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 = 0xb17a64be
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 // Srv6SidListWithSlIndex defines type 'srv6_sid_list_with_sl_index'.
43 type Srv6SidListWithSlIndex struct {
44 NumSids uint8 `binapi:"u8,name=num_sids" json:"num_sids,omitempty"`
45 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
46 SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
47 Sids [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty"`
50 // SrLocalsidAddDel defines message 'sr_localsid_add_del'.
51 type SrLocalsidAddDel struct {
52 IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
53 Localsid ip_types.IP6Address `binapi:"ip6_address,name=localsid" json:"localsid,omitempty"`
54 EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
55 Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
56 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
57 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
58 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
59 NhAddr ip_types.Address `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"`
62 func (m *SrLocalsidAddDel) Reset() { *m = SrLocalsidAddDel{} }
63 func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" }
64 func (*SrLocalsidAddDel) GetCrcString() string { return "5a36c324" }
65 func (*SrLocalsidAddDel) GetMessageType() api.MessageType {
66 return api.RequestMessage
69 func (m *SrLocalsidAddDel) Size() (size int) {
74 size += 1 * 16 // m.Localsid
76 size += 1 // m.Behavior
77 size += 4 // m.SwIfIndex
78 size += 4 // m.VlanIndex
79 size += 4 // m.FibTable
80 size += 1 // m.NhAddr.Af
81 size += 1 * 16 // m.NhAddr.Un
84 func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) {
86 b = make([]byte, m.Size())
88 buf := codec.NewBuffer(b)
89 buf.EncodeBool(m.IsDel)
90 buf.EncodeBytes(m.Localsid[:], 16)
91 buf.EncodeBool(m.EndPsp)
92 buf.EncodeUint8(uint8(m.Behavior))
93 buf.EncodeUint32(uint32(m.SwIfIndex))
94 buf.EncodeUint32(m.VlanIndex)
95 buf.EncodeUint32(m.FibTable)
96 buf.EncodeUint8(uint8(m.NhAddr.Af))
97 buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 16)
98 return buf.Bytes(), nil
100 func (m *SrLocalsidAddDel) Unmarshal(b []byte) error {
101 buf := codec.NewBuffer(b)
102 m.IsDel = buf.DecodeBool()
103 copy(m.Localsid[:], buf.DecodeBytes(16))
104 m.EndPsp = buf.DecodeBool()
105 m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
106 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
107 m.VlanIndex = buf.DecodeUint32()
108 m.FibTable = buf.DecodeUint32()
109 m.NhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
110 copy(m.NhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
114 // SrLocalsidAddDelReply defines message 'sr_localsid_add_del_reply'.
115 type SrLocalsidAddDelReply struct {
116 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
119 func (m *SrLocalsidAddDelReply) Reset() { *m = SrLocalsidAddDelReply{} }
120 func (*SrLocalsidAddDelReply) GetMessageName() string { return "sr_localsid_add_del_reply" }
121 func (*SrLocalsidAddDelReply) GetCrcString() string { return "e8d4e804" }
122 func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType {
123 return api.ReplyMessage
126 func (m *SrLocalsidAddDelReply) Size() (size int) {
130 size += 4 // m.Retval
133 func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) {
135 b = make([]byte, m.Size())
137 buf := codec.NewBuffer(b)
138 buf.EncodeInt32(m.Retval)
139 return buf.Bytes(), nil
141 func (m *SrLocalsidAddDelReply) Unmarshal(b []byte) error {
142 buf := codec.NewBuffer(b)
143 m.Retval = buf.DecodeInt32()
147 // SrLocalsidsDetails defines message 'sr_localsids_details'.
148 type SrLocalsidsDetails struct {
149 Addr ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"`
150 EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
151 Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
152 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
153 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
154 XconnectNhAddr ip_types.Address `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"`
155 XconnectIfaceOrVrfTable uint32 `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"`
158 func (m *SrLocalsidsDetails) Reset() { *m = SrLocalsidsDetails{} }
159 func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" }
160 func (*SrLocalsidsDetails) GetCrcString() string { return "2e9221b9" }
161 func (*SrLocalsidsDetails) GetMessageType() api.MessageType {
162 return api.ReplyMessage
165 func (m *SrLocalsidsDetails) Size() (size int) {
169 size += 1 * 16 // m.Addr
170 size += 1 // m.EndPsp
171 size += 1 // m.Behavior
172 size += 4 // m.FibTable
173 size += 4 // m.VlanIndex
174 size += 1 // m.XconnectNhAddr.Af
175 size += 1 * 16 // m.XconnectNhAddr.Un
176 size += 4 // m.XconnectIfaceOrVrfTable
179 func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) {
181 b = make([]byte, m.Size())
183 buf := codec.NewBuffer(b)
184 buf.EncodeBytes(m.Addr[:], 16)
185 buf.EncodeBool(m.EndPsp)
186 buf.EncodeUint8(uint8(m.Behavior))
187 buf.EncodeUint32(m.FibTable)
188 buf.EncodeUint32(m.VlanIndex)
189 buf.EncodeUint8(uint8(m.XconnectNhAddr.Af))
190 buf.EncodeBytes(m.XconnectNhAddr.Un.XXX_UnionData[:], 16)
191 buf.EncodeUint32(m.XconnectIfaceOrVrfTable)
192 return buf.Bytes(), nil
194 func (m *SrLocalsidsDetails) Unmarshal(b []byte) error {
195 buf := codec.NewBuffer(b)
196 copy(m.Addr[:], buf.DecodeBytes(16))
197 m.EndPsp = buf.DecodeBool()
198 m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
199 m.FibTable = buf.DecodeUint32()
200 m.VlanIndex = buf.DecodeUint32()
201 m.XconnectNhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
202 copy(m.XconnectNhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
203 m.XconnectIfaceOrVrfTable = buf.DecodeUint32()
207 // SrLocalsidsDump defines message 'sr_localsids_dump'.
208 type SrLocalsidsDump struct{}
210 func (m *SrLocalsidsDump) Reset() { *m = SrLocalsidsDump{} }
211 func (*SrLocalsidsDump) GetMessageName() string { return "sr_localsids_dump" }
212 func (*SrLocalsidsDump) GetCrcString() string { return "51077d14" }
213 func (*SrLocalsidsDump) GetMessageType() api.MessageType {
214 return api.RequestMessage
217 func (m *SrLocalsidsDump) Size() (size int) {
223 func (m *SrLocalsidsDump) Marshal(b []byte) ([]byte, error) {
225 b = make([]byte, m.Size())
227 buf := codec.NewBuffer(b)
228 return buf.Bytes(), nil
230 func (m *SrLocalsidsDump) Unmarshal(b []byte) error {
234 // SrPoliciesDetails defines message 'sr_policies_details'.
235 type SrPoliciesDetails struct {
236 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
237 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
238 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
239 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
240 NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"-"`
241 SidLists []Srv6SidList `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
244 func (m *SrPoliciesDetails) Reset() { *m = SrPoliciesDetails{} }
245 func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" }
246 func (*SrPoliciesDetails) GetCrcString() string { return "db6ff2a1" }
247 func (*SrPoliciesDetails) GetMessageType() api.MessageType {
248 return api.ReplyMessage
251 func (m *SrPoliciesDetails) Size() (size int) {
255 size += 1 * 16 // m.Bsid
256 size += 1 // m.IsSpray
257 size += 1 // m.IsEncap
258 size += 4 // m.FibTable
259 size += 1 // m.NumSidLists
260 for j1 := 0; j1 < len(m.SidLists); j1++ {
263 if j1 < len(m.SidLists) {
266 size += 1 // s1.NumSids
267 size += 4 // s1.Weight
268 for j2 := 0; j2 < 16; j2++ {
269 size += 1 * 16 // s1.Sids[j2]
274 func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) {
276 b = make([]byte, m.Size())
278 buf := codec.NewBuffer(b)
279 buf.EncodeBytes(m.Bsid[:], 16)
280 buf.EncodeBool(m.IsSpray)
281 buf.EncodeBool(m.IsEncap)
282 buf.EncodeUint32(m.FibTable)
283 buf.EncodeUint8(uint8(len(m.SidLists)))
284 for j0 := 0; j0 < len(m.SidLists); j0++ {
285 var v0 Srv6SidList // SidLists
286 if j0 < len(m.SidLists) {
289 buf.EncodeUint8(v0.NumSids)
290 buf.EncodeUint32(v0.Weight)
291 for j1 := 0; j1 < 16; j1++ {
292 buf.EncodeBytes(v0.Sids[j1][:], 16)
295 return buf.Bytes(), nil
297 func (m *SrPoliciesDetails) Unmarshal(b []byte) error {
298 buf := codec.NewBuffer(b)
299 copy(m.Bsid[:], buf.DecodeBytes(16))
300 m.IsSpray = buf.DecodeBool()
301 m.IsEncap = buf.DecodeBool()
302 m.FibTable = buf.DecodeUint32()
303 m.NumSidLists = buf.DecodeUint8()
304 m.SidLists = make([]Srv6SidList, m.NumSidLists)
305 for j0 := 0; j0 < len(m.SidLists); j0++ {
306 m.SidLists[j0].NumSids = buf.DecodeUint8()
307 m.SidLists[j0].Weight = buf.DecodeUint32()
308 for j1 := 0; j1 < 16; j1++ {
309 copy(m.SidLists[j0].Sids[j1][:], buf.DecodeBytes(16))
315 // SrPoliciesDump defines message 'sr_policies_dump'.
316 type SrPoliciesDump struct{}
318 func (m *SrPoliciesDump) Reset() { *m = SrPoliciesDump{} }
319 func (*SrPoliciesDump) GetMessageName() string { return "sr_policies_dump" }
320 func (*SrPoliciesDump) GetCrcString() string { return "51077d14" }
321 func (*SrPoliciesDump) GetMessageType() api.MessageType {
322 return api.RequestMessage
325 func (m *SrPoliciesDump) Size() (size int) {
331 func (m *SrPoliciesDump) Marshal(b []byte) ([]byte, error) {
333 b = make([]byte, m.Size())
335 buf := codec.NewBuffer(b)
336 return buf.Bytes(), nil
338 func (m *SrPoliciesDump) Unmarshal(b []byte) error {
342 // SrPoliciesWithSlIndexDetails defines message 'sr_policies_with_sl_index_details'.
343 // InProgress: the message form may change in the future versions
344 type SrPoliciesWithSlIndexDetails struct {
345 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
346 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
347 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
348 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
349 NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"-"`
350 SidLists []Srv6SidListWithSlIndex `binapi:"srv6_sid_list_with_sl_index[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
353 func (m *SrPoliciesWithSlIndexDetails) Reset() { *m = SrPoliciesWithSlIndexDetails{} }
354 func (*SrPoliciesWithSlIndexDetails) GetMessageName() string {
355 return "sr_policies_with_sl_index_details"
357 func (*SrPoliciesWithSlIndexDetails) GetCrcString() string { return "ca2e9bc8" }
358 func (*SrPoliciesWithSlIndexDetails) GetMessageType() api.MessageType {
359 return api.ReplyMessage
362 func (m *SrPoliciesWithSlIndexDetails) Size() (size int) {
366 size += 1 * 16 // m.Bsid
367 size += 1 // m.IsSpray
368 size += 1 // m.IsEncap
369 size += 4 // m.FibTable
370 size += 1 // m.NumSidLists
371 for j1 := 0; j1 < len(m.SidLists); j1++ {
372 var s1 Srv6SidListWithSlIndex
374 if j1 < len(m.SidLists) {
377 size += 1 // s1.NumSids
378 size += 4 // s1.Weight
379 size += 4 // s1.SlIndex
380 for j2 := 0; j2 < 16; j2++ {
381 size += 1 * 16 // s1.Sids[j2]
386 func (m *SrPoliciesWithSlIndexDetails) Marshal(b []byte) ([]byte, error) {
388 b = make([]byte, m.Size())
390 buf := codec.NewBuffer(b)
391 buf.EncodeBytes(m.Bsid[:], 16)
392 buf.EncodeBool(m.IsSpray)
393 buf.EncodeBool(m.IsEncap)
394 buf.EncodeUint32(m.FibTable)
395 buf.EncodeUint8(uint8(len(m.SidLists)))
396 for j0 := 0; j0 < len(m.SidLists); j0++ {
397 var v0 Srv6SidListWithSlIndex // SidLists
398 if j0 < len(m.SidLists) {
401 buf.EncodeUint8(v0.NumSids)
402 buf.EncodeUint32(v0.Weight)
403 buf.EncodeUint32(v0.SlIndex)
404 for j1 := 0; j1 < 16; j1++ {
405 buf.EncodeBytes(v0.Sids[j1][:], 16)
408 return buf.Bytes(), nil
410 func (m *SrPoliciesWithSlIndexDetails) Unmarshal(b []byte) error {
411 buf := codec.NewBuffer(b)
412 copy(m.Bsid[:], buf.DecodeBytes(16))
413 m.IsSpray = buf.DecodeBool()
414 m.IsEncap = buf.DecodeBool()
415 m.FibTable = buf.DecodeUint32()
416 m.NumSidLists = buf.DecodeUint8()
417 m.SidLists = make([]Srv6SidListWithSlIndex, m.NumSidLists)
418 for j0 := 0; j0 < len(m.SidLists); j0++ {
419 m.SidLists[j0].NumSids = buf.DecodeUint8()
420 m.SidLists[j0].Weight = buf.DecodeUint32()
421 m.SidLists[j0].SlIndex = buf.DecodeUint32()
422 for j1 := 0; j1 < 16; j1++ {
423 copy(m.SidLists[j0].Sids[j1][:], buf.DecodeBytes(16))
429 // SrPoliciesWithSlIndexDump defines message 'sr_policies_with_sl_index_dump'.
430 // InProgress: the message form may change in the future versions
431 type SrPoliciesWithSlIndexDump struct{}
433 func (m *SrPoliciesWithSlIndexDump) Reset() { *m = SrPoliciesWithSlIndexDump{} }
434 func (*SrPoliciesWithSlIndexDump) GetMessageName() string { return "sr_policies_with_sl_index_dump" }
435 func (*SrPoliciesWithSlIndexDump) GetCrcString() string { return "51077d14" }
436 func (*SrPoliciesWithSlIndexDump) GetMessageType() api.MessageType {
437 return api.RequestMessage
440 func (m *SrPoliciesWithSlIndexDump) Size() (size int) {
446 func (m *SrPoliciesWithSlIndexDump) Marshal(b []byte) ([]byte, error) {
448 b = make([]byte, m.Size())
450 buf := codec.NewBuffer(b)
451 return buf.Bytes(), nil
453 func (m *SrPoliciesWithSlIndexDump) Unmarshal(b []byte) error {
457 // SrPolicyAdd defines message 'sr_policy_add'.
458 type SrPolicyAdd struct {
459 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
460 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
461 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
462 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
463 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
464 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
467 func (m *SrPolicyAdd) Reset() { *m = SrPolicyAdd{} }
468 func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" }
469 func (*SrPolicyAdd) GetCrcString() string { return "44ac92e8" }
470 func (*SrPolicyAdd) GetMessageType() api.MessageType {
471 return api.RequestMessage
474 func (m *SrPolicyAdd) Size() (size int) {
478 size += 1 * 16 // m.BsidAddr
479 size += 4 // m.Weight
480 size += 1 // m.IsEncap
481 size += 1 // m.IsSpray
482 size += 4 // m.FibTable
483 size += 1 // m.Sids.NumSids
484 size += 4 // m.Sids.Weight
485 for j2 := 0; j2 < 16; j2++ {
486 size += 1 * 16 // m.Sids.Sids[j2]
490 func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) {
492 b = make([]byte, m.Size())
494 buf := codec.NewBuffer(b)
495 buf.EncodeBytes(m.BsidAddr[:], 16)
496 buf.EncodeUint32(m.Weight)
497 buf.EncodeBool(m.IsEncap)
498 buf.EncodeBool(m.IsSpray)
499 buf.EncodeUint32(m.FibTable)
500 buf.EncodeUint8(m.Sids.NumSids)
501 buf.EncodeUint32(m.Sids.Weight)
502 for j1 := 0; j1 < 16; j1++ {
503 buf.EncodeBytes(m.Sids.Sids[j1][:], 16)
505 return buf.Bytes(), nil
507 func (m *SrPolicyAdd) Unmarshal(b []byte) error {
508 buf := codec.NewBuffer(b)
509 copy(m.BsidAddr[:], buf.DecodeBytes(16))
510 m.Weight = buf.DecodeUint32()
511 m.IsEncap = buf.DecodeBool()
512 m.IsSpray = buf.DecodeBool()
513 m.FibTable = buf.DecodeUint32()
514 m.Sids.NumSids = buf.DecodeUint8()
515 m.Sids.Weight = buf.DecodeUint32()
516 for j1 := 0; j1 < 16; j1++ {
517 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
522 // SrPolicyAddReply defines message 'sr_policy_add_reply'.
523 type SrPolicyAddReply struct {
524 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
527 func (m *SrPolicyAddReply) Reset() { *m = SrPolicyAddReply{} }
528 func (*SrPolicyAddReply) GetMessageName() string { return "sr_policy_add_reply" }
529 func (*SrPolicyAddReply) GetCrcString() string { return "e8d4e804" }
530 func (*SrPolicyAddReply) GetMessageType() api.MessageType {
531 return api.ReplyMessage
534 func (m *SrPolicyAddReply) Size() (size int) {
538 size += 4 // m.Retval
541 func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) {
543 b = make([]byte, m.Size())
545 buf := codec.NewBuffer(b)
546 buf.EncodeInt32(m.Retval)
547 return buf.Bytes(), nil
549 func (m *SrPolicyAddReply) Unmarshal(b []byte) error {
550 buf := codec.NewBuffer(b)
551 m.Retval = buf.DecodeInt32()
555 // SrPolicyDel defines message 'sr_policy_del'.
556 type SrPolicyDel struct {
557 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
558 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
561 func (m *SrPolicyDel) Reset() { *m = SrPolicyDel{} }
562 func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" }
563 func (*SrPolicyDel) GetCrcString() string { return "cb4d48d5" }
564 func (*SrPolicyDel) GetMessageType() api.MessageType {
565 return api.RequestMessage
568 func (m *SrPolicyDel) Size() (size int) {
572 size += 1 * 16 // m.BsidAddr
573 size += 4 // m.SrPolicyIndex
576 func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) {
578 b = make([]byte, m.Size())
580 buf := codec.NewBuffer(b)
581 buf.EncodeBytes(m.BsidAddr[:], 16)
582 buf.EncodeUint32(m.SrPolicyIndex)
583 return buf.Bytes(), nil
585 func (m *SrPolicyDel) Unmarshal(b []byte) error {
586 buf := codec.NewBuffer(b)
587 copy(m.BsidAddr[:], buf.DecodeBytes(16))
588 m.SrPolicyIndex = buf.DecodeUint32()
592 // SrPolicyDelReply defines message 'sr_policy_del_reply'.
593 type SrPolicyDelReply struct {
594 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
597 func (m *SrPolicyDelReply) Reset() { *m = SrPolicyDelReply{} }
598 func (*SrPolicyDelReply) GetMessageName() string { return "sr_policy_del_reply" }
599 func (*SrPolicyDelReply) GetCrcString() string { return "e8d4e804" }
600 func (*SrPolicyDelReply) GetMessageType() api.MessageType {
601 return api.ReplyMessage
604 func (m *SrPolicyDelReply) Size() (size int) {
608 size += 4 // m.Retval
611 func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) {
613 b = make([]byte, m.Size())
615 buf := codec.NewBuffer(b)
616 buf.EncodeInt32(m.Retval)
617 return buf.Bytes(), nil
619 func (m *SrPolicyDelReply) Unmarshal(b []byte) error {
620 buf := codec.NewBuffer(b)
621 m.Retval = buf.DecodeInt32()
625 // SrPolicyMod defines message 'sr_policy_mod'.
626 type SrPolicyMod struct {
627 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
628 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
629 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
630 Operation sr_types.SrPolicyOp `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"`
631 SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
632 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
633 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
636 func (m *SrPolicyMod) Reset() { *m = SrPolicyMod{} }
637 func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" }
638 func (*SrPolicyMod) GetCrcString() string { return "b97bb56e" }
639 func (*SrPolicyMod) GetMessageType() api.MessageType {
640 return api.RequestMessage
643 func (m *SrPolicyMod) Size() (size int) {
647 size += 1 * 16 // m.BsidAddr
648 size += 4 // m.SrPolicyIndex
649 size += 4 // m.FibTable
650 size += 1 // m.Operation
651 size += 4 // m.SlIndex
652 size += 4 // m.Weight
653 size += 1 // m.Sids.NumSids
654 size += 4 // m.Sids.Weight
655 for j2 := 0; j2 < 16; j2++ {
656 size += 1 * 16 // m.Sids.Sids[j2]
660 func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) {
662 b = make([]byte, m.Size())
664 buf := codec.NewBuffer(b)
665 buf.EncodeBytes(m.BsidAddr[:], 16)
666 buf.EncodeUint32(m.SrPolicyIndex)
667 buf.EncodeUint32(m.FibTable)
668 buf.EncodeUint8(uint8(m.Operation))
669 buf.EncodeUint32(m.SlIndex)
670 buf.EncodeUint32(m.Weight)
671 buf.EncodeUint8(m.Sids.NumSids)
672 buf.EncodeUint32(m.Sids.Weight)
673 for j1 := 0; j1 < 16; j1++ {
674 buf.EncodeBytes(m.Sids.Sids[j1][:], 16)
676 return buf.Bytes(), nil
678 func (m *SrPolicyMod) Unmarshal(b []byte) error {
679 buf := codec.NewBuffer(b)
680 copy(m.BsidAddr[:], buf.DecodeBytes(16))
681 m.SrPolicyIndex = buf.DecodeUint32()
682 m.FibTable = buf.DecodeUint32()
683 m.Operation = sr_types.SrPolicyOp(buf.DecodeUint8())
684 m.SlIndex = buf.DecodeUint32()
685 m.Weight = buf.DecodeUint32()
686 m.Sids.NumSids = buf.DecodeUint8()
687 m.Sids.Weight = buf.DecodeUint32()
688 for j1 := 0; j1 < 16; j1++ {
689 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
694 // SrPolicyModReply defines message 'sr_policy_mod_reply'.
695 type SrPolicyModReply struct {
696 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
699 func (m *SrPolicyModReply) Reset() { *m = SrPolicyModReply{} }
700 func (*SrPolicyModReply) GetMessageName() string { return "sr_policy_mod_reply" }
701 func (*SrPolicyModReply) GetCrcString() string { return "e8d4e804" }
702 func (*SrPolicyModReply) GetMessageType() api.MessageType {
703 return api.ReplyMessage
706 func (m *SrPolicyModReply) Size() (size int) {
710 size += 4 // m.Retval
713 func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) {
715 b = make([]byte, m.Size())
717 buf := codec.NewBuffer(b)
718 buf.EncodeInt32(m.Retval)
719 return buf.Bytes(), nil
721 func (m *SrPolicyModReply) Unmarshal(b []byte) error {
722 buf := codec.NewBuffer(b)
723 m.Retval = buf.DecodeInt32()
727 // SrSetEncapHopLimit defines message 'sr_set_encap_hop_limit'.
728 type SrSetEncapHopLimit struct {
729 HopLimit uint8 `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
732 func (m *SrSetEncapHopLimit) Reset() { *m = SrSetEncapHopLimit{} }
733 func (*SrSetEncapHopLimit) GetMessageName() string { return "sr_set_encap_hop_limit" }
734 func (*SrSetEncapHopLimit) GetCrcString() string { return "aa75d7d0" }
735 func (*SrSetEncapHopLimit) GetMessageType() api.MessageType {
736 return api.RequestMessage
739 func (m *SrSetEncapHopLimit) Size() (size int) {
743 size += 1 // m.HopLimit
746 func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) {
748 b = make([]byte, m.Size())
750 buf := codec.NewBuffer(b)
751 buf.EncodeUint8(m.HopLimit)
752 return buf.Bytes(), nil
754 func (m *SrSetEncapHopLimit) Unmarshal(b []byte) error {
755 buf := codec.NewBuffer(b)
756 m.HopLimit = buf.DecodeUint8()
760 // SrSetEncapHopLimitReply defines message 'sr_set_encap_hop_limit_reply'.
761 type SrSetEncapHopLimitReply struct {
762 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
765 func (m *SrSetEncapHopLimitReply) Reset() { *m = SrSetEncapHopLimitReply{} }
766 func (*SrSetEncapHopLimitReply) GetMessageName() string { return "sr_set_encap_hop_limit_reply" }
767 func (*SrSetEncapHopLimitReply) GetCrcString() string { return "e8d4e804" }
768 func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType {
769 return api.ReplyMessage
772 func (m *SrSetEncapHopLimitReply) Size() (size int) {
776 size += 4 // m.Retval
779 func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) {
781 b = make([]byte, m.Size())
783 buf := codec.NewBuffer(b)
784 buf.EncodeInt32(m.Retval)
785 return buf.Bytes(), nil
787 func (m *SrSetEncapHopLimitReply) Unmarshal(b []byte) error {
788 buf := codec.NewBuffer(b)
789 m.Retval = buf.DecodeInt32()
793 // SrSetEncapSource defines message 'sr_set_encap_source'.
794 type SrSetEncapSource struct {
795 EncapsSource ip_types.IP6Address `binapi:"ip6_address,name=encaps_source" json:"encaps_source,omitempty"`
798 func (m *SrSetEncapSource) Reset() { *m = SrSetEncapSource{} }
799 func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" }
800 func (*SrSetEncapSource) GetCrcString() string { return "d3bad5e1" }
801 func (*SrSetEncapSource) GetMessageType() api.MessageType {
802 return api.RequestMessage
805 func (m *SrSetEncapSource) Size() (size int) {
809 size += 1 * 16 // m.EncapsSource
812 func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) {
814 b = make([]byte, m.Size())
816 buf := codec.NewBuffer(b)
817 buf.EncodeBytes(m.EncapsSource[:], 16)
818 return buf.Bytes(), nil
820 func (m *SrSetEncapSource) Unmarshal(b []byte) error {
821 buf := codec.NewBuffer(b)
822 copy(m.EncapsSource[:], buf.DecodeBytes(16))
826 // SrSetEncapSourceReply defines message 'sr_set_encap_source_reply'.
827 type SrSetEncapSourceReply struct {
828 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
831 func (m *SrSetEncapSourceReply) Reset() { *m = SrSetEncapSourceReply{} }
832 func (*SrSetEncapSourceReply) GetMessageName() string { return "sr_set_encap_source_reply" }
833 func (*SrSetEncapSourceReply) GetCrcString() string { return "e8d4e804" }
834 func (*SrSetEncapSourceReply) GetMessageType() api.MessageType {
835 return api.ReplyMessage
838 func (m *SrSetEncapSourceReply) Size() (size int) {
842 size += 4 // m.Retval
845 func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) {
847 b = make([]byte, m.Size())
849 buf := codec.NewBuffer(b)
850 buf.EncodeInt32(m.Retval)
851 return buf.Bytes(), nil
853 func (m *SrSetEncapSourceReply) Unmarshal(b []byte) error {
854 buf := codec.NewBuffer(b)
855 m.Retval = buf.DecodeInt32()
859 // SrSteeringAddDel defines message 'sr_steering_add_del'.
860 type SrSteeringAddDel struct {
861 IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
862 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
863 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
864 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
865 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
866 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
867 TrafficType sr_types.SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
870 func (m *SrSteeringAddDel) Reset() { *m = SrSteeringAddDel{} }
871 func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" }
872 func (*SrSteeringAddDel) GetCrcString() string { return "e46b0a0f" }
873 func (*SrSteeringAddDel) GetMessageType() api.MessageType {
874 return api.RequestMessage
877 func (m *SrSteeringAddDel) Size() (size int) {
882 size += 1 * 16 // m.BsidAddr
883 size += 4 // m.SrPolicyIndex
884 size += 4 // m.TableID
885 size += 1 // m.Prefix.Address.Af
886 size += 1 * 16 // m.Prefix.Address.Un
887 size += 1 // m.Prefix.Len
888 size += 4 // m.SwIfIndex
889 size += 1 // m.TrafficType
892 func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) {
894 b = make([]byte, m.Size())
896 buf := codec.NewBuffer(b)
897 buf.EncodeBool(m.IsDel)
898 buf.EncodeBytes(m.BsidAddr[:], 16)
899 buf.EncodeUint32(m.SrPolicyIndex)
900 buf.EncodeUint32(m.TableID)
901 buf.EncodeUint8(uint8(m.Prefix.Address.Af))
902 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
903 buf.EncodeUint8(m.Prefix.Len)
904 buf.EncodeUint32(uint32(m.SwIfIndex))
905 buf.EncodeUint8(uint8(m.TrafficType))
906 return buf.Bytes(), nil
908 func (m *SrSteeringAddDel) Unmarshal(b []byte) error {
909 buf := codec.NewBuffer(b)
910 m.IsDel = buf.DecodeBool()
911 copy(m.BsidAddr[:], buf.DecodeBytes(16))
912 m.SrPolicyIndex = buf.DecodeUint32()
913 m.TableID = buf.DecodeUint32()
914 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
915 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
916 m.Prefix.Len = buf.DecodeUint8()
917 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
918 m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
922 // SrSteeringAddDelReply defines message 'sr_steering_add_del_reply'.
923 type SrSteeringAddDelReply struct {
924 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
927 func (m *SrSteeringAddDelReply) Reset() { *m = SrSteeringAddDelReply{} }
928 func (*SrSteeringAddDelReply) GetMessageName() string { return "sr_steering_add_del_reply" }
929 func (*SrSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
930 func (*SrSteeringAddDelReply) GetMessageType() api.MessageType {
931 return api.ReplyMessage
934 func (m *SrSteeringAddDelReply) Size() (size int) {
938 size += 4 // m.Retval
941 func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
943 b = make([]byte, m.Size())
945 buf := codec.NewBuffer(b)
946 buf.EncodeInt32(m.Retval)
947 return buf.Bytes(), nil
949 func (m *SrSteeringAddDelReply) Unmarshal(b []byte) error {
950 buf := codec.NewBuffer(b)
951 m.Retval = buf.DecodeInt32()
955 // SrSteeringPolDetails defines message 'sr_steering_pol_details'.
956 type SrSteeringPolDetails struct {
957 TrafficType sr_types.SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
958 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
959 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
960 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
961 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
964 func (m *SrSteeringPolDetails) Reset() { *m = SrSteeringPolDetails{} }
965 func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" }
966 func (*SrSteeringPolDetails) GetCrcString() string { return "d41258c9" }
967 func (*SrSteeringPolDetails) GetMessageType() api.MessageType {
968 return api.ReplyMessage
971 func (m *SrSteeringPolDetails) Size() (size int) {
975 size += 1 // m.TrafficType
976 size += 4 // m.FibTable
977 size += 1 // m.Prefix.Address.Af
978 size += 1 * 16 // m.Prefix.Address.Un
979 size += 1 // m.Prefix.Len
980 size += 4 // m.SwIfIndex
981 size += 1 * 16 // m.Bsid
984 func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) {
986 b = make([]byte, m.Size())
988 buf := codec.NewBuffer(b)
989 buf.EncodeUint8(uint8(m.TrafficType))
990 buf.EncodeUint32(m.FibTable)
991 buf.EncodeUint8(uint8(m.Prefix.Address.Af))
992 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
993 buf.EncodeUint8(m.Prefix.Len)
994 buf.EncodeUint32(uint32(m.SwIfIndex))
995 buf.EncodeBytes(m.Bsid[:], 16)
996 return buf.Bytes(), nil
998 func (m *SrSteeringPolDetails) Unmarshal(b []byte) error {
999 buf := codec.NewBuffer(b)
1000 m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
1001 m.FibTable = buf.DecodeUint32()
1002 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
1003 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1004 m.Prefix.Len = buf.DecodeUint8()
1005 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1006 copy(m.Bsid[:], buf.DecodeBytes(16))
1010 // SrSteeringPolDump defines message 'sr_steering_pol_dump'.
1011 type SrSteeringPolDump struct{}
1013 func (m *SrSteeringPolDump) Reset() { *m = SrSteeringPolDump{} }
1014 func (*SrSteeringPolDump) GetMessageName() string { return "sr_steering_pol_dump" }
1015 func (*SrSteeringPolDump) GetCrcString() string { return "51077d14" }
1016 func (*SrSteeringPolDump) GetMessageType() api.MessageType {
1017 return api.RequestMessage
1020 func (m *SrSteeringPolDump) Size() (size int) {
1026 func (m *SrSteeringPolDump) Marshal(b []byte) ([]byte, error) {
1028 b = make([]byte, m.Size())
1030 buf := codec.NewBuffer(b)
1031 return buf.Bytes(), nil
1033 func (m *SrSteeringPolDump) Unmarshal(b []byte) error {
1037 func init() { file_sr_binapi_init() }
1038 func file_sr_binapi_init() {
1039 api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr_localsid_add_del_5a36c324")
1040 api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr_localsid_add_del_reply_e8d4e804")
1041 api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr_localsids_details_2e9221b9")
1042 api.RegisterMessage((*SrLocalsidsDump)(nil), "sr_localsids_dump_51077d14")
1043 api.RegisterMessage((*SrPoliciesDetails)(nil), "sr_policies_details_db6ff2a1")
1044 api.RegisterMessage((*SrPoliciesDump)(nil), "sr_policies_dump_51077d14")
1045 api.RegisterMessage((*SrPoliciesWithSlIndexDetails)(nil), "sr_policies_with_sl_index_details_ca2e9bc8")
1046 api.RegisterMessage((*SrPoliciesWithSlIndexDump)(nil), "sr_policies_with_sl_index_dump_51077d14")
1047 api.RegisterMessage((*SrPolicyAdd)(nil), "sr_policy_add_44ac92e8")
1048 api.RegisterMessage((*SrPolicyAddReply)(nil), "sr_policy_add_reply_e8d4e804")
1049 api.RegisterMessage((*SrPolicyDel)(nil), "sr_policy_del_cb4d48d5")
1050 api.RegisterMessage((*SrPolicyDelReply)(nil), "sr_policy_del_reply_e8d4e804")
1051 api.RegisterMessage((*SrPolicyMod)(nil), "sr_policy_mod_b97bb56e")
1052 api.RegisterMessage((*SrPolicyModReply)(nil), "sr_policy_mod_reply_e8d4e804")
1053 api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr_set_encap_hop_limit_aa75d7d0")
1054 api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr_set_encap_hop_limit_reply_e8d4e804")
1055 api.RegisterMessage((*SrSetEncapSource)(nil), "sr_set_encap_source_d3bad5e1")
1056 api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr_set_encap_source_reply_e8d4e804")
1057 api.RegisterMessage((*SrSteeringAddDel)(nil), "sr_steering_add_del_e46b0a0f")
1058 api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr_steering_add_del_reply_e8d4e804")
1059 api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr_steering_pol_details_d41258c9")
1060 api.RegisterMessage((*SrSteeringPolDump)(nil), "sr_steering_pol_dump_51077d14")
1063 // Messages returns list of all messages in this module.
1064 func AllMessages() []api.Message {
1065 return []api.Message{
1066 (*SrLocalsidAddDel)(nil),
1067 (*SrLocalsidAddDelReply)(nil),
1068 (*SrLocalsidsDetails)(nil),
1069 (*SrLocalsidsDump)(nil),
1070 (*SrPoliciesDetails)(nil),
1071 (*SrPoliciesDump)(nil),
1072 (*SrPoliciesWithSlIndexDetails)(nil),
1073 (*SrPoliciesWithSlIndexDump)(nil),
1074 (*SrPolicyAdd)(nil),
1075 (*SrPolicyAddReply)(nil),
1076 (*SrPolicyDel)(nil),
1077 (*SrPolicyDelReply)(nil),
1078 (*SrPolicyMod)(nil),
1079 (*SrPolicyModReply)(nil),
1080 (*SrSetEncapHopLimit)(nil),
1081 (*SrSetEncapHopLimitReply)(nil),
1082 (*SrSetEncapSource)(nil),
1083 (*SrSetEncapSourceReply)(nil),
1084 (*SrSteeringAddDel)(nil),
1085 (*SrSteeringAddDelReply)(nil),
1086 (*SrSteeringPolDetails)(nil),
1087 (*SrSteeringPolDump)(nil),