160f7bda5c13f1f204652e4cf9dcfef5b31e8dd3
[govpp.git] / binapi / 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.05-release
5
6 // Package nsh contains generated bindings for API file nsh.api.
7 //
8 // Contents:
9 //   8 messages
10 //
11 package nsh
12
13 import (
14         api "git.fd.io/govpp.git/api"
15         interface_types "git.fd.io/govpp.git/binapi/interface_types"
16         codec "git.fd.io/govpp.git/codec"
17 )
18
19 // This is a compile-time assertion to ensure that this generated file
20 // is compatible with the GoVPP api package it is being compiled against.
21 // A compilation error at this line likely means your copy of the
22 // GoVPP api package needs to be updated.
23 const _ = api.GoVppAPIPackageIsVersion2
24
25 const (
26         APIFile    = "nsh"
27         APIVersion = "1.0.0"
28         VersionCrc = 0x43be6707
29 )
30
31 // NshAddDelEntry defines message 'nsh_add_del_entry'.
32 type NshAddDelEntry struct {
33         IsAdd        bool   `binapi:"bool,name=is_add" json:"is_add,omitempty"`
34         NspNsi       uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
35         MdType       uint8  `binapi:"u8,name=md_type" json:"md_type,omitempty"`
36         VerOC        uint8  `binapi:"u8,name=ver_o_c" json:"ver_o_c,omitempty"`
37         TTL          uint8  `binapi:"u8,name=ttl" json:"ttl,omitempty"`
38         Length       uint8  `binapi:"u8,name=length" json:"length,omitempty"`
39         NextProtocol uint8  `binapi:"u8,name=next_protocol" json:"next_protocol,omitempty"`
40         C1           uint32 `binapi:"u32,name=c1" json:"c1,omitempty"`
41         C2           uint32 `binapi:"u32,name=c2" json:"c2,omitempty"`
42         C3           uint32 `binapi:"u32,name=c3" json:"c3,omitempty"`
43         C4           uint32 `binapi:"u32,name=c4" json:"c4,omitempty"`
44         TlvLength    uint8  `binapi:"u8,name=tlv_length" json:"tlv_length,omitempty"`
45         Tlv          []byte `binapi:"u8[248],name=tlv" json:"tlv,omitempty"`
46 }
47
48 func (m *NshAddDelEntry) Reset()               { *m = NshAddDelEntry{} }
49 func (*NshAddDelEntry) GetMessageName() string { return "nsh_add_del_entry" }
50 func (*NshAddDelEntry) GetCrcString() string   { return "7dea480b" }
51 func (*NshAddDelEntry) GetMessageType() api.MessageType {
52         return api.RequestMessage
53 }
54
55 func (m *NshAddDelEntry) Size() (size int) {
56         if m == nil {
57                 return 0
58         }
59         size += 1       // m.IsAdd
60         size += 4       // m.NspNsi
61         size += 1       // m.MdType
62         size += 1       // m.VerOC
63         size += 1       // m.TTL
64         size += 1       // m.Length
65         size += 1       // m.NextProtocol
66         size += 4       // m.C1
67         size += 4       // m.C2
68         size += 4       // m.C3
69         size += 4       // m.C4
70         size += 1       // m.TlvLength
71         size += 1 * 248 // m.Tlv
72         return size
73 }
74 func (m *NshAddDelEntry) Marshal(b []byte) ([]byte, error) {
75         if b == nil {
76                 b = make([]byte, m.Size())
77         }
78         buf := codec.NewBuffer(b)
79         buf.EncodeBool(m.IsAdd)
80         buf.EncodeUint32(m.NspNsi)
81         buf.EncodeUint8(m.MdType)
82         buf.EncodeUint8(m.VerOC)
83         buf.EncodeUint8(m.TTL)
84         buf.EncodeUint8(m.Length)
85         buf.EncodeUint8(m.NextProtocol)
86         buf.EncodeUint32(m.C1)
87         buf.EncodeUint32(m.C2)
88         buf.EncodeUint32(m.C3)
89         buf.EncodeUint32(m.C4)
90         buf.EncodeUint8(m.TlvLength)
91         buf.EncodeBytes(m.Tlv, 248)
92         return buf.Bytes(), nil
93 }
94 func (m *NshAddDelEntry) Unmarshal(b []byte) error {
95         buf := codec.NewBuffer(b)
96         m.IsAdd = buf.DecodeBool()
97         m.NspNsi = buf.DecodeUint32()
98         m.MdType = buf.DecodeUint8()
99         m.VerOC = buf.DecodeUint8()
100         m.TTL = buf.DecodeUint8()
101         m.Length = buf.DecodeUint8()
102         m.NextProtocol = buf.DecodeUint8()
103         m.C1 = buf.DecodeUint32()
104         m.C2 = buf.DecodeUint32()
105         m.C3 = buf.DecodeUint32()
106         m.C4 = buf.DecodeUint32()
107         m.TlvLength = buf.DecodeUint8()
108         m.Tlv = make([]byte, 248)
109         copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
110         return nil
111 }
112
113 // NshAddDelEntryReply defines message 'nsh_add_del_entry_reply'.
114 type NshAddDelEntryReply struct {
115         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
116         EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
117 }
118
119 func (m *NshAddDelEntryReply) Reset()               { *m = NshAddDelEntryReply{} }
120 func (*NshAddDelEntryReply) GetMessageName() string { return "nsh_add_del_entry_reply" }
121 func (*NshAddDelEntryReply) GetCrcString() string   { return "6296a9eb" }
122 func (*NshAddDelEntryReply) GetMessageType() api.MessageType {
123         return api.ReplyMessage
124 }
125
126 func (m *NshAddDelEntryReply) Size() (size int) {
127         if m == nil {
128                 return 0
129         }
130         size += 4 // m.Retval
131         size += 4 // m.EntryIndex
132         return size
133 }
134 func (m *NshAddDelEntryReply) Marshal(b []byte) ([]byte, error) {
135         if b == nil {
136                 b = make([]byte, m.Size())
137         }
138         buf := codec.NewBuffer(b)
139         buf.EncodeInt32(m.Retval)
140         buf.EncodeUint32(m.EntryIndex)
141         return buf.Bytes(), nil
142 }
143 func (m *NshAddDelEntryReply) Unmarshal(b []byte) error {
144         buf := codec.NewBuffer(b)
145         m.Retval = buf.DecodeInt32()
146         m.EntryIndex = buf.DecodeUint32()
147         return nil
148 }
149
150 // NshAddDelMap defines message 'nsh_add_del_map'.
151 type NshAddDelMap struct {
152         IsAdd        bool                           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
153         NspNsi       uint32                         `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
154         MappedNspNsi uint32                         `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
155         NshAction    uint32                         `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
156         SwIfIndex    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
157         RxSwIfIndex  interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
158         NextNode     uint32                         `binapi:"u32,name=next_node" json:"next_node,omitempty"`
159 }
160
161 func (m *NshAddDelMap) Reset()               { *m = NshAddDelMap{} }
162 func (*NshAddDelMap) GetMessageName() string { return "nsh_add_del_map" }
163 func (*NshAddDelMap) GetCrcString() string   { return "898d857d" }
164 func (*NshAddDelMap) GetMessageType() api.MessageType {
165         return api.RequestMessage
166 }
167
168 func (m *NshAddDelMap) Size() (size int) {
169         if m == nil {
170                 return 0
171         }
172         size += 1 // m.IsAdd
173         size += 4 // m.NspNsi
174         size += 4 // m.MappedNspNsi
175         size += 4 // m.NshAction
176         size += 4 // m.SwIfIndex
177         size += 4 // m.RxSwIfIndex
178         size += 4 // m.NextNode
179         return size
180 }
181 func (m *NshAddDelMap) Marshal(b []byte) ([]byte, error) {
182         if b == nil {
183                 b = make([]byte, m.Size())
184         }
185         buf := codec.NewBuffer(b)
186         buf.EncodeBool(m.IsAdd)
187         buf.EncodeUint32(m.NspNsi)
188         buf.EncodeUint32(m.MappedNspNsi)
189         buf.EncodeUint32(m.NshAction)
190         buf.EncodeUint32(uint32(m.SwIfIndex))
191         buf.EncodeUint32(uint32(m.RxSwIfIndex))
192         buf.EncodeUint32(m.NextNode)
193         return buf.Bytes(), nil
194 }
195 func (m *NshAddDelMap) Unmarshal(b []byte) error {
196         buf := codec.NewBuffer(b)
197         m.IsAdd = buf.DecodeBool()
198         m.NspNsi = buf.DecodeUint32()
199         m.MappedNspNsi = buf.DecodeUint32()
200         m.NshAction = buf.DecodeUint32()
201         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
202         m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
203         m.NextNode = buf.DecodeUint32()
204         return nil
205 }
206
207 // NshAddDelMapReply defines message 'nsh_add_del_map_reply'.
208 type NshAddDelMapReply struct {
209         Retval   int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
210         MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
211 }
212
213 func (m *NshAddDelMapReply) Reset()               { *m = NshAddDelMapReply{} }
214 func (*NshAddDelMapReply) GetMessageName() string { return "nsh_add_del_map_reply" }
215 func (*NshAddDelMapReply) GetCrcString() string   { return "b2b127ef" }
216 func (*NshAddDelMapReply) GetMessageType() api.MessageType {
217         return api.ReplyMessage
218 }
219
220 func (m *NshAddDelMapReply) Size() (size int) {
221         if m == nil {
222                 return 0
223         }
224         size += 4 // m.Retval
225         size += 4 // m.MapIndex
226         return size
227 }
228 func (m *NshAddDelMapReply) Marshal(b []byte) ([]byte, error) {
229         if b == nil {
230                 b = make([]byte, m.Size())
231         }
232         buf := codec.NewBuffer(b)
233         buf.EncodeInt32(m.Retval)
234         buf.EncodeUint32(m.MapIndex)
235         return buf.Bytes(), nil
236 }
237 func (m *NshAddDelMapReply) Unmarshal(b []byte) error {
238         buf := codec.NewBuffer(b)
239         m.Retval = buf.DecodeInt32()
240         m.MapIndex = buf.DecodeUint32()
241         return nil
242 }
243
244 // NshEntryDetails defines message 'nsh_entry_details'.
245 type NshEntryDetails struct {
246         EntryIndex   uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
247         NspNsi       uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
248         MdType       uint8  `binapi:"u8,name=md_type" json:"md_type,omitempty"`
249         VerOC        uint8  `binapi:"u8,name=ver_o_c" json:"ver_o_c,omitempty"`
250         TTL          uint8  `binapi:"u8,name=ttl" json:"ttl,omitempty"`
251         Length       uint8  `binapi:"u8,name=length" json:"length,omitempty"`
252         NextProtocol uint8  `binapi:"u8,name=next_protocol" json:"next_protocol,omitempty"`
253         C1           uint32 `binapi:"u32,name=c1" json:"c1,omitempty"`
254         C2           uint32 `binapi:"u32,name=c2" json:"c2,omitempty"`
255         C3           uint32 `binapi:"u32,name=c3" json:"c3,omitempty"`
256         C4           uint32 `binapi:"u32,name=c4" json:"c4,omitempty"`
257         TlvLength    uint8  `binapi:"u8,name=tlv_length" json:"tlv_length,omitempty"`
258         Tlv          []byte `binapi:"u8[248],name=tlv" json:"tlv,omitempty"`
259 }
260
261 func (m *NshEntryDetails) Reset()               { *m = NshEntryDetails{} }
262 func (*NshEntryDetails) GetMessageName() string { return "nsh_entry_details" }
263 func (*NshEntryDetails) GetCrcString() string   { return "046fb556" }
264 func (*NshEntryDetails) GetMessageType() api.MessageType {
265         return api.ReplyMessage
266 }
267
268 func (m *NshEntryDetails) Size() (size int) {
269         if m == nil {
270                 return 0
271         }
272         size += 4       // m.EntryIndex
273         size += 4       // m.NspNsi
274         size += 1       // m.MdType
275         size += 1       // m.VerOC
276         size += 1       // m.TTL
277         size += 1       // m.Length
278         size += 1       // m.NextProtocol
279         size += 4       // m.C1
280         size += 4       // m.C2
281         size += 4       // m.C3
282         size += 4       // m.C4
283         size += 1       // m.TlvLength
284         size += 1 * 248 // m.Tlv
285         return size
286 }
287 func (m *NshEntryDetails) Marshal(b []byte) ([]byte, error) {
288         if b == nil {
289                 b = make([]byte, m.Size())
290         }
291         buf := codec.NewBuffer(b)
292         buf.EncodeUint32(m.EntryIndex)
293         buf.EncodeUint32(m.NspNsi)
294         buf.EncodeUint8(m.MdType)
295         buf.EncodeUint8(m.VerOC)
296         buf.EncodeUint8(m.TTL)
297         buf.EncodeUint8(m.Length)
298         buf.EncodeUint8(m.NextProtocol)
299         buf.EncodeUint32(m.C1)
300         buf.EncodeUint32(m.C2)
301         buf.EncodeUint32(m.C3)
302         buf.EncodeUint32(m.C4)
303         buf.EncodeUint8(m.TlvLength)
304         buf.EncodeBytes(m.Tlv, 248)
305         return buf.Bytes(), nil
306 }
307 func (m *NshEntryDetails) Unmarshal(b []byte) error {
308         buf := codec.NewBuffer(b)
309         m.EntryIndex = buf.DecodeUint32()
310         m.NspNsi = buf.DecodeUint32()
311         m.MdType = buf.DecodeUint8()
312         m.VerOC = buf.DecodeUint8()
313         m.TTL = buf.DecodeUint8()
314         m.Length = buf.DecodeUint8()
315         m.NextProtocol = buf.DecodeUint8()
316         m.C1 = buf.DecodeUint32()
317         m.C2 = buf.DecodeUint32()
318         m.C3 = buf.DecodeUint32()
319         m.C4 = buf.DecodeUint32()
320         m.TlvLength = buf.DecodeUint8()
321         m.Tlv = make([]byte, 248)
322         copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
323         return nil
324 }
325
326 // NshEntryDump defines message 'nsh_entry_dump'.
327 type NshEntryDump struct {
328         EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
329 }
330
331 func (m *NshEntryDump) Reset()               { *m = NshEntryDump{} }
332 func (*NshEntryDump) GetMessageName() string { return "nsh_entry_dump" }
333 func (*NshEntryDump) GetCrcString() string   { return "cdaf8ccb" }
334 func (*NshEntryDump) GetMessageType() api.MessageType {
335         return api.RequestMessage
336 }
337
338 func (m *NshEntryDump) Size() (size int) {
339         if m == nil {
340                 return 0
341         }
342         size += 4 // m.EntryIndex
343         return size
344 }
345 func (m *NshEntryDump) Marshal(b []byte) ([]byte, error) {
346         if b == nil {
347                 b = make([]byte, m.Size())
348         }
349         buf := codec.NewBuffer(b)
350         buf.EncodeUint32(m.EntryIndex)
351         return buf.Bytes(), nil
352 }
353 func (m *NshEntryDump) Unmarshal(b []byte) error {
354         buf := codec.NewBuffer(b)
355         m.EntryIndex = buf.DecodeUint32()
356         return nil
357 }
358
359 // NshMapDetails defines message 'nsh_map_details'.
360 type NshMapDetails struct {
361         MapIndex     uint32                         `binapi:"u32,name=map_index" json:"map_index,omitempty"`
362         NspNsi       uint32                         `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
363         MappedNspNsi uint32                         `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
364         NshAction    uint32                         `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
365         SwIfIndex    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
366         RxSwIfIndex  interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
367         NextNode     uint32                         `binapi:"u32,name=next_node" json:"next_node,omitempty"`
368 }
369
370 func (m *NshMapDetails) Reset()               { *m = NshMapDetails{} }
371 func (*NshMapDetails) GetMessageName() string { return "nsh_map_details" }
372 func (*NshMapDetails) GetCrcString() string   { return "b34ac8a1" }
373 func (*NshMapDetails) GetMessageType() api.MessageType {
374         return api.ReplyMessage
375 }
376
377 func (m *NshMapDetails) Size() (size int) {
378         if m == nil {
379                 return 0
380         }
381         size += 4 // m.MapIndex
382         size += 4 // m.NspNsi
383         size += 4 // m.MappedNspNsi
384         size += 4 // m.NshAction
385         size += 4 // m.SwIfIndex
386         size += 4 // m.RxSwIfIndex
387         size += 4 // m.NextNode
388         return size
389 }
390 func (m *NshMapDetails) Marshal(b []byte) ([]byte, error) {
391         if b == nil {
392                 b = make([]byte, m.Size())
393         }
394         buf := codec.NewBuffer(b)
395         buf.EncodeUint32(m.MapIndex)
396         buf.EncodeUint32(m.NspNsi)
397         buf.EncodeUint32(m.MappedNspNsi)
398         buf.EncodeUint32(m.NshAction)
399         buf.EncodeUint32(uint32(m.SwIfIndex))
400         buf.EncodeUint32(uint32(m.RxSwIfIndex))
401         buf.EncodeUint32(m.NextNode)
402         return buf.Bytes(), nil
403 }
404 func (m *NshMapDetails) Unmarshal(b []byte) error {
405         buf := codec.NewBuffer(b)
406         m.MapIndex = buf.DecodeUint32()
407         m.NspNsi = buf.DecodeUint32()
408         m.MappedNspNsi = buf.DecodeUint32()
409         m.NshAction = buf.DecodeUint32()
410         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
411         m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
412         m.NextNode = buf.DecodeUint32()
413         return nil
414 }
415
416 // NshMapDump defines message 'nsh_map_dump'.
417 type NshMapDump struct {
418         MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
419 }
420
421 func (m *NshMapDump) Reset()               { *m = NshMapDump{} }
422 func (*NshMapDump) GetMessageName() string { return "nsh_map_dump" }
423 func (*NshMapDump) GetCrcString() string   { return "8fc06b82" }
424 func (*NshMapDump) GetMessageType() api.MessageType {
425         return api.RequestMessage
426 }
427
428 func (m *NshMapDump) Size() (size int) {
429         if m == nil {
430                 return 0
431         }
432         size += 4 // m.MapIndex
433         return size
434 }
435 func (m *NshMapDump) Marshal(b []byte) ([]byte, error) {
436         if b == nil {
437                 b = make([]byte, m.Size())
438         }
439         buf := codec.NewBuffer(b)
440         buf.EncodeUint32(m.MapIndex)
441         return buf.Bytes(), nil
442 }
443 func (m *NshMapDump) Unmarshal(b []byte) error {
444         buf := codec.NewBuffer(b)
445         m.MapIndex = buf.DecodeUint32()
446         return nil
447 }
448
449 func init() { file_nsh_binapi_init() }
450 func file_nsh_binapi_init() {
451         api.RegisterMessage((*NshAddDelEntry)(nil), "nsh_add_del_entry_7dea480b")
452         api.RegisterMessage((*NshAddDelEntryReply)(nil), "nsh_add_del_entry_reply_6296a9eb")
453         api.RegisterMessage((*NshAddDelMap)(nil), "nsh_add_del_map_898d857d")
454         api.RegisterMessage((*NshAddDelMapReply)(nil), "nsh_add_del_map_reply_b2b127ef")
455         api.RegisterMessage((*NshEntryDetails)(nil), "nsh_entry_details_046fb556")
456         api.RegisterMessage((*NshEntryDump)(nil), "nsh_entry_dump_cdaf8ccb")
457         api.RegisterMessage((*NshMapDetails)(nil), "nsh_map_details_b34ac8a1")
458         api.RegisterMessage((*NshMapDump)(nil), "nsh_map_dump_8fc06b82")
459 }
460
461 // Messages returns list of all messages in this module.
462 func AllMessages() []api.Message {
463         return []api.Message{
464                 (*NshAddDelEntry)(nil),
465                 (*NshAddDelEntryReply)(nil),
466                 (*NshAddDelMap)(nil),
467                 (*NshAddDelMapReply)(nil),
468                 (*NshEntryDetails)(nil),
469                 (*NshEntryDump)(nil),
470                 (*NshMapDetails)(nil),
471                 (*NshMapDump)(nil),
472         }
473 }