faucet.faucet_dot1x module

802.1x implementation for FAUCET.

class faucet.faucet_dot1x.FaucetDot1x(logger, metrics, send_flow_msgs)[source]

Bases: object

Wrapper for experimental Chewie 802.1x authenticator.

auth_handler(address, port_id, *args, **kwargs)[source]

Callback for when a successful auth happens.

create_flow_pair(dp_id, dot1x_port, nfv_sw_port, valve)[source]

Creates the pair of flows that redirects the eapol packets to/from the supplicant and nfv port

Parameters
  • dp_id (int) –

  • dot1x_port (Port) –

  • nfv_sw_port (Port) –

  • valve (Valve) –

Returns

list

failure_handler(address, port_id)[source]

Callback for when a EAP failure happens.

log_auth_event(valve, port_num, mac_str, status)[source]

Log an authentication attempt event

log_port_event(event_type, port_type, valve, port_num)[source]

Log a dot1x port event

logoff_handler(address, port_id)[source]

Callback for when an EAP logoff happens.

nfv_sw_port_up(dp_id, dot1x_ports, nfv_sw_port)[source]

Setup the dot1x forward port acls when the nfv_sw_port comes up. :param dp_id: :type dp_id: int :param dot1x_ports: :type dot1x_ports: Iterable of Port objects :param nfv_sw_port: :type nfv_sw_port: Port

Returns

list of flowmods

port_down(dp_id, dot1x_port, nfv_sw_port)[source]

Remove the acls added by FaucetDot1x.get_port_acls :param dp_id: :type dp_id: int :param dot1x_port: :type dot1x_port: Port :param nfv_sw_port: :type nfv_sw_port: Port

Returns

list of flowmods

port_up(dp_id, dot1x_port, nfv_sw_port)[source]

Setup the dot1x forward port acls. :param dp_id: :type dp_id: int :param dot1x_port: :type dot1x_port: Port :param nfv_sw_port: :type nfv_sw_port: Port

Returns

list of flowmods

reset(valves)[source]

Set up a dot1x speaker.

set_mac_str(valve, valve_index, port_num)[source]
Parameters
  • valve (Valve) –

  • valve_index (int) –

  • port_num (int) –

Returns

str

faucet.faucet_dot1x.get_mac_str(valve_index, port_num)[source]

Gets the mac address string for the valve/port combo :param valve_index: The internally used id of the valve. :type valve_index: int :param port_num: port number :type port_num: int

Returns

str