1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/core/sr.api.json
7 // Package sr contains generated bindings for API file sr.api.
16 api "git.fd.io/govpp.git/api"
17 codec "git.fd.io/govpp.git/codec"
20 // This is a compile-time assertion to ensure that this generated file
21 // is compatible with the GoVPP api package it is being compiled against.
22 // A compilation error at this line likely means your copy of the
23 // GoVPP api package needs to be updated.
24 const _ = api.GoVppAPIPackageIsVersion2
29 VersionCrc = 0xbf277f96
32 // SrIP6Address defines type 'sr_ip6_address'.
33 type SrIP6Address struct {
34 Data []byte `binapi:"u8[16],name=data" json:"data,omitempty"`
37 // Srv6Sid defines type 'srv6_sid'.
39 Addr []byte `binapi:"u8[16],name=addr" json:"addr,omitempty"`
42 // Srv6SidList defines type 'srv6_sid_list'.
43 type Srv6SidList struct {
44 NumSids uint8 `binapi:"u8,name=num_sids" json:"num_sids,omitempty"`
45 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
46 Sids [16]Srv6Sid `binapi:"srv6_sid[16],name=sids" json:"sids,omitempty"`
49 // SrLocalsidAddDel defines message 'sr_localsid_add_del'.
50 type SrLocalsidAddDel struct {
51 IsDel uint8 `binapi:"u8,name=is_del" json:"is_del,omitempty"`
52 Localsid Srv6Sid `binapi:"srv6_sid,name=localsid" json:"localsid,omitempty"`
53 EndPsp uint8 `binapi:"u8,name=end_psp" json:"end_psp,omitempty"`
54 Behavior uint8 `binapi:"u8,name=behavior" json:"behavior,omitempty"`
55 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
56 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
57 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
58 NhAddr6 []byte `binapi:"u8[16],name=nh_addr6" json:"nh_addr6,omitempty"`
59 NhAddr4 []byte `binapi:"u8[4],name=nh_addr4" json:"nh_addr4,omitempty"`
62 func (m *SrLocalsidAddDel) Reset() { *m = SrLocalsidAddDel{} }
63 func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" }
64 func (*SrLocalsidAddDel) GetCrcString() string { return "b30489eb" }
65 func (*SrLocalsidAddDel) GetMessageType() api.MessageType {
66 return api.RequestMessage
69 func (m *SrLocalsidAddDel) Size() (size int) {
74 size += 1 * 16 // m.Localsid.Addr
76 size += 1 // m.Behavior
77 size += 4 // m.SwIfIndex
78 size += 4 // m.VlanIndex
79 size += 4 // m.FibTable
80 size += 1 * 16 // m.NhAddr6
81 size += 1 * 4 // m.NhAddr4
84 func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) {
86 b = make([]byte, m.Size())
88 buf := codec.NewBuffer(b)
89 buf.EncodeUint8(m.IsDel)
90 buf.EncodeBytes(m.Localsid.Addr, 16)
91 buf.EncodeUint8(m.EndPsp)
92 buf.EncodeUint8(m.Behavior)
93 buf.EncodeUint32(m.SwIfIndex)
94 buf.EncodeUint32(m.VlanIndex)
95 buf.EncodeUint32(m.FibTable)
96 buf.EncodeBytes(m.NhAddr6, 16)
97 buf.EncodeBytes(m.NhAddr4, 4)
98 return buf.Bytes(), nil
100 func (m *SrLocalsidAddDel) Unmarshal(b []byte) error {
101 buf := codec.NewBuffer(b)
102 m.IsDel = buf.DecodeUint8()
103 m.Localsid.Addr = make([]byte, 16)
104 copy(m.Localsid.Addr, buf.DecodeBytes(len(m.Localsid.Addr)))
105 m.EndPsp = buf.DecodeUint8()
106 m.Behavior = buf.DecodeUint8()
107 m.SwIfIndex = buf.DecodeUint32()
108 m.VlanIndex = buf.DecodeUint32()
109 m.FibTable = buf.DecodeUint32()
110 m.NhAddr6 = make([]byte, 16)
111 copy(m.NhAddr6, buf.DecodeBytes(len(m.NhAddr6)))
112 m.NhAddr4 = make([]byte, 4)
113 copy(m.NhAddr4, buf.DecodeBytes(len(m.NhAddr4)))
117 // SrLocalsidAddDelReply defines message 'sr_localsid_add_del_reply'.
118 type SrLocalsidAddDelReply struct {
119 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
122 func (m *SrLocalsidAddDelReply) Reset() { *m = SrLocalsidAddDelReply{} }
123 func (*SrLocalsidAddDelReply) GetMessageName() string { return "sr_localsid_add_del_reply" }
124 func (*SrLocalsidAddDelReply) GetCrcString() string { return "e8d4e804" }
125 func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType {
126 return api.ReplyMessage
129 func (m *SrLocalsidAddDelReply) Size() (size int) {
133 size += 4 // m.Retval
136 func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) {
138 b = make([]byte, m.Size())
140 buf := codec.NewBuffer(b)
141 buf.EncodeInt32(m.Retval)
142 return buf.Bytes(), nil
144 func (m *SrLocalsidAddDelReply) Unmarshal(b []byte) error {
145 buf := codec.NewBuffer(b)
146 m.Retval = buf.DecodeInt32()
150 // SrLocalsidsDetails defines message 'sr_localsids_details'.
151 type SrLocalsidsDetails struct {
152 Addr Srv6Sid `binapi:"srv6_sid,name=addr" json:"addr,omitempty"`
153 EndPsp uint8 `binapi:"u8,name=end_psp" json:"end_psp,omitempty"`
154 Behavior uint16 `binapi:"u16,name=behavior" json:"behavior,omitempty"`
155 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
156 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
157 XconnectNhAddr6 []byte `binapi:"u8[16],name=xconnect_nh_addr6" json:"xconnect_nh_addr6,omitempty"`
158 XconnectNhAddr4 []byte `binapi:"u8[4],name=xconnect_nh_addr4" json:"xconnect_nh_addr4,omitempty"`
159 XconnectIfaceOrVrfTable uint32 `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"`
162 func (m *SrLocalsidsDetails) Reset() { *m = SrLocalsidsDetails{} }
163 func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" }
164 func (*SrLocalsidsDetails) GetCrcString() string { return "0791babc" }
165 func (*SrLocalsidsDetails) GetMessageType() api.MessageType {
166 return api.ReplyMessage
169 func (m *SrLocalsidsDetails) Size() (size int) {
173 size += 1 * 16 // m.Addr.Addr
174 size += 1 // m.EndPsp
175 size += 2 // m.Behavior
176 size += 4 // m.FibTable
177 size += 4 // m.VlanIndex
178 size += 1 * 16 // m.XconnectNhAddr6
179 size += 1 * 4 // m.XconnectNhAddr4
180 size += 4 // m.XconnectIfaceOrVrfTable
183 func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) {
185 b = make([]byte, m.Size())
187 buf := codec.NewBuffer(b)
188 buf.EncodeBytes(m.Addr.Addr, 16)
189 buf.EncodeUint8(m.EndPsp)
190 buf.EncodeUint16(m.Behavior)
191 buf.EncodeUint32(m.FibTable)
192 buf.EncodeUint32(m.VlanIndex)
193 buf.EncodeBytes(m.XconnectNhAddr6, 16)
194 buf.EncodeBytes(m.XconnectNhAddr4, 4)
195 buf.EncodeUint32(m.XconnectIfaceOrVrfTable)
196 return buf.Bytes(), nil
198 func (m *SrLocalsidsDetails) Unmarshal(b []byte) error {
199 buf := codec.NewBuffer(b)
200 m.Addr.Addr = make([]byte, 16)
201 copy(m.Addr.Addr, buf.DecodeBytes(len(m.Addr.Addr)))
202 m.EndPsp = buf.DecodeUint8()
203 m.Behavior = buf.DecodeUint16()
204 m.FibTable = buf.DecodeUint32()
205 m.VlanIndex = buf.DecodeUint32()
206 m.XconnectNhAddr6 = make([]byte, 16)
207 copy(m.XconnectNhAddr6, buf.DecodeBytes(len(m.XconnectNhAddr6)))
208 m.XconnectNhAddr4 = make([]byte, 4)
209 copy(m.XconnectNhAddr4, buf.DecodeBytes(len(m.XconnectNhAddr4)))
210 m.XconnectIfaceOrVrfTable = buf.DecodeUint32()
214 // SrLocalsidsDump defines message 'sr_localsids_dump'.
215 type SrLocalsidsDump struct{}
217 func (m *SrLocalsidsDump) Reset() { *m = SrLocalsidsDump{} }
218 func (*SrLocalsidsDump) GetMessageName() string { return "sr_localsids_dump" }
219 func (*SrLocalsidsDump) GetCrcString() string { return "51077d14" }
220 func (*SrLocalsidsDump) GetMessageType() api.MessageType {
221 return api.RequestMessage
224 func (m *SrLocalsidsDump) Size() (size int) {
230 func (m *SrLocalsidsDump) Marshal(b []byte) ([]byte, error) {
232 b = make([]byte, m.Size())
234 buf := codec.NewBuffer(b)
235 return buf.Bytes(), nil
237 func (m *SrLocalsidsDump) Unmarshal(b []byte) error {
241 // SrPoliciesDetails defines message 'sr_policies_details'.
242 type SrPoliciesDetails struct {
243 Bsid Srv6Sid `binapi:"srv6_sid,name=bsid" json:"bsid,omitempty"`
244 Type uint8 `binapi:"u8,name=type" json:"type,omitempty"`
245 IsEncap uint8 `binapi:"u8,name=is_encap" json:"is_encap,omitempty"`
246 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
247 NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"-"`
248 SidLists []Srv6SidList `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
251 func (m *SrPoliciesDetails) Reset() { *m = SrPoliciesDetails{} }
252 func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" }
253 func (*SrPoliciesDetails) GetCrcString() string { return "5087f460" }
254 func (*SrPoliciesDetails) GetMessageType() api.MessageType {
255 return api.ReplyMessage
258 func (m *SrPoliciesDetails) Size() (size int) {
262 size += 1 * 16 // m.Bsid.Addr
264 size += 1 // m.IsEncap
265 size += 4 // m.FibTable
266 size += 1 // m.NumSidLists
267 for j1 := 0; j1 < len(m.SidLists); j1++ {
270 if j1 < len(m.SidLists) {
273 size += 1 // s1.NumSids
274 size += 4 // s1.Weight
275 for j2 := 0; j2 < 16; j2++ {
276 size += 1 * 16 // s1.Sids[j2].Addr
281 func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) {
283 b = make([]byte, m.Size())
285 buf := codec.NewBuffer(b)
286 buf.EncodeBytes(m.Bsid.Addr, 16)
287 buf.EncodeUint8(m.Type)
288 buf.EncodeUint8(m.IsEncap)
289 buf.EncodeUint32(m.FibTable)
290 buf.EncodeUint8(uint8(len(m.SidLists)))
291 for j0 := 0; j0 < len(m.SidLists); j0++ {
292 var v0 Srv6SidList // SidLists
293 if j0 < len(m.SidLists) {
296 buf.EncodeUint8(v0.NumSids)
297 buf.EncodeUint32(v0.Weight)
298 for j1 := 0; j1 < 16; j1++ {
299 buf.EncodeBytes(v0.Sids[j1].Addr, 16)
302 return buf.Bytes(), nil
304 func (m *SrPoliciesDetails) Unmarshal(b []byte) error {
305 buf := codec.NewBuffer(b)
306 m.Bsid.Addr = make([]byte, 16)
307 copy(m.Bsid.Addr, buf.DecodeBytes(len(m.Bsid.Addr)))
308 m.Type = buf.DecodeUint8()
309 m.IsEncap = buf.DecodeUint8()
310 m.FibTable = buf.DecodeUint32()
311 m.NumSidLists = buf.DecodeUint8()
312 m.SidLists = make([]Srv6SidList, m.NumSidLists)
313 for j0 := 0; j0 < len(m.SidLists); j0++ {
314 m.SidLists[j0].NumSids = buf.DecodeUint8()
315 m.SidLists[j0].Weight = buf.DecodeUint32()
316 for j1 := 0; j1 < 16; j1++ {
317 m.SidLists[j0].Sids[j1].Addr = make([]byte, 16)
318 copy(m.SidLists[j0].Sids[j1].Addr, buf.DecodeBytes(len(m.SidLists[j0].Sids[j1].Addr)))
324 // SrPoliciesDump defines message 'sr_policies_dump'.
325 type SrPoliciesDump struct{}
327 func (m *SrPoliciesDump) Reset() { *m = SrPoliciesDump{} }
328 func (*SrPoliciesDump) GetMessageName() string { return "sr_policies_dump" }
329 func (*SrPoliciesDump) GetCrcString() string { return "51077d14" }
330 func (*SrPoliciesDump) GetMessageType() api.MessageType {
331 return api.RequestMessage
334 func (m *SrPoliciesDump) Size() (size int) {
340 func (m *SrPoliciesDump) Marshal(b []byte) ([]byte, error) {
342 b = make([]byte, m.Size())
344 buf := codec.NewBuffer(b)
345 return buf.Bytes(), nil
347 func (m *SrPoliciesDump) Unmarshal(b []byte) error {
351 // SrPolicyAdd defines message 'sr_policy_add'.
352 type SrPolicyAdd struct {
353 BsidAddr []byte `binapi:"u8[16],name=bsid_addr" json:"bsid_addr,omitempty"`
354 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
355 IsEncap uint8 `binapi:"u8,name=is_encap" json:"is_encap,omitempty"`
356 Type uint8 `binapi:"u8,name=type" json:"type,omitempty"`
357 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
358 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
361 func (m *SrPolicyAdd) Reset() { *m = SrPolicyAdd{} }
362 func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" }
363 func (*SrPolicyAdd) GetCrcString() string { return "4b6e2484" }
364 func (*SrPolicyAdd) GetMessageType() api.MessageType {
365 return api.RequestMessage
368 func (m *SrPolicyAdd) Size() (size int) {
372 size += 1 * 16 // m.BsidAddr
373 size += 4 // m.Weight
374 size += 1 // m.IsEncap
376 size += 4 // m.FibTable
377 size += 1 // m.Sids.NumSids
378 size += 4 // m.Sids.Weight
379 for j2 := 0; j2 < 16; j2++ {
380 size += 1 * 16 // m.Sids.Sids[j2].Addr
384 func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) {
386 b = make([]byte, m.Size())
388 buf := codec.NewBuffer(b)
389 buf.EncodeBytes(m.BsidAddr, 16)
390 buf.EncodeUint32(m.Weight)
391 buf.EncodeUint8(m.IsEncap)
392 buf.EncodeUint8(m.Type)
393 buf.EncodeUint32(m.FibTable)
394 buf.EncodeUint8(m.Sids.NumSids)
395 buf.EncodeUint32(m.Sids.Weight)
396 for j1 := 0; j1 < 16; j1++ {
397 buf.EncodeBytes(m.Sids.Sids[j1].Addr, 16)
399 return buf.Bytes(), nil
401 func (m *SrPolicyAdd) Unmarshal(b []byte) error {
402 buf := codec.NewBuffer(b)
403 m.BsidAddr = make([]byte, 16)
404 copy(m.BsidAddr, buf.DecodeBytes(len(m.BsidAddr)))
405 m.Weight = buf.DecodeUint32()
406 m.IsEncap = buf.DecodeUint8()
407 m.Type = buf.DecodeUint8()
408 m.FibTable = buf.DecodeUint32()
409 m.Sids.NumSids = buf.DecodeUint8()
410 m.Sids.Weight = buf.DecodeUint32()
411 for j1 := 0; j1 < 16; j1++ {
412 m.Sids.Sids[j1].Addr = make([]byte, 16)
413 copy(m.Sids.Sids[j1].Addr, buf.DecodeBytes(len(m.Sids.Sids[j1].Addr)))
418 // SrPolicyAddReply defines message 'sr_policy_add_reply'.
419 type SrPolicyAddReply struct {
420 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
423 func (m *SrPolicyAddReply) Reset() { *m = SrPolicyAddReply{} }
424 func (*SrPolicyAddReply) GetMessageName() string { return "sr_policy_add_reply" }
425 func (*SrPolicyAddReply) GetCrcString() string { return "e8d4e804" }
426 func (*SrPolicyAddReply) GetMessageType() api.MessageType {
427 return api.ReplyMessage
430 func (m *SrPolicyAddReply) Size() (size int) {
434 size += 4 // m.Retval
437 func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) {
439 b = make([]byte, m.Size())
441 buf := codec.NewBuffer(b)
442 buf.EncodeInt32(m.Retval)
443 return buf.Bytes(), nil
445 func (m *SrPolicyAddReply) Unmarshal(b []byte) error {
446 buf := codec.NewBuffer(b)
447 m.Retval = buf.DecodeInt32()
451 // SrPolicyDel defines message 'sr_policy_del'.
452 type SrPolicyDel struct {
453 BsidAddr Srv6Sid `binapi:"srv6_sid,name=bsid_addr" json:"bsid_addr,omitempty"`
454 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
457 func (m *SrPolicyDel) Reset() { *m = SrPolicyDel{} }
458 func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" }
459 func (*SrPolicyDel) GetCrcString() string { return "e4133171" }
460 func (*SrPolicyDel) GetMessageType() api.MessageType {
461 return api.RequestMessage
464 func (m *SrPolicyDel) Size() (size int) {
468 size += 1 * 16 // m.BsidAddr.Addr
469 size += 4 // m.SrPolicyIndex
472 func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) {
474 b = make([]byte, m.Size())
476 buf := codec.NewBuffer(b)
477 buf.EncodeBytes(m.BsidAddr.Addr, 16)
478 buf.EncodeUint32(m.SrPolicyIndex)
479 return buf.Bytes(), nil
481 func (m *SrPolicyDel) Unmarshal(b []byte) error {
482 buf := codec.NewBuffer(b)
483 m.BsidAddr.Addr = make([]byte, 16)
484 copy(m.BsidAddr.Addr, buf.DecodeBytes(len(m.BsidAddr.Addr)))
485 m.SrPolicyIndex = buf.DecodeUint32()
489 // SrPolicyDelReply defines message 'sr_policy_del_reply'.
490 type SrPolicyDelReply struct {
491 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
494 func (m *SrPolicyDelReply) Reset() { *m = SrPolicyDelReply{} }
495 func (*SrPolicyDelReply) GetMessageName() string { return "sr_policy_del_reply" }
496 func (*SrPolicyDelReply) GetCrcString() string { return "e8d4e804" }
497 func (*SrPolicyDelReply) GetMessageType() api.MessageType {
498 return api.ReplyMessage
501 func (m *SrPolicyDelReply) Size() (size int) {
505 size += 4 // m.Retval
508 func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) {
510 b = make([]byte, m.Size())
512 buf := codec.NewBuffer(b)
513 buf.EncodeInt32(m.Retval)
514 return buf.Bytes(), nil
516 func (m *SrPolicyDelReply) Unmarshal(b []byte) error {
517 buf := codec.NewBuffer(b)
518 m.Retval = buf.DecodeInt32()
522 // SrPolicyMod defines message 'sr_policy_mod'.
523 type SrPolicyMod struct {
524 BsidAddr []byte `binapi:"u8[16],name=bsid_addr" json:"bsid_addr,omitempty"`
525 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
526 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
527 Operation uint8 `binapi:"u8,name=operation" json:"operation,omitempty"`
528 SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
529 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
530 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
533 func (m *SrPolicyMod) Reset() { *m = SrPolicyMod{} }
534 func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" }
535 func (*SrPolicyMod) GetCrcString() string { return "c1dfaee0" }
536 func (*SrPolicyMod) GetMessageType() api.MessageType {
537 return api.RequestMessage
540 func (m *SrPolicyMod) Size() (size int) {
544 size += 1 * 16 // m.BsidAddr
545 size += 4 // m.SrPolicyIndex
546 size += 4 // m.FibTable
547 size += 1 // m.Operation
548 size += 4 // m.SlIndex
549 size += 4 // m.Weight
550 size += 1 // m.Sids.NumSids
551 size += 4 // m.Sids.Weight
552 for j2 := 0; j2 < 16; j2++ {
553 size += 1 * 16 // m.Sids.Sids[j2].Addr
557 func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) {
559 b = make([]byte, m.Size())
561 buf := codec.NewBuffer(b)
562 buf.EncodeBytes(m.BsidAddr, 16)
563 buf.EncodeUint32(m.SrPolicyIndex)
564 buf.EncodeUint32(m.FibTable)
565 buf.EncodeUint8(m.Operation)
566 buf.EncodeUint32(m.SlIndex)
567 buf.EncodeUint32(m.Weight)
568 buf.EncodeUint8(m.Sids.NumSids)
569 buf.EncodeUint32(m.Sids.Weight)
570 for j1 := 0; j1 < 16; j1++ {
571 buf.EncodeBytes(m.Sids.Sids[j1].Addr, 16)
573 return buf.Bytes(), nil
575 func (m *SrPolicyMod) Unmarshal(b []byte) error {
576 buf := codec.NewBuffer(b)
577 m.BsidAddr = make([]byte, 16)
578 copy(m.BsidAddr, buf.DecodeBytes(len(m.BsidAddr)))
579 m.SrPolicyIndex = buf.DecodeUint32()
580 m.FibTable = buf.DecodeUint32()
581 m.Operation = buf.DecodeUint8()
582 m.SlIndex = buf.DecodeUint32()
583 m.Weight = buf.DecodeUint32()
584 m.Sids.NumSids = buf.DecodeUint8()
585 m.Sids.Weight = buf.DecodeUint32()
586 for j1 := 0; j1 < 16; j1++ {
587 m.Sids.Sids[j1].Addr = make([]byte, 16)
588 copy(m.Sids.Sids[j1].Addr, buf.DecodeBytes(len(m.Sids.Sids[j1].Addr)))
593 // SrPolicyModReply defines message 'sr_policy_mod_reply'.
594 type SrPolicyModReply struct {
595 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
598 func (m *SrPolicyModReply) Reset() { *m = SrPolicyModReply{} }
599 func (*SrPolicyModReply) GetMessageName() string { return "sr_policy_mod_reply" }
600 func (*SrPolicyModReply) GetCrcString() string { return "e8d4e804" }
601 func (*SrPolicyModReply) GetMessageType() api.MessageType {
602 return api.ReplyMessage
605 func (m *SrPolicyModReply) Size() (size int) {
609 size += 4 // m.Retval
612 func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) {
614 b = make([]byte, m.Size())
616 buf := codec.NewBuffer(b)
617 buf.EncodeInt32(m.Retval)
618 return buf.Bytes(), nil
620 func (m *SrPolicyModReply) Unmarshal(b []byte) error {
621 buf := codec.NewBuffer(b)
622 m.Retval = buf.DecodeInt32()
626 // SrSetEncapHopLimit defines message 'sr_set_encap_hop_limit'.
627 type SrSetEncapHopLimit struct {
628 HopLimit uint8 `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
631 func (m *SrSetEncapHopLimit) Reset() { *m = SrSetEncapHopLimit{} }
632 func (*SrSetEncapHopLimit) GetMessageName() string { return "sr_set_encap_hop_limit" }
633 func (*SrSetEncapHopLimit) GetCrcString() string { return "aa75d7d0" }
634 func (*SrSetEncapHopLimit) GetMessageType() api.MessageType {
635 return api.RequestMessage
638 func (m *SrSetEncapHopLimit) Size() (size int) {
642 size += 1 // m.HopLimit
645 func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) {
647 b = make([]byte, m.Size())
649 buf := codec.NewBuffer(b)
650 buf.EncodeUint8(m.HopLimit)
651 return buf.Bytes(), nil
653 func (m *SrSetEncapHopLimit) Unmarshal(b []byte) error {
654 buf := codec.NewBuffer(b)
655 m.HopLimit = buf.DecodeUint8()
659 // SrSetEncapHopLimitReply defines message 'sr_set_encap_hop_limit_reply'.
660 type SrSetEncapHopLimitReply struct {
661 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
664 func (m *SrSetEncapHopLimitReply) Reset() { *m = SrSetEncapHopLimitReply{} }
665 func (*SrSetEncapHopLimitReply) GetMessageName() string { return "sr_set_encap_hop_limit_reply" }
666 func (*SrSetEncapHopLimitReply) GetCrcString() string { return "e8d4e804" }
667 func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType {
668 return api.ReplyMessage
671 func (m *SrSetEncapHopLimitReply) Size() (size int) {
675 size += 4 // m.Retval
678 func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) {
680 b = make([]byte, m.Size())
682 buf := codec.NewBuffer(b)
683 buf.EncodeInt32(m.Retval)
684 return buf.Bytes(), nil
686 func (m *SrSetEncapHopLimitReply) Unmarshal(b []byte) error {
687 buf := codec.NewBuffer(b)
688 m.Retval = buf.DecodeInt32()
692 // SrSetEncapSource defines message 'sr_set_encap_source'.
693 type SrSetEncapSource struct {
694 EncapsSource []byte `binapi:"u8[16],name=encaps_source" json:"encaps_source,omitempty"`
697 func (m *SrSetEncapSource) Reset() { *m = SrSetEncapSource{} }
698 func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" }
699 func (*SrSetEncapSource) GetCrcString() string { return "d05bb4de" }
700 func (*SrSetEncapSource) GetMessageType() api.MessageType {
701 return api.RequestMessage
704 func (m *SrSetEncapSource) Size() (size int) {
708 size += 1 * 16 // m.EncapsSource
711 func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) {
713 b = make([]byte, m.Size())
715 buf := codec.NewBuffer(b)
716 buf.EncodeBytes(m.EncapsSource, 16)
717 return buf.Bytes(), nil
719 func (m *SrSetEncapSource) Unmarshal(b []byte) error {
720 buf := codec.NewBuffer(b)
721 m.EncapsSource = make([]byte, 16)
722 copy(m.EncapsSource, buf.DecodeBytes(len(m.EncapsSource)))
726 // SrSetEncapSourceReply defines message 'sr_set_encap_source_reply'.
727 type SrSetEncapSourceReply struct {
728 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
731 func (m *SrSetEncapSourceReply) Reset() { *m = SrSetEncapSourceReply{} }
732 func (*SrSetEncapSourceReply) GetMessageName() string { return "sr_set_encap_source_reply" }
733 func (*SrSetEncapSourceReply) GetCrcString() string { return "e8d4e804" }
734 func (*SrSetEncapSourceReply) GetMessageType() api.MessageType {
735 return api.ReplyMessage
738 func (m *SrSetEncapSourceReply) Size() (size int) {
742 size += 4 // m.Retval
745 func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) {
747 b = make([]byte, m.Size())
749 buf := codec.NewBuffer(b)
750 buf.EncodeInt32(m.Retval)
751 return buf.Bytes(), nil
753 func (m *SrSetEncapSourceReply) Unmarshal(b []byte) error {
754 buf := codec.NewBuffer(b)
755 m.Retval = buf.DecodeInt32()
759 // SrSteeringAddDel defines message 'sr_steering_add_del'.
760 type SrSteeringAddDel struct {
761 IsDel uint8 `binapi:"u8,name=is_del" json:"is_del,omitempty"`
762 BsidAddr []byte `binapi:"u8[16],name=bsid_addr" json:"bsid_addr,omitempty"`
763 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
764 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
765 PrefixAddr []byte `binapi:"u8[16],name=prefix_addr" json:"prefix_addr,omitempty"`
766 MaskWidth uint32 `binapi:"u32,name=mask_width" json:"mask_width,omitempty"`
767 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
768 TrafficType uint8 `binapi:"u8,name=traffic_type" json:"traffic_type,omitempty"`
771 func (m *SrSteeringAddDel) Reset() { *m = SrSteeringAddDel{} }
772 func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" }
773 func (*SrSteeringAddDel) GetCrcString() string { return "28b5dcab" }
774 func (*SrSteeringAddDel) GetMessageType() api.MessageType {
775 return api.RequestMessage
778 func (m *SrSteeringAddDel) Size() (size int) {
783 size += 1 * 16 // m.BsidAddr
784 size += 4 // m.SrPolicyIndex
785 size += 4 // m.TableID
786 size += 1 * 16 // m.PrefixAddr
787 size += 4 // m.MaskWidth
788 size += 4 // m.SwIfIndex
789 size += 1 // m.TrafficType
792 func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) {
794 b = make([]byte, m.Size())
796 buf := codec.NewBuffer(b)
797 buf.EncodeUint8(m.IsDel)
798 buf.EncodeBytes(m.BsidAddr, 16)
799 buf.EncodeUint32(m.SrPolicyIndex)
800 buf.EncodeUint32(m.TableID)
801 buf.EncodeBytes(m.PrefixAddr, 16)
802 buf.EncodeUint32(m.MaskWidth)
803 buf.EncodeUint32(m.SwIfIndex)
804 buf.EncodeUint8(m.TrafficType)
805 return buf.Bytes(), nil
807 func (m *SrSteeringAddDel) Unmarshal(b []byte) error {
808 buf := codec.NewBuffer(b)
809 m.IsDel = buf.DecodeUint8()
810 m.BsidAddr = make([]byte, 16)
811 copy(m.BsidAddr, buf.DecodeBytes(len(m.BsidAddr)))
812 m.SrPolicyIndex = buf.DecodeUint32()
813 m.TableID = buf.DecodeUint32()
814 m.PrefixAddr = make([]byte, 16)
815 copy(m.PrefixAddr, buf.DecodeBytes(len(m.PrefixAddr)))
816 m.MaskWidth = buf.DecodeUint32()
817 m.SwIfIndex = buf.DecodeUint32()
818 m.TrafficType = buf.DecodeUint8()
822 // SrSteeringAddDelReply defines message 'sr_steering_add_del_reply'.
823 type SrSteeringAddDelReply struct {
824 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
827 func (m *SrSteeringAddDelReply) Reset() { *m = SrSteeringAddDelReply{} }
828 func (*SrSteeringAddDelReply) GetMessageName() string { return "sr_steering_add_del_reply" }
829 func (*SrSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
830 func (*SrSteeringAddDelReply) GetMessageType() api.MessageType {
831 return api.ReplyMessage
834 func (m *SrSteeringAddDelReply) Size() (size int) {
838 size += 4 // m.Retval
841 func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
843 b = make([]byte, m.Size())
845 buf := codec.NewBuffer(b)
846 buf.EncodeInt32(m.Retval)
847 return buf.Bytes(), nil
849 func (m *SrSteeringAddDelReply) Unmarshal(b []byte) error {
850 buf := codec.NewBuffer(b)
851 m.Retval = buf.DecodeInt32()
855 // SrSteeringPolDetails defines message 'sr_steering_pol_details'.
856 type SrSteeringPolDetails struct {
857 TrafficType uint8 `binapi:"u8,name=traffic_type" json:"traffic_type,omitempty"`
858 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
859 PrefixAddr []byte `binapi:"u8[16],name=prefix_addr" json:"prefix_addr,omitempty"`
860 MaskWidth uint32 `binapi:"u32,name=mask_width" json:"mask_width,omitempty"`
861 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
862 Bsid Srv6Sid `binapi:"srv6_sid,name=bsid" json:"bsid,omitempty"`
865 func (m *SrSteeringPolDetails) Reset() { *m = SrSteeringPolDetails{} }
866 func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" }
867 func (*SrSteeringPolDetails) GetCrcString() string { return "5627d483" }
868 func (*SrSteeringPolDetails) GetMessageType() api.MessageType {
869 return api.ReplyMessage
872 func (m *SrSteeringPolDetails) Size() (size int) {
876 size += 1 // m.TrafficType
877 size += 4 // m.FibTable
878 size += 1 * 16 // m.PrefixAddr
879 size += 4 // m.MaskWidth
880 size += 4 // m.SwIfIndex
881 size += 1 * 16 // m.Bsid.Addr
884 func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) {
886 b = make([]byte, m.Size())
888 buf := codec.NewBuffer(b)
889 buf.EncodeUint8(m.TrafficType)
890 buf.EncodeUint32(m.FibTable)
891 buf.EncodeBytes(m.PrefixAddr, 16)
892 buf.EncodeUint32(m.MaskWidth)
893 buf.EncodeUint32(m.SwIfIndex)
894 buf.EncodeBytes(m.Bsid.Addr, 16)
895 return buf.Bytes(), nil
897 func (m *SrSteeringPolDetails) Unmarshal(b []byte) error {
898 buf := codec.NewBuffer(b)
899 m.TrafficType = buf.DecodeUint8()
900 m.FibTable = buf.DecodeUint32()
901 m.PrefixAddr = make([]byte, 16)
902 copy(m.PrefixAddr, buf.DecodeBytes(len(m.PrefixAddr)))
903 m.MaskWidth = buf.DecodeUint32()
904 m.SwIfIndex = buf.DecodeUint32()
905 m.Bsid.Addr = make([]byte, 16)
906 copy(m.Bsid.Addr, buf.DecodeBytes(len(m.Bsid.Addr)))
910 // SrSteeringPolDump defines message 'sr_steering_pol_dump'.
911 type SrSteeringPolDump struct{}
913 func (m *SrSteeringPolDump) Reset() { *m = SrSteeringPolDump{} }
914 func (*SrSteeringPolDump) GetMessageName() string { return "sr_steering_pol_dump" }
915 func (*SrSteeringPolDump) GetCrcString() string { return "51077d14" }
916 func (*SrSteeringPolDump) GetMessageType() api.MessageType {
917 return api.RequestMessage
920 func (m *SrSteeringPolDump) Size() (size int) {
926 func (m *SrSteeringPolDump) Marshal(b []byte) ([]byte, error) {
928 b = make([]byte, m.Size())
930 buf := codec.NewBuffer(b)
931 return buf.Bytes(), nil
933 func (m *SrSteeringPolDump) Unmarshal(b []byte) error {
937 func init() { file_sr_binapi_init() }
938 func file_sr_binapi_init() {
939 api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr_localsid_add_del_b30489eb")
940 api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr_localsid_add_del_reply_e8d4e804")
941 api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr_localsids_details_0791babc")
942 api.RegisterMessage((*SrLocalsidsDump)(nil), "sr_localsids_dump_51077d14")
943 api.RegisterMessage((*SrPoliciesDetails)(nil), "sr_policies_details_5087f460")
944 api.RegisterMessage((*SrPoliciesDump)(nil), "sr_policies_dump_51077d14")
945 api.RegisterMessage((*SrPolicyAdd)(nil), "sr_policy_add_4b6e2484")
946 api.RegisterMessage((*SrPolicyAddReply)(nil), "sr_policy_add_reply_e8d4e804")
947 api.RegisterMessage((*SrPolicyDel)(nil), "sr_policy_del_e4133171")
948 api.RegisterMessage((*SrPolicyDelReply)(nil), "sr_policy_del_reply_e8d4e804")
949 api.RegisterMessage((*SrPolicyMod)(nil), "sr_policy_mod_c1dfaee0")
950 api.RegisterMessage((*SrPolicyModReply)(nil), "sr_policy_mod_reply_e8d4e804")
951 api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr_set_encap_hop_limit_aa75d7d0")
952 api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr_set_encap_hop_limit_reply_e8d4e804")
953 api.RegisterMessage((*SrSetEncapSource)(nil), "sr_set_encap_source_d05bb4de")
954 api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr_set_encap_source_reply_e8d4e804")
955 api.RegisterMessage((*SrSteeringAddDel)(nil), "sr_steering_add_del_28b5dcab")
956 api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr_steering_add_del_reply_e8d4e804")
957 api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr_steering_pol_details_5627d483")
958 api.RegisterMessage((*SrSteeringPolDump)(nil), "sr_steering_pol_dump_51077d14")
961 // Messages returns list of all messages in this module.
962 func AllMessages() []api.Message {
963 return []api.Message{
964 (*SrLocalsidAddDel)(nil),
965 (*SrLocalsidAddDelReply)(nil),
966 (*SrLocalsidsDetails)(nil),
967 (*SrLocalsidsDump)(nil),
968 (*SrPoliciesDetails)(nil),
969 (*SrPoliciesDump)(nil),
971 (*SrPolicyAddReply)(nil),
973 (*SrPolicyDelReply)(nil),
975 (*SrPolicyModReply)(nil),
976 (*SrSetEncapHopLimit)(nil),
977 (*SrSetEncapHopLimitReply)(nil),
978 (*SrSetEncapSource)(nil),
979 (*SrSetEncapSourceReply)(nil),
980 (*SrSteeringAddDel)(nil),
981 (*SrSteeringAddDelReply)(nil),
982 (*SrSteeringPolDetails)(nil),
983 (*SrSteeringPolDump)(nil),