2.62. vpp_papi_provider module¶
-
class
vpp_papi_provider.
L2_VTR_OP
¶ -
L2_DISABLED
= 0¶
-
L2_POP_1
= 3¶
-
L2_POP_2
= 4¶
-
L2_PUSH_1
= 1¶
-
L2_PUSH_2
= 2¶
-
L2_TRANSLATE_1_1
= 5¶
-
L2_TRANSLATE_1_2
= 6¶
-
L2_TRANSLATE_2_1
= 7¶
-
L2_TRANSLATE_2_2
= 8¶
-
-
exception
vpp_papi_provider.
UnexpectedApiReturnValueError
¶ Bases:
exceptions.Exception
exception raised when the API return value is unexpected
-
class
vpp_papi_provider.
VppPapiProvider
(name, shm_prefix, test_class)¶ Bases:
object
VPP-api provider using vpp-papi
@property hook: hook object providing before and after api/cli hooks
-
acl_add_replace
(acl_index, r, tag='', expected_retval=0)¶ Add/replace an ACL :param int acl_index: ACL index to replace, 2^32-1 to create new ACL. :param acl_rule r: ACL rules array. :param str tag: symbolic tag (description) for this ACL. :param int count: number of rules.
-
acl_del
(acl_index, expected_retval=0)¶ Parameters: acl_index – Returns:
-
acl_dump
(acl_index, expected_retval=0)¶
-
acl_interface_set_acl_list
(sw_if_index, n_input, acls, expected_retval=0)¶
-
api
(api_fn, api_args, expected_retval=0)¶ Call API function and check it’s return value. Call the appropriate hooks before and after the API call
Parameters: - api_fn – API function to call
- api_args – tuple of API function arguments
- expected_retval – Expected return value (Default value = 0)
Returns: reply from the API
-
bd_ip_mac_add_del
(bd_id, mac, ip, is_ipv6=0, is_add=1)¶
-
bfd_auth_del_key
(conf_key_id)¶
-
bfd_auth_keys_dump
()¶
-
bfd_auth_set_key
(conf_key_id, auth_type, key)¶
-
bfd_udp_add
(sw_if_index, desired_min_tx, required_min_rx, detect_mult, local_addr, peer_addr, is_ipv6=0, bfd_key_id=None, conf_key_id=None)¶
-
bfd_udp_auth_activate
(sw_if_index, local_addr, peer_addr, is_ipv6=0, bfd_key_id=None, conf_key_id=None, is_delayed=False)¶
-
bfd_udp_auth_deactivate
(sw_if_index, local_addr, peer_addr, is_ipv6=0, is_delayed=False)¶
-
bfd_udp_del
(sw_if_index, local_addr, peer_addr, is_ipv6=0)¶
-
bfd_udp_del_echo_source
()¶
-
bfd_udp_mod
(sw_if_index, desired_min_tx, required_min_rx, detect_mult, local_addr, peer_addr, is_ipv6=0)¶
-
bfd_udp_session_dump
()¶
-
bfd_udp_session_set_flags
(admin_up_down, sw_if_index, local_addr, peer_addr, is_ipv6=0)¶
-
bfd_udp_set_echo_source
(sw_if_index)¶
-
bridge_domain_add_del
(bd_id, flood=1, uu_flood=1, forward=1, learn=1, arp_term=0, is_add=1)¶ Create/delete bridge domain.
Parameters: - bd_id (int) – Bridge domain index.
- flood (int) – Enable/disable bcast/mcast flooding in the BD. (Default value = 1)
- uu_flood (int) – Enable/disable unknown unicast flood in the BD. (Default value = 1)
- forward (int) – Enable/disable forwarding on all interfaces in the BD. (Default value = 1)
- learn (int) – Enable/disable learning on all interfaces in the BD. (Default value = 1)
- arp_term (int) – Enable/disable arp termination in the BD. (Default value = 1)
- is_add (int) – Add or delete flag. (Default value = 1)
-
bridge_domain_dump
(bd_id=0)¶ Parameters: bd_id (int) – Bridge domain ID. (Default value = 0 => dump of all existing bridge domains returned) Returns: Dictionary of bridge domain(s) data.
-
bridge_flags
(bd_id, is_set, feature_bitmap)¶ Enable/disable required feature of the bridge domain with defined ID.
Parameters: - bd_id (int) – Bridge domain ID.
- is_set (int) – Set to 1 to enable, set to 0 to disable the feature.
- feature_bitmap (int) – Bitmap value of the feature to be set: - learn (1 << 0), - forward (1 << 1), - flood (1 << 2), - uu-flood (1 << 3) or - arp-term (1 << 4).
-
classify_add_del_session
(is_add, table_index, match, opaque_index=4294967295, hit_next_index=4294967295, advance=0, action=0, metadata=0)¶ Parameters: - is_add –
- table_index –
- match –
- opaque_index – (Default value = 0xFFFFFFFF)
- hit_next_index – (Default value = 0xFFFFFFFF)
- advance – (Default value = 0)
- action – (Default value = 0)
- metadata – (Default value = 0)
-
classify_add_del_table
(is_add, mask, match_n_vectors=1, table_index=4294967295, nbuckets=2, memory_size=2097152, skip_n_vectors=0, next_table_index=4294967295, miss_next_index=4294967295, current_data_flag=0, current_data_offset=0)¶ Parameters: - is_add –
- mask –
- match_n_vectors – (Default value = 1)
- table_index – (Default value = 0xFFFFFFFF)
- nbuckets – (Default value = 2)
- memory_size – (Default value = 2097152)
- skip_n_vectors – (Default value = 0)
- next_table_index – (Default value = 0xFFFFFFFF)
- miss_next_index – (Default value = 0xFFFFFFFF)
- current_data_flag – (Default value = 0)
- current_data_offset – (Default value = 0)
-
cli
(cli)¶ Execute a CLI, calling the before/after hooks appropriately.
Parameters: cli – CLI to execute Returns: CLI output
-
collect_events
()¶ Collect all events from the internal queue and clear the queue.
-
connect
()¶ Connect the API to VPP
-
control_ping
()¶
-
create_loopback
(mac='')¶ Parameters: mac – (Optional)
-
create_p2pethernet_subif
(sw_if_index, remote_mac, subif_id)¶ Create p2p ethernet subinterface
Parameters: - sw_if_index – main (parent) interface
- remote_mac – client (remote) mac address
-
create_subif
(sw_if_index, sub_id, outer_vlan, inner_vlan, no_tags=0, one_tag=0, two_tags=0, dot1ad=0, exact_match=0, default_sub=0, outer_vlan_id_any=0, inner_vlan_id_any=0)¶ Create subinterface from vpe.api: set dot1ad = 0 for dot1q, set dot1ad = 1 for dot1ad
Parameters: - sub_id – param inner_vlan:
- sw_if_index –
- outer_vlan –
- inner_vlan –
- no_tags – (Default value = 0)
- one_tag – (Default value = 0)
- two_tags – (Default value = 0)
- dot1ad – (Default value = 0)
- exact_match – (Default value = 0)
- default_sub – (Default value = 0)
- outer_vlan_id_any – (Default value = 0)
- inner_vlan_id_any – (Default value = 0)
-
create_vlan_subif
(sw_if_index, vlan)¶ Parameters: - vlan –
- sw_if_index –
-
delete_loopback
(sw_if_index)¶
-
delete_p2pethernet_subif
(sw_if_index, remote_mac)¶ Delete p2p ethernet subinterface
Parameters: - sw_if_index – main (parent) interface
- remote_mac – client (remote) mac address
-
delete_subif
(sw_if_index)¶ Delete subinterface
Parameters: sw_if_index –
-
dhcp_client
(sw_if_index, hostname, client_id='', is_add=1, want_dhcp_events=0)¶
-
dhcp_proxy_config
(dhcp_server, dhcp_src_address, rx_table_id=0, server_table_id=0, is_add=1, is_ipv6=0)¶
-
dhcp_proxy_set_vss
(table_id, fib_id, oui, is_add=1, is_ip6=0)¶
-
disconnect
()¶ Disconnect the API from VPP
-
expect_negative_api_retval
()¶ Expect API failure
-
expect_zero_api_retval
()¶ Expect API success
-
gre_tunnel_add_del
(src_address, dst_address, outer_fib_id=0, is_teb=0, is_add=1, is_ip6=0)¶ Add a GRE tunnel
Parameters: - src_address –
- dst_address –
- outer_fib_id – (Default value = 0)
- is_add – (Default value = 1)
- is_ipv6 – (Default value = 0)
- is_teb – (Default value = 0)
-
gtpu_add_del_tunnel
(src_addr, dst_addr, is_add=1, is_ipv6=0, mcast_sw_if_index=4294967295, encap_vrf_id=0, decap_next_index=4294967295, teid=0)¶ Parameters: - is_add – (Default value = 1)
- is_ipv6 – (Default value = 0)
- src_addr –
- dst_addr –
- mcast_sw_if_index – (Default value = 0xFFFFFFFF)
- encap_vrf_id – (Default value = 0)
- decap_next_index – (Default value = 0xFFFFFFFF)
- teid – (Default value = 0)
-
input_acl_set_interface
(is_add, sw_if_index, ip4_table_index=4294967295, ip6_table_index=4294967295, l2_table_index=4294967295)¶ Parameters: - is_add –
- sw_if_index –
- ip4_table_index – (Default value = 0xFFFFFFFF)
- ip6_table_index – (Default value = 0xFFFFFFFF)
- l2_table_index – (Default value = 0xFFFFFFFF)
-
ip6_fib_dump
()¶
-
ip6_nd_proxy
(address, sw_if_index, is_del=0)¶
-
ip6_sw_interface_enable_disable
(sw_if_index, enable)¶ Enable/Disable An interface for IPv6
-
ip6_sw_interface_ra_config
(sw_if_index, no, suppress, send_unicast)¶
-
ip6_sw_interface_ra_prefix
(sw_if_index, address, address_length, use_default=0, no_advertise=0, off_link=0, no_autoconfig=0, no_onlink=0, is_no=0, val_lifetime=4294967295, pref_lifetime=4294967295)¶
-
ip_add_del_route
(dst_address, dst_address_length, next_hop_address, next_hop_sw_if_index=4294967295, table_id=0, next_hop_table_id=0, next_hop_weight=1, next_hop_n_out_labels=0, next_hop_out_label_stack=[], next_hop_via_label=1048576, is_resolve_host=0, is_resolve_attached=0, classify_table_index=4294967295, is_add=1, is_drop=0, is_unreach=0, is_prohibit=0, is_ipv6=0, is_local=0, is_classify=0, is_multipath=0, not_last=0)¶ Parameters: - dst_address_length –
- next_hop_sw_if_index – (Default value = 0xFFFFFFFF)
- dst_address –
- next_hop_address –
- next_hop_sw_if_index – (Default value = 0xFFFFFFFF)
- vrf_id – (Default value = 0)
- lookup_in_vrf – (Default value = 0)
- classify_table_index – (Default value = 0xFFFFFFFF)
- is_add – (Default value = 1)
- is_drop – (Default value = 0)
- is_ipv6 – (Default value = 0)
- is_local – (Default value = 0)
- is_classify – (Default value = 0)
- is_multipath – (Default value = 0)
- is_resolve_host – (Default value = 0)
- is_resolve_attached – (Default value = 0)
- not_last – (Default value = 0)
- next_hop_weight – (Default value = 1)
-
ip_dump
(is_ipv6=0)¶ Return IP dump.
Parameters: is_ipv6 (int) – 1 for IPv6 neighbor, 0 for IPv4. (Default = 0)
-
ip_fib_dump
()¶
-
ip_mfib_dump
()¶
-
ip_mroute_add_del
(src_address, grp_address, grp_address_length, e_flags, next_hop_sw_if_index, i_flags, rpf_id=0, table_id=0, is_add=1, is_ipv6=0, is_local=0)¶
-
ip_neighbor_add_del
(sw_if_index, mac_address, dst_address, is_add=1, is_ipv6=0, is_static=0, is_no_adj_fib=0)¶ Add neighbor MAC to IPv4 or IPv6 address.
Parameters: - sw_if_index –
- mac_address –
- dst_address –
- is_add – (Default value = 1)
- is_ipv6 – (Default value = 0)
- is_static – (Default value = 0)
- is_no_adj_fib – (Default value = 0)
-
ip_neighbor_dump
(sw_if_index, is_ipv6=0)¶ Return IP neighbor dump.
Parameters: - sw_if_index –
- is_ipv6 (int) – 1 for IPv6 neighbor, 0 for IPv4. (Default = 0)
-
ip_table_add_del
(table_id, is_add=1, is_ipv6=0)¶ :param table_id :param is_add: (Default value = 1) :param is_ipv6: (Default value = 0)
-
l2fib_add_del
(mac, bd_id, sw_if_index, is_add=1, static_mac=0, filter_mac=0, bvi_mac=0)¶ Create/delete L2 FIB entry.
Parameters: - mac (str) – MAC address to create FIB entry for.
- bd_id (int) – Bridge domain index.
- sw_if_index (int) – Software interface index of the interface.
- is_add (int) – Add or delete flag. (Default value = 1)
- static_mac (int) – Set to 1 to create static MAC entry. (Default value = 0)
- filter_mac (int) – Set to 1 to drop packet that’s source or destination MAC address contains defined MAC address. (Default value = 0)
- bvi_mac (int) – Set to 1 to create entry that points to BVI interface. (Default value = 0)
-
l2fib_flush_all
()¶ Flush all L2 FIB.
-
l2fib_flush_bd
(bd_id)¶ Flush L2 FIB entries for bd_id.
Parameters: sw_if_index (int) – Bridge Domain id.
-
l2fib_flush_int
(sw_if_index)¶ Flush L2 FIB entries for sw_if_index.
Parameters: sw_if_index (int) – Software interface index of the interface.
-
lisp_adjacencies_get
(vni=0)¶
-
lisp_adjacency
(leid, reid, leid_len, reid_len, eid_type, is_add=1, vni=0)¶
-
lisp_eid_table_dump
(eid_set=0, prefix_length=0, vni=0, eid_type=0, eid=None, filter_opt=0)¶
-
lisp_enable_disable
(is_enabled)¶
-
lisp_local_mapping
(ls_name, eid_type, eid, prefix_len, vni=0, key_id=0, key='', is_add=1)¶
-
lisp_locator
(ls_name, sw_if_index, priority=1, weight=1, is_add=1)¶
-
lisp_locator_dump
(is_index_set, ls_name=None, ls_index=0)¶
-
lisp_locator_set
(ls_name, is_add=1)¶
-
lisp_locator_set_dump
()¶
-
lisp_remote_mapping
(eid_type, eid, eid_prefix_len=0, vni=0, rlocs=[], rlocs_num=0, is_src_dst=0, is_add=1)¶
-
macip_acl_add
(rules, tag='')¶ Add MACIP acl
Parameters: - rules – list of rules for given acl
- tag – acl tag
-
macip_acl_add_replace
(rules, acl_index=4294967295, tag='')¶ Add MACIP acl
Parameters: - rules – list of rules for given acl
- tag – acl tag
-
macip_acl_del
(acl_index)¶ Parameters: acl_index – Returns:
-
macip_acl_dump
(acl_index=4294967295)¶ Return MACIP acl dump
-
macip_acl_interface_add_del
(sw_if_index, acl_index, is_add=1)¶ Add MACIP acl to interface
Parameters: - sw_if_index –
- acl_index –
- is_add – (Default value = 1)
-
macip_acl_interface_get
()¶ Return interface acls dump
-
map_add_domain
(ip6_prefix, ip6_prefix_len, ip6_src, ip6_src_prefix_len, ip4_prefix, ip4_prefix_len, ea_bits_len=0, psid_offset=0, psid_length=0, is_translation=0, mtu=1280)¶
-
mfib_signal_dump
()¶
-
mpls_fib_dump
()¶
-
mpls_ip_bind_unbind
(label, dst_address, dst_address_length, table_id=0, ip_table_id=0, is_ip4=1, is_bind=1)¶
-
mpls_route_add_del
(label, eos, next_hop_proto, next_hop_address, next_hop_sw_if_index=4294967295, table_id=0, next_hop_table_id=0, next_hop_weight=1, next_hop_n_out_labels=0, next_hop_out_label_stack=[], next_hop_via_label=1048576, is_resolve_host=0, is_resolve_attached=0, is_interface_rx=0, is_rpf_id=0, is_multicast=0, is_add=1, is_drop=0, is_multipath=0, classify_table_index=4294967295, is_classify=0, not_last=0)¶ Parameters: - dst_address_length –
- next_hop_sw_if_index – (Default value = 0xFFFFFFFF)
- dst_address –
- next_hop_address –
- next_hop_sw_if_index – (Default value = 0xFFFFFFFF)
- vrf_id – (Default value = 0)
- lookup_in_vrf – (Default value = 0)
- classify_table_index – (Default value = 0xFFFFFFFF)
- is_add – (Default value = 1)
- is_drop – (Default value = 0)
- is_ipv6 – (Default value = 0)
- is_local – (Default value = 0)
- is_classify – (Default value = 0)
- is_multipath – (Default value = 0)
- is_multicast – (Default value = 0)
- is_resolve_host – (Default value = 0)
- is_resolve_attached – (Default value = 0)
- not_last – (Default value = 0)
- next_hop_weight – (Default value = 1)
-
mpls_table_add_del
(table_id, is_add=1)¶ :param table_id :param is_add: (Default value = 1)
-
mpls_tunnel_add_del
(tun_sw_if_index, next_hop_proto_is_ip4, next_hop_address, next_hop_sw_if_index=4294967295, next_hop_table_id=0, next_hop_weight=1, next_hop_n_out_labels=0, next_hop_out_label_stack=[], next_hop_via_label=1048576, is_add=1, l2_only=0, is_multicast=0)¶ Parameters: - dst_address_length –
- next_hop_sw_if_index – (Default value = 0xFFFFFFFF)
- dst_address –
- next_hop_address –
- next_hop_sw_if_index – (Default value = 0xFFFFFFFF)
- vrf_id – (Default value = 0)
- lookup_in_vrf – (Default value = 0)
- classify_table_index – (Default value = 0xFFFFFFFF)
- is_add – (Default value = 1)
- is_drop – (Default value = 0)
- is_ipv6 – (Default value = 0)
- is_local – (Default value = 0)
- is_classify – (Default value = 0)
- is_multipath – (Default value = 0)
- is_resolve_host – (Default value = 0)
- is_resolve_attached – (Default value = 0)
- next_hop_weight – (Default value = 1)
- is_multicast – (Default value = 0)
-
nat44_add_del_address_range
(first_ip_address, last_ip_address, is_add=1, vrf_id=4294967295)¶ Add/del NAT44 address range
Parameters: - first_ip_address – First IP address
- last_ip_address – Last IP address
- vrf_id – VRF id for the address range
- is_add – 1 if add, 0 if delete (Default value = 1)
-
nat44_add_del_lb_static_mapping
(external_addr, external_port, protocol, vrf_id=0, local_num=0, locals=[], is_add=1)¶ Add/delete NAT44 load balancing static mapping
:param is_add - 1 if add, 0 if delete
-
nat44_add_del_static_mapping
(local_ip, external_ip=0, external_sw_if_index=4294967295, local_port=0, external_port=0, addr_only=1, vrf_id=0, protocol=0, is_add=1)¶ Add/delete NAT44 static mapping
Parameters: - local_ip – Local IP address
- external_ip – External IP address
- external_sw_if_index – External interface instead of IP address
- local_port – Local port number (Default value = 0)
- external_port – External port number (Default value = 0)
- addr_only – 1 if address only mapping, 0 if address and port
- vrf_id – VRF ID
- protocol – IP protocol (Default value = 0)
- is_add – 1 if add, 0 if delete (Default value = 1)
-
nat44_add_interface_addr
(sw_if_index, is_add=1)¶ Add/del NAT44 address from interface
Parameters: - sw_if_index – Software index of the interface
- is_add – 1 if add, 0 if delete (Default value = 1)
-
nat44_address_dump
()¶ Dump NAT44 addresses :return: Dictionary of NAT44 addresses
-
nat44_interface_add_del_feature
(sw_if_index, is_inside=1, is_add=1)¶ Enable/disable NAT44 feature on the interface
Parameters: - sw_if_index – Software index of the interface
- is_inside – 1 if inside, 0 if outside (Default value = 1)
- is_add – 1 if add, 0 if delete (Default value = 1)
-
nat44_interface_add_del_output_feature
(sw_if_index, is_inside=1, is_add=1)¶ Enable/disable NAT44 output feature on the interface
Parameters: - sw_if_index – Software index of the interface
- is_inside – 1 if inside, 0 if outside (Default value = 1)
- is_add – 1 if add, 0 if delete (Default value = 1)
-
nat44_interface_addr_dump
()¶ Dump NAT44 addresses interfaces :return: Dictionary of NAT44 addresses interfaces
-
nat44_interface_dump
()¶ Dump interfaces with NAT44 feature :return: Dictionary of interfaces with NAT44 feature
-
nat44_interface_output_feature_dump
()¶ Dump interfaces with NAT44 output feature :return: Dictionary of interfaces with NAT44 output feature
-
nat44_lb_static_mapping_dump
()¶ Dump NAT44 load balancing static mappings
Returns: Dictionary of NAT44 load balancing static mapping
-
nat44_static_mapping_dump
()¶ Dump NAT44 static mappings :return: Dictionary of NAT44 static mappings
-
nat44_user_dump
()¶ Dump NAT44 users
Returns: Dictionary of NAT44 users
-
nat44_user_session_dump
(ip_address, vrf_id)¶ Dump NAT44 user’s sessions
Parameters: - ip_address – ip adress of the user to be dumped
- cpu_index – cpu_index on which the user is
- vrf_id – VRF ID
Returns: Dictionary of S-NAT sessions
-
nat64_add_del_interface
(sw_if_index, is_inside=1, is_add=1)¶ Enable/disable NAT64 feature on the interface :param sw_if_index: Index of the interface :param is_inside: 1 if inside, 0 if outside (Default value = 1) :param is_add: 1 if add, 0 if delete (Default value = 1)
-
nat64_add_del_pool_addr_range
(start_addr, end_addr, vrf_id=4294967295, is_add=1)¶ Add/del address range to NAT64 pool
Parameters: - start_addr – First IP address
- end_addr – Last IP address
- vrf_id – VRF id for the address range
- is_add – 1 if add, 0 if delete (Default value = 1)
-
nat64_add_del_prefix
(prefix, plen, vrf_id=0, is_add=1)¶ Add/del NAT64 prefix
Parameters: - prefix – NAT64 prefix
- plen – NAT64 prefix length
- vrf_id – VRF id of tenant (Default 0)
- is_add – 1 if add, 0 if delete (Default value = 1)
-
nat64_add_del_static_bib
(in_ip, out_ip, in_port, out_port, protocol, vrf_id=0, is_add=1)¶ Add/delete S-NAT static BIB entry
Parameters: - in_ip – Inside IPv6 address
- out_ip – Outside IPv4 address
- in_port – Inside port number
- out_port – Outside port number
- protocol – IP protocol
- vrf_id – VRF ID (Default value = 0)
- is_add – 1 if add, 0 if delete (Default value = 1)
-
nat64_bib_dump
(protocol=255)¶ Dump NAT64 BIB
Parameters: protocol – IP protocol (Default value = 255, all BIBs) Returns: Dictionary of NAT64 BIB entries
-
nat64_get_timeouts
()¶ Get values of timeouts for NAT64
Returns: Timeouts for NAT64 (in seconds)
-
nat64_interface_dump
()¶ Dump interfaces with NAT64 feature :return: Dictionary of interfaces with NAT64 feature
-
nat64_pool_addr_dump
()¶ Dump NAT64 pool addresses :return: Dictionary of NAT64 pool addresses
-
nat64_prefix_dump
()¶ Dump NAT64 prefix
Returns: Dictionary of NAT64 prefixes
-
nat64_set_timeouts
(udp=300, icmp=60, tcp_trans=240, tcp_est=7440, tcp_incoming_syn=6)¶ Set values of timeouts for NAT64 (in seconds)
Parameters: - udpi – UDP timeout (Default value = 300)
- icmp – ICMP timeout (Default value = 60)
- tcp_trans – TCP transitory timeout (Default value = 240)
- tcp_est – TCP established timeout (Default value = 7440)
- tcp_incoming_syn – TCP incoming SYN timeout (Default value = 6)
-
nat64_st_dump
(protocol=255)¶ Dump NAT64 session table
Parameters: protocol – IP protocol (Default value = 255, all STs) Returns: Dictionary of NAT64 sesstion table entries
-
nat_det_add_del_map
(in_addr, in_plen, out_addr, out_plen, is_add=1)¶ Add/delete deterministic NAT mapping
:param is_add - 1 if add, 0 if delete :param in_addr - inside IP address :param in_plen - inside IP address prefix length :param out_addr - outside IP address :param out_plen - outside IP address prefix length
-
nat_det_close_session_in
(in_addr, in_port, ext_addr, ext_port)¶ Close deterministic NAT session using inside address and port
:param in_addr - inside IP address :param in_port - inside port :param ext_addr - external host IP address :param ext_port - external host port
-
nat_det_close_session_out
(out_addr, out_port, ext_addr, ext_port)¶ Close deterministic NAT session using outside address and port
:param out_addr - outside IP address :param out_port - outside port :param ext_addr - external host IP address :param ext_port - external host port
-
nat_det_forward
(in_addr)¶ Get outside address and port range from inside address
:param in_addr - inside IP address
-
nat_det_get_timeouts
()¶ Get values of timeouts for deterministic NAT
Returns: Timeouts for deterministic NAT (in seconds)
-
nat_det_map_dump
()¶ Dump deterministic NAT mappings
Returns: Dictionary of deterministic NAT mappings
-
nat_det_reverse
(out_addr, out_port)¶ Get inside address from outside address and port
:param out_addr - outside IP address :param out_port - outside port
-
nat_det_session_dump
(user_addr)¶ Dump deterministic NAT sessions belonging to a user
:param user_addr - inside IP address of the user :return: Dictionary of deterministic NAT sessions
-
nat_det_set_timeouts
(udp=300, tcp_established=7440, tcp_transitory=240, icmp=60)¶ Set values of timeouts for deterministic NAT (in seconds)
:param udp - UDP timeout (Default value = 300) :param tcp_established - TCP established timeout (Default value = 7440) :param tcp_transitory - TCP transitory timeout (Default value = 240) :param icmp - ICMP timeout (Default value = 60)
-
nat_ipfix
(domain_id=1, src_port=4739, enable=1)¶ Enable/disable NAT IPFIX logging
Parameters: - domain_id – Observation domain ID (Default value = 1)
- src_port – Source port number (Default value = 4739)
- enable – 1 if enable, 0 if disable (Default value = 1)
-
nat_show_config
()¶ Show NAT plugin config :return: NAT plugin config parameters
-
pg_create_interface
(pg_index)¶ Parameters: pg_index –
-
ppcli
(cli)¶ Helper method to print CLI command in case of info logging level.
Parameters: cli – CLI to execute Returns: CLI output
-
pppoe_add_del_session
(client_ip, client_mac, session_id=0, is_add=1, is_ipv6=0, decap_vrf_id=0)¶ Parameters: - is_add – (Default value = 1)
- is_ipv6 – (Default value = 0)
- client_ip –
- session_id – (Default value = 0)
- client_mac –
- decap_vrf_id – (Default value = 0)
-
proxy_arp_add_del
(low_address, hi_address, vrf_id=0, is_add=1)¶ Config Proxy Arp Range.
Parameters: - low_address – Start address in the rnage to Proxy for
- hi_address – End address in the rnage to Proxy for
- vrf_id – The VRF/table in which to proxy
-
proxy_arp_intfc_enable_disable
(sw_if_index, is_enable=1)¶ Enable/Disable an interface for proxy ARP requests
Parameters: - sw_if_index – Interface
- enable_disable – Enable/Disable
-
register_hook
(hook)¶ Replace hook registration with new hook
Parameters: hook –
-
reset_fib
(vrf_id, is_ipv6=0)¶ Reset VRF (remove all routes etc.) request.
Parameters: - vrf_id (int) – ID of the FIB table / VRF to reset.
- is_ipv6 (int) – 1 for IPv6 neighbor, 0 for IPv4. (Default = 0)
-
reset_vrf
(vrf_id, is_ipv6=0)¶ Reset VRF (remove all routes etc.) request.
Parameters: - vrf_id (int) – ID of the FIB table / VRF to reset.
- is_ipv6 (int) – 1 for IPv6 neighbor, 0 for IPv4. (Default = 0)
-
set_ip_flow_hash
(table_id, src=1, dst=1, sport=1, dport=1, proto=1, reverse=0, is_ip6=0)¶
-
set_ipfix_exporter
(collector_address, src_address, path_mtu, template_interval, vrf_id=0, collector_port=4739, udp_checksum=0)¶
-
show_version
()¶
-
sr_localsid_add_del
(localsid_addr, behavior, nh_addr, is_del=0, end_psp=0, sw_if_index=4294967295, vlan_index=0, fib_table=0)¶ Add/del IPv6 SR local-SID.
Parameters: - localsid_addr –
- behavior – END=1; END.X=2; END.DX2=4; END.DX6=5;
- behavior – END.DX4=6; END.DT6=7; END.DT4=8
- nh_addr –
- is_del – (Default value = 0)
- end_psp – (Default value = 0)
- sw_if_index – (Default value = 0xFFFFFFFF)
- vlan_index – (Default value = 0)
- fib_table – (Default value = 0)
-
sr_policy_add
(bsid_addr, weight=1, is_encap=1, type=0, fib_table=0, n_segments=0, segments=[])¶ Parameters: - bsid_addr – bindingSID of the SR Policy
- weight – weight of the sid list. optional. (default: 1)
- is_encap – (bool) whether SR policy should Encap or SRH insert (default: Encap)
- type – type/behavior of the SR policy. (default or spray) (default: default)
- fib_table – VRF where to install the FIB entry for the BSID (default: 0)
- n_segments – number of segments (default: 0)
- segments – a vector of IPv6 address composing the segment list (default: [])
-
sr_policy_del
(bsid_addr, sr_policy_index=0)¶ Parameters: - bsid – bindingSID of the SR Policy
- sr_policy_index – index of the sr policy (default: 0)
-
sr_steering_add_del
(is_del, bsid_addr, sr_policy_index, table_id, prefix_addr, mask_width, sw_if_index, traffic_type)¶ Steer traffic L2 and L3 traffic through a given SR policy
Parameters: - is_del – delete or add
- bsid_addr – bindingSID of the SR Policy (alt to sr_policy_index)
- sr_policy – is the index of the SR Policy (alt to bsid)
- table_id – is the VRF where to install the FIB entry for the BSID
- prefix_addr – is the IPv4/v6 address for L3 traffic type
- mask_width – is the mask for L3 traffic type
- sw_if_index – is the incoming interface for L2 traffic
- traffic_type – type of traffic (IPv4: 4, IPv6: 6, L2: 2)
-
sw_interface_add_del_address
(sw_if_index, addr, addr_len, is_ipv6=0, is_add=1, del_all=0)¶ Parameters: - addr – param is_ipv6: (Default value = 0)
- sw_if_index –
- addr_len –
- is_ipv6 – (Default value = 0)
- is_add – (Default value = 1)
- del_all – (Default value = 0)
-
sw_interface_dump
(filter=None)¶ Parameters: filter – (Default value = None)
-
sw_interface_enable_disable_mpls
(sw_if_index, is_enable=1)¶ Enable/Disable MPLS on the interface :param sw_if_index: :param is_enable: (Default value = 1)
-
sw_interface_ra_suppress
(sw_if_index, suppress=1)¶
-
sw_interface_set_flags
(sw_if_index, admin_up_down)¶ Parameters: - admin_up_down –
- sw_if_index –
-
sw_interface_set_l2_bridge
(sw_if_index, bd_id, shg=0, bvi=0, enable=1)¶ Add/remove interface to/from bridge domain.
Parameters: - sw_if_index (int) – Software interface index of the interface.
- bd_id (int) – Bridge domain index.
- shg (int) – Split-horizon group index. (Default value = 0)
- bvi (int) – Set interface as a bridge group virtual interface. (Default value = 0)
- enable (int) – Add or remove interface. (Default value = 1)
-
sw_interface_set_l2_tag_rewrite
(sw_if_index, vtr_oper, push=0, tag1=0, tag2=0)¶ L2 interface vlan tag rewrite configure request :param client_index - opaque cookie to identify the sender :param context - sender context, to match reply w/ request :param sw_if_index - interface the operation is applied to :param vtr_op - Choose from l2_vtr_op_t enum values :param push_dot1q - first pushed flag dot1q id set, else dot1ad :param tag1 - Needed for any push or translate vtr op :param tag2 - Needed for any push 2 or translate x-2 vtr ops
-
sw_interface_set_l2_xconnect
(rx_sw_if_index, tx_sw_if_index, enable)¶ Create or delete unidirectional cross-connect from Tx interface to Rx interface.
Parameters: - rx_sw_if_index (int) – Software interface index of Rx interface.
- tx_sw_if_index (int) – Software interface index of Tx interface.
- enable (int) – Create cross-connect if equal to 1, delete cross-connect if equal to 0.
-
sw_interface_set_table
(sw_if_index, is_ipv6, table_id)¶ Set the IPvX Table-id for the Interface
Parameters: - sw_if_index –
- is_ipv6 –
- table_id –
-
sw_interface_set_unnumbered
(sw_if_index, ip_sw_if_index, is_add=1)¶ Set the Interface to be unnumbered
Parameters: is_add – (Default value = 1) :param sw_if_index - interface That will be unnumbered :param ip_sw_if_index - interface with an IP addres
-
sw_interface_span_enable_disable
(sw_if_index_from, sw_if_index_to, state=1, is_l2=0)¶ Parameters: - sw_if_index_from –
- sw_if_index_to –
- state –
- is_l2 –
-
vxlan_add_del_tunnel
(src_addr, dst_addr, mcast_sw_if_index=4294967295, is_add=1, is_ipv6=0, encap_vrf_id=0, decap_next_index=4294967295, vni=0)¶ Parameters: - dst_addr –
- src_addr –
- is_add – (Default value = 1)
- is_ipv6 – (Default value = 0)
- encap_vrf_id – (Default value = 0)
- decap_next_index – (Default value = 0xFFFFFFFF)
- mcast_sw_if_index – (Default value = 0xFFFFFFFF)
- vni – (Default value = 0)
-
vxlan_gpe_add_del_tunnel
(src_addr, dst_addr, mcast_sw_if_index=4294967295, is_add=1, is_ipv6=0, encap_vrf_id=0, decap_vrf_id=0, protocol=3, vni=0)¶ Parameters: - local –
- remote –
- is_add – (Default value = 1)
- is_ipv6 – (Default value = 0)
- encap_vrf_id – (Default value = 0)
- decap_vrf_id – (Default value = 0)
- mcast_sw_if_index – (Default value = 0xFFFFFFFF)
- protocol – (Default value = 3)
- vni – (Default value = 0)
-
wait_for_event
(timeout, name=None)¶ Wait for and return next event.
-
want_bfd_events
(enable_disable=1)¶
-
want_ip4_arp_events
(enable_disable=1, address=0)¶
-
want_ip6_nd_events
(enable_disable=1, address=0)¶
-
want_macs_learn_events
(enable_disable=1, scan_delay=0, max_macs_in_event=0, learn_limit=0)¶
-