X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fip%2Fip_frag.h;h=4ddd62b89e60e7654d82dc95d8d1e8242de3bb40;hb=2f4586d9b3507243918c11ce99b9d151d5bde7a0;hp=ef5eb4c0543bb63a89c70a886c8f9d8ae55f610e;hpb=b3655e5592e3e8e48eb087632f3fa71915891a9f;p=vpp.git diff --git a/src/vnet/ip/ip_frag.h b/src/vnet/ip/ip_frag.h index ef5eb4c0543..4ddd62b89e6 100644 --- a/src/vnet/ip/ip_frag.h +++ b/src/vnet/ip/ip_frag.h @@ -36,6 +36,7 @@ #define IP_FRAG_H #include +#include #define IP_FRAG_FLAG_IP4_HEADER 0x01 //Encapsulating IPv4 header #define IP_FRAG_FLAG_IP6_HEADER 0x02 //Encapsulating IPv6 header @@ -48,50 +49,29 @@ extern vlib_node_registration_t ip6_frag_node; typedef enum { - IP4_FRAG_NEXT_IP4_REWRITE, - IP4_FRAG_NEXT_IP4_LOOKUP, - IP4_FRAG_NEXT_IP6_LOOKUP, - IP4_FRAG_NEXT_ICMP_ERROR, - IP4_FRAG_NEXT_DROP, - IP4_FRAG_N_NEXT -} ip4_frag_next_t; + IP_FRAG_NEXT_IP_REWRITE, + IP_FRAG_NEXT_IP_REWRITE_MIDCHAIN, + IP_FRAG_NEXT_IP4_LOOKUP, + IP_FRAG_NEXT_IP6_LOOKUP, + IP_FRAG_NEXT_ICMP_ERROR, + IP_FRAG_NEXT_DROP, + IP_FRAG_N_NEXT +} ip_frag_next_t; -typedef enum -{ - IP6_FRAG_NEXT_IP4_LOOKUP, - IP6_FRAG_NEXT_IP6_LOOKUP, - IP6_FRAG_NEXT_IP6_REWRITE, - IP6_FRAG_NEXT_DROP, - IP6_FRAG_N_NEXT -} ip6_frag_next_t; +typedef vl_counter_ip_frag_enum_t ip_frag_error_t; -#define foreach_ip_frag_error \ - /* Must be first. */ \ - _(NONE, "packet fragmented") \ - _(SMALL_PACKET, "packet smaller than MTU") \ - _(FRAGMENT_SENT, "number of sent fragments") \ - _(CANT_FRAGMENT_HEADER, "can't fragment header") \ - _(DONT_FRAGMENT_SET, "can't fragment this packet") \ - _(MALFORMED, "malformed packet") \ - _(MEMORY, "could not allocate buffer") \ - _(UNKNOWN, "unknown error") +void ip_frag_set_vnet_buffer (vlib_buffer_t * b, u16 mtu, + u8 next_index, u8 flags); -typedef enum -{ -#define _(sym,str) IP_FRAG_ERROR_##sym, - foreach_ip_frag_error -#undef _ - IP_FRAG_N_ERROR, -} ip_frag_error_t; +extern ip_frag_error_t ip4_frag_do_fragment (vlib_main_t * vm, + u32 from_bi, + u16 mtu, + u16 encapsize, u32 ** buffer); +extern ip_frag_error_t ip6_frag_do_fragment (vlib_main_t * vm, + u32 from_bi, + u16 mtu, + u16 encapsize, u32 ** buffer); -void ip_frag_set_vnet_buffer (vlib_buffer_t * b, u16 offset, u16 mtu, - u8 next_index, u8 flags); -void -ip4_frag_do_fragment (vlib_main_t * vm, u32 pi, u32 ** buffer, - ip_frag_error_t * error); -void -ip6_frag_do_fragment (vlib_main_t * vm, u32 pi, u32 ** buffer, - ip_frag_error_t * error); #endif /* ifndef IP_FRAG_H */ /*