netdev-dpdk: fix mbuf leaks
[cascardo/ovs.git] / lib / geneve.h
1 /*
2  * Copyright (c) 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 GENEVE_H
18 #define GENEVE_H 1
19
20 #include "openvswitch/types.h"
21
22 #define TLV_MAX_OPT_SIZE 124
23 #define TLV_TOT_OPT_SIZE 252
24
25 #define GENEVE_CRIT_OPT_TYPE (1 << 7)
26
27 struct geneve_opt {
28     ovs_be16  opt_class;
29     uint8_t   type;
30 #ifdef WORDS_BIGENDIAN
31     uint8_t   r1:1;
32     uint8_t   r2:1;
33     uint8_t   r3:1;
34     uint8_t   length:5;
35 #else
36     uint8_t   length:5;
37     uint8_t   r3:1;
38     uint8_t   r2:1;
39     uint8_t   r1:1;
40 #endif
41     /* Option data */
42 };
43
44 struct genevehdr {
45 #ifdef WORDS_BIGENDIAN
46     uint8_t ver:2;
47     uint8_t opt_len:6;
48     uint8_t oam:1;
49     uint8_t critical:1;
50     uint8_t rsvd1:6;
51 #else
52     uint8_t opt_len:6;
53     uint8_t ver:2;
54     uint8_t rsvd1:6;
55     uint8_t critical:1;
56     uint8_t oam:1;
57 #endif
58     ovs_be16 proto_type;
59     ovs_16aligned_be32 vni;
60     struct geneve_opt options[];
61 };
62
63 #endif /* geneve.h */