Added ability to configure a global vlan used for all ARP packets sent from the controller
diff --git a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
index 79cca4b..28f97ce 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
@@ -122,6 +122,7 @@
private Map<InetAddress, BgpPeer> bgpPeers;
private SwitchPort bgpdAttachmentPoint;
private MACAddress bgpdMacAddress;
+ private short vlan;
//True when all switches have connected
private volatile boolean switchesConnected = false;
@@ -183,8 +184,8 @@
}
}
- private void readGatewaysConfiguration(String gatewaysFilename){
- File gatewaysFile = new File(gatewaysFilename);
+ private void readConfiguration(String configFilename){
+ File gatewaysFile = new File(configFilename);
ObjectMapper mapper = new ObjectMapper();
try {
@@ -205,6 +206,7 @@
new Port(config.getBgpdAttachmentPort()));
bgpdMacAddress = config.getBgpdMacAddress();
+ vlan = config.getVlan();
} catch (JsonParseException e) {
log.error("Error in JSON file", e);
System.exit(1);
@@ -313,7 +315,7 @@
}
log.debug("Config file set to {}", configFilename);
- readGatewaysConfiguration(configFilename);
+ readConfiguration(configFilename);
}
@Override
@@ -322,7 +324,7 @@
topologyService.addListener(this);
floodlightProvider.addOFSwitchListener(this);
- proxyArp.startUp();
+ proxyArp.startUp(vlan);
floodlightProvider.addOFMessageListener(OFType.PACKET_IN, proxyArp);
diff --git a/src/main/java/net/onrc/onos/ofcontroller/bgproute/Configuration.java b/src/main/java/net/onrc/onos/ofcontroller/bgproute/Configuration.java
index 1d90edc..7fabc72 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/bgproute/Configuration.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/bgproute/Configuration.java
@@ -12,6 +12,7 @@
private long bgpdAttachmentDpid;
private short bgpdAttachmentPort;
private MACAddress bgpdMacAddress;
+ private short vlan;
private List<String> switches;
private List<Interface> interfaces;
private List<BgpPeer> peers;
@@ -50,6 +51,15 @@
public List<String> getSwitches() {
return Collections.unmodifiableList(switches);
}
+
+ @JsonProperty("vlan")
+ public void setVlan(short vlan) {
+ this.vlan = vlan;
+ }
+
+ public short getVlan() {
+ return vlan;
+ }
@JsonProperty("switches")
public void setSwitches(List<String> switches) {