Refactored binapi generator with message encoding
[govpp.git] / examples / binapi / af_packet / af_packet.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/af_packet.api.json
6
7 /*
8 Package af_packet contains generated code for VPP binary API defined by af_packet.api (version 2.0.0).
9
10 It consists of:
11           2 aliases
12           6 enums
13           8 messages
14 */
15 package af_packet
16
17 import (
18         "bytes"
19         "context"
20         "encoding/binary"
21         "io"
22         "math"
23         "strconv"
24
25         api "git.fd.io/govpp.git/api"
26         codec "git.fd.io/govpp.git/codec"
27         struc "github.com/lunixbochs/struc"
28 )
29
30 // This is a compile-time assertion to ensure that this generated file
31 // is compatible with the GoVPP api package it is being compiled against.
32 // A compilation error at this line likely means your copy of the
33 // GoVPP api package needs to be updated.
34 const _ = api.GoVppAPIPackageIsVersion2 // please upgrade the GoVPP api package
35
36 const (
37         // ModuleName is the name of this module.
38         ModuleName = "af_packet"
39         // APIVersion is the API version of this module.
40         APIVersion = "2.0.0"
41         // VersionCrc is the CRC of this module.
42         VersionCrc = 0xba745e20
43 )
44
45 // IfStatusFlags represents VPP binary API enum 'if_status_flags'.
46 type IfStatusFlags uint32
47
48 const (
49         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
50         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
51 )
52
53 var (
54         IfStatusFlags_name = map[uint32]string{
55                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
56                 2: "IF_STATUS_API_FLAG_LINK_UP",
57         }
58         IfStatusFlags_value = map[string]uint32{
59                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
60                 "IF_STATUS_API_FLAG_LINK_UP":  2,
61         }
62 )
63
64 func (x IfStatusFlags) String() string {
65         s, ok := IfStatusFlags_name[uint32(x)]
66         if ok {
67                 return s
68         }
69         return "IfStatusFlags(" + strconv.Itoa(int(x)) + ")"
70 }
71
72 // IfType represents VPP binary API enum 'if_type'.
73 type IfType uint32
74
75 const (
76         IF_API_TYPE_HARDWARE IfType = 1
77         IF_API_TYPE_SUB      IfType = 2
78         IF_API_TYPE_P2P      IfType = 3
79         IF_API_TYPE_PIPE     IfType = 4
80 )
81
82 var (
83         IfType_name = map[uint32]string{
84                 1: "IF_API_TYPE_HARDWARE",
85                 2: "IF_API_TYPE_SUB",
86                 3: "IF_API_TYPE_P2P",
87                 4: "IF_API_TYPE_PIPE",
88         }
89         IfType_value = map[string]uint32{
90                 "IF_API_TYPE_HARDWARE": 1,
91                 "IF_API_TYPE_SUB":      2,
92                 "IF_API_TYPE_P2P":      3,
93                 "IF_API_TYPE_PIPE":     4,
94         }
95 )
96
97 func (x IfType) String() string {
98         s, ok := IfType_name[uint32(x)]
99         if ok {
100                 return s
101         }
102         return "IfType(" + strconv.Itoa(int(x)) + ")"
103 }
104
105 // LinkDuplex represents VPP binary API enum 'link_duplex'.
106 type LinkDuplex uint32
107
108 const (
109         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
110         LINK_DUPLEX_API_HALF    LinkDuplex = 1
111         LINK_DUPLEX_API_FULL    LinkDuplex = 2
112 )
113
114 var (
115         LinkDuplex_name = map[uint32]string{
116                 0: "LINK_DUPLEX_API_UNKNOWN",
117                 1: "LINK_DUPLEX_API_HALF",
118                 2: "LINK_DUPLEX_API_FULL",
119         }
120         LinkDuplex_value = map[string]uint32{
121                 "LINK_DUPLEX_API_UNKNOWN": 0,
122                 "LINK_DUPLEX_API_HALF":    1,
123                 "LINK_DUPLEX_API_FULL":    2,
124         }
125 )
126
127 func (x LinkDuplex) String() string {
128         s, ok := LinkDuplex_name[uint32(x)]
129         if ok {
130                 return s
131         }
132         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
133 }
134
135 // MtuProto represents VPP binary API enum 'mtu_proto'.
136 type MtuProto uint32
137
138 const (
139         MTU_PROTO_API_L3   MtuProto = 1
140         MTU_PROTO_API_IP4  MtuProto = 2
141         MTU_PROTO_API_IP6  MtuProto = 3
142         MTU_PROTO_API_MPLS MtuProto = 4
143         MTU_PROTO_API_N    MtuProto = 5
144 )
145
146 var (
147         MtuProto_name = map[uint32]string{
148                 1: "MTU_PROTO_API_L3",
149                 2: "MTU_PROTO_API_IP4",
150                 3: "MTU_PROTO_API_IP6",
151                 4: "MTU_PROTO_API_MPLS",
152                 5: "MTU_PROTO_API_N",
153         }
154         MtuProto_value = map[string]uint32{
155                 "MTU_PROTO_API_L3":   1,
156                 "MTU_PROTO_API_IP4":  2,
157                 "MTU_PROTO_API_IP6":  3,
158                 "MTU_PROTO_API_MPLS": 4,
159                 "MTU_PROTO_API_N":    5,
160         }
161 )
162
163 func (x MtuProto) String() string {
164         s, ok := MtuProto_name[uint32(x)]
165         if ok {
166                 return s
167         }
168         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
169 }
170
171 // RxMode represents VPP binary API enum 'rx_mode'.
172 type RxMode uint32
173
174 const (
175         RX_MODE_API_UNKNOWN   RxMode = 0
176         RX_MODE_API_POLLING   RxMode = 1
177         RX_MODE_API_INTERRUPT RxMode = 2
178         RX_MODE_API_ADAPTIVE  RxMode = 3
179         RX_MODE_API_DEFAULT   RxMode = 4
180 )
181
182 var (
183         RxMode_name = map[uint32]string{
184                 0: "RX_MODE_API_UNKNOWN",
185                 1: "RX_MODE_API_POLLING",
186                 2: "RX_MODE_API_INTERRUPT",
187                 3: "RX_MODE_API_ADAPTIVE",
188                 4: "RX_MODE_API_DEFAULT",
189         }
190         RxMode_value = map[string]uint32{
191                 "RX_MODE_API_UNKNOWN":   0,
192                 "RX_MODE_API_POLLING":   1,
193                 "RX_MODE_API_INTERRUPT": 2,
194                 "RX_MODE_API_ADAPTIVE":  3,
195                 "RX_MODE_API_DEFAULT":   4,
196         }
197 )
198
199 func (x RxMode) String() string {
200         s, ok := RxMode_name[uint32(x)]
201         if ok {
202                 return s
203         }
204         return "RxMode(" + strconv.Itoa(int(x)) + ")"
205 }
206
207 // SubIfFlags represents VPP binary API enum 'sub_if_flags'.
208 type SubIfFlags uint32
209
210 const (
211         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
212         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
213         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
214         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
215         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
216         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
217         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
218         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
219         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
220         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
221 )
222
223 var (
224         SubIfFlags_name = map[uint32]string{
225                 1:   "SUB_IF_API_FLAG_NO_TAGS",
226                 2:   "SUB_IF_API_FLAG_ONE_TAG",
227                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
228                 8:   "SUB_IF_API_FLAG_DOT1AD",
229                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
230                 32:  "SUB_IF_API_FLAG_DEFAULT",
231                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
232                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
233                 254: "SUB_IF_API_FLAG_MASK_VNET",
234                 256: "SUB_IF_API_FLAG_DOT1AH",
235         }
236         SubIfFlags_value = map[string]uint32{
237                 "SUB_IF_API_FLAG_NO_TAGS":           1,
238                 "SUB_IF_API_FLAG_ONE_TAG":           2,
239                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
240                 "SUB_IF_API_FLAG_DOT1AD":            8,
241                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
242                 "SUB_IF_API_FLAG_DEFAULT":           32,
243                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
244                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
245                 "SUB_IF_API_FLAG_MASK_VNET":         254,
246                 "SUB_IF_API_FLAG_DOT1AH":            256,
247         }
248 )
249
250 func (x SubIfFlags) String() string {
251         s, ok := SubIfFlags_name[uint32(x)]
252         if ok {
253                 return s
254         }
255         return "SubIfFlags(" + strconv.Itoa(int(x)) + ")"
256 }
257
258 // InterfaceIndex represents VPP binary API alias 'interface_index'.
259 type InterfaceIndex uint32
260
261 // MacAddress represents VPP binary API alias 'mac_address'.
262 type MacAddress [6]uint8
263
264 // AfPacketCreate represents VPP binary API message 'af_packet_create'.
265 type AfPacketCreate struct {
266         HwAddr          MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
267         UseRandomHwAddr bool       `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"`
268         HostIfName      string     `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty" struc:"[64]byte"`
269 }
270
271 func (m *AfPacketCreate) Reset()                        { *m = AfPacketCreate{} }
272 func (*AfPacketCreate) GetMessageName() string          { return "af_packet_create" }
273 func (*AfPacketCreate) GetCrcString() string            { return "a190415f" }
274 func (*AfPacketCreate) GetMessageType() api.MessageType { return api.RequestMessage }
275
276 func (m *AfPacketCreate) Size() int {
277         if m == nil {
278                 return 0
279         }
280         var size int
281         // field[1] m.HwAddr
282         size += 6
283         // field[1] m.UseRandomHwAddr
284         size += 1
285         // field[1] m.HostIfName
286         size += 64
287         return size
288 }
289 func (m *AfPacketCreate) Marshal(b []byte) ([]byte, error) {
290         o := binary.BigEndian
291         _ = o
292         pos := 0
293         _ = pos
294         var buf []byte
295         if b == nil {
296                 buf = make([]byte, m.Size())
297         } else {
298                 buf = b
299         }
300         // field[1] m.HwAddr
301         for i := 0; i < 6; i++ {
302                 var x uint8
303                 if i < len(m.HwAddr) {
304                         x = uint8(m.HwAddr[i])
305                 }
306                 buf[pos] = uint8(x)
307                 pos += 1
308         }
309         // field[1] m.UseRandomHwAddr
310         if m.UseRandomHwAddr {
311                 buf[pos] = 1
312         }
313         pos += 1
314         // field[1] m.HostIfName
315         copy(buf[pos:pos+64], m.HostIfName)
316         pos += 64
317         return buf, nil
318 }
319 func (m *AfPacketCreate) Unmarshal(tmp []byte) error {
320         o := binary.BigEndian
321         _ = o
322         pos := 0
323         _ = pos
324         // field[1] m.HwAddr
325         for i := 0; i < len(m.HwAddr); i++ {
326                 m.HwAddr[i] = uint8(tmp[pos])
327                 pos += 1
328         }
329         // field[1] m.UseRandomHwAddr
330         m.UseRandomHwAddr = tmp[pos] != 0
331         pos += 1
332         // field[1] m.HostIfName
333         {
334                 nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
335                 m.HostIfName = codec.DecodeString(tmp[pos : pos+nul])
336                 pos += 64
337         }
338         return nil
339 }
340
341 // AfPacketCreateReply represents VPP binary API message 'af_packet_create_reply'.
342 type AfPacketCreateReply struct {
343         Retval    int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
344         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
345 }
346
347 func (m *AfPacketCreateReply) Reset()                        { *m = AfPacketCreateReply{} }
348 func (*AfPacketCreateReply) GetMessageName() string          { return "af_packet_create_reply" }
349 func (*AfPacketCreateReply) GetCrcString() string            { return "5383d31f" }
350 func (*AfPacketCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage }
351
352 func (m *AfPacketCreateReply) Size() int {
353         if m == nil {
354                 return 0
355         }
356         var size int
357         // field[1] m.Retval
358         size += 4
359         // field[1] m.SwIfIndex
360         size += 4
361         return size
362 }
363 func (m *AfPacketCreateReply) Marshal(b []byte) ([]byte, error) {
364         o := binary.BigEndian
365         _ = o
366         pos := 0
367         _ = pos
368         var buf []byte
369         if b == nil {
370                 buf = make([]byte, m.Size())
371         } else {
372                 buf = b
373         }
374         // field[1] m.Retval
375         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
376         pos += 4
377         // field[1] m.SwIfIndex
378         o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
379         pos += 4
380         return buf, nil
381 }
382 func (m *AfPacketCreateReply) Unmarshal(tmp []byte) error {
383         o := binary.BigEndian
384         _ = o
385         pos := 0
386         _ = pos
387         // field[1] m.Retval
388         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
389         pos += 4
390         // field[1] m.SwIfIndex
391         m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
392         pos += 4
393         return nil
394 }
395
396 // AfPacketDelete represents VPP binary API message 'af_packet_delete'.
397 type AfPacketDelete struct {
398         HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty" struc:"[64]byte"`
399 }
400
401 func (m *AfPacketDelete) Reset()                        { *m = AfPacketDelete{} }
402 func (*AfPacketDelete) GetMessageName() string          { return "af_packet_delete" }
403 func (*AfPacketDelete) GetCrcString() string            { return "863fa648" }
404 func (*AfPacketDelete) GetMessageType() api.MessageType { return api.RequestMessage }
405
406 func (m *AfPacketDelete) Size() int {
407         if m == nil {
408                 return 0
409         }
410         var size int
411         // field[1] m.HostIfName
412         size += 64
413         return size
414 }
415 func (m *AfPacketDelete) 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         // field[1] m.HostIfName
427         copy(buf[pos:pos+64], m.HostIfName)
428         pos += 64
429         return buf, nil
430 }
431 func (m *AfPacketDelete) Unmarshal(tmp []byte) error {
432         o := binary.BigEndian
433         _ = o
434         pos := 0
435         _ = pos
436         // field[1] m.HostIfName
437         {
438                 nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
439                 m.HostIfName = codec.DecodeString(tmp[pos : pos+nul])
440                 pos += 64
441         }
442         return nil
443 }
444
445 // AfPacketDeleteReply represents VPP binary API message 'af_packet_delete_reply'.
446 type AfPacketDeleteReply struct {
447         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
448 }
449
450 func (m *AfPacketDeleteReply) Reset()                        { *m = AfPacketDeleteReply{} }
451 func (*AfPacketDeleteReply) GetMessageName() string          { return "af_packet_delete_reply" }
452 func (*AfPacketDeleteReply) GetCrcString() string            { return "e8d4e804" }
453 func (*AfPacketDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage }
454
455 func (m *AfPacketDeleteReply) Size() int {
456         if m == nil {
457                 return 0
458         }
459         var size int
460         // field[1] m.Retval
461         size += 4
462         return size
463 }
464 func (m *AfPacketDeleteReply) Marshal(b []byte) ([]byte, error) {
465         o := binary.BigEndian
466         _ = o
467         pos := 0
468         _ = pos
469         var buf []byte
470         if b == nil {
471                 buf = make([]byte, m.Size())
472         } else {
473                 buf = b
474         }
475         // field[1] m.Retval
476         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
477         pos += 4
478         return buf, nil
479 }
480 func (m *AfPacketDeleteReply) Unmarshal(tmp []byte) error {
481         o := binary.BigEndian
482         _ = o
483         pos := 0
484         _ = pos
485         // field[1] m.Retval
486         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
487         pos += 4
488         return nil
489 }
490
491 // AfPacketDetails represents VPP binary API message 'af_packet_details'.
492 type AfPacketDetails struct {
493         SwIfIndex  InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
494         HostIfName string         `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty" struc:"[64]byte"`
495 }
496
497 func (m *AfPacketDetails) Reset()                        { *m = AfPacketDetails{} }
498 func (*AfPacketDetails) GetMessageName() string          { return "af_packet_details" }
499 func (*AfPacketDetails) GetCrcString() string            { return "58c7c042" }
500 func (*AfPacketDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
501
502 func (m *AfPacketDetails) Size() int {
503         if m == nil {
504                 return 0
505         }
506         var size int
507         // field[1] m.SwIfIndex
508         size += 4
509         // field[1] m.HostIfName
510         size += 64
511         return size
512 }
513 func (m *AfPacketDetails) Marshal(b []byte) ([]byte, error) {
514         o := binary.BigEndian
515         _ = o
516         pos := 0
517         _ = pos
518         var buf []byte
519         if b == nil {
520                 buf = make([]byte, m.Size())
521         } else {
522                 buf = b
523         }
524         // field[1] m.SwIfIndex
525         o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
526         pos += 4
527         // field[1] m.HostIfName
528         copy(buf[pos:pos+64], m.HostIfName)
529         pos += 64
530         return buf, nil
531 }
532 func (m *AfPacketDetails) Unmarshal(tmp []byte) error {
533         o := binary.BigEndian
534         _ = o
535         pos := 0
536         _ = pos
537         // field[1] m.SwIfIndex
538         m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
539         pos += 4
540         // field[1] m.HostIfName
541         {
542                 nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
543                 m.HostIfName = codec.DecodeString(tmp[pos : pos+nul])
544                 pos += 64
545         }
546         return nil
547 }
548
549 // AfPacketDump represents VPP binary API message 'af_packet_dump'.
550 type AfPacketDump struct{}
551
552 func (m *AfPacketDump) Reset()                        { *m = AfPacketDump{} }
553 func (*AfPacketDump) GetMessageName() string          { return "af_packet_dump" }
554 func (*AfPacketDump) GetCrcString() string            { return "51077d14" }
555 func (*AfPacketDump) GetMessageType() api.MessageType { return api.RequestMessage }
556
557 func (m *AfPacketDump) Size() int {
558         if m == nil {
559                 return 0
560         }
561         var size int
562         return size
563 }
564 func (m *AfPacketDump) 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         return buf, nil
576 }
577 func (m *AfPacketDump) Unmarshal(tmp []byte) error {
578         o := binary.BigEndian
579         _ = o
580         pos := 0
581         _ = pos
582         return nil
583 }
584
585 // AfPacketSetL4CksumOffload represents VPP binary API message 'af_packet_set_l4_cksum_offload'.
586 type AfPacketSetL4CksumOffload struct {
587         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
588         Set       bool           `binapi:"bool,name=set" json:"set,omitempty"`
589 }
590
591 func (m *AfPacketSetL4CksumOffload) Reset()                        { *m = AfPacketSetL4CksumOffload{} }
592 func (*AfPacketSetL4CksumOffload) GetMessageName() string          { return "af_packet_set_l4_cksum_offload" }
593 func (*AfPacketSetL4CksumOffload) GetCrcString() string            { return "319cd5c8" }
594 func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType { return api.RequestMessage }
595
596 func (m *AfPacketSetL4CksumOffload) Size() int {
597         if m == nil {
598                 return 0
599         }
600         var size int
601         // field[1] m.SwIfIndex
602         size += 4
603         // field[1] m.Set
604         size += 1
605         return size
606 }
607 func (m *AfPacketSetL4CksumOffload) Marshal(b []byte) ([]byte, error) {
608         o := binary.BigEndian
609         _ = o
610         pos := 0
611         _ = pos
612         var buf []byte
613         if b == nil {
614                 buf = make([]byte, m.Size())
615         } else {
616                 buf = b
617         }
618         // field[1] m.SwIfIndex
619         o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
620         pos += 4
621         // field[1] m.Set
622         if m.Set {
623                 buf[pos] = 1
624         }
625         pos += 1
626         return buf, nil
627 }
628 func (m *AfPacketSetL4CksumOffload) Unmarshal(tmp []byte) error {
629         o := binary.BigEndian
630         _ = o
631         pos := 0
632         _ = pos
633         // field[1] m.SwIfIndex
634         m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
635         pos += 4
636         // field[1] m.Set
637         m.Set = tmp[pos] != 0
638         pos += 1
639         return nil
640 }
641
642 // AfPacketSetL4CksumOffloadReply represents VPP binary API message 'af_packet_set_l4_cksum_offload_reply'.
643 type AfPacketSetL4CksumOffloadReply struct {
644         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
645 }
646
647 func (m *AfPacketSetL4CksumOffloadReply) Reset() { *m = AfPacketSetL4CksumOffloadReply{} }
648 func (*AfPacketSetL4CksumOffloadReply) GetMessageName() string {
649         return "af_packet_set_l4_cksum_offload_reply"
650 }
651 func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string            { return "e8d4e804" }
652 func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType { return api.ReplyMessage }
653
654 func (m *AfPacketSetL4CksumOffloadReply) Size() int {
655         if m == nil {
656                 return 0
657         }
658         var size int
659         // field[1] m.Retval
660         size += 4
661         return size
662 }
663 func (m *AfPacketSetL4CksumOffloadReply) Marshal(b []byte) ([]byte, error) {
664         o := binary.BigEndian
665         _ = o
666         pos := 0
667         _ = pos
668         var buf []byte
669         if b == nil {
670                 buf = make([]byte, m.Size())
671         } else {
672                 buf = b
673         }
674         // field[1] m.Retval
675         o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
676         pos += 4
677         return buf, nil
678 }
679 func (m *AfPacketSetL4CksumOffloadReply) Unmarshal(tmp []byte) error {
680         o := binary.BigEndian
681         _ = o
682         pos := 0
683         _ = pos
684         // field[1] m.Retval
685         m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
686         pos += 4
687         return nil
688 }
689
690 func init() { file_af_packet_binapi_init() }
691 func file_af_packet_binapi_init() {
692         api.RegisterMessage((*AfPacketCreate)(nil), "af_packet.AfPacketCreate")
693         api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet.AfPacketCreateReply")
694         api.RegisterMessage((*AfPacketDelete)(nil), "af_packet.AfPacketDelete")
695         api.RegisterMessage((*AfPacketDeleteReply)(nil), "af_packet.AfPacketDeleteReply")
696         api.RegisterMessage((*AfPacketDetails)(nil), "af_packet.AfPacketDetails")
697         api.RegisterMessage((*AfPacketDump)(nil), "af_packet.AfPacketDump")
698         api.RegisterMessage((*AfPacketSetL4CksumOffload)(nil), "af_packet.AfPacketSetL4CksumOffload")
699         api.RegisterMessage((*AfPacketSetL4CksumOffloadReply)(nil), "af_packet.AfPacketSetL4CksumOffloadReply")
700 }
701
702 // Messages returns list of all messages in this module.
703 func AllMessages() []api.Message {
704         return []api.Message{
705                 (*AfPacketCreate)(nil),
706                 (*AfPacketCreateReply)(nil),
707                 (*AfPacketDelete)(nil),
708                 (*AfPacketDeleteReply)(nil),
709                 (*AfPacketDetails)(nil),
710                 (*AfPacketDump)(nil),
711                 (*AfPacketSetL4CksumOffload)(nil),
712                 (*AfPacketSetL4CksumOffloadReply)(nil),
713         }
714 }
715
716 // Reference imports to suppress errors if they are not otherwise used.
717 var _ = api.RegisterMessage
718 var _ = codec.DecodeString
719 var _ = bytes.NewBuffer
720 var _ = context.Background
721 var _ = io.Copy
722 var _ = strconv.Itoa
723 var _ = struc.Pack
724 var _ = binary.BigEndian
725 var _ = math.Float32bits