Example #1
0
 def __init__(self, match, ifb, **kwargs):
     U32Filter.__init__(self, match, **kwargs)
     prio = kwargs.get('prio', 2)
     
     protocol = ETH_P_IP
     self.tcm_info = prio << 16 | protocol
     
     if_index = get_if_index(ifb)
     flow = u32_classid(convert_handle(0x10001))
     action = u32_mirred_action(if_index)
     self.attrs.append(Attr(TCA_OPTIONS,
                            flow.pack()+action.pack()+self.selector.pack()))
Example #2
0
 def set_shaping(self):
     self.if_index = utils.get_if_index(self.name)
     self.execute()
     Interface.set_shaping(self)
Example #3
0
 def __init__(self, name):
     self.name = name
     self.if_index = utils.get_if_index(self.name)