ovsdb-server: Fix a reference count leak bug
[cascardo/ovs.git] / include / openflow / netronome-ext.h
1 /*
2  * Copyright (c) 2014 Netronome.
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 OPENFLOW_NETRONOME_EXT_H
18 #define OPENFLOW_NETRONOME_EXT_H 1
19
20 #include "openflow/openflow.h"
21 #include "openvswitch/types.h"
22
23 /* The following vendor extension, proposed by Netronome, is not yet
24  * standardized, so they are not included in openflow.h.  It may
25  * be suitable for standardization */
26
27 \f
28 /* Netronome enhanced select group */
29
30 enum ntr_group_mod_subtype {
31         NTRT_SELECTION_METHOD = 1,
32 };
33
34 #define NTR_MAX_SELECTION_METHOD_LEN 16
35
36 struct ntr_group_prop_selection_method {
37     ovs_be16 type;                  /* OFPGPT15_EXPERIMENTER. */
38     ovs_be16 length;                /* Length in bytes of this property
39                                      * excluding trailing padding. */
40     ovs_be32 experimenter;          /* NTR_VENDOR_ID. */
41     ovs_be32 exp_type;              /* NTRT_SELECTION_METHOD. */
42     ovs_be32 pad;
43     char selection_method[NTR_MAX_SELECTION_METHOD_LEN];
44                                     /* Null-terminated */
45     ovs_be64 selection_method_param;  /* Non-Field parameter for
46                                        * bucket selection. */
47
48     /* Followed by:
49      *   - Exactly (length - 40) (possibly 0) bytes containing OXM TLVs, then
50      *   - Exactly ((length + 7)/8*8 - length) (between 0 and 7) bytes of
51      *     all-zero bytes
52      * In summary, ntr_group_prop_selection_method is padded as needed,
53      * to make its overall size a multiple of 8, to preserve alignment
54      * in structures using it.
55      */
56     /* uint8_t field_array[0]; */   /* Zero or more fields encoded as
57                                      * OXM TLVs where the has_mask bit must
58                                      * be zero and the value it specifies is
59                                      * a mask to apply to packet fields and
60                                      * then input them to the selection
61                                      * method of a select group. */
62     /* uint8_t pad2[0]; */
63 };
64 OFP_ASSERT(sizeof(struct ntr_group_prop_selection_method) == 40);
65
66 #endif /* openflow/netronome-ext.h */