Dear Sir/Madam,

I'm trying to drop packets that match an IP address using this code

> class RuleBase(object):
>     def __init__(self, dp: Datapath, *args, **kwargs):
>         self.dp = dp
>         self.ofproto = self.dp.ofproto
>         self.parser = self.dp.ofproto_parser
>         self.match = kwargs
>         self.inst = []
>
>     def add_flow(self):
>         match = self.parser.OFPMatch(**self.match)
>         msg = self.parser.OFPFlowMod(
>             table_id=FIREWALL_TABLE_ID,
>             datapath=self.dp,
>             priority=10,
>             command=self.ofproto.OFPFC_ADD,
>             match=match,
>             instructions=self.inst
>         )
>         self.dp.send_msg(msg)
>
>
> class DenyRule(RuleBase):
>     def __init__(self, *args, **kwargs):
>         super(DenyRule, self).__init__(*args, **kwargs)
>         self.inst = [
>
 self.parser.OFPInstructionActions(self.ofproto.OFPIT_APPLY_ACTIONS, [])
>         ]


I'm using it in switch_features_handler as follows:
> msg = ev.msg
> dp = msg.datapath
> d_rule = DenyRule(dp=dp, ipv6_dst='2001:db8:bd05:1d2:288a:1fc0:1:10ee')
> d_rule.add_flow()



But, I get the following output:

move onto main mode
EventOFPErrorMsg received.
version=0x4, msg_type=0x1, msg_len=0x4c, xid=0xa6de76ce
 `-- msg_type: OFPT_ERROR(1)
OFPErrorMsg(type=0x4, code=0x9,
data=b'\x04\x0e\x00\x50\xa6\xde\x76\xce\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0a\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x18\x80\x00\x36\x10\x20\x01\x0d\xb8\xbd\x05\x01\xd2')


 |-- type: OFPET_BAD_MATCH(4)
 |-- code: OFPBMC_BAD_PREREQ(9)
 `-- data: version=0x4, msg_type=0xe, msg_len=0x50, xid=0xa6de76ce
     `-- msg_type: OFPT_FLOW_MOD(14)



Best Regards,
Maged
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to