75cb38af6f321f70c94ef33b16b407524fad9064
[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.4.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         api "git.fd.io/govpp.git/api"
18         codec "git.fd.io/govpp.git/codec"
19         "strconv"
20 )
21
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
27
28 const (
29         APIFile    = "nsh"
30         APIVersion = "1.0.0"
31         VersionCrc = 0xac2c8897
32 )
33
34 // IfStatusFlags defines enum 'if_status_flags'.
35 type IfStatusFlags uint32
36
37 const (
38         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
39         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
40 )
41
42 var (
43         IfStatusFlags_name = map[uint32]string{
44                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
45                 2: "IF_STATUS_API_FLAG_LINK_UP",
46         }
47         IfStatusFlags_value = map[string]uint32{
48                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
49                 "IF_STATUS_API_FLAG_LINK_UP":  2,
50         }
51 )
52
53 func (x IfStatusFlags) String() string {
54         s, ok := IfStatusFlags_name[uint32(x)]
55         if ok {
56                 return s
57         }
58         str := func(n uint32) string {
59                 s, ok := IfStatusFlags_name[uint32(n)]
60                 if ok {
61                         return s
62                 }
63                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
64         }
65         for i := uint32(0); i <= 32; i++ {
66                 val := uint32(x)
67                 if val&(1<<i) != 0 {
68                         if s != "" {
69                                 s += "|"
70                         }
71                         s += str(1 << i)
72                 }
73         }
74         if s == "" {
75                 return str(uint32(x))
76         }
77         return s
78 }
79
80 // IfType defines enum 'if_type'.
81 type IfType uint32
82
83 const (
84         IF_API_TYPE_HARDWARE IfType = 1
85         IF_API_TYPE_SUB      IfType = 2
86         IF_API_TYPE_P2P      IfType = 3
87         IF_API_TYPE_PIPE     IfType = 4
88 )
89
90 var (
91         IfType_name = map[uint32]string{
92                 1: "IF_API_TYPE_HARDWARE",
93                 2: "IF_API_TYPE_SUB",
94                 3: "IF_API_TYPE_P2P",
95                 4: "IF_API_TYPE_PIPE",
96         }
97         IfType_value = map[string]uint32{
98                 "IF_API_TYPE_HARDWARE": 1,
99                 "IF_API_TYPE_SUB":      2,
100                 "IF_API_TYPE_P2P":      3,
101                 "IF_API_TYPE_PIPE":     4,
102         }
103 )
104
105 func (x IfType) String() string {
106         s, ok := IfType_name[uint32(x)]
107         if ok {
108                 return s
109         }
110         return "IfType(" + strconv.Itoa(int(x)) + ")"
111 }
112
113 // LinkDuplex defines enum 'link_duplex'.
114 type LinkDuplex uint32
115
116 const (
117         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
118         LINK_DUPLEX_API_HALF    LinkDuplex = 1
119         LINK_DUPLEX_API_FULL    LinkDuplex = 2
120 )
121
122 var (
123         LinkDuplex_name = map[uint32]string{
124                 0: "LINK_DUPLEX_API_UNKNOWN",
125                 1: "LINK_DUPLEX_API_HALF",
126                 2: "LINK_DUPLEX_API_FULL",
127         }
128         LinkDuplex_value = map[string]uint32{
129                 "LINK_DUPLEX_API_UNKNOWN": 0,
130                 "LINK_DUPLEX_API_HALF":    1,
131                 "LINK_DUPLEX_API_FULL":    2,
132         }
133 )
134
135 func (x LinkDuplex) String() string {
136         s, ok := LinkDuplex_name[uint32(x)]
137         if ok {
138                 return s
139         }
140         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
141 }
142
143 // MtuProto defines enum 'mtu_proto'.
144 type MtuProto uint32
145
146 const (
147         MTU_PROTO_API_L3   MtuProto = 1
148         MTU_PROTO_API_IP4  MtuProto = 2
149         MTU_PROTO_API_IP6  MtuProto = 3
150         MTU_PROTO_API_MPLS MtuProto = 4
151         MTU_PROTO_API_N    MtuProto = 5
152 )
153
154 var (
155         MtuProto_name = map[uint32]string{
156                 1: "MTU_PROTO_API_L3",
157                 2: "MTU_PROTO_API_IP4",
158                 3: "MTU_PROTO_API_IP6",
159                 4: "MTU_PROTO_API_MPLS",
160                 5: "MTU_PROTO_API_N",
161         }
162         MtuProto_value = map[string]uint32{
163                 "MTU_PROTO_API_L3":   1,
164                 "MTU_PROTO_API_IP4":  2,
165                 "MTU_PROTO_API_IP6":  3,
166                 "MTU_PROTO_API_MPLS": 4,
167                 "MTU_PROTO_API_N":    5,
168         }
169 )
170
171 func (x MtuProto) String() string {
172         s, ok := MtuProto_name[uint32(x)]
173         if ok {
174                 return s
175         }
176         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
177 }
178
179 // RxMode defines enum 'rx_mode'.
180 type RxMode uint32
181
182 const (
183         RX_MODE_API_UNKNOWN   RxMode = 0
184         RX_MODE_API_POLLING   RxMode = 1
185         RX_MODE_API_INTERRUPT RxMode = 2
186         RX_MODE_API_ADAPTIVE  RxMode = 3
187         RX_MODE_API_DEFAULT   RxMode = 4
188 )
189
190 var (
191         RxMode_name = map[uint32]string{
192                 0: "RX_MODE_API_UNKNOWN",
193                 1: "RX_MODE_API_POLLING",
194                 2: "RX_MODE_API_INTERRUPT",
195                 3: "RX_MODE_API_ADAPTIVE",
196                 4: "RX_MODE_API_DEFAULT",
197         }
198         RxMode_value = map[string]uint32{
199                 "RX_MODE_API_UNKNOWN":   0,
200                 "RX_MODE_API_POLLING":   1,
201                 "RX_MODE_API_INTERRUPT": 2,
202                 "RX_MODE_API_ADAPTIVE":  3,
203                 "RX_MODE_API_DEFAULT":   4,
204         }
205 )
206
207 func (x RxMode) String() string {
208         s, ok := RxMode_name[uint32(x)]
209         if ok {
210                 return s
211         }
212         return "RxMode(" + strconv.Itoa(int(x)) + ")"
213 }
214
215 // SubIfFlags defines enum 'sub_if_flags'.
216 type SubIfFlags uint32
217
218 const (
219         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
220         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
221         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
222         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
223         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
224         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
225         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
226         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
227         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
228         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
229 )
230
231 var (
232         SubIfFlags_name = map[uint32]string{
233                 1:   "SUB_IF_API_FLAG_NO_TAGS",
234                 2:   "SUB_IF_API_FLAG_ONE_TAG",
235                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
236                 8:   "SUB_IF_API_FLAG_DOT1AD",
237                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
238                 32:  "SUB_IF_API_FLAG_DEFAULT",
239                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
240                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
241                 254: "SUB_IF_API_FLAG_MASK_VNET",
242                 256: "SUB_IF_API_FLAG_DOT1AH",
243         }
244         SubIfFlags_value = map[string]uint32{
245                 "SUB_IF_API_FLAG_NO_TAGS":           1,
246                 "SUB_IF_API_FLAG_ONE_TAG":           2,
247                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
248                 "SUB_IF_API_FLAG_DOT1AD":            8,
249                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
250                 "SUB_IF_API_FLAG_DEFAULT":           32,
251                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
252                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
253                 "SUB_IF_API_FLAG_MASK_VNET":         254,
254                 "SUB_IF_API_FLAG_DOT1AH":            256,
255         }
256 )
257
258 func (x SubIfFlags) String() string {
259         s, ok := SubIfFlags_name[uint32(x)]
260         if ok {
261                 return s
262         }
263         str := func(n uint32) string {
264                 s, ok := SubIfFlags_name[uint32(n)]
265                 if ok {
266                         return s
267                 }
268                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
269         }
270         for i := uint32(0); i <= 32; i++ {
271                 val := uint32(x)
272                 if val&(1<<i) != 0 {
273                         if s != "" {
274                                 s += "|"
275                         }
276                         s += str(1 << i)
277                 }
278         }
279         if s == "" {
280                 return str(uint32(x))
281         }
282         return s
283 }
284
285 // InterfaceIndex defines alias 'interface_index'.
286 type InterfaceIndex uint32
287
288 // NshAddDelEntry defines message 'nsh_add_del_entry'.
289 type NshAddDelEntry struct {
290         IsAdd        bool   `binapi:"bool,name=is_add" json:"is_add,omitempty"`
291         NspNsi       uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
292         MdType       uint8  `binapi:"u8,name=md_type" json:"md_type,omitempty"`
293         VerOC        uint8  `binapi:"u8,name=ver_o_c" json:"ver_o_c,omitempty"`
294         TTL          uint8  `binapi:"u8,name=ttl" json:"ttl,omitempty"`
295         Length       uint8  `binapi:"u8,name=length" json:"length,omitempty"`
296         NextProtocol uint8  `binapi:"u8,name=next_protocol" json:"next_protocol,omitempty"`
297         C1           uint32 `binapi:"u32,name=c1" json:"c1,omitempty"`
298         C2           uint32 `binapi:"u32,name=c2" json:"c2,omitempty"`
299         C3           uint32 `binapi:"u32,name=c3" json:"c3,omitempty"`
300         C4           uint32 `binapi:"u32,name=c4" json:"c4,omitempty"`
301         TlvLength    uint8  `binapi:"u8,name=tlv_length" json:"tlv_length,omitempty"`
302         Tlv          []byte `binapi:"u8[248],name=tlv" json:"tlv,omitempty"`
303 }
304
305 func (m *NshAddDelEntry) Reset()               { *m = NshAddDelEntry{} }
306 func (*NshAddDelEntry) GetMessageName() string { return "nsh_add_del_entry" }
307 func (*NshAddDelEntry) GetCrcString() string   { return "7dea480b" }
308 func (*NshAddDelEntry) GetMessageType() api.MessageType {
309         return api.RequestMessage
310 }
311
312 func (m *NshAddDelEntry) Size() (size int) {
313         if m == nil {
314                 return 0
315         }
316         size += 1       // m.IsAdd
317         size += 4       // m.NspNsi
318         size += 1       // m.MdType
319         size += 1       // m.VerOC
320         size += 1       // m.TTL
321         size += 1       // m.Length
322         size += 1       // m.NextProtocol
323         size += 4       // m.C1
324         size += 4       // m.C2
325         size += 4       // m.C3
326         size += 4       // m.C4
327         size += 1       // m.TlvLength
328         size += 1 * 248 // m.Tlv
329         return size
330 }
331 func (m *NshAddDelEntry) Marshal(b []byte) ([]byte, error) {
332         if b == nil {
333                 b = make([]byte, m.Size())
334         }
335         buf := codec.NewBuffer(b)
336         buf.EncodeBool(m.IsAdd)
337         buf.EncodeUint32(m.NspNsi)
338         buf.EncodeUint8(m.MdType)
339         buf.EncodeUint8(m.VerOC)
340         buf.EncodeUint8(m.TTL)
341         buf.EncodeUint8(m.Length)
342         buf.EncodeUint8(m.NextProtocol)
343         buf.EncodeUint32(m.C1)
344         buf.EncodeUint32(m.C2)
345         buf.EncodeUint32(m.C3)
346         buf.EncodeUint32(m.C4)
347         buf.EncodeUint8(m.TlvLength)
348         buf.EncodeBytes(m.Tlv, 248)
349         return buf.Bytes(), nil
350 }
351 func (m *NshAddDelEntry) Unmarshal(b []byte) error {
352         buf := codec.NewBuffer(b)
353         m.IsAdd = buf.DecodeBool()
354         m.NspNsi = buf.DecodeUint32()
355         m.MdType = buf.DecodeUint8()
356         m.VerOC = buf.DecodeUint8()
357         m.TTL = buf.DecodeUint8()
358         m.Length = buf.DecodeUint8()
359         m.NextProtocol = buf.DecodeUint8()
360         m.C1 = buf.DecodeUint32()
361         m.C2 = buf.DecodeUint32()
362         m.C3 = buf.DecodeUint32()
363         m.C4 = buf.DecodeUint32()
364         m.TlvLength = buf.DecodeUint8()
365         m.Tlv = make([]byte, 248)
366         copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
367         return nil
368 }
369
370 // NshAddDelEntryReply defines message 'nsh_add_del_entry_reply'.
371 type NshAddDelEntryReply struct {
372         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
373         EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
374 }
375
376 func (m *NshAddDelEntryReply) Reset()               { *m = NshAddDelEntryReply{} }
377 func (*NshAddDelEntryReply) GetMessageName() string { return "nsh_add_del_entry_reply" }
378 func (*NshAddDelEntryReply) GetCrcString() string   { return "6296a9eb" }
379 func (*NshAddDelEntryReply) GetMessageType() api.MessageType {
380         return api.ReplyMessage
381 }
382
383 func (m *NshAddDelEntryReply) Size() (size int) {
384         if m == nil {
385                 return 0
386         }
387         size += 4 // m.Retval
388         size += 4 // m.EntryIndex
389         return size
390 }
391 func (m *NshAddDelEntryReply) Marshal(b []byte) ([]byte, error) {
392         if b == nil {
393                 b = make([]byte, m.Size())
394         }
395         buf := codec.NewBuffer(b)
396         buf.EncodeInt32(m.Retval)
397         buf.EncodeUint32(m.EntryIndex)
398         return buf.Bytes(), nil
399 }
400 func (m *NshAddDelEntryReply) Unmarshal(b []byte) error {
401         buf := codec.NewBuffer(b)
402         m.Retval = buf.DecodeInt32()
403         m.EntryIndex = buf.DecodeUint32()
404         return nil
405 }
406
407 // NshAddDelMap defines message 'nsh_add_del_map'.
408 type NshAddDelMap struct {
409         IsAdd        bool           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
410         NspNsi       uint32         `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
411         MappedNspNsi uint32         `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
412         NshAction    uint32         `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
413         SwIfIndex    InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
414         RxSwIfIndex  InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
415         NextNode     uint32         `binapi:"u32,name=next_node" json:"next_node,omitempty"`
416 }
417
418 func (m *NshAddDelMap) Reset()               { *m = NshAddDelMap{} }
419 func (*NshAddDelMap) GetMessageName() string { return "nsh_add_del_map" }
420 func (*NshAddDelMap) GetCrcString() string   { return "898d857d" }
421 func (*NshAddDelMap) GetMessageType() api.MessageType {
422         return api.RequestMessage
423 }
424
425 func (m *NshAddDelMap) Size() (size int) {
426         if m == nil {
427                 return 0
428         }
429         size += 1 // m.IsAdd
430         size += 4 // m.NspNsi
431         size += 4 // m.MappedNspNsi
432         size += 4 // m.NshAction
433         size += 4 // m.SwIfIndex
434         size += 4 // m.RxSwIfIndex
435         size += 4 // m.NextNode
436         return size
437 }
438 func (m *NshAddDelMap) Marshal(b []byte) ([]byte, error) {
439         if b == nil {
440                 b = make([]byte, m.Size())
441         }
442         buf := codec.NewBuffer(b)
443         buf.EncodeBool(m.IsAdd)
444         buf.EncodeUint32(m.NspNsi)
445         buf.EncodeUint32(m.MappedNspNsi)
446         buf.EncodeUint32(m.NshAction)
447         buf.EncodeUint32(uint32(m.SwIfIndex))
448         buf.EncodeUint32(uint32(m.RxSwIfIndex))
449         buf.EncodeUint32(m.NextNode)
450         return buf.Bytes(), nil
451 }
452 func (m *NshAddDelMap) Unmarshal(b []byte) error {
453         buf := codec.NewBuffer(b)
454         m.IsAdd = buf.DecodeBool()
455         m.NspNsi = buf.DecodeUint32()
456         m.MappedNspNsi = buf.DecodeUint32()
457         m.NshAction = buf.DecodeUint32()
458         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
459         m.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
460         m.NextNode = buf.DecodeUint32()
461         return nil
462 }
463
464 // NshAddDelMapReply defines message 'nsh_add_del_map_reply'.
465 type NshAddDelMapReply struct {
466         Retval   int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
467         MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
468 }
469
470 func (m *NshAddDelMapReply) Reset()               { *m = NshAddDelMapReply{} }
471 func (*NshAddDelMapReply) GetMessageName() string { return "nsh_add_del_map_reply" }
472 func (*NshAddDelMapReply) GetCrcString() string   { return "b2b127ef" }
473 func (*NshAddDelMapReply) GetMessageType() api.MessageType {
474         return api.ReplyMessage
475 }
476
477 func (m *NshAddDelMapReply) Size() (size int) {
478         if m == nil {
479                 return 0
480         }
481         size += 4 // m.Retval
482         size += 4 // m.MapIndex
483         return size
484 }
485 func (m *NshAddDelMapReply) Marshal(b []byte) ([]byte, error) {
486         if b == nil {
487                 b = make([]byte, m.Size())
488         }
489         buf := codec.NewBuffer(b)
490         buf.EncodeInt32(m.Retval)
491         buf.EncodeUint32(m.MapIndex)
492         return buf.Bytes(), nil
493 }
494 func (m *NshAddDelMapReply) Unmarshal(b []byte) error {
495         buf := codec.NewBuffer(b)
496         m.Retval = buf.DecodeInt32()
497         m.MapIndex = buf.DecodeUint32()
498         return nil
499 }
500
501 // NshEntryDetails defines message 'nsh_entry_details'.
502 type NshEntryDetails struct {
503         EntryIndex   uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
504         NspNsi       uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
505         MdType       uint8  `binapi:"u8,name=md_type" json:"md_type,omitempty"`
506         VerOC        uint8  `binapi:"u8,name=ver_o_c" json:"ver_o_c,omitempty"`
507         TTL          uint8  `binapi:"u8,name=ttl" json:"ttl,omitempty"`
508         Length       uint8  `binapi:"u8,name=length" json:"length,omitempty"`
509         NextProtocol uint8  `binapi:"u8,name=next_protocol" json:"next_protocol,omitempty"`
510         C1           uint32 `binapi:"u32,name=c1" json:"c1,omitempty"`
511         C2           uint32 `binapi:"u32,name=c2" json:"c2,omitempty"`
512         C3           uint32 `binapi:"u32,name=c3" json:"c3,omitempty"`
513         C4           uint32 `binapi:"u32,name=c4" json:"c4,omitempty"`
514         TlvLength    uint8  `binapi:"u8,name=tlv_length" json:"tlv_length,omitempty"`
515         Tlv          []byte `binapi:"u8[248],name=tlv" json:"tlv,omitempty"`
516 }
517
518 func (m *NshEntryDetails) Reset()               { *m = NshEntryDetails{} }
519 func (*NshEntryDetails) GetMessageName() string { return "nsh_entry_details" }
520 func (*NshEntryDetails) GetCrcString() string   { return "046fb556" }
521 func (*NshEntryDetails) GetMessageType() api.MessageType {
522         return api.ReplyMessage
523 }
524
525 func (m *NshEntryDetails) Size() (size int) {
526         if m == nil {
527                 return 0
528         }
529         size += 4       // m.EntryIndex
530         size += 4       // m.NspNsi
531         size += 1       // m.MdType
532         size += 1       // m.VerOC
533         size += 1       // m.TTL
534         size += 1       // m.Length
535         size += 1       // m.NextProtocol
536         size += 4       // m.C1
537         size += 4       // m.C2
538         size += 4       // m.C3
539         size += 4       // m.C4
540         size += 1       // m.TlvLength
541         size += 1 * 248 // m.Tlv
542         return size
543 }
544 func (m *NshEntryDetails) Marshal(b []byte) ([]byte, error) {
545         if b == nil {
546                 b = make([]byte, m.Size())
547         }
548         buf := codec.NewBuffer(b)
549         buf.EncodeUint32(m.EntryIndex)
550         buf.EncodeUint32(m.NspNsi)
551         buf.EncodeUint8(m.MdType)
552         buf.EncodeUint8(m.VerOC)
553         buf.EncodeUint8(m.TTL)
554         buf.EncodeUint8(m.Length)
555         buf.EncodeUint8(m.NextProtocol)
556         buf.EncodeUint32(m.C1)
557         buf.EncodeUint32(m.C2)
558         buf.EncodeUint32(m.C3)
559         buf.EncodeUint32(m.C4)
560         buf.EncodeUint8(m.TlvLength)
561         buf.EncodeBytes(m.Tlv, 248)
562         return buf.Bytes(), nil
563 }
564 func (m *NshEntryDetails) Unmarshal(b []byte) error {
565         buf := codec.NewBuffer(b)
566         m.EntryIndex = buf.DecodeUint32()
567         m.NspNsi = buf.DecodeUint32()
568         m.MdType = buf.DecodeUint8()
569         m.VerOC = buf.DecodeUint8()
570         m.TTL = buf.DecodeUint8()
571         m.Length = buf.DecodeUint8()
572         m.NextProtocol = buf.DecodeUint8()
573         m.C1 = buf.DecodeUint32()
574         m.C2 = buf.DecodeUint32()
575         m.C3 = buf.DecodeUint32()
576         m.C4 = buf.DecodeUint32()
577         m.TlvLength = buf.DecodeUint8()
578         m.Tlv = make([]byte, 248)
579         copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
580         return nil
581 }
582
583 // NshEntryDump defines message 'nsh_entry_dump'.
584 type NshEntryDump struct {
585         EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
586 }
587
588 func (m *NshEntryDump) Reset()               { *m = NshEntryDump{} }
589 func (*NshEntryDump) GetMessageName() string { return "nsh_entry_dump" }
590 func (*NshEntryDump) GetCrcString() string   { return "cdaf8ccb" }
591 func (*NshEntryDump) GetMessageType() api.MessageType {
592         return api.RequestMessage
593 }
594
595 func (m *NshEntryDump) Size() (size int) {
596         if m == nil {
597                 return 0
598         }
599         size += 4 // m.EntryIndex
600         return size
601 }
602 func (m *NshEntryDump) Marshal(b []byte) ([]byte, error) {
603         if b == nil {
604                 b = make([]byte, m.Size())
605         }
606         buf := codec.NewBuffer(b)
607         buf.EncodeUint32(m.EntryIndex)
608         return buf.Bytes(), nil
609 }
610 func (m *NshEntryDump) Unmarshal(b []byte) error {
611         buf := codec.NewBuffer(b)
612         m.EntryIndex = buf.DecodeUint32()
613         return nil
614 }
615
616 // NshMapDetails defines message 'nsh_map_details'.
617 type NshMapDetails struct {
618         MapIndex     uint32         `binapi:"u32,name=map_index" json:"map_index,omitempty"`
619         NspNsi       uint32         `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
620         MappedNspNsi uint32         `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
621         NshAction    uint32         `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
622         SwIfIndex    InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
623         RxSwIfIndex  InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
624         NextNode     uint32         `binapi:"u32,name=next_node" json:"next_node,omitempty"`
625 }
626
627 func (m *NshMapDetails) Reset()               { *m = NshMapDetails{} }
628 func (*NshMapDetails) GetMessageName() string { return "nsh_map_details" }
629 func (*NshMapDetails) GetCrcString() string   { return "b34ac8a1" }
630 func (*NshMapDetails) GetMessageType() api.MessageType {
631         return api.ReplyMessage
632 }
633
634 func (m *NshMapDetails) Size() (size int) {
635         if m == nil {
636                 return 0
637         }
638         size += 4 // m.MapIndex
639         size += 4 // m.NspNsi
640         size += 4 // m.MappedNspNsi
641         size += 4 // m.NshAction
642         size += 4 // m.SwIfIndex
643         size += 4 // m.RxSwIfIndex
644         size += 4 // m.NextNode
645         return size
646 }
647 func (m *NshMapDetails) Marshal(b []byte) ([]byte, error) {
648         if b == nil {
649                 b = make([]byte, m.Size())
650         }
651         buf := codec.NewBuffer(b)
652         buf.EncodeUint32(m.MapIndex)
653         buf.EncodeUint32(m.NspNsi)
654         buf.EncodeUint32(m.MappedNspNsi)
655         buf.EncodeUint32(m.NshAction)
656         buf.EncodeUint32(uint32(m.SwIfIndex))
657         buf.EncodeUint32(uint32(m.RxSwIfIndex))
658         buf.EncodeUint32(m.NextNode)
659         return buf.Bytes(), nil
660 }
661 func (m *NshMapDetails) Unmarshal(b []byte) error {
662         buf := codec.NewBuffer(b)
663         m.MapIndex = buf.DecodeUint32()
664         m.NspNsi = buf.DecodeUint32()
665         m.MappedNspNsi = buf.DecodeUint32()
666         m.NshAction = buf.DecodeUint32()
667         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
668         m.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
669         m.NextNode = buf.DecodeUint32()
670         return nil
671 }
672
673 // NshMapDump defines message 'nsh_map_dump'.
674 type NshMapDump struct {
675         MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
676 }
677
678 func (m *NshMapDump) Reset()               { *m = NshMapDump{} }
679 func (*NshMapDump) GetMessageName() string { return "nsh_map_dump" }
680 func (*NshMapDump) GetCrcString() string   { return "8fc06b82" }
681 func (*NshMapDump) GetMessageType() api.MessageType {
682         return api.RequestMessage
683 }
684
685 func (m *NshMapDump) Size() (size int) {
686         if m == nil {
687                 return 0
688         }
689         size += 4 // m.MapIndex
690         return size
691 }
692 func (m *NshMapDump) Marshal(b []byte) ([]byte, error) {
693         if b == nil {
694                 b = make([]byte, m.Size())
695         }
696         buf := codec.NewBuffer(b)
697         buf.EncodeUint32(m.MapIndex)
698         return buf.Bytes(), nil
699 }
700 func (m *NshMapDump) Unmarshal(b []byte) error {
701         buf := codec.NewBuffer(b)
702         m.MapIndex = buf.DecodeUint32()
703         return nil
704 }
705
706 func init() { file_nsh_binapi_init() }
707 func file_nsh_binapi_init() {
708         api.RegisterMessage((*NshAddDelEntry)(nil), "nsh_add_del_entry_7dea480b")
709         api.RegisterMessage((*NshAddDelEntryReply)(nil), "nsh_add_del_entry_reply_6296a9eb")
710         api.RegisterMessage((*NshAddDelMap)(nil), "nsh_add_del_map_898d857d")
711         api.RegisterMessage((*NshAddDelMapReply)(nil), "nsh_add_del_map_reply_b2b127ef")
712         api.RegisterMessage((*NshEntryDetails)(nil), "nsh_entry_details_046fb556")
713         api.RegisterMessage((*NshEntryDump)(nil), "nsh_entry_dump_cdaf8ccb")
714         api.RegisterMessage((*NshMapDetails)(nil), "nsh_map_details_b34ac8a1")
715         api.RegisterMessage((*NshMapDump)(nil), "nsh_map_dump_8fc06b82")
716 }
717
718 // Messages returns list of all messages in this module.
719 func AllMessages() []api.Message {
720         return []api.Message{
721                 (*NshAddDelEntry)(nil),
722                 (*NshAddDelEntryReply)(nil),
723                 (*NshAddDelMap)(nil),
724                 (*NshAddDelMapReply)(nil),
725                 (*NshEntryDetails)(nil),
726                 (*NshEntryDump)(nil),
727                 (*NshMapDetails)(nil),
728                 (*NshMapDump)(nil),
729         }
730 }