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/l3xc.api.json
7 // Package l3xc contains generated bindings for API file l3xc.api.
16 api "git.fd.io/govpp.git/api"
17 fib_types "git.fd.io/govpp.git/binapi/fib_types"
18 interface_types "git.fd.io/govpp.git/binapi/interface_types"
19 _ "git.fd.io/govpp.git/binapi/ip_types"
20 codec "git.fd.io/govpp.git/codec"
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
32 VersionCrc = 0xaf18effb
35 // L3xc defines type 'l3xc'.
37 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
38 IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
39 NPaths uint8 `binapi:"u8,name=n_paths" json:"-"`
40 Paths []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"`
43 // L3xcDel defines message 'l3xc_del'.
45 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
46 IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
49 func (m *L3xcDel) Reset() { *m = L3xcDel{} }
50 func (*L3xcDel) GetMessageName() string { return "l3xc_del" }
51 func (*L3xcDel) GetCrcString() string { return "e7dbef91" }
52 func (*L3xcDel) GetMessageType() api.MessageType {
53 return api.RequestMessage
56 func (m *L3xcDel) Size() int {
61 size += 4 // m.SwIfIndex
65 func (m *L3xcDel) Marshal(b []byte) ([]byte, error) {
68 buf = codec.NewBuffer(make([]byte, m.Size()))
70 buf = codec.NewBuffer(b)
72 buf.EncodeUint32(uint32(m.SwIfIndex))
73 buf.EncodeBool(m.IsIP6)
74 return buf.Bytes(), nil
76 func (m *L3xcDel) Unmarshal(b []byte) error {
77 buf := codec.NewBuffer(b)
78 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
79 m.IsIP6 = buf.DecodeBool()
83 // L3xcDelReply defines message 'l3xc_del_reply'.
84 type L3xcDelReply struct {
85 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
88 func (m *L3xcDelReply) Reset() { *m = L3xcDelReply{} }
89 func (*L3xcDelReply) GetMessageName() string { return "l3xc_del_reply" }
90 func (*L3xcDelReply) GetCrcString() string { return "e8d4e804" }
91 func (*L3xcDelReply) GetMessageType() api.MessageType {
92 return api.ReplyMessage
95 func (m *L3xcDelReply) Size() int {
100 size += 4 // m.Retval
103 func (m *L3xcDelReply) Marshal(b []byte) ([]byte, error) {
104 var buf *codec.Buffer
106 buf = codec.NewBuffer(make([]byte, m.Size()))
108 buf = codec.NewBuffer(b)
110 buf.EncodeUint32(uint32(m.Retval))
111 return buf.Bytes(), nil
113 func (m *L3xcDelReply) Unmarshal(b []byte) error {
114 buf := codec.NewBuffer(b)
115 m.Retval = int32(buf.DecodeUint32())
119 // L3xcDetails defines message 'l3xc_details'.
120 type L3xcDetails struct {
121 L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"`
124 func (m *L3xcDetails) Reset() { *m = L3xcDetails{} }
125 func (*L3xcDetails) GetMessageName() string { return "l3xc_details" }
126 func (*L3xcDetails) GetCrcString() string { return "d4f69627" }
127 func (*L3xcDetails) GetMessageType() api.MessageType {
128 return api.ReplyMessage
131 func (m *L3xcDetails) Size() int {
136 size += 4 // m.L3xc.SwIfIndex
137 size += 1 // m.L3xc.IsIP6
138 size += 1 // m.L3xc.NPaths
139 for j2 := 0; j2 < len(m.L3xc.Paths); j2++ {
140 var s2 fib_types.FibPath
142 if j2 < len(m.L3xc.Paths) {
143 s2 = m.L3xc.Paths[j2]
145 size += 4 // s2.SwIfIndex
146 size += 4 // s2.TableID
147 size += 4 // s2.RpfID
148 size += 1 // s2.Weight
149 size += 1 // s2.Preference
151 size += 4 // s2.Flags
152 size += 4 // s2.Proto
153 size += 1 * 16 // s2.Nh.Address
154 size += 4 // s2.Nh.ViaLabel
155 size += 4 // s2.Nh.ObjID
156 size += 4 // s2.Nh.ClassifyTableIndex
157 size += 1 // s2.NLabels
158 for j3 := 0; j3 < 16; j3++ {
159 var s3 fib_types.FibMplsLabel
161 if j3 < len(s2.LabelStack) {
162 s3 = s2.LabelStack[j3]
164 size += 1 // s3.IsUniform
165 size += 4 // s3.Label
172 func (m *L3xcDetails) Marshal(b []byte) ([]byte, error) {
173 var buf *codec.Buffer
175 buf = codec.NewBuffer(make([]byte, m.Size()))
177 buf = codec.NewBuffer(b)
179 buf.EncodeUint32(uint32(m.L3xc.SwIfIndex))
180 buf.EncodeBool(m.L3xc.IsIP6)
181 buf.EncodeUint8(uint8(len(m.L3xc.Paths)))
182 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
183 var v1 fib_types.FibPath
184 if j1 < len(m.L3xc.Paths) {
185 v1 = m.L3xc.Paths[j1]
187 buf.EncodeUint32(uint32(v1.SwIfIndex))
188 buf.EncodeUint32(uint32(v1.TableID))
189 buf.EncodeUint32(uint32(v1.RpfID))
190 buf.EncodeUint8(uint8(v1.Weight))
191 buf.EncodeUint8(uint8(v1.Preference))
192 buf.EncodeUint32(uint32(v1.Type))
193 buf.EncodeUint32(uint32(v1.Flags))
194 buf.EncodeUint32(uint32(v1.Proto))
195 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0)
196 buf.EncodeUint32(uint32(v1.Nh.ViaLabel))
197 buf.EncodeUint32(uint32(v1.Nh.ObjID))
198 buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex))
199 buf.EncodeUint8(uint8(v1.NLabels))
200 for j2 := 0; j2 < 16; j2++ {
201 var v2 fib_types.FibMplsLabel
202 if j2 < len(v1.LabelStack) {
203 v2 = v1.LabelStack[j2]
205 buf.EncodeUint8(uint8(v2.IsUniform))
206 buf.EncodeUint32(uint32(v2.Label))
207 buf.EncodeUint8(uint8(v2.TTL))
208 buf.EncodeUint8(uint8(v2.Exp))
211 return buf.Bytes(), nil
213 func (m *L3xcDetails) Unmarshal(b []byte) error {
214 buf := codec.NewBuffer(b)
215 m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
216 m.L3xc.IsIP6 = buf.DecodeBool()
217 m.L3xc.NPaths = buf.DecodeUint8()
218 m.L3xc.Paths = make([]fib_types.FibPath, int(m.L3xc.NPaths))
219 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
220 m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32()
221 m.L3xc.Paths[j1].TableID = buf.DecodeUint32()
222 m.L3xc.Paths[j1].RpfID = buf.DecodeUint32()
223 m.L3xc.Paths[j1].Weight = buf.DecodeUint8()
224 m.L3xc.Paths[j1].Preference = buf.DecodeUint8()
225 m.L3xc.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
226 m.L3xc.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
227 m.L3xc.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
228 copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
229 m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
230 m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32()
231 m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
232 m.L3xc.Paths[j1].NLabels = buf.DecodeUint8()
233 for j2 := 0; j2 < 16; j2++ {
234 m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
235 m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
236 m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
237 m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
243 // L3xcDump defines message 'l3xc_dump'.
244 type L3xcDump struct {
245 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
248 func (m *L3xcDump) Reset() { *m = L3xcDump{} }
249 func (*L3xcDump) GetMessageName() string { return "l3xc_dump" }
250 func (*L3xcDump) GetCrcString() string { return "f9e6675e" }
251 func (*L3xcDump) GetMessageType() api.MessageType {
252 return api.RequestMessage
255 func (m *L3xcDump) Size() int {
260 size += 4 // m.SwIfIndex
263 func (m *L3xcDump) Marshal(b []byte) ([]byte, error) {
264 var buf *codec.Buffer
266 buf = codec.NewBuffer(make([]byte, m.Size()))
268 buf = codec.NewBuffer(b)
270 buf.EncodeUint32(uint32(m.SwIfIndex))
271 return buf.Bytes(), nil
273 func (m *L3xcDump) Unmarshal(b []byte) error {
274 buf := codec.NewBuffer(b)
275 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
279 // L3xcPluginGetVersion defines message 'l3xc_plugin_get_version'.
280 type L3xcPluginGetVersion struct{}
282 func (m *L3xcPluginGetVersion) Reset() { *m = L3xcPluginGetVersion{} }
283 func (*L3xcPluginGetVersion) GetMessageName() string { return "l3xc_plugin_get_version" }
284 func (*L3xcPluginGetVersion) GetCrcString() string { return "51077d14" }
285 func (*L3xcPluginGetVersion) GetMessageType() api.MessageType {
286 return api.RequestMessage
289 func (m *L3xcPluginGetVersion) Size() int {
296 func (m *L3xcPluginGetVersion) Marshal(b []byte) ([]byte, error) {
297 var buf *codec.Buffer
299 buf = codec.NewBuffer(make([]byte, m.Size()))
301 buf = codec.NewBuffer(b)
303 return buf.Bytes(), nil
305 func (m *L3xcPluginGetVersion) Unmarshal(b []byte) error {
309 // L3xcPluginGetVersionReply defines message 'l3xc_plugin_get_version_reply'.
310 type L3xcPluginGetVersionReply struct {
311 Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
312 Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
315 func (m *L3xcPluginGetVersionReply) Reset() { *m = L3xcPluginGetVersionReply{} }
316 func (*L3xcPluginGetVersionReply) GetMessageName() string { return "l3xc_plugin_get_version_reply" }
317 func (*L3xcPluginGetVersionReply) GetCrcString() string { return "9b32cf86" }
318 func (*L3xcPluginGetVersionReply) GetMessageType() api.MessageType {
319 return api.ReplyMessage
322 func (m *L3xcPluginGetVersionReply) Size() int {
331 func (m *L3xcPluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
332 var buf *codec.Buffer
334 buf = codec.NewBuffer(make([]byte, m.Size()))
336 buf = codec.NewBuffer(b)
338 buf.EncodeUint32(uint32(m.Major))
339 buf.EncodeUint32(uint32(m.Minor))
340 return buf.Bytes(), nil
342 func (m *L3xcPluginGetVersionReply) Unmarshal(b []byte) error {
343 buf := codec.NewBuffer(b)
344 m.Major = buf.DecodeUint32()
345 m.Minor = buf.DecodeUint32()
349 // L3xcUpdate defines message 'l3xc_update'.
350 type L3xcUpdate struct {
351 L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"`
354 func (m *L3xcUpdate) Reset() { *m = L3xcUpdate{} }
355 func (*L3xcUpdate) GetMessageName() string { return "l3xc_update" }
356 func (*L3xcUpdate) GetCrcString() string { return "0787b1d3" }
357 func (*L3xcUpdate) GetMessageType() api.MessageType {
358 return api.RequestMessage
361 func (m *L3xcUpdate) Size() int {
366 size += 4 // m.L3xc.SwIfIndex
367 size += 1 // m.L3xc.IsIP6
368 size += 1 // m.L3xc.NPaths
369 for j2 := 0; j2 < len(m.L3xc.Paths); j2++ {
370 var s2 fib_types.FibPath
372 if j2 < len(m.L3xc.Paths) {
373 s2 = m.L3xc.Paths[j2]
375 size += 4 // s2.SwIfIndex
376 size += 4 // s2.TableID
377 size += 4 // s2.RpfID
378 size += 1 // s2.Weight
379 size += 1 // s2.Preference
381 size += 4 // s2.Flags
382 size += 4 // s2.Proto
383 size += 1 * 16 // s2.Nh.Address
384 size += 4 // s2.Nh.ViaLabel
385 size += 4 // s2.Nh.ObjID
386 size += 4 // s2.Nh.ClassifyTableIndex
387 size += 1 // s2.NLabels
388 for j3 := 0; j3 < 16; j3++ {
389 var s3 fib_types.FibMplsLabel
391 if j3 < len(s2.LabelStack) {
392 s3 = s2.LabelStack[j3]
394 size += 1 // s3.IsUniform
395 size += 4 // s3.Label
402 func (m *L3xcUpdate) Marshal(b []byte) ([]byte, error) {
403 var buf *codec.Buffer
405 buf = codec.NewBuffer(make([]byte, m.Size()))
407 buf = codec.NewBuffer(b)
409 buf.EncodeUint32(uint32(m.L3xc.SwIfIndex))
410 buf.EncodeBool(m.L3xc.IsIP6)
411 buf.EncodeUint8(uint8(len(m.L3xc.Paths)))
412 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
413 var v1 fib_types.FibPath
414 if j1 < len(m.L3xc.Paths) {
415 v1 = m.L3xc.Paths[j1]
417 buf.EncodeUint32(uint32(v1.SwIfIndex))
418 buf.EncodeUint32(uint32(v1.TableID))
419 buf.EncodeUint32(uint32(v1.RpfID))
420 buf.EncodeUint8(uint8(v1.Weight))
421 buf.EncodeUint8(uint8(v1.Preference))
422 buf.EncodeUint32(uint32(v1.Type))
423 buf.EncodeUint32(uint32(v1.Flags))
424 buf.EncodeUint32(uint32(v1.Proto))
425 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0)
426 buf.EncodeUint32(uint32(v1.Nh.ViaLabel))
427 buf.EncodeUint32(uint32(v1.Nh.ObjID))
428 buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex))
429 buf.EncodeUint8(uint8(v1.NLabels))
430 for j2 := 0; j2 < 16; j2++ {
431 var v2 fib_types.FibMplsLabel
432 if j2 < len(v1.LabelStack) {
433 v2 = v1.LabelStack[j2]
435 buf.EncodeUint8(uint8(v2.IsUniform))
436 buf.EncodeUint32(uint32(v2.Label))
437 buf.EncodeUint8(uint8(v2.TTL))
438 buf.EncodeUint8(uint8(v2.Exp))
441 return buf.Bytes(), nil
443 func (m *L3xcUpdate) Unmarshal(b []byte) error {
444 buf := codec.NewBuffer(b)
445 m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
446 m.L3xc.IsIP6 = buf.DecodeBool()
447 m.L3xc.NPaths = buf.DecodeUint8()
448 m.L3xc.Paths = make([]fib_types.FibPath, int(m.L3xc.NPaths))
449 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
450 m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32()
451 m.L3xc.Paths[j1].TableID = buf.DecodeUint32()
452 m.L3xc.Paths[j1].RpfID = buf.DecodeUint32()
453 m.L3xc.Paths[j1].Weight = buf.DecodeUint8()
454 m.L3xc.Paths[j1].Preference = buf.DecodeUint8()
455 m.L3xc.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
456 m.L3xc.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
457 m.L3xc.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
458 copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
459 m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
460 m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32()
461 m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
462 m.L3xc.Paths[j1].NLabels = buf.DecodeUint8()
463 for j2 := 0; j2 < 16; j2++ {
464 m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
465 m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
466 m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
467 m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
473 // L3xcUpdateReply defines message 'l3xc_update_reply'.
474 type L3xcUpdateReply struct {
475 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
476 StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
479 func (m *L3xcUpdateReply) Reset() { *m = L3xcUpdateReply{} }
480 func (*L3xcUpdateReply) GetMessageName() string { return "l3xc_update_reply" }
481 func (*L3xcUpdateReply) GetCrcString() string { return "1992deab" }
482 func (*L3xcUpdateReply) GetMessageType() api.MessageType {
483 return api.ReplyMessage
486 func (m *L3xcUpdateReply) Size() int {
491 size += 4 // m.Retval
492 size += 4 // m.StatsIndex
495 func (m *L3xcUpdateReply) Marshal(b []byte) ([]byte, error) {
496 var buf *codec.Buffer
498 buf = codec.NewBuffer(make([]byte, m.Size()))
500 buf = codec.NewBuffer(b)
502 buf.EncodeUint32(uint32(m.Retval))
503 buf.EncodeUint32(uint32(m.StatsIndex))
504 return buf.Bytes(), nil
506 func (m *L3xcUpdateReply) Unmarshal(b []byte) error {
507 buf := codec.NewBuffer(b)
508 m.Retval = int32(buf.DecodeUint32())
509 m.StatsIndex = buf.DecodeUint32()
513 func init() { file_l3xc_binapi_init() }
514 func file_l3xc_binapi_init() {
515 api.RegisterMessage((*L3xcDel)(nil), "l3xc_del_e7dbef91")
516 api.RegisterMessage((*L3xcDelReply)(nil), "l3xc_del_reply_e8d4e804")
517 api.RegisterMessage((*L3xcDetails)(nil), "l3xc_details_d4f69627")
518 api.RegisterMessage((*L3xcDump)(nil), "l3xc_dump_f9e6675e")
519 api.RegisterMessage((*L3xcPluginGetVersion)(nil), "l3xc_plugin_get_version_51077d14")
520 api.RegisterMessage((*L3xcPluginGetVersionReply)(nil), "l3xc_plugin_get_version_reply_9b32cf86")
521 api.RegisterMessage((*L3xcUpdate)(nil), "l3xc_update_0787b1d3")
522 api.RegisterMessage((*L3xcUpdateReply)(nil), "l3xc_update_reply_1992deab")
525 // Messages returns list of all messages in this module.
526 func AllMessages() []api.Message {
527 return []api.Message{
529 (*L3xcDelReply)(nil),
532 (*L3xcPluginGetVersion)(nil),
533 (*L3xcPluginGetVersionReply)(nil),
535 (*L3xcUpdateReply)(nil),