1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
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 = 0xc2f3127d
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() (size int) {
66 size += 1 // m.NextProtocol
71 size += 1 // m.TlvLength
72 size += 1 * 248 // m.Tlv
75 func (m *NshAddDelEntry) Marshal(b []byte) ([]byte, error) {
77 b = make([]byte, m.Size())
79 buf := codec.NewBuffer(b)
80 buf.EncodeBool(m.IsAdd)
81 buf.EncodeUint32(m.NspNsi)
82 buf.EncodeUint8(m.MdType)
83 buf.EncodeUint8(m.VerOC)
84 buf.EncodeUint8(m.TTL)
85 buf.EncodeUint8(m.Length)
86 buf.EncodeUint8(m.NextProtocol)
87 buf.EncodeUint32(m.C1)
88 buf.EncodeUint32(m.C2)
89 buf.EncodeUint32(m.C3)
90 buf.EncodeUint32(m.C4)
91 buf.EncodeUint8(m.TlvLength)
92 buf.EncodeBytes(m.Tlv, 248)
93 return buf.Bytes(), nil
95 func (m *NshAddDelEntry) Unmarshal(b []byte) error {
96 buf := codec.NewBuffer(b)
97 m.IsAdd = buf.DecodeBool()
98 m.NspNsi = buf.DecodeUint32()
99 m.MdType = buf.DecodeUint8()
100 m.VerOC = buf.DecodeUint8()
101 m.TTL = buf.DecodeUint8()
102 m.Length = buf.DecodeUint8()
103 m.NextProtocol = buf.DecodeUint8()
104 m.C1 = buf.DecodeUint32()
105 m.C2 = buf.DecodeUint32()
106 m.C3 = buf.DecodeUint32()
107 m.C4 = buf.DecodeUint32()
108 m.TlvLength = buf.DecodeUint8()
109 m.Tlv = make([]byte, 248)
110 copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
114 // NshAddDelEntryReply defines message 'nsh_add_del_entry_reply'.
115 type NshAddDelEntryReply struct {
116 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
117 EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
120 func (m *NshAddDelEntryReply) Reset() { *m = NshAddDelEntryReply{} }
121 func (*NshAddDelEntryReply) GetMessageName() string { return "nsh_add_del_entry_reply" }
122 func (*NshAddDelEntryReply) GetCrcString() string { return "6296a9eb" }
123 func (*NshAddDelEntryReply) GetMessageType() api.MessageType {
124 return api.ReplyMessage
127 func (m *NshAddDelEntryReply) Size() (size int) {
131 size += 4 // m.Retval
132 size += 4 // m.EntryIndex
135 func (m *NshAddDelEntryReply) Marshal(b []byte) ([]byte, error) {
137 b = make([]byte, m.Size())
139 buf := codec.NewBuffer(b)
140 buf.EncodeInt32(m.Retval)
141 buf.EncodeUint32(m.EntryIndex)
142 return buf.Bytes(), nil
144 func (m *NshAddDelEntryReply) Unmarshal(b []byte) error {
145 buf := codec.NewBuffer(b)
146 m.Retval = buf.DecodeInt32()
147 m.EntryIndex = buf.DecodeUint32()
151 // NshAddDelMap defines message 'nsh_add_del_map'.
152 type NshAddDelMap struct {
153 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
154 NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
155 MappedNspNsi uint32 `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
156 NshAction uint32 `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
157 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
158 RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
159 NextNode uint32 `binapi:"u32,name=next_node" json:"next_node,omitempty"`
162 func (m *NshAddDelMap) Reset() { *m = NshAddDelMap{} }
163 func (*NshAddDelMap) GetMessageName() string { return "nsh_add_del_map" }
164 func (*NshAddDelMap) GetCrcString() string { return "0a0f42b0" }
165 func (*NshAddDelMap) GetMessageType() api.MessageType {
166 return api.RequestMessage
169 func (m *NshAddDelMap) Size() (size int) {
174 size += 4 // m.NspNsi
175 size += 4 // m.MappedNspNsi
176 size += 4 // m.NshAction
177 size += 4 // m.SwIfIndex
178 size += 4 // m.RxSwIfIndex
179 size += 4 // m.NextNode
182 func (m *NshAddDelMap) Marshal(b []byte) ([]byte, error) {
184 b = make([]byte, m.Size())
186 buf := codec.NewBuffer(b)
187 buf.EncodeBool(m.IsAdd)
188 buf.EncodeUint32(m.NspNsi)
189 buf.EncodeUint32(m.MappedNspNsi)
190 buf.EncodeUint32(m.NshAction)
191 buf.EncodeUint32(uint32(m.SwIfIndex))
192 buf.EncodeUint32(uint32(m.RxSwIfIndex))
193 buf.EncodeUint32(m.NextNode)
194 return buf.Bytes(), nil
196 func (m *NshAddDelMap) Unmarshal(b []byte) error {
197 buf := codec.NewBuffer(b)
198 m.IsAdd = buf.DecodeBool()
199 m.NspNsi = buf.DecodeUint32()
200 m.MappedNspNsi = buf.DecodeUint32()
201 m.NshAction = buf.DecodeUint32()
202 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
203 m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
204 m.NextNode = buf.DecodeUint32()
208 // NshAddDelMapReply defines message 'nsh_add_del_map_reply'.
209 type NshAddDelMapReply struct {
210 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
211 MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
214 func (m *NshAddDelMapReply) Reset() { *m = NshAddDelMapReply{} }
215 func (*NshAddDelMapReply) GetMessageName() string { return "nsh_add_del_map_reply" }
216 func (*NshAddDelMapReply) GetCrcString() string { return "b2b127ef" }
217 func (*NshAddDelMapReply) GetMessageType() api.MessageType {
218 return api.ReplyMessage
221 func (m *NshAddDelMapReply) Size() (size int) {
225 size += 4 // m.Retval
226 size += 4 // m.MapIndex
229 func (m *NshAddDelMapReply) Marshal(b []byte) ([]byte, error) {
231 b = make([]byte, m.Size())
233 buf := codec.NewBuffer(b)
234 buf.EncodeInt32(m.Retval)
235 buf.EncodeUint32(m.MapIndex)
236 return buf.Bytes(), nil
238 func (m *NshAddDelMapReply) Unmarshal(b []byte) error {
239 buf := codec.NewBuffer(b)
240 m.Retval = buf.DecodeInt32()
241 m.MapIndex = buf.DecodeUint32()
245 // NshEntryDetails defines message 'nsh_entry_details'.
246 type NshEntryDetails struct {
247 EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
248 NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
249 MdType uint8 `binapi:"u8,name=md_type" json:"md_type,omitempty"`
250 VerOC uint8 `binapi:"u8,name=ver_o_c" json:"ver_o_c,omitempty"`
251 TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
252 Length uint8 `binapi:"u8,name=length" json:"length,omitempty"`
253 NextProtocol uint8 `binapi:"u8,name=next_protocol" json:"next_protocol,omitempty"`
254 C1 uint32 `binapi:"u32,name=c1" json:"c1,omitempty"`
255 C2 uint32 `binapi:"u32,name=c2" json:"c2,omitempty"`
256 C3 uint32 `binapi:"u32,name=c3" json:"c3,omitempty"`
257 C4 uint32 `binapi:"u32,name=c4" json:"c4,omitempty"`
258 TlvLength uint8 `binapi:"u8,name=tlv_length" json:"tlv_length,omitempty"`
259 Tlv []byte `binapi:"u8[248],name=tlv" json:"tlv,omitempty"`
262 func (m *NshEntryDetails) Reset() { *m = NshEntryDetails{} }
263 func (*NshEntryDetails) GetMessageName() string { return "nsh_entry_details" }
264 func (*NshEntryDetails) GetCrcString() string { return "046fb556" }
265 func (*NshEntryDetails) GetMessageType() api.MessageType {
266 return api.ReplyMessage
269 func (m *NshEntryDetails) Size() (size int) {
273 size += 4 // m.EntryIndex
274 size += 4 // m.NspNsi
275 size += 1 // m.MdType
278 size += 1 // m.Length
279 size += 1 // m.NextProtocol
284 size += 1 // m.TlvLength
285 size += 1 * 248 // m.Tlv
288 func (m *NshEntryDetails) Marshal(b []byte) ([]byte, error) {
290 b = make([]byte, m.Size())
292 buf := codec.NewBuffer(b)
293 buf.EncodeUint32(m.EntryIndex)
294 buf.EncodeUint32(m.NspNsi)
295 buf.EncodeUint8(m.MdType)
296 buf.EncodeUint8(m.VerOC)
297 buf.EncodeUint8(m.TTL)
298 buf.EncodeUint8(m.Length)
299 buf.EncodeUint8(m.NextProtocol)
300 buf.EncodeUint32(m.C1)
301 buf.EncodeUint32(m.C2)
302 buf.EncodeUint32(m.C3)
303 buf.EncodeUint32(m.C4)
304 buf.EncodeUint8(m.TlvLength)
305 buf.EncodeBytes(m.Tlv, 248)
306 return buf.Bytes(), nil
308 func (m *NshEntryDetails) Unmarshal(b []byte) error {
309 buf := codec.NewBuffer(b)
310 m.EntryIndex = buf.DecodeUint32()
311 m.NspNsi = buf.DecodeUint32()
312 m.MdType = buf.DecodeUint8()
313 m.VerOC = buf.DecodeUint8()
314 m.TTL = buf.DecodeUint8()
315 m.Length = buf.DecodeUint8()
316 m.NextProtocol = buf.DecodeUint8()
317 m.C1 = buf.DecodeUint32()
318 m.C2 = buf.DecodeUint32()
319 m.C3 = buf.DecodeUint32()
320 m.C4 = buf.DecodeUint32()
321 m.TlvLength = buf.DecodeUint8()
322 m.Tlv = make([]byte, 248)
323 copy(m.Tlv, buf.DecodeBytes(len(m.Tlv)))
327 // NshEntryDump defines message 'nsh_entry_dump'.
328 type NshEntryDump struct {
329 EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
332 func (m *NshEntryDump) Reset() { *m = NshEntryDump{} }
333 func (*NshEntryDump) GetMessageName() string { return "nsh_entry_dump" }
334 func (*NshEntryDump) GetCrcString() string { return "cdaf8ccb" }
335 func (*NshEntryDump) GetMessageType() api.MessageType {
336 return api.RequestMessage
339 func (m *NshEntryDump) Size() (size int) {
343 size += 4 // m.EntryIndex
346 func (m *NshEntryDump) Marshal(b []byte) ([]byte, error) {
348 b = make([]byte, m.Size())
350 buf := codec.NewBuffer(b)
351 buf.EncodeUint32(m.EntryIndex)
352 return buf.Bytes(), nil
354 func (m *NshEntryDump) Unmarshal(b []byte) error {
355 buf := codec.NewBuffer(b)
356 m.EntryIndex = buf.DecodeUint32()
360 // NshMapDetails defines message 'nsh_map_details'.
361 type NshMapDetails struct {
362 MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
363 NspNsi uint32 `binapi:"u32,name=nsp_nsi" json:"nsp_nsi,omitempty"`
364 MappedNspNsi uint32 `binapi:"u32,name=mapped_nsp_nsi" json:"mapped_nsp_nsi,omitempty"`
365 NshAction uint32 `binapi:"u32,name=nsh_action" json:"nsh_action,omitempty"`
366 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
367 RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
368 NextNode uint32 `binapi:"u32,name=next_node" json:"next_node,omitempty"`
371 func (m *NshMapDetails) Reset() { *m = NshMapDetails{} }
372 func (*NshMapDetails) GetMessageName() string { return "nsh_map_details" }
373 func (*NshMapDetails) GetCrcString() string { return "2fefcf49" }
374 func (*NshMapDetails) GetMessageType() api.MessageType {
375 return api.ReplyMessage
378 func (m *NshMapDetails) Size() (size int) {
382 size += 4 // m.MapIndex
383 size += 4 // m.NspNsi
384 size += 4 // m.MappedNspNsi
385 size += 4 // m.NshAction
386 size += 4 // m.SwIfIndex
387 size += 4 // m.RxSwIfIndex
388 size += 4 // m.NextNode
391 func (m *NshMapDetails) Marshal(b []byte) ([]byte, error) {
393 b = make([]byte, m.Size())
395 buf := codec.NewBuffer(b)
396 buf.EncodeUint32(m.MapIndex)
397 buf.EncodeUint32(m.NspNsi)
398 buf.EncodeUint32(m.MappedNspNsi)
399 buf.EncodeUint32(m.NshAction)
400 buf.EncodeUint32(uint32(m.SwIfIndex))
401 buf.EncodeUint32(uint32(m.RxSwIfIndex))
402 buf.EncodeUint32(m.NextNode)
403 return buf.Bytes(), nil
405 func (m *NshMapDetails) Unmarshal(b []byte) error {
406 buf := codec.NewBuffer(b)
407 m.MapIndex = buf.DecodeUint32()
408 m.NspNsi = buf.DecodeUint32()
409 m.MappedNspNsi = buf.DecodeUint32()
410 m.NshAction = buf.DecodeUint32()
411 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
412 m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
413 m.NextNode = buf.DecodeUint32()
417 // NshMapDump defines message 'nsh_map_dump'.
418 type NshMapDump struct {
419 MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
422 func (m *NshMapDump) Reset() { *m = NshMapDump{} }
423 func (*NshMapDump) GetMessageName() string { return "nsh_map_dump" }
424 func (*NshMapDump) GetCrcString() string { return "8fc06b82" }
425 func (*NshMapDump) GetMessageType() api.MessageType {
426 return api.RequestMessage
429 func (m *NshMapDump) Size() (size int) {
433 size += 4 // m.MapIndex
436 func (m *NshMapDump) Marshal(b []byte) ([]byte, error) {
438 b = make([]byte, m.Size())
440 buf := codec.NewBuffer(b)
441 buf.EncodeUint32(m.MapIndex)
442 return buf.Bytes(), nil
444 func (m *NshMapDump) Unmarshal(b []byte) error {
445 buf := codec.NewBuffer(b)
446 m.MapIndex = buf.DecodeUint32()
450 func init() { file_nsh_binapi_init() }
451 func file_nsh_binapi_init() {
452 api.RegisterMessage((*NshAddDelEntry)(nil), "nsh_add_del_entry_7dea480b")
453 api.RegisterMessage((*NshAddDelEntryReply)(nil), "nsh_add_del_entry_reply_6296a9eb")
454 api.RegisterMessage((*NshAddDelMap)(nil), "nsh_add_del_map_0a0f42b0")
455 api.RegisterMessage((*NshAddDelMapReply)(nil), "nsh_add_del_map_reply_b2b127ef")
456 api.RegisterMessage((*NshEntryDetails)(nil), "nsh_entry_details_046fb556")
457 api.RegisterMessage((*NshEntryDump)(nil), "nsh_entry_dump_cdaf8ccb")
458 api.RegisterMessage((*NshMapDetails)(nil), "nsh_map_details_2fefcf49")
459 api.RegisterMessage((*NshMapDump)(nil), "nsh_map_dump_8fc06b82")
462 // Messages returns list of all messages in this module.
463 func AllMessages() []api.Message {
464 return []api.Message{
465 (*NshAddDelEntry)(nil),
466 (*NshAddDelEntryReply)(nil),
467 (*NshAddDelMap)(nil),
468 (*NshAddDelMapReply)(nil),
469 (*NshEntryDetails)(nil),
470 (*NshEntryDump)(nil),
471 (*NshMapDetails)(nil),