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.api.json
7 // Package sr contains generated bindings for API file sr.api.
16 api "git.fd.io/govpp.git/api"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 ip_types "git.fd.io/govpp.git/binapi/ip_types"
19 sr_types "git.fd.io/govpp.git/binapi/sr_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 = 0xd85c77ca
35 // Srv6SidList defines type 'srv6_sid_list'.
36 type Srv6SidList struct {
37 NumSids uint8 `binapi:"u8,name=num_sids" json:"num_sids,omitempty"`
38 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
39 Sids [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty"`
42 // SrLocalsidAddDel defines message 'sr_localsid_add_del'.
43 type SrLocalsidAddDel struct {
44 IsDel bool `binapi:"bool,name=is_del,default=%!s(bool=false)" json:"is_del,omitempty"`
45 Localsid ip_types.IP6Address `binapi:"ip6_address,name=localsid" json:"localsid,omitempty"`
46 EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
47 Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
48 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
49 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
50 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
51 NhAddr ip_types.Address `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"`
54 func (m *SrLocalsidAddDel) Reset() { *m = SrLocalsidAddDel{} }
55 func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" }
56 func (*SrLocalsidAddDel) GetCrcString() string { return "26fa3309" }
57 func (*SrLocalsidAddDel) GetMessageType() api.MessageType {
58 return api.RequestMessage
61 func (m *SrLocalsidAddDel) Size() int {
67 size += 1 * 16 // m.Localsid
69 size += 1 // m.Behavior
70 size += 4 // m.SwIfIndex
71 size += 4 // m.VlanIndex
72 size += 4 // m.FibTable
73 size += 1 // m.NhAddr.Af
74 size += 1 * 16 // m.NhAddr.Un
77 func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) {
80 buf = codec.NewBuffer(make([]byte, m.Size()))
82 buf = codec.NewBuffer(b)
84 buf.EncodeBool(m.IsDel)
85 buf.EncodeBytes(m.Localsid[:], 16)
86 buf.EncodeBool(m.EndPsp)
87 buf.EncodeUint8(uint8(m.Behavior))
88 buf.EncodeUint32(uint32(m.SwIfIndex))
89 buf.EncodeUint32(uint32(m.VlanIndex))
90 buf.EncodeUint32(uint32(m.FibTable))
91 buf.EncodeUint8(uint8(m.NhAddr.Af))
92 buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 0)
93 return buf.Bytes(), nil
95 func (m *SrLocalsidAddDel) Unmarshal(b []byte) error {
96 buf := codec.NewBuffer(b)
97 m.IsDel = buf.DecodeBool()
98 copy(m.Localsid[:], buf.DecodeBytes(16))
99 m.EndPsp = buf.DecodeBool()
100 m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
101 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
102 m.VlanIndex = buf.DecodeUint32()
103 m.FibTable = buf.DecodeUint32()
104 m.NhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
105 copy(m.NhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
109 // SrLocalsidAddDelReply defines message 'sr_localsid_add_del_reply'.
110 type SrLocalsidAddDelReply struct {
111 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
114 func (m *SrLocalsidAddDelReply) Reset() { *m = SrLocalsidAddDelReply{} }
115 func (*SrLocalsidAddDelReply) GetMessageName() string { return "sr_localsid_add_del_reply" }
116 func (*SrLocalsidAddDelReply) GetCrcString() string { return "e8d4e804" }
117 func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType {
118 return api.ReplyMessage
121 func (m *SrLocalsidAddDelReply) Size() int {
126 size += 4 // m.Retval
129 func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) {
130 var buf *codec.Buffer
132 buf = codec.NewBuffer(make([]byte, m.Size()))
134 buf = codec.NewBuffer(b)
136 buf.EncodeUint32(uint32(m.Retval))
137 return buf.Bytes(), nil
139 func (m *SrLocalsidAddDelReply) Unmarshal(b []byte) error {
140 buf := codec.NewBuffer(b)
141 m.Retval = int32(buf.DecodeUint32())
145 // SrLocalsidsDetails defines message 'sr_localsids_details'.
146 type SrLocalsidsDetails struct {
147 Addr ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"`
148 EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
149 Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
150 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
151 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
152 XconnectNhAddr ip_types.Address `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"`
153 XconnectIfaceOrVrfTable uint32 `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"`
156 func (m *SrLocalsidsDetails) Reset() { *m = SrLocalsidsDetails{} }
157 func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" }
158 func (*SrLocalsidsDetails) GetCrcString() string { return "6a6c0265" }
159 func (*SrLocalsidsDetails) GetMessageType() api.MessageType {
160 return api.ReplyMessage
163 func (m *SrLocalsidsDetails) Size() int {
168 size += 1 * 16 // m.Addr
169 size += 1 // m.EndPsp
170 size += 1 // m.Behavior
171 size += 4 // m.FibTable
172 size += 4 // m.VlanIndex
173 size += 1 // m.XconnectNhAddr.Af
174 size += 1 * 16 // m.XconnectNhAddr.Un
175 size += 4 // m.XconnectIfaceOrVrfTable
178 func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) {
179 var buf *codec.Buffer
181 buf = codec.NewBuffer(make([]byte, m.Size()))
183 buf = codec.NewBuffer(b)
185 buf.EncodeBytes(m.Addr[:], 16)
186 buf.EncodeBool(m.EndPsp)
187 buf.EncodeUint8(uint8(m.Behavior))
188 buf.EncodeUint32(uint32(m.FibTable))
189 buf.EncodeUint32(uint32(m.VlanIndex))
190 buf.EncodeUint8(uint8(m.XconnectNhAddr.Af))
191 buf.EncodeBytes(m.XconnectNhAddr.Un.XXX_UnionData[:], 0)
192 buf.EncodeUint32(uint32(m.XconnectIfaceOrVrfTable))
193 return buf.Bytes(), nil
195 func (m *SrLocalsidsDetails) Unmarshal(b []byte) error {
196 buf := codec.NewBuffer(b)
197 copy(m.Addr[:], buf.DecodeBytes(16))
198 m.EndPsp = buf.DecodeBool()
199 m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
200 m.FibTable = buf.DecodeUint32()
201 m.VlanIndex = buf.DecodeUint32()
202 m.XconnectNhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
203 copy(m.XconnectNhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
204 m.XconnectIfaceOrVrfTable = buf.DecodeUint32()
208 // SrLocalsidsDump defines message 'sr_localsids_dump'.
209 type SrLocalsidsDump struct{}
211 func (m *SrLocalsidsDump) Reset() { *m = SrLocalsidsDump{} }
212 func (*SrLocalsidsDump) GetMessageName() string { return "sr_localsids_dump" }
213 func (*SrLocalsidsDump) GetCrcString() string { return "51077d14" }
214 func (*SrLocalsidsDump) GetMessageType() api.MessageType {
215 return api.RequestMessage
218 func (m *SrLocalsidsDump) Size() int {
225 func (m *SrLocalsidsDump) Marshal(b []byte) ([]byte, error) {
226 var buf *codec.Buffer
228 buf = codec.NewBuffer(make([]byte, m.Size()))
230 buf = codec.NewBuffer(b)
232 return buf.Bytes(), nil
234 func (m *SrLocalsidsDump) Unmarshal(b []byte) error {
238 // SrPoliciesDetails defines message 'sr_policies_details'.
239 type SrPoliciesDetails struct {
240 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
241 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
242 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
243 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
244 NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"-"`
245 SidLists []Srv6SidList `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
248 func (m *SrPoliciesDetails) Reset() { *m = SrPoliciesDetails{} }
249 func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" }
250 func (*SrPoliciesDetails) GetCrcString() string { return "07ec2d93" }
251 func (*SrPoliciesDetails) GetMessageType() api.MessageType {
252 return api.ReplyMessage
255 func (m *SrPoliciesDetails) Size() int {
260 size += 1 * 16 // m.Bsid
261 size += 1 // m.IsSpray
262 size += 1 // m.IsEncap
263 size += 4 // m.FibTable
264 size += 1 // m.NumSidLists
265 for j1 := 0; j1 < len(m.SidLists); j1++ {
268 if j1 < len(m.SidLists) {
271 size += 1 // s1.NumSids
272 size += 4 // s1.Weight
273 for j2 := 0; j2 < 16; j2++ {
274 var s2 ip_types.IP6Address
276 if j2 < len(s1.Sids) {
284 func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) {
285 var buf *codec.Buffer
287 buf = codec.NewBuffer(make([]byte, m.Size()))
289 buf = codec.NewBuffer(b)
291 buf.EncodeBytes(m.Bsid[:], 16)
292 buf.EncodeBool(m.IsSpray)
293 buf.EncodeBool(m.IsEncap)
294 buf.EncodeUint32(uint32(m.FibTable))
295 buf.EncodeUint8(uint8(len(m.SidLists)))
296 for j0 := 0; j0 < len(m.SidLists); j0++ {
298 if j0 < len(m.SidLists) {
301 buf.EncodeUint8(uint8(v0.NumSids))
302 buf.EncodeUint32(uint32(v0.Weight))
303 for j1 := 0; j1 < 16; j1++ {
304 var v1 ip_types.IP6Address
305 if j1 < len(v0.Sids) {
308 buf.EncodeBytes(v1[:], 16)
311 return buf.Bytes(), nil
313 func (m *SrPoliciesDetails) Unmarshal(b []byte) error {
314 buf := codec.NewBuffer(b)
315 copy(m.Bsid[:], buf.DecodeBytes(16))
316 m.IsSpray = buf.DecodeBool()
317 m.IsEncap = buf.DecodeBool()
318 m.FibTable = buf.DecodeUint32()
319 m.NumSidLists = buf.DecodeUint8()
320 m.SidLists = make([]Srv6SidList, int(m.NumSidLists))
321 for j0 := 0; j0 < len(m.SidLists); j0++ {
322 m.SidLists[j0].NumSids = buf.DecodeUint8()
323 m.SidLists[j0].Weight = buf.DecodeUint32()
324 for j1 := 0; j1 < 16; j1++ {
325 copy(m.SidLists[j0].Sids[j1][:], buf.DecodeBytes(16))
331 // SrPoliciesDump defines message 'sr_policies_dump'.
332 type SrPoliciesDump struct{}
334 func (m *SrPoliciesDump) Reset() { *m = SrPoliciesDump{} }
335 func (*SrPoliciesDump) GetMessageName() string { return "sr_policies_dump" }
336 func (*SrPoliciesDump) GetCrcString() string { return "51077d14" }
337 func (*SrPoliciesDump) GetMessageType() api.MessageType {
338 return api.RequestMessage
341 func (m *SrPoliciesDump) Size() int {
348 func (m *SrPoliciesDump) Marshal(b []byte) ([]byte, error) {
349 var buf *codec.Buffer
351 buf = codec.NewBuffer(make([]byte, m.Size()))
353 buf = codec.NewBuffer(b)
355 return buf.Bytes(), nil
357 func (m *SrPoliciesDump) Unmarshal(b []byte) error {
361 // SrPolicyAdd defines message 'sr_policy_add'.
362 type SrPolicyAdd struct {
363 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
364 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
365 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
366 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
367 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
368 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
371 func (m *SrPolicyAdd) Reset() { *m = SrPolicyAdd{} }
372 func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" }
373 func (*SrPolicyAdd) GetCrcString() string { return "ec79ee6a" }
374 func (*SrPolicyAdd) GetMessageType() api.MessageType {
375 return api.RequestMessage
378 func (m *SrPolicyAdd) Size() int {
383 size += 1 * 16 // m.BsidAddr
384 size += 4 // m.Weight
385 size += 1 // m.IsEncap
386 size += 1 // m.IsSpray
387 size += 4 // m.FibTable
388 size += 1 // m.Sids.NumSids
389 size += 4 // m.Sids.Weight
390 for j2 := 0; j2 < 16; j2++ {
391 var s2 ip_types.IP6Address
393 if j2 < len(m.Sids.Sids) {
400 func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) {
401 var buf *codec.Buffer
403 buf = codec.NewBuffer(make([]byte, m.Size()))
405 buf = codec.NewBuffer(b)
407 buf.EncodeBytes(m.BsidAddr[:], 16)
408 buf.EncodeUint32(uint32(m.Weight))
409 buf.EncodeBool(m.IsEncap)
410 buf.EncodeBool(m.IsSpray)
411 buf.EncodeUint32(uint32(m.FibTable))
412 buf.EncodeUint8(uint8(m.Sids.NumSids))
413 buf.EncodeUint32(uint32(m.Sids.Weight))
414 for j1 := 0; j1 < 16; j1++ {
415 var v1 ip_types.IP6Address
416 if j1 < len(m.Sids.Sids) {
419 buf.EncodeBytes(v1[:], 16)
421 return buf.Bytes(), nil
423 func (m *SrPolicyAdd) Unmarshal(b []byte) error {
424 buf := codec.NewBuffer(b)
425 copy(m.BsidAddr[:], buf.DecodeBytes(16))
426 m.Weight = buf.DecodeUint32()
427 m.IsEncap = buf.DecodeBool()
428 m.IsSpray = buf.DecodeBool()
429 m.FibTable = buf.DecodeUint32()
430 m.Sids.NumSids = buf.DecodeUint8()
431 m.Sids.Weight = buf.DecodeUint32()
432 for j1 := 0; j1 < 16; j1++ {
433 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
438 // SrPolicyAddReply defines message 'sr_policy_add_reply'.
439 type SrPolicyAddReply struct {
440 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
443 func (m *SrPolicyAddReply) Reset() { *m = SrPolicyAddReply{} }
444 func (*SrPolicyAddReply) GetMessageName() string { return "sr_policy_add_reply" }
445 func (*SrPolicyAddReply) GetCrcString() string { return "e8d4e804" }
446 func (*SrPolicyAddReply) GetMessageType() api.MessageType {
447 return api.ReplyMessage
450 func (m *SrPolicyAddReply) Size() int {
455 size += 4 // m.Retval
458 func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) {
459 var buf *codec.Buffer
461 buf = codec.NewBuffer(make([]byte, m.Size()))
463 buf = codec.NewBuffer(b)
465 buf.EncodeUint32(uint32(m.Retval))
466 return buf.Bytes(), nil
468 func (m *SrPolicyAddReply) Unmarshal(b []byte) error {
469 buf := codec.NewBuffer(b)
470 m.Retval = int32(buf.DecodeUint32())
474 // SrPolicyDel defines message 'sr_policy_del'.
475 type SrPolicyDel struct {
476 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
477 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
480 func (m *SrPolicyDel) Reset() { *m = SrPolicyDel{} }
481 func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" }
482 func (*SrPolicyDel) GetCrcString() string { return "cb4d48d5" }
483 func (*SrPolicyDel) GetMessageType() api.MessageType {
484 return api.RequestMessage
487 func (m *SrPolicyDel) Size() int {
492 size += 1 * 16 // m.BsidAddr
493 size += 4 // m.SrPolicyIndex
496 func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) {
497 var buf *codec.Buffer
499 buf = codec.NewBuffer(make([]byte, m.Size()))
501 buf = codec.NewBuffer(b)
503 buf.EncodeBytes(m.BsidAddr[:], 16)
504 buf.EncodeUint32(uint32(m.SrPolicyIndex))
505 return buf.Bytes(), nil
507 func (m *SrPolicyDel) Unmarshal(b []byte) error {
508 buf := codec.NewBuffer(b)
509 copy(m.BsidAddr[:], buf.DecodeBytes(16))
510 m.SrPolicyIndex = buf.DecodeUint32()
514 // SrPolicyDelReply defines message 'sr_policy_del_reply'.
515 type SrPolicyDelReply struct {
516 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
519 func (m *SrPolicyDelReply) Reset() { *m = SrPolicyDelReply{} }
520 func (*SrPolicyDelReply) GetMessageName() string { return "sr_policy_del_reply" }
521 func (*SrPolicyDelReply) GetCrcString() string { return "e8d4e804" }
522 func (*SrPolicyDelReply) GetMessageType() api.MessageType {
523 return api.ReplyMessage
526 func (m *SrPolicyDelReply) Size() int {
531 size += 4 // m.Retval
534 func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) {
535 var buf *codec.Buffer
537 buf = codec.NewBuffer(make([]byte, m.Size()))
539 buf = codec.NewBuffer(b)
541 buf.EncodeUint32(uint32(m.Retval))
542 return buf.Bytes(), nil
544 func (m *SrPolicyDelReply) Unmarshal(b []byte) error {
545 buf := codec.NewBuffer(b)
546 m.Retval = int32(buf.DecodeUint32())
550 // SrPolicyMod defines message 'sr_policy_mod'.
551 type SrPolicyMod struct {
552 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
553 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
554 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
555 Operation sr_types.SrPolicyOp `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"`
556 SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
557 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
558 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
561 func (m *SrPolicyMod) Reset() { *m = SrPolicyMod{} }
562 func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" }
563 func (*SrPolicyMod) GetCrcString() string { return "e531a102" }
564 func (*SrPolicyMod) GetMessageType() api.MessageType {
565 return api.RequestMessage
568 func (m *SrPolicyMod) Size() int {
573 size += 1 * 16 // m.BsidAddr
574 size += 4 // m.SrPolicyIndex
575 size += 4 // m.FibTable
576 size += 1 // m.Operation
577 size += 4 // m.SlIndex
578 size += 4 // m.Weight
579 size += 1 // m.Sids.NumSids
580 size += 4 // m.Sids.Weight
581 for j2 := 0; j2 < 16; j2++ {
582 var s2 ip_types.IP6Address
584 if j2 < len(m.Sids.Sids) {
591 func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) {
592 var buf *codec.Buffer
594 buf = codec.NewBuffer(make([]byte, m.Size()))
596 buf = codec.NewBuffer(b)
598 buf.EncodeBytes(m.BsidAddr[:], 16)
599 buf.EncodeUint32(uint32(m.SrPolicyIndex))
600 buf.EncodeUint32(uint32(m.FibTable))
601 buf.EncodeUint8(uint8(m.Operation))
602 buf.EncodeUint32(uint32(m.SlIndex))
603 buf.EncodeUint32(uint32(m.Weight))
604 buf.EncodeUint8(uint8(m.Sids.NumSids))
605 buf.EncodeUint32(uint32(m.Sids.Weight))
606 for j1 := 0; j1 < 16; j1++ {
607 var v1 ip_types.IP6Address
608 if j1 < len(m.Sids.Sids) {
611 buf.EncodeBytes(v1[:], 16)
613 return buf.Bytes(), nil
615 func (m *SrPolicyMod) Unmarshal(b []byte) error {
616 buf := codec.NewBuffer(b)
617 copy(m.BsidAddr[:], buf.DecodeBytes(16))
618 m.SrPolicyIndex = buf.DecodeUint32()
619 m.FibTable = buf.DecodeUint32()
620 m.Operation = sr_types.SrPolicyOp(buf.DecodeUint8())
621 m.SlIndex = buf.DecodeUint32()
622 m.Weight = buf.DecodeUint32()
623 m.Sids.NumSids = buf.DecodeUint8()
624 m.Sids.Weight = buf.DecodeUint32()
625 for j1 := 0; j1 < 16; j1++ {
626 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
631 // SrPolicyModReply defines message 'sr_policy_mod_reply'.
632 type SrPolicyModReply struct {
633 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
636 func (m *SrPolicyModReply) Reset() { *m = SrPolicyModReply{} }
637 func (*SrPolicyModReply) GetMessageName() string { return "sr_policy_mod_reply" }
638 func (*SrPolicyModReply) GetCrcString() string { return "e8d4e804" }
639 func (*SrPolicyModReply) GetMessageType() api.MessageType {
640 return api.ReplyMessage
643 func (m *SrPolicyModReply) Size() int {
648 size += 4 // m.Retval
651 func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) {
652 var buf *codec.Buffer
654 buf = codec.NewBuffer(make([]byte, m.Size()))
656 buf = codec.NewBuffer(b)
658 buf.EncodeUint32(uint32(m.Retval))
659 return buf.Bytes(), nil
661 func (m *SrPolicyModReply) Unmarshal(b []byte) error {
662 buf := codec.NewBuffer(b)
663 m.Retval = int32(buf.DecodeUint32())
667 // SrSetEncapHopLimit defines message 'sr_set_encap_hop_limit'.
668 type SrSetEncapHopLimit struct {
669 HopLimit uint8 `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
672 func (m *SrSetEncapHopLimit) Reset() { *m = SrSetEncapHopLimit{} }
673 func (*SrSetEncapHopLimit) GetMessageName() string { return "sr_set_encap_hop_limit" }
674 func (*SrSetEncapHopLimit) GetCrcString() string { return "aa75d7d0" }
675 func (*SrSetEncapHopLimit) GetMessageType() api.MessageType {
676 return api.RequestMessage
679 func (m *SrSetEncapHopLimit) Size() int {
684 size += 1 // m.HopLimit
687 func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) {
688 var buf *codec.Buffer
690 buf = codec.NewBuffer(make([]byte, m.Size()))
692 buf = codec.NewBuffer(b)
694 buf.EncodeUint8(uint8(m.HopLimit))
695 return buf.Bytes(), nil
697 func (m *SrSetEncapHopLimit) Unmarshal(b []byte) error {
698 buf := codec.NewBuffer(b)
699 m.HopLimit = buf.DecodeUint8()
703 // SrSetEncapHopLimitReply defines message 'sr_set_encap_hop_limit_reply'.
704 type SrSetEncapHopLimitReply struct {
705 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
708 func (m *SrSetEncapHopLimitReply) Reset() { *m = SrSetEncapHopLimitReply{} }
709 func (*SrSetEncapHopLimitReply) GetMessageName() string { return "sr_set_encap_hop_limit_reply" }
710 func (*SrSetEncapHopLimitReply) GetCrcString() string { return "e8d4e804" }
711 func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType {
712 return api.ReplyMessage
715 func (m *SrSetEncapHopLimitReply) Size() int {
720 size += 4 // m.Retval
723 func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) {
724 var buf *codec.Buffer
726 buf = codec.NewBuffer(make([]byte, m.Size()))
728 buf = codec.NewBuffer(b)
730 buf.EncodeUint32(uint32(m.Retval))
731 return buf.Bytes(), nil
733 func (m *SrSetEncapHopLimitReply) Unmarshal(b []byte) error {
734 buf := codec.NewBuffer(b)
735 m.Retval = int32(buf.DecodeUint32())
739 // SrSetEncapSource defines message 'sr_set_encap_source'.
740 type SrSetEncapSource struct {
741 EncapsSource ip_types.IP6Address `binapi:"ip6_address,name=encaps_source" json:"encaps_source,omitempty"`
744 func (m *SrSetEncapSource) Reset() { *m = SrSetEncapSource{} }
745 func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" }
746 func (*SrSetEncapSource) GetCrcString() string { return "d3bad5e1" }
747 func (*SrSetEncapSource) GetMessageType() api.MessageType {
748 return api.RequestMessage
751 func (m *SrSetEncapSource) Size() int {
756 size += 1 * 16 // m.EncapsSource
759 func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) {
760 var buf *codec.Buffer
762 buf = codec.NewBuffer(make([]byte, m.Size()))
764 buf = codec.NewBuffer(b)
766 buf.EncodeBytes(m.EncapsSource[:], 16)
767 return buf.Bytes(), nil
769 func (m *SrSetEncapSource) Unmarshal(b []byte) error {
770 buf := codec.NewBuffer(b)
771 copy(m.EncapsSource[:], buf.DecodeBytes(16))
775 // SrSetEncapSourceReply defines message 'sr_set_encap_source_reply'.
776 type SrSetEncapSourceReply struct {
777 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
780 func (m *SrSetEncapSourceReply) Reset() { *m = SrSetEncapSourceReply{} }
781 func (*SrSetEncapSourceReply) GetMessageName() string { return "sr_set_encap_source_reply" }
782 func (*SrSetEncapSourceReply) GetCrcString() string { return "e8d4e804" }
783 func (*SrSetEncapSourceReply) GetMessageType() api.MessageType {
784 return api.ReplyMessage
787 func (m *SrSetEncapSourceReply) Size() int {
792 size += 4 // m.Retval
795 func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) {
796 var buf *codec.Buffer
798 buf = codec.NewBuffer(make([]byte, m.Size()))
800 buf = codec.NewBuffer(b)
802 buf.EncodeUint32(uint32(m.Retval))
803 return buf.Bytes(), nil
805 func (m *SrSetEncapSourceReply) Unmarshal(b []byte) error {
806 buf := codec.NewBuffer(b)
807 m.Retval = int32(buf.DecodeUint32())
811 // SrSteeringAddDel defines message 'sr_steering_add_del'.
812 type SrSteeringAddDel struct {
813 IsDel bool `binapi:"bool,name=is_del,default=%!s(bool=false)" json:"is_del,omitempty"`
814 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
815 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
816 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
817 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
818 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
819 TrafficType sr_types.SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
822 func (m *SrSteeringAddDel) Reset() { *m = SrSteeringAddDel{} }
823 func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" }
824 func (*SrSteeringAddDel) GetCrcString() string { return "3711dace" }
825 func (*SrSteeringAddDel) GetMessageType() api.MessageType {
826 return api.RequestMessage
829 func (m *SrSteeringAddDel) Size() int {
835 size += 1 * 16 // m.BsidAddr
836 size += 4 // m.SrPolicyIndex
837 size += 4 // m.TableID
838 size += 1 // m.Prefix.Address.Af
839 size += 1 * 16 // m.Prefix.Address.Un
840 size += 1 // m.Prefix.Len
841 size += 4 // m.SwIfIndex
842 size += 1 // m.TrafficType
845 func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) {
846 var buf *codec.Buffer
848 buf = codec.NewBuffer(make([]byte, m.Size()))
850 buf = codec.NewBuffer(b)
852 buf.EncodeBool(m.IsDel)
853 buf.EncodeBytes(m.BsidAddr[:], 16)
854 buf.EncodeUint32(uint32(m.SrPolicyIndex))
855 buf.EncodeUint32(uint32(m.TableID))
856 buf.EncodeUint8(uint8(m.Prefix.Address.Af))
857 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0)
858 buf.EncodeUint8(uint8(m.Prefix.Len))
859 buf.EncodeUint32(uint32(m.SwIfIndex))
860 buf.EncodeUint8(uint8(m.TrafficType))
861 return buf.Bytes(), nil
863 func (m *SrSteeringAddDel) Unmarshal(b []byte) error {
864 buf := codec.NewBuffer(b)
865 m.IsDel = buf.DecodeBool()
866 copy(m.BsidAddr[:], buf.DecodeBytes(16))
867 m.SrPolicyIndex = buf.DecodeUint32()
868 m.TableID = buf.DecodeUint32()
869 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
870 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
871 m.Prefix.Len = buf.DecodeUint8()
872 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
873 m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
877 // SrSteeringAddDelReply defines message 'sr_steering_add_del_reply'.
878 type SrSteeringAddDelReply struct {
879 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
882 func (m *SrSteeringAddDelReply) Reset() { *m = SrSteeringAddDelReply{} }
883 func (*SrSteeringAddDelReply) GetMessageName() string { return "sr_steering_add_del_reply" }
884 func (*SrSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
885 func (*SrSteeringAddDelReply) GetMessageType() api.MessageType {
886 return api.ReplyMessage
889 func (m *SrSteeringAddDelReply) Size() int {
894 size += 4 // m.Retval
897 func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
898 var buf *codec.Buffer
900 buf = codec.NewBuffer(make([]byte, m.Size()))
902 buf = codec.NewBuffer(b)
904 buf.EncodeUint32(uint32(m.Retval))
905 return buf.Bytes(), nil
907 func (m *SrSteeringAddDelReply) Unmarshal(b []byte) error {
908 buf := codec.NewBuffer(b)
909 m.Retval = int32(buf.DecodeUint32())
913 // SrSteeringPolDetails defines message 'sr_steering_pol_details'.
914 type SrSteeringPolDetails struct {
915 TrafficType sr_types.SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
916 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
917 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
918 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
919 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
922 func (m *SrSteeringPolDetails) Reset() { *m = SrSteeringPolDetails{} }
923 func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" }
924 func (*SrSteeringPolDetails) GetCrcString() string { return "1c1ee786" }
925 func (*SrSteeringPolDetails) GetMessageType() api.MessageType {
926 return api.ReplyMessage
929 func (m *SrSteeringPolDetails) Size() int {
934 size += 1 // m.TrafficType
935 size += 4 // m.FibTable
936 size += 1 // m.Prefix.Address.Af
937 size += 1 * 16 // m.Prefix.Address.Un
938 size += 1 // m.Prefix.Len
939 size += 4 // m.SwIfIndex
940 size += 1 * 16 // m.Bsid
943 func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) {
944 var buf *codec.Buffer
946 buf = codec.NewBuffer(make([]byte, m.Size()))
948 buf = codec.NewBuffer(b)
950 buf.EncodeUint8(uint8(m.TrafficType))
951 buf.EncodeUint32(uint32(m.FibTable))
952 buf.EncodeUint8(uint8(m.Prefix.Address.Af))
953 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 0)
954 buf.EncodeUint8(uint8(m.Prefix.Len))
955 buf.EncodeUint32(uint32(m.SwIfIndex))
956 buf.EncodeBytes(m.Bsid[:], 16)
957 return buf.Bytes(), nil
959 func (m *SrSteeringPolDetails) Unmarshal(b []byte) error {
960 buf := codec.NewBuffer(b)
961 m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
962 m.FibTable = buf.DecodeUint32()
963 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
964 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
965 m.Prefix.Len = buf.DecodeUint8()
966 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
967 copy(m.Bsid[:], buf.DecodeBytes(16))
971 // SrSteeringPolDump defines message 'sr_steering_pol_dump'.
972 type SrSteeringPolDump struct{}
974 func (m *SrSteeringPolDump) Reset() { *m = SrSteeringPolDump{} }
975 func (*SrSteeringPolDump) GetMessageName() string { return "sr_steering_pol_dump" }
976 func (*SrSteeringPolDump) GetCrcString() string { return "51077d14" }
977 func (*SrSteeringPolDump) GetMessageType() api.MessageType {
978 return api.RequestMessage
981 func (m *SrSteeringPolDump) Size() int {
988 func (m *SrSteeringPolDump) Marshal(b []byte) ([]byte, error) {
989 var buf *codec.Buffer
991 buf = codec.NewBuffer(make([]byte, m.Size()))
993 buf = codec.NewBuffer(b)
995 return buf.Bytes(), nil
997 func (m *SrSteeringPolDump) Unmarshal(b []byte) error {
1001 func init() { file_sr_binapi_init() }
1002 func file_sr_binapi_init() {
1003 api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr_localsid_add_del_26fa3309")
1004 api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr_localsid_add_del_reply_e8d4e804")
1005 api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr_localsids_details_6a6c0265")
1006 api.RegisterMessage((*SrLocalsidsDump)(nil), "sr_localsids_dump_51077d14")
1007 api.RegisterMessage((*SrPoliciesDetails)(nil), "sr_policies_details_07ec2d93")
1008 api.RegisterMessage((*SrPoliciesDump)(nil), "sr_policies_dump_51077d14")
1009 api.RegisterMessage((*SrPolicyAdd)(nil), "sr_policy_add_ec79ee6a")
1010 api.RegisterMessage((*SrPolicyAddReply)(nil), "sr_policy_add_reply_e8d4e804")
1011 api.RegisterMessage((*SrPolicyDel)(nil), "sr_policy_del_cb4d48d5")
1012 api.RegisterMessage((*SrPolicyDelReply)(nil), "sr_policy_del_reply_e8d4e804")
1013 api.RegisterMessage((*SrPolicyMod)(nil), "sr_policy_mod_e531a102")
1014 api.RegisterMessage((*SrPolicyModReply)(nil), "sr_policy_mod_reply_e8d4e804")
1015 api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr_set_encap_hop_limit_aa75d7d0")
1016 api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr_set_encap_hop_limit_reply_e8d4e804")
1017 api.RegisterMessage((*SrSetEncapSource)(nil), "sr_set_encap_source_d3bad5e1")
1018 api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr_set_encap_source_reply_e8d4e804")
1019 api.RegisterMessage((*SrSteeringAddDel)(nil), "sr_steering_add_del_3711dace")
1020 api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr_steering_add_del_reply_e8d4e804")
1021 api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr_steering_pol_details_1c1ee786")
1022 api.RegisterMessage((*SrSteeringPolDump)(nil), "sr_steering_pol_dump_51077d14")
1025 // Messages returns list of all messages in this module.
1026 func AllMessages() []api.Message {
1027 return []api.Message{
1028 (*SrLocalsidAddDel)(nil),
1029 (*SrLocalsidAddDelReply)(nil),
1030 (*SrLocalsidsDetails)(nil),
1031 (*SrLocalsidsDump)(nil),
1032 (*SrPoliciesDetails)(nil),
1033 (*SrPoliciesDump)(nil),
1034 (*SrPolicyAdd)(nil),
1035 (*SrPolicyAddReply)(nil),
1036 (*SrPolicyDel)(nil),
1037 (*SrPolicyDelReply)(nil),
1038 (*SrPolicyMod)(nil),
1039 (*SrPolicyModReply)(nil),
1040 (*SrSetEncapHopLimit)(nil),
1041 (*SrSetEncapHopLimitReply)(nil),
1042 (*SrSetEncapSource)(nil),
1043 (*SrSetEncapSourceReply)(nil),
1044 (*SrSteeringAddDel)(nil),
1045 (*SrSteeringAddDelReply)(nil),
1046 (*SrSteeringPolDetails)(nil),
1047 (*SrSteeringPolDump)(nil),