Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / memif / memif.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/plugins/memif.api.json
6
7 // Package memif contains generated bindings for API file memif.api.
8 //
9 // Contents:
10 //   2 aliases
11 //   8 enums
12 //  10 messages
13 //
14 package memif
15
16 import (
17         "net"
18         "strconv"
19
20         api "git.fd.io/govpp.git/api"
21         codec "git.fd.io/govpp.git/codec"
22 )
23
24 // This is a compile-time assertion to ensure that this generated file
25 // is compatible with the GoVPP api package it is being compiled against.
26 // A compilation error at this line likely means your copy of the
27 // GoVPP api package needs to be updated.
28 const _ = api.GoVppAPIPackageIsVersion2
29
30 const (
31         APIFile    = "memif"
32         APIVersion = "3.0.0"
33         VersionCrc = 0x88dc56c9
34 )
35
36 // IfStatusFlags defines enum 'if_status_flags'.
37 type IfStatusFlags uint32
38
39 const (
40         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
41         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
42 )
43
44 var (
45         IfStatusFlags_name = map[uint32]string{
46                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
47                 2: "IF_STATUS_API_FLAG_LINK_UP",
48         }
49         IfStatusFlags_value = map[string]uint32{
50                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
51                 "IF_STATUS_API_FLAG_LINK_UP":  2,
52         }
53 )
54
55 func (x IfStatusFlags) String() string {
56         s, ok := IfStatusFlags_name[uint32(x)]
57         if ok {
58                 return s
59         }
60         str := func(n uint32) string {
61                 s, ok := IfStatusFlags_name[uint32(n)]
62                 if ok {
63                         return s
64                 }
65                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
66         }
67         for i := uint32(0); i <= 32; i++ {
68                 val := uint32(x)
69                 if val&(1<<i) != 0 {
70                         if s != "" {
71                                 s += "|"
72                         }
73                         s += str(1 << i)
74                 }
75         }
76         if s == "" {
77                 return str(uint32(x))
78         }
79         return s
80 }
81
82 // IfType defines enum 'if_type'.
83 type IfType uint32
84
85 const (
86         IF_API_TYPE_HARDWARE IfType = 1
87         IF_API_TYPE_SUB      IfType = 2
88         IF_API_TYPE_P2P      IfType = 3
89         IF_API_TYPE_PIPE     IfType = 4
90 )
91
92 var (
93         IfType_name = map[uint32]string{
94                 1: "IF_API_TYPE_HARDWARE",
95                 2: "IF_API_TYPE_SUB",
96                 3: "IF_API_TYPE_P2P",
97                 4: "IF_API_TYPE_PIPE",
98         }
99         IfType_value = map[string]uint32{
100                 "IF_API_TYPE_HARDWARE": 1,
101                 "IF_API_TYPE_SUB":      2,
102                 "IF_API_TYPE_P2P":      3,
103                 "IF_API_TYPE_PIPE":     4,
104         }
105 )
106
107 func (x IfType) String() string {
108         s, ok := IfType_name[uint32(x)]
109         if ok {
110                 return s
111         }
112         return "IfType(" + strconv.Itoa(int(x)) + ")"
113 }
114
115 // LinkDuplex defines enum 'link_duplex'.
116 type LinkDuplex uint32
117
118 const (
119         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
120         LINK_DUPLEX_API_HALF    LinkDuplex = 1
121         LINK_DUPLEX_API_FULL    LinkDuplex = 2
122 )
123
124 var (
125         LinkDuplex_name = map[uint32]string{
126                 0: "LINK_DUPLEX_API_UNKNOWN",
127                 1: "LINK_DUPLEX_API_HALF",
128                 2: "LINK_DUPLEX_API_FULL",
129         }
130         LinkDuplex_value = map[string]uint32{
131                 "LINK_DUPLEX_API_UNKNOWN": 0,
132                 "LINK_DUPLEX_API_HALF":    1,
133                 "LINK_DUPLEX_API_FULL":    2,
134         }
135 )
136
137 func (x LinkDuplex) String() string {
138         s, ok := LinkDuplex_name[uint32(x)]
139         if ok {
140                 return s
141         }
142         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
143 }
144
145 // MemifMode defines enum 'memif_mode'.
146 type MemifMode uint32
147
148 const (
149         MEMIF_MODE_API_ETHERNET    MemifMode = 0
150         MEMIF_MODE_API_IP          MemifMode = 1
151         MEMIF_MODE_API_PUNT_INJECT MemifMode = 2
152 )
153
154 var (
155         MemifMode_name = map[uint32]string{
156                 0: "MEMIF_MODE_API_ETHERNET",
157                 1: "MEMIF_MODE_API_IP",
158                 2: "MEMIF_MODE_API_PUNT_INJECT",
159         }
160         MemifMode_value = map[string]uint32{
161                 "MEMIF_MODE_API_ETHERNET":    0,
162                 "MEMIF_MODE_API_IP":          1,
163                 "MEMIF_MODE_API_PUNT_INJECT": 2,
164         }
165 )
166
167 func (x MemifMode) String() string {
168         s, ok := MemifMode_name[uint32(x)]
169         if ok {
170                 return s
171         }
172         return "MemifMode(" + strconv.Itoa(int(x)) + ")"
173 }
174
175 // MemifRole defines enum 'memif_role'.
176 type MemifRole uint32
177
178 const (
179         MEMIF_ROLE_API_MASTER MemifRole = 0
180         MEMIF_ROLE_API_SLAVE  MemifRole = 1
181 )
182
183 var (
184         MemifRole_name = map[uint32]string{
185                 0: "MEMIF_ROLE_API_MASTER",
186                 1: "MEMIF_ROLE_API_SLAVE",
187         }
188         MemifRole_value = map[string]uint32{
189                 "MEMIF_ROLE_API_MASTER": 0,
190                 "MEMIF_ROLE_API_SLAVE":  1,
191         }
192 )
193
194 func (x MemifRole) String() string {
195         s, ok := MemifRole_name[uint32(x)]
196         if ok {
197                 return s
198         }
199         return "MemifRole(" + strconv.Itoa(int(x)) + ")"
200 }
201
202 // MtuProto defines enum 'mtu_proto'.
203 type MtuProto uint32
204
205 const (
206         MTU_PROTO_API_L3   MtuProto = 1
207         MTU_PROTO_API_IP4  MtuProto = 2
208         MTU_PROTO_API_IP6  MtuProto = 3
209         MTU_PROTO_API_MPLS MtuProto = 4
210         MTU_PROTO_API_N    MtuProto = 5
211 )
212
213 var (
214         MtuProto_name = map[uint32]string{
215                 1: "MTU_PROTO_API_L3",
216                 2: "MTU_PROTO_API_IP4",
217                 3: "MTU_PROTO_API_IP6",
218                 4: "MTU_PROTO_API_MPLS",
219                 5: "MTU_PROTO_API_N",
220         }
221         MtuProto_value = map[string]uint32{
222                 "MTU_PROTO_API_L3":   1,
223                 "MTU_PROTO_API_IP4":  2,
224                 "MTU_PROTO_API_IP6":  3,
225                 "MTU_PROTO_API_MPLS": 4,
226                 "MTU_PROTO_API_N":    5,
227         }
228 )
229
230 func (x MtuProto) String() string {
231         s, ok := MtuProto_name[uint32(x)]
232         if ok {
233                 return s
234         }
235         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
236 }
237
238 // RxMode defines enum 'rx_mode'.
239 type RxMode uint32
240
241 const (
242         RX_MODE_API_UNKNOWN   RxMode = 0
243         RX_MODE_API_POLLING   RxMode = 1
244         RX_MODE_API_INTERRUPT RxMode = 2
245         RX_MODE_API_ADAPTIVE  RxMode = 3
246         RX_MODE_API_DEFAULT   RxMode = 4
247 )
248
249 var (
250         RxMode_name = map[uint32]string{
251                 0: "RX_MODE_API_UNKNOWN",
252                 1: "RX_MODE_API_POLLING",
253                 2: "RX_MODE_API_INTERRUPT",
254                 3: "RX_MODE_API_ADAPTIVE",
255                 4: "RX_MODE_API_DEFAULT",
256         }
257         RxMode_value = map[string]uint32{
258                 "RX_MODE_API_UNKNOWN":   0,
259                 "RX_MODE_API_POLLING":   1,
260                 "RX_MODE_API_INTERRUPT": 2,
261                 "RX_MODE_API_ADAPTIVE":  3,
262                 "RX_MODE_API_DEFAULT":   4,
263         }
264 )
265
266 func (x RxMode) String() string {
267         s, ok := RxMode_name[uint32(x)]
268         if ok {
269                 return s
270         }
271         return "RxMode(" + strconv.Itoa(int(x)) + ")"
272 }
273
274 // SubIfFlags defines enum 'sub_if_flags'.
275 type SubIfFlags uint32
276
277 const (
278         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
279         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
280         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
281         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
282         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
283         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
284         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
285         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
286         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
287         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
288 )
289
290 var (
291         SubIfFlags_name = map[uint32]string{
292                 1:   "SUB_IF_API_FLAG_NO_TAGS",
293                 2:   "SUB_IF_API_FLAG_ONE_TAG",
294                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
295                 8:   "SUB_IF_API_FLAG_DOT1AD",
296                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
297                 32:  "SUB_IF_API_FLAG_DEFAULT",
298                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
299                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
300                 254: "SUB_IF_API_FLAG_MASK_VNET",
301                 256: "SUB_IF_API_FLAG_DOT1AH",
302         }
303         SubIfFlags_value = map[string]uint32{
304                 "SUB_IF_API_FLAG_NO_TAGS":           1,
305                 "SUB_IF_API_FLAG_ONE_TAG":           2,
306                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
307                 "SUB_IF_API_FLAG_DOT1AD":            8,
308                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
309                 "SUB_IF_API_FLAG_DEFAULT":           32,
310                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
311                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
312                 "SUB_IF_API_FLAG_MASK_VNET":         254,
313                 "SUB_IF_API_FLAG_DOT1AH":            256,
314         }
315 )
316
317 func (x SubIfFlags) String() string {
318         s, ok := SubIfFlags_name[uint32(x)]
319         if ok {
320                 return s
321         }
322         str := func(n uint32) string {
323                 s, ok := SubIfFlags_name[uint32(n)]
324                 if ok {
325                         return s
326                 }
327                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
328         }
329         for i := uint32(0); i <= 32; i++ {
330                 val := uint32(x)
331                 if val&(1<<i) != 0 {
332                         if s != "" {
333                                 s += "|"
334                         }
335                         s += str(1 << i)
336                 }
337         }
338         if s == "" {
339                 return str(uint32(x))
340         }
341         return s
342 }
343
344 // InterfaceIndex defines alias 'interface_index'.
345 type InterfaceIndex uint32
346
347 // MacAddress defines alias 'mac_address'.
348 type MacAddress [6]uint8
349
350 func ParseMacAddress(s string) (MacAddress, error) {
351         var macaddr MacAddress
352         mac, err := net.ParseMAC(s)
353         if err != nil {
354                 return macaddr, err
355         }
356         copy(macaddr[:], mac[:])
357         return macaddr, nil
358 }
359
360 func (x MacAddress) ToMAC() net.HardwareAddr {
361         return net.HardwareAddr(x[:])
362 }
363
364 func (x MacAddress) String() string {
365         return x.ToMAC().String()
366 }
367
368 func (x *MacAddress) MarshalText() ([]byte, error) {
369         return []byte(x.String()), nil
370 }
371
372 func (x *MacAddress) UnmarshalText(text []byte) error {
373         mac, err := ParseMacAddress(string(text))
374         if err != nil {
375                 return err
376         }
377         *x = mac
378         return nil
379 }
380
381 // MemifCreate defines message 'memif_create'.
382 type MemifCreate struct {
383         Role       MemifRole  `binapi:"memif_role,name=role" json:"role,omitempty"`
384         Mode       MemifMode  `binapi:"memif_mode,name=mode" json:"mode,omitempty"`
385         RxQueues   uint8      `binapi:"u8,name=rx_queues" json:"rx_queues,omitempty"`
386         TxQueues   uint8      `binapi:"u8,name=tx_queues" json:"tx_queues,omitempty"`
387         ID         uint32     `binapi:"u32,name=id" json:"id,omitempty"`
388         SocketID   uint32     `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
389         RingSize   uint32     `binapi:"u32,name=ring_size" json:"ring_size,omitempty"`
390         BufferSize uint16     `binapi:"u16,name=buffer_size" json:"buffer_size,omitempty"`
391         NoZeroCopy bool       `binapi:"bool,name=no_zero_copy" json:"no_zero_copy,omitempty"`
392         HwAddr     MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
393         Secret     string     `binapi:"string[24],name=secret" json:"secret,omitempty"`
394 }
395
396 func (m *MemifCreate) Reset()               { *m = MemifCreate{} }
397 func (*MemifCreate) GetMessageName() string { return "memif_create" }
398 func (*MemifCreate) GetCrcString() string   { return "b1b25061" }
399 func (*MemifCreate) GetMessageType() api.MessageType {
400         return api.RequestMessage
401 }
402
403 func (m *MemifCreate) Size() (size int) {
404         if m == nil {
405                 return 0
406         }
407         size += 4     // m.Role
408         size += 4     // m.Mode
409         size += 1     // m.RxQueues
410         size += 1     // m.TxQueues
411         size += 4     // m.ID
412         size += 4     // m.SocketID
413         size += 4     // m.RingSize
414         size += 2     // m.BufferSize
415         size += 1     // m.NoZeroCopy
416         size += 1 * 6 // m.HwAddr
417         size += 24    // m.Secret
418         return size
419 }
420 func (m *MemifCreate) Marshal(b []byte) ([]byte, error) {
421         if b == nil {
422                 b = make([]byte, m.Size())
423         }
424         buf := codec.NewBuffer(b)
425         buf.EncodeUint32(uint32(m.Role))
426         buf.EncodeUint32(uint32(m.Mode))
427         buf.EncodeUint8(m.RxQueues)
428         buf.EncodeUint8(m.TxQueues)
429         buf.EncodeUint32(m.ID)
430         buf.EncodeUint32(m.SocketID)
431         buf.EncodeUint32(m.RingSize)
432         buf.EncodeUint16(m.BufferSize)
433         buf.EncodeBool(m.NoZeroCopy)
434         buf.EncodeBytes(m.HwAddr[:], 6)
435         buf.EncodeString(m.Secret, 24)
436         return buf.Bytes(), nil
437 }
438 func (m *MemifCreate) Unmarshal(b []byte) error {
439         buf := codec.NewBuffer(b)
440         m.Role = MemifRole(buf.DecodeUint32())
441         m.Mode = MemifMode(buf.DecodeUint32())
442         m.RxQueues = buf.DecodeUint8()
443         m.TxQueues = buf.DecodeUint8()
444         m.ID = buf.DecodeUint32()
445         m.SocketID = buf.DecodeUint32()
446         m.RingSize = buf.DecodeUint32()
447         m.BufferSize = buf.DecodeUint16()
448         m.NoZeroCopy = buf.DecodeBool()
449         copy(m.HwAddr[:], buf.DecodeBytes(6))
450         m.Secret = buf.DecodeString(24)
451         return nil
452 }
453
454 // MemifCreateReply defines message 'memif_create_reply'.
455 type MemifCreateReply struct {
456         Retval    int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
457         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
458 }
459
460 func (m *MemifCreateReply) Reset()               { *m = MemifCreateReply{} }
461 func (*MemifCreateReply) GetMessageName() string { return "memif_create_reply" }
462 func (*MemifCreateReply) GetCrcString() string   { return "5383d31f" }
463 func (*MemifCreateReply) GetMessageType() api.MessageType {
464         return api.ReplyMessage
465 }
466
467 func (m *MemifCreateReply) Size() (size int) {
468         if m == nil {
469                 return 0
470         }
471         size += 4 // m.Retval
472         size += 4 // m.SwIfIndex
473         return size
474 }
475 func (m *MemifCreateReply) Marshal(b []byte) ([]byte, error) {
476         if b == nil {
477                 b = make([]byte, m.Size())
478         }
479         buf := codec.NewBuffer(b)
480         buf.EncodeInt32(m.Retval)
481         buf.EncodeUint32(uint32(m.SwIfIndex))
482         return buf.Bytes(), nil
483 }
484 func (m *MemifCreateReply) Unmarshal(b []byte) error {
485         buf := codec.NewBuffer(b)
486         m.Retval = buf.DecodeInt32()
487         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
488         return nil
489 }
490
491 // MemifDelete defines message 'memif_delete'.
492 type MemifDelete struct {
493         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
494 }
495
496 func (m *MemifDelete) Reset()               { *m = MemifDelete{} }
497 func (*MemifDelete) GetMessageName() string { return "memif_delete" }
498 func (*MemifDelete) GetCrcString() string   { return "f9e6675e" }
499 func (*MemifDelete) GetMessageType() api.MessageType {
500         return api.RequestMessage
501 }
502
503 func (m *MemifDelete) Size() (size int) {
504         if m == nil {
505                 return 0
506         }
507         size += 4 // m.SwIfIndex
508         return size
509 }
510 func (m *MemifDelete) Marshal(b []byte) ([]byte, error) {
511         if b == nil {
512                 b = make([]byte, m.Size())
513         }
514         buf := codec.NewBuffer(b)
515         buf.EncodeUint32(uint32(m.SwIfIndex))
516         return buf.Bytes(), nil
517 }
518 func (m *MemifDelete) Unmarshal(b []byte) error {
519         buf := codec.NewBuffer(b)
520         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
521         return nil
522 }
523
524 // MemifDeleteReply defines message 'memif_delete_reply'.
525 type MemifDeleteReply struct {
526         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
527 }
528
529 func (m *MemifDeleteReply) Reset()               { *m = MemifDeleteReply{} }
530 func (*MemifDeleteReply) GetMessageName() string { return "memif_delete_reply" }
531 func (*MemifDeleteReply) GetCrcString() string   { return "e8d4e804" }
532 func (*MemifDeleteReply) GetMessageType() api.MessageType {
533         return api.ReplyMessage
534 }
535
536 func (m *MemifDeleteReply) Size() (size int) {
537         if m == nil {
538                 return 0
539         }
540         size += 4 // m.Retval
541         return size
542 }
543 func (m *MemifDeleteReply) Marshal(b []byte) ([]byte, error) {
544         if b == nil {
545                 b = make([]byte, m.Size())
546         }
547         buf := codec.NewBuffer(b)
548         buf.EncodeInt32(m.Retval)
549         return buf.Bytes(), nil
550 }
551 func (m *MemifDeleteReply) Unmarshal(b []byte) error {
552         buf := codec.NewBuffer(b)
553         m.Retval = buf.DecodeInt32()
554         return nil
555 }
556
557 // MemifDetails defines message 'memif_details'.
558 type MemifDetails struct {
559         SwIfIndex  InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
560         HwAddr     MacAddress     `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
561         ID         uint32         `binapi:"u32,name=id" json:"id,omitempty"`
562         Role       MemifRole      `binapi:"memif_role,name=role" json:"role,omitempty"`
563         Mode       MemifMode      `binapi:"memif_mode,name=mode" json:"mode,omitempty"`
564         ZeroCopy   bool           `binapi:"bool,name=zero_copy" json:"zero_copy,omitempty"`
565         SocketID   uint32         `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
566         RingSize   uint32         `binapi:"u32,name=ring_size" json:"ring_size,omitempty"`
567         BufferSize uint16         `binapi:"u16,name=buffer_size" json:"buffer_size,omitempty"`
568         Flags      IfStatusFlags  `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
569         IfName     string         `binapi:"string[64],name=if_name" json:"if_name,omitempty"`
570 }
571
572 func (m *MemifDetails) Reset()               { *m = MemifDetails{} }
573 func (*MemifDetails) GetMessageName() string { return "memif_details" }
574 func (*MemifDetails) GetCrcString() string   { return "d0382c4c" }
575 func (*MemifDetails) GetMessageType() api.MessageType {
576         return api.ReplyMessage
577 }
578
579 func (m *MemifDetails) Size() (size int) {
580         if m == nil {
581                 return 0
582         }
583         size += 4     // m.SwIfIndex
584         size += 1 * 6 // m.HwAddr
585         size += 4     // m.ID
586         size += 4     // m.Role
587         size += 4     // m.Mode
588         size += 1     // m.ZeroCopy
589         size += 4     // m.SocketID
590         size += 4     // m.RingSize
591         size += 2     // m.BufferSize
592         size += 4     // m.Flags
593         size += 64    // m.IfName
594         return size
595 }
596 func (m *MemifDetails) Marshal(b []byte) ([]byte, error) {
597         if b == nil {
598                 b = make([]byte, m.Size())
599         }
600         buf := codec.NewBuffer(b)
601         buf.EncodeUint32(uint32(m.SwIfIndex))
602         buf.EncodeBytes(m.HwAddr[:], 6)
603         buf.EncodeUint32(m.ID)
604         buf.EncodeUint32(uint32(m.Role))
605         buf.EncodeUint32(uint32(m.Mode))
606         buf.EncodeBool(m.ZeroCopy)
607         buf.EncodeUint32(m.SocketID)
608         buf.EncodeUint32(m.RingSize)
609         buf.EncodeUint16(m.BufferSize)
610         buf.EncodeUint32(uint32(m.Flags))
611         buf.EncodeString(m.IfName, 64)
612         return buf.Bytes(), nil
613 }
614 func (m *MemifDetails) Unmarshal(b []byte) error {
615         buf := codec.NewBuffer(b)
616         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
617         copy(m.HwAddr[:], buf.DecodeBytes(6))
618         m.ID = buf.DecodeUint32()
619         m.Role = MemifRole(buf.DecodeUint32())
620         m.Mode = MemifMode(buf.DecodeUint32())
621         m.ZeroCopy = buf.DecodeBool()
622         m.SocketID = buf.DecodeUint32()
623         m.RingSize = buf.DecodeUint32()
624         m.BufferSize = buf.DecodeUint16()
625         m.Flags = IfStatusFlags(buf.DecodeUint32())
626         m.IfName = buf.DecodeString(64)
627         return nil
628 }
629
630 // MemifDump defines message 'memif_dump'.
631 type MemifDump struct{}
632
633 func (m *MemifDump) Reset()               { *m = MemifDump{} }
634 func (*MemifDump) GetMessageName() string { return "memif_dump" }
635 func (*MemifDump) GetCrcString() string   { return "51077d14" }
636 func (*MemifDump) GetMessageType() api.MessageType {
637         return api.RequestMessage
638 }
639
640 func (m *MemifDump) Size() (size int) {
641         if m == nil {
642                 return 0
643         }
644         return size
645 }
646 func (m *MemifDump) Marshal(b []byte) ([]byte, error) {
647         if b == nil {
648                 b = make([]byte, m.Size())
649         }
650         buf := codec.NewBuffer(b)
651         return buf.Bytes(), nil
652 }
653 func (m *MemifDump) Unmarshal(b []byte) error {
654         return nil
655 }
656
657 // MemifSocketFilenameAddDel defines message 'memif_socket_filename_add_del'.
658 type MemifSocketFilenameAddDel struct {
659         IsAdd          bool   `binapi:"bool,name=is_add" json:"is_add,omitempty"`
660         SocketID       uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
661         SocketFilename string `binapi:"string[108],name=socket_filename" json:"socket_filename,omitempty"`
662 }
663
664 func (m *MemifSocketFilenameAddDel) Reset()               { *m = MemifSocketFilenameAddDel{} }
665 func (*MemifSocketFilenameAddDel) GetMessageName() string { return "memif_socket_filename_add_del" }
666 func (*MemifSocketFilenameAddDel) GetCrcString() string   { return "a2ce1a10" }
667 func (*MemifSocketFilenameAddDel) GetMessageType() api.MessageType {
668         return api.RequestMessage
669 }
670
671 func (m *MemifSocketFilenameAddDel) Size() (size int) {
672         if m == nil {
673                 return 0
674         }
675         size += 1   // m.IsAdd
676         size += 4   // m.SocketID
677         size += 108 // m.SocketFilename
678         return size
679 }
680 func (m *MemifSocketFilenameAddDel) Marshal(b []byte) ([]byte, error) {
681         if b == nil {
682                 b = make([]byte, m.Size())
683         }
684         buf := codec.NewBuffer(b)
685         buf.EncodeBool(m.IsAdd)
686         buf.EncodeUint32(m.SocketID)
687         buf.EncodeString(m.SocketFilename, 108)
688         return buf.Bytes(), nil
689 }
690 func (m *MemifSocketFilenameAddDel) Unmarshal(b []byte) error {
691         buf := codec.NewBuffer(b)
692         m.IsAdd = buf.DecodeBool()
693         m.SocketID = buf.DecodeUint32()
694         m.SocketFilename = buf.DecodeString(108)
695         return nil
696 }
697
698 // MemifSocketFilenameAddDelReply defines message 'memif_socket_filename_add_del_reply'.
699 type MemifSocketFilenameAddDelReply struct {
700         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
701 }
702
703 func (m *MemifSocketFilenameAddDelReply) Reset() { *m = MemifSocketFilenameAddDelReply{} }
704 func (*MemifSocketFilenameAddDelReply) GetMessageName() string {
705         return "memif_socket_filename_add_del_reply"
706 }
707 func (*MemifSocketFilenameAddDelReply) GetCrcString() string { return "e8d4e804" }
708 func (*MemifSocketFilenameAddDelReply) GetMessageType() api.MessageType {
709         return api.ReplyMessage
710 }
711
712 func (m *MemifSocketFilenameAddDelReply) Size() (size int) {
713         if m == nil {
714                 return 0
715         }
716         size += 4 // m.Retval
717         return size
718 }
719 func (m *MemifSocketFilenameAddDelReply) Marshal(b []byte) ([]byte, error) {
720         if b == nil {
721                 b = make([]byte, m.Size())
722         }
723         buf := codec.NewBuffer(b)
724         buf.EncodeInt32(m.Retval)
725         return buf.Bytes(), nil
726 }
727 func (m *MemifSocketFilenameAddDelReply) Unmarshal(b []byte) error {
728         buf := codec.NewBuffer(b)
729         m.Retval = buf.DecodeInt32()
730         return nil
731 }
732
733 // MemifSocketFilenameDetails defines message 'memif_socket_filename_details'.
734 type MemifSocketFilenameDetails struct {
735         SocketID       uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
736         SocketFilename string `binapi:"string[108],name=socket_filename" json:"socket_filename,omitempty"`
737 }
738
739 func (m *MemifSocketFilenameDetails) Reset()               { *m = MemifSocketFilenameDetails{} }
740 func (*MemifSocketFilenameDetails) GetMessageName() string { return "memif_socket_filename_details" }
741 func (*MemifSocketFilenameDetails) GetCrcString() string   { return "7ff326f7" }
742 func (*MemifSocketFilenameDetails) GetMessageType() api.MessageType {
743         return api.ReplyMessage
744 }
745
746 func (m *MemifSocketFilenameDetails) Size() (size int) {
747         if m == nil {
748                 return 0
749         }
750         size += 4   // m.SocketID
751         size += 108 // m.SocketFilename
752         return size
753 }
754 func (m *MemifSocketFilenameDetails) Marshal(b []byte) ([]byte, error) {
755         if b == nil {
756                 b = make([]byte, m.Size())
757         }
758         buf := codec.NewBuffer(b)
759         buf.EncodeUint32(m.SocketID)
760         buf.EncodeString(m.SocketFilename, 108)
761         return buf.Bytes(), nil
762 }
763 func (m *MemifSocketFilenameDetails) Unmarshal(b []byte) error {
764         buf := codec.NewBuffer(b)
765         m.SocketID = buf.DecodeUint32()
766         m.SocketFilename = buf.DecodeString(108)
767         return nil
768 }
769
770 // MemifSocketFilenameDump defines message 'memif_socket_filename_dump'.
771 type MemifSocketFilenameDump struct{}
772
773 func (m *MemifSocketFilenameDump) Reset()               { *m = MemifSocketFilenameDump{} }
774 func (*MemifSocketFilenameDump) GetMessageName() string { return "memif_socket_filename_dump" }
775 func (*MemifSocketFilenameDump) GetCrcString() string   { return "51077d14" }
776 func (*MemifSocketFilenameDump) GetMessageType() api.MessageType {
777         return api.RequestMessage
778 }
779
780 func (m *MemifSocketFilenameDump) Size() (size int) {
781         if m == nil {
782                 return 0
783         }
784         return size
785 }
786 func (m *MemifSocketFilenameDump) Marshal(b []byte) ([]byte, error) {
787         if b == nil {
788                 b = make([]byte, m.Size())
789         }
790         buf := codec.NewBuffer(b)
791         return buf.Bytes(), nil
792 }
793 func (m *MemifSocketFilenameDump) Unmarshal(b []byte) error {
794         return nil
795 }
796
797 func init() { file_memif_binapi_init() }
798 func file_memif_binapi_init() {
799         api.RegisterMessage((*MemifCreate)(nil), "memif_create_b1b25061")
800         api.RegisterMessage((*MemifCreateReply)(nil), "memif_create_reply_5383d31f")
801         api.RegisterMessage((*MemifDelete)(nil), "memif_delete_f9e6675e")
802         api.RegisterMessage((*MemifDeleteReply)(nil), "memif_delete_reply_e8d4e804")
803         api.RegisterMessage((*MemifDetails)(nil), "memif_details_d0382c4c")
804         api.RegisterMessage((*MemifDump)(nil), "memif_dump_51077d14")
805         api.RegisterMessage((*MemifSocketFilenameAddDel)(nil), "memif_socket_filename_add_del_a2ce1a10")
806         api.RegisterMessage((*MemifSocketFilenameAddDelReply)(nil), "memif_socket_filename_add_del_reply_e8d4e804")
807         api.RegisterMessage((*MemifSocketFilenameDetails)(nil), "memif_socket_filename_details_7ff326f7")
808         api.RegisterMessage((*MemifSocketFilenameDump)(nil), "memif_socket_filename_dump_51077d14")
809 }
810
811 // Messages returns list of all messages in this module.
812 func AllMessages() []api.Message {
813         return []api.Message{
814                 (*MemifCreate)(nil),
815                 (*MemifCreateReply)(nil),
816                 (*MemifDelete)(nil),
817                 (*MemifDeleteReply)(nil),
818                 (*MemifDetails)(nil),
819                 (*MemifDump)(nil),
820                 (*MemifSocketFilenameAddDel)(nil),
821                 (*MemifSocketFilenameAddDelReply)(nil),
822                 (*MemifSocketFilenameDetails)(nil),
823                 (*MemifSocketFilenameDump)(nil),
824         }
825 }