Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / sr / sr.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/core/sr.api.json
6
7 // Package sr contains generated bindings for API file sr.api.
8 //
9 // Contents:
10 //   3 structs
11 //  20 messages
12 //
13 package sr
14
15 import (
16         api "git.fd.io/govpp.git/api"
17         codec "git.fd.io/govpp.git/codec"
18 )
19
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
25
26 const (
27         APIFile    = "sr"
28         APIVersion = "1.2.0"
29         VersionCrc = 0xbf277f96
30 )
31
32 // SrIP6Address defines type 'sr_ip6_address'.
33 type SrIP6Address struct {
34         Data []byte `binapi:"u8[16],name=data" json:"data,omitempty"`
35 }
36
37 // Srv6Sid defines type 'srv6_sid'.
38 type Srv6Sid struct {
39         Addr []byte `binapi:"u8[16],name=addr" json:"addr,omitempty"`
40 }
41
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"`
47 }
48
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"`
60 }
61
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
67 }
68
69 func (m *SrLocalsidAddDel) Size() (size int) {
70         if m == nil {
71                 return 0
72         }
73         size += 1      // m.IsDel
74         size += 1 * 16 // m.Localsid.Addr
75         size += 1      // m.EndPsp
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
82         return size
83 }
84 func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) {
85         if b == nil {
86                 b = make([]byte, m.Size())
87         }
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
99 }
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)))
114         return nil
115 }
116
117 // SrLocalsidAddDelReply defines message 'sr_localsid_add_del_reply'.
118 type SrLocalsidAddDelReply struct {
119         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
120 }
121
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
127 }
128
129 func (m *SrLocalsidAddDelReply) Size() (size int) {
130         if m == nil {
131                 return 0
132         }
133         size += 4 // m.Retval
134         return size
135 }
136 func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) {
137         if b == nil {
138                 b = make([]byte, m.Size())
139         }
140         buf := codec.NewBuffer(b)
141         buf.EncodeInt32(m.Retval)
142         return buf.Bytes(), nil
143 }
144 func (m *SrLocalsidAddDelReply) Unmarshal(b []byte) error {
145         buf := codec.NewBuffer(b)
146         m.Retval = buf.DecodeInt32()
147         return nil
148 }
149
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"`
160 }
161
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
167 }
168
169 func (m *SrLocalsidsDetails) Size() (size int) {
170         if m == nil {
171                 return 0
172         }
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
181         return size
182 }
183 func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) {
184         if b == nil {
185                 b = make([]byte, m.Size())
186         }
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
197 }
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()
211         return nil
212 }
213
214 // SrLocalsidsDump defines message 'sr_localsids_dump'.
215 type SrLocalsidsDump struct{}
216
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
222 }
223
224 func (m *SrLocalsidsDump) Size() (size int) {
225         if m == nil {
226                 return 0
227         }
228         return size
229 }
230 func (m *SrLocalsidsDump) Marshal(b []byte) ([]byte, error) {
231         if b == nil {
232                 b = make([]byte, m.Size())
233         }
234         buf := codec.NewBuffer(b)
235         return buf.Bytes(), nil
236 }
237 func (m *SrLocalsidsDump) Unmarshal(b []byte) error {
238         return nil
239 }
240
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"`
249 }
250
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
256 }
257
258 func (m *SrPoliciesDetails) Size() (size int) {
259         if m == nil {
260                 return 0
261         }
262         size += 1 * 16 // m.Bsid.Addr
263         size += 1      // m.Type
264         size += 1      // m.IsEncap
265         size += 4      // m.FibTable
266         size += 1      // m.NumSidLists
267         for j1 := 0; j1 < len(m.SidLists); j1++ {
268                 var s1 Srv6SidList
269                 _ = s1
270                 if j1 < len(m.SidLists) {
271                         s1 = m.SidLists[j1]
272                 }
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
277                 }
278         }
279         return size
280 }
281 func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) {
282         if b == nil {
283                 b = make([]byte, m.Size())
284         }
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) {
294                         v0 = m.SidLists[j0]
295                 }
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)
300                 }
301         }
302         return buf.Bytes(), nil
303 }
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)))
319                 }
320         }
321         return nil
322 }
323
324 // SrPoliciesDump defines message 'sr_policies_dump'.
325 type SrPoliciesDump struct{}
326
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
332 }
333
334 func (m *SrPoliciesDump) Size() (size int) {
335         if m == nil {
336                 return 0
337         }
338         return size
339 }
340 func (m *SrPoliciesDump) Marshal(b []byte) ([]byte, error) {
341         if b == nil {
342                 b = make([]byte, m.Size())
343         }
344         buf := codec.NewBuffer(b)
345         return buf.Bytes(), nil
346 }
347 func (m *SrPoliciesDump) Unmarshal(b []byte) error {
348         return nil
349 }
350
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"`
359 }
360
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
366 }
367
368 func (m *SrPolicyAdd) Size() (size int) {
369         if m == nil {
370                 return 0
371         }
372         size += 1 * 16 // m.BsidAddr
373         size += 4      // m.Weight
374         size += 1      // m.IsEncap
375         size += 1      // m.Type
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
381         }
382         return size
383 }
384 func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) {
385         if b == nil {
386                 b = make([]byte, m.Size())
387         }
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)
398         }
399         return buf.Bytes(), nil
400 }
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)))
414         }
415         return nil
416 }
417
418 // SrPolicyAddReply defines message 'sr_policy_add_reply'.
419 type SrPolicyAddReply struct {
420         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
421 }
422
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
428 }
429
430 func (m *SrPolicyAddReply) Size() (size int) {
431         if m == nil {
432                 return 0
433         }
434         size += 4 // m.Retval
435         return size
436 }
437 func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) {
438         if b == nil {
439                 b = make([]byte, m.Size())
440         }
441         buf := codec.NewBuffer(b)
442         buf.EncodeInt32(m.Retval)
443         return buf.Bytes(), nil
444 }
445 func (m *SrPolicyAddReply) Unmarshal(b []byte) error {
446         buf := codec.NewBuffer(b)
447         m.Retval = buf.DecodeInt32()
448         return nil
449 }
450
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"`
455 }
456
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
462 }
463
464 func (m *SrPolicyDel) Size() (size int) {
465         if m == nil {
466                 return 0
467         }
468         size += 1 * 16 // m.BsidAddr.Addr
469         size += 4      // m.SrPolicyIndex
470         return size
471 }
472 func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) {
473         if b == nil {
474                 b = make([]byte, m.Size())
475         }
476         buf := codec.NewBuffer(b)
477         buf.EncodeBytes(m.BsidAddr.Addr, 16)
478         buf.EncodeUint32(m.SrPolicyIndex)
479         return buf.Bytes(), nil
480 }
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()
486         return nil
487 }
488
489 // SrPolicyDelReply defines message 'sr_policy_del_reply'.
490 type SrPolicyDelReply struct {
491         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
492 }
493
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
499 }
500
501 func (m *SrPolicyDelReply) Size() (size int) {
502         if m == nil {
503                 return 0
504         }
505         size += 4 // m.Retval
506         return size
507 }
508 func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) {
509         if b == nil {
510                 b = make([]byte, m.Size())
511         }
512         buf := codec.NewBuffer(b)
513         buf.EncodeInt32(m.Retval)
514         return buf.Bytes(), nil
515 }
516 func (m *SrPolicyDelReply) Unmarshal(b []byte) error {
517         buf := codec.NewBuffer(b)
518         m.Retval = buf.DecodeInt32()
519         return nil
520 }
521
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"`
531 }
532
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
538 }
539
540 func (m *SrPolicyMod) Size() (size int) {
541         if m == nil {
542                 return 0
543         }
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
554         }
555         return size
556 }
557 func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) {
558         if b == nil {
559                 b = make([]byte, m.Size())
560         }
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)
572         }
573         return buf.Bytes(), nil
574 }
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)))
589         }
590         return nil
591 }
592
593 // SrPolicyModReply defines message 'sr_policy_mod_reply'.
594 type SrPolicyModReply struct {
595         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
596 }
597
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
603 }
604
605 func (m *SrPolicyModReply) Size() (size int) {
606         if m == nil {
607                 return 0
608         }
609         size += 4 // m.Retval
610         return size
611 }
612 func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) {
613         if b == nil {
614                 b = make([]byte, m.Size())
615         }
616         buf := codec.NewBuffer(b)
617         buf.EncodeInt32(m.Retval)
618         return buf.Bytes(), nil
619 }
620 func (m *SrPolicyModReply) Unmarshal(b []byte) error {
621         buf := codec.NewBuffer(b)
622         m.Retval = buf.DecodeInt32()
623         return nil
624 }
625
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"`
629 }
630
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
636 }
637
638 func (m *SrSetEncapHopLimit) Size() (size int) {
639         if m == nil {
640                 return 0
641         }
642         size += 1 // m.HopLimit
643         return size
644 }
645 func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) {
646         if b == nil {
647                 b = make([]byte, m.Size())
648         }
649         buf := codec.NewBuffer(b)
650         buf.EncodeUint8(m.HopLimit)
651         return buf.Bytes(), nil
652 }
653 func (m *SrSetEncapHopLimit) Unmarshal(b []byte) error {
654         buf := codec.NewBuffer(b)
655         m.HopLimit = buf.DecodeUint8()
656         return nil
657 }
658
659 // SrSetEncapHopLimitReply defines message 'sr_set_encap_hop_limit_reply'.
660 type SrSetEncapHopLimitReply struct {
661         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
662 }
663
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
669 }
670
671 func (m *SrSetEncapHopLimitReply) Size() (size int) {
672         if m == nil {
673                 return 0
674         }
675         size += 4 // m.Retval
676         return size
677 }
678 func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) {
679         if b == nil {
680                 b = make([]byte, m.Size())
681         }
682         buf := codec.NewBuffer(b)
683         buf.EncodeInt32(m.Retval)
684         return buf.Bytes(), nil
685 }
686 func (m *SrSetEncapHopLimitReply) Unmarshal(b []byte) error {
687         buf := codec.NewBuffer(b)
688         m.Retval = buf.DecodeInt32()
689         return nil
690 }
691
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"`
695 }
696
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
702 }
703
704 func (m *SrSetEncapSource) Size() (size int) {
705         if m == nil {
706                 return 0
707         }
708         size += 1 * 16 // m.EncapsSource
709         return size
710 }
711 func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) {
712         if b == nil {
713                 b = make([]byte, m.Size())
714         }
715         buf := codec.NewBuffer(b)
716         buf.EncodeBytes(m.EncapsSource, 16)
717         return buf.Bytes(), nil
718 }
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)))
723         return nil
724 }
725
726 // SrSetEncapSourceReply defines message 'sr_set_encap_source_reply'.
727 type SrSetEncapSourceReply struct {
728         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
729 }
730
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
736 }
737
738 func (m *SrSetEncapSourceReply) Size() (size int) {
739         if m == nil {
740                 return 0
741         }
742         size += 4 // m.Retval
743         return size
744 }
745 func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) {
746         if b == nil {
747                 b = make([]byte, m.Size())
748         }
749         buf := codec.NewBuffer(b)
750         buf.EncodeInt32(m.Retval)
751         return buf.Bytes(), nil
752 }
753 func (m *SrSetEncapSourceReply) Unmarshal(b []byte) error {
754         buf := codec.NewBuffer(b)
755         m.Retval = buf.DecodeInt32()
756         return nil
757 }
758
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"`
769 }
770
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
776 }
777
778 func (m *SrSteeringAddDel) Size() (size int) {
779         if m == nil {
780                 return 0
781         }
782         size += 1      // m.IsDel
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
790         return size
791 }
792 func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) {
793         if b == nil {
794                 b = make([]byte, m.Size())
795         }
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
806 }
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()
819         return nil
820 }
821
822 // SrSteeringAddDelReply defines message 'sr_steering_add_del_reply'.
823 type SrSteeringAddDelReply struct {
824         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
825 }
826
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
832 }
833
834 func (m *SrSteeringAddDelReply) Size() (size int) {
835         if m == nil {
836                 return 0
837         }
838         size += 4 // m.Retval
839         return size
840 }
841 func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
842         if b == nil {
843                 b = make([]byte, m.Size())
844         }
845         buf := codec.NewBuffer(b)
846         buf.EncodeInt32(m.Retval)
847         return buf.Bytes(), nil
848 }
849 func (m *SrSteeringAddDelReply) Unmarshal(b []byte) error {
850         buf := codec.NewBuffer(b)
851         m.Retval = buf.DecodeInt32()
852         return nil
853 }
854
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"`
863 }
864
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
870 }
871
872 func (m *SrSteeringPolDetails) Size() (size int) {
873         if m == nil {
874                 return 0
875         }
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
882         return size
883 }
884 func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) {
885         if b == nil {
886                 b = make([]byte, m.Size())
887         }
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
896 }
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)))
907         return nil
908 }
909
910 // SrSteeringPolDump defines message 'sr_steering_pol_dump'.
911 type SrSteeringPolDump struct{}
912
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
918 }
919
920 func (m *SrSteeringPolDump) Size() (size int) {
921         if m == nil {
922                 return 0
923         }
924         return size
925 }
926 func (m *SrSteeringPolDump) Marshal(b []byte) ([]byte, error) {
927         if b == nil {
928                 b = make([]byte, m.Size())
929         }
930         buf := codec.NewBuffer(b)
931         return buf.Bytes(), nil
932 }
933 func (m *SrSteeringPolDump) Unmarshal(b []byte) error {
934         return nil
935 }
936
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")
959 }
960
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),
970                 (*SrPolicyAdd)(nil),
971                 (*SrPolicyAddReply)(nil),
972                 (*SrPolicyDel)(nil),
973                 (*SrPolicyDelReply)(nil),
974                 (*SrPolicyMod)(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),
984         }
985 }