Hi Alan,
On 2017年03月01日 08:02, Alan Helal wrote: > Hello guys. Im trying to drop all the packets except the ones from a > whitelist. Here is the code that Im using: > > @set_ev_cls(ofp_event.EventOFPPacketIn, MAIN_DISPATCHER) > def _packet_in_handler(self, ev): > global flag1 > > msg = ev.msg > datapath = msg.datapath > ofproto = datapath.ofproto > > pkt = packet.Packet(msg.data) > eth = pkt.get_protocol(ethernet.ethernet) > > if eth.ethertype == ether_types.ETH_TYPE_LLDP: > # ignore lldp packet > return > dst = eth.dst > src = eth.src > > dpid = datapath.id <http://datapath.id> > self.mac_to_port.setdefault(dpid, {}) > self.add_flow(datapath,0,0, {},0,0,0) #this creates the drop all and > it works It might be depending on what "get stucked" mean though. If you install the DROP flow against all packet here, "table-miss flow entry" will be replaced? Then, I guess switch will stop to send Packet-In message. Thanks, Iwase > self.create_allowed_flows() # this creates the flows for the mac > address in the white list > > The problem is when I run the ryu-manager mycode.py everything works but the > code in the packet in handler. So, if I want to update the whitelist (insert > or delete a mac addres), I have to stop the controller and run again. > > Anyone have an idea how to solve this? > > Best regards, > > > -- > Alan Helal > > > Computer Engineer > CREA-ES 041032/D > Mestrando em Informática - Universidade Federal do Espírito Santo > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > > > > _______________________________________________ > Ryu-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/ryu-devel > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ Ryu-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ryu-devel
