blob: 64b39f2c40bd5a2496a6fb5a3302001ebdf0706a [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001#ifndef included_vnet_gre_packet_h
2#define included_vnet_gre_packet_h
3
4/*
5 * GRE packet format
6 *
7 * Copyright (c) 2012 Cisco and/or its affiliates.
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at:
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21#define foreach_gre_protocol \
22_ (0x0800, ip4) \
23_ (0x86DD, ip6) \
David Hothama8cd3092016-09-19 09:55:07 -070024_ (0x6558, teb) \
Ed Warnickecb9cada2015-12-08 15:45:58 -070025_ (0x0806, arp) \
26_ (0x8847, mpls_unicast) \
27_ (0x894F, nsh)
28
Swarup Nayak9ff647a2017-11-27 10:27:43 +053029typedef enum
30{
Ed Warnickecb9cada2015-12-08 15:45:58 -070031#define _(n,f) GRE_PROTOCOL_##f = n,
32 foreach_gre_protocol
33#undef _
34} gre_protocol_t;
35
Swarup Nayak9ff647a2017-11-27 10:27:43 +053036typedef struct
37{
Ed Warnickecb9cada2015-12-08 15:45:58 -070038 /* flags and version */
39 u16 flags_and_version;
40 /* unimplemented at the moment */
41#define GRE_FLAGS_CHECKSUM (1 << 15)
42
43 /* deprecated, according to rfc2784 */
44#define GRE_FLAGS_ROUTING (1 << 14)
45#define GRE_FLAGS_KEY (1 << 13)
46#define GRE_FLAGS_SEQUENCE (1 << 12)
47#define GRE_FLAGS_STRICT_SOURCE_ROUTE (1 << 11)
48
49 /* version 1 is PPTP which we don't support */
50#define GRE_SUPPORTED_VERSION 0
51#define GRE_VERSION_MASK 0x7
52
53 /* 0x800 for ip4, etc. */
54 u16 protocol;
55} gre_header_t;
56
57#endif /* included_vnet_gre_packet_h */
Swarup Nayak9ff647a2017-11-27 10:27:43 +053058
59/*
60 * fd.io coding-style-patch-verification: ON
61 *
62 * Local Variables:
63 * eval: (c-set-style "gnu")
64 * End:
65 */