DOT1x

class trex.emu.emu_plugins.emu_plugin_dot1x.DOT1XPlugin(emu_client)[source]

Defines DOT1x plugin RFC 8415 dot1x client with EAP-MD5 EAP-MSCHAPv2

INIT_JSON_NS = {}
Parameters

Empty.

INIT_JSON_CLIENT = {'dot1x': {'max_start': 2, 'nthash': 'a12db4', 'password': 'pass', 'timeo_idle': 2, 'user': 'username'}}
Parameters
user: string

User name.

password: string

password

nthash: string

Hash string for MSCHAPv2

timeo_idle: uint32

timeout for success in sec

max_start: uint32

max number of retries

get_counters(c_key, cnt_filter=None, zero=True, verbose=True)[source]

Get the DOT1X 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.

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

clear_counters(c_key)[source]

Clear the DOT1X counters of a client.

Parameters
c_key: trex.emu.trex_emu_profile.EMUClientKey

EMUClientKey

Returns

Boolean indicating if clearing was successful.
  • True: Clearing was successful.

  • False: Clearing was not successful.

Raises

TRexError

get_clients_info(c_keys)[source]

Get dot1x clients information.

parameters
c_keys: list of EMUClientKey

see trex.emu.trex_emu_profile.EMUClientKey

return
list: List of clients information
[{‘state’: string, ‘method’: string, ‘eap_version’: int}, {..}]
dot1x_show_counters_line(line)[source]

Show dot1x counters (per client).

tear_down_ns(ns_key)

This function will be called before removing this plugin from namespace.

parameters
ns_key: EMUNamespaceKey

see trex.emu.trex_emu_profile.EMUNamespaceKey

dot1x_show_client_info_line(line)[source]

Show dot1x client info (per 1 client).

dot1x_show_all_line(line)[source]

Show dot1x client info (per 1 ns).

trex.emu.emu_plugins.emu_plugin_dot1x.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.