]>
Commit | Line | Data |
---|---|---|
b2bd6da6 BW |
1 | /* |
2 | * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc. | |
3 | * | |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at: | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | ||
17 | #ifndef OPENVSWITCH_PACKETS_H | |
18 | #define OPENVSWITCH_PACKETS_H 1 | |
19 | ||
20 | #include <netinet/in.h> | |
21 | #include "openvswitch/tun-metadata.h" | |
22 | ||
23 | /* Tunnel information used in flow key and metadata. */ | |
24 | struct flow_tnl { | |
25 | ovs_be32 ip_dst; | |
26 | struct in6_addr ipv6_dst; | |
27 | ovs_be32 ip_src; | |
28 | struct in6_addr ipv6_src; | |
29 | ovs_be64 tun_id; | |
30 | uint16_t flags; | |
31 | uint8_t ip_tos; | |
32 | uint8_t ip_ttl; | |
33 | ovs_be16 tp_src; | |
34 | ovs_be16 tp_dst; | |
35 | ovs_be16 gbp_id; | |
36 | uint8_t gbp_flags; | |
37 | uint8_t pad1[5]; /* Pad to 64 bits. */ | |
38 | struct tun_metadata metadata; | |
39 | }; | |
40 | ||
41 | /* Some flags are exposed through OpenFlow while others are used only | |
42 | * internally. */ | |
43 | ||
44 | /* Public flags */ | |
45 | #define FLOW_TNL_F_OAM (1 << 0) | |
46 | ||
47 | #define FLOW_TNL_PUB_F_MASK ((1 << 1) - 1) | |
48 | ||
49 | /* Private flags */ | |
50 | #define FLOW_TNL_F_DONT_FRAGMENT (1 << 1) | |
51 | #define FLOW_TNL_F_CSUM (1 << 2) | |
52 | #define FLOW_TNL_F_KEY (1 << 3) | |
53 | ||
54 | #define FLOW_TNL_F_MASK ((1 << 4) - 1) | |
55 | ||
56 | /* Unfortunately, a "struct flow" sometimes has to handle OpenFlow port | |
57 | * numbers and other times datapath (dpif) port numbers. This union allows | |
58 | * access to both. */ | |
59 | union flow_in_port { | |
60 | odp_port_t odp_port; | |
61 | ofp_port_t ofp_port; | |
62 | }; | |
63 | ||
64 | #endif /* packets.h */ |