ee83937ba59d5fd608ff855239d2c72f5ffff5b6
[govpp.git] / binapi / sr / sr.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5
6 // Package sr contains generated bindings for API file sr.api.
7 //
8 // Contents:
9 //   1 struct
10 //  20 messages
11 //
12 package sr
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         interface_types "git.fd.io/govpp.git/binapi/interface_types"
17         ip_types "git.fd.io/govpp.git/binapi/ip_types"
18         sr_types "git.fd.io/govpp.git/binapi/sr_types"
19         codec "git.fd.io/govpp.git/codec"
20 )
21
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
27
28 const (
29         APIFile    = "sr"
30         APIVersion = "2.0.0"
31         VersionCrc = 0xd85c77ca
32 )
33
34 // Srv6SidList defines type 'srv6_sid_list'.
35 type Srv6SidList struct {
36         NumSids uint8                   `binapi:"u8,name=num_sids" json:"num_sids,omitempty"`
37         Weight  uint32                  `binapi:"u32,name=weight" json:"weight,omitempty"`
38         Sids    [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty"`
39 }
40
41 // SrLocalsidAddDel defines message 'sr_localsid_add_del'.
42 type SrLocalsidAddDel struct {
43         IsDel     bool                           `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
44         Localsid  ip_types.IP6Address            `binapi:"ip6_address,name=localsid" json:"localsid,omitempty"`
45         EndPsp    bool                           `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
46         Behavior  sr_types.SrBehavior            `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
47         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
48         VlanIndex uint32                         `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
49         FibTable  uint32                         `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
50         NhAddr    ip_types.Address               `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"`
51 }
52
53 func (m *SrLocalsidAddDel) Reset()               { *m = SrLocalsidAddDel{} }
54 func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" }
55 func (*SrLocalsidAddDel) GetCrcString() string   { return "26fa3309" }
56 func (*SrLocalsidAddDel) GetMessageType() api.MessageType {
57         return api.RequestMessage
58 }
59
60 func (m *SrLocalsidAddDel) Size() (size int) {
61         if m == nil {
62                 return 0
63         }
64         size += 1      // m.IsDel
65         size += 1 * 16 // m.Localsid
66         size += 1      // m.EndPsp
67         size += 1      // m.Behavior
68         size += 4      // m.SwIfIndex
69         size += 4      // m.VlanIndex
70         size += 4      // m.FibTable
71         size += 1      // m.NhAddr.Af
72         size += 1 * 16 // m.NhAddr.Un
73         return size
74 }
75 func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) {
76         if b == nil {
77                 b = make([]byte, m.Size())
78         }
79         buf := codec.NewBuffer(b)
80         buf.EncodeBool(m.IsDel)
81         buf.EncodeBytes(m.Localsid[:], 16)
82         buf.EncodeBool(m.EndPsp)
83         buf.EncodeUint8(uint8(m.Behavior))
84         buf.EncodeUint32(uint32(m.SwIfIndex))
85         buf.EncodeUint32(m.VlanIndex)
86         buf.EncodeUint32(m.FibTable)
87         buf.EncodeUint8(uint8(m.NhAddr.Af))
88         buf.EncodeBytes(m.NhAddr.Un.XXX_UnionData[:], 16)
89         return buf.Bytes(), nil
90 }
91 func (m *SrLocalsidAddDel) Unmarshal(b []byte) error {
92         buf := codec.NewBuffer(b)
93         m.IsDel = buf.DecodeBool()
94         copy(m.Localsid[:], buf.DecodeBytes(16))
95         m.EndPsp = buf.DecodeBool()
96         m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
97         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
98         m.VlanIndex = buf.DecodeUint32()
99         m.FibTable = buf.DecodeUint32()
100         m.NhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
101         copy(m.NhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
102         return nil
103 }
104
105 // SrLocalsidAddDelReply defines message 'sr_localsid_add_del_reply'.
106 type SrLocalsidAddDelReply struct {
107         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
108 }
109
110 func (m *SrLocalsidAddDelReply) Reset()               { *m = SrLocalsidAddDelReply{} }
111 func (*SrLocalsidAddDelReply) GetMessageName() string { return "sr_localsid_add_del_reply" }
112 func (*SrLocalsidAddDelReply) GetCrcString() string   { return "e8d4e804" }
113 func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType {
114         return api.ReplyMessage
115 }
116
117 func (m *SrLocalsidAddDelReply) Size() (size int) {
118         if m == nil {
119                 return 0
120         }
121         size += 4 // m.Retval
122         return size
123 }
124 func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) {
125         if b == nil {
126                 b = make([]byte, m.Size())
127         }
128         buf := codec.NewBuffer(b)
129         buf.EncodeInt32(m.Retval)
130         return buf.Bytes(), nil
131 }
132 func (m *SrLocalsidAddDelReply) Unmarshal(b []byte) error {
133         buf := codec.NewBuffer(b)
134         m.Retval = buf.DecodeInt32()
135         return nil
136 }
137
138 // SrLocalsidsDetails defines message 'sr_localsids_details'.
139 type SrLocalsidsDetails struct {
140         Addr                    ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"`
141         EndPsp                  bool                `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
142         Behavior                sr_types.SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
143         FibTable                uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
144         VlanIndex               uint32              `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
145         XconnectNhAddr          ip_types.Address    `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"`
146         XconnectIfaceOrVrfTable uint32              `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"`
147 }
148
149 func (m *SrLocalsidsDetails) Reset()               { *m = SrLocalsidsDetails{} }
150 func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" }
151 func (*SrLocalsidsDetails) GetCrcString() string   { return "6a6c0265" }
152 func (*SrLocalsidsDetails) GetMessageType() api.MessageType {
153         return api.ReplyMessage
154 }
155
156 func (m *SrLocalsidsDetails) Size() (size int) {
157         if m == nil {
158                 return 0
159         }
160         size += 1 * 16 // m.Addr
161         size += 1      // m.EndPsp
162         size += 1      // m.Behavior
163         size += 4      // m.FibTable
164         size += 4      // m.VlanIndex
165         size += 1      // m.XconnectNhAddr.Af
166         size += 1 * 16 // m.XconnectNhAddr.Un
167         size += 4      // m.XconnectIfaceOrVrfTable
168         return size
169 }
170 func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) {
171         if b == nil {
172                 b = make([]byte, m.Size())
173         }
174         buf := codec.NewBuffer(b)
175         buf.EncodeBytes(m.Addr[:], 16)
176         buf.EncodeBool(m.EndPsp)
177         buf.EncodeUint8(uint8(m.Behavior))
178         buf.EncodeUint32(m.FibTable)
179         buf.EncodeUint32(m.VlanIndex)
180         buf.EncodeUint8(uint8(m.XconnectNhAddr.Af))
181         buf.EncodeBytes(m.XconnectNhAddr.Un.XXX_UnionData[:], 16)
182         buf.EncodeUint32(m.XconnectIfaceOrVrfTable)
183         return buf.Bytes(), nil
184 }
185 func (m *SrLocalsidsDetails) Unmarshal(b []byte) error {
186         buf := codec.NewBuffer(b)
187         copy(m.Addr[:], buf.DecodeBytes(16))
188         m.EndPsp = buf.DecodeBool()
189         m.Behavior = sr_types.SrBehavior(buf.DecodeUint8())
190         m.FibTable = buf.DecodeUint32()
191         m.VlanIndex = buf.DecodeUint32()
192         m.XconnectNhAddr.Af = ip_types.AddressFamily(buf.DecodeUint8())
193         copy(m.XconnectNhAddr.Un.XXX_UnionData[:], buf.DecodeBytes(16))
194         m.XconnectIfaceOrVrfTable = buf.DecodeUint32()
195         return nil
196 }
197
198 // SrLocalsidsDump defines message 'sr_localsids_dump'.
199 type SrLocalsidsDump struct{}
200
201 func (m *SrLocalsidsDump) Reset()               { *m = SrLocalsidsDump{} }
202 func (*SrLocalsidsDump) GetMessageName() string { return "sr_localsids_dump" }
203 func (*SrLocalsidsDump) GetCrcString() string   { return "51077d14" }
204 func (*SrLocalsidsDump) GetMessageType() api.MessageType {
205         return api.RequestMessage
206 }
207
208 func (m *SrLocalsidsDump) Size() (size int) {
209         if m == nil {
210                 return 0
211         }
212         return size
213 }
214 func (m *SrLocalsidsDump) Marshal(b []byte) ([]byte, error) {
215         if b == nil {
216                 b = make([]byte, m.Size())
217         }
218         buf := codec.NewBuffer(b)
219         return buf.Bytes(), nil
220 }
221 func (m *SrLocalsidsDump) Unmarshal(b []byte) error {
222         return nil
223 }
224
225 // SrPoliciesDetails defines message 'sr_policies_details'.
226 type SrPoliciesDetails struct {
227         Bsid        ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
228         IsSpray     bool                `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
229         IsEncap     bool                `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
230         FibTable    uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
231         NumSidLists uint8               `binapi:"u8,name=num_sid_lists" json:"-"`
232         SidLists    []Srv6SidList       `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
233 }
234
235 func (m *SrPoliciesDetails) Reset()               { *m = SrPoliciesDetails{} }
236 func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" }
237 func (*SrPoliciesDetails) GetCrcString() string   { return "07ec2d93" }
238 func (*SrPoliciesDetails) GetMessageType() api.MessageType {
239         return api.ReplyMessage
240 }
241
242 func (m *SrPoliciesDetails) Size() (size int) {
243         if m == nil {
244                 return 0
245         }
246         size += 1 * 16 // m.Bsid
247         size += 1      // m.IsSpray
248         size += 1      // m.IsEncap
249         size += 4      // m.FibTable
250         size += 1      // m.NumSidLists
251         for j1 := 0; j1 < len(m.SidLists); j1++ {
252                 var s1 Srv6SidList
253                 _ = s1
254                 if j1 < len(m.SidLists) {
255                         s1 = m.SidLists[j1]
256                 }
257                 size += 1 // s1.NumSids
258                 size += 4 // s1.Weight
259                 for j2 := 0; j2 < 16; j2++ {
260                         size += 1 * 16 // s1.Sids[j2]
261                 }
262         }
263         return size
264 }
265 func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) {
266         if b == nil {
267                 b = make([]byte, m.Size())
268         }
269         buf := codec.NewBuffer(b)
270         buf.EncodeBytes(m.Bsid[:], 16)
271         buf.EncodeBool(m.IsSpray)
272         buf.EncodeBool(m.IsEncap)
273         buf.EncodeUint32(m.FibTable)
274         buf.EncodeUint8(uint8(len(m.SidLists)))
275         for j0 := 0; j0 < len(m.SidLists); j0++ {
276                 var v0 Srv6SidList // SidLists
277                 if j0 < len(m.SidLists) {
278                         v0 = m.SidLists[j0]
279                 }
280                 buf.EncodeUint8(v0.NumSids)
281                 buf.EncodeUint32(v0.Weight)
282                 for j1 := 0; j1 < 16; j1++ {
283                         buf.EncodeBytes(v0.Sids[j1][:], 16)
284                 }
285         }
286         return buf.Bytes(), nil
287 }
288 func (m *SrPoliciesDetails) Unmarshal(b []byte) error {
289         buf := codec.NewBuffer(b)
290         copy(m.Bsid[:], buf.DecodeBytes(16))
291         m.IsSpray = buf.DecodeBool()
292         m.IsEncap = buf.DecodeBool()
293         m.FibTable = buf.DecodeUint32()
294         m.NumSidLists = buf.DecodeUint8()
295         m.SidLists = make([]Srv6SidList, m.NumSidLists)
296         for j0 := 0; j0 < len(m.SidLists); j0++ {
297                 m.SidLists[j0].NumSids = buf.DecodeUint8()
298                 m.SidLists[j0].Weight = buf.DecodeUint32()
299                 for j1 := 0; j1 < 16; j1++ {
300                         copy(m.SidLists[j0].Sids[j1][:], buf.DecodeBytes(16))
301                 }
302         }
303         return nil
304 }
305
306 // SrPoliciesDump defines message 'sr_policies_dump'.
307 type SrPoliciesDump struct{}
308
309 func (m *SrPoliciesDump) Reset()               { *m = SrPoliciesDump{} }
310 func (*SrPoliciesDump) GetMessageName() string { return "sr_policies_dump" }
311 func (*SrPoliciesDump) GetCrcString() string   { return "51077d14" }
312 func (*SrPoliciesDump) GetMessageType() api.MessageType {
313         return api.RequestMessage
314 }
315
316 func (m *SrPoliciesDump) Size() (size int) {
317         if m == nil {
318                 return 0
319         }
320         return size
321 }
322 func (m *SrPoliciesDump) Marshal(b []byte) ([]byte, error) {
323         if b == nil {
324                 b = make([]byte, m.Size())
325         }
326         buf := codec.NewBuffer(b)
327         return buf.Bytes(), nil
328 }
329 func (m *SrPoliciesDump) Unmarshal(b []byte) error {
330         return nil
331 }
332
333 // SrPolicyAdd defines message 'sr_policy_add'.
334 type SrPolicyAdd struct {
335         BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
336         Weight   uint32              `binapi:"u32,name=weight" json:"weight,omitempty"`
337         IsEncap  bool                `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
338         IsSpray  bool                `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
339         FibTable uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
340         Sids     Srv6SidList         `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
341 }
342
343 func (m *SrPolicyAdd) Reset()               { *m = SrPolicyAdd{} }
344 func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" }
345 func (*SrPolicyAdd) GetCrcString() string   { return "ec79ee6a" }
346 func (*SrPolicyAdd) GetMessageType() api.MessageType {
347         return api.RequestMessage
348 }
349
350 func (m *SrPolicyAdd) Size() (size int) {
351         if m == nil {
352                 return 0
353         }
354         size += 1 * 16 // m.BsidAddr
355         size += 4      // m.Weight
356         size += 1      // m.IsEncap
357         size += 1      // m.IsSpray
358         size += 4      // m.FibTable
359         size += 1      // m.Sids.NumSids
360         size += 4      // m.Sids.Weight
361         for j2 := 0; j2 < 16; j2++ {
362                 size += 1 * 16 // m.Sids.Sids[j2]
363         }
364         return size
365 }
366 func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) {
367         if b == nil {
368                 b = make([]byte, m.Size())
369         }
370         buf := codec.NewBuffer(b)
371         buf.EncodeBytes(m.BsidAddr[:], 16)
372         buf.EncodeUint32(m.Weight)
373         buf.EncodeBool(m.IsEncap)
374         buf.EncodeBool(m.IsSpray)
375         buf.EncodeUint32(m.FibTable)
376         buf.EncodeUint8(m.Sids.NumSids)
377         buf.EncodeUint32(m.Sids.Weight)
378         for j1 := 0; j1 < 16; j1++ {
379                 buf.EncodeBytes(m.Sids.Sids[j1][:], 16)
380         }
381         return buf.Bytes(), nil
382 }
383 func (m *SrPolicyAdd) Unmarshal(b []byte) error {
384         buf := codec.NewBuffer(b)
385         copy(m.BsidAddr[:], buf.DecodeBytes(16))
386         m.Weight = buf.DecodeUint32()
387         m.IsEncap = buf.DecodeBool()
388         m.IsSpray = buf.DecodeBool()
389         m.FibTable = buf.DecodeUint32()
390         m.Sids.NumSids = buf.DecodeUint8()
391         m.Sids.Weight = buf.DecodeUint32()
392         for j1 := 0; j1 < 16; j1++ {
393                 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
394         }
395         return nil
396 }
397
398 // SrPolicyAddReply defines message 'sr_policy_add_reply'.
399 type SrPolicyAddReply struct {
400         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
401 }
402
403 func (m *SrPolicyAddReply) Reset()               { *m = SrPolicyAddReply{} }
404 func (*SrPolicyAddReply) GetMessageName() string { return "sr_policy_add_reply" }
405 func (*SrPolicyAddReply) GetCrcString() string   { return "e8d4e804" }
406 func (*SrPolicyAddReply) GetMessageType() api.MessageType {
407         return api.ReplyMessage
408 }
409
410 func (m *SrPolicyAddReply) Size() (size int) {
411         if m == nil {
412                 return 0
413         }
414         size += 4 // m.Retval
415         return size
416 }
417 func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) {
418         if b == nil {
419                 b = make([]byte, m.Size())
420         }
421         buf := codec.NewBuffer(b)
422         buf.EncodeInt32(m.Retval)
423         return buf.Bytes(), nil
424 }
425 func (m *SrPolicyAddReply) Unmarshal(b []byte) error {
426         buf := codec.NewBuffer(b)
427         m.Retval = buf.DecodeInt32()
428         return nil
429 }
430
431 // SrPolicyDel defines message 'sr_policy_del'.
432 type SrPolicyDel struct {
433         BsidAddr      ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
434         SrPolicyIndex uint32              `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
435 }
436
437 func (m *SrPolicyDel) Reset()               { *m = SrPolicyDel{} }
438 func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" }
439 func (*SrPolicyDel) GetCrcString() string   { return "cb4d48d5" }
440 func (*SrPolicyDel) GetMessageType() api.MessageType {
441         return api.RequestMessage
442 }
443
444 func (m *SrPolicyDel) Size() (size int) {
445         if m == nil {
446                 return 0
447         }
448         size += 1 * 16 // m.BsidAddr
449         size += 4      // m.SrPolicyIndex
450         return size
451 }
452 func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) {
453         if b == nil {
454                 b = make([]byte, m.Size())
455         }
456         buf := codec.NewBuffer(b)
457         buf.EncodeBytes(m.BsidAddr[:], 16)
458         buf.EncodeUint32(m.SrPolicyIndex)
459         return buf.Bytes(), nil
460 }
461 func (m *SrPolicyDel) Unmarshal(b []byte) error {
462         buf := codec.NewBuffer(b)
463         copy(m.BsidAddr[:], buf.DecodeBytes(16))
464         m.SrPolicyIndex = buf.DecodeUint32()
465         return nil
466 }
467
468 // SrPolicyDelReply defines message 'sr_policy_del_reply'.
469 type SrPolicyDelReply struct {
470         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
471 }
472
473 func (m *SrPolicyDelReply) Reset()               { *m = SrPolicyDelReply{} }
474 func (*SrPolicyDelReply) GetMessageName() string { return "sr_policy_del_reply" }
475 func (*SrPolicyDelReply) GetCrcString() string   { return "e8d4e804" }
476 func (*SrPolicyDelReply) GetMessageType() api.MessageType {
477         return api.ReplyMessage
478 }
479
480 func (m *SrPolicyDelReply) Size() (size int) {
481         if m == nil {
482                 return 0
483         }
484         size += 4 // m.Retval
485         return size
486 }
487 func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) {
488         if b == nil {
489                 b = make([]byte, m.Size())
490         }
491         buf := codec.NewBuffer(b)
492         buf.EncodeInt32(m.Retval)
493         return buf.Bytes(), nil
494 }
495 func (m *SrPolicyDelReply) Unmarshal(b []byte) error {
496         buf := codec.NewBuffer(b)
497         m.Retval = buf.DecodeInt32()
498         return nil
499 }
500
501 // SrPolicyMod defines message 'sr_policy_mod'.
502 type SrPolicyMod struct {
503         BsidAddr      ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
504         SrPolicyIndex uint32              `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
505         FibTable      uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
506         Operation     sr_types.SrPolicyOp `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"`
507         SlIndex       uint32              `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
508         Weight        uint32              `binapi:"u32,name=weight" json:"weight,omitempty"`
509         Sids          Srv6SidList         `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
510 }
511
512 func (m *SrPolicyMod) Reset()               { *m = SrPolicyMod{} }
513 func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" }
514 func (*SrPolicyMod) GetCrcString() string   { return "e531a102" }
515 func (*SrPolicyMod) GetMessageType() api.MessageType {
516         return api.RequestMessage
517 }
518
519 func (m *SrPolicyMod) Size() (size int) {
520         if m == nil {
521                 return 0
522         }
523         size += 1 * 16 // m.BsidAddr
524         size += 4      // m.SrPolicyIndex
525         size += 4      // m.FibTable
526         size += 1      // m.Operation
527         size += 4      // m.SlIndex
528         size += 4      // m.Weight
529         size += 1      // m.Sids.NumSids
530         size += 4      // m.Sids.Weight
531         for j2 := 0; j2 < 16; j2++ {
532                 size += 1 * 16 // m.Sids.Sids[j2]
533         }
534         return size
535 }
536 func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) {
537         if b == nil {
538                 b = make([]byte, m.Size())
539         }
540         buf := codec.NewBuffer(b)
541         buf.EncodeBytes(m.BsidAddr[:], 16)
542         buf.EncodeUint32(m.SrPolicyIndex)
543         buf.EncodeUint32(m.FibTable)
544         buf.EncodeUint8(uint8(m.Operation))
545         buf.EncodeUint32(m.SlIndex)
546         buf.EncodeUint32(m.Weight)
547         buf.EncodeUint8(m.Sids.NumSids)
548         buf.EncodeUint32(m.Sids.Weight)
549         for j1 := 0; j1 < 16; j1++ {
550                 buf.EncodeBytes(m.Sids.Sids[j1][:], 16)
551         }
552         return buf.Bytes(), nil
553 }
554 func (m *SrPolicyMod) Unmarshal(b []byte) error {
555         buf := codec.NewBuffer(b)
556         copy(m.BsidAddr[:], buf.DecodeBytes(16))
557         m.SrPolicyIndex = buf.DecodeUint32()
558         m.FibTable = buf.DecodeUint32()
559         m.Operation = sr_types.SrPolicyOp(buf.DecodeUint8())
560         m.SlIndex = buf.DecodeUint32()
561         m.Weight = buf.DecodeUint32()
562         m.Sids.NumSids = buf.DecodeUint8()
563         m.Sids.Weight = buf.DecodeUint32()
564         for j1 := 0; j1 < 16; j1++ {
565                 copy(m.Sids.Sids[j1][:], buf.DecodeBytes(16))
566         }
567         return nil
568 }
569
570 // SrPolicyModReply defines message 'sr_policy_mod_reply'.
571 type SrPolicyModReply struct {
572         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
573 }
574
575 func (m *SrPolicyModReply) Reset()               { *m = SrPolicyModReply{} }
576 func (*SrPolicyModReply) GetMessageName() string { return "sr_policy_mod_reply" }
577 func (*SrPolicyModReply) GetCrcString() string   { return "e8d4e804" }
578 func (*SrPolicyModReply) GetMessageType() api.MessageType {
579         return api.ReplyMessage
580 }
581
582 func (m *SrPolicyModReply) Size() (size int) {
583         if m == nil {
584                 return 0
585         }
586         size += 4 // m.Retval
587         return size
588 }
589 func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) {
590         if b == nil {
591                 b = make([]byte, m.Size())
592         }
593         buf := codec.NewBuffer(b)
594         buf.EncodeInt32(m.Retval)
595         return buf.Bytes(), nil
596 }
597 func (m *SrPolicyModReply) Unmarshal(b []byte) error {
598         buf := codec.NewBuffer(b)
599         m.Retval = buf.DecodeInt32()
600         return nil
601 }
602
603 // SrSetEncapHopLimit defines message 'sr_set_encap_hop_limit'.
604 type SrSetEncapHopLimit struct {
605         HopLimit uint8 `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
606 }
607
608 func (m *SrSetEncapHopLimit) Reset()               { *m = SrSetEncapHopLimit{} }
609 func (*SrSetEncapHopLimit) GetMessageName() string { return "sr_set_encap_hop_limit" }
610 func (*SrSetEncapHopLimit) GetCrcString() string   { return "aa75d7d0" }
611 func (*SrSetEncapHopLimit) GetMessageType() api.MessageType {
612         return api.RequestMessage
613 }
614
615 func (m *SrSetEncapHopLimit) Size() (size int) {
616         if m == nil {
617                 return 0
618         }
619         size += 1 // m.HopLimit
620         return size
621 }
622 func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) {
623         if b == nil {
624                 b = make([]byte, m.Size())
625         }
626         buf := codec.NewBuffer(b)
627         buf.EncodeUint8(m.HopLimit)
628         return buf.Bytes(), nil
629 }
630 func (m *SrSetEncapHopLimit) Unmarshal(b []byte) error {
631         buf := codec.NewBuffer(b)
632         m.HopLimit = buf.DecodeUint8()
633         return nil
634 }
635
636 // SrSetEncapHopLimitReply defines message 'sr_set_encap_hop_limit_reply'.
637 type SrSetEncapHopLimitReply struct {
638         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
639 }
640
641 func (m *SrSetEncapHopLimitReply) Reset()               { *m = SrSetEncapHopLimitReply{} }
642 func (*SrSetEncapHopLimitReply) GetMessageName() string { return "sr_set_encap_hop_limit_reply" }
643 func (*SrSetEncapHopLimitReply) GetCrcString() string   { return "e8d4e804" }
644 func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType {
645         return api.ReplyMessage
646 }
647
648 func (m *SrSetEncapHopLimitReply) Size() (size int) {
649         if m == nil {
650                 return 0
651         }
652         size += 4 // m.Retval
653         return size
654 }
655 func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) {
656         if b == nil {
657                 b = make([]byte, m.Size())
658         }
659         buf := codec.NewBuffer(b)
660         buf.EncodeInt32(m.Retval)
661         return buf.Bytes(), nil
662 }
663 func (m *SrSetEncapHopLimitReply) Unmarshal(b []byte) error {
664         buf := codec.NewBuffer(b)
665         m.Retval = buf.DecodeInt32()
666         return nil
667 }
668
669 // SrSetEncapSource defines message 'sr_set_encap_source'.
670 type SrSetEncapSource struct {
671         EncapsSource ip_types.IP6Address `binapi:"ip6_address,name=encaps_source" json:"encaps_source,omitempty"`
672 }
673
674 func (m *SrSetEncapSource) Reset()               { *m = SrSetEncapSource{} }
675 func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" }
676 func (*SrSetEncapSource) GetCrcString() string   { return "d3bad5e1" }
677 func (*SrSetEncapSource) GetMessageType() api.MessageType {
678         return api.RequestMessage
679 }
680
681 func (m *SrSetEncapSource) Size() (size int) {
682         if m == nil {
683                 return 0
684         }
685         size += 1 * 16 // m.EncapsSource
686         return size
687 }
688 func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) {
689         if b == nil {
690                 b = make([]byte, m.Size())
691         }
692         buf := codec.NewBuffer(b)
693         buf.EncodeBytes(m.EncapsSource[:], 16)
694         return buf.Bytes(), nil
695 }
696 func (m *SrSetEncapSource) Unmarshal(b []byte) error {
697         buf := codec.NewBuffer(b)
698         copy(m.EncapsSource[:], buf.DecodeBytes(16))
699         return nil
700 }
701
702 // SrSetEncapSourceReply defines message 'sr_set_encap_source_reply'.
703 type SrSetEncapSourceReply struct {
704         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
705 }
706
707 func (m *SrSetEncapSourceReply) Reset()               { *m = SrSetEncapSourceReply{} }
708 func (*SrSetEncapSourceReply) GetMessageName() string { return "sr_set_encap_source_reply" }
709 func (*SrSetEncapSourceReply) GetCrcString() string   { return "e8d4e804" }
710 func (*SrSetEncapSourceReply) GetMessageType() api.MessageType {
711         return api.ReplyMessage
712 }
713
714 func (m *SrSetEncapSourceReply) Size() (size int) {
715         if m == nil {
716                 return 0
717         }
718         size += 4 // m.Retval
719         return size
720 }
721 func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) {
722         if b == nil {
723                 b = make([]byte, m.Size())
724         }
725         buf := codec.NewBuffer(b)
726         buf.EncodeInt32(m.Retval)
727         return buf.Bytes(), nil
728 }
729 func (m *SrSetEncapSourceReply) Unmarshal(b []byte) error {
730         buf := codec.NewBuffer(b)
731         m.Retval = buf.DecodeInt32()
732         return nil
733 }
734
735 // SrSteeringAddDel defines message 'sr_steering_add_del'.
736 type SrSteeringAddDel struct {
737         IsDel         bool                           `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
738         BsidAddr      ip_types.IP6Address            `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
739         SrPolicyIndex uint32                         `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
740         TableID       uint32                         `binapi:"u32,name=table_id" json:"table_id,omitempty"`
741         Prefix        ip_types.Prefix                `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
742         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
743         TrafficType   sr_types.SrSteer               `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
744 }
745
746 func (m *SrSteeringAddDel) Reset()               { *m = SrSteeringAddDel{} }
747 func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" }
748 func (*SrSteeringAddDel) GetCrcString() string   { return "3711dace" }
749 func (*SrSteeringAddDel) GetMessageType() api.MessageType {
750         return api.RequestMessage
751 }
752
753 func (m *SrSteeringAddDel) Size() (size int) {
754         if m == nil {
755                 return 0
756         }
757         size += 1      // m.IsDel
758         size += 1 * 16 // m.BsidAddr
759         size += 4      // m.SrPolicyIndex
760         size += 4      // m.TableID
761         size += 1      // m.Prefix.Address.Af
762         size += 1 * 16 // m.Prefix.Address.Un
763         size += 1      // m.Prefix.Len
764         size += 4      // m.SwIfIndex
765         size += 1      // m.TrafficType
766         return size
767 }
768 func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) {
769         if b == nil {
770                 b = make([]byte, m.Size())
771         }
772         buf := codec.NewBuffer(b)
773         buf.EncodeBool(m.IsDel)
774         buf.EncodeBytes(m.BsidAddr[:], 16)
775         buf.EncodeUint32(m.SrPolicyIndex)
776         buf.EncodeUint32(m.TableID)
777         buf.EncodeUint8(uint8(m.Prefix.Address.Af))
778         buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
779         buf.EncodeUint8(m.Prefix.Len)
780         buf.EncodeUint32(uint32(m.SwIfIndex))
781         buf.EncodeUint8(uint8(m.TrafficType))
782         return buf.Bytes(), nil
783 }
784 func (m *SrSteeringAddDel) Unmarshal(b []byte) error {
785         buf := codec.NewBuffer(b)
786         m.IsDel = buf.DecodeBool()
787         copy(m.BsidAddr[:], buf.DecodeBytes(16))
788         m.SrPolicyIndex = buf.DecodeUint32()
789         m.TableID = buf.DecodeUint32()
790         m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
791         copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
792         m.Prefix.Len = buf.DecodeUint8()
793         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
794         m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
795         return nil
796 }
797
798 // SrSteeringAddDelReply defines message 'sr_steering_add_del_reply'.
799 type SrSteeringAddDelReply struct {
800         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
801 }
802
803 func (m *SrSteeringAddDelReply) Reset()               { *m = SrSteeringAddDelReply{} }
804 func (*SrSteeringAddDelReply) GetMessageName() string { return "sr_steering_add_del_reply" }
805 func (*SrSteeringAddDelReply) GetCrcString() string   { return "e8d4e804" }
806 func (*SrSteeringAddDelReply) GetMessageType() api.MessageType {
807         return api.ReplyMessage
808 }
809
810 func (m *SrSteeringAddDelReply) Size() (size int) {
811         if m == nil {
812                 return 0
813         }
814         size += 4 // m.Retval
815         return size
816 }
817 func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
818         if b == nil {
819                 b = make([]byte, m.Size())
820         }
821         buf := codec.NewBuffer(b)
822         buf.EncodeInt32(m.Retval)
823         return buf.Bytes(), nil
824 }
825 func (m *SrSteeringAddDelReply) Unmarshal(b []byte) error {
826         buf := codec.NewBuffer(b)
827         m.Retval = buf.DecodeInt32()
828         return nil
829 }
830
831 // SrSteeringPolDetails defines message 'sr_steering_pol_details'.
832 type SrSteeringPolDetails struct {
833         TrafficType sr_types.SrSteer               `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
834         FibTable    uint32                         `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
835         Prefix      ip_types.Prefix                `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
836         SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
837         Bsid        ip_types.IP6Address            `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
838 }
839
840 func (m *SrSteeringPolDetails) Reset()               { *m = SrSteeringPolDetails{} }
841 func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" }
842 func (*SrSteeringPolDetails) GetCrcString() string   { return "1c1ee786" }
843 func (*SrSteeringPolDetails) GetMessageType() api.MessageType {
844         return api.ReplyMessage
845 }
846
847 func (m *SrSteeringPolDetails) Size() (size int) {
848         if m == nil {
849                 return 0
850         }
851         size += 1      // m.TrafficType
852         size += 4      // m.FibTable
853         size += 1      // m.Prefix.Address.Af
854         size += 1 * 16 // m.Prefix.Address.Un
855         size += 1      // m.Prefix.Len
856         size += 4      // m.SwIfIndex
857         size += 1 * 16 // m.Bsid
858         return size
859 }
860 func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) {
861         if b == nil {
862                 b = make([]byte, m.Size())
863         }
864         buf := codec.NewBuffer(b)
865         buf.EncodeUint8(uint8(m.TrafficType))
866         buf.EncodeUint32(m.FibTable)
867         buf.EncodeUint8(uint8(m.Prefix.Address.Af))
868         buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
869         buf.EncodeUint8(m.Prefix.Len)
870         buf.EncodeUint32(uint32(m.SwIfIndex))
871         buf.EncodeBytes(m.Bsid[:], 16)
872         return buf.Bytes(), nil
873 }
874 func (m *SrSteeringPolDetails) Unmarshal(b []byte) error {
875         buf := codec.NewBuffer(b)
876         m.TrafficType = sr_types.SrSteer(buf.DecodeUint8())
877         m.FibTable = buf.DecodeUint32()
878         m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
879         copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
880         m.Prefix.Len = buf.DecodeUint8()
881         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
882         copy(m.Bsid[:], buf.DecodeBytes(16))
883         return nil
884 }
885
886 // SrSteeringPolDump defines message 'sr_steering_pol_dump'.
887 type SrSteeringPolDump struct{}
888
889 func (m *SrSteeringPolDump) Reset()               { *m = SrSteeringPolDump{} }
890 func (*SrSteeringPolDump) GetMessageName() string { return "sr_steering_pol_dump" }
891 func (*SrSteeringPolDump) GetCrcString() string   { return "51077d14" }
892 func (*SrSteeringPolDump) GetMessageType() api.MessageType {
893         return api.RequestMessage
894 }
895
896 func (m *SrSteeringPolDump) Size() (size int) {
897         if m == nil {
898                 return 0
899         }
900         return size
901 }
902 func (m *SrSteeringPolDump) Marshal(b []byte) ([]byte, error) {
903         if b == nil {
904                 b = make([]byte, m.Size())
905         }
906         buf := codec.NewBuffer(b)
907         return buf.Bytes(), nil
908 }
909 func (m *SrSteeringPolDump) Unmarshal(b []byte) error {
910         return nil
911 }
912
913 func init() { file_sr_binapi_init() }
914 func file_sr_binapi_init() {
915         api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr_localsid_add_del_26fa3309")
916         api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr_localsid_add_del_reply_e8d4e804")
917         api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr_localsids_details_6a6c0265")
918         api.RegisterMessage((*SrLocalsidsDump)(nil), "sr_localsids_dump_51077d14")
919         api.RegisterMessage((*SrPoliciesDetails)(nil), "sr_policies_details_07ec2d93")
920         api.RegisterMessage((*SrPoliciesDump)(nil), "sr_policies_dump_51077d14")
921         api.RegisterMessage((*SrPolicyAdd)(nil), "sr_policy_add_ec79ee6a")
922         api.RegisterMessage((*SrPolicyAddReply)(nil), "sr_policy_add_reply_e8d4e804")
923         api.RegisterMessage((*SrPolicyDel)(nil), "sr_policy_del_cb4d48d5")
924         api.RegisterMessage((*SrPolicyDelReply)(nil), "sr_policy_del_reply_e8d4e804")
925         api.RegisterMessage((*SrPolicyMod)(nil), "sr_policy_mod_e531a102")
926         api.RegisterMessage((*SrPolicyModReply)(nil), "sr_policy_mod_reply_e8d4e804")
927         api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr_set_encap_hop_limit_aa75d7d0")
928         api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr_set_encap_hop_limit_reply_e8d4e804")
929         api.RegisterMessage((*SrSetEncapSource)(nil), "sr_set_encap_source_d3bad5e1")
930         api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr_set_encap_source_reply_e8d4e804")
931         api.RegisterMessage((*SrSteeringAddDel)(nil), "sr_steering_add_del_3711dace")
932         api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr_steering_add_del_reply_e8d4e804")
933         api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr_steering_pol_details_1c1ee786")
934         api.RegisterMessage((*SrSteeringPolDump)(nil), "sr_steering_pol_dump_51077d14")
935 }
936
937 // Messages returns list of all messages in this module.
938 func AllMessages() []api.Message {
939         return []api.Message{
940                 (*SrLocalsidAddDel)(nil),
941                 (*SrLocalsidAddDelReply)(nil),
942                 (*SrLocalsidsDetails)(nil),
943                 (*SrLocalsidsDump)(nil),
944                 (*SrPoliciesDetails)(nil),
945                 (*SrPoliciesDump)(nil),
946                 (*SrPolicyAdd)(nil),
947                 (*SrPolicyAddReply)(nil),
948                 (*SrPolicyDel)(nil),
949                 (*SrPolicyDelReply)(nil),
950                 (*SrPolicyMod)(nil),
951                 (*SrPolicyModReply)(nil),
952                 (*SrSetEncapHopLimit)(nil),
953                 (*SrSetEncapHopLimitReply)(nil),
954                 (*SrSetEncapSource)(nil),
955                 (*SrSetEncapSourceReply)(nil),
956                 (*SrSteeringAddDel)(nil),
957                 (*SrSteeringAddDelReply)(nil),
958                 (*SrSteeringPolDetails)(nil),
959                 (*SrSteeringPolDump)(nil),
960         }
961 }