faucet.vlan module

VLAN configuration.

class faucet.vlan.HostCacheEntry(eth_src, port, cache_time)[source]

Bases: object

class faucet.vlan.VLAN(_id, dp_id, conf=None)[source]

Bases: faucet.conf.Conf

Contains state for one VLAN, including its configuration.

acl_in = None
add_cache_host(eth_src, port, cache_time)[source]
bgp_as = None
bgp_local_address = None
bgp_neighbor_addresses = []
bgp_neighbor_as = None
bgp_neighbour_addresses = []
bgp_neighbour_as = None
bgp_port = None
bgp_routerid = None
bgp_server_addresses = []
cached_host(eth_src)[source]
cached_host_on_port(eth_src, port)[source]

Return host cache entry if host in cache and on specified port.

cached_hosts_on_port(port)[source]

Return all hosts learned on a port.

check_config()[source]
clear_cache_hosts_on_port(port)[source]

Clear all hosts learned on a port.

defaults = {'minimum_ip_size_check': True, 'acl_in': None, 'vid': None, 'faucet_mac': '0e:00:00:00:00:01', 'bgp_port': 9179, 'name': None, 'proactive_arp_limit': None, 'max_hosts': 255, 'targeted_gw_resolution': False, 'description': None, 'unicast_flood': True, 'bgp_neighbour_addresses': [], 'proactive_nd_limit': None, 'bgp_routerid': None, 'bgp_server_addresses': ['0.0.0.0', '::'], 'bgp_neighbor_as': None, 'faucet_vips': None, 'bgp_as': None, 'bgp_neighbour_as': None, 'bgp_neighbor_addresses': [], 'bgp_local_address': None, 'routes': None}
defaults_types = {'minimum_ip_size_check': <class 'bool'>, 'acl_in': (<class 'int'>, <class 'str'>), 'vid': <class 'int'>, 'faucet_mac': <class 'str'>, 'bgp_port': <class 'int'>, 'name': <class 'str'>, 'proactive_arp_limit': <class 'int'>, 'max_hosts': <class 'int'>, 'targeted_gw_resolution': <class 'bool'>, 'description': <class 'str'>, 'unicast_flood': <class 'bool'>, 'bgp_neighbour_addresses': <class 'list'>, 'proactive_nd_limit': <class 'int'>, 'bgp_routerid': <class 'str'>, 'bgp_server_addresses': <class 'list'>, 'bgp_neighbor_as': <class 'int'>, 'faucet_vips': <class 'list'>, 'bgp_as': <class 'int'>, 'bgp_neighbour_as': <class 'int'>, 'bgp_neighbor_addresses': <class 'list'>, 'bgp_local_address': <class 'str'>, 'routes': <class 'list'>}
dp_id = None
dyn_faucet_vips_by_ipv = None
dyn_host_cache = None
dyn_learn_ban_count = 0
dyn_neigh_cache_by_ipv = None
dyn_routes_by_ipv = None
expire_cache_hosts(now, learn_timeout)[source]

Expire stale host entries.

faucet_mac = None
faucet_vips = None
faucet_vips_by_ipv(ipv)[source]

Return list of VIPs with specified IP version on this VLAN.

flood_pkt(packet_builder, *args)[source]
flood_ports(configured_ports, exclude_unicast)[source]
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.

get_ports()[source]

Return list of all ports on this VLAN.

hairpin_ports()[source]

Return all ports with hairpin enabled.

host_cache

Return host (L2) cache for this VLAN.

hosts_count()[source]

Return number of hosts learned on this VLAN.

ip_in_vip_subnet(ipa)[source]

Return faucet_vip if IP in same IP network as a VIP on this VLAN.

ips_in_vip_subnet(ips)[source]

Return True if all IPs are on same subnet as VIP on this VLAN.

ipvs()[source]

Return list of IP versions configured on this VLAN.

is_faucet_vip(ipa)[source]

Return True if IP is a VIP on this VLAN.

lags()[source]

Return dict of LAGs mapped to member ports.

max_hosts = None
mirrored_ports()[source]

Return list of ports that are mirrored on this VLAN.

name = None
neigh_cache_by_ipv(ipv)[source]

Return neighbor cache for specified IP version on this VLAN.

output_port(port, hairpin=False)[source]
pkt_out_port(packet_builder, port, *args)[source]
port_is_tagged(port)[source]

Return True if port number is an tagged port on this VLAN.

port_is_untagged(port)[source]

Return True if port number is an untagged port on this VLAN.

proactive_arp_limit = None
proactive_nd_limit = None
reset_host_cache()[source]
reset_ports(ports)[source]
routes = None
routes_by_ipv(ipv)[source]

Return route table for specified IP version on this VLAN.

set_defaults()[source]
tagged = None
tagged_flood_ports(exclude_unicast)[source]
targeted_gw_resolution = None
unicast_flood = None
untagged = None
untagged_flood_ports(exclude_unicast)[source]
vid = None
static vid_valid(vid)[source]

Return True if VID valid.