X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fip%2Fip4.h;h=af0e6b9a8a51794b8b5715fe62e417d7211ed517;hb=1bfd37295f5cd332b7326923f1fbd5e0415829cd;hp=74faa05947e9937af5c0263d427c723dcfc51064;hpb=66b11318a1e5f24880e3ec77c95d70647732a4a8;p=vpp.git diff --git a/src/vnet/ip/ip4.h b/src/vnet/ip/ip4.h index 74faa05947e..af0e6b9a8a5 100644 --- a/src/vnet/ip/ip4.h +++ b/src/vnet/ip/ip4.h @@ -44,6 +44,7 @@ #include #include #include +#include typedef struct ip4_mfib_t { @@ -72,6 +73,16 @@ typedef struct uword function_opaque; } ip4_add_del_interface_address_callback_t; +typedef void (ip4_table_bind_function_t) + (struct ip4_main_t * im, + uword opaque, u32 sw_if_index, u32 new_fib_index, u32 old_fib_index); + +typedef struct +{ + ip4_table_bind_function_t *function; + uword function_opaque; +} ip4_table_bind_callback_t; + /** * @brief IPv4 main type. * @@ -117,6 +128,9 @@ typedef struct ip4_main_t ip4_add_del_interface_address_callback_t * add_del_interface_address_callbacks; + /** Functions to call when interface to table biding changes. */ + ip4_table_bind_callback_t *table_bind_callbacks; + /** Template used to generate IP4 ARP packets. */ vlib_packet_template_t ip4_arp_request_packet_template; @@ -354,6 +368,8 @@ vlib_buffer_push_ip4 (vlib_main_t * vm, vlib_buffer_t * b, ih->checksum = 0; b->flags |= VNET_BUFFER_F_OFFLOAD_IP_CKSUM | VNET_BUFFER_F_IS_IP4; vnet_buffer (b)->l3_hdr_offset = (u8 *) ih - b->data; + vnet_buffer (b)->l4_hdr_offset = vnet_buffer (b)->l3_hdr_offset + + sizeof (*ih); } else ih->checksum = ip4_header_checksum (ih);