1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/sr.api.json
7 // Package sr contains generated bindings for API file sr.api.
16 api "git.fd.io/govpp.git/api"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 ip_types "git.fd.io/govpp.git/binapi/ip_types"
19 sr_types "git.fd.io/govpp.git/binapi/sr_types"
20 codec "git.fd.io/govpp.git/codec"
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
32 VersionCrc = 0xd85c77ca
35 // Srv6SidList defines type 'srv6_sid_list'.
36 type Srv6SidList struct {
37 NumSids uint8 `binapi:"u8,name=num_sids" json:"num_sids,omitempty"`
38 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
39 Sids [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty"`
42 // SrLocalsidAddDel defines message 'sr_localsid_add_del'.
43 type SrLocalsidAddDel struct {
44 IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
45 Localsid ip_types.IP6Address `binapi:"ip6_address,name=localsid" json:"localsid,omitempty"`
46 EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
47 Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
48 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
49 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
50 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
51 NhAddr ip_types.Address `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"`
54 func (m *SrLocalsidAddDel) Reset() { *m = SrLocalsidAddDel{} }
55 func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" }
56 func (*SrLocalsidAddDel) GetCrcString() string { return "26fa3309" }
57 func (*SrLocalsidAddDel) GetMessageType() api.MessageType {
58 return api.RequestMessage
61 func (m *SrLocalsidAddDel) Size() (size int) {
66 size += 1 * 16 // m.Localsid
68 size += 1 // m.Behavior
69 size += 4 // m.SwIfIndex
70 size += 4 // m.VlanIndex
71 size += 4 // m.FibTable
72 size += 1 // m.NhAddr.Af
73 size += 1 * 16 // m.NhAddr.Un
76 func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) {
78 b = make([]byte, m.Size())
80 buf := codec.NewBuffer(b)
81 buf.EncodeBool(m.IsDel)
82 buf.EncodeBytes(m.Localsid[:], 16)
83 buf.EncodeBool(m.EndPsp)
84 buf.EncodeUint8(uint8(m.Behavior))
85 buf.EncodeUint32(uint32(m.SwIfIndex))
86 buf.EncodeUint32(m.VlanIndex)
87 buf.EncodeUint32(m.FibTable)
88 buf.EncodeUint8(uint8(m.NhAddr.Af))
89 buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 16)
90 return buf.Bytes(), nil
92 func (m *SrLocalsidAddDel) Unmarshal(b []byte) error {
93 buf := codec.NewBuffer(b)
94 m.IsDel = buf.DecodeBool()
95 copy(m.Localsid[:], buf.DecodeBytes(16))
96 m.EndPsp = buf.DecodeBool()
97 m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
98 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
99 m.VlanIndex = buf.DecodeUint32()
100 m.FibTable = buf.DecodeUint32()
101 m.NhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
102 copy(m.NhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
106 // SrLocalsidAddDelReply defines message 'sr_localsid_add_del_reply'.
107 type SrLocalsidAddDelReply struct {
108 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
111 func (m *SrLocalsidAddDelReply) Reset() { *m = SrLocalsidAddDelReply{} }
112 func (*SrLocalsidAddDelReply) GetMessageName() string { return "sr_localsid_add_del_reply" }
113 func (*SrLocalsidAddDelReply) GetCrcString() string { return "e8d4e804" }
114 func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType {
115 return api.ReplyMessage
118 func (m *SrLocalsidAddDelReply) Size() (size int) {
122 size += 4 // m.Retval
125 func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) {
127 b = make([]byte, m.Size())
129 buf := codec.NewBuffer(b)
130 buf.EncodeInt32(m.Retval)
131 return buf.Bytes(), nil
133 func (m *SrLocalsidAddDelReply) Unmarshal(b []byte) error {
134 buf := codec.NewBuffer(b)
135 m.Retval = buf.DecodeInt32()
139 // SrLocalsidsDetails defines message 'sr_localsids_details'.
140 type SrLocalsidsDetails struct {
141 Addr ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"`
142 EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
143 Behavior sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
144 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
145 VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
146 XconnectNhAddr ip_types.Address `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"`
147 XconnectIfaceOrVrfTable uint32 `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"`
150 func (m *SrLocalsidsDetails) Reset() { *m = SrLocalsidsDetails{} }
151 func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" }
152 func (*SrLocalsidsDetails) GetCrcString() string { return "6a6c0265" }
153 func (*SrLocalsidsDetails) GetMessageType() api.MessageType {
154 return api.ReplyMessage
157 func (m *SrLocalsidsDetails) Size() (size int) {
161 size += 1 * 16 // m.Addr
162 size += 1 // m.EndPsp
163 size += 1 // m.Behavior
164 size += 4 // m.FibTable
165 size += 4 // m.VlanIndex
166 size += 1 // m.XconnectNhAddr.Af
167 size += 1 * 16 // m.XconnectNhAddr.Un
168 size += 4 // m.XconnectIfaceOrVrfTable
171 func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) {
173 b = make([]byte, m.Size())
175 buf := codec.NewBuffer(b)
176 buf.EncodeBytes(m.Addr[:], 16)
177 buf.EncodeBool(m.EndPsp)
178 buf.EncodeUint8(uint8(m.Behavior))
179 buf.EncodeUint32(m.FibTable)
180 buf.EncodeUint32(m.VlanIndex)
181 buf.EncodeUint8(uint8(m.XconnectNhAddr.Af))
182 buf.EncodeBytes(m.XconnectNhAddr.Un.XXX_UnionData[:], 16)
183 buf.EncodeUint32(m.XconnectIfaceOrVrfTable)
184 return buf.Bytes(), nil
186 func (m *SrLocalsidsDetails) Unmarshal(b []byte) error {
187 buf := codec.NewBuffer(b)
188 copy(m.Addr[:], buf.DecodeBytes(16))
189 m.EndPsp = buf.DecodeBool()
190 m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
191 m.FibTable = buf.DecodeUint32()
192 m.VlanIndex = buf.DecodeUint32()
193 m.XconnectNhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
194 copy(m.XconnectNhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
195 m.XconnectIfaceOrVrfTable = buf.DecodeUint32()
199 // SrLocalsidsDump defines message 'sr_localsids_dump'.
200 type SrLocalsidsDump struct{}
202 func (m *SrLocalsidsDump) Reset() { *m = SrLocalsidsDump{} }
203 func (*SrLocalsidsDump) GetMessageName() string { return "sr_localsids_dump" }
204 func (*SrLocalsidsDump) GetCrcString() string { return "51077d14" }
205 func (*SrLocalsidsDump) GetMessageType() api.MessageType {
206 return api.RequestMessage
209 func (m *SrLocalsidsDump) Size() (size int) {
215 func (m *SrLocalsidsDump) Marshal(b []byte) ([]byte, error) {
217 b = make([]byte, m.Size())
219 buf := codec.NewBuffer(b)
220 return buf.Bytes(), nil
222 func (m *SrLocalsidsDump) Unmarshal(b []byte) error {
226 // SrPoliciesDetails defines message 'sr_policies_details'.
227 type SrPoliciesDetails struct {
228 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
229 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
230 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
231 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
232 NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"-"`
233 SidLists []Srv6SidList `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
236 func (m *SrPoliciesDetails) Reset() { *m = SrPoliciesDetails{} }
237 func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" }
238 func (*SrPoliciesDetails) GetCrcString() string { return "07ec2d93" }
239 func (*SrPoliciesDetails) GetMessageType() api.MessageType {
240 return api.ReplyMessage
243 func (m *SrPoliciesDetails) Size() (size int) {
247 size += 1 * 16 // m.Bsid
248 size += 1 // m.IsSpray
249 size += 1 // m.IsEncap
250 size += 4 // m.FibTable
251 size += 1 // m.NumSidLists
252 for j1 := 0; j1 < len(m.SidLists); j1++ {
255 if j1 < len(m.SidLists) {
258 size += 1 // s1.NumSids
259 size += 4 // s1.Weight
260 for j2 := 0; j2 < 16; j2++ {
261 size += 1 * 16 // s1.Sids[j2]
266 func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) {
268 b = make([]byte, m.Size())
270 buf := codec.NewBuffer(b)
271 buf.EncodeBytes(m.Bsid[:], 16)
272 buf.EncodeBool(m.IsSpray)
273 buf.EncodeBool(m.IsEncap)
274 buf.EncodeUint32(m.FibTable)
275 buf.EncodeUint8(uint8(len(m.SidLists)))
276 for j0 := 0; j0 < len(m.SidLists); j0++ {
277 var v0 Srv6SidList // SidLists
278 if j0 < len(m.SidLists) {
281 buf.EncodeUint8(v0.NumSids)
282 buf.EncodeUint32(v0.Weight)
283 for j1 := 0; j1 < 16; j1++ {
284 buf.EncodeBytes(v0.Sids[j1][:], 16)
287 return buf.Bytes(), nil
289 func (m *SrPoliciesDetails) Unmarshal(b []byte) error {
290 buf := codec.NewBuffer(b)
291 copy(m.Bsid[:], buf.DecodeBytes(16))
292 m.IsSpray = buf.DecodeBool()
293 m.IsEncap = buf.DecodeBool()
294 m.FibTable = buf.DecodeUint32()
295 m.NumSidLists = buf.DecodeUint8()
296 m.SidLists = make([]Srv6SidList, m.NumSidLists)
297 for j0 := 0; j0 < len(m.SidLists); j0++ {
298 m.SidLists[j0].NumSids = buf.DecodeUint8()
299 m.SidLists[j0].Weight = buf.DecodeUint32()
300 for j1 := 0; j1 < 16; j1++ {
301 copy(m.SidLists[j0].Sids[j1][:], buf.DecodeBytes(16))
307 // SrPoliciesDump defines message 'sr_policies_dump'.
308 type SrPoliciesDump struct{}
310 func (m *SrPoliciesDump) Reset() { *m = SrPoliciesDump{} }
311 func (*SrPoliciesDump) GetMessageName() string { return "sr_policies_dump" }
312 func (*SrPoliciesDump) GetCrcString() string { return "51077d14" }
313 func (*SrPoliciesDump) GetMessageType() api.MessageType {
314 return api.RequestMessage
317 func (m *SrPoliciesDump) Size() (size int) {
323 func (m *SrPoliciesDump) Marshal(b []byte) ([]byte, error) {
325 b = make([]byte, m.Size())
327 buf := codec.NewBuffer(b)
328 return buf.Bytes(), nil
330 func (m *SrPoliciesDump) Unmarshal(b []byte) error {
334 // SrPolicyAdd defines message 'sr_policy_add'.
335 type SrPolicyAdd struct {
336 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
337 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
338 IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
339 IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
340 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
341 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
344 func (m *SrPolicyAdd) Reset() { *m = SrPolicyAdd{} }
345 func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" }
346 func (*SrPolicyAdd) GetCrcString() string { return "ec79ee6a" }
347 func (*SrPolicyAdd) GetMessageType() api.MessageType {
348 return api.RequestMessage
351 func (m *SrPolicyAdd) Size() (size int) {
355 size += 1 * 16 // m.BsidAddr
356 size += 4 // m.Weight
357 size += 1 // m.IsEncap
358 size += 1 // m.IsSpray
359 size += 4 // m.FibTable
360 size += 1 // m.Sids.NumSids
361 size += 4 // m.Sids.Weight
362 for j2 := 0; j2 < 16; j2++ {
363 size += 1 * 16 // m.Sids.Sids[j2]
367 func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) {
369 b = make([]byte, m.Size())
371 buf := codec.NewBuffer(b)
372 buf.EncodeBytes(m.BsidAddr[:], 16)
373 buf.EncodeUint32(m.Weight)
374 buf.EncodeBool(m.IsEncap)
375 buf.EncodeBool(m.IsSpray)
376 buf.EncodeUint32(m.FibTable)
377 buf.EncodeUint8(m.Sids.NumSids)
378 buf.EncodeUint32(m.Sids.Weight)
379 for j1 := 0; j1 < 16; j1++ {
380 buf.EncodeBytes(m.Sids.Sids[j1][:], 16)
382 return buf.Bytes(), nil
384 func (m *SrPolicyAdd) Unmarshal(b []byte) error {
385 buf := codec.NewBuffer(b)
386 copy(m.BsidAddr[:], buf.DecodeBytes(16))
387 m.Weight = buf.DecodeUint32()
388 m.IsEncap = buf.DecodeBool()
389 m.IsSpray = buf.DecodeBool()
390 m.FibTable = buf.DecodeUint32()
391 m.Sids.NumSids = buf.DecodeUint8()
392 m.Sids.Weight = buf.DecodeUint32()
393 for j1 := 0; j1 < 16; j1++ {
394 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
399 // SrPolicyAddReply defines message 'sr_policy_add_reply'.
400 type SrPolicyAddReply struct {
401 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
404 func (m *SrPolicyAddReply) Reset() { *m = SrPolicyAddReply{} }
405 func (*SrPolicyAddReply) GetMessageName() string { return "sr_policy_add_reply" }
406 func (*SrPolicyAddReply) GetCrcString() string { return "e8d4e804" }
407 func (*SrPolicyAddReply) GetMessageType() api.MessageType {
408 return api.ReplyMessage
411 func (m *SrPolicyAddReply) Size() (size int) {
415 size += 4 // m.Retval
418 func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) {
420 b = make([]byte, m.Size())
422 buf := codec.NewBuffer(b)
423 buf.EncodeInt32(m.Retval)
424 return buf.Bytes(), nil
426 func (m *SrPolicyAddReply) Unmarshal(b []byte) error {
427 buf := codec.NewBuffer(b)
428 m.Retval = buf.DecodeInt32()
432 // SrPolicyDel defines message 'sr_policy_del'.
433 type SrPolicyDel struct {
434 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
435 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
438 func (m *SrPolicyDel) Reset() { *m = SrPolicyDel{} }
439 func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" }
440 func (*SrPolicyDel) GetCrcString() string { return "cb4d48d5" }
441 func (*SrPolicyDel) GetMessageType() api.MessageType {
442 return api.RequestMessage
445 func (m *SrPolicyDel) Size() (size int) {
449 size += 1 * 16 // m.BsidAddr
450 size += 4 // m.SrPolicyIndex
453 func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) {
455 b = make([]byte, m.Size())
457 buf := codec.NewBuffer(b)
458 buf.EncodeBytes(m.BsidAddr[:], 16)
459 buf.EncodeUint32(m.SrPolicyIndex)
460 return buf.Bytes(), nil
462 func (m *SrPolicyDel) Unmarshal(b []byte) error {
463 buf := codec.NewBuffer(b)
464 copy(m.BsidAddr[:], buf.DecodeBytes(16))
465 m.SrPolicyIndex = buf.DecodeUint32()
469 // SrPolicyDelReply defines message 'sr_policy_del_reply'.
470 type SrPolicyDelReply struct {
471 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
474 func (m *SrPolicyDelReply) Reset() { *m = SrPolicyDelReply{} }
475 func (*SrPolicyDelReply) GetMessageName() string { return "sr_policy_del_reply" }
476 func (*SrPolicyDelReply) GetCrcString() string { return "e8d4e804" }
477 func (*SrPolicyDelReply) GetMessageType() api.MessageType {
478 return api.ReplyMessage
481 func (m *SrPolicyDelReply) Size() (size int) {
485 size += 4 // m.Retval
488 func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) {
490 b = make([]byte, m.Size())
492 buf := codec.NewBuffer(b)
493 buf.EncodeInt32(m.Retval)
494 return buf.Bytes(), nil
496 func (m *SrPolicyDelReply) Unmarshal(b []byte) error {
497 buf := codec.NewBuffer(b)
498 m.Retval = buf.DecodeInt32()
502 // SrPolicyMod defines message 'sr_policy_mod'.
503 type SrPolicyMod struct {
504 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
505 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
506 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
507 Operation sr_types.SrPolicyOp `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"`
508 SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
509 Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
510 Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
513 func (m *SrPolicyMod) Reset() { *m = SrPolicyMod{} }
514 func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" }
515 func (*SrPolicyMod) GetCrcString() string { return "e531a102" }
516 func (*SrPolicyMod) GetMessageType() api.MessageType {
517 return api.RequestMessage
520 func (m *SrPolicyMod) Size() (size int) {
524 size += 1 * 16 // m.BsidAddr
525 size += 4 // m.SrPolicyIndex
526 size += 4 // m.FibTable
527 size += 1 // m.Operation
528 size += 4 // m.SlIndex
529 size += 4 // m.Weight
530 size += 1 // m.Sids.NumSids
531 size += 4 // m.Sids.Weight
532 for j2 := 0; j2 < 16; j2++ {
533 size += 1 * 16 // m.Sids.Sids[j2]
537 func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) {
539 b = make([]byte, m.Size())
541 buf := codec.NewBuffer(b)
542 buf.EncodeBytes(m.BsidAddr[:], 16)
543 buf.EncodeUint32(m.SrPolicyIndex)
544 buf.EncodeUint32(m.FibTable)
545 buf.EncodeUint8(uint8(m.Operation))
546 buf.EncodeUint32(m.SlIndex)
547 buf.EncodeUint32(m.Weight)
548 buf.EncodeUint8(m.Sids.NumSids)
549 buf.EncodeUint32(m.Sids.Weight)
550 for j1 := 0; j1 < 16; j1++ {
551 buf.EncodeBytes(m.Sids.Sids[j1][:], 16)
553 return buf.Bytes(), nil
555 func (m *SrPolicyMod) Unmarshal(b []byte) error {
556 buf := codec.NewBuffer(b)
557 copy(m.BsidAddr[:], buf.DecodeBytes(16))
558 m.SrPolicyIndex = buf.DecodeUint32()
559 m.FibTable = buf.DecodeUint32()
560 m.Operation = sr_types.SrPolicyOp(buf.DecodeUint8())
561 m.SlIndex = buf.DecodeUint32()
562 m.Weight = buf.DecodeUint32()
563 m.Sids.NumSids = buf.DecodeUint8()
564 m.Sids.Weight = buf.DecodeUint32()
565 for j1 := 0; j1 < 16; j1++ {
566 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
571 // SrPolicyModReply defines message 'sr_policy_mod_reply'.
572 type SrPolicyModReply struct {
573 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
576 func (m *SrPolicyModReply) Reset() { *m = SrPolicyModReply{} }
577 func (*SrPolicyModReply) GetMessageName() string { return "sr_policy_mod_reply" }
578 func (*SrPolicyModReply) GetCrcString() string { return "e8d4e804" }
579 func (*SrPolicyModReply) GetMessageType() api.MessageType {
580 return api.ReplyMessage
583 func (m *SrPolicyModReply) Size() (size int) {
587 size += 4 // m.Retval
590 func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) {
592 b = make([]byte, m.Size())
594 buf := codec.NewBuffer(b)
595 buf.EncodeInt32(m.Retval)
596 return buf.Bytes(), nil
598 func (m *SrPolicyModReply) Unmarshal(b []byte) error {
599 buf := codec.NewBuffer(b)
600 m.Retval = buf.DecodeInt32()
604 // SrSetEncapHopLimit defines message 'sr_set_encap_hop_limit'.
605 type SrSetEncapHopLimit struct {
606 HopLimit uint8 `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
609 func (m *SrSetEncapHopLimit) Reset() { *m = SrSetEncapHopLimit{} }
610 func (*SrSetEncapHopLimit) GetMessageName() string { return "sr_set_encap_hop_limit" }
611 func (*SrSetEncapHopLimit) GetCrcString() string { return "aa75d7d0" }
612 func (*SrSetEncapHopLimit) GetMessageType() api.MessageType {
613 return api.RequestMessage
616 func (m *SrSetEncapHopLimit) Size() (size int) {
620 size += 1 // m.HopLimit
623 func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) {
625 b = make([]byte, m.Size())
627 buf := codec.NewBuffer(b)
628 buf.EncodeUint8(m.HopLimit)
629 return buf.Bytes(), nil
631 func (m *SrSetEncapHopLimit) Unmarshal(b []byte) error {
632 buf := codec.NewBuffer(b)
633 m.HopLimit = buf.DecodeUint8()
637 // SrSetEncapHopLimitReply defines message 'sr_set_encap_hop_limit_reply'.
638 type SrSetEncapHopLimitReply struct {
639 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
642 func (m *SrSetEncapHopLimitReply) Reset() { *m = SrSetEncapHopLimitReply{} }
643 func (*SrSetEncapHopLimitReply) GetMessageName() string { return "sr_set_encap_hop_limit_reply" }
644 func (*SrSetEncapHopLimitReply) GetCrcString() string { return "e8d4e804" }
645 func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType {
646 return api.ReplyMessage
649 func (m *SrSetEncapHopLimitReply) Size() (size int) {
653 size += 4 // m.Retval
656 func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) {
658 b = make([]byte, m.Size())
660 buf := codec.NewBuffer(b)
661 buf.EncodeInt32(m.Retval)
662 return buf.Bytes(), nil
664 func (m *SrSetEncapHopLimitReply) Unmarshal(b []byte) error {
665 buf := codec.NewBuffer(b)
666 m.Retval = buf.DecodeInt32()
670 // SrSetEncapSource defines message 'sr_set_encap_source'.
671 type SrSetEncapSource struct {
672 EncapsSource ip_types.IP6Address `binapi:"ip6_address,name=encaps_source" json:"encaps_source,omitempty"`
675 func (m *SrSetEncapSource) Reset() { *m = SrSetEncapSource{} }
676 func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" }
677 func (*SrSetEncapSource) GetCrcString() string { return "d3bad5e1" }
678 func (*SrSetEncapSource) GetMessageType() api.MessageType {
679 return api.RequestMessage
682 func (m *SrSetEncapSource) Size() (size int) {
686 size += 1 * 16 // m.EncapsSource
689 func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) {
691 b = make([]byte, m.Size())
693 buf := codec.NewBuffer(b)
694 buf.EncodeBytes(m.EncapsSource[:], 16)
695 return buf.Bytes(), nil
697 func (m *SrSetEncapSource) Unmarshal(b []byte) error {
698 buf := codec.NewBuffer(b)
699 copy(m.EncapsSource[:], buf.DecodeBytes(16))
703 // SrSetEncapSourceReply defines message 'sr_set_encap_source_reply'.
704 type SrSetEncapSourceReply struct {
705 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
708 func (m *SrSetEncapSourceReply) Reset() { *m = SrSetEncapSourceReply{} }
709 func (*SrSetEncapSourceReply) GetMessageName() string { return "sr_set_encap_source_reply" }
710 func (*SrSetEncapSourceReply) GetCrcString() string { return "e8d4e804" }
711 func (*SrSetEncapSourceReply) GetMessageType() api.MessageType {
712 return api.ReplyMessage
715 func (m *SrSetEncapSourceReply) Size() (size int) {
719 size += 4 // m.Retval
722 func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) {
724 b = make([]byte, m.Size())
726 buf := codec.NewBuffer(b)
727 buf.EncodeInt32(m.Retval)
728 return buf.Bytes(), nil
730 func (m *SrSetEncapSourceReply) Unmarshal(b []byte) error {
731 buf := codec.NewBuffer(b)
732 m.Retval = buf.DecodeInt32()
736 // SrSteeringAddDel defines message 'sr_steering_add_del'.
737 type SrSteeringAddDel struct {
738 IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
739 BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
740 SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
741 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
742 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
743 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
744 TrafficType sr_types.SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
747 func (m *SrSteeringAddDel) Reset() { *m = SrSteeringAddDel{} }
748 func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" }
749 func (*SrSteeringAddDel) GetCrcString() string { return "3711dace" }
750 func (*SrSteeringAddDel) GetMessageType() api.MessageType {
751 return api.RequestMessage
754 func (m *SrSteeringAddDel) Size() (size int) {
759 size += 1 * 16 // m.BsidAddr
760 size += 4 // m.SrPolicyIndex
761 size += 4 // m.TableID
762 size += 1 // m.Prefix.Address.Af
763 size += 1 * 16 // m.Prefix.Address.Un
764 size += 1 // m.Prefix.Len
765 size += 4 // m.SwIfIndex
766 size += 1 // m.TrafficType
769 func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) {
771 b = make([]byte, m.Size())
773 buf := codec.NewBuffer(b)
774 buf.EncodeBool(m.IsDel)
775 buf.EncodeBytes(m.BsidAddr[:], 16)
776 buf.EncodeUint32(m.SrPolicyIndex)
777 buf.EncodeUint32(m.TableID)
778 buf.EncodeUint8(uint8(m.Prefix.Address.Af))
779 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
780 buf.EncodeUint8(m.Prefix.Len)
781 buf.EncodeUint32(uint32(m.SwIfIndex))
782 buf.EncodeUint8(uint8(m.TrafficType))
783 return buf.Bytes(), nil
785 func (m *SrSteeringAddDel) Unmarshal(b []byte) error {
786 buf := codec.NewBuffer(b)
787 m.IsDel = buf.DecodeBool()
788 copy(m.BsidAddr[:], buf.DecodeBytes(16))
789 m.SrPolicyIndex = buf.DecodeUint32()
790 m.TableID = buf.DecodeUint32()
791 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
792 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
793 m.Prefix.Len = buf.DecodeUint8()
794 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
795 m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
799 // SrSteeringAddDelReply defines message 'sr_steering_add_del_reply'.
800 type SrSteeringAddDelReply struct {
801 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
804 func (m *SrSteeringAddDelReply) Reset() { *m = SrSteeringAddDelReply{} }
805 func (*SrSteeringAddDelReply) GetMessageName() string { return "sr_steering_add_del_reply" }
806 func (*SrSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
807 func (*SrSteeringAddDelReply) GetMessageType() api.MessageType {
808 return api.ReplyMessage
811 func (m *SrSteeringAddDelReply) Size() (size int) {
815 size += 4 // m.Retval
818 func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
820 b = make([]byte, m.Size())
822 buf := codec.NewBuffer(b)
823 buf.EncodeInt32(m.Retval)
824 return buf.Bytes(), nil
826 func (m *SrSteeringAddDelReply) Unmarshal(b []byte) error {
827 buf := codec.NewBuffer(b)
828 m.Retval = buf.DecodeInt32()
832 // SrSteeringPolDetails defines message 'sr_steering_pol_details'.
833 type SrSteeringPolDetails struct {
834 TrafficType sr_types.SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
835 FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
836 Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
837 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
838 Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
841 func (m *SrSteeringPolDetails) Reset() { *m = SrSteeringPolDetails{} }
842 func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" }
843 func (*SrSteeringPolDetails) GetCrcString() string { return "1c1ee786" }
844 func (*SrSteeringPolDetails) GetMessageType() api.MessageType {
845 return api.ReplyMessage
848 func (m *SrSteeringPolDetails) Size() (size int) {
852 size += 1 // m.TrafficType
853 size += 4 // m.FibTable
854 size += 1 // m.Prefix.Address.Af
855 size += 1 * 16 // m.Prefix.Address.Un
856 size += 1 // m.Prefix.Len
857 size += 4 // m.SwIfIndex
858 size += 1 * 16 // m.Bsid
861 func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) {
863 b = make([]byte, m.Size())
865 buf := codec.NewBuffer(b)
866 buf.EncodeUint8(uint8(m.TrafficType))
867 buf.EncodeUint32(m.FibTable)
868 buf.EncodeUint8(uint8(m.Prefix.Address.Af))
869 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
870 buf.EncodeUint8(m.Prefix.Len)
871 buf.EncodeUint32(uint32(m.SwIfIndex))
872 buf.EncodeBytes(m.Bsid[:], 16)
873 return buf.Bytes(), nil
875 func (m *SrSteeringPolDetails) Unmarshal(b []byte) error {
876 buf := codec.NewBuffer(b)
877 m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
878 m.FibTable = buf.DecodeUint32()
879 m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
880 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
881 m.Prefix.Len = buf.DecodeUint8()
882 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
883 copy(m.Bsid[:], buf.DecodeBytes(16))
887 // SrSteeringPolDump defines message 'sr_steering_pol_dump'.
888 type SrSteeringPolDump struct{}
890 func (m *SrSteeringPolDump) Reset() { *m = SrSteeringPolDump{} }
891 func (*SrSteeringPolDump) GetMessageName() string { return "sr_steering_pol_dump" }
892 func (*SrSteeringPolDump) GetCrcString() string { return "51077d14" }
893 func (*SrSteeringPolDump) GetMessageType() api.MessageType {
894 return api.RequestMessage
897 func (m *SrSteeringPolDump) Size() (size int) {
903 func (m *SrSteeringPolDump) Marshal(b []byte) ([]byte, error) {
905 b = make([]byte, m.Size())
907 buf := codec.NewBuffer(b)
908 return buf.Bytes(), nil
910 func (m *SrSteeringPolDump) Unmarshal(b []byte) error {
914 func init() { file_sr_binapi_init() }
915 func file_sr_binapi_init() {
916 api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr_localsid_add_del_26fa3309")
917 api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr_localsid_add_del_reply_e8d4e804")
918 api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr_localsids_details_6a6c0265")
919 api.RegisterMessage((*SrLocalsidsDump)(nil), "sr_localsids_dump_51077d14")
920 api.RegisterMessage((*SrPoliciesDetails)(nil), "sr_policies_details_07ec2d93")
921 api.RegisterMessage((*SrPoliciesDump)(nil), "sr_policies_dump_51077d14")
922 api.RegisterMessage((*SrPolicyAdd)(nil), "sr_policy_add_ec79ee6a")
923 api.RegisterMessage((*SrPolicyAddReply)(nil), "sr_policy_add_reply_e8d4e804")
924 api.RegisterMessage((*SrPolicyDel)(nil), "sr_policy_del_cb4d48d5")
925 api.RegisterMessage((*SrPolicyDelReply)(nil), "sr_policy_del_reply_e8d4e804")
926 api.RegisterMessage((*SrPolicyMod)(nil), "sr_policy_mod_e531a102")
927 api.RegisterMessage((*SrPolicyModReply)(nil), "sr_policy_mod_reply_e8d4e804")
928 api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr_set_encap_hop_limit_aa75d7d0")
929 api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr_set_encap_hop_limit_reply_e8d4e804")
930 api.RegisterMessage((*SrSetEncapSource)(nil), "sr_set_encap_source_d3bad5e1")
931 api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr_set_encap_source_reply_e8d4e804")
932 api.RegisterMessage((*SrSteeringAddDel)(nil), "sr_steering_add_del_3711dace")
933 api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr_steering_add_del_reply_e8d4e804")
934 api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr_steering_pol_details_1c1ee786")
935 api.RegisterMessage((*SrSteeringPolDump)(nil), "sr_steering_pol_dump_51077d14")
938 // Messages returns list of all messages in this module.
939 func AllMessages() []api.Message {
940 return []api.Message{
941 (*SrLocalsidAddDel)(nil),
942 (*SrLocalsidAddDelReply)(nil),
943 (*SrLocalsidsDetails)(nil),
944 (*SrLocalsidsDump)(nil),
945 (*SrPoliciesDetails)(nil),
946 (*SrPoliciesDump)(nil),
948 (*SrPolicyAddReply)(nil),
950 (*SrPolicyDelReply)(nil),
952 (*SrPolicyModReply)(nil),
953 (*SrSetEncapHopLimit)(nil),
954 (*SrSetEncapHopLimitReply)(nil),
955 (*SrSetEncapSource)(nil),
956 (*SrSetEncapSourceReply)(nil),
957 (*SrSteeringAddDel)(nil),
958 (*SrSteeringAddDelReply)(nil),
959 (*SrSteeringPolDetails)(nil),
960 (*SrSteeringPolDump)(nil),