1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package l3xc contains generated bindings for API file l3xc.api.
15 api "git.fd.io/govpp.git/api"
16 fib_types "git.fd.io/govpp.git/binapi/fib_types"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 _ "git.fd.io/govpp.git/binapi/ip_types"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0xaf18effb
34 // L3xc defines type 'l3xc'.
36 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
37 IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
38 NPaths uint8 `binapi:"u8,name=n_paths" json:"-"`
39 Paths []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"`
42 // L3xcDel defines message 'l3xc_del'.
44 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
45 IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
48 func (m *L3xcDel) Reset() { *m = L3xcDel{} }
49 func (*L3xcDel) GetMessageName() string { return "l3xc_del" }
50 func (*L3xcDel) GetCrcString() string { return "e7dbef91" }
51 func (*L3xcDel) GetMessageType() api.MessageType {
52 return api.RequestMessage
55 func (m *L3xcDel) Size() (size int) {
59 size += 4 // m.SwIfIndex
63 func (m *L3xcDel) Marshal(b []byte) ([]byte, error) {
65 b = make([]byte, m.Size())
67 buf := codec.NewBuffer(b)
68 buf.EncodeUint32(uint32(m.SwIfIndex))
69 buf.EncodeBool(m.IsIP6)
70 return buf.Bytes(), nil
72 func (m *L3xcDel) Unmarshal(b []byte) error {
73 buf := codec.NewBuffer(b)
74 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
75 m.IsIP6 = buf.DecodeBool()
79 // L3xcDelReply defines message 'l3xc_del_reply'.
80 type L3xcDelReply struct {
81 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
84 func (m *L3xcDelReply) Reset() { *m = L3xcDelReply{} }
85 func (*L3xcDelReply) GetMessageName() string { return "l3xc_del_reply" }
86 func (*L3xcDelReply) GetCrcString() string { return "e8d4e804" }
87 func (*L3xcDelReply) GetMessageType() api.MessageType {
88 return api.ReplyMessage
91 func (m *L3xcDelReply) Size() (size int) {
98 func (m *L3xcDelReply) Marshal(b []byte) ([]byte, error) {
100 b = make([]byte, m.Size())
102 buf := codec.NewBuffer(b)
103 buf.EncodeInt32(m.Retval)
104 return buf.Bytes(), nil
106 func (m *L3xcDelReply) Unmarshal(b []byte) error {
107 buf := codec.NewBuffer(b)
108 m.Retval = buf.DecodeInt32()
112 // L3xcDetails defines message 'l3xc_details'.
113 type L3xcDetails struct {
114 L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"`
117 func (m *L3xcDetails) Reset() { *m = L3xcDetails{} }
118 func (*L3xcDetails) GetMessageName() string { return "l3xc_details" }
119 func (*L3xcDetails) GetCrcString() string { return "d4f69627" }
120 func (*L3xcDetails) GetMessageType() api.MessageType {
121 return api.ReplyMessage
124 func (m *L3xcDetails) Size() (size int) {
128 size += 4 // m.L3xc.SwIfIndex
129 size += 1 // m.L3xc.IsIP6
130 size += 1 // m.L3xc.NPaths
131 for j2 := 0; j2 < len(m.L3xc.Paths); j2++ {
132 var s2 fib_types.FibPath
134 if j2 < len(m.L3xc.Paths) {
135 s2 = m.L3xc.Paths[j2]
137 size += 4 // s2.SwIfIndex
138 size += 4 // s2.TableID
139 size += 4 // s2.RpfID
140 size += 1 // s2.Weight
141 size += 1 // s2.Preference
143 size += 4 // s2.Flags
144 size += 4 // s2.Proto
145 size += 1 * 16 // s2.Nh.Address
146 size += 4 // s2.Nh.ViaLabel
147 size += 4 // s2.Nh.ObjID
148 size += 4 // s2.Nh.ClassifyTableIndex
149 size += 1 // s2.NLabels
150 for j3 := 0; j3 < 16; j3++ {
151 size += 1 // s2.LabelStack[j3].IsUniform
152 size += 4 // s2.LabelStack[j3].Label
153 size += 1 // s2.LabelStack[j3].TTL
154 size += 1 // s2.LabelStack[j3].Exp
159 func (m *L3xcDetails) Marshal(b []byte) ([]byte, error) {
161 b = make([]byte, m.Size())
163 buf := codec.NewBuffer(b)
164 buf.EncodeUint32(uint32(m.L3xc.SwIfIndex))
165 buf.EncodeBool(m.L3xc.IsIP6)
166 buf.EncodeUint8(uint8(len(m.L3xc.Paths)))
167 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
168 var v1 fib_types.FibPath // Paths
169 if j1 < len(m.L3xc.Paths) {
170 v1 = m.L3xc.Paths[j1]
172 buf.EncodeUint32(v1.SwIfIndex)
173 buf.EncodeUint32(v1.TableID)
174 buf.EncodeUint32(v1.RpfID)
175 buf.EncodeUint8(v1.Weight)
176 buf.EncodeUint8(v1.Preference)
177 buf.EncodeUint32(uint32(v1.Type))
178 buf.EncodeUint32(uint32(v1.Flags))
179 buf.EncodeUint32(uint32(v1.Proto))
180 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
181 buf.EncodeUint32(v1.Nh.ViaLabel)
182 buf.EncodeUint32(v1.Nh.ObjID)
183 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
184 buf.EncodeUint8(v1.NLabels)
185 for j2 := 0; j2 < 16; j2++ {
186 buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
187 buf.EncodeUint32(v1.LabelStack[j2].Label)
188 buf.EncodeUint8(v1.LabelStack[j2].TTL)
189 buf.EncodeUint8(v1.LabelStack[j2].Exp)
192 return buf.Bytes(), nil
194 func (m *L3xcDetails) Unmarshal(b []byte) error {
195 buf := codec.NewBuffer(b)
196 m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
197 m.L3xc.IsIP6 = buf.DecodeBool()
198 m.L3xc.NPaths = buf.DecodeUint8()
199 m.L3xc.Paths = make([]fib_types.FibPath, m.L3xc.NPaths)
200 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
201 m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32()
202 m.L3xc.Paths[j1].TableID = buf.DecodeUint32()
203 m.L3xc.Paths[j1].RpfID = buf.DecodeUint32()
204 m.L3xc.Paths[j1].Weight = buf.DecodeUint8()
205 m.L3xc.Paths[j1].Preference = buf.DecodeUint8()
206 m.L3xc.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
207 m.L3xc.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
208 m.L3xc.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
209 copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
210 m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
211 m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32()
212 m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
213 m.L3xc.Paths[j1].NLabels = buf.DecodeUint8()
214 for j2 := 0; j2 < 16; j2++ {
215 m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
216 m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
217 m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
218 m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
224 // L3xcDump defines message 'l3xc_dump'.
225 type L3xcDump struct {
226 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
229 func (m *L3xcDump) Reset() { *m = L3xcDump{} }
230 func (*L3xcDump) GetMessageName() string { return "l3xc_dump" }
231 func (*L3xcDump) GetCrcString() string { return "f9e6675e" }
232 func (*L3xcDump) GetMessageType() api.MessageType {
233 return api.RequestMessage
236 func (m *L3xcDump) Size() (size int) {
240 size += 4 // m.SwIfIndex
243 func (m *L3xcDump) Marshal(b []byte) ([]byte, error) {
245 b = make([]byte, m.Size())
247 buf := codec.NewBuffer(b)
248 buf.EncodeUint32(uint32(m.SwIfIndex))
249 return buf.Bytes(), nil
251 func (m *L3xcDump) Unmarshal(b []byte) error {
252 buf := codec.NewBuffer(b)
253 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
257 // L3xcPluginGetVersion defines message 'l3xc_plugin_get_version'.
258 type L3xcPluginGetVersion struct{}
260 func (m *L3xcPluginGetVersion) Reset() { *m = L3xcPluginGetVersion{} }
261 func (*L3xcPluginGetVersion) GetMessageName() string { return "l3xc_plugin_get_version" }
262 func (*L3xcPluginGetVersion) GetCrcString() string { return "51077d14" }
263 func (*L3xcPluginGetVersion) GetMessageType() api.MessageType {
264 return api.RequestMessage
267 func (m *L3xcPluginGetVersion) Size() (size int) {
273 func (m *L3xcPluginGetVersion) Marshal(b []byte) ([]byte, error) {
275 b = make([]byte, m.Size())
277 buf := codec.NewBuffer(b)
278 return buf.Bytes(), nil
280 func (m *L3xcPluginGetVersion) Unmarshal(b []byte) error {
284 // L3xcPluginGetVersionReply defines message 'l3xc_plugin_get_version_reply'.
285 type L3xcPluginGetVersionReply struct {
286 Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
287 Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
290 func (m *L3xcPluginGetVersionReply) Reset() { *m = L3xcPluginGetVersionReply{} }
291 func (*L3xcPluginGetVersionReply) GetMessageName() string { return "l3xc_plugin_get_version_reply" }
292 func (*L3xcPluginGetVersionReply) GetCrcString() string { return "9b32cf86" }
293 func (*L3xcPluginGetVersionReply) GetMessageType() api.MessageType {
294 return api.ReplyMessage
297 func (m *L3xcPluginGetVersionReply) Size() (size int) {
305 func (m *L3xcPluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
307 b = make([]byte, m.Size())
309 buf := codec.NewBuffer(b)
310 buf.EncodeUint32(m.Major)
311 buf.EncodeUint32(m.Minor)
312 return buf.Bytes(), nil
314 func (m *L3xcPluginGetVersionReply) Unmarshal(b []byte) error {
315 buf := codec.NewBuffer(b)
316 m.Major = buf.DecodeUint32()
317 m.Minor = buf.DecodeUint32()
321 // L3xcUpdate defines message 'l3xc_update'.
322 type L3xcUpdate struct {
323 L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"`
326 func (m *L3xcUpdate) Reset() { *m = L3xcUpdate{} }
327 func (*L3xcUpdate) GetMessageName() string { return "l3xc_update" }
328 func (*L3xcUpdate) GetCrcString() string { return "0787b1d3" }
329 func (*L3xcUpdate) GetMessageType() api.MessageType {
330 return api.RequestMessage
333 func (m *L3xcUpdate) Size() (size int) {
337 size += 4 // m.L3xc.SwIfIndex
338 size += 1 // m.L3xc.IsIP6
339 size += 1 // m.L3xc.NPaths
340 for j2 := 0; j2 < len(m.L3xc.Paths); j2++ {
341 var s2 fib_types.FibPath
343 if j2 < len(m.L3xc.Paths) {
344 s2 = m.L3xc.Paths[j2]
346 size += 4 // s2.SwIfIndex
347 size += 4 // s2.TableID
348 size += 4 // s2.RpfID
349 size += 1 // s2.Weight
350 size += 1 // s2.Preference
352 size += 4 // s2.Flags
353 size += 4 // s2.Proto
354 size += 1 * 16 // s2.Nh.Address
355 size += 4 // s2.Nh.ViaLabel
356 size += 4 // s2.Nh.ObjID
357 size += 4 // s2.Nh.ClassifyTableIndex
358 size += 1 // s2.NLabels
359 for j3 := 0; j3 < 16; j3++ {
360 size += 1 // s2.LabelStack[j3].IsUniform
361 size += 4 // s2.LabelStack[j3].Label
362 size += 1 // s2.LabelStack[j3].TTL
363 size += 1 // s2.LabelStack[j3].Exp
368 func (m *L3xcUpdate) Marshal(b []byte) ([]byte, error) {
370 b = make([]byte, m.Size())
372 buf := codec.NewBuffer(b)
373 buf.EncodeUint32(uint32(m.L3xc.SwIfIndex))
374 buf.EncodeBool(m.L3xc.IsIP6)
375 buf.EncodeUint8(uint8(len(m.L3xc.Paths)))
376 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
377 var v1 fib_types.FibPath // Paths
378 if j1 < len(m.L3xc.Paths) {
379 v1 = m.L3xc.Paths[j1]
381 buf.EncodeUint32(v1.SwIfIndex)
382 buf.EncodeUint32(v1.TableID)
383 buf.EncodeUint32(v1.RpfID)
384 buf.EncodeUint8(v1.Weight)
385 buf.EncodeUint8(v1.Preference)
386 buf.EncodeUint32(uint32(v1.Type))
387 buf.EncodeUint32(uint32(v1.Flags))
388 buf.EncodeUint32(uint32(v1.Proto))
389 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
390 buf.EncodeUint32(v1.Nh.ViaLabel)
391 buf.EncodeUint32(v1.Nh.ObjID)
392 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
393 buf.EncodeUint8(v1.NLabels)
394 for j2 := 0; j2 < 16; j2++ {
395 buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
396 buf.EncodeUint32(v1.LabelStack[j2].Label)
397 buf.EncodeUint8(v1.LabelStack[j2].TTL)
398 buf.EncodeUint8(v1.LabelStack[j2].Exp)
401 return buf.Bytes(), nil
403 func (m *L3xcUpdate) Unmarshal(b []byte) error {
404 buf := codec.NewBuffer(b)
405 m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
406 m.L3xc.IsIP6 = buf.DecodeBool()
407 m.L3xc.NPaths = buf.DecodeUint8()
408 m.L3xc.Paths = make([]fib_types.FibPath, m.L3xc.NPaths)
409 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
410 m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32()
411 m.L3xc.Paths[j1].TableID = buf.DecodeUint32()
412 m.L3xc.Paths[j1].RpfID = buf.DecodeUint32()
413 m.L3xc.Paths[j1].Weight = buf.DecodeUint8()
414 m.L3xc.Paths[j1].Preference = buf.DecodeUint8()
415 m.L3xc.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
416 m.L3xc.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
417 m.L3xc.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
418 copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
419 m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
420 m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32()
421 m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
422 m.L3xc.Paths[j1].NLabels = buf.DecodeUint8()
423 for j2 := 0; j2 < 16; j2++ {
424 m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
425 m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
426 m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
427 m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
433 // L3xcUpdateReply defines message 'l3xc_update_reply'.
434 type L3xcUpdateReply struct {
435 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
436 StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
439 func (m *L3xcUpdateReply) Reset() { *m = L3xcUpdateReply{} }
440 func (*L3xcUpdateReply) GetMessageName() string { return "l3xc_update_reply" }
441 func (*L3xcUpdateReply) GetCrcString() string { return "1992deab" }
442 func (*L3xcUpdateReply) GetMessageType() api.MessageType {
443 return api.ReplyMessage
446 func (m *L3xcUpdateReply) Size() (size int) {
450 size += 4 // m.Retval
451 size += 4 // m.StatsIndex
454 func (m *L3xcUpdateReply) Marshal(b []byte) ([]byte, error) {
456 b = make([]byte, m.Size())
458 buf := codec.NewBuffer(b)
459 buf.EncodeInt32(m.Retval)
460 buf.EncodeUint32(m.StatsIndex)
461 return buf.Bytes(), nil
463 func (m *L3xcUpdateReply) Unmarshal(b []byte) error {
464 buf := codec.NewBuffer(b)
465 m.Retval = buf.DecodeInt32()
466 m.StatsIndex = buf.DecodeUint32()
470 func init() { file_l3xc_binapi_init() }
471 func file_l3xc_binapi_init() {
472 api.RegisterMessage((*L3xcDel)(nil), "l3xc_del_e7dbef91")
473 api.RegisterMessage((*L3xcDelReply)(nil), "l3xc_del_reply_e8d4e804")
474 api.RegisterMessage((*L3xcDetails)(nil), "l3xc_details_d4f69627")
475 api.RegisterMessage((*L3xcDump)(nil), "l3xc_dump_f9e6675e")
476 api.RegisterMessage((*L3xcPluginGetVersion)(nil), "l3xc_plugin_get_version_51077d14")
477 api.RegisterMessage((*L3xcPluginGetVersionReply)(nil), "l3xc_plugin_get_version_reply_9b32cf86")
478 api.RegisterMessage((*L3xcUpdate)(nil), "l3xc_update_0787b1d3")
479 api.RegisterMessage((*L3xcUpdateReply)(nil), "l3xc_update_reply_1992deab")
482 // Messages returns list of all messages in this module.
483 func AllMessages() []api.Message {
484 return []api.Message{
486 (*L3xcDelReply)(nil),
489 (*L3xcPluginGetVersion)(nil),
490 (*L3xcPluginGetVersionReply)(nil),
492 (*L3xcUpdateReply)(nil),