1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package nsh contains generated bindings for API file nsh.api.
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"
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
28 VersionCrc = 0x43be6707
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"`
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
55 func (m *NshAddDelEntry) Size() (size int) {
65 size += 1 // m.NextProtocol
70 size += 1 // m.TlvLength
71 size += 1 * 248 // m.Tlv
74 func (m *NshAddDelEntry) Marshal(b []byte) ([]byte, error) {
76 b = make([]byte, m.Size())
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
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)))
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"`
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
126 func (m *NshAddDelEntryReply) Size() (size int) {
130 size += 4 // m.Retval
131 size += 4 // m.EntryIndex
134 func (m *NshAddDelEntryReply) Marshal(b []byte) ([]byte, error) {
136 b = make([]byte, m.Size())
138 buf := codec.NewBuffer(b)
139 buf.EncodeInt32(m.Retval)
140 buf.EncodeUint32(m.EntryIndex)
141 return buf.Bytes(), nil
143 func (m *NshAddDelEntryReply) Unmarshal(b []byte) error {
144 buf := codec.NewBuffer(b)
145 m.Retval = buf.DecodeInt32()
146 m.EntryIndex = buf.DecodeUint32()
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"`
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
168 func (m *NshAddDelMap) Size() (size int) {
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
181 func (m *NshAddDelMap) Marshal(b []byte) ([]byte, error) {
183 b = make([]byte, m.Size())
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
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()
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"`
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
220 func (m *NshAddDelMapReply) Size() (size int) {
224 size += 4 // m.Retval
225 size += 4 // m.MapIndex
228 func (m *NshAddDelMapReply) Marshal(b []byte) ([]byte, error) {
230 b = make([]byte, m.Size())
232 buf := codec.NewBuffer(b)
233 buf.EncodeInt32(m.Retval)
234 buf.EncodeUint32(m.MapIndex)
235 return buf.Bytes(), nil
237 func (m *NshAddDelMapReply) Unmarshal(b []byte) error {
238 buf := codec.NewBuffer(b)
239 m.Retval = buf.DecodeInt32()
240 m.MapIndex = buf.DecodeUint32()
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"`
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
268 func (m *NshEntryDetails) Size() (size int) {
272 size += 4 // m.EntryIndex
273 size += 4 // m.NspNsi
274 size += 1 // m.MdType
277 size += 1 // m.Length
278 size += 1 // m.NextProtocol
283 size += 1 // m.TlvLength
284 size += 1 * 248 // m.Tlv
287 func (m *NshEntryDetails) Marshal(b []byte) ([]byte, error) {
289 b = make([]byte, m.Size())
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
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)))
326 // NshEntryDump defines message 'nsh_entry_dump'.
327 type NshEntryDump struct {
328 EntryIndex uint32 `binapi:"u32,name=entry_index" json:"entry_index,omitempty"`
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
338 func (m *NshEntryDump) Size() (size int) {
342 size += 4 // m.EntryIndex
345 func (m *NshEntryDump) Marshal(b []byte) ([]byte, error) {
347 b = make([]byte, m.Size())
349 buf := codec.NewBuffer(b)
350 buf.EncodeUint32(m.EntryIndex)
351 return buf.Bytes(), nil
353 func (m *NshEntryDump) Unmarshal(b []byte) error {
354 buf := codec.NewBuffer(b)
355 m.EntryIndex = buf.DecodeUint32()
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"`
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
377 func (m *NshMapDetails) Size() (size int) {
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
390 func (m *NshMapDetails) Marshal(b []byte) ([]byte, error) {
392 b = make([]byte, m.Size())
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
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()
416 // NshMapDump defines message 'nsh_map_dump'.
417 type NshMapDump struct {
418 MapIndex uint32 `binapi:"u32,name=map_index" json:"map_index,omitempty"`
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
428 func (m *NshMapDump) Size() (size int) {
432 size += 4 // m.MapIndex
435 func (m *NshMapDump) Marshal(b []byte) ([]byte, error) {
437 b = make([]byte, m.Size())
439 buf := codec.NewBuffer(b)
440 buf.EncodeUint32(m.MapIndex)
441 return buf.Bytes(), nil
443 func (m *NshMapDump) Unmarshal(b []byte) error {
444 buf := codec.NewBuffer(b)
445 m.MapIndex = buf.DecodeUint32()
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")
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),