1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
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 = 0x520bfc6e
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() (size int) {
60 size += 4 // m.SwIfIndex
64 func (m *L3xcDel) Marshal(b []byte) ([]byte, error) {
66 b = make([]byte, m.Size())
68 buf := codec.NewBuffer(b)
69 buf.EncodeUint32(uint32(m.SwIfIndex))
70 buf.EncodeBool(m.IsIP6)
71 return buf.Bytes(), nil
73 func (m *L3xcDel) Unmarshal(b []byte) error {
74 buf := codec.NewBuffer(b)
75 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
76 m.IsIP6 = buf.DecodeBool()
80 // L3xcDelReply defines message 'l3xc_del_reply'.
81 type L3xcDelReply struct {
82 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
85 func (m *L3xcDelReply) Reset() { *m = L3xcDelReply{} }
86 func (*L3xcDelReply) GetMessageName() string { return "l3xc_del_reply" }
87 func (*L3xcDelReply) GetCrcString() string { return "e8d4e804" }
88 func (*L3xcDelReply) GetMessageType() api.MessageType {
89 return api.ReplyMessage
92 func (m *L3xcDelReply) Size() (size int) {
99 func (m *L3xcDelReply) Marshal(b []byte) ([]byte, error) {
101 b = make([]byte, m.Size())
103 buf := codec.NewBuffer(b)
104 buf.EncodeInt32(m.Retval)
105 return buf.Bytes(), nil
107 func (m *L3xcDelReply) Unmarshal(b []byte) error {
108 buf := codec.NewBuffer(b)
109 m.Retval = buf.DecodeInt32()
113 // L3xcDetails defines message 'l3xc_details'.
114 type L3xcDetails struct {
115 L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"`
118 func (m *L3xcDetails) Reset() { *m = L3xcDetails{} }
119 func (*L3xcDetails) GetMessageName() string { return "l3xc_details" }
120 func (*L3xcDetails) GetCrcString() string { return "bc5bf852" }
121 func (*L3xcDetails) GetMessageType() api.MessageType {
122 return api.ReplyMessage
125 func (m *L3xcDetails) Size() (size int) {
129 size += 4 // m.L3xc.SwIfIndex
130 size += 1 // m.L3xc.IsIP6
131 size += 1 // m.L3xc.NPaths
132 for j2 := 0; j2 < len(m.L3xc.Paths); j2++ {
133 var s2 fib_types.FibPath
135 if j2 < len(m.L3xc.Paths) {
136 s2 = m.L3xc.Paths[j2]
138 size += 4 // s2.SwIfIndex
139 size += 4 // s2.TableID
140 size += 4 // s2.RpfID
141 size += 1 // s2.Weight
142 size += 1 // s2.Preference
144 size += 4 // s2.Flags
145 size += 4 // s2.Proto
146 size += 1 * 16 // s2.Nh.Address
147 size += 4 // s2.Nh.ViaLabel
148 size += 4 // s2.Nh.ObjID
149 size += 4 // s2.Nh.ClassifyTableIndex
150 size += 1 // s2.NLabels
151 for j3 := 0; j3 < 16; j3++ {
152 size += 1 // s2.LabelStack[j3].IsUniform
153 size += 4 // s2.LabelStack[j3].Label
154 size += 1 // s2.LabelStack[j3].TTL
155 size += 1 // s2.LabelStack[j3].Exp
160 func (m *L3xcDetails) Marshal(b []byte) ([]byte, error) {
162 b = make([]byte, m.Size())
164 buf := codec.NewBuffer(b)
165 buf.EncodeUint32(uint32(m.L3xc.SwIfIndex))
166 buf.EncodeBool(m.L3xc.IsIP6)
167 buf.EncodeUint8(uint8(len(m.L3xc.Paths)))
168 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
169 var v1 fib_types.FibPath // Paths
170 if j1 < len(m.L3xc.Paths) {
171 v1 = m.L3xc.Paths[j1]
173 buf.EncodeUint32(v1.SwIfIndex)
174 buf.EncodeUint32(v1.TableID)
175 buf.EncodeUint32(v1.RpfID)
176 buf.EncodeUint8(v1.Weight)
177 buf.EncodeUint8(v1.Preference)
178 buf.EncodeUint32(uint32(v1.Type))
179 buf.EncodeUint32(uint32(v1.Flags))
180 buf.EncodeUint32(uint32(v1.Proto))
181 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
182 buf.EncodeUint32(v1.Nh.ViaLabel)
183 buf.EncodeUint32(v1.Nh.ObjID)
184 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
185 buf.EncodeUint8(v1.NLabels)
186 for j2 := 0; j2 < 16; j2++ {
187 buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
188 buf.EncodeUint32(v1.LabelStack[j2].Label)
189 buf.EncodeUint8(v1.LabelStack[j2].TTL)
190 buf.EncodeUint8(v1.LabelStack[j2].Exp)
193 return buf.Bytes(), nil
195 func (m *L3xcDetails) Unmarshal(b []byte) error {
196 buf := codec.NewBuffer(b)
197 m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
198 m.L3xc.IsIP6 = buf.DecodeBool()
199 m.L3xc.NPaths = buf.DecodeUint8()
200 m.L3xc.Paths = make([]fib_types.FibPath, m.L3xc.NPaths)
201 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
202 m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32()
203 m.L3xc.Paths[j1].TableID = buf.DecodeUint32()
204 m.L3xc.Paths[j1].RpfID = buf.DecodeUint32()
205 m.L3xc.Paths[j1].Weight = buf.DecodeUint8()
206 m.L3xc.Paths[j1].Preference = buf.DecodeUint8()
207 m.L3xc.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
208 m.L3xc.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
209 m.L3xc.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
210 copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
211 m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
212 m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32()
213 m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
214 m.L3xc.Paths[j1].NLabels = buf.DecodeUint8()
215 for j2 := 0; j2 < 16; j2++ {
216 m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
217 m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
218 m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
219 m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
225 // L3xcDump defines message 'l3xc_dump'.
226 type L3xcDump struct {
227 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
230 func (m *L3xcDump) Reset() { *m = L3xcDump{} }
231 func (*L3xcDump) GetMessageName() string { return "l3xc_dump" }
232 func (*L3xcDump) GetCrcString() string { return "f9e6675e" }
233 func (*L3xcDump) GetMessageType() api.MessageType {
234 return api.RequestMessage
237 func (m *L3xcDump) Size() (size int) {
241 size += 4 // m.SwIfIndex
244 func (m *L3xcDump) Marshal(b []byte) ([]byte, error) {
246 b = make([]byte, m.Size())
248 buf := codec.NewBuffer(b)
249 buf.EncodeUint32(uint32(m.SwIfIndex))
250 return buf.Bytes(), nil
252 func (m *L3xcDump) Unmarshal(b []byte) error {
253 buf := codec.NewBuffer(b)
254 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
258 // L3xcPluginGetVersion defines message 'l3xc_plugin_get_version'.
259 type L3xcPluginGetVersion struct{}
261 func (m *L3xcPluginGetVersion) Reset() { *m = L3xcPluginGetVersion{} }
262 func (*L3xcPluginGetVersion) GetMessageName() string { return "l3xc_plugin_get_version" }
263 func (*L3xcPluginGetVersion) GetCrcString() string { return "51077d14" }
264 func (*L3xcPluginGetVersion) GetMessageType() api.MessageType {
265 return api.RequestMessage
268 func (m *L3xcPluginGetVersion) Size() (size int) {
274 func (m *L3xcPluginGetVersion) Marshal(b []byte) ([]byte, error) {
276 b = make([]byte, m.Size())
278 buf := codec.NewBuffer(b)
279 return buf.Bytes(), nil
281 func (m *L3xcPluginGetVersion) Unmarshal(b []byte) error {
285 // L3xcPluginGetVersionReply defines message 'l3xc_plugin_get_version_reply'.
286 type L3xcPluginGetVersionReply struct {
287 Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
288 Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
291 func (m *L3xcPluginGetVersionReply) Reset() { *m = L3xcPluginGetVersionReply{} }
292 func (*L3xcPluginGetVersionReply) GetMessageName() string { return "l3xc_plugin_get_version_reply" }
293 func (*L3xcPluginGetVersionReply) GetCrcString() string { return "9b32cf86" }
294 func (*L3xcPluginGetVersionReply) GetMessageType() api.MessageType {
295 return api.ReplyMessage
298 func (m *L3xcPluginGetVersionReply) Size() (size int) {
306 func (m *L3xcPluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
308 b = make([]byte, m.Size())
310 buf := codec.NewBuffer(b)
311 buf.EncodeUint32(m.Major)
312 buf.EncodeUint32(m.Minor)
313 return buf.Bytes(), nil
315 func (m *L3xcPluginGetVersionReply) Unmarshal(b []byte) error {
316 buf := codec.NewBuffer(b)
317 m.Major = buf.DecodeUint32()
318 m.Minor = buf.DecodeUint32()
322 // L3xcUpdate defines message 'l3xc_update'.
323 type L3xcUpdate struct {
324 L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"`
327 func (m *L3xcUpdate) Reset() { *m = L3xcUpdate{} }
328 func (*L3xcUpdate) GetMessageName() string { return "l3xc_update" }
329 func (*L3xcUpdate) GetCrcString() string { return "e96aabdf" }
330 func (*L3xcUpdate) GetMessageType() api.MessageType {
331 return api.RequestMessage
334 func (m *L3xcUpdate) Size() (size int) {
338 size += 4 // m.L3xc.SwIfIndex
339 size += 1 // m.L3xc.IsIP6
340 size += 1 // m.L3xc.NPaths
341 for j2 := 0; j2 < len(m.L3xc.Paths); j2++ {
342 var s2 fib_types.FibPath
344 if j2 < len(m.L3xc.Paths) {
345 s2 = m.L3xc.Paths[j2]
347 size += 4 // s2.SwIfIndex
348 size += 4 // s2.TableID
349 size += 4 // s2.RpfID
350 size += 1 // s2.Weight
351 size += 1 // s2.Preference
353 size += 4 // s2.Flags
354 size += 4 // s2.Proto
355 size += 1 * 16 // s2.Nh.Address
356 size += 4 // s2.Nh.ViaLabel
357 size += 4 // s2.Nh.ObjID
358 size += 4 // s2.Nh.ClassifyTableIndex
359 size += 1 // s2.NLabels
360 for j3 := 0; j3 < 16; j3++ {
361 size += 1 // s2.LabelStack[j3].IsUniform
362 size += 4 // s2.LabelStack[j3].Label
363 size += 1 // s2.LabelStack[j3].TTL
364 size += 1 // s2.LabelStack[j3].Exp
369 func (m *L3xcUpdate) Marshal(b []byte) ([]byte, error) {
371 b = make([]byte, m.Size())
373 buf := codec.NewBuffer(b)
374 buf.EncodeUint32(uint32(m.L3xc.SwIfIndex))
375 buf.EncodeBool(m.L3xc.IsIP6)
376 buf.EncodeUint8(uint8(len(m.L3xc.Paths)))
377 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
378 var v1 fib_types.FibPath // Paths
379 if j1 < len(m.L3xc.Paths) {
380 v1 = m.L3xc.Paths[j1]
382 buf.EncodeUint32(v1.SwIfIndex)
383 buf.EncodeUint32(v1.TableID)
384 buf.EncodeUint32(v1.RpfID)
385 buf.EncodeUint8(v1.Weight)
386 buf.EncodeUint8(v1.Preference)
387 buf.EncodeUint32(uint32(v1.Type))
388 buf.EncodeUint32(uint32(v1.Flags))
389 buf.EncodeUint32(uint32(v1.Proto))
390 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
391 buf.EncodeUint32(v1.Nh.ViaLabel)
392 buf.EncodeUint32(v1.Nh.ObjID)
393 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
394 buf.EncodeUint8(v1.NLabels)
395 for j2 := 0; j2 < 16; j2++ {
396 buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
397 buf.EncodeUint32(v1.LabelStack[j2].Label)
398 buf.EncodeUint8(v1.LabelStack[j2].TTL)
399 buf.EncodeUint8(v1.LabelStack[j2].Exp)
402 return buf.Bytes(), nil
404 func (m *L3xcUpdate) Unmarshal(b []byte) error {
405 buf := codec.NewBuffer(b)
406 m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
407 m.L3xc.IsIP6 = buf.DecodeBool()
408 m.L3xc.NPaths = buf.DecodeUint8()
409 m.L3xc.Paths = make([]fib_types.FibPath, m.L3xc.NPaths)
410 for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
411 m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32()
412 m.L3xc.Paths[j1].TableID = buf.DecodeUint32()
413 m.L3xc.Paths[j1].RpfID = buf.DecodeUint32()
414 m.L3xc.Paths[j1].Weight = buf.DecodeUint8()
415 m.L3xc.Paths[j1].Preference = buf.DecodeUint8()
416 m.L3xc.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
417 m.L3xc.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
418 m.L3xc.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
419 copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
420 m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
421 m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32()
422 m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
423 m.L3xc.Paths[j1].NLabels = buf.DecodeUint8()
424 for j2 := 0; j2 < 16; j2++ {
425 m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
426 m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
427 m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
428 m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
434 // L3xcUpdateReply defines message 'l3xc_update_reply'.
435 type L3xcUpdateReply struct {
436 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
437 StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
440 func (m *L3xcUpdateReply) Reset() { *m = L3xcUpdateReply{} }
441 func (*L3xcUpdateReply) GetMessageName() string { return "l3xc_update_reply" }
442 func (*L3xcUpdateReply) GetCrcString() string { return "1992deab" }
443 func (*L3xcUpdateReply) GetMessageType() api.MessageType {
444 return api.ReplyMessage
447 func (m *L3xcUpdateReply) Size() (size int) {
451 size += 4 // m.Retval
452 size += 4 // m.StatsIndex
455 func (m *L3xcUpdateReply) Marshal(b []byte) ([]byte, error) {
457 b = make([]byte, m.Size())
459 buf := codec.NewBuffer(b)
460 buf.EncodeInt32(m.Retval)
461 buf.EncodeUint32(m.StatsIndex)
462 return buf.Bytes(), nil
464 func (m *L3xcUpdateReply) Unmarshal(b []byte) error {
465 buf := codec.NewBuffer(b)
466 m.Retval = buf.DecodeInt32()
467 m.StatsIndex = buf.DecodeUint32()
471 func init() { file_l3xc_binapi_init() }
472 func file_l3xc_binapi_init() {
473 api.RegisterMessage((*L3xcDel)(nil), "l3xc_del_e7dbef91")
474 api.RegisterMessage((*L3xcDelReply)(nil), "l3xc_del_reply_e8d4e804")
475 api.RegisterMessage((*L3xcDetails)(nil), "l3xc_details_bc5bf852")
476 api.RegisterMessage((*L3xcDump)(nil), "l3xc_dump_f9e6675e")
477 api.RegisterMessage((*L3xcPluginGetVersion)(nil), "l3xc_plugin_get_version_51077d14")
478 api.RegisterMessage((*L3xcPluginGetVersionReply)(nil), "l3xc_plugin_get_version_reply_9b32cf86")
479 api.RegisterMessage((*L3xcUpdate)(nil), "l3xc_update_e96aabdf")
480 api.RegisterMessage((*L3xcUpdateReply)(nil), "l3xc_update_reply_1992deab")
483 // Messages returns list of all messages in this module.
484 func AllMessages() []api.Message {
485 return []api.Message{
487 (*L3xcDelReply)(nil),
490 (*L3xcPluginGetVersion)(nil),
491 (*L3xcPluginGetVersionReply)(nil),
493 (*L3xcUpdateReply)(nil),