ofp_pktinfilter: add 'logging' option
When packet_in_filter discards a packet, it is always logging. However, it may be felt noisy. Signed-off-by: Satoshi Kobayashi <satoshi-k@stratosphere.co.jp> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
aa21f3d052
commit
9e8e241652
@ -23,11 +23,12 @@ from ryu.lib.packet import packet
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def packet_in_filter(cls, args=None):
|
def packet_in_filter(cls, args=None, logging=False):
|
||||||
def _packet_in_filter(packet_in_handler):
|
def _packet_in_filter(packet_in_handler):
|
||||||
def __packet_in_filter(self, ev):
|
def __packet_in_filter(self, ev):
|
||||||
pkt = packet.Packet(ev.msg.data)
|
pkt = packet.Packet(ev.msg.data)
|
||||||
if not packet_in_handler.pkt_in_filter.filter(pkt):
|
if not packet_in_handler.pkt_in_filter.filter(pkt):
|
||||||
|
if logging:
|
||||||
LOG.debug('The packet is discarded by %s: %s' % (cls, pkt))
|
LOG.debug('The packet is discarded by %s: %s' % (cls, pkt))
|
||||||
return
|
return
|
||||||
return packet_in_handler(self, ev)
|
return packet_in_handler(self, ev)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user