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.
16 #ifndef included_lisp_gpe_packet_h
17 #define included_lisp_gpe_packet_h
20 * From draft-lewis-lisp-gpe-02.txt
23 * 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
24 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
25 * |N|L|E|V|I|P|R|O|Ver| Reserved | Next Protocol |
26 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
27 * | Instance ID/Locator-Status-Bits |
28 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
30 * N: The N-bit is the nonce-present bit. When this bit is set to 1,
31 * the low-order 24 bits of the first 32 bits of the LISP header
32 * contain a Nonce. See Section 6.3.1 for details. Both N- and
33 * V-bits MUST NOT be set in the same packet. If they are, a
34 * decapsulating ETR MUST treat the 'Nonce/Map-Version' field as
35 * having a Nonce value present.
37 * L: The L-bit is the 'Locator-Status-Bits' field enabled bit. When
38 * this bit is set to 1, the Locator-Status-Bits in the second
39 * 32 bits of the LISP header are in use.
41 * E: The E-bit is the echo-nonce-request bit. This bit MUST be ignored
42 * and has no meaning when the N-bit is set to 0. When the N-bit is
43 * set to 1 and this bit is set to 1, an ITR is requesting that the
44 * nonce value in the 'Nonce' field be echoed back in LISP-
45 * encapsulated packets when the ITR is also an ETR. See
46 * Section 6.3.1 for details.
48 * V: The V-bit is the Map-Version present bit. When this bit is set to
49 * 1, the N-bit MUST be 0. Refer to Section 6.6.3 for more details.
51 * I: The I-bit is the Instance ID bit. See Section 5.5 for more
52 * details. When this bit is set to 1, the 'Locator-Status-Bits'
53 * field is reduced to 8 bits and the high-order 24 bits are used as
54 * an Instance ID. If the L-bit is set to 0, then the low-order
55 * 8 bits are transmitted as zero and ignored on receipt.
57 * P Bit: Flag bit 5 is defined as the Next Protocol bit. The P bit
58 * MUST be set to 1 to indicate the presence of the 8 bit next
61 * P = 0 indicates that the payload MUST conform to LISP as defined
64 * Flag bit 5 was chosen as the P bit because this flag bit is
65 * currently unallocated in LISP [RFC6830].
67 * O: Flag bit 7 is defined as the O bit. When the O bit is set to 1, the
68 * packet is an OAM packet and OAM processing MUST occur. The OAM
69 * protocol details are out of scope for this document. As with the
70 * P-bit, bit 7 is currently a reserved flag in [RFC6830].
72 * Next Protocol Field: The lower 8 bits of the first word are used to
73 * carry a next protocol. This next protocol field contains the
74 * protocol of the encapsulated payload packet.
76 * LISP [RFC6830] uses the lower 16 bits of the first word for either
77 * a nonce, an echo-nonce ([RFC6830]) or to support map-versioning
78 * ([RFC6834]). These are all optional capabilities that are
79 * indicated by setting the N, E, and the V bit respectively.
81 * To maintain the desired data plane compatibility, when the P bit
82 * is set, the N, E, and V bits MUST be set to zero.
84 * A new protocol registry will be requested from IANA for the Next
85 * Protocol field. This draft defines the following Next Protocol
91 * 0x4: Network Service Header
103 #define foreach_lisp_gpe_flag_bit \
114 #define _(n,v) LISP_GPE_FLAGS_##n = v,
115 foreach_lisp_gpe_flag_bit
117 } vnet_lisp_gpe_flag_bit_t;
119 #define LISP_GPE_VERSION 0x0
121 #define LISP_GPE_NEXT_PROTOCOL_IP4 0x1
122 #define LISP_GPE_NEXT_PROTOCOL_IP6 0x2
123 #define LISP_GPE_NEXT_PROTOCOL_ETHERNET 0x3
124 #define LISP_GPE_NEXT_PROTOCOL_NSH 0x4
128 LISP_GPE_NEXT_PROTO_IP4 = 1,
129 LISP_GPE_NEXT_PROTO_IP6,
130 LISP_GPE_NEXT_PROTO_ETHERNET,
131 LISP_GPE_NEXT_PROTO_NSH,
133 } lisp_gpe_next_protocol_e;
135 #endif /* included_lisp_gpe_packet_h */
138 * fd.io coding-style-patch-verification: ON
141 * eval: (c-set-style "gnu")