faucet.port module

Port configuration.

class faucet.port.Port(_id, dp_id, conf=None)[source]

Bases: faucet.conf.Conf

Stores state for ports, including the configuration.

acl_in = None
acls_in = None
check_config()[source]

Check config at instantiation time for errors, typically via assert.

defaults = {'acl_in': None, 'acls_in': None, 'description': None, 'dot1x': False, 'enabled': True, 'hairpin': False, 'lacp': 0, 'lldp_beacon': {}, 'loop_protect': False, 'max_hosts': 255, 'max_lldp_lost': 3, 'mirror': None, 'name': None, 'native_vlan': None, 'number': None, 'opstatus_reconf': True, 'output_only': False, 'override_output_port': None, 'permanent_learn': False, 'receive_lldp': False, 'stack': None, 'tagged_vlans': None, 'unicast_flood': True}
defaults_types = {'acl_in': (<class 'str'>, <class 'int'>), 'acls_in': <class 'list'>, 'description': <class 'str'>, 'dot1x': <class 'bool'>, 'enabled': <class 'bool'>, 'hairpin': <class 'bool'>, 'lacp': <class 'int'>, 'lldp_beacon': <class 'dict'>, 'loop_protect': <class 'bool'>, 'max_hosts': <class 'int'>, 'mirror': (<class 'list'>, <class 'str'>, <class 'int'>), 'name': <class 'str'>, 'native_vlan': (<class 'str'>, <class 'int'>), 'number': <class 'int'>, 'opstatus_reconf': <class 'bool'>, 'output_only': <class 'bool'>, 'override_output_port': (<class 'str'>, <class 'int'>), 'permanent_learn': <class 'bool'>, 'receive_lldp': <class 'bool'>, 'stack': <class 'dict'>, 'tagged_vlans': <class 'list'>, 'unicast_flood': <class 'bool'>}
description = None
dp_id = None
dyn_lacp_up = None
dyn_lacp_updated_time = None
dyn_last_ban_time = None
dyn_last_lacp_pkt = None
dyn_last_lldp_beacon_time = None
dyn_learn_ban_count = 0
dyn_phys_up = False
dyn_stack_current_state = 2
dyn_stack_probe_info = None
enabled = None
finalize()[source]

Configuration parsing marked complete.

hairpin = None
hosts(vlans=None)[source]

Return all host cache entries this port has learned (on all or specified VLANs).

hosts_count(vlans=None)[source]

Return count of all hosts this port has learned (on all or specified VLANs).

is_stack_admin_down()[source]

Return True if port is in ADMIN_DOWN state.

is_stack_down()[source]

Return True if port is in DOWN state.

is_stack_init()[source]

Return True if port is in INIT state.

is_stack_up()[source]

Return True if port is in UP state.

lldp_beacon = {}
lldp_beacon_defaults_types = {'enable': <class 'bool'>, 'org_tlvs': <class 'list'>, 'port_descr': <class 'str'>, 'system_name': <class 'str'>}
lldp_beacon_enabled()[source]

Return True if LLDP beacon enabled on this port.

lldp_org_tlv_defaults_types = {'info': (<class 'str'>, <class 'bytearray'>), 'oui': (<class 'int'>, <class 'bytearray'>), 'subtype': (<class 'int'>, <class 'bytearray'>)}
loop_protect = None
max_hosts = None
max_lldp_lost = None
mirror = None
mirror_actions()[source]

Return OF actions to mirror this port.

name = None
native_vlan = None
number = None
op_status_reconf = None
output_only = None
override_output_port = None
permanent_learn = None
receive_lldp = None
running()[source]

Return True if port enabled and up.

set_defaults()[source]

Set default values and run any basic sanity checks.

stack = {}
stack_admin_down()[source]

Change the current stack state to ADMIN_DOWN.

stack_defaults_types = {'dp': <class 'str'>, 'port': (<class 'str'>, <class 'int'>)}
stack_down()[source]

Change the current stack state to DOWN.

stack_init()[source]

Change the current stack state to INIT_DOWN.

stack_up()[source]

Change the current stack state to UP.

tagged_vlans = []
to_conf()[source]

Return configuration as a dict.

unicast_flood = None
vlans()[source]

Return list of all VLANs this port is in.