class VirtualNetworkFilter implements IFloodlightModule, IVirtualNetworkService, IOFMessageListener {

	@Override
	public void deleteNetwork(String guid) {
		String name = null;
		if (nameToGuid.isEmpty()) {
			log.warn("Could not delete network with ID {}, network doesn't exist",
					guid);
			return;
		}
		for (Entry<String, String> entry : nameToGuid.entrySet()) {
			if (entry.getValue().equals(guid)) {
				name = entry.getKey();
				break;
			}
			log.warn("Could not delete network with ID {}, network doesn't exist", guid);
		}

		if (log.isDebugEnabled())
			log.debug("Deleting network with name {} ID {}", name, guid);

		nameToGuid.remove(name);
		deleteGateway(guid);
		if (vNetsByGuid.get(guid) != null){
			vNetsByGuid.get(guid).clearHosts();
			vNetsByGuid.remove(guid);
		}
		Collection<MacAddress> deleteList = new ArrayList<MacAddress>();
		for (MacAddress host : macToGuid.keySet()) {
			if (macToGuid.get(host).equals(guid)) {
				deleteList.add(host);
			}
		}
		for (MacAddress mac : deleteList) {
			if (log.isDebugEnabled()) {
				log.debug("Removing host {} from network {}", mac.toString(), guid);
			}
			macToGuid.remove(mac);
			for (Entry<String, MacAddress> entry : portToMac.entrySet()) {
				if (entry.getValue().equals(mac)) {
					portToMac.remove(entry.getKey());
					break;
				}
			}
		}
	}

}