test_class.declarator: vns
test_class.modifier: protected
test_class.original_string: protected VirtualNetworkFilter vns;
test_class.type: VirtualNetworkFilter
test_class.var_name: vns
test_class.declarator: deviceService
test_class.modifier: protected
test_class.original_string: protected MockDeviceManager deviceService;
test_class.type: MockDeviceManager
test_class.var_name: deviceService
test_class.declarator: guid1 = "guid1"
test_class.modifier: protected static
test_class.original_string: protected static String guid1 = "guid1";
test_class.type: String
test_class.var_name: guid1
test_class.declarator: net1 = "net1"
test_class.modifier: protected static
test_class.original_string: protected static String net1 = "net1";
test_class.type: String
test_class.var_name: net1
test_class.declarator: gw1 = "1.1.1.1"
test_class.modifier: protected static
test_class.original_string: protected static String gw1 = "1.1.1.1";
test_class.type: String
test_class.var_name: gw1
test_class.declarator: guid2 = "guid2"
test_class.modifier: protected static
test_class.original_string: protected static String guid2 = "guid2";
test_class.type: String
test_class.var_name: guid2
test_class.declarator: net2 = "net2"
test_class.modifier: protected static
test_class.original_string: protected static String net2 = "net2";
test_class.type: String
test_class.var_name: net2
test_class.declarator: guid3 = "guid3"
test_class.modifier: protected static
test_class.original_string: protected static String guid3 = "guid3";
test_class.type: String
test_class.var_name: guid3
test_class.declarator: net3 = "net3"
test_class.modifier: protected static
test_class.original_string: protected static String net3 = "net3";
test_class.type: String
test_class.var_name: net3
test_class.declarator: gw2 = "2.2.2.2"
test_class.modifier: protected static
test_class.original_string: protected static String gw2 = "2.2.2.2";
test_class.type: String
test_class.var_name: gw2
test_class.declarator: mac1 = MacAddress.of("00:11:22:33:44:55")
test_class.modifier: protected static
test_class.original_string: protected static MacAddress mac1 = MacAddress.of("00:11:22:33:44:55");
test_class.type: MacAddress
test_class.var_name: mac1
test_class.declarator: mac2 = MacAddress.of("00:11:22:33:44:66")
test_class.modifier: protected static
test_class.original_string: protected static MacAddress mac2 = MacAddress.of("00:11:22:33:44:66");
test_class.type: MacAddress
test_class.var_name: mac2
test_class.declarator: mac3 = MacAddress.of("00:11:22:33:44:77")
test_class.modifier: protected static
test_class.original_string: protected static MacAddress mac3 = MacAddress.of("00:11:22:33:44:77");
test_class.type: MacAddress
test_class.var_name: mac3
test_class.declarator: mac4 = MacAddress.of("00:11:22:33:44:88")
test_class.modifier: protected static
test_class.original_string: protected static MacAddress mac4 = MacAddress.of("00:11:22:33:44:88");
test_class.type: MacAddress
test_class.var_name: mac4
test_class.declarator: hostPort1 = "port1"
test_class.modifier: protected static
test_class.original_string: protected static String hostPort1 = "port1";
test_class.type: String
test_class.var_name: hostPort1
test_class.declarator: hostPort2 = "port2"
test_class.modifier: protected static
test_class.original_string: protected static String hostPort2 = "port2";
test_class.type: String
test_class.var_name: hostPort2
test_class.declarator: hostPort3 = "port3"
test_class.modifier: protected static
test_class.original_string: protected static String hostPort3 = "port3";
test_class.type: String
test_class.var_name: hostPort3
test_class.declarator: hostPort4 = "port4"
test_class.modifier: protected static
test_class.original_string: protected static String hostPort4 = "port4";
test_class.type: String
test_class.var_name: hostPort4
test_class.declarator: sw1
test_class.modifier: protected
test_class.original_string: protected IOFSwitch sw1;
test_class.type: IOFSwitch
test_class.var_name: sw1
test_class.declarator: cntx
test_class.modifier: protected
test_class.original_string: protected FloodlightContext cntx;
test_class.type: FloodlightContext
test_class.var_name: cntx
test_class.declarator: mac1ToMac2PacketIn
test_class.modifier: protected
test_class.original_string: protected OFPacketIn mac1ToMac2PacketIn;
test_class.type: OFPacketIn
test_class.var_name: mac1ToMac2PacketIn
test_class.declarator: mac1ToMac2PacketIntestPacket
test_class.modifier: protected
test_class.original_string: protected IPacket mac1ToMac2PacketIntestPacket;
test_class.type: IPacket
test_class.var_name: mac1ToMac2PacketIntestPacket
test_class.declarator: mac1ToMac2PacketIntestPacketSerialized
test_class.modifier: protected
test_class.original_string: protected byte[] mac1ToMac2PacketIntestPacketSerialized;
test_class.type: byte[]
test_class.var_name: mac1ToMac2PacketIntestPacketSerialized
test_class.declarator: mac1ToMac4PacketIn
test_class.modifier: protected
test_class.original_string: protected OFPacketIn mac1ToMac4PacketIn;
test_class.type: OFPacketIn
test_class.var_name: mac1ToMac4PacketIn
test_class.declarator: mac1ToMac4PacketIntestPacket
test_class.modifier: protected
test_class.original_string: protected IPacket mac1ToMac4PacketIntestPacket;
test_class.type: IPacket
test_class.var_name: mac1ToMac4PacketIntestPacket
test_class.declarator: mac1ToMac4PacketIntestPacketSerialized
test_class.modifier: protected
test_class.original_string: protected byte[] mac1ToMac4PacketIntestPacketSerialized;
test_class.type: byte[]
test_class.var_name: mac1ToMac4PacketIntestPacketSerialized
test_class.declarator: mac1ToGwPacketIn
test_class.modifier: protected
test_class.original_string: protected OFPacketIn mac1ToGwPacketIn;
test_class.type: OFPacketIn
test_class.var_name: mac1ToGwPacketIn
test_class.declarator: mac1ToGwPacketIntestPacket
test_class.modifier: protected
test_class.original_string: protected IPacket mac1ToGwPacketIntestPacket;
test_class.type: IPacket
test_class.var_name: mac1ToGwPacketIntestPacket
test_class.declarator: mac1ToGwPacketIntestPacketSerialized
test_class.modifier: protected
test_class.original_string: protected byte[] mac1ToGwPacketIntestPacketSerialized;
test_class.type: byte[]
test_class.var_name: mac1ToGwPacketIntestPacketSerialized
test_class.declarator: packetInDHCPDiscoveryRequest
test_class.modifier: protected
test_class.original_string: protected OFPacketIn packetInDHCPDiscoveryRequest;
test_class.type: OFPacketIn
test_class.var_name: packetInDHCPDiscoveryRequest
test_class.declarator: mockSyncService
test_class.modifier: private
test_class.original_string: private MockSyncService mockSyncService;
test_class.type: MockSyncService
test_class.var_name: mockSyncService
test_class.file: src/agents/apps/floodlight/floodlight-1.0/src/test/java/net/floodlightcontroller/virtualnetwork/VirtualNetworkFilterTest.java
test_class.identifier: VirtualNetworkFilterTest
test_class.superclass: extends FloodlightTestCase
test_case.body: @Test
      public void testModifyNetwork() {
          // Create some networks
  
          testCreateNetwork();
          // Modify net2 to add a gateway
          vns.createNetwork(guid2, net2, IPv4Address.of(gw1));
          assertTrue(vns.nameToGuid.get(net2).equals(guid2));
          assertTrue(vns.guidToGateway.get(guid2).equals(IPv4Address.of(gw1)));
          assertTrue(vns.gatewayToGuid.get(IPv4Address.of(gw1)).contains(guid1));
          assertTrue(vns.gatewayToGuid.get(IPv4Address.of(gw1)).contains(guid2));
          assertTrue(vns.gatewayToGuid.get(IPv4Address.of(gw1)).contains(guid3));
          assertTrue(vns.gatewayToGuid.get(IPv4Address.of(gw1)).size() == 3);
          // Modify net2 to change it's name
          vns.createNetwork(guid2, "newnet2", null);
          // Make sure the gateway is still there
          assertTrue(vns.gatewayToGuid.get(IPv4Address.of(gw1)).contains(guid2));
          assertTrue(vns.vNetsByGuid.get(guid2).gateway.equals(gw1));
          // make sure the new name mapping was learned
          assertTrue(vns.nameToGuid.get("newnet2").equals(guid2));
          assertTrue(vns.vNetsByGuid.get(guid2).name.equals("newnet2"));
          // and the old one was deleted
          assertFalse(vns.nameToGuid.containsKey(net2));
      }
