29 "[%d] %U (src) %U (dst) outer_fib_index %d",
45 u32 hw_if_index, sw_if_index;
57 return VNET_API_ERROR_INVALID_VALUE;
61 return VNET_API_ERROR_NO_SUCH_FIB;
63 outer_fib_index = p[0];
66 memset (t, 0,
sizeof (*t));
128 return VNET_API_ERROR_NO_SUCH_ENTRY;
144 *sw_if_indexp = sw_if_index;
158 u32 outer_fib_id = 0;
175 else if (
unformat (line_input,
"outer-fib-id %d", &outer_fib_id))
186 if (memcmp (&src, &dst,
sizeof(src)) == 0)
189 memset (a, 0,
sizeof (*a));
202 case VNET_API_ERROR_INVALID_VALUE:
204 case VNET_API_ERROR_NO_SUCH_FIB:
215 .path =
"create gre tunnel",
216 .short_help =
"create gre tunnel src <addr> dst <addr> " 217 "[outer-fib-id <fib>] [del]",
234 vlib_cli_output (vm,
"%U", format_gre_tunnel, t);
241 .path =
"show gre tunnel",
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
#define hash_set(h, key, value)
#define hash_unset(h, key)
vnet_interface_main_t interface_main
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
format_function_t format_vnet_sw_if_index_name
u32 * tunnel_index_by_sw_if_index
vnet_main_t * vnet_get_main(void)
u32 * free_gre_tunnel_hw_if_indices
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
#define VLIB_INIT_FUNCTION(x)
u8 * format_gre_tunnel(u8 *s, va_list *args)
vlib_combined_counter_main_t * combined_sw_if_counters
clib_error_t * gre_interface_init(vlib_main_t *vm)
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
static clib_error_t * create_gre_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread u16 counters, and the shared vlib_counter_t...
uword * fib_index_by_table_id
Hash table mapping table id to fib index.
#define pool_put(P, E)
Free an object E in pool P.
vlib_simple_counter_main_t * sw_if_counters
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P (general version).
static clib_error_t * show_gre_tunnel_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define clib_memcpy(a, b, c)
static void vnet_interface_counter_unlock(vnet_interface_main_t *im)
static void vnet_interface_counter_lock(vnet_interface_main_t *im)
u32 max_l3_packet_bytes[VLIB_N_RX_TX]
static void vlib_zero_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
Clear a simple counter Clears the set of per-thread u16 counters, and the u64 counter.
vnet_hw_interface_class_t gre_hw_interface_class
vnet_device_class_t gre_device_class
VLIB_CLI_COMMAND(set_interface_ip_source_and_port_range_check_command, static)
#define GRE_OUTPUT_NEXT_LOOKUP
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
ip4_main_t ip4_main
Global ip4 main structure.
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
u32 per_packet_overhead_bytes
#define clib_error_return(e, args...)
uword vlib_node_add_named_next_with_slot(vlib_main_t *vm, uword node, char *name, uword slot)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
#define CLIB_CACHE_LINE_BYTES
int vnet_gre_add_del_tunnel(vnet_gre_add_del_tunnel_args_t *a, u32 *sw_if_indexp)
static uword pool_elts(void *v)
Number of active elements in a pool.