1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.6.0-dev
5 // source: /usr/share/vpp/api/plugins/pnat.api.json
7 // Package pnat contains generated bindings for API file pnat.api.
19 api "go.fd.io/govpp/api"
20 interface_types "go.fd.io/govpp/binapi/interface_types"
21 ip_types "go.fd.io/govpp/binapi/ip_types"
22 codec "go.fd.io/govpp/codec"
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
34 VersionCrc = 0x108d3b87
37 // PnatAttachmentPoint defines enum 'pnat_attachment_point'.
38 type PnatAttachmentPoint uint32
41 PNAT_IP4_INPUT PnatAttachmentPoint = 0
42 PNAT_IP4_OUTPUT PnatAttachmentPoint = 1
43 PNAT_ATTACHMENT_POINT_MAX PnatAttachmentPoint = 2
47 PnatAttachmentPoint_name = map[uint32]string{
50 2: "PNAT_ATTACHMENT_POINT_MAX",
52 PnatAttachmentPoint_value = map[string]uint32{
55 "PNAT_ATTACHMENT_POINT_MAX": 2,
59 func (x PnatAttachmentPoint) String() string {
60 s, ok := PnatAttachmentPoint_name[uint32(x)]
64 return "PnatAttachmentPoint(" + strconv.Itoa(int(x)) + ")"
67 // PnatMask defines enum 'pnat_mask'.
73 PNAT_SPORT PnatMask = 4
74 PNAT_DPORT PnatMask = 8
75 PNAT_COPY_BYTE PnatMask = 16
76 PNAT_CLEAR_BYTE PnatMask = 32
80 PnatMask_name = map[uint32]string{
86 32: "PNAT_CLEAR_BYTE",
88 PnatMask_value = map[string]uint32{
94 "PNAT_CLEAR_BYTE": 32,
98 func (x PnatMask) String() string {
99 s, ok := PnatMask_name[uint32(x)]
103 return "PnatMask(" + strconv.Itoa(int(x)) + ")"
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"`
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"`
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"`
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
142 func (m *PnatBindingAdd) Size() (size int) {
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
162 func (m *PnatBindingAdd) Marshal(b []byte) ([]byte, error) {
164 b = make([]byte, m.Size())
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
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()
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"`
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
216 func (m *PnatBindingAddReply) Size() (size int) {
220 size += 4 // m.Retval
221 size += 4 // m.BindingIndex
224 func (m *PnatBindingAddReply) Marshal(b []byte) ([]byte, error) {
226 b = make([]byte, m.Size())
228 buf := codec.NewBuffer(b)
229 buf.EncodeInt32(m.Retval)
230 buf.EncodeUint32(m.BindingIndex)
231 return buf.Bytes(), nil
233 func (m *PnatBindingAddReply) Unmarshal(b []byte) error {
234 buf := codec.NewBuffer(b)
235 m.Retval = buf.DecodeInt32()
236 m.BindingIndex = buf.DecodeUint32()
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"`
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
255 func (m *PnatBindingAttach) Size() (size int) {
259 size += 4 // m.SwIfIndex
260 size += 4 // m.Attachment
261 size += 4 // m.BindingIndex
264 func (m *PnatBindingAttach) Marshal(b []byte) ([]byte, error) {
266 b = make([]byte, m.Size())
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
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()
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"`
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
295 func (m *PnatBindingAttachReply) Size() (size int) {
299 size += 4 // m.Retval
302 func (m *PnatBindingAttachReply) Marshal(b []byte) ([]byte, error) {
304 b = make([]byte, m.Size())
306 buf := codec.NewBuffer(b)
307 buf.EncodeInt32(m.Retval)
308 return buf.Bytes(), nil
310 func (m *PnatBindingAttachReply) Unmarshal(b []byte) error {
311 buf := codec.NewBuffer(b)
312 m.Retval = buf.DecodeInt32()
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"`
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
329 func (m *PnatBindingDel) Size() (size int) {
333 size += 4 // m.BindingIndex
336 func (m *PnatBindingDel) Marshal(b []byte) ([]byte, error) {
338 b = make([]byte, m.Size())
340 buf := codec.NewBuffer(b)
341 buf.EncodeUint32(m.BindingIndex)
342 return buf.Bytes(), nil
344 func (m *PnatBindingDel) Unmarshal(b []byte) error {
345 buf := codec.NewBuffer(b)
346 m.BindingIndex = buf.DecodeUint32()
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"`
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
363 func (m *PnatBindingDelReply) Size() (size int) {
367 size += 4 // m.Retval
370 func (m *PnatBindingDelReply) Marshal(b []byte) ([]byte, error) {
372 b = make([]byte, m.Size())
374 buf := codec.NewBuffer(b)
375 buf.EncodeInt32(m.Retval)
376 return buf.Bytes(), nil
378 func (m *PnatBindingDelReply) Unmarshal(b []byte) error {
379 buf := codec.NewBuffer(b)
380 m.Retval = buf.DecodeInt32()
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"`
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
399 func (m *PnatBindingDetach) Size() (size int) {
403 size += 4 // m.SwIfIndex
404 size += 4 // m.Attachment
405 size += 4 // m.BindingIndex
408 func (m *PnatBindingDetach) Marshal(b []byte) ([]byte, error) {
410 b = make([]byte, m.Size())
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
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()
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"`
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
439 func (m *PnatBindingDetachReply) Size() (size int) {
443 size += 4 // m.Retval
446 func (m *PnatBindingDetachReply) Marshal(b []byte) ([]byte, error) {
448 b = make([]byte, m.Size())
450 buf := codec.NewBuffer(b)
451 buf.EncodeInt32(m.Retval)
452 return buf.Bytes(), nil
454 func (m *PnatBindingDetachReply) Unmarshal(b []byte) error {
455 buf := codec.NewBuffer(b)
456 m.Retval = buf.DecodeInt32()
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"`
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
474 func (m *PnatBindingsDetails) Size() (size int) {
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
494 func (m *PnatBindingsDetails) Marshal(b []byte) ([]byte, error) {
496 b = make([]byte, m.Size())
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
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()
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"`
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
547 func (m *PnatBindingsGet) Size() (size int) {
551 size += 4 // m.Cursor
554 func (m *PnatBindingsGet) Marshal(b []byte) ([]byte, error) {
556 b = make([]byte, m.Size())
558 buf := codec.NewBuffer(b)
559 buf.EncodeUint32(m.Cursor)
560 return buf.Bytes(), nil
562 func (m *PnatBindingsGet) Unmarshal(b []byte) error {
563 buf := codec.NewBuffer(b)
564 m.Cursor = buf.DecodeUint32()
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"`
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
582 func (m *PnatBindingsGetReply) Size() (size int) {
586 size += 4 // m.Retval
587 size += 4 // m.Cursor
590 func (m *PnatBindingsGetReply) Marshal(b []byte) ([]byte, error) {
592 b = make([]byte, m.Size())
594 buf := codec.NewBuffer(b)
595 buf.EncodeInt32(m.Retval)
596 buf.EncodeUint32(m.Cursor)
597 return buf.Bytes(), nil
599 func (m *PnatBindingsGetReply) Unmarshal(b []byte) error {
600 buf := codec.NewBuffer(b)
601 m.Retval = buf.DecodeInt32()
602 m.Cursor = buf.DecodeUint32()
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"`
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
621 func (m *PnatInterfacesDetails) Size() (size int) {
625 size += 4 // m.SwIfIndex
626 size += 1 * 2 // m.Enabled
627 for j1 := 0; j1 < 2; j1++ {
628 size += 4 // m.LookupMask[j1]
632 func (m *PnatInterfacesDetails) Marshal(b []byte) ([]byte, error) {
634 b = make([]byte, m.Size())
636 buf := codec.NewBuffer(b)
637 buf.EncodeUint32(uint32(m.SwIfIndex))
638 for i := 0; i < 2; i++ {
640 if i < len(m.Enabled) {
641 x = bool(m.Enabled[i])
645 for j0 := 0; j0 < 2; j0++ {
646 buf.EncodeUint32(uint32(m.LookupMask[j0]))
648 return buf.Bytes(), nil
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()
657 for j0 := 0; j0 < 2; j0++ {
658 m.LookupMask[j0] = PnatMask(buf.DecodeUint32())
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"`
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
676 func (m *PnatInterfacesGet) Size() (size int) {
680 size += 4 // m.Cursor
683 func (m *PnatInterfacesGet) Marshal(b []byte) ([]byte, error) {
685 b = make([]byte, m.Size())
687 buf := codec.NewBuffer(b)
688 buf.EncodeUint32(m.Cursor)
689 return buf.Bytes(), nil
691 func (m *PnatInterfacesGet) Unmarshal(b []byte) error {
692 buf := codec.NewBuffer(b)
693 m.Cursor = buf.DecodeUint32()
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"`
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
711 func (m *PnatInterfacesGetReply) Size() (size int) {
715 size += 4 // m.Retval
716 size += 4 // m.Cursor
719 func (m *PnatInterfacesGetReply) Marshal(b []byte) ([]byte, error) {
721 b = make([]byte, m.Size())
723 buf := codec.NewBuffer(b)
724 buf.EncodeInt32(m.Retval)
725 buf.EncodeUint32(m.Cursor)
726 return buf.Bytes(), nil
728 func (m *PnatInterfacesGetReply) Unmarshal(b []byte) error {
729 buf := codec.NewBuffer(b)
730 m.Retval = buf.DecodeInt32()
731 m.Cursor = buf.DecodeUint32()
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")
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),