|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
36 bool ip4_set =
false, ip6_set =
false;
97 if (ip4_set && ip6_set)
101 "source and destination must be of same address family");
109 rv = VNET_API_ERROR_NO_SUCH_FIB;
127 case VNET_API_ERROR_IF_ALREADY_EXISTS:
130 case VNET_API_ERROR_NO_SUCH_FIB:
134 case VNET_API_ERROR_NO_SUCH_ENTRY:
137 case VNET_API_ERROR_INSTANCE_IN_USE:
140 case VNET_API_ERROR_INVALID_DST_ADDRESS:
143 "destination IP address when mode is multi-point");
192 printf (
"RV %d\n",
rv);
202 .path =
"create ipip tunnel",
203 .short_help =
"create ipip tunnel src <addr> dst <addr> [instance <n>] "
204 "[outer-table-id <ID>] [p2mp]",
208 .path =
"delete ipip tunnel",
209 .short_help =
"delete ipip tunnel sw_if_index <sw_if_index>",
228 s =
format (s,
"[%d] 6rd src %U ip6-pfx %U/%d ",
235 s =
format (s,
"[%d] instance %d src %U dst %U ",
241 s =
format (s,
"[%d] instance %d p2mp src %U ",
247 s =
format (s,
"table-ID %d sw-if-idx %d flags [%U] dscp %U",
295 .path =
"show ipip tunnel",
303 ipip_tunnel_key_t *t = va_arg (*args, ipip_tunnel_key_t *);
305 s =
format (s,
"src:%U dst:%U fib:%d transport:%d mode:%d",
308 t->fib_index, t->transport, t->mode);
318 ipip_tunnel_key_t *
key;
324 vlib_cli_output (vm,
" %U -> %d", format_ipip_tunnel_key, key, index);
337 .path =
"show ipip tunnel-hash",
339 .short_help =
"show ipip tunnel-hash",
352 u32 ip6_prefix_len = 0, ip4_prefix_len = 0, sixrd_tunnel_index;
358 bool security_check =
false;
366 if (
unformat (line_input,
"security-check"))
367 security_check =
true;
399 if (~0 == ip4_fib_index)
402 rv = VNET_API_ERROR_NO_SUCH_FIB;
404 else if (~0 == ip6_fib_index)
407 rv = VNET_API_ERROR_NO_SUCH_FIB;
412 ip4_prefix_len, &ip4_src, security_check,
413 ip4_fib_index, ip6_fib_index,
414 &sixrd_tunnel_index);
459 printf (
"RV %d\n",
rv);
469 .path =
"create 6rd tunnel",
470 .short_help =
"create 6rd tunnel ip6-pfx <ip6-pfx> ip4-pfx <ip4-pfx> "
471 "ip4-src <ip4-addr> ip4-table-id <ID> ip6-table-id <ID> "
476 .path =
"delete 6rd tunnel",
477 .short_help =
"delete 6rd tunnel sw_if_index <sw_if_index>",
static clib_error_t * ipip_tunnel_hash_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
fib_protocol_t fib_proto_from_ip46(ip46_type_t iproto)
Convert from ip46_type to fib_protocol.
vnet_interface_main_t * im
static vlib_cli_command_t delete_ipip_tunnel_command
(constructor) VLIB_CLI_COMMAND (delete_ipip_tunnel_command)
enum tunnel_encap_decap_flags_t_ tunnel_encap_decap_flags_t
static fib_protocol_t fib_ip_proto(bool is_ip6)
Convert from boolean is_ip6 to FIB protocol.
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
#define ip46_address_initializer
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static clib_error_t * create_sixrd_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define clib_error_return(e, args...)
#define hash_foreach(key_var, value_var, h, body)
int sixrd_del_tunnel(u32 sw_if_index)
static clib_error_t * show_ipip_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vl_api_tunnel_mode_t mode
static u8 * format_ipip_tunnel(u8 *s, va_list *args)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
ipip_transport_t transport
static vlib_cli_command_t show_ipip_tunnel_command
(constructor) VLIB_CLI_COMMAND (show_ipip_tunnel_command)
A representation of a IPIP tunnel.
uword unformat_tunnel_mode(unformat_input_t *input, va_list *args)
static vlib_cli_command_t create_sixrd_tunnel_command
(constructor) VLIB_CLI_COMMAND (create_sixrd_tunnel_command)
static vlib_cli_command_t delete_sixrd_tunnel_command
(constructor) VLIB_CLI_COMMAND (delete_sixrd_tunnel_command)
manual_print typedef ip6_prefix
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define pool_foreach(VAR, POOL)
Iterate through pool.
vnet_main_t * vnet_get_main(void)
static clib_error_t * create_ipip_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
ip46_address_t tunnel_dst
uword unformat_tunnel_encap_decap_flags(unformat_input_t *input, va_list *args)
static clib_error_t * delete_ipip_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_CLI_COMMAND(x,...)
int ipip_del_tunnel(u32 sw_if_index)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
struct ipip_tunnel_t::@426 sixrd
ip46_address_t tunnel_src
format_function_t format_vnet_sw_if_index_name
description fragment has unexpected format
format_function_t format_ip46_address
static u8 * format_ipip_tunnel_key(u8 *s, va_list *args)
int sixrd_add_tunnel(ip6_address_t *ip6_prefix, u8 ip6_prefix_len, ip4_address_t *ip4_prefix, u8 ip4_prefix_len, ip4_address_t *ip4_src, bool security_check, u32 ip4_fib_index, u32 ip6_fib_index, u32 *sw_if_index)
static uword pool_elts(void *v)
Number of active elements in a pool.
static clib_error_t * delete_sixrd_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
manual_print typedef ip4_prefix
u8 * format_tunnel_encap_decap_flags(u8 *s, va_list *args)
enum tunnel_mode_t_ tunnel_mode_t
static vlib_cli_command_t ipip_tunnel_hash_show_node
show IPSEC tunnel protection hash tables
tunnel_encap_decap_flags_t flags
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
vl_api_interface_index_t sw_if_index
u8 * format_ip_dscp(u8 *s, va_list *va)
vl_api_fib_path_type_t type
int ipip_add_tunnel(ipip_transport_t transport, u32 instance, ip46_address_t *src, ip46_address_t *dst, u32 fib_index, tunnel_encap_decap_flags_t flags, ip_dscp_t dscp, tunnel_mode_t tmode, u32 *sw_if_indexp)
vl_api_wireguard_peer_flags_t flags
static vlib_cli_command_t create_ipip_tunnel_command
(constructor) VLIB_CLI_COMMAND (create_ipip_tunnel_command)