1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package sr contains generated bindings for API file sr.api.
15 api "git.fd.io/govpp.git/api"
16 interface_types "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 = 0xd85c77ca
34 // Srv6SidList defines type 'srv6_sid_list'.
35 type Srv6SidList struct {
36 NumSids uint8 `binapi:"u8,name=num_sids" json:"num_sids,omitempty"`
37 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
38 Sids [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty"`
41 // SrLocalsidAddDel defines message 'sr_localsid_add_del'.
42 type SrLocalsidAddDel struct {
43 IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
44 Localsid ip_types.IP6Address `binapi:"ip6_address,name=localsid" json:"localsid,omitempty"`
45 EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
46 Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
47 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
48 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
49 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
50 NhAddr ip_types.Address `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"`
53 func (m *SrLocalsidAddDel) Reset() { *m = SrLocalsidAddDel{} }
54 func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" }
55 func (*SrLocalsidAddDel) GetCrcString() string { return "26fa3309" }
56 func (*SrLocalsidAddDel) GetMessageType() api.MessageType {
57 return api.RequestMessage
60 func (m *SrLocalsidAddDel) Size() (size int) {
65 size += 1 * 16 // m.Localsid
67 size += 1 // m.Behavior
68 size += 4 // m.SwIfIndex
69 size += 4 // m.VlanIndex
70 size += 4 // m.FibTable
71 size += 1 // m.NhAddr.Af
72 size += 1 * 16 // m.NhAddr.Un
75 func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) {
77 b = make([]byte, m.Size())
79 buf := codec.NewBuffer(b)
80 buf.EncodeBool(m.IsDel)
81 buf.EncodeBytes(m.Localsid[:], 16)
82 buf.EncodeBool(m.EndPsp)
83 buf.EncodeUint8(uint8(m.Behavior))
84 buf.EncodeUint32(uint32(m.SwIfIndex))
85 buf.EncodeUint32(m.VlanIndex)
86 buf.EncodeUint32(m.FibTable)
87 buf.EncodeUint8(uint8(m.NhAddr.Af))
88 buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 16)
89 return buf.Bytes(), nil
91 func (m *SrLocalsidAddDel) Unmarshal(b []byte) error {
92 buf := codec.NewBuffer(b)
93 m.IsDel = buf.DecodeBool()
94 copy(m.Localsid[:], buf.DecodeBytes(16))
95 m.EndPsp = buf.DecodeBool()
96 m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
97 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
98 m.VlanIndex = buf.DecodeUint32()
99 m.FibTable = buf.DecodeUint32()
100 m.NhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
101 copy(m.NhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
105 // SrLocalsidAddDelReply defines message 'sr_localsid_add_del_reply'.
106 type SrLocalsidAddDelReply struct {
107 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
110 func (m *SrLocalsidAddDelReply) Reset() { *m = SrLocalsidAddDelReply{} }
111 func (*SrLocalsidAddDelReply) GetMessageName() string { return "sr_localsid_add_del_reply" }
112 func (*SrLocalsidAddDelReply) GetCrcString() string { return "e8d4e804" }
113 func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType {
114 return api.ReplyMessage
117 func (m *SrLocalsidAddDelReply) Size() (size int) {
121 size += 4 // m.Retval
124 func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) {
126 b = make([]byte, m.Size())
128 buf := codec.NewBuffer(b)
129 buf.EncodeInt32(m.Retval)
130 return buf.Bytes(), nil
132 func (m *SrLocalsidAddDelReply) Unmarshal(b []byte) error {
133 buf := codec.NewBuffer(b)
134 m.Retval = buf.DecodeInt32()
138 // SrLocalsidsDetails defines message 'sr_localsids_details'.
139 type SrLocalsidsDetails struct {
140 Addr ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"`
141 EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
142 Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
143 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
144 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
145 XconnectNhAddr ip_types.Address `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"`
146 XconnectIfaceOrVrfTable uint32 `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"`
149 func (m *SrLocalsidsDetails) Reset() { *m = SrLocalsidsDetails{} }
150 func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" }
151 func (*SrLocalsidsDetails) GetCrcString() string { return "6a6c0265" }
152 func (*SrLocalsidsDetails) GetMessageType() api.MessageType {
153 return api.ReplyMessage
156 func (m *SrLocalsidsDetails) Size() (size int) {
160 size += 1 * 16 // m.Addr
161 size += 1 // m.EndPsp
162 size += 1 // m.Behavior
163 size += 4 // m.FibTable
164 size += 4 // m.VlanIndex
165 size += 1 // m.XconnectNhAddr.Af
166 size += 1 * 16 // m.XconnectNhAddr.Un
167 size += 4 // m.XconnectIfaceOrVrfTable
170 func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) {
172 b = make([]byte, m.Size())
174 buf := codec.NewBuffer(b)
175 buf.EncodeBytes(m.Addr[:], 16)
176 buf.EncodeBool(m.EndPsp)
177 buf.EncodeUint8(uint8(m.Behavior))
178 buf.EncodeUint32(m.FibTable)
179 buf.EncodeUint32(m.VlanIndex)
180 buf.EncodeUint8(uint8(m.XconnectNhAddr.Af))
181 buf.EncodeBytes(m.XconnectNhAddr.Un.XXX_UnionData[:], 16)
182 buf.EncodeUint32(m.XconnectIfaceOrVrfTable)
183 return buf.Bytes(), nil
185 func (m *SrLocalsidsDetails) Unmarshal(b []byte) error {
186 buf := codec.NewBuffer(b)
187 copy(m.Addr[:], buf.DecodeBytes(16))
188 m.EndPsp = buf.DecodeBool()
189 m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
190 m.FibTable = buf.DecodeUint32()
191 m.VlanIndex = buf.DecodeUint32()
192 m.XconnectNhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
193 copy(m.XconnectNhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
194 m.XconnectIfaceOrVrfTable = buf.DecodeUint32()
198 // SrLocalsidsDump defines message 'sr_localsids_dump'.
199 type SrLocalsidsDump struct{}
201 func (m *SrLocalsidsDump) Reset() { *m = SrLocalsidsDump{} }
202 func (*SrLocalsidsDump) GetMessageName() string { return "sr_localsids_dump" }
203 func (*SrLocalsidsDump) GetCrcString() string { return "51077d14" }
204 func (*SrLocalsidsDump) GetMessageType() api.MessageType {
205 return api.RequestMessage
208 func (m *SrLocalsidsDump) Size() (size int) {
214 func (m *SrLocalsidsDump) Marshal(b []byte) ([]byte, error) {
216 b = make([]byte, m.Size())
218 buf := codec.NewBuffer(b)
219 return buf.Bytes(), nil
221 func (m *SrLocalsidsDump) Unmarshal(b []byte) error {
225 // SrPoliciesDetails defines message 'sr_policies_details'.
226 type SrPoliciesDetails struct {
227 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
228 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
229 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
230 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
231 NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"-"`
232 SidLists []Srv6SidList `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
235 func (m *SrPoliciesDetails) Reset() { *m = SrPoliciesDetails{} }
236 func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" }
237 func (*SrPoliciesDetails) GetCrcString() string { return "07ec2d93" }
238 func (*SrPoliciesDetails) GetMessageType() api.MessageType {
239 return api.ReplyMessage
242 func (m *SrPoliciesDetails) Size() (size int) {
246 size += 1 * 16 // m.Bsid
247 size += 1 // m.IsSpray
248 size += 1 // m.IsEncap
249 size += 4 // m.FibTable
250 size += 1 // m.NumSidLists
251 for j1 := 0; j1 < len(m.SidLists); j1++ {
254 if j1 < len(m.SidLists) {
257 size += 1 // s1.NumSids
258 size += 4 // s1.Weight
259 for j2 := 0; j2 < 16; j2++ {
260 size += 1 * 16 // s1.Sids[j2]
265 func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) {
267 b = make([]byte, m.Size())
269 buf := codec.NewBuffer(b)
270 buf.EncodeBytes(m.Bsid[:], 16)
271 buf.EncodeBool(m.IsSpray)
272 buf.EncodeBool(m.IsEncap)
273 buf.EncodeUint32(m.FibTable)
274 buf.EncodeUint8(uint8(len(m.SidLists)))
275 for j0 := 0; j0 < len(m.SidLists); j0++ {
276 var v0 Srv6SidList // SidLists
277 if j0 < len(m.SidLists) {
280 buf.EncodeUint8(v0.NumSids)
281 buf.EncodeUint32(v0.Weight)
282 for j1 := 0; j1 < 16; j1++ {
283 buf.EncodeBytes(v0.Sids[j1][:], 16)
286 return buf.Bytes(), nil
288 func (m *SrPoliciesDetails) Unmarshal(b []byte) error {
289 buf := codec.NewBuffer(b)
290 copy(m.Bsid[:], buf.DecodeBytes(16))
291 m.IsSpray = buf.DecodeBool()
292 m.IsEncap = buf.DecodeBool()
293 m.FibTable = buf.DecodeUint32()
294 m.NumSidLists = buf.DecodeUint8()
295 m.SidLists = make([]Srv6SidList, m.NumSidLists)
296 for j0 := 0; j0 < len(m.SidLists); j0++ {
297 m.SidLists[j0].NumSids = buf.DecodeUint8()
298 m.SidLists[j0].Weight = buf.DecodeUint32()
299 for j1 := 0; j1 < 16; j1++ {
300 copy(m.SidLists[j0].Sids[j1][:], buf.DecodeBytes(16))
306 // SrPoliciesDump defines message 'sr_policies_dump'.
307 type SrPoliciesDump struct{}
309 func (m *SrPoliciesDump) Reset() { *m = SrPoliciesDump{} }
310 func (*SrPoliciesDump) GetMessageName() string { return "sr_policies_dump" }
311 func (*SrPoliciesDump) GetCrcString() string { return "51077d14" }
312 func (*SrPoliciesDump) GetMessageType() api.MessageType {
313 return api.RequestMessage
316 func (m *SrPoliciesDump) Size() (size int) {
322 func (m *SrPoliciesDump) Marshal(b []byte) ([]byte, error) {
324 b = make([]byte, m.Size())
326 buf := codec.NewBuffer(b)
327 return buf.Bytes(), nil
329 func (m *SrPoliciesDump) Unmarshal(b []byte) error {
333 // SrPolicyAdd defines message 'sr_policy_add'.
334 type SrPolicyAdd struct {
335 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
336 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
337 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
338 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
339 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
340 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
343 func (m *SrPolicyAdd) Reset() { *m = SrPolicyAdd{} }
344 func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" }
345 func (*SrPolicyAdd) GetCrcString() string { return "ec79ee6a" }
346 func (*SrPolicyAdd) GetMessageType() api.MessageType {
347 return api.RequestMessage
350 func (m *SrPolicyAdd) Size() (size int) {
354 size += 1 * 16 // m.BsidAddr
355 size += 4 // m.Weight
356 size += 1 // m.IsEncap
357 size += 1 // m.IsSpray
358 size += 4 // m.FibTable
359 size += 1 // m.Sids.NumSids
360 size += 4 // m.Sids.Weight
361 for j2 := 0; j2 < 16; j2++ {
362 size += 1 * 16 // m.Sids.Sids[j2]
366 func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) {
368 b = make([]byte, m.Size())
370 buf := codec.NewBuffer(b)
371 buf.EncodeBytes(m.BsidAddr[:], 16)
372 buf.EncodeUint32(m.Weight)
373 buf.EncodeBool(m.IsEncap)
374 buf.EncodeBool(m.IsSpray)
375 buf.EncodeUint32(m.FibTable)
376 buf.EncodeUint8(m.Sids.NumSids)
377 buf.EncodeUint32(m.Sids.Weight)
378 for j1 := 0; j1 < 16; j1++ {
379 buf.EncodeBytes(m.Sids.Sids[j1][:], 16)
381 return buf.Bytes(), nil
383 func (m *SrPolicyAdd) Unmarshal(b []byte) error {
384 buf := codec.NewBuffer(b)
385 copy(m.BsidAddr[:], buf.DecodeBytes(16))
386 m.Weight = buf.DecodeUint32()
387 m.IsEncap = buf.DecodeBool()
388 m.IsSpray = buf.DecodeBool()
389 m.FibTable = buf.DecodeUint32()
390 m.Sids.NumSids = buf.DecodeUint8()
391 m.Sids.Weight = buf.DecodeUint32()
392 for j1 := 0; j1 < 16; j1++ {
393 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
398 // SrPolicyAddReply defines message 'sr_policy_add_reply'.
399 type SrPolicyAddReply struct {
400 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
403 func (m *SrPolicyAddReply) Reset() { *m = SrPolicyAddReply{} }
404 func (*SrPolicyAddReply) GetMessageName() string { return "sr_policy_add_reply" }
405 func (*SrPolicyAddReply) GetCrcString() string { return "e8d4e804" }
406 func (*SrPolicyAddReply) GetMessageType() api.MessageType {
407 return api.ReplyMessage
410 func (m *SrPolicyAddReply) Size() (size int) {
414 size += 4 // m.Retval
417 func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) {
419 b = make([]byte, m.Size())
421 buf := codec.NewBuffer(b)
422 buf.EncodeInt32(m.Retval)
423 return buf.Bytes(), nil
425 func (m *SrPolicyAddReply) Unmarshal(b []byte) error {
426 buf := codec.NewBuffer(b)
427 m.Retval = buf.DecodeInt32()
431 // SrPolicyDel defines message 'sr_policy_del'.
432 type SrPolicyDel struct {
433 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
434 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
437 func (m *SrPolicyDel) Reset() { *m = SrPolicyDel{} }
438 func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" }
439 func (*SrPolicyDel) GetCrcString() string { return "cb4d48d5" }
440 func (*SrPolicyDel) GetMessageType() api.MessageType {
441 return api.RequestMessage
444 func (m *SrPolicyDel) Size() (size int) {
448 size += 1 * 16 // m.BsidAddr
449 size += 4 // m.SrPolicyIndex
452 func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) {
454 b = make([]byte, m.Size())
456 buf := codec.NewBuffer(b)
457 buf.EncodeBytes(m.BsidAddr[:], 16)
458 buf.EncodeUint32(m.SrPolicyIndex)
459 return buf.Bytes(), nil
461 func (m *SrPolicyDel) Unmarshal(b []byte) error {
462 buf := codec.NewBuffer(b)
463 copy(m.BsidAddr[:], buf.DecodeBytes(16))
464 m.SrPolicyIndex = buf.DecodeUint32()
468 // SrPolicyDelReply defines message 'sr_policy_del_reply'.
469 type SrPolicyDelReply struct {
470 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
473 func (m *SrPolicyDelReply) Reset() { *m = SrPolicyDelReply{} }
474 func (*SrPolicyDelReply) GetMessageName() string { return "sr_policy_del_reply" }
475 func (*SrPolicyDelReply) GetCrcString() string { return "e8d4e804" }
476 func (*SrPolicyDelReply) GetMessageType() api.MessageType {
477 return api.ReplyMessage
480 func (m *SrPolicyDelReply) Size() (size int) {
484 size += 4 // m.Retval
487 func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) {
489 b = make([]byte, m.Size())
491 buf := codec.NewBuffer(b)
492 buf.EncodeInt32(m.Retval)
493 return buf.Bytes(), nil
495 func (m *SrPolicyDelReply) Unmarshal(b []byte) error {
496 buf := codec.NewBuffer(b)
497 m.Retval = buf.DecodeInt32()
501 // SrPolicyMod defines message 'sr_policy_mod'.
502 type SrPolicyMod struct {
503 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
504 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
505 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
506 Operation sr_types.SrPolicyOp `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"`
507 SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
508 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
509 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
512 func (m *SrPolicyMod) Reset() { *m = SrPolicyMod{} }
513 func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" }
514 func (*SrPolicyMod) GetCrcString() string { return "e531a102" }
515 func (*SrPolicyMod) GetMessageType() api.MessageType {
516 return api.RequestMessage
519 func (m *SrPolicyMod) Size() (size int) {
523 size += 1 * 16 // m.BsidAddr
524 size += 4 // m.SrPolicyIndex
525 size += 4 // m.FibTable
526 size += 1 // m.Operation
527 size += 4 // m.SlIndex
528 size += 4 // m.Weight
529 size += 1 // m.Sids.NumSids
530 size += 4 // m.Sids.Weight
531 for j2 := 0; j2 < 16; j2++ {
532 size += 1 * 16 // m.Sids.Sids[j2]
536 func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) {
538 b = make([]byte, m.Size())
540 buf := codec.NewBuffer(b)
541 buf.EncodeBytes(m.BsidAddr[:], 16)
542 buf.EncodeUint32(m.SrPolicyIndex)
543 buf.EncodeUint32(m.FibTable)
544 buf.EncodeUint8(uint8(m.Operation))
545 buf.EncodeUint32(m.SlIndex)
546 buf.EncodeUint32(m.Weight)
547 buf.EncodeUint8(m.Sids.NumSids)
548 buf.EncodeUint32(m.Sids.Weight)
549 for j1 := 0; j1 < 16; j1++ {
550 buf.EncodeBytes(m.Sids.Sids[j1][:], 16)
552 return buf.Bytes(), nil
554 func (m *SrPolicyMod) Unmarshal(b []byte) error {
555 buf := codec.NewBuffer(b)
556 copy(m.BsidAddr[:], buf.DecodeBytes(16))
557 m.SrPolicyIndex = buf.DecodeUint32()
558 m.FibTable = buf.DecodeUint32()
559 m.Operation = sr_types.SrPolicyOp(buf.DecodeUint8())
560 m.SlIndex = buf.DecodeUint32()
561 m.Weight = buf.DecodeUint32()
562 m.Sids.NumSids = buf.DecodeUint8()
563 m.Sids.Weight = buf.DecodeUint32()
564 for j1 := 0; j1 < 16; j1++ {
565 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
570 // SrPolicyModReply defines message 'sr_policy_mod_reply'.
571 type SrPolicyModReply struct {
572 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
575 func (m *SrPolicyModReply) Reset() { *m = SrPolicyModReply{} }
576 func (*SrPolicyModReply) GetMessageName() string { return "sr_policy_mod_reply" }
577 func (*SrPolicyModReply) GetCrcString() string { return "e8d4e804" }
578 func (*SrPolicyModReply) GetMessageType() api.MessageType {
579 return api.ReplyMessage
582 func (m *SrPolicyModReply) Size() (size int) {
586 size += 4 // m.Retval
589 func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) {
591 b = make([]byte, m.Size())
593 buf := codec.NewBuffer(b)
594 buf.EncodeInt32(m.Retval)
595 return buf.Bytes(), nil
597 func (m *SrPolicyModReply) Unmarshal(b []byte) error {
598 buf := codec.NewBuffer(b)
599 m.Retval = buf.DecodeInt32()
603 // SrSetEncapHopLimit defines message 'sr_set_encap_hop_limit'.
604 type SrSetEncapHopLimit struct {
605 HopLimit uint8 `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
608 func (m *SrSetEncapHopLimit) Reset() { *m = SrSetEncapHopLimit{} }
609 func (*SrSetEncapHopLimit) GetMessageName() string { return "sr_set_encap_hop_limit" }
610 func (*SrSetEncapHopLimit) GetCrcString() string { return "aa75d7d0" }
611 func (*SrSetEncapHopLimit) GetMessageType() api.MessageType {
612 return api.RequestMessage
615 func (m *SrSetEncapHopLimit) Size() (size int) {
619 size += 1 // m.HopLimit
622 func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) {
624 b = make([]byte, m.Size())
626 buf := codec.NewBuffer(b)
627 buf.EncodeUint8(m.HopLimit)
628 return buf.Bytes(), nil
630 func (m *SrSetEncapHopLimit) Unmarshal(b []byte) error {
631 buf := codec.NewBuffer(b)
632 m.HopLimit = buf.DecodeUint8()
636 // SrSetEncapHopLimitReply defines message 'sr_set_encap_hop_limit_reply'.
637 type SrSetEncapHopLimitReply struct {
638 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
641 func (m *SrSetEncapHopLimitReply) Reset() { *m = SrSetEncapHopLimitReply{} }
642 func (*SrSetEncapHopLimitReply) GetMessageName() string { return "sr_set_encap_hop_limit_reply" }
643 func (*SrSetEncapHopLimitReply) GetCrcString() string { return "e8d4e804" }
644 func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType {
645 return api.ReplyMessage
648 func (m *SrSetEncapHopLimitReply) Size() (size int) {
652 size += 4 // m.Retval
655 func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) {
657 b = make([]byte, m.Size())
659 buf := codec.NewBuffer(b)
660 buf.EncodeInt32(m.Retval)
661 return buf.Bytes(), nil
663 func (m *SrSetEncapHopLimitReply) Unmarshal(b []byte) error {
664 buf := codec.NewBuffer(b)
665 m.Retval = buf.DecodeInt32()
669 // SrSetEncapSource defines message 'sr_set_encap_source'.
670 type SrSetEncapSource struct {
671 EncapsSource ip_types.IP6Address `binapi:"ip6_address,name=encaps_source" json:"encaps_source,omitempty"`
674 func (m *SrSetEncapSource) Reset() { *m = SrSetEncapSource{} }
675 func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" }
676 func (*SrSetEncapSource) GetCrcString() string { return "d3bad5e1" }
677 func (*SrSetEncapSource) GetMessageType() api.MessageType {
678 return api.RequestMessage
681 func (m *SrSetEncapSource) Size() (size int) {
685 size += 1 * 16 // m.EncapsSource
688 func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) {
690 b = make([]byte, m.Size())
692 buf := codec.NewBuffer(b)
693 buf.EncodeBytes(m.EncapsSource[:], 16)
694 return buf.Bytes(), nil
696 func (m *SrSetEncapSource) Unmarshal(b []byte) error {
697 buf := codec.NewBuffer(b)
698 copy(m.EncapsSource[:], buf.DecodeBytes(16))
702 // SrSetEncapSourceReply defines message 'sr_set_encap_source_reply'.
703 type SrSetEncapSourceReply struct {
704 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
707 func (m *SrSetEncapSourceReply) Reset() { *m = SrSetEncapSourceReply{} }
708 func (*SrSetEncapSourceReply) GetMessageName() string { return "sr_set_encap_source_reply" }
709 func (*SrSetEncapSourceReply) GetCrcString() string { return "e8d4e804" }
710 func (*SrSetEncapSourceReply) GetMessageType() api.MessageType {
711 return api.ReplyMessage
714 func (m *SrSetEncapSourceReply) Size() (size int) {
718 size += 4 // m.Retval
721 func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) {
723 b = make([]byte, m.Size())
725 buf := codec.NewBuffer(b)
726 buf.EncodeInt32(m.Retval)
727 return buf.Bytes(), nil
729 func (m *SrSetEncapSourceReply) Unmarshal(b []byte) error {
730 buf := codec.NewBuffer(b)
731 m.Retval = buf.DecodeInt32()
735 // SrSteeringAddDel defines message 'sr_steering_add_del'.
736 type SrSteeringAddDel struct {
737 IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
738 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
739 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
740 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
741 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
742 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
743 TrafficType sr_types.SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
746 func (m *SrSteeringAddDel) Reset() { *m = SrSteeringAddDel{} }
747 func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" }
748 func (*SrSteeringAddDel) GetCrcString() string { return "3711dace" }
749 func (*SrSteeringAddDel) GetMessageType() api.MessageType {
750 return api.RequestMessage
753 func (m *SrSteeringAddDel) Size() (size int) {
758 size += 1 * 16 // m.BsidAddr
759 size += 4 // m.SrPolicyIndex
760 size += 4 // m.TableID
761 size += 1 // m.Prefix.Address.Af
762 size += 1 * 16 // m.Prefix.Address.Un
763 size += 1 // m.Prefix.Len
764 size += 4 // m.SwIfIndex
765 size += 1 // m.TrafficType
768 func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) {
770 b = make([]byte, m.Size())
772 buf := codec.NewBuffer(b)
773 buf.EncodeBool(m.IsDel)
774 buf.EncodeBytes(m.BsidAddr[:], 16)
775 buf.EncodeUint32(m.SrPolicyIndex)
776 buf.EncodeUint32(m.TableID)
777 buf.EncodeUint8(uint8(m.Prefix.Address.Af))
778 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
779 buf.EncodeUint8(m.Prefix.Len)
780 buf.EncodeUint32(uint32(m.SwIfIndex))
781 buf.EncodeUint8(uint8(m.TrafficType))
782 return buf.Bytes(), nil
784 func (m *SrSteeringAddDel) Unmarshal(b []byte) error {
785 buf := codec.NewBuffer(b)
786 m.IsDel = buf.DecodeBool()
787 copy(m.BsidAddr[:], buf.DecodeBytes(16))
788 m.SrPolicyIndex = buf.DecodeUint32()
789 m.TableID = buf.DecodeUint32()
790 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
791 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
792 m.Prefix.Len = buf.DecodeUint8()
793 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
794 m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
798 // SrSteeringAddDelReply defines message 'sr_steering_add_del_reply'.
799 type SrSteeringAddDelReply struct {
800 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
803 func (m *SrSteeringAddDelReply) Reset() { *m = SrSteeringAddDelReply{} }
804 func (*SrSteeringAddDelReply) GetMessageName() string { return "sr_steering_add_del_reply" }
805 func (*SrSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
806 func (*SrSteeringAddDelReply) GetMessageType() api.MessageType {
807 return api.ReplyMessage
810 func (m *SrSteeringAddDelReply) Size() (size int) {
814 size += 4 // m.Retval
817 func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
819 b = make([]byte, m.Size())
821 buf := codec.NewBuffer(b)
822 buf.EncodeInt32(m.Retval)
823 return buf.Bytes(), nil
825 func (m *SrSteeringAddDelReply) Unmarshal(b []byte) error {
826 buf := codec.NewBuffer(b)
827 m.Retval = buf.DecodeInt32()
831 // SrSteeringPolDetails defines message 'sr_steering_pol_details'.
832 type SrSteeringPolDetails struct {
833 TrafficType sr_types.SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
834 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
835 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
836 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
837 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
840 func (m *SrSteeringPolDetails) Reset() { *m = SrSteeringPolDetails{} }
841 func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" }
842 func (*SrSteeringPolDetails) GetCrcString() string { return "1c1ee786" }
843 func (*SrSteeringPolDetails) GetMessageType() api.MessageType {
844 return api.ReplyMessage
847 func (m *SrSteeringPolDetails) Size() (size int) {
851 size += 1 // m.TrafficType
852 size += 4 // m.FibTable
853 size += 1 // m.Prefix.Address.Af
854 size += 1 * 16 // m.Prefix.Address.Un
855 size += 1 // m.Prefix.Len
856 size += 4 // m.SwIfIndex
857 size += 1 * 16 // m.Bsid
860 func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) {
862 b = make([]byte, m.Size())
864 buf := codec.NewBuffer(b)
865 buf.EncodeUint8(uint8(m.TrafficType))
866 buf.EncodeUint32(m.FibTable)
867 buf.EncodeUint8(uint8(m.Prefix.Address.Af))
868 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
869 buf.EncodeUint8(m.Prefix.Len)
870 buf.EncodeUint32(uint32(m.SwIfIndex))
871 buf.EncodeBytes(m.Bsid[:], 16)
872 return buf.Bytes(), nil
874 func (m *SrSteeringPolDetails) Unmarshal(b []byte) error {
875 buf := codec.NewBuffer(b)
876 m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
877 m.FibTable = buf.DecodeUint32()
878 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
879 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
880 m.Prefix.Len = buf.DecodeUint8()
881 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
882 copy(m.Bsid[:], buf.DecodeBytes(16))
886 // SrSteeringPolDump defines message 'sr_steering_pol_dump'.
887 type SrSteeringPolDump struct{}
889 func (m *SrSteeringPolDump) Reset() { *m = SrSteeringPolDump{} }
890 func (*SrSteeringPolDump) GetMessageName() string { return "sr_steering_pol_dump" }
891 func (*SrSteeringPolDump) GetCrcString() string { return "51077d14" }
892 func (*SrSteeringPolDump) GetMessageType() api.MessageType {
893 return api.RequestMessage
896 func (m *SrSteeringPolDump) Size() (size int) {
902 func (m *SrSteeringPolDump) Marshal(b []byte) ([]byte, error) {
904 b = make([]byte, m.Size())
906 buf := codec.NewBuffer(b)
907 return buf.Bytes(), nil
909 func (m *SrSteeringPolDump) Unmarshal(b []byte) error {
913 func init() { file_sr_binapi_init() }
914 func file_sr_binapi_init() {
915 api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr_localsid_add_del_26fa3309")
916 api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr_localsid_add_del_reply_e8d4e804")
917 api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr_localsids_details_6a6c0265")
918 api.RegisterMessage((*SrLocalsidsDump)(nil), "sr_localsids_dump_51077d14")
919 api.RegisterMessage((*SrPoliciesDetails)(nil), "sr_policies_details_07ec2d93")
920 api.RegisterMessage((*SrPoliciesDump)(nil), "sr_policies_dump_51077d14")
921 api.RegisterMessage((*SrPolicyAdd)(nil), "sr_policy_add_ec79ee6a")
922 api.RegisterMessage((*SrPolicyAddReply)(nil), "sr_policy_add_reply_e8d4e804")
923 api.RegisterMessage((*SrPolicyDel)(nil), "sr_policy_del_cb4d48d5")
924 api.RegisterMessage((*SrPolicyDelReply)(nil), "sr_policy_del_reply_e8d4e804")
925 api.RegisterMessage((*SrPolicyMod)(nil), "sr_policy_mod_e531a102")
926 api.RegisterMessage((*SrPolicyModReply)(nil), "sr_policy_mod_reply_e8d4e804")
927 api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr_set_encap_hop_limit_aa75d7d0")
928 api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr_set_encap_hop_limit_reply_e8d4e804")
929 api.RegisterMessage((*SrSetEncapSource)(nil), "sr_set_encap_source_d3bad5e1")
930 api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr_set_encap_source_reply_e8d4e804")
931 api.RegisterMessage((*SrSteeringAddDel)(nil), "sr_steering_add_del_3711dace")
932 api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr_steering_add_del_reply_e8d4e804")
933 api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr_steering_pol_details_1c1ee786")
934 api.RegisterMessage((*SrSteeringPolDump)(nil), "sr_steering_pol_dump_51077d14")
937 // Messages returns list of all messages in this module.
938 func AllMessages() []api.Message {
939 return []api.Message{
940 (*SrLocalsidAddDel)(nil),
941 (*SrLocalsidAddDelReply)(nil),
942 (*SrLocalsidsDetails)(nil),
943 (*SrLocalsidsDump)(nil),
944 (*SrPoliciesDetails)(nil),
945 (*SrPoliciesDump)(nil),
947 (*SrPolicyAddReply)(nil),
949 (*SrPolicyDelReply)(nil),
951 (*SrPolicyModReply)(nil),
952 (*SrSetEncapHopLimit)(nil),
953 (*SrSetEncapHopLimitReply)(nil),
954 (*SrSetEncapSource)(nil),
955 (*SrSetEncapSourceReply)(nil),
956 (*SrSteeringAddDel)(nil),
957 (*SrSteeringAddDelReply)(nil),
958 (*SrSteeringPolDetails)(nil),
959 (*SrSteeringPolDump)(nil),