Binary API generator improvements
[govpp.git] / examples / 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 // source: /usr/share/vpp/api/core/sr.api.json
6
7 /*
8 Package sr contains generated code for VPP API file sr.api (2.0.0).
9
10 It consists of:
11           6 aliases
12          13 enums
13          20 messages
14           7 types
15           1 union
16 */
17 package sr
18
19 import (
20         "bytes"
21         "context"
22         "encoding/binary"
23         "fmt"
24         "io"
25         "math"
26         "net"
27         "strconv"
28         "strings"
29
30         api "git.fd.io/govpp.git/api"
31         codec "git.fd.io/govpp.git/codec"
32         struc "github.com/lunixbochs/struc"
33
34         interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
35         ip_types "git.fd.io/govpp.git/examples/binapi/ip_types"
36 )
37
38 // This is a compile-time assertion to ensure that this generated file
39 // is compatible with the GoVPP api package it is being compiled against.
40 // A compilation error at this line likely means your copy of the
41 // GoVPP api package needs to be updated.
42 const _ = api.GoVppAPIPackageIsVersion2 // please upgrade the GoVPP api package
43
44 const (
45         // ModuleName is the name of this module.
46         ModuleName = "sr"
47         // APIVersion is the API version of this module.
48         APIVersion = "2.0.0"
49         // VersionCrc is the CRC of this module.
50         VersionCrc = 0xd85c77ca
51 )
52
53 // SrBehavior represents VPP binary API enum 'sr_behavior'.
54 type SrBehavior uint8
55
56 const (
57         SR_BEHAVIOR_API_END     SrBehavior = 1
58         SR_BEHAVIOR_API_X       SrBehavior = 2
59         SR_BEHAVIOR_API_T       SrBehavior = 3
60         SR_BEHAVIOR_API_D_FIRST SrBehavior = 4
61         SR_BEHAVIOR_API_DX2     SrBehavior = 5
62         SR_BEHAVIOR_API_DX6     SrBehavior = 6
63         SR_BEHAVIOR_API_DX4     SrBehavior = 7
64         SR_BEHAVIOR_API_DT6     SrBehavior = 8
65         SR_BEHAVIOR_API_DT4     SrBehavior = 9
66         SR_BEHAVIOR_API_LAST    SrBehavior = 10
67 )
68
69 var (
70         SrBehavior_name = map[uint8]string{
71                 1:  "SR_BEHAVIOR_API_END",
72                 2:  "SR_BEHAVIOR_API_X",
73                 3:  "SR_BEHAVIOR_API_T",
74                 4:  "SR_BEHAVIOR_API_D_FIRST",
75                 5:  "SR_BEHAVIOR_API_DX2",
76                 6:  "SR_BEHAVIOR_API_DX6",
77                 7:  "SR_BEHAVIOR_API_DX4",
78                 8:  "SR_BEHAVIOR_API_DT6",
79                 9:  "SR_BEHAVIOR_API_DT4",
80                 10: "SR_BEHAVIOR_API_LAST",
81         }
82         SrBehavior_value = map[string]uint8{
83                 "SR_BEHAVIOR_API_END":     1,
84                 "SR_BEHAVIOR_API_X":       2,
85                 "SR_BEHAVIOR_API_T":       3,
86                 "SR_BEHAVIOR_API_D_FIRST": 4,
87                 "SR_BEHAVIOR_API_DX2":     5,
88                 "SR_BEHAVIOR_API_DX6":     6,
89                 "SR_BEHAVIOR_API_DX4":     7,
90                 "SR_BEHAVIOR_API_DT6":     8,
91                 "SR_BEHAVIOR_API_DT4":     9,
92                 "SR_BEHAVIOR_API_LAST":    10,
93         }
94 )
95
96 func (x SrBehavior) String() string {
97         s, ok := SrBehavior_name[uint8(x)]
98         if ok {
99                 return s
100         }
101         return "SrBehavior(" + strconv.Itoa(int(x)) + ")"
102 }
103
104 // SrPolicyOp represents VPP binary API enum 'sr_policy_op'.
105 type SrPolicyOp uint8
106
107 const (
108         SR_POLICY_OP_API_NONE SrPolicyOp = 0
109         SR_POLICY_OP_API_ADD  SrPolicyOp = 1
110         SR_POLICY_OP_API_DEL  SrPolicyOp = 2
111         SR_POLICY_OP_API_MOD  SrPolicyOp = 3
112 )
113
114 var (
115         SrPolicyOp_name = map[uint8]string{
116                 0: "SR_POLICY_OP_API_NONE",
117                 1: "SR_POLICY_OP_API_ADD",
118                 2: "SR_POLICY_OP_API_DEL",
119                 3: "SR_POLICY_OP_API_MOD",
120         }
121         SrPolicyOp_value = map[string]uint8{
122                 "SR_POLICY_OP_API_NONE": 0,
123                 "SR_POLICY_OP_API_ADD":  1,
124                 "SR_POLICY_OP_API_DEL":  2,
125                 "SR_POLICY_OP_API_MOD":  3,
126         }
127 )
128
129 func (x SrPolicyOp) String() string {
130         s, ok := SrPolicyOp_name[uint8(x)]
131         if ok {
132                 return s
133         }
134         return "SrPolicyOp(" + strconv.Itoa(int(x)) + ")"
135 }
136
137 // SrSteer represents VPP binary API enum 'sr_steer'.
138 type SrSteer uint8
139
140 const (
141         SR_STEER_API_L2   SrSteer = 2
142         SR_STEER_API_IPV4 SrSteer = 4
143         SR_STEER_API_IPV6 SrSteer = 6
144 )
145
146 var (
147         SrSteer_name = map[uint8]string{
148                 2: "SR_STEER_API_L2",
149                 4: "SR_STEER_API_IPV4",
150                 6: "SR_STEER_API_IPV6",
151         }
152         SrSteer_value = map[string]uint8{
153                 "SR_STEER_API_L2":   2,
154                 "SR_STEER_API_IPV4": 4,
155                 "SR_STEER_API_IPV6": 6,
156         }
157 )
158
159 func (x SrSteer) String() string {
160         s, ok := SrSteer_name[uint8(x)]
161         if ok {
162                 return s
163         }
164         return "SrSteer(" + strconv.Itoa(int(x)) + ")"
165 }
166
167 // Srv6SidList represents VPP binary API type 'srv6_sid_list'.
168 type Srv6SidList struct {
169         NumSids uint8                   `binapi:"u8,name=num_sids" json:"num_sids,omitempty"`
170         Weight  uint32                  `binapi:"u32,name=weight" json:"weight,omitempty"`
171         Sids    [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty" struc:"[16]ip_types.IP6Address"`
172 }
173
174 func (*Srv6SidList) GetTypeName() string { return "srv6_sid_list" }
175
176 // SrLocalsidAddDel represents VPP binary API message 'sr_localsid_add_del'.
177 type SrLocalsidAddDel struct {
178         IsDel     bool                           `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
179         Localsid  ip_types.IP6Address            `binapi:"ip6_address,name=localsid" json:"localsid,omitempty"`
180         EndPsp    bool                           `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
181         Behavior  SrBehavior                     `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
182         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4.294967295e+09" json:"sw_if_index,omitempty"`
183         VlanIndex uint32                         `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
184         FibTable  uint32                         `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
185         NhAddr    ip_types.Address               `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"`
186 }
187
188 func (m *SrLocalsidAddDel) Reset()                        { *m = SrLocalsidAddDel{} }
189 func (*SrLocalsidAddDel) GetMessageName() string          { return "sr_localsid_add_del" }
190 func (*SrLocalsidAddDel) GetCrcString() string            { return "26fa3309" }
191 func (*SrLocalsidAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
192
193 func (m *SrLocalsidAddDel) Size() int {
194         if m == nil {
195                 return 0
196         }
197         var size int
198         // field[1] m.IsDel
199         size += 1
200         // field[1] m.Localsid
201         size += 16
202         // field[1] m.EndPsp
203         size += 1
204         // field[1] m.Behavior
205         size += 1
206         // field[1] m.SwIfIndex
207         size += 4
208         // field[1] m.VlanIndex
209         size += 4
210         // field[1] m.FibTable
211         size += 4
212         // field[1] m.NhAddr
213         // field[2] m.NhAddr.Af
214         size += 1
215         // field[2] m.NhAddr.Un
216         size += 16
217         return size
218 }
219 func (m *SrLocalsidAddDel) Marshal(b []byte) ([]byte, error) {
220         o := binary.BigEndian
221         _ = o
222         pos := 0
223         _ = pos
224         var buf []byte
225         if b == nil {
226                 buf = make([]byte, m.Size())
227         } else {
228                 buf = b
229         }
230         // field[1] m.IsDel
231         if m.IsDel {
232                 buf[pos] = 1
233         }
234         pos += 1
235         // field[1] m.Localsid
236         for i := 0; i < 16; i++ {
237                 var x uint8
238                 if i < len(m.Localsid) {
239                         x = uint8(m.Localsid[i])
240                 }
241                 buf[pos] = uint8(x)
242                 pos += 1
243         }
244         // field[1] m.EndPsp
245         if m.EndPsp {
246                 buf[pos] = 1
247         }
248         pos += 1
249         // field[1] m.Behavior
250         buf[pos] = uint8(m.Behavior)
251         pos += 1
252         // field[1] m.SwIfIndex
253         o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
254         pos += 4
255         // field[1] m.VlanIndex
256         o.PutUint32(buf[pos:pos+4], uint32(m.VlanIndex))
257         pos += 4
258         // field[1] m.FibTable
259         o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
260         pos += 4
261         // field[1] m.NhAddr
262         // field[2] m.NhAddr.Af
263         buf[pos] = uint8(m.NhAddr.Af)
264         pos += 1
265         // field[2] m.NhAddr.Un
266         copy(buf[pos:pos+16], m.NhAddr.Un.XXX_UnionData[:])
267         pos += 16
268         return buf, nil
269 }
270 func (m *SrLocalsidAddDel) Unmarshal(tmp []byte) error {
271         o := binary.BigEndian
272         _ = o
273         pos := 0
274         _ = pos
275         // field[1] m.IsDel
276         m.IsDel = tmp[pos] != 0
277         pos += 1
278         // field[1] m.Localsid
279         for i := 0; i < len(m.Localsid); i++ {
280                 m.Localsid[i] = uint8(tmp[pos])
281                 pos += 1
282         }
283         // field[1] m.EndPsp
284         m.EndPsp = tmp[pos] != 0
285         pos += 1
286         // field[1] m.Behavior
287         m.Behavior = SrBehavior(tmp[pos])
288         pos += 1
289         // field[1] m.SwIfIndex
290         m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
291         pos += 4
292         // field[1] m.VlanIndex
293         m.VlanIndex = uint32(o.Uint32(tmp[pos : pos+4]))
294         pos += 4
295         // field[1] m.FibTable
296         m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
297         pos += 4
298         // field[1] m.NhAddr
299         // field[2] m.NhAddr.Af
300         m.NhAddr.Af = ip_types.AddressFamily(tmp[pos])
301         pos += 1
302         // field[2] m.NhAddr.Un
303         copy(m.NhAddr.Un.XXX_UnionData[:], tmp[pos:pos+16])
304         pos += 16
305         return nil
306 }
307
308 // SrLocalsidAddDelReply represents VPP binary API message 'sr_localsid_add_del_reply'.
309 type SrLocalsidAddDelReply struct {
310         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
311 }
312
313 func (m *SrLocalsidAddDelReply) Reset()                        { *m = SrLocalsidAddDelReply{} }
314 func (*SrLocalsidAddDelReply) GetMessageName() string          { return "sr_localsid_add_del_reply" }
315 func (*SrLocalsidAddDelReply) GetCrcString() string            { return "e8d4e804" }
316 func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
317
318 func (m *SrLocalsidAddDelReply) Size() int {
319         if m == nil {
320                 return 0
321         }
322         var size int
323         // field[1] m.Retval
324         size += 4
325         return size
326 }
327 func (m *SrLocalsidAddDelReply) Marshal(b []byte) ([]byte, error) {
328         o := binary.BigEndian
329         _ = o
330         pos := 0
331         _ = pos
332         var buf []byte
333         if b == nil {
334                 buf = make([]byte, m.Size())
335         } else {
336                 buf = b
337         }
338         // field[1] m.Retval
339         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
340         pos += 4
341         return buf, nil
342 }
343 func (m *SrLocalsidAddDelReply) Unmarshal(tmp []byte) error {
344         o := binary.BigEndian
345         _ = o
346         pos := 0
347         _ = pos
348         // field[1] m.Retval
349         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
350         pos += 4
351         return nil
352 }
353
354 // SrLocalsidsDetails represents VPP binary API message 'sr_localsids_details'.
355 type SrLocalsidsDetails struct {
356         Addr                    ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"`
357         EndPsp                  bool                `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
358         Behavior                SrBehavior          `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
359         FibTable                uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
360         VlanIndex               uint32              `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
361         XconnectNhAddr          ip_types.Address    `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"`
362         XconnectIfaceOrVrfTable uint32              `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"`
363 }
364
365 func (m *SrLocalsidsDetails) Reset()                        { *m = SrLocalsidsDetails{} }
366 func (*SrLocalsidsDetails) GetMessageName() string          { return "sr_localsids_details" }
367 func (*SrLocalsidsDetails) GetCrcString() string            { return "6a6c0265" }
368 func (*SrLocalsidsDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
369
370 func (m *SrLocalsidsDetails) Size() int {
371         if m == nil {
372                 return 0
373         }
374         var size int
375         // field[1] m.Addr
376         size += 16
377         // field[1] m.EndPsp
378         size += 1
379         // field[1] m.Behavior
380         size += 1
381         // field[1] m.FibTable
382         size += 4
383         // field[1] m.VlanIndex
384         size += 4
385         // field[1] m.XconnectNhAddr
386         // field[2] m.XconnectNhAddr.Af
387         size += 1
388         // field[2] m.XconnectNhAddr.Un
389         size += 16
390         // field[1] m.XconnectIfaceOrVrfTable
391         size += 4
392         return size
393 }
394 func (m *SrLocalsidsDetails) Marshal(b []byte) ([]byte, error) {
395         o := binary.BigEndian
396         _ = o
397         pos := 0
398         _ = pos
399         var buf []byte
400         if b == nil {
401                 buf = make([]byte, m.Size())
402         } else {
403                 buf = b
404         }
405         // field[1] m.Addr
406         for i := 0; i < 16; i++ {
407                 var x uint8
408                 if i < len(m.Addr) {
409                         x = uint8(m.Addr[i])
410                 }
411                 buf[pos] = uint8(x)
412                 pos += 1
413         }
414         // field[1] m.EndPsp
415         if m.EndPsp {
416                 buf[pos] = 1
417         }
418         pos += 1
419         // field[1] m.Behavior
420         buf[pos] = uint8(m.Behavior)
421         pos += 1
422         // field[1] m.FibTable
423         o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
424         pos += 4
425         // field[1] m.VlanIndex
426         o.PutUint32(buf[pos:pos+4], uint32(m.VlanIndex))
427         pos += 4
428         // field[1] m.XconnectNhAddr
429         // field[2] m.XconnectNhAddr.Af
430         buf[pos] = uint8(m.XconnectNhAddr.Af)
431         pos += 1
432         // field[2] m.XconnectNhAddr.Un
433         copy(buf[pos:pos+16], m.XconnectNhAddr.Un.XXX_UnionData[:])
434         pos += 16
435         // field[1] m.XconnectIfaceOrVrfTable
436         o.PutUint32(buf[pos:pos+4], uint32(m.XconnectIfaceOrVrfTable))
437         pos += 4
438         return buf, nil
439 }
440 func (m *SrLocalsidsDetails) Unmarshal(tmp []byte) error {
441         o := binary.BigEndian
442         _ = o
443         pos := 0
444         _ = pos
445         // field[1] m.Addr
446         for i := 0; i < len(m.Addr); i++ {
447                 m.Addr[i] = uint8(tmp[pos])
448                 pos += 1
449         }
450         // field[1] m.EndPsp
451         m.EndPsp = tmp[pos] != 0
452         pos += 1
453         // field[1] m.Behavior
454         m.Behavior = SrBehavior(tmp[pos])
455         pos += 1
456         // field[1] m.FibTable
457         m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
458         pos += 4
459         // field[1] m.VlanIndex
460         m.VlanIndex = uint32(o.Uint32(tmp[pos : pos+4]))
461         pos += 4
462         // field[1] m.XconnectNhAddr
463         // field[2] m.XconnectNhAddr.Af
464         m.XconnectNhAddr.Af = ip_types.AddressFamily(tmp[pos])
465         pos += 1
466         // field[2] m.XconnectNhAddr.Un
467         copy(m.XconnectNhAddr.Un.XXX_UnionData[:], tmp[pos:pos+16])
468         pos += 16
469         // field[1] m.XconnectIfaceOrVrfTable
470         m.XconnectIfaceOrVrfTable = uint32(o.Uint32(tmp[pos : pos+4]))
471         pos += 4
472         return nil
473 }
474
475 // SrLocalsidsDump represents VPP binary API message 'sr_localsids_dump'.
476 type SrLocalsidsDump struct{}
477
478 func (m *SrLocalsidsDump) Reset()                        { *m = SrLocalsidsDump{} }
479 func (*SrLocalsidsDump) GetMessageName() string          { return "sr_localsids_dump" }
480 func (*SrLocalsidsDump) GetCrcString() string            { return "51077d14" }
481 func (*SrLocalsidsDump) GetMessageType() api.MessageType { return api.RequestMessage }
482
483 func (m *SrLocalsidsDump) Size() int {
484         if m == nil {
485                 return 0
486         }
487         var size int
488         return size
489 }
490 func (m *SrLocalsidsDump) Marshal(b []byte) ([]byte, error) {
491         o := binary.BigEndian
492         _ = o
493         pos := 0
494         _ = pos
495         var buf []byte
496         if b == nil {
497                 buf = make([]byte, m.Size())
498         } else {
499                 buf = b
500         }
501         return buf, nil
502 }
503 func (m *SrLocalsidsDump) Unmarshal(tmp []byte) error {
504         o := binary.BigEndian
505         _ = o
506         pos := 0
507         _ = pos
508         return nil
509 }
510
511 // SrPoliciesDetails represents VPP binary API message 'sr_policies_details'.
512 type SrPoliciesDetails struct {
513         Bsid        ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
514         IsSpray     bool                `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
515         IsEncap     bool                `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
516         FibTable    uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
517         NumSidLists uint8               `binapi:"u8,name=num_sid_lists" json:"num_sid_lists,omitempty" struc:"sizeof=SidLists"`
518         SidLists    []Srv6SidList       `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
519 }
520
521 func (m *SrPoliciesDetails) Reset()                        { *m = SrPoliciesDetails{} }
522 func (*SrPoliciesDetails) GetMessageName() string          { return "sr_policies_details" }
523 func (*SrPoliciesDetails) GetCrcString() string            { return "07ec2d93" }
524 func (*SrPoliciesDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
525
526 func (m *SrPoliciesDetails) Size() int {
527         if m == nil {
528                 return 0
529         }
530         var size int
531         // field[1] m.Bsid
532         size += 16
533         // field[1] m.IsSpray
534         size += 1
535         // field[1] m.IsEncap
536         size += 1
537         // field[1] m.FibTable
538         size += 4
539         // field[1] m.NumSidLists
540         size += 1
541         // field[1] m.SidLists
542         for j1 := 0; j1 < len(m.SidLists); j1++ {
543                 var s1 Srv6SidList
544                 _ = s1
545                 if j1 < len(m.SidLists) {
546                         s1 = m.SidLists[j1]
547                 }
548                 // field[2] s1.NumSids
549                 size += 1
550                 // field[2] s1.Weight
551                 size += 4
552                 // field[2] s1.Sids
553                 for j2 := 0; j2 < 16; j2++ {
554                         var s2 ip_types.IP6Address
555                         _ = s2
556                         if j2 < len(s1.Sids) {
557                                 s2 = s1.Sids[j2]
558                         }
559                         size += 16
560                 }
561         }
562         return size
563 }
564 func (m *SrPoliciesDetails) Marshal(b []byte) ([]byte, error) {
565         o := binary.BigEndian
566         _ = o
567         pos := 0
568         _ = pos
569         var buf []byte
570         if b == nil {
571                 buf = make([]byte, m.Size())
572         } else {
573                 buf = b
574         }
575         // field[1] m.Bsid
576         for i := 0; i < 16; i++ {
577                 var x uint8
578                 if i < len(m.Bsid) {
579                         x = uint8(m.Bsid[i])
580                 }
581                 buf[pos] = uint8(x)
582                 pos += 1
583         }
584         // field[1] m.IsSpray
585         if m.IsSpray {
586                 buf[pos] = 1
587         }
588         pos += 1
589         // field[1] m.IsEncap
590         if m.IsEncap {
591                 buf[pos] = 1
592         }
593         pos += 1
594         // field[1] m.FibTable
595         o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
596         pos += 4
597         // field[1] m.NumSidLists
598         buf[pos] = uint8(len(m.SidLists))
599         pos += 1
600         // field[1] m.SidLists
601         for j1 := 0; j1 < len(m.SidLists); j1++ {
602                 var v1 Srv6SidList
603                 if j1 < len(m.SidLists) {
604                         v1 = m.SidLists[j1]
605                 }
606                 // field[2] v1.NumSids
607                 buf[pos] = uint8(v1.NumSids)
608                 pos += 1
609                 // field[2] v1.Weight
610                 o.PutUint32(buf[pos:pos+4], uint32(v1.Weight))
611                 pos += 4
612                 // field[2] v1.Sids
613                 for j2 := 0; j2 < 16; j2++ {
614                         var v2 ip_types.IP6Address
615                         if j2 < len(v1.Sids) {
616                                 v2 = v1.Sids[j2]
617                         }
618                         for i := 0; i < 16; i++ {
619                                 var x uint8
620                                 if i < len(v2) {
621                                         x = uint8(v2[i])
622                                 }
623                                 buf[pos] = uint8(x)
624                                 pos += 1
625                         }
626                 }
627         }
628         return buf, nil
629 }
630 func (m *SrPoliciesDetails) Unmarshal(tmp []byte) error {
631         o := binary.BigEndian
632         _ = o
633         pos := 0
634         _ = pos
635         // field[1] m.Bsid
636         for i := 0; i < len(m.Bsid); i++ {
637                 m.Bsid[i] = uint8(tmp[pos])
638                 pos += 1
639         }
640         // field[1] m.IsSpray
641         m.IsSpray = tmp[pos] != 0
642         pos += 1
643         // field[1] m.IsEncap
644         m.IsEncap = tmp[pos] != 0
645         pos += 1
646         // field[1] m.FibTable
647         m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
648         pos += 4
649         // field[1] m.NumSidLists
650         m.NumSidLists = uint8(tmp[pos])
651         pos += 1
652         // field[1] m.SidLists
653         m.SidLists = make([]Srv6SidList, int(m.NumSidLists))
654         for j1 := 0; j1 < int(m.NumSidLists); j1++ {
655                 // field[2] m.SidLists[j1].NumSids
656                 m.SidLists[j1].NumSids = uint8(tmp[pos])
657                 pos += 1
658                 // field[2] m.SidLists[j1].Weight
659                 m.SidLists[j1].Weight = uint32(o.Uint32(tmp[pos : pos+4]))
660                 pos += 4
661                 // field[2] m.SidLists[j1].Sids
662                 for j2 := 0; j2 < 16; j2++ {
663                         for i := 0; i < len(m.SidLists[j1].Sids[j2]); i++ {
664                                 m.SidLists[j1].Sids[j2][i] = uint8(tmp[pos])
665                                 pos += 1
666                         }
667                 }
668         }
669         return nil
670 }
671
672 // SrPoliciesDump represents VPP binary API message 'sr_policies_dump'.
673 type SrPoliciesDump struct{}
674
675 func (m *SrPoliciesDump) Reset()                        { *m = SrPoliciesDump{} }
676 func (*SrPoliciesDump) GetMessageName() string          { return "sr_policies_dump" }
677 func (*SrPoliciesDump) GetCrcString() string            { return "51077d14" }
678 func (*SrPoliciesDump) GetMessageType() api.MessageType { return api.RequestMessage }
679
680 func (m *SrPoliciesDump) Size() int {
681         if m == nil {
682                 return 0
683         }
684         var size int
685         return size
686 }
687 func (m *SrPoliciesDump) Marshal(b []byte) ([]byte, error) {
688         o := binary.BigEndian
689         _ = o
690         pos := 0
691         _ = pos
692         var buf []byte
693         if b == nil {
694                 buf = make([]byte, m.Size())
695         } else {
696                 buf = b
697         }
698         return buf, nil
699 }
700 func (m *SrPoliciesDump) Unmarshal(tmp []byte) error {
701         o := binary.BigEndian
702         _ = o
703         pos := 0
704         _ = pos
705         return nil
706 }
707
708 // SrPolicyAdd represents VPP binary API message 'sr_policy_add'.
709 type SrPolicyAdd struct {
710         BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
711         Weight   uint32              `binapi:"u32,name=weight" json:"weight,omitempty"`
712         IsEncap  bool                `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
713         IsSpray  bool                `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
714         FibTable uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
715         Sids     Srv6SidList         `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
716 }
717
718 func (m *SrPolicyAdd) Reset()                        { *m = SrPolicyAdd{} }
719 func (*SrPolicyAdd) GetMessageName() string          { return "sr_policy_add" }
720 func (*SrPolicyAdd) GetCrcString() string            { return "ec79ee6a" }
721 func (*SrPolicyAdd) GetMessageType() api.MessageType { return api.RequestMessage }
722
723 func (m *SrPolicyAdd) Size() int {
724         if m == nil {
725                 return 0
726         }
727         var size int
728         // field[1] m.BsidAddr
729         size += 16
730         // field[1] m.Weight
731         size += 4
732         // field[1] m.IsEncap
733         size += 1
734         // field[1] m.IsSpray
735         size += 1
736         // field[1] m.FibTable
737         size += 4
738         // field[1] m.Sids
739         // field[2] m.Sids.NumSids
740         size += 1
741         // field[2] m.Sids.Weight
742         size += 4
743         // field[2] m.Sids.Sids
744         for j2 := 0; j2 < 16; j2++ {
745                 var s2 ip_types.IP6Address
746                 _ = s2
747                 if j2 < len(m.Sids.Sids) {
748                         s2 = m.Sids.Sids[j2]
749                 }
750                 size += 16
751         }
752         return size
753 }
754 func (m *SrPolicyAdd) Marshal(b []byte) ([]byte, error) {
755         o := binary.BigEndian
756         _ = o
757         pos := 0
758         _ = pos
759         var buf []byte
760         if b == nil {
761                 buf = make([]byte, m.Size())
762         } else {
763                 buf = b
764         }
765         // field[1] m.BsidAddr
766         for i := 0; i < 16; i++ {
767                 var x uint8
768                 if i < len(m.BsidAddr) {
769                         x = uint8(m.BsidAddr[i])
770                 }
771                 buf[pos] = uint8(x)
772                 pos += 1
773         }
774         // field[1] m.Weight
775         o.PutUint32(buf[pos:pos+4], uint32(m.Weight))
776         pos += 4
777         // field[1] m.IsEncap
778         if m.IsEncap {
779                 buf[pos] = 1
780         }
781         pos += 1
782         // field[1] m.IsSpray
783         if m.IsSpray {
784                 buf[pos] = 1
785         }
786         pos += 1
787         // field[1] m.FibTable
788         o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
789         pos += 4
790         // field[1] m.Sids
791         // field[2] m.Sids.NumSids
792         buf[pos] = uint8(m.Sids.NumSids)
793         pos += 1
794         // field[2] m.Sids.Weight
795         o.PutUint32(buf[pos:pos+4], uint32(m.Sids.Weight))
796         pos += 4
797         // field[2] m.Sids.Sids
798         for j2 := 0; j2 < 16; j2++ {
799                 var v2 ip_types.IP6Address
800                 if j2 < len(m.Sids.Sids) {
801                         v2 = m.Sids.Sids[j2]
802                 }
803                 for i := 0; i < 16; i++ {
804                         var x uint8
805                         if i < len(v2) {
806                                 x = uint8(v2[i])
807                         }
808                         buf[pos] = uint8(x)
809                         pos += 1
810                 }
811         }
812         return buf, nil
813 }
814 func (m *SrPolicyAdd) Unmarshal(tmp []byte) error {
815         o := binary.BigEndian
816         _ = o
817         pos := 0
818         _ = pos
819         // field[1] m.BsidAddr
820         for i := 0; i < len(m.BsidAddr); i++ {
821                 m.BsidAddr[i] = uint8(tmp[pos])
822                 pos += 1
823         }
824         // field[1] m.Weight
825         m.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
826         pos += 4
827         // field[1] m.IsEncap
828         m.IsEncap = tmp[pos] != 0
829         pos += 1
830         // field[1] m.IsSpray
831         m.IsSpray = tmp[pos] != 0
832         pos += 1
833         // field[1] m.FibTable
834         m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
835         pos += 4
836         // field[1] m.Sids
837         // field[2] m.Sids.NumSids
838         m.Sids.NumSids = uint8(tmp[pos])
839         pos += 1
840         // field[2] m.Sids.Weight
841         m.Sids.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
842         pos += 4
843         // field[2] m.Sids.Sids
844         for j2 := 0; j2 < 16; j2++ {
845                 for i := 0; i < len(m.Sids.Sids[j2]); i++ {
846                         m.Sids.Sids[j2][i] = uint8(tmp[pos])
847                         pos += 1
848                 }
849         }
850         return nil
851 }
852
853 // SrPolicyAddReply represents VPP binary API message 'sr_policy_add_reply'.
854 type SrPolicyAddReply struct {
855         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
856 }
857
858 func (m *SrPolicyAddReply) Reset()                        { *m = SrPolicyAddReply{} }
859 func (*SrPolicyAddReply) GetMessageName() string          { return "sr_policy_add_reply" }
860 func (*SrPolicyAddReply) GetCrcString() string            { return "e8d4e804" }
861 func (*SrPolicyAddReply) GetMessageType() api.MessageType { return api.ReplyMessage }
862
863 func (m *SrPolicyAddReply) Size() int {
864         if m == nil {
865                 return 0
866         }
867         var size int
868         // field[1] m.Retval
869         size += 4
870         return size
871 }
872 func (m *SrPolicyAddReply) Marshal(b []byte) ([]byte, error) {
873         o := binary.BigEndian
874         _ = o
875         pos := 0
876         _ = pos
877         var buf []byte
878         if b == nil {
879                 buf = make([]byte, m.Size())
880         } else {
881                 buf = b
882         }
883         // field[1] m.Retval
884         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
885         pos += 4
886         return buf, nil
887 }
888 func (m *SrPolicyAddReply) Unmarshal(tmp []byte) error {
889         o := binary.BigEndian
890         _ = o
891         pos := 0
892         _ = pos
893         // field[1] m.Retval
894         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
895         pos += 4
896         return nil
897 }
898
899 // SrPolicyDel represents VPP binary API message 'sr_policy_del'.
900 type SrPolicyDel struct {
901         BsidAddr      ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
902         SrPolicyIndex uint32              `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
903 }
904
905 func (m *SrPolicyDel) Reset()                        { *m = SrPolicyDel{} }
906 func (*SrPolicyDel) GetMessageName() string          { return "sr_policy_del" }
907 func (*SrPolicyDel) GetCrcString() string            { return "cb4d48d5" }
908 func (*SrPolicyDel) GetMessageType() api.MessageType { return api.RequestMessage }
909
910 func (m *SrPolicyDel) Size() int {
911         if m == nil {
912                 return 0
913         }
914         var size int
915         // field[1] m.BsidAddr
916         size += 16
917         // field[1] m.SrPolicyIndex
918         size += 4
919         return size
920 }
921 func (m *SrPolicyDel) Marshal(b []byte) ([]byte, error) {
922         o := binary.BigEndian
923         _ = o
924         pos := 0
925         _ = pos
926         var buf []byte
927         if b == nil {
928                 buf = make([]byte, m.Size())
929         } else {
930                 buf = b
931         }
932         // field[1] m.BsidAddr
933         for i := 0; i < 16; i++ {
934                 var x uint8
935                 if i < len(m.BsidAddr) {
936                         x = uint8(m.BsidAddr[i])
937                 }
938                 buf[pos] = uint8(x)
939                 pos += 1
940         }
941         // field[1] m.SrPolicyIndex
942         o.PutUint32(buf[pos:pos+4], uint32(m.SrPolicyIndex))
943         pos += 4
944         return buf, nil
945 }
946 func (m *SrPolicyDel) Unmarshal(tmp []byte) error {
947         o := binary.BigEndian
948         _ = o
949         pos := 0
950         _ = pos
951         // field[1] m.BsidAddr
952         for i := 0; i < len(m.BsidAddr); i++ {
953                 m.BsidAddr[i] = uint8(tmp[pos])
954                 pos += 1
955         }
956         // field[1] m.SrPolicyIndex
957         m.SrPolicyIndex = uint32(o.Uint32(tmp[pos : pos+4]))
958         pos += 4
959         return nil
960 }
961
962 // SrPolicyDelReply represents VPP binary API message 'sr_policy_del_reply'.
963 type SrPolicyDelReply struct {
964         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
965 }
966
967 func (m *SrPolicyDelReply) Reset()                        { *m = SrPolicyDelReply{} }
968 func (*SrPolicyDelReply) GetMessageName() string          { return "sr_policy_del_reply" }
969 func (*SrPolicyDelReply) GetCrcString() string            { return "e8d4e804" }
970 func (*SrPolicyDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
971
972 func (m *SrPolicyDelReply) Size() int {
973         if m == nil {
974                 return 0
975         }
976         var size int
977         // field[1] m.Retval
978         size += 4
979         return size
980 }
981 func (m *SrPolicyDelReply) Marshal(b []byte) ([]byte, error) {
982         o := binary.BigEndian
983         _ = o
984         pos := 0
985         _ = pos
986         var buf []byte
987         if b == nil {
988                 buf = make([]byte, m.Size())
989         } else {
990                 buf = b
991         }
992         // field[1] m.Retval
993         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
994         pos += 4
995         return buf, nil
996 }
997 func (m *SrPolicyDelReply) Unmarshal(tmp []byte) error {
998         o := binary.BigEndian
999         _ = o
1000         pos := 0
1001         _ = pos
1002         // field[1] m.Retval
1003         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
1004         pos += 4
1005         return nil
1006 }
1007
1008 // SrPolicyMod represents VPP binary API message 'sr_policy_mod'.
1009 type SrPolicyMod struct {
1010         BsidAddr      ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
1011         SrPolicyIndex uint32              `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
1012         FibTable      uint32              `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
1013         Operation     SrPolicyOp          `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"`
1014         SlIndex       uint32              `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
1015         Weight        uint32              `binapi:"u32,name=weight" json:"weight,omitempty"`
1016         Sids          Srv6SidList         `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
1017 }
1018
1019 func (m *SrPolicyMod) Reset()                        { *m = SrPolicyMod{} }
1020 func (*SrPolicyMod) GetMessageName() string          { return "sr_policy_mod" }
1021 func (*SrPolicyMod) GetCrcString() string            { return "e531a102" }
1022 func (*SrPolicyMod) GetMessageType() api.MessageType { return api.RequestMessage }
1023
1024 func (m *SrPolicyMod) Size() int {
1025         if m == nil {
1026                 return 0
1027         }
1028         var size int
1029         // field[1] m.BsidAddr
1030         size += 16
1031         // field[1] m.SrPolicyIndex
1032         size += 4
1033         // field[1] m.FibTable
1034         size += 4
1035         // field[1] m.Operation
1036         size += 1
1037         // field[1] m.SlIndex
1038         size += 4
1039         // field[1] m.Weight
1040         size += 4
1041         // field[1] m.Sids
1042         // field[2] m.Sids.NumSids
1043         size += 1
1044         // field[2] m.Sids.Weight
1045         size += 4
1046         // field[2] m.Sids.Sids
1047         for j2 := 0; j2 < 16; j2++ {
1048                 var s2 ip_types.IP6Address
1049                 _ = s2
1050                 if j2 < len(m.Sids.Sids) {
1051                         s2 = m.Sids.Sids[j2]
1052                 }
1053                 size += 16
1054         }
1055         return size
1056 }
1057 func (m *SrPolicyMod) Marshal(b []byte) ([]byte, error) {
1058         o := binary.BigEndian
1059         _ = o
1060         pos := 0
1061         _ = pos
1062         var buf []byte
1063         if b == nil {
1064                 buf = make([]byte, m.Size())
1065         } else {
1066                 buf = b
1067         }
1068         // field[1] m.BsidAddr
1069         for i := 0; i < 16; i++ {
1070                 var x uint8
1071                 if i < len(m.BsidAddr) {
1072                         x = uint8(m.BsidAddr[i])
1073                 }
1074                 buf[pos] = uint8(x)
1075                 pos += 1
1076         }
1077         // field[1] m.SrPolicyIndex
1078         o.PutUint32(buf[pos:pos+4], uint32(m.SrPolicyIndex))
1079         pos += 4
1080         // field[1] m.FibTable
1081         o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
1082         pos += 4
1083         // field[1] m.Operation
1084         buf[pos] = uint8(m.Operation)
1085         pos += 1
1086         // field[1] m.SlIndex
1087         o.PutUint32(buf[pos:pos+4], uint32(m.SlIndex))
1088         pos += 4
1089         // field[1] m.Weight
1090         o.PutUint32(buf[pos:pos+4], uint32(m.Weight))
1091         pos += 4
1092         // field[1] m.Sids
1093         // field[2] m.Sids.NumSids
1094         buf[pos] = uint8(m.Sids.NumSids)
1095         pos += 1
1096         // field[2] m.Sids.Weight
1097         o.PutUint32(buf[pos:pos+4], uint32(m.Sids.Weight))
1098         pos += 4
1099         // field[2] m.Sids.Sids
1100         for j2 := 0; j2 < 16; j2++ {
1101                 var v2 ip_types.IP6Address
1102                 if j2 < len(m.Sids.Sids) {
1103                         v2 = m.Sids.Sids[j2]
1104                 }
1105                 for i := 0; i < 16; i++ {
1106                         var x uint8
1107                         if i < len(v2) {
1108                                 x = uint8(v2[i])
1109                         }
1110                         buf[pos] = uint8(x)
1111                         pos += 1
1112                 }
1113         }
1114         return buf, nil
1115 }
1116 func (m *SrPolicyMod) Unmarshal(tmp []byte) error {
1117         o := binary.BigEndian
1118         _ = o
1119         pos := 0
1120         _ = pos
1121         // field[1] m.BsidAddr
1122         for i := 0; i < len(m.BsidAddr); i++ {
1123                 m.BsidAddr[i] = uint8(tmp[pos])
1124                 pos += 1
1125         }
1126         // field[1] m.SrPolicyIndex
1127         m.SrPolicyIndex = uint32(o.Uint32(tmp[pos : pos+4]))
1128         pos += 4
1129         // field[1] m.FibTable
1130         m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
1131         pos += 4
1132         // field[1] m.Operation
1133         m.Operation = SrPolicyOp(tmp[pos])
1134         pos += 1
1135         // field[1] m.SlIndex
1136         m.SlIndex = uint32(o.Uint32(tmp[pos : pos+4]))
1137         pos += 4
1138         // field[1] m.Weight
1139         m.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
1140         pos += 4
1141         // field[1] m.Sids
1142         // field[2] m.Sids.NumSids
1143         m.Sids.NumSids = uint8(tmp[pos])
1144         pos += 1
1145         // field[2] m.Sids.Weight
1146         m.Sids.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
1147         pos += 4
1148         // field[2] m.Sids.Sids
1149         for j2 := 0; j2 < 16; j2++ {
1150                 for i := 0; i < len(m.Sids.Sids[j2]); i++ {
1151                         m.Sids.Sids[j2][i] = uint8(tmp[pos])
1152                         pos += 1
1153                 }
1154         }
1155         return nil
1156 }
1157
1158 // SrPolicyModReply represents VPP binary API message 'sr_policy_mod_reply'.
1159 type SrPolicyModReply struct {
1160         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1161 }
1162
1163 func (m *SrPolicyModReply) Reset()                        { *m = SrPolicyModReply{} }
1164 func (*SrPolicyModReply) GetMessageName() string          { return "sr_policy_mod_reply" }
1165 func (*SrPolicyModReply) GetCrcString() string            { return "e8d4e804" }
1166 func (*SrPolicyModReply) GetMessageType() api.MessageType { return api.ReplyMessage }
1167
1168 func (m *SrPolicyModReply) Size() int {
1169         if m == nil {
1170                 return 0
1171         }
1172         var size int
1173         // field[1] m.Retval
1174         size += 4
1175         return size
1176 }
1177 func (m *SrPolicyModReply) Marshal(b []byte) ([]byte, error) {
1178         o := binary.BigEndian
1179         _ = o
1180         pos := 0
1181         _ = pos
1182         var buf []byte
1183         if b == nil {
1184                 buf = make([]byte, m.Size())
1185         } else {
1186                 buf = b
1187         }
1188         // field[1] m.Retval
1189         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
1190         pos += 4
1191         return buf, nil
1192 }
1193 func (m *SrPolicyModReply) Unmarshal(tmp []byte) error {
1194         o := binary.BigEndian
1195         _ = o
1196         pos := 0
1197         _ = pos
1198         // field[1] m.Retval
1199         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
1200         pos += 4
1201         return nil
1202 }
1203
1204 // SrSetEncapHopLimit represents VPP binary API message 'sr_set_encap_hop_limit'.
1205 type SrSetEncapHopLimit struct {
1206         HopLimit uint8 `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
1207 }
1208
1209 func (m *SrSetEncapHopLimit) Reset()                        { *m = SrSetEncapHopLimit{} }
1210 func (*SrSetEncapHopLimit) GetMessageName() string          { return "sr_set_encap_hop_limit" }
1211 func (*SrSetEncapHopLimit) GetCrcString() string            { return "aa75d7d0" }
1212 func (*SrSetEncapHopLimit) GetMessageType() api.MessageType { return api.RequestMessage }
1213
1214 func (m *SrSetEncapHopLimit) Size() int {
1215         if m == nil {
1216                 return 0
1217         }
1218         var size int
1219         // field[1] m.HopLimit
1220         size += 1
1221         return size
1222 }
1223 func (m *SrSetEncapHopLimit) Marshal(b []byte) ([]byte, error) {
1224         o := binary.BigEndian
1225         _ = o
1226         pos := 0
1227         _ = pos
1228         var buf []byte
1229         if b == nil {
1230                 buf = make([]byte, m.Size())
1231         } else {
1232                 buf = b
1233         }
1234         // field[1] m.HopLimit
1235         buf[pos] = uint8(m.HopLimit)
1236         pos += 1
1237         return buf, nil
1238 }
1239 func (m *SrSetEncapHopLimit) Unmarshal(tmp []byte) error {
1240         o := binary.BigEndian
1241         _ = o
1242         pos := 0
1243         _ = pos
1244         // field[1] m.HopLimit
1245         m.HopLimit = uint8(tmp[pos])
1246         pos += 1
1247         return nil
1248 }
1249
1250 // SrSetEncapHopLimitReply represents VPP binary API message 'sr_set_encap_hop_limit_reply'.
1251 type SrSetEncapHopLimitReply struct {
1252         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1253 }
1254
1255 func (m *SrSetEncapHopLimitReply) Reset()                        { *m = SrSetEncapHopLimitReply{} }
1256 func (*SrSetEncapHopLimitReply) GetMessageName() string          { return "sr_set_encap_hop_limit_reply" }
1257 func (*SrSetEncapHopLimitReply) GetCrcString() string            { return "e8d4e804" }
1258 func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType { return api.ReplyMessage }
1259
1260 func (m *SrSetEncapHopLimitReply) Size() int {
1261         if m == nil {
1262                 return 0
1263         }
1264         var size int
1265         // field[1] m.Retval
1266         size += 4
1267         return size
1268 }
1269 func (m *SrSetEncapHopLimitReply) Marshal(b []byte) ([]byte, error) {
1270         o := binary.BigEndian
1271         _ = o
1272         pos := 0
1273         _ = pos
1274         var buf []byte
1275         if b == nil {
1276                 buf = make([]byte, m.Size())
1277         } else {
1278                 buf = b
1279         }
1280         // field[1] m.Retval
1281         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
1282         pos += 4
1283         return buf, nil
1284 }
1285 func (m *SrSetEncapHopLimitReply) Unmarshal(tmp []byte) error {
1286         o := binary.BigEndian
1287         _ = o
1288         pos := 0
1289         _ = pos
1290         // field[1] m.Retval
1291         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
1292         pos += 4
1293         return nil
1294 }
1295
1296 // SrSetEncapSource represents VPP binary API message 'sr_set_encap_source'.
1297 type SrSetEncapSource struct {
1298         EncapsSource ip_types.IP6Address `binapi:"ip6_address,name=encaps_source" json:"encaps_source,omitempty"`
1299 }
1300
1301 func (m *SrSetEncapSource) Reset()                        { *m = SrSetEncapSource{} }
1302 func (*SrSetEncapSource) GetMessageName() string          { return "sr_set_encap_source" }
1303 func (*SrSetEncapSource) GetCrcString() string            { return "d3bad5e1" }
1304 func (*SrSetEncapSource) GetMessageType() api.MessageType { return api.RequestMessage }
1305
1306 func (m *SrSetEncapSource) Size() int {
1307         if m == nil {
1308                 return 0
1309         }
1310         var size int
1311         // field[1] m.EncapsSource
1312         size += 16
1313         return size
1314 }
1315 func (m *SrSetEncapSource) Marshal(b []byte) ([]byte, error) {
1316         o := binary.BigEndian
1317         _ = o
1318         pos := 0
1319         _ = pos
1320         var buf []byte
1321         if b == nil {
1322                 buf = make([]byte, m.Size())
1323         } else {
1324                 buf = b
1325         }
1326         // field[1] m.EncapsSource
1327         for i := 0; i < 16; i++ {
1328                 var x uint8
1329                 if i < len(m.EncapsSource) {
1330                         x = uint8(m.EncapsSource[i])
1331                 }
1332                 buf[pos] = uint8(x)
1333                 pos += 1
1334         }
1335         return buf, nil
1336 }
1337 func (m *SrSetEncapSource) Unmarshal(tmp []byte) error {
1338         o := binary.BigEndian
1339         _ = o
1340         pos := 0
1341         _ = pos
1342         // field[1] m.EncapsSource
1343         for i := 0; i < len(m.EncapsSource); i++ {
1344                 m.EncapsSource[i] = uint8(tmp[pos])
1345                 pos += 1
1346         }
1347         return nil
1348 }
1349
1350 // SrSetEncapSourceReply represents VPP binary API message 'sr_set_encap_source_reply'.
1351 type SrSetEncapSourceReply struct {
1352         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1353 }
1354
1355 func (m *SrSetEncapSourceReply) Reset()                        { *m = SrSetEncapSourceReply{} }
1356 func (*SrSetEncapSourceReply) GetMessageName() string          { return "sr_set_encap_source_reply" }
1357 func (*SrSetEncapSourceReply) GetCrcString() string            { return "e8d4e804" }
1358 func (*SrSetEncapSourceReply) GetMessageType() api.MessageType { return api.ReplyMessage }
1359
1360 func (m *SrSetEncapSourceReply) Size() int {
1361         if m == nil {
1362                 return 0
1363         }
1364         var size int
1365         // field[1] m.Retval
1366         size += 4
1367         return size
1368 }
1369 func (m *SrSetEncapSourceReply) Marshal(b []byte) ([]byte, error) {
1370         o := binary.BigEndian
1371         _ = o
1372         pos := 0
1373         _ = pos
1374         var buf []byte
1375         if b == nil {
1376                 buf = make([]byte, m.Size())
1377         } else {
1378                 buf = b
1379         }
1380         // field[1] m.Retval
1381         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
1382         pos += 4
1383         return buf, nil
1384 }
1385 func (m *SrSetEncapSourceReply) Unmarshal(tmp []byte) error {
1386         o := binary.BigEndian
1387         _ = o
1388         pos := 0
1389         _ = pos
1390         // field[1] m.Retval
1391         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
1392         pos += 4
1393         return nil
1394 }
1395
1396 // SrSteeringAddDel represents VPP binary API message 'sr_steering_add_del'.
1397 type SrSteeringAddDel struct {
1398         IsDel         bool                           `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
1399         BsidAddr      ip_types.IP6Address            `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
1400         SrPolicyIndex uint32                         `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
1401         TableID       uint32                         `binapi:"u32,name=table_id" json:"table_id,omitempty"`
1402         Prefix        ip_types.Prefix                `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
1403         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1404         TrafficType   SrSteer                        `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
1405 }
1406
1407 func (m *SrSteeringAddDel) Reset()                        { *m = SrSteeringAddDel{} }
1408 func (*SrSteeringAddDel) GetMessageName() string          { return "sr_steering_add_del" }
1409 func (*SrSteeringAddDel) GetCrcString() string            { return "3711dace" }
1410 func (*SrSteeringAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
1411
1412 func (m *SrSteeringAddDel) Size() int {
1413         if m == nil {
1414                 return 0
1415         }
1416         var size int
1417         // field[1] m.IsDel
1418         size += 1
1419         // field[1] m.BsidAddr
1420         size += 16
1421         // field[1] m.SrPolicyIndex
1422         size += 4
1423         // field[1] m.TableID
1424         size += 4
1425         // field[1] m.Prefix
1426         // field[2] m.Prefix.Address
1427         // field[3] m.Prefix.Address.Af
1428         size += 1
1429         // field[3] m.Prefix.Address.Un
1430         size += 16
1431         // field[2] m.Prefix.Len
1432         size += 1
1433         // field[1] m.SwIfIndex
1434         size += 4
1435         // field[1] m.TrafficType
1436         size += 1
1437         return size
1438 }
1439 func (m *SrSteeringAddDel) Marshal(b []byte) ([]byte, error) {
1440         o := binary.BigEndian
1441         _ = o
1442         pos := 0
1443         _ = pos
1444         var buf []byte
1445         if b == nil {
1446                 buf = make([]byte, m.Size())
1447         } else {
1448                 buf = b
1449         }
1450         // field[1] m.IsDel
1451         if m.IsDel {
1452                 buf[pos] = 1
1453         }
1454         pos += 1
1455         // field[1] m.BsidAddr
1456         for i := 0; i < 16; i++ {
1457                 var x uint8
1458                 if i < len(m.BsidAddr) {
1459                         x = uint8(m.BsidAddr[i])
1460                 }
1461                 buf[pos] = uint8(x)
1462                 pos += 1
1463         }
1464         // field[1] m.SrPolicyIndex
1465         o.PutUint32(buf[pos:pos+4], uint32(m.SrPolicyIndex))
1466         pos += 4
1467         // field[1] m.TableID
1468         o.PutUint32(buf[pos:pos+4], uint32(m.TableID))
1469         pos += 4
1470         // field[1] m.Prefix
1471         // field[2] m.Prefix.Address
1472         // field[3] m.Prefix.Address.Af
1473         buf[pos] = uint8(m.Prefix.Address.Af)
1474         pos += 1
1475         // field[3] m.Prefix.Address.Un
1476         copy(buf[pos:pos+16], m.Prefix.Address.Un.XXX_UnionData[:])
1477         pos += 16
1478         // field[2] m.Prefix.Len
1479         buf[pos] = uint8(m.Prefix.Len)
1480         pos += 1
1481         // field[1] m.SwIfIndex
1482         o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
1483         pos += 4
1484         // field[1] m.TrafficType
1485         buf[pos] = uint8(m.TrafficType)
1486         pos += 1
1487         return buf, nil
1488 }
1489 func (m *SrSteeringAddDel) Unmarshal(tmp []byte) error {
1490         o := binary.BigEndian
1491         _ = o
1492         pos := 0
1493         _ = pos
1494         // field[1] m.IsDel
1495         m.IsDel = tmp[pos] != 0
1496         pos += 1
1497         // field[1] m.BsidAddr
1498         for i := 0; i < len(m.BsidAddr); i++ {
1499                 m.BsidAddr[i] = uint8(tmp[pos])
1500                 pos += 1
1501         }
1502         // field[1] m.SrPolicyIndex
1503         m.SrPolicyIndex = uint32(o.Uint32(tmp[pos : pos+4]))
1504         pos += 4
1505         // field[1] m.TableID
1506         m.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
1507         pos += 4
1508         // field[1] m.Prefix
1509         // field[2] m.Prefix.Address
1510         // field[3] m.Prefix.Address.Af
1511         m.Prefix.Address.Af = ip_types.AddressFamily(tmp[pos])
1512         pos += 1
1513         // field[3] m.Prefix.Address.Un
1514         copy(m.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
1515         pos += 16
1516         // field[2] m.Prefix.Len
1517         m.Prefix.Len = uint8(tmp[pos])
1518         pos += 1
1519         // field[1] m.SwIfIndex
1520         m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
1521         pos += 4
1522         // field[1] m.TrafficType
1523         m.TrafficType = SrSteer(tmp[pos])
1524         pos += 1
1525         return nil
1526 }
1527
1528 // SrSteeringAddDelReply represents VPP binary API message 'sr_steering_add_del_reply'.
1529 type SrSteeringAddDelReply struct {
1530         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1531 }
1532
1533 func (m *SrSteeringAddDelReply) Reset()                        { *m = SrSteeringAddDelReply{} }
1534 func (*SrSteeringAddDelReply) GetMessageName() string          { return "sr_steering_add_del_reply" }
1535 func (*SrSteeringAddDelReply) GetCrcString() string            { return "e8d4e804" }
1536 func (*SrSteeringAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
1537
1538 func (m *SrSteeringAddDelReply) Size() int {
1539         if m == nil {
1540                 return 0
1541         }
1542         var size int
1543         // field[1] m.Retval
1544         size += 4
1545         return size
1546 }
1547 func (m *SrSteeringAddDelReply) Marshal(b []byte) ([]byte, error) {
1548         o := binary.BigEndian
1549         _ = o
1550         pos := 0
1551         _ = pos
1552         var buf []byte
1553         if b == nil {
1554                 buf = make([]byte, m.Size())
1555         } else {
1556                 buf = b
1557         }
1558         // field[1] m.Retval
1559         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
1560         pos += 4
1561         return buf, nil
1562 }
1563 func (m *SrSteeringAddDelReply) Unmarshal(tmp []byte) error {
1564         o := binary.BigEndian
1565         _ = o
1566         pos := 0
1567         _ = pos
1568         // field[1] m.Retval
1569         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
1570         pos += 4
1571         return nil
1572 }
1573
1574 // SrSteeringPolDetails represents VPP binary API message 'sr_steering_pol_details'.
1575 type SrSteeringPolDetails struct {
1576         TrafficType SrSteer                        `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
1577         FibTable    uint32                         `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
1578         Prefix      ip_types.Prefix                `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
1579         SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1580         Bsid        ip_types.IP6Address            `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
1581 }
1582
1583 func (m *SrSteeringPolDetails) Reset()                        { *m = SrSteeringPolDetails{} }
1584 func (*SrSteeringPolDetails) GetMessageName() string          { return "sr_steering_pol_details" }
1585 func (*SrSteeringPolDetails) GetCrcString() string            { return "1c1ee786" }
1586 func (*SrSteeringPolDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
1587
1588 func (m *SrSteeringPolDetails) Size() int {
1589         if m == nil {
1590                 return 0
1591         }
1592         var size int
1593         // field[1] m.TrafficType
1594         size += 1
1595         // field[1] m.FibTable
1596         size += 4
1597         // field[1] m.Prefix
1598         // field[2] m.Prefix.Address
1599         // field[3] m.Prefix.Address.Af
1600         size += 1
1601         // field[3] m.Prefix.Address.Un
1602         size += 16
1603         // field[2] m.Prefix.Len
1604         size += 1
1605         // field[1] m.SwIfIndex
1606         size += 4
1607         // field[1] m.Bsid
1608         size += 16
1609         return size
1610 }
1611 func (m *SrSteeringPolDetails) Marshal(b []byte) ([]byte, error) {
1612         o := binary.BigEndian
1613         _ = o
1614         pos := 0
1615         _ = pos
1616         var buf []byte
1617         if b == nil {
1618                 buf = make([]byte, m.Size())
1619         } else {
1620                 buf = b
1621         }
1622         // field[1] m.TrafficType
1623         buf[pos] = uint8(m.TrafficType)
1624         pos += 1
1625         // field[1] m.FibTable
1626         o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
1627         pos += 4
1628         // field[1] m.Prefix
1629         // field[2] m.Prefix.Address
1630         // field[3] m.Prefix.Address.Af
1631         buf[pos] = uint8(m.Prefix.Address.Af)
1632         pos += 1
1633         // field[3] m.Prefix.Address.Un
1634         copy(buf[pos:pos+16], m.Prefix.Address.Un.XXX_UnionData[:])
1635         pos += 16
1636         // field[2] m.Prefix.Len
1637         buf[pos] = uint8(m.Prefix.Len)
1638         pos += 1
1639         // field[1] m.SwIfIndex
1640         o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
1641         pos += 4
1642         // field[1] m.Bsid
1643         for i := 0; i < 16; i++ {
1644                 var x uint8
1645                 if i < len(m.Bsid) {
1646                         x = uint8(m.Bsid[i])
1647                 }
1648                 buf[pos] = uint8(x)
1649                 pos += 1
1650         }
1651         return buf, nil
1652 }
1653 func (m *SrSteeringPolDetails) Unmarshal(tmp []byte) error {
1654         o := binary.BigEndian
1655         _ = o
1656         pos := 0
1657         _ = pos
1658         // field[1] m.TrafficType
1659         m.TrafficType = SrSteer(tmp[pos])
1660         pos += 1
1661         // field[1] m.FibTable
1662         m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
1663         pos += 4
1664         // field[1] m.Prefix
1665         // field[2] m.Prefix.Address
1666         // field[3] m.Prefix.Address.Af
1667         m.Prefix.Address.Af = ip_types.AddressFamily(tmp[pos])
1668         pos += 1
1669         // field[3] m.Prefix.Address.Un
1670         copy(m.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
1671         pos += 16
1672         // field[2] m.Prefix.Len
1673         m.Prefix.Len = uint8(tmp[pos])
1674         pos += 1
1675         // field[1] m.SwIfIndex
1676         m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
1677         pos += 4
1678         // field[1] m.Bsid
1679         for i := 0; i < len(m.Bsid); i++ {
1680                 m.Bsid[i] = uint8(tmp[pos])
1681                 pos += 1
1682         }
1683         return nil
1684 }
1685
1686 // SrSteeringPolDump represents VPP binary API message 'sr_steering_pol_dump'.
1687 type SrSteeringPolDump struct{}
1688
1689 func (m *SrSteeringPolDump) Reset()                        { *m = SrSteeringPolDump{} }
1690 func (*SrSteeringPolDump) GetMessageName() string          { return "sr_steering_pol_dump" }
1691 func (*SrSteeringPolDump) GetCrcString() string            { return "51077d14" }
1692 func (*SrSteeringPolDump) GetMessageType() api.MessageType { return api.RequestMessage }
1693
1694 func (m *SrSteeringPolDump) Size() int {
1695         if m == nil {
1696                 return 0
1697         }
1698         var size int
1699         return size
1700 }
1701 func (m *SrSteeringPolDump) Marshal(b []byte) ([]byte, error) {
1702         o := binary.BigEndian
1703         _ = o
1704         pos := 0
1705         _ = pos
1706         var buf []byte
1707         if b == nil {
1708                 buf = make([]byte, m.Size())
1709         } else {
1710                 buf = b
1711         }
1712         return buf, nil
1713 }
1714 func (m *SrSteeringPolDump) Unmarshal(tmp []byte) error {
1715         o := binary.BigEndian
1716         _ = o
1717         pos := 0
1718         _ = pos
1719         return nil
1720 }
1721
1722 func init() { file_sr_binapi_init() }
1723 func file_sr_binapi_init() {
1724         api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr.SrLocalsidAddDel")
1725         api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr.SrLocalsidAddDelReply")
1726         api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr.SrLocalsidsDetails")
1727         api.RegisterMessage((*SrLocalsidsDump)(nil), "sr.SrLocalsidsDump")
1728         api.RegisterMessage((*SrPoliciesDetails)(nil), "sr.SrPoliciesDetails")
1729         api.RegisterMessage((*SrPoliciesDump)(nil), "sr.SrPoliciesDump")
1730         api.RegisterMessage((*SrPolicyAdd)(nil), "sr.SrPolicyAdd")
1731         api.RegisterMessage((*SrPolicyAddReply)(nil), "sr.SrPolicyAddReply")
1732         api.RegisterMessage((*SrPolicyDel)(nil), "sr.SrPolicyDel")
1733         api.RegisterMessage((*SrPolicyDelReply)(nil), "sr.SrPolicyDelReply")
1734         api.RegisterMessage((*SrPolicyMod)(nil), "sr.SrPolicyMod")
1735         api.RegisterMessage((*SrPolicyModReply)(nil), "sr.SrPolicyModReply")
1736         api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr.SrSetEncapHopLimit")
1737         api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr.SrSetEncapHopLimitReply")
1738         api.RegisterMessage((*SrSetEncapSource)(nil), "sr.SrSetEncapSource")
1739         api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr.SrSetEncapSourceReply")
1740         api.RegisterMessage((*SrSteeringAddDel)(nil), "sr.SrSteeringAddDel")
1741         api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr.SrSteeringAddDelReply")
1742         api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr.SrSteeringPolDetails")
1743         api.RegisterMessage((*SrSteeringPolDump)(nil), "sr.SrSteeringPolDump")
1744 }
1745
1746 // Messages returns list of all messages in this module.
1747 func AllMessages() []api.Message {
1748         return []api.Message{
1749                 (*SrLocalsidAddDel)(nil),
1750                 (*SrLocalsidAddDelReply)(nil),
1751                 (*SrLocalsidsDetails)(nil),
1752                 (*SrLocalsidsDump)(nil),
1753                 (*SrPoliciesDetails)(nil),
1754                 (*SrPoliciesDump)(nil),
1755                 (*SrPolicyAdd)(nil),
1756                 (*SrPolicyAddReply)(nil),
1757                 (*SrPolicyDel)(nil),
1758                 (*SrPolicyDelReply)(nil),
1759                 (*SrPolicyMod)(nil),
1760                 (*SrPolicyModReply)(nil),
1761                 (*SrSetEncapHopLimit)(nil),
1762                 (*SrSetEncapHopLimitReply)(nil),
1763                 (*SrSetEncapSource)(nil),
1764                 (*SrSetEncapSourceReply)(nil),
1765                 (*SrSteeringAddDel)(nil),
1766                 (*SrSteeringAddDelReply)(nil),
1767                 (*SrSteeringPolDetails)(nil),
1768                 (*SrSteeringPolDump)(nil),
1769         }
1770 }
1771
1772 // Reference imports to suppress errors if they are not otherwise used.
1773 var _ = api.RegisterMessage
1774 var _ = codec.DecodeString
1775 var _ = bytes.NewBuffer
1776 var _ = context.Background
1777 var _ = io.Copy
1778 var _ = strconv.Itoa
1779 var _ = strings.Contains
1780 var _ = struc.Pack
1781 var _ = binary.BigEndian
1782 var _ = math.Float32bits
1783 var _ = net.ParseIP
1784 var _ = fmt.Errorf