New feature: packet capture for the Ethernet hub and Ethernet, ATM and Frame relay switches.

This commit is contained in:
grossmj
2014-06-27 07:26:47 -06:00
parent 606f773f3d
commit 33787d486a
13 changed files with 776 additions and 6 deletions

View File

@ -1578,11 +1578,11 @@ class Router(object):
nio.bind_filter("both", "capture")
nio.setup_filter("both", "{} {}".format(data_link_type, output_file))
log.info("router {name} [id={id}]: capturing on port {slot_id}/{port_id}".format(name=self._name,
id=self._id,
nio_name=nio.name,
slot_id=slot_id,
port_id=port_id))
log.info("router {name} [id={id}]: starting packet capture on port {slot_id}/{port_id}".format(name=self._name,
id=self._id,
nio_name=nio.name,
slot_id=slot_id,
port_id=port_id))
def stop_capture(self, slot_id, port_id):
"""
@ -1604,6 +1604,12 @@ class Router(object):
nio = adapter.get_nio(port_id)
nio.unbind_filter("both")
log.info("router {name} [id={id}]: stopping packet capture on port {slot_id}/{port_id}".format(name=self._name,
id=self._id,
nio_name=nio.name,
slot_id=slot_id,
port_id=port_id))
def _create_slots(self, numslots):
"""
Creates the appropriate number of slots for this router.