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