85 clib_host_to_net_u32 (6 << 28);
122 ip4->
protocol = IP_PROTOCOL_IP_IN_IP;
143 b->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
159 ip6->
protocol = IP_PROTOCOL_IP_IN_IP;
179 sw_if_index = adj->rewrite_header.sw_if_index;
280 u32 dev_instance = va_arg (*args,
u32);
285 return format (s,
"<improperly-referenced>");
294 u32 dev_instance = va_arg (*args,
u32);
297 s =
format (s,
"IPIP tunnel: id %d\n", dev_instance);
326 .name =
"IPIP tunnel device",
416 return (>->
p2p.node);
450 t->
p2p.fib_entry_index =
453 t->
p2p.sibling_index =
468 u32 instance, ip46_address_t *
src, ip46_address_t *
dst,
469 u32 fib_index,
u8 tc_tos,
u32 * sw_if_indexp)
479 .fib_index = fib_index,
485 return VNET_API_ERROR_IF_ALREADY_EXISTS;
488 memset (t, 0,
sizeof (*t));
492 u32 u_idx = instance;
498 return VNET_API_ERROR_INSTANCE_IN_USE;
575 return VNET_API_ERROR_NO_SUCH_ENTRY;
593 memset (gm, 0,
sizeof (gm[0]));
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
void ipip_tunnel_db_remove(ipip_tunnel_t *t)
Recursive resolution source.
Contribute an object that is to be used to forward IP6 packets.
#define hash_set(h, key, value)
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
#define hash_unset(h, key)
void ip6_register_protocol(u32 protocol, u32 node_index)
static fib_node_t * ipip_tunnel_fib_node_get(fib_node_index_t index)
A representation of a IPIP tunnel.
struct ipip_tunnel_t::@227::@229 p2p
vnet_main_t * vnet_get_main(void)
int ipip_add_tunnel(ipip_transport_t transport, u32 instance, ip46_address_t *src, ip46_address_t *dst, u32 fib_index, u8 tc_tos, u32 *sw_if_indexp)
void fib_node_init(fib_node_t *node, fib_node_type_t type)
ip46_address_t tunnel_src
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
static clib_error_t * ipip_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
const u8 * adj_get_rewrite(adj_index_t ai)
Return the rewrite string of the adjacency.
vnet_hw_interface_class_t ipip_hw_interface_class
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
static u32 ip4_compute_flow_hash(const ip4_header_t *ip, flow_hash_config_t flow_hash_config)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
void fib_entry_contribute_forwarding(fib_node_index_t fib_entry_index, fib_forward_chain_type_t fct, dpo_id_t *dpo)
flow_hash_config_t lb_hash_config
the hash config to use when selecting a bucket.
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
void fib_entry_child_remove(fib_node_index_t fib_entry_index, u32 sibling_index)
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
static u8 * format_ipip_device(u8 *s, va_list *args)
Contribute an object that is to be used to forward IP4 packets.
#define hash_set_mem(h, key, value)
void fib_node_deinit(fib_node_t *node)
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
#define VNET_HW_INTERFACE_FLAG_LINK_UP
void ip4_register_protocol(u32 protocol, u32 node_index)
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
bool ip4_protocol_registered
fib_node_type_t fib_node_register_new_type(const fib_node_vft_t *vft)
Create a new FIB node type and Register the function table for it.
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
vnet_link_t ia_link
link/ether-type 1 bytes
static void ipip_tunnel_last_lock_gone(fib_node_t *node)
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
memset(h->entries, 0, sizeof(h->entries[0])*entries)
static void ipip4_fixup(vlib_main_t *vm, ip_adjacency_t *adj, vlib_buffer_t *b, const void *data)
#define VLIB_INIT_FUNCTION(x)
u16 lb_n_buckets_minus_1
number of buckets in the load-balance - 1.
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
static_always_inline void ip6_set_traffic_class_network_order(ip6_header_t *ip6, u8 dscp)
static_always_inline u8 ip6_traffic_class_network_order(const ip6_header_t *ip6)
static void ipip_tunnel_restack(ipip_tunnel_t *gt)
Aggregrate type for a prefix.
u32 * tunnel_index_by_sw_if_index
ipip_transport_t transport
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define hash_create_mem(elts, key_bytes, value_bytes)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define hash_unset_mem(h, key)
void ipip_tunnel_db_add(ipip_tunnel_t *t, ipip_tunnel_key_t *key)
static void ipip_tunnel_stack(adj_index_t ai)
static u8 * ipip_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
static uword vnet_hw_interface_get_flags(vnet_main_t *vnm, u32 hw_if_index)
ipip_tunnel_t * ipip_tunnel_db_find(ipip_tunnel_key_t *key)
dpo_type_t dpoi_type
the type
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
ipip_tunnel_t * ipip_tunnel_db_find_by_sw_if_index(u32 sw_if_index)
load-balancing over a choice of [un]equal cost paths
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
static u32 ip6_compute_flow_hash(const ip6_header_t *ip, flow_hash_config_t flow_hash_config)
#define pool_put(P, E)
Free an object E in pool P.
fib_node_type_t fn_type
The node's type.
An node in the FIB graph.
u8 * format_ipip_tx_trace(u8 *s, va_list *args)
static void ipip6_fixup(vlib_main_t *vm, ip_adjacency_t *adj, vlib_buffer_t *b, const void *data)
static adj_walk_rc_t ipip_adj_walk_cb(adj_index_t ai, void *ctx)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P (general version).
fib_node_index_t fib_table_entry_special_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags)
Add a 'special' entry to the FIB.
VNET_HW_INTERFACE_CLASS(ipip_hw_interface_class)
ipip_transport_t
IPIP Tunnel key.
void fib_table_entry_delete_index(fib_node_index_t fib_entry_index, fib_source_t source)
Delete a FIB entry.
static u8 * format_ipip_tunnel_name(u8 *s, va_list *args)
void adj_nbr_midchain_update_rewrite(adj_index_t adj_index, adj_midchain_fixup_t fixup, const void *fixup_data, adj_flags_t flags, u8 *rewrite)
adj_nbr_midchain_update_rewrite
#define clib_memcpy(a, b, c)
static void ipip_fib_add(ipip_tunnel_t *t)
Packets TX through the midchain do not increment the interface counters.
vlib_node_registration_t ipip4_input_node
(constructor) VLIB_REGISTER_NODE (ipip4_input_node)
u32 fib_node_index_t
A typedef of a node index.
void(* adj_midchain_fixup_t)(vlib_main_t *vm, struct ip_adjacency_t_ *adj, vlib_buffer_t *b0, const void *data)
A function type for post-rewrite fixups on midchain adjacency.
u32 adj_index_t
An index for adjacencies.
void adj_nbr_walk(u32 sw_if_index, fib_protocol_t adj_nh_proto, adj_walk_cb_t cb, void *ctx)
Walk the neighbour Adjacencies on a given interface.
Context passed between object during a back walk.
fib_node_type_t fib_node_type
void adj_nbr_midchain_stack(adj_index_t adj_index, const dpo_id_t *next)
adj_nbr_midchain_stack
static ipip_tunnel_t * ipip_tunnel_from_fib_node(fib_node_t *node)
ipip_transport_t transport
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
static load_balance_t * load_balance_get(index_t lbi)
static void ipip_fib_delete(ipip_tunnel_t *t)
static void clib_mem_free(void *p)
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
void adj_nbr_midchain_unstack(adj_index_t adj_index)
adj_nbr_midchain_unstack
static void * clib_mem_alloc(uword size)
void ipip_update_adj(vnet_main_t *vnm, u32 sw_if_index, adj_index_t ai)
void vnet_delete_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vlib_node_registration_t ipip6_input_node
(constructor) VLIB_REGISTER_NODE (ipip6_input_node)
index_t dpoi_index
the index of objects of that type
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
bool ip6_protocol_registered
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
static clib_error_t * ipip_init(vlib_main_t *vm)
a point 2 point interface
void vnet_sw_interface_set_mtu(vnet_main_t *vnm, u32 sw_if_index, u32 mtu)
int ipip_del_tunnel(u32 sw_if_index)
#define FOR_EACH_FIB_IP_PROTOCOL(_item)
#define hash_get_mem(h, key)
A FIB graph nodes virtual function table.
ip4_main_t ip4_main
Global ip4 main structure.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
ip46_address_t tunnel_dst
#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
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
u32 * fib_index_by_sw_if_index
static fib_node_back_walk_rc_t ipip_tunnel_back_walk(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
static u16 ip4_header_checksum(ip4_header_t *i)
VNET_DEVICE_CLASS(ipip_device_class)