374191bdbe2269c1d9604d6ecc74b644d6f0e268
[govpp.git] / internal / testbinapi / binapi2001 / gso / gso.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/core/gso.api.json
6
7 // Package gso contains generated bindings for API file gso.api.
8 //
9 // Contents:
10 //   1 alias
11 //   6 enums
12 //   2 messages
13 //
14 package gso
15
16 import (
17         api "git.fd.io/govpp.git/api"
18         codec "git.fd.io/govpp.git/codec"
19         "strconv"
20 )
21
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
27
28 const (
29         APIFile    = "gso"
30         APIVersion = "1.0.0"
31         VersionCrc = 0xecb22d44
32 )
33
34 // IfStatusFlags defines enum 'if_status_flags'.
35 type IfStatusFlags uint32
36
37 const (
38         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
39         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
40 )
41
42 var (
43         IfStatusFlags_name = map[uint32]string{
44                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
45                 2: "IF_STATUS_API_FLAG_LINK_UP",
46         }
47         IfStatusFlags_value = map[string]uint32{
48                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
49                 "IF_STATUS_API_FLAG_LINK_UP":  2,
50         }
51 )
52
53 func (x IfStatusFlags) String() string {
54         s, ok := IfStatusFlags_name[uint32(x)]
55         if ok {
56                 return s
57         }
58         str := func(n uint32) string {
59                 s, ok := IfStatusFlags_name[uint32(n)]
60                 if ok {
61                         return s
62                 }
63                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
64         }
65         for i := uint32(0); i <= 32; i++ {
66                 val := uint32(x)
67                 if val&(1<<i) != 0 {
68                         if s != "" {
69                                 s += "|"
70                         }
71                         s += str(1 << i)
72                 }
73         }
74         if s == "" {
75                 return str(uint32(x))
76         }
77         return s
78 }
79
80 // IfType defines enum 'if_type'.
81 type IfType uint32
82
83 const (
84         IF_API_TYPE_HARDWARE IfType = 1
85         IF_API_TYPE_SUB      IfType = 2
86         IF_API_TYPE_P2P      IfType = 3
87         IF_API_TYPE_PIPE     IfType = 4
88 )
89
90 var (
91         IfType_name = map[uint32]string{
92                 1: "IF_API_TYPE_HARDWARE",
93                 2: "IF_API_TYPE_SUB",
94                 3: "IF_API_TYPE_P2P",
95                 4: "IF_API_TYPE_PIPE",
96         }
97         IfType_value = map[string]uint32{
98                 "IF_API_TYPE_HARDWARE": 1,
99                 "IF_API_TYPE_SUB":      2,
100                 "IF_API_TYPE_P2P":      3,
101                 "IF_API_TYPE_PIPE":     4,
102         }
103 )
104
105 func (x IfType) String() string {
106         s, ok := IfType_name[uint32(x)]
107         if ok {
108                 return s
109         }
110         return "IfType(" + strconv.Itoa(int(x)) + ")"
111 }
112
113 // LinkDuplex defines enum 'link_duplex'.
114 type LinkDuplex uint32
115
116 const (
117         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
118         LINK_DUPLEX_API_HALF    LinkDuplex = 1
119         LINK_DUPLEX_API_FULL    LinkDuplex = 2
120 )
121
122 var (
123         LinkDuplex_name = map[uint32]string{
124                 0: "LINK_DUPLEX_API_UNKNOWN",
125                 1: "LINK_DUPLEX_API_HALF",
126                 2: "LINK_DUPLEX_API_FULL",
127         }
128         LinkDuplex_value = map[string]uint32{
129                 "LINK_DUPLEX_API_UNKNOWN": 0,
130                 "LINK_DUPLEX_API_HALF":    1,
131                 "LINK_DUPLEX_API_FULL":    2,
132         }
133 )
134
135 func (x LinkDuplex) String() string {
136         s, ok := LinkDuplex_name[uint32(x)]
137         if ok {
138                 return s
139         }
140         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
141 }
142
143 // MtuProto defines enum 'mtu_proto'.
144 type MtuProto uint32
145
146 const (
147         MTU_PROTO_API_L3   MtuProto = 1
148         MTU_PROTO_API_IP4  MtuProto = 2
149         MTU_PROTO_API_IP6  MtuProto = 3
150         MTU_PROTO_API_MPLS MtuProto = 4
151         MTU_PROTO_API_N    MtuProto = 5
152 )
153
154 var (
155         MtuProto_name = map[uint32]string{
156                 1: "MTU_PROTO_API_L3",
157                 2: "MTU_PROTO_API_IP4",
158                 3: "MTU_PROTO_API_IP6",
159                 4: "MTU_PROTO_API_MPLS",
160                 5: "MTU_PROTO_API_N",
161         }
162         MtuProto_value = map[string]uint32{
163                 "MTU_PROTO_API_L3":   1,
164                 "MTU_PROTO_API_IP4":  2,
165                 "MTU_PROTO_API_IP6":  3,
166                 "MTU_PROTO_API_MPLS": 4,
167                 "MTU_PROTO_API_N":    5,
168         }
169 )
170
171 func (x MtuProto) String() string {
172         s, ok := MtuProto_name[uint32(x)]
173         if ok {
174                 return s
175         }
176         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
177 }
178
179 // RxMode defines enum 'rx_mode'.
180 type RxMode uint32
181
182 const (
183         RX_MODE_API_UNKNOWN   RxMode = 0
184         RX_MODE_API_POLLING   RxMode = 1
185         RX_MODE_API_INTERRUPT RxMode = 2
186         RX_MODE_API_ADAPTIVE  RxMode = 3
187         RX_MODE_API_DEFAULT   RxMode = 4
188 )
189
190 var (
191         RxMode_name = map[uint32]string{
192                 0: "RX_MODE_API_UNKNOWN",
193                 1: "RX_MODE_API_POLLING",
194                 2: "RX_MODE_API_INTERRUPT",
195                 3: "RX_MODE_API_ADAPTIVE",
196                 4: "RX_MODE_API_DEFAULT",
197         }
198         RxMode_value = map[string]uint32{
199                 "RX_MODE_API_UNKNOWN":   0,
200                 "RX_MODE_API_POLLING":   1,
201                 "RX_MODE_API_INTERRUPT": 2,
202                 "RX_MODE_API_ADAPTIVE":  3,
203                 "RX_MODE_API_DEFAULT":   4,
204         }
205 )
206
207 func (x RxMode) String() string {
208         s, ok := RxMode_name[uint32(x)]
209         if ok {
210                 return s
211         }
212         return "RxMode(" + strconv.Itoa(int(x)) + ")"
213 }
214
215 // SubIfFlags defines enum 'sub_if_flags'.
216 type SubIfFlags uint32
217
218 const (
219         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
220         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
221         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
222         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
223         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
224         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
225         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
226         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
227         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
228         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
229 )
230
231 var (
232         SubIfFlags_name = map[uint32]string{
233                 1:   "SUB_IF_API_FLAG_NO_TAGS",
234                 2:   "SUB_IF_API_FLAG_ONE_TAG",
235                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
236                 8:   "SUB_IF_API_FLAG_DOT1AD",
237                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
238                 32:  "SUB_IF_API_FLAG_DEFAULT",
239                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
240                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
241                 254: "SUB_IF_API_FLAG_MASK_VNET",
242                 256: "SUB_IF_API_FLAG_DOT1AH",
243         }
244         SubIfFlags_value = map[string]uint32{
245                 "SUB_IF_API_FLAG_NO_TAGS":           1,
246                 "SUB_IF_API_FLAG_ONE_TAG":           2,
247                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
248                 "SUB_IF_API_FLAG_DOT1AD":            8,
249                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
250                 "SUB_IF_API_FLAG_DEFAULT":           32,
251                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
252                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
253                 "SUB_IF_API_FLAG_MASK_VNET":         254,
254                 "SUB_IF_API_FLAG_DOT1AH":            256,
255         }
256 )
257
258 func (x SubIfFlags) String() string {
259         s, ok := SubIfFlags_name[uint32(x)]
260         if ok {
261                 return s
262         }
263         str := func(n uint32) string {
264                 s, ok := SubIfFlags_name[uint32(n)]
265                 if ok {
266                         return s
267                 }
268                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
269         }
270         for i := uint32(0); i <= 32; i++ {
271                 val := uint32(x)
272                 if val&(1<<i) != 0 {
273                         if s != "" {
274                                 s += "|"
275                         }
276                         s += str(1 << i)
277                 }
278         }
279         if s == "" {
280                 return str(uint32(x))
281         }
282         return s
283 }
284
285 // InterfaceIndex defines alias 'interface_index'.
286 type InterfaceIndex uint32
287
288 // FeatureGsoEnableDisable defines message 'feature_gso_enable_disable'.
289 type FeatureGsoEnableDisable struct {
290         SwIfIndex     InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
291         EnableDisable bool           `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
292 }
293
294 func (m *FeatureGsoEnableDisable) Reset()               { *m = FeatureGsoEnableDisable{} }
295 func (*FeatureGsoEnableDisable) GetMessageName() string { return "feature_gso_enable_disable" }
296 func (*FeatureGsoEnableDisable) GetCrcString() string   { return "5501adee" }
297 func (*FeatureGsoEnableDisable) GetMessageType() api.MessageType {
298         return api.RequestMessage
299 }
300
301 func (m *FeatureGsoEnableDisable) Size() (size int) {
302         if m == nil {
303                 return 0
304         }
305         size += 4 // m.SwIfIndex
306         size += 1 // m.EnableDisable
307         return size
308 }
309 func (m *FeatureGsoEnableDisable) Marshal(b []byte) ([]byte, error) {
310         if b == nil {
311                 b = make([]byte, m.Size())
312         }
313         buf := codec.NewBuffer(b)
314         buf.EncodeUint32(uint32(m.SwIfIndex))
315         buf.EncodeBool(m.EnableDisable)
316         return buf.Bytes(), nil
317 }
318 func (m *FeatureGsoEnableDisable) Unmarshal(b []byte) error {
319         buf := codec.NewBuffer(b)
320         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
321         m.EnableDisable = buf.DecodeBool()
322         return nil
323 }
324
325 // FeatureGsoEnableDisableReply defines message 'feature_gso_enable_disable_reply'.
326 type FeatureGsoEnableDisableReply struct {
327         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
328 }
329
330 func (m *FeatureGsoEnableDisableReply) Reset() { *m = FeatureGsoEnableDisableReply{} }
331 func (*FeatureGsoEnableDisableReply) GetMessageName() string {
332         return "feature_gso_enable_disable_reply"
333 }
334 func (*FeatureGsoEnableDisableReply) GetCrcString() string { return "e8d4e804" }
335 func (*FeatureGsoEnableDisableReply) GetMessageType() api.MessageType {
336         return api.ReplyMessage
337 }
338
339 func (m *FeatureGsoEnableDisableReply) Size() (size int) {
340         if m == nil {
341                 return 0
342         }
343         size += 4 // m.Retval
344         return size
345 }
346 func (m *FeatureGsoEnableDisableReply) Marshal(b []byte) ([]byte, error) {
347         if b == nil {
348                 b = make([]byte, m.Size())
349         }
350         buf := codec.NewBuffer(b)
351         buf.EncodeInt32(m.Retval)
352         return buf.Bytes(), nil
353 }
354 func (m *FeatureGsoEnableDisableReply) Unmarshal(b []byte) error {
355         buf := codec.NewBuffer(b)
356         m.Retval = buf.DecodeInt32()
357         return nil
358 }
359
360 func init() { file_gso_binapi_init() }
361 func file_gso_binapi_init() {
362         api.RegisterMessage((*FeatureGsoEnableDisable)(nil), "feature_gso_enable_disable_5501adee")
363         api.RegisterMessage((*FeatureGsoEnableDisableReply)(nil), "feature_gso_enable_disable_reply_e8d4e804")
364 }
365
366 // Messages returns list of all messages in this module.
367 func AllMessages() []api.Message {
368         return []api.Message{
369                 (*FeatureGsoEnableDisable)(nil),
370                 (*FeatureGsoEnableDisableReply)(nil),
371         }
372 }