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