1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/sr_mpls.api.json
7 // Package sr_mpls contains generated bindings for API file sr_mpls.api.
15 api "git.fd.io/govpp.git/api"
16 _ "git.fd.io/govpp.git/binapi/interface_types"
17 ip_types "git.fd.io/govpp.git/binapi/ip_types"
18 sr_types "git.fd.io/govpp.git/binapi/sr_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 = 0xaf471151
34 // SrMplsPolicyAdd defines message 'sr_mpls_policy_add'.
35 type SrMplsPolicyAdd struct {
36 Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
37 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
38 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
39 NSegments uint8 `binapi:"u8,name=n_segments" json:"-"`
40 Segments []uint32 `binapi:"u32[n_segments],name=segments" json:"segments,omitempty"`
43 func (m *SrMplsPolicyAdd) Reset() { *m = SrMplsPolicyAdd{} }
44 func (*SrMplsPolicyAdd) GetMessageName() string { return "sr_mpls_policy_add" }
45 func (*SrMplsPolicyAdd) GetCrcString() string { return "a1a70c70" }
46 func (*SrMplsPolicyAdd) GetMessageType() api.MessageType {
47 return api.RequestMessage
50 func (m *SrMplsPolicyAdd) Size() int {
57 size += 1 // m.IsSpray
58 size += 1 // m.NSegments
59 size += 4 * len(m.Segments) // m.Segments
62 func (m *SrMplsPolicyAdd) Marshal(b []byte) ([]byte, error) {
65 buf = codec.NewBuffer(make([]byte, m.Size()))
67 buf = codec.NewBuffer(b)
69 buf.EncodeUint32(uint32(m.Bsid))
70 buf.EncodeUint32(uint32(m.Weight))
71 buf.EncodeBool(m.IsSpray)
72 buf.EncodeUint8(uint8(len(m.Segments)))
73 for i := 0; i < len(m.Segments); i++ {
75 if i < len(m.Segments) {
76 x = uint32(m.Segments[i])
78 buf.EncodeUint32(uint32(x))
80 return buf.Bytes(), nil
82 func (m *SrMplsPolicyAdd) Unmarshal(b []byte) error {
83 buf := codec.NewBuffer(b)
84 m.Bsid = buf.DecodeUint32()
85 m.Weight = buf.DecodeUint32()
86 m.IsSpray = buf.DecodeBool()
87 m.NSegments = buf.DecodeUint8()
88 m.Segments = make([]uint32, m.NSegments)
89 for i := 0; i < len(m.Segments); i++ {
90 m.Segments[i] = buf.DecodeUint32()
95 // SrMplsPolicyAddReply defines message 'sr_mpls_policy_add_reply'.
96 type SrMplsPolicyAddReply struct {
97 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
100 func (m *SrMplsPolicyAddReply) Reset() { *m = SrMplsPolicyAddReply{} }
101 func (*SrMplsPolicyAddReply) GetMessageName() string { return "sr_mpls_policy_add_reply" }
102 func (*SrMplsPolicyAddReply) GetCrcString() string { return "e8d4e804" }
103 func (*SrMplsPolicyAddReply) GetMessageType() api.MessageType {
104 return api.ReplyMessage
107 func (m *SrMplsPolicyAddReply) Size() int {
112 size += 4 // m.Retval
115 func (m *SrMplsPolicyAddReply) Marshal(b []byte) ([]byte, error) {
116 var buf *codec.Buffer
118 buf = codec.NewBuffer(make([]byte, m.Size()))
120 buf = codec.NewBuffer(b)
122 buf.EncodeUint32(uint32(m.Retval))
123 return buf.Bytes(), nil
125 func (m *SrMplsPolicyAddReply) Unmarshal(b []byte) error {
126 buf := codec.NewBuffer(b)
127 m.Retval = int32(buf.DecodeUint32())
131 // SrMplsPolicyAssignEndpointColor defines message 'sr_mpls_policy_assign_endpoint_color'.
132 type SrMplsPolicyAssignEndpointColor struct {
133 Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
134 Endpoint ip_types.Address `binapi:"address,name=endpoint" json:"endpoint,omitempty"`
135 Color uint32 `binapi:"u32,name=color" json:"color,omitempty"`
138 func (m *SrMplsPolicyAssignEndpointColor) Reset() { *m = SrMplsPolicyAssignEndpointColor{} }
139 func (*SrMplsPolicyAssignEndpointColor) GetMessageName() string {
140 return "sr_mpls_policy_assign_endpoint_color"
142 func (*SrMplsPolicyAssignEndpointColor) GetCrcString() string { return "5e1c5c13" }
143 func (*SrMplsPolicyAssignEndpointColor) GetMessageType() api.MessageType {
144 return api.RequestMessage
147 func (m *SrMplsPolicyAssignEndpointColor) Size() int {
153 size += 1 // m.Endpoint.Af
154 size += 1 * 16 // m.Endpoint.Un
158 func (m *SrMplsPolicyAssignEndpointColor) Marshal(b []byte) ([]byte, error) {
159 var buf *codec.Buffer
161 buf = codec.NewBuffer(make([]byte, m.Size()))
163 buf = codec.NewBuffer(b)
165 buf.EncodeUint32(uint32(m.Bsid))
166 buf.EncodeUint8(uint8(m.Endpoint.Af))
167 buf.EncodeBytes(m.Endpoint.Un.XXX_UnionData[:], 0)
168 buf.EncodeUint32(uint32(m.Color))
169 return buf.Bytes(), nil
171 func (m *SrMplsPolicyAssignEndpointColor) Unmarshal(b []byte) error {
172 buf := codec.NewBuffer(b)
173 m.Bsid = buf.DecodeUint32()
174 m.Endpoint.Af = ip_types.AddressFamily(buf.DecodeUint8())
175 copy(m.Endpoint.Un.XXX_UnionData[:], buf.DecodeBytes(16))
176 m.Color = buf.DecodeUint32()
180 // SrMplsPolicyAssignEndpointColorReply defines message 'sr_mpls_policy_assign_endpoint_color_reply'.
181 type SrMplsPolicyAssignEndpointColorReply struct {
182 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
185 func (m *SrMplsPolicyAssignEndpointColorReply) Reset() { *m = SrMplsPolicyAssignEndpointColorReply{} }
186 func (*SrMplsPolicyAssignEndpointColorReply) GetMessageName() string {
187 return "sr_mpls_policy_assign_endpoint_color_reply"
189 func (*SrMplsPolicyAssignEndpointColorReply) GetCrcString() string { return "e8d4e804" }
190 func (*SrMplsPolicyAssignEndpointColorReply) GetMessageType() api.MessageType {
191 return api.ReplyMessage
194 func (m *SrMplsPolicyAssignEndpointColorReply) Size() int {
199 size += 4 // m.Retval
202 func (m *SrMplsPolicyAssignEndpointColorReply) Marshal(b []byte) ([]byte, error) {
203 var buf *codec.Buffer
205 buf = codec.NewBuffer(make([]byte, m.Size()))
207 buf = codec.NewBuffer(b)
209 buf.EncodeUint32(uint32(m.Retval))
210 return buf.Bytes(), nil
212 func (m *SrMplsPolicyAssignEndpointColorReply) Unmarshal(b []byte) error {
213 buf := codec.NewBuffer(b)
214 m.Retval = int32(buf.DecodeUint32())
218 // SrMplsPolicyDel defines message 'sr_mpls_policy_del'.
219 type SrMplsPolicyDel struct {
220 Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
223 func (m *SrMplsPolicyDel) Reset() { *m = SrMplsPolicyDel{} }
224 func (*SrMplsPolicyDel) GetMessageName() string { return "sr_mpls_policy_del" }
225 func (*SrMplsPolicyDel) GetCrcString() string { return "e29d34fa" }
226 func (*SrMplsPolicyDel) GetMessageType() api.MessageType {
227 return api.RequestMessage
230 func (m *SrMplsPolicyDel) Size() int {
238 func (m *SrMplsPolicyDel) Marshal(b []byte) ([]byte, error) {
239 var buf *codec.Buffer
241 buf = codec.NewBuffer(make([]byte, m.Size()))
243 buf = codec.NewBuffer(b)
245 buf.EncodeUint32(uint32(m.Bsid))
246 return buf.Bytes(), nil
248 func (m *SrMplsPolicyDel) Unmarshal(b []byte) error {
249 buf := codec.NewBuffer(b)
250 m.Bsid = buf.DecodeUint32()
254 // SrMplsPolicyDelReply defines message 'sr_mpls_policy_del_reply'.
255 type SrMplsPolicyDelReply struct {
256 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
259 func (m *SrMplsPolicyDelReply) Reset() { *m = SrMplsPolicyDelReply{} }
260 func (*SrMplsPolicyDelReply) GetMessageName() string { return "sr_mpls_policy_del_reply" }
261 func (*SrMplsPolicyDelReply) GetCrcString() string { return "e8d4e804" }
262 func (*SrMplsPolicyDelReply) GetMessageType() api.MessageType {
263 return api.ReplyMessage
266 func (m *SrMplsPolicyDelReply) Size() int {
271 size += 4 // m.Retval
274 func (m *SrMplsPolicyDelReply) Marshal(b []byte) ([]byte, error) {
275 var buf *codec.Buffer
277 buf = codec.NewBuffer(make([]byte, m.Size()))
279 buf = codec.NewBuffer(b)
281 buf.EncodeUint32(uint32(m.Retval))
282 return buf.Bytes(), nil
284 func (m *SrMplsPolicyDelReply) Unmarshal(b []byte) error {
285 buf := codec.NewBuffer(b)
286 m.Retval = int32(buf.DecodeUint32())
290 // SrMplsPolicyMod defines message 'sr_mpls_policy_mod'.
291 type SrMplsPolicyMod struct {
292 Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
293 Operation sr_types.SrPolicyOp `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"`
294 SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
295 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
296 NSegments uint8 `binapi:"u8,name=n_segments" json:"-"`
297 Segments []uint32 `binapi:"u32[n_segments],name=segments" json:"segments,omitempty"`
300 func (m *SrMplsPolicyMod) Reset() { *m = SrMplsPolicyMod{} }
301 func (*SrMplsPolicyMod) GetMessageName() string { return "sr_mpls_policy_mod" }
302 func (*SrMplsPolicyMod) GetCrcString() string { return "88482c17" }
303 func (*SrMplsPolicyMod) GetMessageType() api.MessageType {
304 return api.RequestMessage
307 func (m *SrMplsPolicyMod) Size() int {
313 size += 1 // m.Operation
314 size += 4 // m.SlIndex
315 size += 4 // m.Weight
316 size += 1 // m.NSegments
317 size += 4 * len(m.Segments) // m.Segments
320 func (m *SrMplsPolicyMod) Marshal(b []byte) ([]byte, error) {
321 var buf *codec.Buffer
323 buf = codec.NewBuffer(make([]byte, m.Size()))
325 buf = codec.NewBuffer(b)
327 buf.EncodeUint32(uint32(m.Bsid))
328 buf.EncodeUint8(uint8(m.Operation))
329 buf.EncodeUint32(uint32(m.SlIndex))
330 buf.EncodeUint32(uint32(m.Weight))
331 buf.EncodeUint8(uint8(len(m.Segments)))
332 for i := 0; i < len(m.Segments); i++ {
334 if i < len(m.Segments) {
335 x = uint32(m.Segments[i])
337 buf.EncodeUint32(uint32(x))
339 return buf.Bytes(), nil
341 func (m *SrMplsPolicyMod) Unmarshal(b []byte) error {
342 buf := codec.NewBuffer(b)
343 m.Bsid = buf.DecodeUint32()
344 m.Operation = sr_types.SrPolicyOp(buf.DecodeUint8())
345 m.SlIndex = buf.DecodeUint32()
346 m.Weight = buf.DecodeUint32()
347 m.NSegments = buf.DecodeUint8()
348 m.Segments = make([]uint32, m.NSegments)
349 for i := 0; i < len(m.Segments); i++ {
350 m.Segments[i] = buf.DecodeUint32()
355 // SrMplsPolicyModReply defines message 'sr_mpls_policy_mod_reply'.
356 type SrMplsPolicyModReply struct {
357 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
360 func (m *SrMplsPolicyModReply) Reset() { *m = SrMplsPolicyModReply{} }
361 func (*SrMplsPolicyModReply) GetMessageName() string { return "sr_mpls_policy_mod_reply" }
362 func (*SrMplsPolicyModReply) GetCrcString() string { return "e8d4e804" }
363 func (*SrMplsPolicyModReply) GetMessageType() api.MessageType {
364 return api.ReplyMessage
367 func (m *SrMplsPolicyModReply) Size() int {
372 size += 4 // m.Retval
375 func (m *SrMplsPolicyModReply) Marshal(b []byte) ([]byte, error) {
376 var buf *codec.Buffer
378 buf = codec.NewBuffer(make([]byte, m.Size()))
380 buf = codec.NewBuffer(b)
382 buf.EncodeUint32(uint32(m.Retval))
383 return buf.Bytes(), nil
385 func (m *SrMplsPolicyModReply) Unmarshal(b []byte) error {
386 buf := codec.NewBuffer(b)
387 m.Retval = int32(buf.DecodeUint32())
391 // SrMplsSteeringAddDel defines message 'sr_mpls_steering_add_del'.
392 type SrMplsSteeringAddDel struct {
393 IsDel bool `binapi:"bool,name=is_del,default=%!s(bool=false)" json:"is_del,omitempty"`
394 Bsid uint32 `binapi:"u32,name=bsid" json:"bsid,omitempty"`
395 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
396 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
397 MaskWidth uint32 `binapi:"u32,name=mask_width" json:"mask_width,omitempty"`
398 NextHop ip_types.Address `binapi:"address,name=next_hop" json:"next_hop,omitempty"`
399 Color uint32 `binapi:"u32,name=color" json:"color,omitempty"`
400 CoBits uint8 `binapi:"u8,name=co_bits" json:"co_bits,omitempty"`
401 VPNLabel uint32 `binapi:"u32,name=vpn_label" json:"vpn_label,omitempty"`
404 func (m *SrMplsSteeringAddDel) Reset() { *m = SrMplsSteeringAddDel{} }
405 func (*SrMplsSteeringAddDel) GetMessageName() string { return "sr_mpls_steering_add_del" }
406 func (*SrMplsSteeringAddDel) GetCrcString() string { return "7d1b0a0b" }
407 func (*SrMplsSteeringAddDel) GetMessageType() api.MessageType {
408 return api.RequestMessage
411 func (m *SrMplsSteeringAddDel) Size() int {
418 size += 4 // m.TableID
419 size += 1 // m.Prefix.Address.Af
420 size += 1 * 16 // m.Prefix.Address.Un
421 size += 1 // m.Prefix.Len
422 size += 4 // m.MaskWidth
423 size += 1 // m.NextHop.Af
424 size += 1 * 16 // m.NextHop.Un
426 size += 1 // m.CoBits
427 size += 4 // m.VPNLabel
430 func (m *SrMplsSteeringAddDel) Marshal(b []byte) ([]byte, error) {
431 var buf *codec.Buffer
433 buf = codec.NewBuffer(make([]byte, m.Size()))
435 buf = codec.NewBuffer(b)
437 buf.EncodeBool(m.IsDel)
438 buf.EncodeUint32(uint32(m.Bsid))
439 buf.EncodeUint32(uint32(m.TableID))
440 buf.EncodeUint8(uint8(m.Prefix.Address.Af))
441 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0)
442 buf.EncodeUint8(uint8(m.Prefix.Len))
443 buf.EncodeUint32(uint32(m.MaskWidth))
444 buf.EncodeUint8(uint8(m.NextHop.Af))
445 buf.EncodeBytes(m.NextHop.Un.XXX_UnionData[:], 0)
446 buf.EncodeUint32(uint32(m.Color))
447 buf.EncodeUint8(uint8(m.CoBits))
448 buf.EncodeUint32(uint32(m.VPNLabel))
449 return buf.Bytes(), nil
451 func (m *SrMplsSteeringAddDel) Unmarshal(b []byte) error {
452 buf := codec.NewBuffer(b)
453 m.IsDel = buf.DecodeBool()
454 m.Bsid = buf.DecodeUint32()
455 m.TableID = buf.DecodeUint32()
456 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
457 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
458 m.Prefix.Len = buf.DecodeUint8()
459 m.MaskWidth = buf.DecodeUint32()
460 m.NextHop.Af = ip_types.AddressFamily(buf.DecodeUint8())
461 copy(m.NextHop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
462 m.Color = buf.DecodeUint32()
463 m.CoBits = buf.DecodeUint8()
464 m.VPNLabel = buf.DecodeUint32()
468 // SrMplsSteeringAddDelReply defines message 'sr_mpls_steering_add_del_reply'.
469 type SrMplsSteeringAddDelReply struct {
470 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
473 func (m *SrMplsSteeringAddDelReply) Reset() { *m = SrMplsSteeringAddDelReply{} }
474 func (*SrMplsSteeringAddDelReply) GetMessageName() string { return "sr_mpls_steering_add_del_reply" }
475 func (*SrMplsSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
476 func (*SrMplsSteeringAddDelReply) GetMessageType() api.MessageType {
477 return api.ReplyMessage
480 func (m *SrMplsSteeringAddDelReply) Size() int {
485 size += 4 // m.Retval
488 func (m *SrMplsSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
489 var buf *codec.Buffer
491 buf = codec.NewBuffer(make([]byte, m.Size()))
493 buf = codec.NewBuffer(b)
495 buf.EncodeUint32(uint32(m.Retval))
496 return buf.Bytes(), nil
498 func (m *SrMplsSteeringAddDelReply) Unmarshal(b []byte) error {
499 buf := codec.NewBuffer(b)
500 m.Retval = int32(buf.DecodeUint32())
504 func init() { file_sr_mpls_binapi_init() }
505 func file_sr_mpls_binapi_init() {
506 api.RegisterMessage((*SrMplsPolicyAdd)(nil), "sr_mpls_policy_add_a1a70c70")
507 api.RegisterMessage((*SrMplsPolicyAddReply)(nil), "sr_mpls_policy_add_reply_e8d4e804")
508 api.RegisterMessage((*SrMplsPolicyAssignEndpointColor)(nil), "sr_mpls_policy_assign_endpoint_color_5e1c5c13")
509 api.RegisterMessage((*SrMplsPolicyAssignEndpointColorReply)(nil), "sr_mpls_policy_assign_endpoint_color_reply_e8d4e804")
510 api.RegisterMessage((*SrMplsPolicyDel)(nil), "sr_mpls_policy_del_e29d34fa")
511 api.RegisterMessage((*SrMplsPolicyDelReply)(nil), "sr_mpls_policy_del_reply_e8d4e804")
512 api.RegisterMessage((*SrMplsPolicyMod)(nil), "sr_mpls_policy_mod_88482c17")
513 api.RegisterMessage((*SrMplsPolicyModReply)(nil), "sr_mpls_policy_mod_reply_e8d4e804")
514 api.RegisterMessage((*SrMplsSteeringAddDel)(nil), "sr_mpls_steering_add_del_7d1b0a0b")
515 api.RegisterMessage((*SrMplsSteeringAddDelReply)(nil), "sr_mpls_steering_add_del_reply_e8d4e804")
518 // Messages returns list of all messages in this module.
519 func AllMessages() []api.Message {
520 return []api.Message{
521 (*SrMplsPolicyAdd)(nil),
522 (*SrMplsPolicyAddReply)(nil),
523 (*SrMplsPolicyAssignEndpointColor)(nil),
524 (*SrMplsPolicyAssignEndpointColorReply)(nil),
525 (*SrMplsPolicyDel)(nil),
526 (*SrMplsPolicyDelReply)(nil),
527 (*SrMplsPolicyMod)(nil),
528 (*SrMplsPolicyModReply)(nil),
529 (*SrMplsSteeringAddDel)(nil),
530 (*SrMplsSteeringAddDelReply)(nil),