faucet.vlan module
VLAN configuration.
- class faucet.vlan.AnyVLAN[source]
Bases:
object
Placeholder any tagged VLAN. NOTE: Not used, not well supported by hardware
- name = 'Any VLAN'
- vid = 4096
- class faucet.vlan.HostCacheEntry(eth_src, port, cache_time)[source]
Bases:
object
Association of a host with a port.
- cache_time
- eth_src
- eth_src_int
- port
- class faucet.vlan.NullVLAN[source]
Bases:
object
Placeholder null VLAN.
- name = 'Null VLAN'
- vid = 0
- class faucet.vlan.VLAN(_id, dp_id, conf=None)[source]
Bases:
Conf
Contains state for one VLAN, including its configuration.
- add_cache_host(eth_src, port, cache_time)[source]
Add/update a host to the cache on a port at at time.
- cached_host_on_port(eth_src, port)[source]
Return host cache entry if host in cache and on specified port.
- defaults: dict = {'acl_in': None, 'acl_out': None, 'acls_in': None, 'acls_out': None, 'description': None, 'dot1x_assigned': False, 'edge_learn_stack_root': True, 'faucet_mac': '0e:00:00:00:00:01', 'faucet_vips': None, 'max_hosts': 256, 'minimum_ip_size_check': True, 'name': None, 'proactive_arp_limit': 0, 'proactive_nd_limit': 0, 'reserved_internal_vlan': False, 'routes': None, 'targeted_gw_resolution': True, 'unicast_flood': True, 'vid': None}
- defaults_types: dict = {'acl_in': (<class 'int'>, <class 'str'>), 'acl_out': (<class 'int'>, <class 'str'>), 'acls_in': <class 'list'>, 'acls_out': <class 'list'>, 'description': <class 'str'>, 'dot1x_assigned': <class 'bool'>, 'edge_learn_stack_root': <class 'bool'>, 'faucet_mac': <class 'str'>, 'faucet_vips': <class 'list'>, 'max_hosts': <class 'int'>, 'minimum_ip_size_check': <class 'bool'>, 'name': <class 'str'>, 'proactive_arp_limit': <class 'int'>, 'proactive_nd_limit': <class 'int'>, 'reserved_internal_vlan': <class 'bool'>, 'routes': <class 'list'>, 'targeted_gw_resolution': <class 'bool'>, 'unicast_flood': <class 'bool'>, 'vid': <class 'int'>}
- static flood_ports(configured_ports, exclude_unicast)[source]
Return configured ports that allow flooding
- from_connected_to_vip(src_ip, dst_ip)[source]
Return True if src_ip in connected network and dst_ip is a VIP.
- Parameters:
src_ip (ipaddress.ip_address) – source IP.
dst_ip (ipaddress.ip_address) – destination IP
- Returns:
True if local traffic for a VIP.
- ip_in_vip_subnet(ipa, faucet_vip=None)[source]
Return faucet_vip if IP in same IP network as a VIP on this VLAN.
- is_host_fib_route(host_ip)[source]
Return True if IP destination is a host FIB route.
- Parameters:
host_ip – (ipaddress.ip_address): potential host FIB route.
- Returns:
True if a host FIB route (and not used as a gateway).
- mutable_attrs: frozenset = frozenset({'dot1x_untagged', 'tagged', 'untagged'})
- neigh_cache_count_by_ipv(ipv)[source]
Return number of hosts in neighbor cache for specified IP version on this VLAN.