Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / nsh / nsh.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/plugins/nsh.api.json
6
7 // Package nsh contains generated bindings for API file nsh.api.
8 //
9 // Contents:
10 //   1 alias
11 //   6 enums
12 //   8 messages
13 //
14 package nsh
15
16 import (
17         "strconv"
18
19         api "git.fd.io/govpp.git/api"
20         codec "git.fd.io/govpp.git/codec"
21 )
22
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
28
29 const (
30         APIFile    = "nsh"
31         APIVersion = "1.0.0"
32         VersionCrc = 0xac2c8897
33 )
34
35 // IfStatusFlags defines enum 'if_status_flags'.
36 type IfStatusFlags uint32
37
38 const (
39         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
40         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
41 )
42
43 var (
44         IfStatusFlags_name = map[uint32]string{
45                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
46                 2: "IF_STATUS_API_FLAG_LINK_UP",
47         }
48         IfStatusFlags_value = map[string]uint32{
49                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
50                 "IF_STATUS_API_FLAG_LINK_UP":  2,
51         }
52 )
53
54 func (x IfStatusFlags) String() string {
55         s, ok := IfStatusFlags_name[uint32(x)]
56         if ok {
57                 return s
58         }
59         str := func(n uint32) string {
60                 s, ok := IfStatusFlags_name[uint32(n)]
61                 if ok {
62                         return s
63                 }
64                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
65         }
66         for i := uint32(0); i <= 32; i++ {
67                 val := uint32(x)
68                 if val&(1<<i) != 0 {
69                         if s != "" {
70                                 s += "|"
71                         }
72                         s += str(1 << i)
73                 }
74         }
75         if s == "" {
76                 return str(uint32(x))
77         }
78         return s
79 }
80
81 // IfType defines enum 'if_type'.
82 type IfType uint32
83
84 const (
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
89 )
90
91 var (
92         IfType_name = map[uint32]string{
93                 1: "IF_API_TYPE_HARDWARE",
94                 2: "IF_API_TYPE_SUB",
95                 3: "IF_API_TYPE_P2P",
96                 4: "IF_API_TYPE_PIPE",
97         }
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,
103         }
104 )
105
106 func (x IfType) String() string {
107         s, ok := IfType_name[uint32(x)]
108         if ok {
109                 return s
110         }
111         return "IfType(" + strconv.Itoa(int(x)) + ")"
112 }
113
114 // LinkDuplex defines enum 'link_duplex'.
115 type LinkDuplex uint32
116
117 const (
118         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
119         LINK_DUPLEX_API_HALF    LinkDuplex = 1
120         LINK_DUPLEX_API_FULL    LinkDuplex = 2
121 )
122
123 var (
124         LinkDuplex_name = map[uint32]string{
125                 0: "LINK_DUPLEX_API_UNKNOWN",
126                 1: "LINK_DUPLEX_API_HALF",
127                 2: "LINK_DUPLEX_API_FULL",
128         }
129         LinkDuplex_value = map[string]uint32{
130                 "LINK_DUPLEX_API_UNKNOWN": 0,
131                 "LINK_DUPLEX_API_HALF":    1,
132                 "LINK_DUPLEX_API_FULL":    2,
133         }
134 )
135
136 func (x LinkDuplex) String() string {
137         s, ok := LinkDuplex_name[uint32(x)]
138         if ok {
139                 return s
140         }
141         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
142 }
143
144 // MtuProto defines enum 'mtu_proto'.
145 type MtuProto uint32
146
147 const (
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
153 )
154
155 var (
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",
162         }
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,
169         }
170 )
171
172 func (x MtuProto) String() string {
173         s, ok := MtuProto_name[uint32(x)]
174         if ok {
175                 return s
176         }
177         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
178 }
179
180 // RxMode defines enum 'rx_mode'.
181 type RxMode uint32
182
183 const (
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
189 )
190
191 var (
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",
198         }
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,
205         }
206 )
207
208 func (x RxMode) String() string {
209         s, ok := RxMode_name[uint32(x)]
210         if ok {
211                 return s
212         }
213         return "RxMode(" + strconv.Itoa(int(x)) + ")"
214 }
215
216 // SubIfFlags defines enum 'sub_if_flags'.
217 type SubIfFlags uint32
218
219 const (
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
230 )
231
232 var (
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",
244         }
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,
256         }
257 )
258
259 func (x SubIfFlags) String() string {
260         s, ok := SubIfFlags_name[uint32(x)]
261         if ok {
262                 return s
263         }
264         str := func(n uint32) string {
265                 s, ok := SubIfFlags_name[uint32(n)]
266                 if ok {
267                         return s
268                 }
269                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
270         }
271         for i := uint32(0); i <= 32; i++ {
272                 val := uint32(x)
273                 if val&(1<<i) != 0 {
274                         if s != "" {
275                                 s += "|"
276                         }
277                         s += str(1 << i)
278                 }
279         }
280         if s == "" {
281                 return str(uint32(x))
282         }
283         return s
284 }
285
286 // InterfaceIndex defines alias 'interface_index'.
287 type InterfaceIndex uint32
288
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"`
304 }
305
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
311 }
312
313 func (m *NshAddDelEntry) Size() (size int) {
314         if m == nil {
315                 return 0
316         }
317         size += 1       // m.IsAdd
318         size += 4       // m.NspNsi
319         size += 1       // m.MdType
320         size += 1       // m.VerOC
321         size += 1       // m.TTL
322         size += 1       // m.Length
323         size += 1       // m.NextProtocol
324         size += 4       // m.C1
325         size += 4       // m.C2
326         size += 4       // m.C3
327         size += 4       // m.C4
328         size += 1       // m.TlvLength
329         size += 1 * 248 // m.Tlv
330         return size
331 }
332 func (m *NshAddDelEntry) Marshal(b []byte) ([]byte, error) {
333         if b == nil {
334                 b = make([]byte, m.Size())
335         }
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
351 }
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)))
368         return nil
369 }
370
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"`
375 }
376
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
382 }
383
384 func (m *NshAddDelEntryReply) Size() (size int) {
385         if m == nil {
386                 return 0
387         }
388         size += 4 // m.Retval
389         size += 4 // m.EntryIndex
390         return size
391 }
392 func (m *NshAddDelEntryReply) Marshal(b []byte) ([]byte, error) {
393         if b == nil {
394                 b = make([]byte, m.Size())
395         }
396         buf := codec.NewBuffer(b)
397         buf.EncodeInt32(m.Retval)
398         buf.EncodeUint32(m.EntryIndex)
399         return buf.Bytes(), nil
400 }
401 func (m *NshAddDelEntryReply) Unmarshal(b []byte) error {
402         buf := codec.NewBuffer(b)
403         m.Retval = buf.DecodeInt32()
404         m.EntryIndex = buf.DecodeUint32()
405         return nil
406 }
407
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"`
417 }
418
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
424 }
425
426 func (m *NshAddDelMap) Size() (size int) {
427         if m == nil {
428                 return 0
429         }
430         size += 1 // m.IsAdd
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
437         return size
438 }
439 func (m *NshAddDelMap) Marshal(b []byte) ([]byte, error) {
440         if b == nil {
441                 b = make([]byte, m.Size())
442         }
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
452 }
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()
462         return nil
463 }
464
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"`
469 }
470
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
476 }
477
478 func (m *NshAddDelMapReply) Size() (size int) {
479         if m == nil {
480                 return 0
481         }
482         size += 4 // m.Retval
483         size += 4 // m.MapIndex
484         return size
485 }
486 func (m *NshAddDelMapReply) Marshal(b []byte) ([]byte, error) {
487         if b == nil {
488                 b = make([]byte, m.Size())
489         }
490         buf := codec.NewBuffer(b)
491         buf.EncodeInt32(m.Retval)
492         buf.EncodeUint32(m.MapIndex)
493         return buf.Bytes(), nil
494 }
495 func (m *NshAddDelMapReply) Unmarshal(b []byte) error {
496         buf := codec.NewBuffer(b)
497         m.Retval = buf.DecodeInt32()
498         m.MapIndex = buf.DecodeUint32()
499         return nil
500 }
501
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"`
517 }
518
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
524 }
525
526 func (m *NshEntryDetails) Size() (size int) {
527         if m == nil {
528                 return 0
529         }
530         size += 4       // m.EntryIndex
531         size += 4       // m.NspNsi
532         size += 1       // m.MdType
533         size += 1       // m.VerOC
534         size += 1       // m.TTL
535         size += 1       // m.Length
536         size += 1       // m.NextProtocol
537         size += 4       // m.C1
538         size += 4       // m.C2
539         size += 4       // m.C3
540         size += 4       // m.C4
541         size += 1       // m.TlvLength
542         size += 1 * 248 // m.Tlv
543         return size
544 }
545 func (m *NshEntryDetails) Marshal(b []byte) ([]byte, error) {
546         if b == nil {
547                 b = make([]byte, m.Size())
548         }
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
564 }
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)))
581         return nil
582 }
583
584 // NshEntryDump defines message 'nsh_entry_dump'.
585 type NshEntryDump struct {
586         EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
587 }
588
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
594 }
595
596 func (m *NshEntryDump) Size() (size int) {
597         if m == nil {
598                 return 0
599         }
600         size += 4 // m.EntryIndex
601         return size
602 }
603 func (m *NshEntryDump) Marshal(b []byte) ([]byte, error) {
604         if b == nil {
605                 b = make([]byte, m.Size())
606         }
607         buf := codec.NewBuffer(b)
608         buf.EncodeUint32(m.EntryIndex)
609         return buf.Bytes(), nil
610 }
611 func (m *NshEntryDump) Unmarshal(b []byte) error {
612         buf := codec.NewBuffer(b)
613         m.EntryIndex = buf.DecodeUint32()
614         return nil
615 }
616
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"`
626 }
627
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
633 }
634
635 func (m *NshMapDetails) Size() (size int) {
636         if m == nil {
637                 return 0
638         }
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
646         return size
647 }
648 func (m *NshMapDetails) Marshal(b []byte) ([]byte, error) {
649         if b == nil {
650                 b = make([]byte, m.Size())
651         }
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
661 }
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()
671         return nil
672 }
673
674 // NshMapDump defines message 'nsh_map_dump'.
675 type NshMapDump struct {
676         MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
677 }
678
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
684 }
685
686 func (m *NshMapDump) Size() (size int) {
687         if m == nil {
688                 return 0
689         }
690         size += 4 // m.MapIndex
691         return size
692 }
693 func (m *NshMapDump) Marshal(b []byte) ([]byte, error) {
694         if b == nil {
695                 b = make([]byte, m.Size())
696         }
697         buf := codec.NewBuffer(b)
698         buf.EncodeUint32(m.MapIndex)
699         return buf.Bytes(), nil
700 }
701 func (m *NshMapDump) Unmarshal(b []byte) error {
702         buf := codec.NewBuffer(b)
703         m.MapIndex = buf.DecodeUint32()
704         return nil
705 }
706
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")
717 }
718
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),
729                 (*NshMapDump)(nil),
730         }
731 }