DHCPv6¶
- class trex.emu.emu_plugins.emu_plugin_dhcpv6.DHCPV6Plugin(emu_client)[source]¶
Defines DHCPv6 plugin based on DHCPv6
Implemented based on RFC 8415 Client
- INIT_JSON_NS = {'dhcpv6': {}}¶
- Parameters
Empty.
- INIT_JSON_CLIENT = {'dhcpv6': {'timerd': 5, 'timero': 10}}¶
- Parameters
- timerd: uint32
DHCP timer discover in seconds.
- timero: uint32
DHCP timer offer in seconds.
- options: dict
Dictionary that contains DHCPv6 Options:
- Options
- rm_or: bool
Remove default Option Request (Should add another Option Request using sol, req)
- rm_vc: bool
Remove default Vendor Class Option
- sol: List[List[byte]]
List of byte lists. Each byte list represents an Option that will be added to a Solicit Packet.
Each byte list should be of the format [Code][Data] (pay attention, no length).
For example:
"sol": [ [0, 6, 0, 23, 0, 24, 0, 243, 0, 242, 0, 59, 0, 242, 0, 39], # Option Request - Code 6 [0, 15, 98, 101, 115] # User Class Option - Code 15 ]
- req: List[List[byte]]
List of byte lists. Each byte list represents an Option that will be added to a Request Packet.
- rel: List[List[byte]]
List of byte lists. Each byte list represents an Option that will be added to a Release Packet.
- reb: List[List[byte]]
List of byte lists. Each byte list represents an Option that will be added to a Rebind Packet.
- ren: List[List[byte]]
List of byte lists. Each byte list represents an Option that will be added to a Renew Packet.
- get_counters(c_key, cnt_filter=None, zero=True, verbose=True)[source]¶
Get the DHCPV6 counters of a client.
- Parameters
- c_key:
trex.emu.trex_emu_profile.EMUClientKey EMUClientKey
- cnt_filter: list
List of counters types as strings. i.e: [‘INFO’, ‘ERROR’, ‘WARNING’]. Default is None, means no filter. If verbosity is off, this filter can’t be used.
- zero: bool
Get zero values, default is True.
- verbose: bool
Show verbose version of each counter, default is True.
- c_key:
- Returns
Dictionary of all wanted counters. When verbose is True, each plugin contains a list of counter dictionaries.
{'pluginName': [{'help': 'Explanation 1', 'info': 'INFO', 'name': 'counterOne', 'unit': 'pkts', 'value': 8, 'zero': False}, {'help': 'Explanation 2', 'info': 'ERROR', 'name': 'counterTwo', 'unit': 'pkts', 'value': 6, 'zero': False}]}
When verbose is False, each plugins returns a dictionary of counterName, value pairs.
{'pluginName': {'counterOne': 8, 'counterTwo': 6}}
- Raises
TRexError
- tear_down_ns(ns_key)¶
This function will be called before removing this plugin from namespace.
- parameters
- ns_key: EMUNamespaceKey
- clear_counters(c_key)[source]¶
Clear the DHCPV6 counters of a client.
- Parameters
- c_key:
trex.emu.trex_emu_profile.EMUClientKey EMUClientKey
- c_key:
- Returns
- Boolean indicating if clearing was successful.
True: Clearing was successful.
False: Clearing was not successful.
- Raises
TRexError
- trex.emu.emu_plugins.emu_plugin_dhcpv6.wraps(func)¶
Replaces functools.wraps in order to undo wrapping.
Can be used to preserve the decorated function’s signature in the documentation generated by Sphinx.