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.
-
contains_tunnel_acl
(tunnel_id=None)[source]¶ Searches through acls_in for a tunnel ACL with a matching tunnel_id
-
coprocessor_defaults_types
= {'strategy': <class 'str'>, 'vlan_vid_base': <class 'int'>}¶
-
defaults
= {'acl_in': None, 'acls_in': None, 'coprocessor': {}, 'count_untag_vlan_miss': False, 'description': None, 'dot1x': False, 'dot1x_acl': False, 'dot1x_dyn_acl': False, 'dot1x_mab': False, 'enabled': True, 'hairpin': False, 'hairpin_unicast': False, 'lacp': 0, 'lacp_active': False, 'lacp_collect_and_distribute': False, 'lacp_passthrough': None, 'lacp_port_priority': 255, 'lacp_resp_interval': 1, 'lacp_selected': False, 'lacp_standby': False, 'lacp_unselected': False, 'lldp_beacon': {}, 'lldp_peer_mac': None, 'loop_protect': False, 'loop_protect_external': False, 'max_hosts': 255, 'max_lldp_lost': 3, 'mirror': None, 'name': None, 'native_vlan': None, 'number': None, 'opstatus_reconf': True, 'output_only': False, 'permanent_learn': False, 'receive_lldp': False, 'restricted_bcast_arpnd': False, 'stack': None, 'tagged_vlans': None, 'unicast_flood': True}¶
-
defaults_types
= {'acl_in': (<class 'str'>, <class 'int'>), 'acls_in': <class 'list'>, 'coprocessor': <class 'dict'>, 'count_untag_vlan_miss': <class 'bool'>, 'description': <class 'str'>, 'dot1x': <class 'bool'>, 'dot1x_acl': <class 'bool'>, 'dot1x_dyn_acl': <class 'bool'>, 'dot1x_mab': <class 'bool'>, 'enabled': <class 'bool'>, 'hairpin': <class 'bool'>, 'hairpin_unicast': <class 'bool'>, 'lacp': <class 'int'>, 'lacp_active': <class 'bool'>, 'lacp_collect_and_distribute': <class 'bool'>, 'lacp_passthrough': <class 'list'>, 'lacp_port_priority': <class 'int'>, 'lacp_resp_interval': <class 'int'>, 'lacp_selected': <class 'bool'>, 'lacp_standby': <class 'bool'>, 'lacp_unselected': <class 'bool'>, 'lldp_beacon': <class 'dict'>, 'lldp_peer_mac': <class 'str'>, 'loop_protect': <class 'bool'>, 'loop_protect_external': <class 'bool'>, 'max_hosts': <class 'int'>, 'max_lldp_lost': <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'>, 'permanent_learn': <class 'bool'>, 'receive_lldp': <class 'bool'>, 'restricted_bcast_arpnd': <class 'bool'>, 'stack': <class 'dict'>, 'tagged_vlans': <class 'list'>, 'unicast_flood': <class 'bool'>}¶
-
get_lacp_flags
()[source]¶ Get the LACP flags for the state the port is in Return sync, collecting, distributing flag values
-
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).
-
lacp_actor_update
(lacp_up, now=None, lacp_pkt=None, cold_start=False)[source]¶ Update the LACP actor state :param lacp_up: The intended LACP/port state :type lacp_up: bool :param now: Current time :type now: float :param lacp_pkt: Received LACP packet :type lacp_pkt: PacketMeta :param cold_start: Whether the port is being cold started :type cold_start: bool
- Returns
current LACP actor state
-
lacp_port_update
(selected, cold_start=False)[source]¶ Updates the LACP port selection state :param selected: Whether the port’s DPID is the selected one :type selected: bool :param cold_start: Whether the port is being cold started :type cold_start: bool
- Returns
current lacp port state
-
lldp_beacon_defaults_types
= {'enable': <class 'bool'>, 'org_tlvs': <class 'list'>, 'port_descr': <class 'str'>, 'system_name': <class 'str'>}¶
-
lldp_org_tlv_defaults_types
= {'info': (<class 'str'>, <class 'bytearray'>), 'oui': (<class 'int'>, <class 'bytearray'>), 'subtype': (<class 'int'>, <class 'bytearray'>)}¶
-
non_stack_forwarding
()[source]¶ Returns True if port is not-stacking and, and able to forward packets.
-
stack_defaults_types
= {'dp': <class 'str'>, 'port': (<class 'str'>, <class 'int'>)}¶
-