faucet.dp module

Configuration for a datapath.

class faucet.dp.DP(_id, dp_id, conf)[source]

Bases: faucet.conf.Conf

Stores state related to a datapath controlled by Faucet, including configuration.

acls = None
add_acl(acl_ident, acl)[source]

Add an ACL to this DP.

add_port(port)[source]

Add a port to this DP.

add_router(router_ident, router)[source]

Add a router to this DP.

add_vlan(vlan)[source]

Add a VLAN to this datapath.

advertise_interval = None
all_valve_tables()[source]

Return list of all Valve tables.

arp_neighbor_timeout = None
check_config()[source]
configured = False
cookie = None
defaults = {'max_host_fib_retry_count': 10, 'drop_broadcast_source_address': True, 'learn_jitter': 10, 'lowest_priority': None, 'advertise_interval': 30, 'group_table_routing': False, 'highest_priority': None, 'interfaces': {}, 'ignore_learn_ins': 3, 'priority_offset': 0, 'drop_spoofed_faucet_mac': True, 'hardware': 'Open vSwitch', 'use_idle_timeout': False, 'learn_ban_timeout': 10, 'max_hosts_per_resolve_cycle': 5, 'pipeline_config_dir': '/home/docs/checkouts/readthedocs.org/user_builds/faucet/envs/1.6.15/etc/ryu/faucet', 'drop_bpdu': True, 'cookie': 1524372928, 'drop_lldp': True, 'timeout': 300, 'interface_ranges': {}, 'dp_id': None, 'group_table': False, 'ofchannel_log': None, 'high_priority': None, 'arp_neighbor_timeout': 250, 'low_priority': None, 'name': None, 'max_resolve_backoff_time': 32, 'packetin_pps': 0, 'stack': None, 'proactive_learn': True, 'description': None}
defaults_types = {'max_host_fib_retry_count': <class 'int'>, 'drop_broadcast_source_address': <class 'bool'>, 'learn_jitter': <class 'int'>, 'lowest_priority': <class 'int'>, 'advertise_interval': <class 'int'>, 'group_table_routing': <class 'bool'>, 'highest_priority': <class 'int'>, 'interfaces': <class 'dict'>, 'ignore_learn_ins': <class 'int'>, 'priority_offset': <class 'int'>, 'drop_spoofed_faucet_mac': <class 'bool'>, 'hardware': <class 'str'>, 'use_idle_timeout': <class 'bool'>, 'learn_ban_timeout': <class 'int'>, 'max_hosts_per_resolve_cycle': <class 'int'>, 'pipeline_config_dir': <class 'str'>, 'drop_bpdu': <class 'bool'>, 'cookie': <class 'int'>, 'drop_lldp': <class 'bool'>, 'timeout': <class 'int'>, 'interface_ranges': <class 'dict'>, 'dp_id': <class 'int'>, 'group_table': <class 'bool'>, 'ofchannel_log': <class 'str'>, 'high_priority': <class 'int'>, 'arp_neighbor_timeout': <class 'int'>, 'low_priority': <class 'int'>, 'name': <class 'str'>, 'max_resolve_backoff_time': <class 'int'>, 'packetin_pps': <class 'int'>, 'stack': <class 'dict'>, 'proactive_learn': <class 'bool'>, 'description': <class 'str'>}
dp_id = None
drop_bpdu = None
drop_broadcast_source_address = None
drop_lldp = None
drop_spoofed_faucet_mac = None
finalize_config(dps)[source]

Perform consistency checks after initial config parsing.

get_config_changes(logger, new_dp)[source]

Detect any config changes.

Parameters:
  • logger (ValveLogger) – logger instance
  • new_dp (DP) – new dataplane configuration.
Returns:

changes tuple containing:

deleted_ports (set): deleted port numbers. changed_ports (set): changed/added port numbers. changed_acl_ports (set): changed ACL only port numbers. deleted_vlans (set): deleted VLAN IDs. changed_vlans (set): changed/added VLAN IDs. all_ports_changed (bool): True if all ports changed.

Return type:

(tuple)

get_config_dict()[source]

Return DP config as a dict for API call.

get_native_vlan(port_num)[source]

Return native VLAN for a port by number, or None.

get_tables()[source]

Return tables as dict for API call.

group_table = False
group_table_routing = False
groups = None
high_priority = None
ignore_learn_ins = None
in_port_tables()[source]

Return list of tables that specify in_port as a match.

interface_ranges = None
interfaces = None
learn_ban_timeout = None
learn_jitter = None
low_priority = None
match_tables(match_type)[source]

Return list of tables with matches of a specific match type.

max_host_fib_retry_count = None
max_hosts_per_resolve_cycle = None
max_resolve_backoff_time = None
meters = {}
name = None
packetin_pps = None
peer_stack_up_ports(peer_dp)[source]

Return list of stack ports that are up towards a peer.

pipeline_config_dir = None
ports = None
priority_offset = None
proactive_learn = None
resolve_stack_topology(dps)[source]

Resolve inter-DP config for stacking.

routers = None
running = False
set_defaults()[source]
shortest_path(dest_dp)[source]

Return shortest path to a DP, as a list of DPs.

shortest_path_port(dest_dp)[source]

Return first port on our DP, that is the shortest path towards dest DP.

shortest_path_to_root()[source]

Return shortest path to root DP, as list of DPs.

stack = None
stack_ports = None
tables = {}
tables_by_id = {}
timeout = None
to_conf()[source]

Return DP config as dict.

use_idle_timeout = None
vlan_match_tables()[source]

Return list of tables that specify vlan_vid as a match.

vlans = None
wildcard_table = <faucet.valve_table.ValveTable object>