1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/plugins/nsh.api.json
7 // Package nsh contains generated bindings for API file nsh.api.
15 api "git.fd.io/govpp.git/api"
16 interface_types "git.fd.io/govpp.git/binapi/interface_types"
17 codec "git.fd.io/govpp.git/codec"
20 // This is a compile-time assertion to ensure that this generated file
21 // is compatible with the GoVPP api package it is being compiled against.
22 // A compilation error at this line likely means your copy of the
23 // GoVPP api package needs to be updated.
24 const _ = api.GoVppAPIPackageIsVersion2
29 VersionCrc = 0x43be6707
32 // NshAddDelEntry defines message 'nsh_add_del_entry'.
33 type NshAddDelEntry struct {
34 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
35 NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
36 MdType uint8 `binapi:"u8,name=md_type" json:"md_type,omitempty"`
37 VerOC uint8 `binapi:"u8,name=ver_o_c" json:"ver_o_c,omitempty"`
38 TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
39 Length uint8 `binapi:"u8,name=length" json:"length,omitempty"`
40 NextProtocol uint8 `binapi:"u8,name=next_protocol" json:"next_protocol,omitempty"`
41 C1 uint32 `binapi:"u32,name=c1" json:"c1,omitempty"`
42 C2 uint32 `binapi:"u32,name=c2" json:"c2,omitempty"`
43 C3 uint32 `binapi:"u32,name=c3" json:"c3,omitempty"`
44 C4 uint32 `binapi:"u32,name=c4" json:"c4,omitempty"`
45 TlvLength uint8 `binapi:"u8,name=tlv_length" json:"tlv_length,omitempty"`
46 Tlv []byte `binapi:"u8[248],name=tlv" json:"tlv,omitempty"`
49 func (m *NshAddDelEntry) Reset() { *m = NshAddDelEntry{} }
50 func (*NshAddDelEntry) GetMessageName() string { return "nsh_add_del_entry" }
51 func (*NshAddDelEntry) GetCrcString() string { return "7dea480b" }
52 func (*NshAddDelEntry) GetMessageType() api.MessageType {
53 return api.RequestMessage
56 func (m *NshAddDelEntry) Size() int {
67 size += 1 // m.NextProtocol
72 size += 1 // m.TlvLength
73 size += 1 * 248 // m.Tlv
76 func (m *NshAddDelEntry) Marshal(b []byte) ([]byte, error) {
79 buf = codec.NewBuffer(make([]byte, m.Size()))
81 buf = codec.NewBuffer(b)
83 buf.EncodeBool(m.IsAdd)
84 buf.EncodeUint32(uint32(m.NspNsi))
85 buf.EncodeUint8(uint8(m.MdType))
86 buf.EncodeUint8(uint8(m.VerOC))
87 buf.EncodeUint8(uint8(m.TTL))
88 buf.EncodeUint8(uint8(m.Length))
89 buf.EncodeUint8(uint8(m.NextProtocol))
90 buf.EncodeUint32(uint32(m.C1))
91 buf.EncodeUint32(uint32(m.C2))
92 buf.EncodeUint32(uint32(m.C3))
93 buf.EncodeUint32(uint32(m.C4))
94 buf.EncodeUint8(uint8(m.TlvLength))
95 buf.EncodeBytes(m.Tlv[:], 248)
96 return buf.Bytes(), nil
98 func (m *NshAddDelEntry) Unmarshal(b []byte) error {
99 buf := codec.NewBuffer(b)
100 m.IsAdd = buf.DecodeBool()
101 m.NspNsi = buf.DecodeUint32()
102 m.MdType = buf.DecodeUint8()
103 m.VerOC = buf.DecodeUint8()
104 m.TTL = buf.DecodeUint8()
105 m.Length = buf.DecodeUint8()
106 m.NextProtocol = buf.DecodeUint8()
107 m.C1 = buf.DecodeUint32()
108 m.C2 = buf.DecodeUint32()
109 m.C3 = buf.DecodeUint32()
110 m.C4 = buf.DecodeUint32()
111 m.TlvLength = buf.DecodeUint8()
112 copy(m.Tlv[:], buf.DecodeBytes(248))
116 // NshAddDelEntryReply defines message 'nsh_add_del_entry_reply'.
117 type NshAddDelEntryReply struct {
118 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
119 EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
122 func (m *NshAddDelEntryReply) Reset() { *m = NshAddDelEntryReply{} }
123 func (*NshAddDelEntryReply) GetMessageName() string { return "nsh_add_del_entry_reply" }
124 func (*NshAddDelEntryReply) GetCrcString() string { return "6296a9eb" }
125 func (*NshAddDelEntryReply) GetMessageType() api.MessageType {
126 return api.ReplyMessage
129 func (m *NshAddDelEntryReply) Size() int {
134 size += 4 // m.Retval
135 size += 4 // m.EntryIndex
138 func (m *NshAddDelEntryReply) Marshal(b []byte) ([]byte, error) {
139 var buf *codec.Buffer
141 buf = codec.NewBuffer(make([]byte, m.Size()))
143 buf = codec.NewBuffer(b)
145 buf.EncodeUint32(uint32(m.Retval))
146 buf.EncodeUint32(uint32(m.EntryIndex))
147 return buf.Bytes(), nil
149 func (m *NshAddDelEntryReply) Unmarshal(b []byte) error {
150 buf := codec.NewBuffer(b)
151 m.Retval = int32(buf.DecodeUint32())
152 m.EntryIndex = buf.DecodeUint32()
156 // NshAddDelMap defines message 'nsh_add_del_map'.
157 type NshAddDelMap struct {
158 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
159 NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
160 MappedNspNsi uint32 `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
161 NshAction uint32 `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
162 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
163 RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
164 NextNode uint32 `binapi:"u32,name=next_node" json:"next_node,omitempty"`
167 func (m *NshAddDelMap) Reset() { *m = NshAddDelMap{} }
168 func (*NshAddDelMap) GetMessageName() string { return "nsh_add_del_map" }
169 func (*NshAddDelMap) GetCrcString() string { return "898d857d" }
170 func (*NshAddDelMap) GetMessageType() api.MessageType {
171 return api.RequestMessage
174 func (m *NshAddDelMap) Size() int {
180 size += 4 // m.NspNsi
181 size += 4 // m.MappedNspNsi
182 size += 4 // m.NshAction
183 size += 4 // m.SwIfIndex
184 size += 4 // m.RxSwIfIndex
185 size += 4 // m.NextNode
188 func (m *NshAddDelMap) Marshal(b []byte) ([]byte, error) {
189 var buf *codec.Buffer
191 buf = codec.NewBuffer(make([]byte, m.Size()))
193 buf = codec.NewBuffer(b)
195 buf.EncodeBool(m.IsAdd)
196 buf.EncodeUint32(uint32(m.NspNsi))
197 buf.EncodeUint32(uint32(m.MappedNspNsi))
198 buf.EncodeUint32(uint32(m.NshAction))
199 buf.EncodeUint32(uint32(m.SwIfIndex))
200 buf.EncodeUint32(uint32(m.RxSwIfIndex))
201 buf.EncodeUint32(uint32(m.NextNode))
202 return buf.Bytes(), nil
204 func (m *NshAddDelMap) Unmarshal(b []byte) error {
205 buf := codec.NewBuffer(b)
206 m.IsAdd = buf.DecodeBool()
207 m.NspNsi = buf.DecodeUint32()
208 m.MappedNspNsi = buf.DecodeUint32()
209 m.NshAction = buf.DecodeUint32()
210 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
211 m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
212 m.NextNode = buf.DecodeUint32()
216 // NshAddDelMapReply defines message 'nsh_add_del_map_reply'.
217 type NshAddDelMapReply struct {
218 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
219 MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
222 func (m *NshAddDelMapReply) Reset() { *m = NshAddDelMapReply{} }
223 func (*NshAddDelMapReply) GetMessageName() string { return "nsh_add_del_map_reply" }
224 func (*NshAddDelMapReply) GetCrcString() string { return "b2b127ef" }
225 func (*NshAddDelMapReply) GetMessageType() api.MessageType {
226 return api.ReplyMessage
229 func (m *NshAddDelMapReply) Size() int {
234 size += 4 // m.Retval
235 size += 4 // m.MapIndex
238 func (m *NshAddDelMapReply) Marshal(b []byte) ([]byte, error) {
239 var buf *codec.Buffer
241 buf = codec.NewBuffer(make([]byte, m.Size()))
243 buf = codec.NewBuffer(b)
245 buf.EncodeUint32(uint32(m.Retval))
246 buf.EncodeUint32(uint32(m.MapIndex))
247 return buf.Bytes(), nil
249 func (m *NshAddDelMapReply) Unmarshal(b []byte) error {
250 buf := codec.NewBuffer(b)
251 m.Retval = int32(buf.DecodeUint32())
252 m.MapIndex = buf.DecodeUint32()
256 // NshEntryDetails defines message 'nsh_entry_details'.
257 type NshEntryDetails struct {
258 EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
259 NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
260 MdType uint8 `binapi:"u8,name=md_type" json:"md_type,omitempty"`
261 VerOC uint8 `binapi:"u8,name=ver_o_c" json:"ver_o_c,omitempty"`
262 TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
263 Length uint8 `binapi:"u8,name=length" json:"length,omitempty"`
264 NextProtocol uint8 `binapi:"u8,name=next_protocol" json:"next_protocol,omitempty"`
265 C1 uint32 `binapi:"u32,name=c1" json:"c1,omitempty"`
266 C2 uint32 `binapi:"u32,name=c2" json:"c2,omitempty"`
267 C3 uint32 `binapi:"u32,name=c3" json:"c3,omitempty"`
268 C4 uint32 `binapi:"u32,name=c4" json:"c4,omitempty"`
269 TlvLength uint8 `binapi:"u8,name=tlv_length" json:"tlv_length,omitempty"`
270 Tlv []byte `binapi:"u8[248],name=tlv" json:"tlv,omitempty"`
273 func (m *NshEntryDetails) Reset() { *m = NshEntryDetails{} }
274 func (*NshEntryDetails) GetMessageName() string { return "nsh_entry_details" }
275 func (*NshEntryDetails) GetCrcString() string { return "046fb556" }
276 func (*NshEntryDetails) GetMessageType() api.MessageType {
277 return api.ReplyMessage
280 func (m *NshEntryDetails) Size() int {
285 size += 4 // m.EntryIndex
286 size += 4 // m.NspNsi
287 size += 1 // m.MdType
290 size += 1 // m.Length
291 size += 1 // m.NextProtocol
296 size += 1 // m.TlvLength
297 size += 1 * 248 // m.Tlv
300 func (m *NshEntryDetails) Marshal(b []byte) ([]byte, error) {
301 var buf *codec.Buffer
303 buf = codec.NewBuffer(make([]byte, m.Size()))
305 buf = codec.NewBuffer(b)
307 buf.EncodeUint32(uint32(m.EntryIndex))
308 buf.EncodeUint32(uint32(m.NspNsi))
309 buf.EncodeUint8(uint8(m.MdType))
310 buf.EncodeUint8(uint8(m.VerOC))
311 buf.EncodeUint8(uint8(m.TTL))
312 buf.EncodeUint8(uint8(m.Length))
313 buf.EncodeUint8(uint8(m.NextProtocol))
314 buf.EncodeUint32(uint32(m.C1))
315 buf.EncodeUint32(uint32(m.C2))
316 buf.EncodeUint32(uint32(m.C3))
317 buf.EncodeUint32(uint32(m.C4))
318 buf.EncodeUint8(uint8(m.TlvLength))
319 buf.EncodeBytes(m.Tlv[:], 248)
320 return buf.Bytes(), nil
322 func (m *NshEntryDetails) Unmarshal(b []byte) error {
323 buf := codec.NewBuffer(b)
324 m.EntryIndex = buf.DecodeUint32()
325 m.NspNsi = buf.DecodeUint32()
326 m.MdType = buf.DecodeUint8()
327 m.VerOC = buf.DecodeUint8()
328 m.TTL = buf.DecodeUint8()
329 m.Length = buf.DecodeUint8()
330 m.NextProtocol = buf.DecodeUint8()
331 m.C1 = buf.DecodeUint32()
332 m.C2 = buf.DecodeUint32()
333 m.C3 = buf.DecodeUint32()
334 m.C4 = buf.DecodeUint32()
335 m.TlvLength = buf.DecodeUint8()
336 copy(m.Tlv[:], buf.DecodeBytes(248))
340 // NshEntryDump defines message 'nsh_entry_dump'.
341 type NshEntryDump struct {
342 EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
345 func (m *NshEntryDump) Reset() { *m = NshEntryDump{} }
346 func (*NshEntryDump) GetMessageName() string { return "nsh_entry_dump" }
347 func (*NshEntryDump) GetCrcString() string { return "cdaf8ccb" }
348 func (*NshEntryDump) GetMessageType() api.MessageType {
349 return api.RequestMessage
352 func (m *NshEntryDump) Size() int {
357 size += 4 // m.EntryIndex
360 func (m *NshEntryDump) Marshal(b []byte) ([]byte, error) {
361 var buf *codec.Buffer
363 buf = codec.NewBuffer(make([]byte, m.Size()))
365 buf = codec.NewBuffer(b)
367 buf.EncodeUint32(uint32(m.EntryIndex))
368 return buf.Bytes(), nil
370 func (m *NshEntryDump) Unmarshal(b []byte) error {
371 buf := codec.NewBuffer(b)
372 m.EntryIndex = buf.DecodeUint32()
376 // NshMapDetails defines message 'nsh_map_details'.
377 type NshMapDetails struct {
378 MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
379 NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
380 MappedNspNsi uint32 `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
381 NshAction uint32 `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
382 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
383 RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
384 NextNode uint32 `binapi:"u32,name=next_node" json:"next_node,omitempty"`
387 func (m *NshMapDetails) Reset() { *m = NshMapDetails{} }
388 func (*NshMapDetails) GetMessageName() string { return "nsh_map_details" }
389 func (*NshMapDetails) GetCrcString() string { return "b34ac8a1" }
390 func (*NshMapDetails) GetMessageType() api.MessageType {
391 return api.ReplyMessage
394 func (m *NshMapDetails) Size() int {
399 size += 4 // m.MapIndex
400 size += 4 // m.NspNsi
401 size += 4 // m.MappedNspNsi
402 size += 4 // m.NshAction
403 size += 4 // m.SwIfIndex
404 size += 4 // m.RxSwIfIndex
405 size += 4 // m.NextNode
408 func (m *NshMapDetails) Marshal(b []byte) ([]byte, error) {
409 var buf *codec.Buffer
411 buf = codec.NewBuffer(make([]byte, m.Size()))
413 buf = codec.NewBuffer(b)
415 buf.EncodeUint32(uint32(m.MapIndex))
416 buf.EncodeUint32(uint32(m.NspNsi))
417 buf.EncodeUint32(uint32(m.MappedNspNsi))
418 buf.EncodeUint32(uint32(m.NshAction))
419 buf.EncodeUint32(uint32(m.SwIfIndex))
420 buf.EncodeUint32(uint32(m.RxSwIfIndex))
421 buf.EncodeUint32(uint32(m.NextNode))
422 return buf.Bytes(), nil
424 func (m *NshMapDetails) Unmarshal(b []byte) error {
425 buf := codec.NewBuffer(b)
426 m.MapIndex = buf.DecodeUint32()
427 m.NspNsi = buf.DecodeUint32()
428 m.MappedNspNsi = buf.DecodeUint32()
429 m.NshAction = buf.DecodeUint32()
430 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
431 m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
432 m.NextNode = buf.DecodeUint32()
436 // NshMapDump defines message 'nsh_map_dump'.
437 type NshMapDump struct {
438 MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
441 func (m *NshMapDump) Reset() { *m = NshMapDump{} }
442 func (*NshMapDump) GetMessageName() string { return "nsh_map_dump" }
443 func (*NshMapDump) GetCrcString() string { return "8fc06b82" }
444 func (*NshMapDump) GetMessageType() api.MessageType {
445 return api.RequestMessage
448 func (m *NshMapDump) Size() int {
453 size += 4 // m.MapIndex
456 func (m *NshMapDump) Marshal(b []byte) ([]byte, error) {
457 var buf *codec.Buffer
459 buf = codec.NewBuffer(make([]byte, m.Size()))
461 buf = codec.NewBuffer(b)
463 buf.EncodeUint32(uint32(m.MapIndex))
464 return buf.Bytes(), nil
466 func (m *NshMapDump) Unmarshal(b []byte) error {
467 buf := codec.NewBuffer(b)
468 m.MapIndex = buf.DecodeUint32()
472 func init() { file_nsh_binapi_init() }
473 func file_nsh_binapi_init() {
474 api.RegisterMessage((*NshAddDelEntry)(nil), "nsh_add_del_entry_7dea480b")
475 api.RegisterMessage((*NshAddDelEntryReply)(nil), "nsh_add_del_entry_reply_6296a9eb")
476 api.RegisterMessage((*NshAddDelMap)(nil), "nsh_add_del_map_898d857d")
477 api.RegisterMessage((*NshAddDelMapReply)(nil), "nsh_add_del_map_reply_b2b127ef")
478 api.RegisterMessage((*NshEntryDetails)(nil), "nsh_entry_details_046fb556")
479 api.RegisterMessage((*NshEntryDump)(nil), "nsh_entry_dump_cdaf8ccb")
480 api.RegisterMessage((*NshMapDetails)(nil), "nsh_map_details_b34ac8a1")
481 api.RegisterMessage((*NshMapDump)(nil), "nsh_map_dump_8fc06b82")
484 // Messages returns list of all messages in this module.
485 func AllMessages() []api.Message {
486 return []api.Message{
487 (*NshAddDelEntry)(nil),
488 (*NshAddDelEntryReply)(nil),
489 (*NshAddDelMap)(nil),
490 (*NshAddDelMapReply)(nil),
491 (*NshEntryDetails)(nil),
492 (*NshEntryDump)(nil),
493 (*NshMapDetails)(nil),