def _handle_PacketInARP(self, event): inport = event.port arppkt = None # If this an ARP Packet srcd at the server, # Then we drop it not to confuse the MAC learning # At the hosts if packetArpSrcIp(self.packet, self._serverip, log): log.info("DROP ARP Packet From Server!") return # XXX If this is an ARP Request for the server iP # create new ARP request and save it in arppkt # XXX If this is an ARP Reply from the proxy # create new ARP reply and save it in arppkt # If we haven't created a new arp packet, send the one we # received if arppkt is None: SimpleL2LearningSwitch._handle_PacketIn(self, event) return # Send a packet out with the ARP msg = of.ofp_packet_out() msg.actions.append(of.ofp_action_output(port=of.OFPP_FLOOD)) msg.data = arppkt.pack() msg.in_port = inport self.connection.send(msg)
def __init__(self, connection, config): SimpleL2LearningSwitch.__init__(self, connection, False) self._connection = connection; self._serverip = config['server_ip'] self._serverport = int(config['server_port']) self._proxyip = config['proxy_ip'] self._proxyport = int(config['proxy_port'])
def __init__(self, connection, config): SimpleL2LearningSwitch.__init__(self, connection, False) self._connection = connection self._serverip = config['server_ip'] self._serverport = int(config['server_port']) self._proxyip = config['proxy_ip'] self._proxyport = int(config['proxy_port'])
def _handle_PacketInARP(self, event) : inport = event.port arppkt = None # If this an ARP Packet srcd at the server, # Then we drop it not to confuse the MAC learning # At the hosts if packetArpSrcIp(self.packet, self._serverip, log): log.info("DROP ARP Packet From Server!") return # XXX If this is an ARP Request for the server iP # create new ARP request and save it in arppkt # XXX If this is an ARP Reply from the proxy # create new ARP reply and save it in arppkt # If we haven't created a new arp packet, send the one we # received if arppkt is None : SimpleL2LearningSwitch._handle_PacketIn(self, event) return # Send a packet out with the ARP msg = of.ofp_packet_out() msg.actions.append(of.ofp_action_output(port = of.OFPP_FLOOD)) msg.data = arppkt.pack() msg.in_port = inport self.connection.send(msg)
def _handle_PacketIn(self, event): log.debug("Got a packet : " + str(event.parsed)) self.packet = event.parsed self.event = event self.macLearningHandle() if packetIsTCP(self.packet, log): self._handle_PacketInTCP(event) return SimpleL2LearningSwitch._handle_PacketIn(self, event)
def _handle_PacketIn(self, event): log.debug("Got a packet : " + str(event.parsed)) self.packet = event.parsed self.event = event self.macLearningHandle() if packetIsTCP(self.packet, log) : self._handle_PacketInTCP(event) return SimpleL2LearningSwitch._handle_PacketIn(self, event)
def __init__(self, connection, duplicate_port): SimpleL2LearningSwitch.__init__(self, connection, False) self._connection = connection; self._duplicate_port=duplicate_port self._of_duplicate_port=getOpenFlowPort(connection, duplicate_port)
def __init__(self, connection, config): SimpleL2LearningSwitch.__init__(self, connection, False) self._connection = connection self._serverip = config['server_ip'] self._origport = int(config['orig_port']) self._forwport = int(config['forw_port'])
def __init__(self, connection, src_ip, dst_port): SimpleL2LearningSwitch.__init__(self, connection, False) self._connection = connection self._src_ip = src_ip self._dst_port = getOpenFlowPort(connection, dst_port)
def __init__(self, connection, config): SimpleL2LearningSwitch.__init__(self, connection, False) self._connection = connection; self._serverip = config['server_ip'] self._origport = int(config['orig_port']) self._forwport = int(config['forw_port'])