test_case.class_method_signature: VirtualNetworkFilterTest.testModifyNetwork()
test_case.full_signature: @Test public void testModifyNetwork()
test_case.identifier: testModifyNetwork
test_case.invocations: testCreateNetwork createNetwork of assertTrue equals get assertTrue equals get of assertTrue contains get of assertTrue contains get of assertTrue contains get of assertTrue size get of createNetwork assertTrue contains get of assertTrue equals get assertTrue equals get assertTrue equals get assertFalse containsKey
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testModifyNetwork()
focal_class.declarator: log = LoggerFactory.getLogger(VirtualNetworkFilter.class)
focal_class.modifier: protected static
focal_class.original_string: protected static Logger log = LoggerFactory.getLogger(VirtualNetworkFilter.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: APP_ID = 20
focal_class.modifier: private static final
focal_class.original_string: private static final short APP_ID = 20;
focal_class.type: short
focal_class.var_name: APP_ID
focal_class.declarator: floodlightProviderService
focal_class.original_string: IFloodlightProviderService floodlightProviderService;
focal_class.type: IFloodlightProviderService
focal_class.var_name: floodlightProviderService
focal_class.declarator: restApiService
focal_class.original_string: IRestApiService restApiService;
focal_class.type: IRestApiService
focal_class.var_name: restApiService
focal_class.declarator: deviceService
focal_class.original_string: IDeviceService deviceService;
focal_class.type: IDeviceService
focal_class.var_name: deviceService
focal_class.declarator: vNetsByGuid
focal_class.modifier: protected
focal_class.original_string: protected Map<String, VirtualNetwork> vNetsByGuid;
focal_class.type: Map<String, VirtualNetwork>
focal_class.var_name: vNetsByGuid
focal_class.declarator: nameToGuid
focal_class.modifier: protected
focal_class.original_string: protected Map<String, String> nameToGuid;
focal_class.type: Map<String, String>
focal_class.var_name: nameToGuid
focal_class.declarator: guidToGateway
focal_class.modifier: protected
focal_class.original_string: protected Map<String, IPv4Address> guidToGateway;
focal_class.type: Map<String, IPv4Address>
focal_class.var_name: guidToGateway
focal_class.declarator: gatewayToGuid
focal_class.modifier: protected
focal_class.original_string: protected Map<IPv4Address, Set<String>> gatewayToGuid;
focal_class.type: Map<IPv4Address, Set<String>>
focal_class.var_name: gatewayToGuid
focal_class.declarator: macToGateway
focal_class.modifier: protected
focal_class.original_string: protected Map<MacAddress, IPv4Address> macToGateway;
focal_class.type: Map<MacAddress, IPv4Address>
focal_class.var_name: macToGateway
focal_class.declarator: macToGuid
focal_class.modifier: protected
focal_class.original_string: protected Map<MacAddress, String> macToGuid;
focal_class.type: Map<MacAddress, String>
focal_class.var_name: macToGuid
focal_class.declarator: portToMac
focal_class.modifier: protected
focal_class.original_string: protected Map<String, MacAddress> portToMac;
focal_class.type: Map<String, MacAddress>
focal_class.var_name: portToMac
focal_class.declarator: deviceListener
focal_class.modifier: protected
focal_class.original_string: protected DeviceListenerImpl deviceListener;
focal_class.type: DeviceListenerImpl
focal_class.var_name: deviceListener
focal_class.file: src/agents/apps/floodlight/floodlight-1.0/src/main/java/net/floodlightcontroller/virtualnetwork/VirtualNetworkFilter.java
focal_class.identifier: VirtualNetworkFilter
focal_class.interfaces: implements IFloodlightModule, IVirtualNetworkService, IOFMessageListener
focal_class.class_method_signature: VirtualNetworkFilter.addGateway(String guid, IPv4Address ip)
focal_class.full_signature: protected void addGateway(String guid, IPv4Address ip)
focal_class.identifier: addGateway
focal_class.modifiers: protected
focal_class.parameters: (String guid, IPv4Address ip)
focal_class.return: void
focal_class.signature: void addGateway(String guid, IPv4Address ip)
focal_class.class_method_signature: VirtualNetworkFilter.deleteGateway(String guid)
focal_class.full_signature: protected void deleteGateway(String guid)
focal_class.identifier: deleteGateway
focal_class.modifiers: protected
focal_class.parameters: (String guid)
focal_class.return: void
focal_class.signature: void deleteGateway(String guid)
focal_class.class_method_signature: VirtualNetworkFilter.createNetwork(String guid, String network, IPv4Address gateway)
focal_class.full_signature: @Override public void createNetwork(String guid, String network, IPv4Address gateway)
focal_class.identifier: createNetwork
focal_class.modifiers: @Override public
focal_class.parameters: (String guid, String network, IPv4Address gateway)
focal_class.return: void
focal_class.signature: void createNetwork(String guid, String network, IPv4Address gateway)
focal_class.class_method_signature: VirtualNetworkFilter.deleteNetwork(String guid)
focal_class.full_signature: @Override public void deleteNetwork(String guid)
focal_class.identifier: deleteNetwork
focal_class.modifiers: @Override public
focal_class.parameters: (String guid)
focal_class.return: void
focal_class.signature: void deleteNetwork(String guid)
focal_class.class_method_signature: VirtualNetworkFilter.addHost(MacAddress mac, String guid, String port)
focal_class.full_signature: @Override public void addHost(MacAddress mac, String guid, String port)
focal_class.identifier: addHost
focal_class.modifiers: @Override public
focal_class.parameters: (MacAddress mac, String guid, String port)
focal_class.return: void
focal_class.signature: void addHost(MacAddress mac, String guid, String port)
focal_class.class_method_signature: VirtualNetworkFilter.deleteHost(MacAddress mac, String port)
focal_class.full_signature: @Override public void deleteHost(MacAddress mac, String port)
focal_class.identifier: deleteHost
focal_class.modifiers: @Override public
focal_class.parameters: (MacAddress mac, String port)
focal_class.return: void
focal_class.signature: void deleteHost(MacAddress mac, String port)
focal_class.class_method_signature: VirtualNetworkFilter.getModuleServices()
focal_class.full_signature: @Override public Collection<Class<? extends IFloodlightService>> getModuleServices()
focal_class.identifier: getModuleServices
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<Class<? extends IFloodlightService>>
focal_class.signature: Collection<Class<? extends IFloodlightService>> getModuleServices()
focal_class.class_method_signature: VirtualNetworkFilter.getServiceImpls()
focal_class.full_signature: @Override public Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls()
focal_class.identifier: getServiceImpls
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Map<Class<? extends IFloodlightService>, IFloodlightService>
focal_class.signature: Map<Class<? extends IFloodlightService>, IFloodlightService> getServiceImpls()
focal_class.class_method_signature: VirtualNetworkFilter.getModuleDependencies()
focal_class.full_signature: @Override public Collection<Class<? extends IFloodlightService>> getModuleDependencies()
focal_class.identifier: getModuleDependencies
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<Class<? extends IFloodlightService>>
focal_class.signature: Collection<Class<? extends IFloodlightService>> getModuleDependencies()
focal_class.class_method_signature: VirtualNetworkFilter.init(FloodlightModuleContext context)
focal_class.full_signature: @Override public void init(FloodlightModuleContext context)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (FloodlightModuleContext context)
focal_class.return: void
focal_class.signature: void init(FloodlightModuleContext context)
focal_class.class_method_signature: VirtualNetworkFilter.startUp(FloodlightModuleContext context)
focal_class.full_signature: @Override public void startUp(FloodlightModuleContext context)
focal_class.identifier: startUp
focal_class.modifiers: @Override public
focal_class.parameters: (FloodlightModuleContext context)
focal_class.return: void
focal_class.signature: void startUp(FloodlightModuleContext context)
focal_class.class_method_signature: VirtualNetworkFilter.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: VirtualNetworkFilter.isCallbackOrderingPrereq(OFType type, String name)
focal_class.full_signature: @Override public boolean isCallbackOrderingPrereq(OFType type, String name)
focal_class.identifier: isCallbackOrderingPrereq
focal_class.modifiers: @Override public
focal_class.parameters: (OFType type, String name)
focal_class.return: boolean
focal_class.signature: boolean isCallbackOrderingPrereq(OFType type, String name)
focal_class.class_method_signature: VirtualNetworkFilter.isCallbackOrderingPostreq(OFType type, String name)
focal_class.full_signature: @Override public boolean isCallbackOrderingPostreq(OFType type, String name)
focal_class.identifier: isCallbackOrderingPostreq
focal_class.modifiers: @Override public
focal_class.parameters: (OFType type, String name)
focal_class.return: boolean
focal_class.signature: boolean isCallbackOrderingPostreq(OFType type, String name)
focal_class.class_method_signature: VirtualNetworkFilter.receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
focal_class.full_signature: @Override public Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
focal_class.identifier: receive
focal_class.modifiers: @Override public
focal_class.parameters: (IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
focal_class.return: Command
focal_class.signature: Command receive(IOFSwitch sw, OFMessage msg, FloodlightContext cntx)
focal_class.class_method_signature: VirtualNetworkFilter.isDefaultGateway(Ethernet frame)
focal_class.full_signature: protected boolean isDefaultGateway(Ethernet frame)
focal_class.identifier: isDefaultGateway
focal_class.modifiers: protected
focal_class.parameters: (Ethernet frame)
focal_class.return: boolean
focal_class.signature: boolean isDefaultGateway(Ethernet frame)
focal_class.class_method_signature: VirtualNetworkFilter.oneSameNetwork(MacAddress m1, MacAddress m2)
focal_class.full_signature: protected boolean oneSameNetwork(MacAddress m1, MacAddress m2)
focal_class.identifier: oneSameNetwork
focal_class.modifiers: protected
focal_class.parameters: (MacAddress m1, MacAddress m2)
focal_class.return: boolean
focal_class.signature: boolean oneSameNetwork(MacAddress m1, MacAddress m2)
focal_class.class_method_signature: VirtualNetworkFilter.isDhcpPacket(Ethernet frame)
focal_class.full_signature: protected boolean isDhcpPacket(Ethernet frame)
focal_class.identifier: isDhcpPacket
focal_class.modifiers: protected
focal_class.parameters: (Ethernet frame)
focal_class.return: boolean
focal_class.signature: boolean isDhcpPacket(Ethernet frame)
focal_class.class_method_signature: VirtualNetworkFilter.processPacketIn(IOFSwitch sw, OFPacketIn msg, FloodlightContext cntx)
focal_class.full_signature: protected Command processPacketIn(IOFSwitch sw, OFPacketIn msg, FloodlightContext cntx)
focal_class.identifier: processPacketIn
focal_class.modifiers: protected
focal_class.parameters: (IOFSwitch sw, OFPacketIn msg, FloodlightContext cntx)
focal_class.return: Command
focal_class.signature: Command processPacketIn(IOFSwitch sw, OFPacketIn msg, FloodlightContext cntx)
focal_class.class_method_signature: VirtualNetworkFilter.doDropFlow(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx)
focal_class.full_signature: protected void doDropFlow(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx)
focal_class.identifier: doDropFlow
focal_class.modifiers: protected
focal_class.parameters: (IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx)
focal_class.return: void
focal_class.signature: void doDropFlow(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx)
focal_class.class_method_signature: VirtualNetworkFilter.listNetworks()
focal_class.full_signature: @Override public Collection <VirtualNetwork> listNetworks()
focal_class.identifier: listNetworks
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection <VirtualNetwork>
focal_class.signature: Collection <VirtualNetwork> listNetworks()
focal_method.body: @Override
  	public void createNetwork(String guid, String network, IPv4Address gateway) {
  		if (log.isDebugEnabled()) {
  			String gw = null;
  			try {
  				gw = gateway.toString();
  			} catch (Exception e) {
  				// fail silently
  			}
  			log.debug("Creating network {} with ID {} and gateway {}",
  					new Object[] {network, guid, gw});
  		}
  
  		if (!nameToGuid.isEmpty()) {
  			// We have to iterate all the networks to handle name/gateway changes
  			for (Entry<String, String> entry : nameToGuid.entrySet()) {
  				if (entry.getValue().equals(guid)) {
  					nameToGuid.remove(entry.getKey());
  					break;
  				}
  			}
  		}
  		if(network != null)
  			nameToGuid.put(network, guid);
  		if (vNetsByGuid.containsKey(guid))
  			vNetsByGuid.get(guid).setName(network); //network already exists, just updating name
  		else
  			vNetsByGuid.put(guid, new VirtualNetwork(network, guid)); //new network
  
  		// If they don't specify a new gateway the old one will be preserved
  		if ((gateway != null) && (gateway.getInt() != 0)) {
  			addGateway(guid, gateway);
  			if (vNetsByGuid.get(guid) != null)
  				vNetsByGuid.get(guid).setGateway(gateway.toString());
  		}
  	}
focal_method.class_method_signature: VirtualNetworkFilter.createNetwork(String guid, String network, IPv4Address gateway)
focal_method.full_signature: @Override public void createNetwork(String guid, String network, IPv4Address gateway)
focal_method.identifier: createNetwork
focal_method.invocations: isDebugEnabled toString debug isEmpty entrySet equals getValue remove getKey put containsKey setName get put getInt addGateway get setGateway get toString
focal_method.modifiers: @Override public
focal_method.parameters: (String guid, String network, IPv4Address gateway)
focal_method.return: void
focal_method.signature: void createNetwork(String guid, String network, IPv4Address gateway)