1 /*---------------------------------------------------------------------------
2 * Copyright (c) 2009-2014 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *---------------------------------------------------------------------------
17 * IPv4 and IPv6 Fragmentation Nodes
19 * A packet sent to those nodes require the following
20 * buffer attributes to be set:
21 * ip_frag.header_offset :
22 * Where to find the IPv4 (or IPv6) header in the packet. Previous
23 * bytes are left untouched and copied in every fragment. The fragments
24 * are then appended. This option is used for fragmented packets
25 * that are encapsulated.
27 * Maximum size of IP packets, header included, but ignoring
28 * the 'ip_frag.header_offset' copied bytes.
29 * ip_frag.next_index :
30 * One of ip_frag_next_t, indicating to which exit node the fragments
38 #include <vnet/vnet.h>
40 #define IP_FRAG_FLAG_IP4_HEADER 0x01 //Encapsulating IPv4 header
41 #define IP_FRAG_FLAG_IP6_HEADER 0x02 //Encapsulating IPv6 header
43 #define IP4_FRAG_NODE_NAME "ip4-frag"
44 #define IP6_FRAG_NODE_NAME "ip6-frag"
46 vlib_node_registration_t ip4_frag_node;
47 vlib_node_registration_t ip6_frag_node;
50 IP4_FRAG_NEXT_IP4_LOOKUP,
51 IP4_FRAG_NEXT_IP6_LOOKUP,
57 IP6_FRAG_NEXT_IP4_LOOKUP,
58 IP6_FRAG_NEXT_IP6_LOOKUP,
63 #define foreach_ip_frag_error \
64 /* Must be first. */ \
65 _(NONE, "packet fragmented") \
66 _(SMALL_PACKET, "packet smaller than MTU") \
67 _(FRAGMENT_SENT, "number of sent fragments") \
68 _(CANT_FRAGMENT_HEADER, "can't fragment header'") \
69 _(DONT_FRAGMENT_SET, "can't fragment this packet'") \
70 _(MALFORMED, "malformed packet") \
71 _(MEMORY, "could not allocate buffer") \
72 _(UNKNOWN, "unknown error")
75 #define _(sym,str) IP_FRAG_ERROR_##sym,
81 #endif /* ifndef IP_FRAG_H */