2 * Copyright (c) 2016 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.
17 * @brief LISP-GPE packet header structure
21 #ifndef included_lisp_gpe_packet_h
22 #define included_lisp_gpe_packet_h
25 * From draft-lewis-lisp-gpe-02.txt
28 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
29 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
30 * |N|L|E|V|I|P|R|O|Ver| Reserved | Next Protocol |
31 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
32 * | Instance ID/Locator-Status-Bits |
33 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
35 * N: The N-bit is the nonce-present bit. When this bit is set to 1,
36 * the low-order 24 bits of the first 32 bits of the LISP header
37 * contain a Nonce. See Section 6.3.1 for details. Both N- and
38 * V-bits MUST NOT be set in the same packet. If they are, a
39 * decapsulating ETR MUST treat the 'Nonce/Map-Version' field as
40 * having a Nonce value present.
42 * L: The L-bit is the 'Locator-Status-Bits' field enabled bit. When
43 * this bit is set to 1, the Locator-Status-Bits in the second
44 * 32 bits of the LISP header are in use.
46 * E: The E-bit is the echo-nonce-request bit. This bit MUST be ignored
47 * and has no meaning when the N-bit is set to 0. When the N-bit is
48 * set to 1 and this bit is set to 1, an ITR is requesting that the
49 * nonce value in the 'Nonce' field be echoed back in LISP-
50 * encapsulated packets when the ITR is also an ETR. See
51 * Section 6.3.1 for details.
53 * V: The V-bit is the Map-Version present bit. When this bit is set to
54 * 1, the N-bit MUST be 0. Refer to Section 6.6.3 for more details.
56 * I: The I-bit is the Instance ID bit. See Section 5.5 for more
57 * details. When this bit is set to 1, the 'Locator-Status-Bits'
58 * field is reduced to 8 bits and the high-order 24 bits are used as
59 * an Instance ID. If the L-bit is set to 0, then the low-order
60 * 8 bits are transmitted as zero and ignored on receipt.
62 * P Bit: Flag bit 5 is defined as the Next Protocol bit. The P bit
63 * MUST be set to 1 to indicate the presence of the 8 bit next
66 * P = 0 indicates that the payload MUST conform to LISP as defined
69 * Flag bit 5 was chosen as the P bit because this flag bit is
70 * currently unallocated in LISP [RFC6830].
72 * O: Flag bit 7 is defined as the O bit. When the O bit is set to 1, the
73 * packet is an OAM packet and OAM processing MUST occur. The OAM
74 * protocol details are out of scope for this document. As with the
75 * P-bit, bit 7 is currently a reserved flag in [RFC6830].
77 * Next Protocol Field: The lower 8 bits of the first word are used to
78 * carry a next protocol. This next protocol field contains the
79 * protocol of the encapsulated payload packet.
81 * LISP [RFC6830] uses the lower 16 bits of the first word for either
82 * a nonce, an echo-nonce ([RFC6830]) or to support map-versioning
83 * ([RFC6834]). These are all optional capabilities that are
84 * indicated by setting the N, E, and the V bit respectively.
86 * To maintain the desired data plane compatibility, when the P bit
87 * is set, the N, E, and V bits MUST be set to zero.
89 * A new protocol registry will be requested from IANA for the Next
90 * Protocol field. This draft defines the following Next Protocol
96 * 0x4: Network Service Header
99 /** LISP-GPE header */
109 #define foreach_lisp_gpe_flag_bit \
120 #define _(n,v) LISP_GPE_FLAGS_##n = v,
121 foreach_lisp_gpe_flag_bit
123 } vnet_lisp_gpe_flag_bit_t;
125 #define LISP_GPE_VERSION 0x0
127 #define LISP_GPE_NEXT_PROTOCOL_IP4 0x1
128 #define LISP_GPE_NEXT_PROTOCOL_IP6 0x2
129 #define LISP_GPE_NEXT_PROTOCOL_ETHERNET 0x3
130 #define LISP_GPE_NEXT_PROTOCOL_NSH 0x4
134 LISP_GPE_NEXT_PROTO_IP4 = 1,
135 LISP_GPE_NEXT_PROTO_IP6,
136 LISP_GPE_NEXT_PROTO_ETHERNET,
137 LISP_GPE_NEXT_PROTO_NSH,
139 } lisp_gpe_next_protocol_e;
141 #endif /* included_lisp_gpe_packet_h */
144 * fd.io coding-style-patch-verification: ON
147 * eval: (c-set-style "gnu")