1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/plugins/nsh.api.json
7 // Package nsh contains generated bindings for API file nsh.api.
19 api "git.fd.io/govpp.git/api"
20 codec "git.fd.io/govpp.git/codec"
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
32 VersionCrc = 0xac2c8897
35 // IfStatusFlags defines enum 'if_status_flags'.
36 type IfStatusFlags uint32
39 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
40 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
44 IfStatusFlags_name = map[uint32]string{
45 1: "IF_STATUS_API_FLAG_ADMIN_UP",
46 2: "IF_STATUS_API_FLAG_LINK_UP",
48 IfStatusFlags_value = map[string]uint32{
49 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
50 "IF_STATUS_API_FLAG_LINK_UP": 2,
54 func (x IfStatusFlags) String() string {
55 s, ok := IfStatusFlags_name[uint32(x)]
59 str := func(n uint32) string {
60 s, ok := IfStatusFlags_name[uint32(n)]
64 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
66 for i := uint32(0); i <= 32; i++ {
81 // IfType defines enum 'if_type'.
85 IF_API_TYPE_HARDWARE IfType = 1
86 IF_API_TYPE_SUB IfType = 2
87 IF_API_TYPE_P2P IfType = 3
88 IF_API_TYPE_PIPE IfType = 4
92 IfType_name = map[uint32]string{
93 1: "IF_API_TYPE_HARDWARE",
96 4: "IF_API_TYPE_PIPE",
98 IfType_value = map[string]uint32{
99 "IF_API_TYPE_HARDWARE": 1,
100 "IF_API_TYPE_SUB": 2,
101 "IF_API_TYPE_P2P": 3,
102 "IF_API_TYPE_PIPE": 4,
106 func (x IfType) String() string {
107 s, ok := IfType_name[uint32(x)]
111 return "IfType(" + strconv.Itoa(int(x)) + ")"
114 // LinkDuplex defines enum 'link_duplex'.
115 type LinkDuplex uint32
118 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
119 LINK_DUPLEX_API_HALF LinkDuplex = 1
120 LINK_DUPLEX_API_FULL LinkDuplex = 2
124 LinkDuplex_name = map[uint32]string{
125 0: "LINK_DUPLEX_API_UNKNOWN",
126 1: "LINK_DUPLEX_API_HALF",
127 2: "LINK_DUPLEX_API_FULL",
129 LinkDuplex_value = map[string]uint32{
130 "LINK_DUPLEX_API_UNKNOWN": 0,
131 "LINK_DUPLEX_API_HALF": 1,
132 "LINK_DUPLEX_API_FULL": 2,
136 func (x LinkDuplex) String() string {
137 s, ok := LinkDuplex_name[uint32(x)]
141 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
144 // MtuProto defines enum 'mtu_proto'.
148 MTU_PROTO_API_L3 MtuProto = 1
149 MTU_PROTO_API_IP4 MtuProto = 2
150 MTU_PROTO_API_IP6 MtuProto = 3
151 MTU_PROTO_API_MPLS MtuProto = 4
152 MTU_PROTO_API_N MtuProto = 5
156 MtuProto_name = map[uint32]string{
157 1: "MTU_PROTO_API_L3",
158 2: "MTU_PROTO_API_IP4",
159 3: "MTU_PROTO_API_IP6",
160 4: "MTU_PROTO_API_MPLS",
161 5: "MTU_PROTO_API_N",
163 MtuProto_value = map[string]uint32{
164 "MTU_PROTO_API_L3": 1,
165 "MTU_PROTO_API_IP4": 2,
166 "MTU_PROTO_API_IP6": 3,
167 "MTU_PROTO_API_MPLS": 4,
168 "MTU_PROTO_API_N": 5,
172 func (x MtuProto) String() string {
173 s, ok := MtuProto_name[uint32(x)]
177 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
180 // RxMode defines enum 'rx_mode'.
184 RX_MODE_API_UNKNOWN RxMode = 0
185 RX_MODE_API_POLLING RxMode = 1
186 RX_MODE_API_INTERRUPT RxMode = 2
187 RX_MODE_API_ADAPTIVE RxMode = 3
188 RX_MODE_API_DEFAULT RxMode = 4
192 RxMode_name = map[uint32]string{
193 0: "RX_MODE_API_UNKNOWN",
194 1: "RX_MODE_API_POLLING",
195 2: "RX_MODE_API_INTERRUPT",
196 3: "RX_MODE_API_ADAPTIVE",
197 4: "RX_MODE_API_DEFAULT",
199 RxMode_value = map[string]uint32{
200 "RX_MODE_API_UNKNOWN": 0,
201 "RX_MODE_API_POLLING": 1,
202 "RX_MODE_API_INTERRUPT": 2,
203 "RX_MODE_API_ADAPTIVE": 3,
204 "RX_MODE_API_DEFAULT": 4,
208 func (x RxMode) String() string {
209 s, ok := RxMode_name[uint32(x)]
213 return "RxMode(" + strconv.Itoa(int(x)) + ")"
216 // SubIfFlags defines enum 'sub_if_flags'.
217 type SubIfFlags uint32
220 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
221 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
222 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
223 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
224 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
225 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
226 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
227 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
228 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
229 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
233 SubIfFlags_name = map[uint32]string{
234 1: "SUB_IF_API_FLAG_NO_TAGS",
235 2: "SUB_IF_API_FLAG_ONE_TAG",
236 4: "SUB_IF_API_FLAG_TWO_TAGS",
237 8: "SUB_IF_API_FLAG_DOT1AD",
238 16: "SUB_IF_API_FLAG_EXACT_MATCH",
239 32: "SUB_IF_API_FLAG_DEFAULT",
240 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
241 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
242 254: "SUB_IF_API_FLAG_MASK_VNET",
243 256: "SUB_IF_API_FLAG_DOT1AH",
245 SubIfFlags_value = map[string]uint32{
246 "SUB_IF_API_FLAG_NO_TAGS": 1,
247 "SUB_IF_API_FLAG_ONE_TAG": 2,
248 "SUB_IF_API_FLAG_TWO_TAGS": 4,
249 "SUB_IF_API_FLAG_DOT1AD": 8,
250 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
251 "SUB_IF_API_FLAG_DEFAULT": 32,
252 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
253 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
254 "SUB_IF_API_FLAG_MASK_VNET": 254,
255 "SUB_IF_API_FLAG_DOT1AH": 256,
259 func (x SubIfFlags) String() string {
260 s, ok := SubIfFlags_name[uint32(x)]
264 str := func(n uint32) string {
265 s, ok := SubIfFlags_name[uint32(n)]
269 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
271 for i := uint32(0); i <= 32; i++ {
281 return str(uint32(x))
286 // InterfaceIndex defines alias 'interface_index'.
287 type InterfaceIndex uint32
289 // NshAddDelEntry defines message 'nsh_add_del_entry'.
290 type NshAddDelEntry struct {
291 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
292 NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
293 MdType uint8 `binapi:"u8,name=md_type" json:"md_type,omitempty"`
294 VerOC uint8 `binapi:"u8,name=ver_o_c" json:"ver_o_c,omitempty"`
295 TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
296 Length uint8 `binapi:"u8,name=length" json:"length,omitempty"`
297 NextProtocol uint8 `binapi:"u8,name=next_protocol" json:"next_protocol,omitempty"`
298 C1 uint32 `binapi:"u32,name=c1" json:"c1,omitempty"`
299 C2 uint32 `binapi:"u32,name=c2" json:"c2,omitempty"`
300 C3 uint32 `binapi:"u32,name=c3" json:"c3,omitempty"`
301 C4 uint32 `binapi:"u32,name=c4" json:"c4,omitempty"`
302 TlvLength uint8 `binapi:"u8,name=tlv_length" json:"tlv_length,omitempty"`
303 Tlv []byte `binapi:"u8[248],name=tlv" json:"tlv,omitempty"`
306 func (m *NshAddDelEntry) Reset() { *m = NshAddDelEntry{} }
307 func (*NshAddDelEntry) GetMessageName() string { return "nsh_add_del_entry" }
308 func (*NshAddDelEntry) GetCrcString() string { return "7dea480b" }
309 func (*NshAddDelEntry) GetMessageType() api.MessageType {
310 return api.RequestMessage
313 func (m *NshAddDelEntry) Size() (size int) {
318 size += 4 // m.NspNsi
319 size += 1 // m.MdType
322 size += 1 // m.Length
323 size += 1 // m.NextProtocol
328 size += 1 // m.TlvLength
329 size += 1 * 248 // m.Tlv
332 func (m *NshAddDelEntry) Marshal(b []byte) ([]byte, error) {
334 b = make([]byte, m.Size())
336 buf := codec.NewBuffer(b)
337 buf.EncodeBool(m.IsAdd)
338 buf.EncodeUint32(m.NspNsi)
339 buf.EncodeUint8(m.MdType)
340 buf.EncodeUint8(m.VerOC)
341 buf.EncodeUint8(m.TTL)
342 buf.EncodeUint8(m.Length)
343 buf.EncodeUint8(m.NextProtocol)
344 buf.EncodeUint32(m.C1)
345 buf.EncodeUint32(m.C2)
346 buf.EncodeUint32(m.C3)
347 buf.EncodeUint32(m.C4)
348 buf.EncodeUint8(m.TlvLength)
349 buf.EncodeBytes(m.Tlv, 248)
350 return buf.Bytes(), nil
352 func (m *NshAddDelEntry) Unmarshal(b []byte) error {
353 buf := codec.NewBuffer(b)
354 m.IsAdd = buf.DecodeBool()
355 m.NspNsi = buf.DecodeUint32()
356 m.MdType = buf.DecodeUint8()
357 m.VerOC = buf.DecodeUint8()
358 m.TTL = buf.DecodeUint8()
359 m.Length = buf.DecodeUint8()
360 m.NextProtocol = buf.DecodeUint8()
361 m.C1 = buf.DecodeUint32()
362 m.C2 = buf.DecodeUint32()
363 m.C3 = buf.DecodeUint32()
364 m.C4 = buf.DecodeUint32()
365 m.TlvLength = buf.DecodeUint8()
366 m.Tlv = make([]byte, 248)
367 copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
371 // NshAddDelEntryReply defines message 'nsh_add_del_entry_reply'.
372 type NshAddDelEntryReply struct {
373 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
374 EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
377 func (m *NshAddDelEntryReply) Reset() { *m = NshAddDelEntryReply{} }
378 func (*NshAddDelEntryReply) GetMessageName() string { return "nsh_add_del_entry_reply" }
379 func (*NshAddDelEntryReply) GetCrcString() string { return "6296a9eb" }
380 func (*NshAddDelEntryReply) GetMessageType() api.MessageType {
381 return api.ReplyMessage
384 func (m *NshAddDelEntryReply) Size() (size int) {
388 size += 4 // m.Retval
389 size += 4 // m.EntryIndex
392 func (m *NshAddDelEntryReply) Marshal(b []byte) ([]byte, error) {
394 b = make([]byte, m.Size())
396 buf := codec.NewBuffer(b)
397 buf.EncodeInt32(m.Retval)
398 buf.EncodeUint32(m.EntryIndex)
399 return buf.Bytes(), nil
401 func (m *NshAddDelEntryReply) Unmarshal(b []byte) error {
402 buf := codec.NewBuffer(b)
403 m.Retval = buf.DecodeInt32()
404 m.EntryIndex = buf.DecodeUint32()
408 // NshAddDelMap defines message 'nsh_add_del_map'.
409 type NshAddDelMap struct {
410 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
411 NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
412 MappedNspNsi uint32 `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
413 NshAction uint32 `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
414 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
415 RxSwIfIndex InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
416 NextNode uint32 `binapi:"u32,name=next_node" json:"next_node,omitempty"`
419 func (m *NshAddDelMap) Reset() { *m = NshAddDelMap{} }
420 func (*NshAddDelMap) GetMessageName() string { return "nsh_add_del_map" }
421 func (*NshAddDelMap) GetCrcString() string { return "898d857d" }
422 func (*NshAddDelMap) GetMessageType() api.MessageType {
423 return api.RequestMessage
426 func (m *NshAddDelMap) Size() (size int) {
431 size += 4 // m.NspNsi
432 size += 4 // m.MappedNspNsi
433 size += 4 // m.NshAction
434 size += 4 // m.SwIfIndex
435 size += 4 // m.RxSwIfIndex
436 size += 4 // m.NextNode
439 func (m *NshAddDelMap) Marshal(b []byte) ([]byte, error) {
441 b = make([]byte, m.Size())
443 buf := codec.NewBuffer(b)
444 buf.EncodeBool(m.IsAdd)
445 buf.EncodeUint32(m.NspNsi)
446 buf.EncodeUint32(m.MappedNspNsi)
447 buf.EncodeUint32(m.NshAction)
448 buf.EncodeUint32(uint32(m.SwIfIndex))
449 buf.EncodeUint32(uint32(m.RxSwIfIndex))
450 buf.EncodeUint32(m.NextNode)
451 return buf.Bytes(), nil
453 func (m *NshAddDelMap) Unmarshal(b []byte) error {
454 buf := codec.NewBuffer(b)
455 m.IsAdd = buf.DecodeBool()
456 m.NspNsi = buf.DecodeUint32()
457 m.MappedNspNsi = buf.DecodeUint32()
458 m.NshAction = buf.DecodeUint32()
459 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
460 m.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
461 m.NextNode = buf.DecodeUint32()
465 // NshAddDelMapReply defines message 'nsh_add_del_map_reply'.
466 type NshAddDelMapReply struct {
467 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
468 MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
471 func (m *NshAddDelMapReply) Reset() { *m = NshAddDelMapReply{} }
472 func (*NshAddDelMapReply) GetMessageName() string { return "nsh_add_del_map_reply" }
473 func (*NshAddDelMapReply) GetCrcString() string { return "b2b127ef" }
474 func (*NshAddDelMapReply) GetMessageType() api.MessageType {
475 return api.ReplyMessage
478 func (m *NshAddDelMapReply) Size() (size int) {
482 size += 4 // m.Retval
483 size += 4 // m.MapIndex
486 func (m *NshAddDelMapReply) Marshal(b []byte) ([]byte, error) {
488 b = make([]byte, m.Size())
490 buf := codec.NewBuffer(b)
491 buf.EncodeInt32(m.Retval)
492 buf.EncodeUint32(m.MapIndex)
493 return buf.Bytes(), nil
495 func (m *NshAddDelMapReply) Unmarshal(b []byte) error {
496 buf := codec.NewBuffer(b)
497 m.Retval = buf.DecodeInt32()
498 m.MapIndex = buf.DecodeUint32()
502 // NshEntryDetails defines message 'nsh_entry_details'.
503 type NshEntryDetails struct {
504 EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
505 NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
506 MdType uint8 `binapi:"u8,name=md_type" json:"md_type,omitempty"`
507 VerOC uint8 `binapi:"u8,name=ver_o_c" json:"ver_o_c,omitempty"`
508 TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
509 Length uint8 `binapi:"u8,name=length" json:"length,omitempty"`
510 NextProtocol uint8 `binapi:"u8,name=next_protocol" json:"next_protocol,omitempty"`
511 C1 uint32 `binapi:"u32,name=c1" json:"c1,omitempty"`
512 C2 uint32 `binapi:"u32,name=c2" json:"c2,omitempty"`
513 C3 uint32 `binapi:"u32,name=c3" json:"c3,omitempty"`
514 C4 uint32 `binapi:"u32,name=c4" json:"c4,omitempty"`
515 TlvLength uint8 `binapi:"u8,name=tlv_length" json:"tlv_length,omitempty"`
516 Tlv []byte `binapi:"u8[248],name=tlv" json:"tlv,omitempty"`
519 func (m *NshEntryDetails) Reset() { *m = NshEntryDetails{} }
520 func (*NshEntryDetails) GetMessageName() string { return "nsh_entry_details" }
521 func (*NshEntryDetails) GetCrcString() string { return "046fb556" }
522 func (*NshEntryDetails) GetMessageType() api.MessageType {
523 return api.ReplyMessage
526 func (m *NshEntryDetails) Size() (size int) {
530 size += 4 // m.EntryIndex
531 size += 4 // m.NspNsi
532 size += 1 // m.MdType
535 size += 1 // m.Length
536 size += 1 // m.NextProtocol
541 size += 1 // m.TlvLength
542 size += 1 * 248 // m.Tlv
545 func (m *NshEntryDetails) Marshal(b []byte) ([]byte, error) {
547 b = make([]byte, m.Size())
549 buf := codec.NewBuffer(b)
550 buf.EncodeUint32(m.EntryIndex)
551 buf.EncodeUint32(m.NspNsi)
552 buf.EncodeUint8(m.MdType)
553 buf.EncodeUint8(m.VerOC)
554 buf.EncodeUint8(m.TTL)
555 buf.EncodeUint8(m.Length)
556 buf.EncodeUint8(m.NextProtocol)
557 buf.EncodeUint32(m.C1)
558 buf.EncodeUint32(m.C2)
559 buf.EncodeUint32(m.C3)
560 buf.EncodeUint32(m.C4)
561 buf.EncodeUint8(m.TlvLength)
562 buf.EncodeBytes(m.Tlv, 248)
563 return buf.Bytes(), nil
565 func (m *NshEntryDetails) Unmarshal(b []byte) error {
566 buf := codec.NewBuffer(b)
567 m.EntryIndex = buf.DecodeUint32()
568 m.NspNsi = buf.DecodeUint32()
569 m.MdType = buf.DecodeUint8()
570 m.VerOC = buf.DecodeUint8()
571 m.TTL = buf.DecodeUint8()
572 m.Length = buf.DecodeUint8()
573 m.NextProtocol = buf.DecodeUint8()
574 m.C1 = buf.DecodeUint32()
575 m.C2 = buf.DecodeUint32()
576 m.C3 = buf.DecodeUint32()
577 m.C4 = buf.DecodeUint32()
578 m.TlvLength = buf.DecodeUint8()
579 m.Tlv = make([]byte, 248)
580 copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
584 // NshEntryDump defines message 'nsh_entry_dump'.
585 type NshEntryDump struct {
586 EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
589 func (m *NshEntryDump) Reset() { *m = NshEntryDump{} }
590 func (*NshEntryDump) GetMessageName() string { return "nsh_entry_dump" }
591 func (*NshEntryDump) GetCrcString() string { return "cdaf8ccb" }
592 func (*NshEntryDump) GetMessageType() api.MessageType {
593 return api.RequestMessage
596 func (m *NshEntryDump) Size() (size int) {
600 size += 4 // m.EntryIndex
603 func (m *NshEntryDump) Marshal(b []byte) ([]byte, error) {
605 b = make([]byte, m.Size())
607 buf := codec.NewBuffer(b)
608 buf.EncodeUint32(m.EntryIndex)
609 return buf.Bytes(), nil
611 func (m *NshEntryDump) Unmarshal(b []byte) error {
612 buf := codec.NewBuffer(b)
613 m.EntryIndex = buf.DecodeUint32()
617 // NshMapDetails defines message 'nsh_map_details'.
618 type NshMapDetails struct {
619 MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
620 NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
621 MappedNspNsi uint32 `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
622 NshAction uint32 `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
623 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
624 RxSwIfIndex InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
625 NextNode uint32 `binapi:"u32,name=next_node" json:"next_node,omitempty"`
628 func (m *NshMapDetails) Reset() { *m = NshMapDetails{} }
629 func (*NshMapDetails) GetMessageName() string { return "nsh_map_details" }
630 func (*NshMapDetails) GetCrcString() string { return "b34ac8a1" }
631 func (*NshMapDetails) GetMessageType() api.MessageType {
632 return api.ReplyMessage
635 func (m *NshMapDetails) Size() (size int) {
639 size += 4 // m.MapIndex
640 size += 4 // m.NspNsi
641 size += 4 // m.MappedNspNsi
642 size += 4 // m.NshAction
643 size += 4 // m.SwIfIndex
644 size += 4 // m.RxSwIfIndex
645 size += 4 // m.NextNode
648 func (m *NshMapDetails) Marshal(b []byte) ([]byte, error) {
650 b = make([]byte, m.Size())
652 buf := codec.NewBuffer(b)
653 buf.EncodeUint32(m.MapIndex)
654 buf.EncodeUint32(m.NspNsi)
655 buf.EncodeUint32(m.MappedNspNsi)
656 buf.EncodeUint32(m.NshAction)
657 buf.EncodeUint32(uint32(m.SwIfIndex))
658 buf.EncodeUint32(uint32(m.RxSwIfIndex))
659 buf.EncodeUint32(m.NextNode)
660 return buf.Bytes(), nil
662 func (m *NshMapDetails) Unmarshal(b []byte) error {
663 buf := codec.NewBuffer(b)
664 m.MapIndex = buf.DecodeUint32()
665 m.NspNsi = buf.DecodeUint32()
666 m.MappedNspNsi = buf.DecodeUint32()
667 m.NshAction = buf.DecodeUint32()
668 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
669 m.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
670 m.NextNode = buf.DecodeUint32()
674 // NshMapDump defines message 'nsh_map_dump'.
675 type NshMapDump struct {
676 MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
679 func (m *NshMapDump) Reset() { *m = NshMapDump{} }
680 func (*NshMapDump) GetMessageName() string { return "nsh_map_dump" }
681 func (*NshMapDump) GetCrcString() string { return "8fc06b82" }
682 func (*NshMapDump) GetMessageType() api.MessageType {
683 return api.RequestMessage
686 func (m *NshMapDump) Size() (size int) {
690 size += 4 // m.MapIndex
693 func (m *NshMapDump) Marshal(b []byte) ([]byte, error) {
695 b = make([]byte, m.Size())
697 buf := codec.NewBuffer(b)
698 buf.EncodeUint32(m.MapIndex)
699 return buf.Bytes(), nil
701 func (m *NshMapDump) Unmarshal(b []byte) error {
702 buf := codec.NewBuffer(b)
703 m.MapIndex = buf.DecodeUint32()
707 func init() { file_nsh_binapi_init() }
708 func file_nsh_binapi_init() {
709 api.RegisterMessage((*NshAddDelEntry)(nil), "nsh_add_del_entry_7dea480b")
710 api.RegisterMessage((*NshAddDelEntryReply)(nil), "nsh_add_del_entry_reply_6296a9eb")
711 api.RegisterMessage((*NshAddDelMap)(nil), "nsh_add_del_map_898d857d")
712 api.RegisterMessage((*NshAddDelMapReply)(nil), "nsh_add_del_map_reply_b2b127ef")
713 api.RegisterMessage((*NshEntryDetails)(nil), "nsh_entry_details_046fb556")
714 api.RegisterMessage((*NshEntryDump)(nil), "nsh_entry_dump_cdaf8ccb")
715 api.RegisterMessage((*NshMapDetails)(nil), "nsh_map_details_b34ac8a1")
716 api.RegisterMessage((*NshMapDump)(nil), "nsh_map_dump_8fc06b82")
719 // Messages returns list of all messages in this module.
720 func AllMessages() []api.Message {
721 return []api.Message{
722 (*NshAddDelEntry)(nil),
723 (*NshAddDelEntryReply)(nil),
724 (*NshAddDelMap)(nil),
725 (*NshAddDelMapReply)(nil),
726 (*NshEntryDetails)(nil),
727 (*NshEntryDump)(nil),
728 (*NshMapDetails)(nil),