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_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)