b705b4b48554a8bfad310d59f6dc4f40ac49f176
[govpp.git] / binapi / pnat / pnat.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              22.02-release
5 // source: /usr/share/vpp/api/plugins/pnat.api.json
6
7 // Package pnat contains generated bindings for API file pnat.api.
8 //
9 // Contents:
10 //   2 enums
11 //   2 structs
12 //  14 messages
13 //
14 package pnat
15
16 import (
17         "strconv"
18
19         api "git.fd.io/govpp.git/api"
20         interface_types "git.fd.io/govpp.git/binapi/interface_types"
21         ip_types "git.fd.io/govpp.git/binapi/ip_types"
22         codec "git.fd.io/govpp.git/codec"
23 )
24
25 // This is a compile-time assertion to ensure that this generated file
26 // is compatible with the GoVPP api package it is being compiled against.
27 // A compilation error at this line likely means your copy of the
28 // GoVPP api package needs to be updated.
29 const _ = api.GoVppAPIPackageIsVersion2
30
31 const (
32         APIFile    = "pnat"
33         APIVersion = "0.1.1"
34         VersionCrc = 0x108d3b87
35 )
36
37 // PnatAttachmentPoint defines enum 'pnat_attachment_point'.
38 type PnatAttachmentPoint uint32
39
40 const (
41         PNAT_IP4_INPUT            PnatAttachmentPoint = 0
42         PNAT_IP4_OUTPUT           PnatAttachmentPoint = 1
43         PNAT_ATTACHMENT_POINT_MAX PnatAttachmentPoint = 2
44 )
45
46 var (
47         PnatAttachmentPoint_name = map[uint32]string{
48                 0: "PNAT_IP4_INPUT",
49                 1: "PNAT_IP4_OUTPUT",
50                 2: "PNAT_ATTACHMENT_POINT_MAX",
51         }
52         PnatAttachmentPoint_value = map[string]uint32{
53                 "PNAT_IP4_INPUT":            0,
54                 "PNAT_IP4_OUTPUT":           1,
55                 "PNAT_ATTACHMENT_POINT_MAX": 2,
56         }
57 )
58
59 func (x PnatAttachmentPoint) String() string {
60         s, ok := PnatAttachmentPoint_name[uint32(x)]
61         if ok {
62                 return s
63         }
64         return "PnatAttachmentPoint(" + strconv.Itoa(int(x)) + ")"
65 }
66
67 // PnatMask defines enum 'pnat_mask'.
68 type PnatMask uint32
69
70 const (
71         PNAT_SA         PnatMask = 1
72         PNAT_DA         PnatMask = 2
73         PNAT_SPORT      PnatMask = 4
74         PNAT_DPORT      PnatMask = 8
75         PNAT_COPY_BYTE  PnatMask = 16
76         PNAT_CLEAR_BYTE PnatMask = 32
77 )
78
79 var (
80         PnatMask_name = map[uint32]string{
81                 1:  "PNAT_SA",
82                 2:  "PNAT_DA",
83                 4:  "PNAT_SPORT",
84                 8:  "PNAT_DPORT",
85                 16: "PNAT_COPY_BYTE",
86                 32: "PNAT_CLEAR_BYTE",
87         }
88         PnatMask_value = map[string]uint32{
89                 "PNAT_SA":         1,
90                 "PNAT_DA":         2,
91                 "PNAT_SPORT":      4,
92                 "PNAT_DPORT":      8,
93                 "PNAT_COPY_BYTE":  16,
94                 "PNAT_CLEAR_BYTE": 32,
95         }
96 )
97
98 func (x PnatMask) String() string {
99         s, ok := PnatMask_name[uint32(x)]
100         if ok {
101                 return s
102         }
103         return "PnatMask(" + strconv.Itoa(int(x)) + ")"
104 }
105
106 // PnatMatchTuple defines type 'pnat_match_tuple'.
107 type PnatMatchTuple struct {
108         Src   ip_types.IP4Address `binapi:"ip4_address,name=src" json:"src,omitempty"`
109         Dst   ip_types.IP4Address `binapi:"ip4_address,name=dst" json:"dst,omitempty"`
110         Proto ip_types.IPProto    `binapi:"ip_proto,name=proto" json:"proto,omitempty"`
111         Sport uint16              `binapi:"u16,name=sport" json:"sport,omitempty"`
112         Dport uint16              `binapi:"u16,name=dport" json:"dport,omitempty"`
113         Mask  PnatMask            `binapi:"pnat_mask,name=mask" json:"mask,omitempty"`
114 }
115
116 // PnatRewriteTuple defines type 'pnat_rewrite_tuple'.
117 type PnatRewriteTuple struct {
118         Src         ip_types.IP4Address `binapi:"ip4_address,name=src" json:"src,omitempty"`
119         Dst         ip_types.IP4Address `binapi:"ip4_address,name=dst" json:"dst,omitempty"`
120         Sport       uint16              `binapi:"u16,name=sport" json:"sport,omitempty"`
121         Dport       uint16              `binapi:"u16,name=dport" json:"dport,omitempty"`
122         Mask        PnatMask            `binapi:"pnat_mask,name=mask" json:"mask,omitempty"`
123         FromOffset  uint8               `binapi:"u8,name=from_offset" json:"from_offset,omitempty"`
124         ToOffset    uint8               `binapi:"u8,name=to_offset" json:"to_offset,omitempty"`
125         ClearOffset uint8               `binapi:"u8,name=clear_offset" json:"clear_offset,omitempty"`
126 }
127
128 // PnatBindingAdd defines message 'pnat_binding_add'.
129 // InProgress: the message form may change in the future versions
130 type PnatBindingAdd struct {
131         Match   PnatMatchTuple   `binapi:"pnat_match_tuple,name=match" json:"match,omitempty"`
132         Rewrite PnatRewriteTuple `binapi:"pnat_rewrite_tuple,name=rewrite" json:"rewrite,omitempty"`
133 }
134
135 func (m *PnatBindingAdd) Reset()               { *m = PnatBindingAdd{} }
136 func (*PnatBindingAdd) GetMessageName() string { return "pnat_binding_add" }
137 func (*PnatBindingAdd) GetCrcString() string   { return "f00f79aa" }
138 func (*PnatBindingAdd) GetMessageType() api.MessageType {
139         return api.RequestMessage
140 }
141
142 func (m *PnatBindingAdd) Size() (size int) {
143         if m == nil {
144                 return 0
145         }
146         size += 1 * 4 // m.Match.Src
147         size += 1 * 4 // m.Match.Dst
148         size += 1     // m.Match.Proto
149         size += 2     // m.Match.Sport
150         size += 2     // m.Match.Dport
151         size += 4     // m.Match.Mask
152         size += 1 * 4 // m.Rewrite.Src
153         size += 1 * 4 // m.Rewrite.Dst
154         size += 2     // m.Rewrite.Sport
155         size += 2     // m.Rewrite.Dport
156         size += 4     // m.Rewrite.Mask
157         size += 1     // m.Rewrite.FromOffset
158         size += 1     // m.Rewrite.ToOffset
159         size += 1     // m.Rewrite.ClearOffset
160         return size
161 }
162 func (m *PnatBindingAdd) Marshal(b []byte) ([]byte, error) {
163         if b == nil {
164                 b = make([]byte, m.Size())
165         }
166         buf := codec.NewBuffer(b)
167         buf.EncodeBytes(m.Match.Src[:], 4)
168         buf.EncodeBytes(m.Match.Dst[:], 4)
169         buf.EncodeUint8(uint8(m.Match.Proto))
170         buf.EncodeUint16(m.Match.Sport)
171         buf.EncodeUint16(m.Match.Dport)
172         buf.EncodeUint32(uint32(m.Match.Mask))
173         buf.EncodeBytes(m.Rewrite.Src[:], 4)
174         buf.EncodeBytes(m.Rewrite.Dst[:], 4)
175         buf.EncodeUint16(m.Rewrite.Sport)
176         buf.EncodeUint16(m.Rewrite.Dport)
177         buf.EncodeUint32(uint32(m.Rewrite.Mask))
178         buf.EncodeUint8(m.Rewrite.FromOffset)
179         buf.EncodeUint8(m.Rewrite.ToOffset)
180         buf.EncodeUint8(m.Rewrite.ClearOffset)
181         return buf.Bytes(), nil
182 }
183 func (m *PnatBindingAdd) Unmarshal(b []byte) error {
184         buf := codec.NewBuffer(b)
185         copy(m.Match.Src[:], buf.DecodeBytes(4))
186         copy(m.Match.Dst[:], buf.DecodeBytes(4))
187         m.Match.Proto = ip_types.IPProto(buf.DecodeUint8())
188         m.Match.Sport = buf.DecodeUint16()
189         m.Match.Dport = buf.DecodeUint16()
190         m.Match.Mask = PnatMask(buf.DecodeUint32())
191         copy(m.Rewrite.Src[:], buf.DecodeBytes(4))
192         copy(m.Rewrite.Dst[:], buf.DecodeBytes(4))
193         m.Rewrite.Sport = buf.DecodeUint16()
194         m.Rewrite.Dport = buf.DecodeUint16()
195         m.Rewrite.Mask = PnatMask(buf.DecodeUint32())
196         m.Rewrite.FromOffset = buf.DecodeUint8()
197         m.Rewrite.ToOffset = buf.DecodeUint8()
198         m.Rewrite.ClearOffset = buf.DecodeUint8()
199         return nil
200 }
201
202 // PnatBindingAddReply defines message 'pnat_binding_add_reply'.
203 // InProgress: the message form may change in the future versions
204 type PnatBindingAddReply struct {
205         Retval       int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
206         BindingIndex uint32 `binapi:"u32,name=binding_index" json:"binding_index,omitempty"`
207 }
208
209 func (m *PnatBindingAddReply) Reset()               { *m = PnatBindingAddReply{} }
210 func (*PnatBindingAddReply) GetMessageName() string { return "pnat_binding_add_reply" }
211 func (*PnatBindingAddReply) GetCrcString() string   { return "4cd980a7" }
212 func (*PnatBindingAddReply) GetMessageType() api.MessageType {
213         return api.ReplyMessage
214 }
215
216 func (m *PnatBindingAddReply) Size() (size int) {
217         if m == nil {
218                 return 0
219         }
220         size += 4 // m.Retval
221         size += 4 // m.BindingIndex
222         return size
223 }
224 func (m *PnatBindingAddReply) Marshal(b []byte) ([]byte, error) {
225         if b == nil {
226                 b = make([]byte, m.Size())
227         }
228         buf := codec.NewBuffer(b)
229         buf.EncodeInt32(m.Retval)
230         buf.EncodeUint32(m.BindingIndex)
231         return buf.Bytes(), nil
232 }
233 func (m *PnatBindingAddReply) Unmarshal(b []byte) error {
234         buf := codec.NewBuffer(b)
235         m.Retval = buf.DecodeInt32()
236         m.BindingIndex = buf.DecodeUint32()
237         return nil
238 }
239
240 // PnatBindingAttach defines message 'pnat_binding_attach'.
241 // InProgress: the message form may change in the future versions
242 type PnatBindingAttach struct {
243         SwIfIndex    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
244         Attachment   PnatAttachmentPoint            `binapi:"pnat_attachment_point,name=attachment" json:"attachment,omitempty"`
245         BindingIndex uint32                         `binapi:"u32,name=binding_index" json:"binding_index,omitempty"`
246 }
247
248 func (m *PnatBindingAttach) Reset()               { *m = PnatBindingAttach{} }
249 func (*PnatBindingAttach) GetMessageName() string { return "pnat_binding_attach" }
250 func (*PnatBindingAttach) GetCrcString() string   { return "6e074232" }
251 func (*PnatBindingAttach) GetMessageType() api.MessageType {
252         return api.RequestMessage
253 }
254
255 func (m *PnatBindingAttach) Size() (size int) {
256         if m == nil {
257                 return 0
258         }
259         size += 4 // m.SwIfIndex
260         size += 4 // m.Attachment
261         size += 4 // m.BindingIndex
262         return size
263 }
264 func (m *PnatBindingAttach) Marshal(b []byte) ([]byte, error) {
265         if b == nil {
266                 b = make([]byte, m.Size())
267         }
268         buf := codec.NewBuffer(b)
269         buf.EncodeUint32(uint32(m.SwIfIndex))
270         buf.EncodeUint32(uint32(m.Attachment))
271         buf.EncodeUint32(m.BindingIndex)
272         return buf.Bytes(), nil
273 }
274 func (m *PnatBindingAttach) Unmarshal(b []byte) error {
275         buf := codec.NewBuffer(b)
276         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
277         m.Attachment = PnatAttachmentPoint(buf.DecodeUint32())
278         m.BindingIndex = buf.DecodeUint32()
279         return nil
280 }
281
282 // PnatBindingAttachReply defines message 'pnat_binding_attach_reply'.
283 // InProgress: the message form may change in the future versions
284 type PnatBindingAttachReply struct {
285         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
286 }
287
288 func (m *PnatBindingAttachReply) Reset()               { *m = PnatBindingAttachReply{} }
289 func (*PnatBindingAttachReply) GetMessageName() string { return "pnat_binding_attach_reply" }
290 func (*PnatBindingAttachReply) GetCrcString() string   { return "e8d4e804" }
291 func (*PnatBindingAttachReply) GetMessageType() api.MessageType {
292         return api.ReplyMessage
293 }
294
295 func (m *PnatBindingAttachReply) Size() (size int) {
296         if m == nil {
297                 return 0
298         }
299         size += 4 // m.Retval
300         return size
301 }
302 func (m *PnatBindingAttachReply) Marshal(b []byte) ([]byte, error) {
303         if b == nil {
304                 b = make([]byte, m.Size())
305         }
306         buf := codec.NewBuffer(b)
307         buf.EncodeInt32(m.Retval)
308         return buf.Bytes(), nil
309 }
310 func (m *PnatBindingAttachReply) Unmarshal(b []byte) error {
311         buf := codec.NewBuffer(b)
312         m.Retval = buf.DecodeInt32()
313         return nil
314 }
315
316 // PnatBindingDel defines message 'pnat_binding_del'.
317 // InProgress: the message form may change in the future versions
318 type PnatBindingDel struct {
319         BindingIndex uint32 `binapi:"u32,name=binding_index" json:"binding_index,omitempty"`
320 }
321
322 func (m *PnatBindingDel) Reset()               { *m = PnatBindingDel{} }
323 func (*PnatBindingDel) GetMessageName() string { return "pnat_binding_del" }
324 func (*PnatBindingDel) GetCrcString() string   { return "9259df7b" }
325 func (*PnatBindingDel) GetMessageType() api.MessageType {
326         return api.RequestMessage
327 }
328
329 func (m *PnatBindingDel) Size() (size int) {
330         if m == nil {
331                 return 0
332         }
333         size += 4 // m.BindingIndex
334         return size
335 }
336 func (m *PnatBindingDel) Marshal(b []byte) ([]byte, error) {
337         if b == nil {
338                 b = make([]byte, m.Size())
339         }
340         buf := codec.NewBuffer(b)
341         buf.EncodeUint32(m.BindingIndex)
342         return buf.Bytes(), nil
343 }
344 func (m *PnatBindingDel) Unmarshal(b []byte) error {
345         buf := codec.NewBuffer(b)
346         m.BindingIndex = buf.DecodeUint32()
347         return nil
348 }
349
350 // PnatBindingDelReply defines message 'pnat_binding_del_reply'.
351 // InProgress: the message form may change in the future versions
352 type PnatBindingDelReply struct {
353         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
354 }
355
356 func (m *PnatBindingDelReply) Reset()               { *m = PnatBindingDelReply{} }
357 func (*PnatBindingDelReply) GetMessageName() string { return "pnat_binding_del_reply" }
358 func (*PnatBindingDelReply) GetCrcString() string   { return "e8d4e804" }
359 func (*PnatBindingDelReply) GetMessageType() api.MessageType {
360         return api.ReplyMessage
361 }
362
363 func (m *PnatBindingDelReply) Size() (size int) {
364         if m == nil {
365                 return 0
366         }
367         size += 4 // m.Retval
368         return size
369 }
370 func (m *PnatBindingDelReply) Marshal(b []byte) ([]byte, error) {
371         if b == nil {
372                 b = make([]byte, m.Size())
373         }
374         buf := codec.NewBuffer(b)
375         buf.EncodeInt32(m.Retval)
376         return buf.Bytes(), nil
377 }
378 func (m *PnatBindingDelReply) Unmarshal(b []byte) error {
379         buf := codec.NewBuffer(b)
380         m.Retval = buf.DecodeInt32()
381         return nil
382 }
383
384 // PnatBindingDetach defines message 'pnat_binding_detach'.
385 // InProgress: the message form may change in the future versions
386 type PnatBindingDetach struct {
387         SwIfIndex    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
388         Attachment   PnatAttachmentPoint            `binapi:"pnat_attachment_point,name=attachment" json:"attachment,omitempty"`
389         BindingIndex uint32                         `binapi:"u32,name=binding_index" json:"binding_index,omitempty"`
390 }
391
392 func (m *PnatBindingDetach) Reset()               { *m = PnatBindingDetach{} }
393 func (*PnatBindingDetach) GetMessageName() string { return "pnat_binding_detach" }
394 func (*PnatBindingDetach) GetCrcString() string   { return "6e074232" }
395 func (*PnatBindingDetach) GetMessageType() api.MessageType {
396         return api.RequestMessage
397 }
398
399 func (m *PnatBindingDetach) Size() (size int) {
400         if m == nil {
401                 return 0
402         }
403         size += 4 // m.SwIfIndex
404         size += 4 // m.Attachment
405         size += 4 // m.BindingIndex
406         return size
407 }
408 func (m *PnatBindingDetach) Marshal(b []byte) ([]byte, error) {
409         if b == nil {
410                 b = make([]byte, m.Size())
411         }
412         buf := codec.NewBuffer(b)
413         buf.EncodeUint32(uint32(m.SwIfIndex))
414         buf.EncodeUint32(uint32(m.Attachment))
415         buf.EncodeUint32(m.BindingIndex)
416         return buf.Bytes(), nil
417 }
418 func (m *PnatBindingDetach) Unmarshal(b []byte) error {
419         buf := codec.NewBuffer(b)
420         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
421         m.Attachment = PnatAttachmentPoint(buf.DecodeUint32())
422         m.BindingIndex = buf.DecodeUint32()
423         return nil
424 }
425
426 // PnatBindingDetachReply defines message 'pnat_binding_detach_reply'.
427 // InProgress: the message form may change in the future versions
428 type PnatBindingDetachReply struct {
429         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
430 }
431
432 func (m *PnatBindingDetachReply) Reset()               { *m = PnatBindingDetachReply{} }
433 func (*PnatBindingDetachReply) GetMessageName() string { return "pnat_binding_detach_reply" }
434 func (*PnatBindingDetachReply) GetCrcString() string   { return "e8d4e804" }
435 func (*PnatBindingDetachReply) GetMessageType() api.MessageType {
436         return api.ReplyMessage
437 }
438
439 func (m *PnatBindingDetachReply) Size() (size int) {
440         if m == nil {
441                 return 0
442         }
443         size += 4 // m.Retval
444         return size
445 }
446 func (m *PnatBindingDetachReply) Marshal(b []byte) ([]byte, error) {
447         if b == nil {
448                 b = make([]byte, m.Size())
449         }
450         buf := codec.NewBuffer(b)
451         buf.EncodeInt32(m.Retval)
452         return buf.Bytes(), nil
453 }
454 func (m *PnatBindingDetachReply) Unmarshal(b []byte) error {
455         buf := codec.NewBuffer(b)
456         m.Retval = buf.DecodeInt32()
457         return nil
458 }
459
460 // PnatBindingsDetails defines message 'pnat_bindings_details'.
461 // InProgress: the message form may change in the future versions
462 type PnatBindingsDetails struct {
463         Match   PnatMatchTuple   `binapi:"pnat_match_tuple,name=match" json:"match,omitempty"`
464         Rewrite PnatRewriteTuple `binapi:"pnat_rewrite_tuple,name=rewrite" json:"rewrite,omitempty"`
465 }
466
467 func (m *PnatBindingsDetails) Reset()               { *m = PnatBindingsDetails{} }
468 func (*PnatBindingsDetails) GetMessageName() string { return "pnat_bindings_details" }
469 func (*PnatBindingsDetails) GetCrcString() string   { return "78267a35" }
470 func (*PnatBindingsDetails) GetMessageType() api.MessageType {
471         return api.ReplyMessage
472 }
473
474 func (m *PnatBindingsDetails) Size() (size int) {
475         if m == nil {
476                 return 0
477         }
478         size += 1 * 4 // m.Match.Src
479         size += 1 * 4 // m.Match.Dst
480         size += 1     // m.Match.Proto
481         size += 2     // m.Match.Sport
482         size += 2     // m.Match.Dport
483         size += 4     // m.Match.Mask
484         size += 1 * 4 // m.Rewrite.Src
485         size += 1 * 4 // m.Rewrite.Dst
486         size += 2     // m.Rewrite.Sport
487         size += 2     // m.Rewrite.Dport
488         size += 4     // m.Rewrite.Mask
489         size += 1     // m.Rewrite.FromOffset
490         size += 1     // m.Rewrite.ToOffset
491         size += 1     // m.Rewrite.ClearOffset
492         return size
493 }
494 func (m *PnatBindingsDetails) Marshal(b []byte) ([]byte, error) {
495         if b == nil {
496                 b = make([]byte, m.Size())
497         }
498         buf := codec.NewBuffer(b)
499         buf.EncodeBytes(m.Match.Src[:], 4)
500         buf.EncodeBytes(m.Match.Dst[:], 4)
501         buf.EncodeUint8(uint8(m.Match.Proto))
502         buf.EncodeUint16(m.Match.Sport)
503         buf.EncodeUint16(m.Match.Dport)
504         buf.EncodeUint32(uint32(m.Match.Mask))
505         buf.EncodeBytes(m.Rewrite.Src[:], 4)
506         buf.EncodeBytes(m.Rewrite.Dst[:], 4)
507         buf.EncodeUint16(m.Rewrite.Sport)
508         buf.EncodeUint16(m.Rewrite.Dport)
509         buf.EncodeUint32(uint32(m.Rewrite.Mask))
510         buf.EncodeUint8(m.Rewrite.FromOffset)
511         buf.EncodeUint8(m.Rewrite.ToOffset)
512         buf.EncodeUint8(m.Rewrite.ClearOffset)
513         return buf.Bytes(), nil
514 }
515 func (m *PnatBindingsDetails) Unmarshal(b []byte) error {
516         buf := codec.NewBuffer(b)
517         copy(m.Match.Src[:], buf.DecodeBytes(4))
518         copy(m.Match.Dst[:], buf.DecodeBytes(4))
519         m.Match.Proto = ip_types.IPProto(buf.DecodeUint8())
520         m.Match.Sport = buf.DecodeUint16()
521         m.Match.Dport = buf.DecodeUint16()
522         m.Match.Mask = PnatMask(buf.DecodeUint32())
523         copy(m.Rewrite.Src[:], buf.DecodeBytes(4))
524         copy(m.Rewrite.Dst[:], buf.DecodeBytes(4))
525         m.Rewrite.Sport = buf.DecodeUint16()
526         m.Rewrite.Dport = buf.DecodeUint16()
527         m.Rewrite.Mask = PnatMask(buf.DecodeUint32())
528         m.Rewrite.FromOffset = buf.DecodeUint8()
529         m.Rewrite.ToOffset = buf.DecodeUint8()
530         m.Rewrite.ClearOffset = buf.DecodeUint8()
531         return nil
532 }
533
534 // PnatBindingsGet defines message 'pnat_bindings_get'.
535 // InProgress: the message form may change in the future versions
536 type PnatBindingsGet struct {
537         Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"`
538 }
539
540 func (m *PnatBindingsGet) Reset()               { *m = PnatBindingsGet{} }
541 func (*PnatBindingsGet) GetMessageName() string { return "pnat_bindings_get" }
542 func (*PnatBindingsGet) GetCrcString() string   { return "f75ba505" }
543 func (*PnatBindingsGet) GetMessageType() api.MessageType {
544         return api.RequestMessage
545 }
546
547 func (m *PnatBindingsGet) Size() (size int) {
548         if m == nil {
549                 return 0
550         }
551         size += 4 // m.Cursor
552         return size
553 }
554 func (m *PnatBindingsGet) Marshal(b []byte) ([]byte, error) {
555         if b == nil {
556                 b = make([]byte, m.Size())
557         }
558         buf := codec.NewBuffer(b)
559         buf.EncodeUint32(m.Cursor)
560         return buf.Bytes(), nil
561 }
562 func (m *PnatBindingsGet) Unmarshal(b []byte) error {
563         buf := codec.NewBuffer(b)
564         m.Cursor = buf.DecodeUint32()
565         return nil
566 }
567
568 // PnatBindingsGetReply defines message 'pnat_bindings_get_reply'.
569 // InProgress: the message form may change in the future versions
570 type PnatBindingsGetReply struct {
571         Retval int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
572         Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"`
573 }
574
575 func (m *PnatBindingsGetReply) Reset()               { *m = PnatBindingsGetReply{} }
576 func (*PnatBindingsGetReply) GetMessageName() string { return "pnat_bindings_get_reply" }
577 func (*PnatBindingsGetReply) GetCrcString() string   { return "53b48f5d" }
578 func (*PnatBindingsGetReply) GetMessageType() api.MessageType {
579         return api.ReplyMessage
580 }
581
582 func (m *PnatBindingsGetReply) Size() (size int) {
583         if m == nil {
584                 return 0
585         }
586         size += 4 // m.Retval
587         size += 4 // m.Cursor
588         return size
589 }
590 func (m *PnatBindingsGetReply) Marshal(b []byte) ([]byte, error) {
591         if b == nil {
592                 b = make([]byte, m.Size())
593         }
594         buf := codec.NewBuffer(b)
595         buf.EncodeInt32(m.Retval)
596         buf.EncodeUint32(m.Cursor)
597         return buf.Bytes(), nil
598 }
599 func (m *PnatBindingsGetReply) Unmarshal(b []byte) error {
600         buf := codec.NewBuffer(b)
601         m.Retval = buf.DecodeInt32()
602         m.Cursor = buf.DecodeUint32()
603         return nil
604 }
605
606 // PnatInterfacesDetails defines message 'pnat_interfaces_details'.
607 // InProgress: the message form may change in the future versions
608 type PnatInterfacesDetails struct {
609         SwIfIndex  interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
610         Enabled    []bool                         `binapi:"bool[2],name=enabled" json:"enabled,omitempty"`
611         LookupMask [2]PnatMask                    `binapi:"pnat_mask[2],name=lookup_mask" json:"lookup_mask,omitempty"`
612 }
613
614 func (m *PnatInterfacesDetails) Reset()               { *m = PnatInterfacesDetails{} }
615 func (*PnatInterfacesDetails) GetMessageName() string { return "pnat_interfaces_details" }
616 func (*PnatInterfacesDetails) GetCrcString() string   { return "c7b0c4c0" }
617 func (*PnatInterfacesDetails) GetMessageType() api.MessageType {
618         return api.ReplyMessage
619 }
620
621 func (m *PnatInterfacesDetails) Size() (size int) {
622         if m == nil {
623                 return 0
624         }
625         size += 4     // m.SwIfIndex
626         size += 1 * 2 // m.Enabled
627         for j1 := 0; j1 < 2; j1++ {
628                 size += 4 // m.LookupMask[j1]
629         }
630         return size
631 }
632 func (m *PnatInterfacesDetails) Marshal(b []byte) ([]byte, error) {
633         if b == nil {
634                 b = make([]byte, m.Size())
635         }
636         buf := codec.NewBuffer(b)
637         buf.EncodeUint32(uint32(m.SwIfIndex))
638         for i := 0; i < 2; i++ {
639                 var x bool
640                 if i < len(m.Enabled) {
641                         x = bool(m.Enabled[i])
642                 }
643                 buf.EncodeBool(x)
644         }
645         for j0 := 0; j0 < 2; j0++ {
646                 buf.EncodeUint32(uint32(m.LookupMask[j0]))
647         }
648         return buf.Bytes(), nil
649 }
650 func (m *PnatInterfacesDetails) Unmarshal(b []byte) error {
651         buf := codec.NewBuffer(b)
652         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
653         m.Enabled = make([]bool, 2)
654         for i := 0; i < len(m.Enabled); i++ {
655                 m.Enabled[i] = buf.DecodeBool()
656         }
657         for j0 := 0; j0 < 2; j0++ {
658                 m.LookupMask[j0] = PnatMask(buf.DecodeUint32())
659         }
660         return nil
661 }
662
663 // PnatInterfacesGet defines message 'pnat_interfaces_get'.
664 // InProgress: the message form may change in the future versions
665 type PnatInterfacesGet struct {
666         Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"`
667 }
668
669 func (m *PnatInterfacesGet) Reset()               { *m = PnatInterfacesGet{} }
670 func (*PnatInterfacesGet) GetMessageName() string { return "pnat_interfaces_get" }
671 func (*PnatInterfacesGet) GetCrcString() string   { return "f75ba505" }
672 func (*PnatInterfacesGet) GetMessageType() api.MessageType {
673         return api.RequestMessage
674 }
675
676 func (m *PnatInterfacesGet) Size() (size int) {
677         if m == nil {
678                 return 0
679         }
680         size += 4 // m.Cursor
681         return size
682 }
683 func (m *PnatInterfacesGet) Marshal(b []byte) ([]byte, error) {
684         if b == nil {
685                 b = make([]byte, m.Size())
686         }
687         buf := codec.NewBuffer(b)
688         buf.EncodeUint32(m.Cursor)
689         return buf.Bytes(), nil
690 }
691 func (m *PnatInterfacesGet) Unmarshal(b []byte) error {
692         buf := codec.NewBuffer(b)
693         m.Cursor = buf.DecodeUint32()
694         return nil
695 }
696
697 // PnatInterfacesGetReply defines message 'pnat_interfaces_get_reply'.
698 // InProgress: the message form may change in the future versions
699 type PnatInterfacesGetReply struct {
700         Retval int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
701         Cursor uint32 `binapi:"u32,name=cursor" json:"cursor,omitempty"`
702 }
703
704 func (m *PnatInterfacesGetReply) Reset()               { *m = PnatInterfacesGetReply{} }
705 func (*PnatInterfacesGetReply) GetMessageName() string { return "pnat_interfaces_get_reply" }
706 func (*PnatInterfacesGetReply) GetCrcString() string   { return "53b48f5d" }
707 func (*PnatInterfacesGetReply) GetMessageType() api.MessageType {
708         return api.ReplyMessage
709 }
710
711 func (m *PnatInterfacesGetReply) Size() (size int) {
712         if m == nil {
713                 return 0
714         }
715         size += 4 // m.Retval
716         size += 4 // m.Cursor
717         return size
718 }
719 func (m *PnatInterfacesGetReply) Marshal(b []byte) ([]byte, error) {
720         if b == nil {
721                 b = make([]byte, m.Size())
722         }
723         buf := codec.NewBuffer(b)
724         buf.EncodeInt32(m.Retval)
725         buf.EncodeUint32(m.Cursor)
726         return buf.Bytes(), nil
727 }
728 func (m *PnatInterfacesGetReply) Unmarshal(b []byte) error {
729         buf := codec.NewBuffer(b)
730         m.Retval = buf.DecodeInt32()
731         m.Cursor = buf.DecodeUint32()
732         return nil
733 }
734
735 func init() { file_pnat_binapi_init() }
736 func file_pnat_binapi_init() {
737         api.RegisterMessage((*PnatBindingAdd)(nil), "pnat_binding_add_f00f79aa")
738         api.RegisterMessage((*PnatBindingAddReply)(nil), "pnat_binding_add_reply_4cd980a7")
739         api.RegisterMessage((*PnatBindingAttach)(nil), "pnat_binding_attach_6e074232")
740         api.RegisterMessage((*PnatBindingAttachReply)(nil), "pnat_binding_attach_reply_e8d4e804")
741         api.RegisterMessage((*PnatBindingDel)(nil), "pnat_binding_del_9259df7b")
742         api.RegisterMessage((*PnatBindingDelReply)(nil), "pnat_binding_del_reply_e8d4e804")
743         api.RegisterMessage((*PnatBindingDetach)(nil), "pnat_binding_detach_6e074232")
744         api.RegisterMessage((*PnatBindingDetachReply)(nil), "pnat_binding_detach_reply_e8d4e804")
745         api.RegisterMessage((*PnatBindingsDetails)(nil), "pnat_bindings_details_78267a35")
746         api.RegisterMessage((*PnatBindingsGet)(nil), "pnat_bindings_get_f75ba505")
747         api.RegisterMessage((*PnatBindingsGetReply)(nil), "pnat_bindings_get_reply_53b48f5d")
748         api.RegisterMessage((*PnatInterfacesDetails)(nil), "pnat_interfaces_details_c7b0c4c0")
749         api.RegisterMessage((*PnatInterfacesGet)(nil), "pnat_interfaces_get_f75ba505")
750         api.RegisterMessage((*PnatInterfacesGetReply)(nil), "pnat_interfaces_get_reply_53b48f5d")
751 }
752
753 // Messages returns list of all messages in this module.
754 func AllMessages() []api.Message {
755         return []api.Message{
756                 (*PnatBindingAdd)(nil),
757                 (*PnatBindingAddReply)(nil),
758                 (*PnatBindingAttach)(nil),
759                 (*PnatBindingAttachReply)(nil),
760                 (*PnatBindingDel)(nil),
761                 (*PnatBindingDelReply)(nil),
762                 (*PnatBindingDetach)(nil),
763                 (*PnatBindingDetachReply)(nil),
764                 (*PnatBindingsDetails)(nil),
765                 (*PnatBindingsGet)(nil),
766                 (*PnatBindingsGetReply)(nil),
767                 (*PnatInterfacesDetails)(nil),
768                 (*PnatInterfacesGet)(nil),
769                 (*PnatInterfacesGetReply)(nil),
770         }
771 }