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)[source]

Callback for when a successful auth happens.

create_flow_pair(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:
  • dot1x_port (Port) –
  • nfv_sw_port (int) –
  • valve (Valve) –
Returns:

list

failure_handler(address, port_id)[source]

Callback for when a EAP failure happens.

static get_dot1x_port_match_priority(dot1x_port, port_acl_table, valve)[source]

Create the match for eapol coming from the supplicant’s port. :param dot1x_port: supplicant port. :type dot1x_port: Port :param port_acl_table: :type port_acl_table: ValveTable :param valve: :type valve: Valve

Returns:dict containing a match and priority.
static get_nfv_sw_port_match_priority(mac, nfv_sw_port, port_acl_table, valve)[source]

Create the match for eapol coming from the nfv_sw_port. :param mac: the MacAddress of the dot1x (supplicant port) :type mac: str :param nfv_sw_port: :type nfv_sw_port: int :param port_acl_table: :type port_acl_table: ValveTable :param valve: :type valve: Valve

Returns:dict containing a match and priority.
get_valve_and_port(port_id)[source]

Finds the valve and port that this address corresponds to :param port_id: is a macaddress string

logoff_handler(address, port_id)[source]

Callback for when an EAP logoff happens.

port_down(valve, dot1x_port)[source]

Remove the acls added by FaucetDot1x.get_port_acls :param valve: :param dot1x_port:

Returns:list of flowmods
port_up(valve, dot1x_port)[source]

Setup the dot1x forward port acls. :param dot1x_port: :param valve:

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