Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / vhost_user / vhost_user.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/core/vhost_user.api.json
6
7 // Package vhost_user contains generated bindings for API file vhost_user.api.
8 //
9 // Contents:
10 //   2 aliases
11 //   8 enums
12 //   8 messages
13 //
14 package vhost_user
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    = "vhost_user"
32         APIVersion = "4.0.0"
33         VersionCrc = 0xb547a33d
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 // MtuProto defines enum 'mtu_proto'.
146 type MtuProto uint32
147
148 const (
149         MTU_PROTO_API_L3   MtuProto = 1
150         MTU_PROTO_API_IP4  MtuProto = 2
151         MTU_PROTO_API_IP6  MtuProto = 3
152         MTU_PROTO_API_MPLS MtuProto = 4
153         MTU_PROTO_API_N    MtuProto = 5
154 )
155
156 var (
157         MtuProto_name = map[uint32]string{
158                 1: "MTU_PROTO_API_L3",
159                 2: "MTU_PROTO_API_IP4",
160                 3: "MTU_PROTO_API_IP6",
161                 4: "MTU_PROTO_API_MPLS",
162                 5: "MTU_PROTO_API_N",
163         }
164         MtuProto_value = map[string]uint32{
165                 "MTU_PROTO_API_L3":   1,
166                 "MTU_PROTO_API_IP4":  2,
167                 "MTU_PROTO_API_IP6":  3,
168                 "MTU_PROTO_API_MPLS": 4,
169                 "MTU_PROTO_API_N":    5,
170         }
171 )
172
173 func (x MtuProto) String() string {
174         s, ok := MtuProto_name[uint32(x)]
175         if ok {
176                 return s
177         }
178         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
179 }
180
181 // RxMode defines enum 'rx_mode'.
182 type RxMode uint32
183
184 const (
185         RX_MODE_API_UNKNOWN   RxMode = 0
186         RX_MODE_API_POLLING   RxMode = 1
187         RX_MODE_API_INTERRUPT RxMode = 2
188         RX_MODE_API_ADAPTIVE  RxMode = 3
189         RX_MODE_API_DEFAULT   RxMode = 4
190 )
191
192 var (
193         RxMode_name = map[uint32]string{
194                 0: "RX_MODE_API_UNKNOWN",
195                 1: "RX_MODE_API_POLLING",
196                 2: "RX_MODE_API_INTERRUPT",
197                 3: "RX_MODE_API_ADAPTIVE",
198                 4: "RX_MODE_API_DEFAULT",
199         }
200         RxMode_value = map[string]uint32{
201                 "RX_MODE_API_UNKNOWN":   0,
202                 "RX_MODE_API_POLLING":   1,
203                 "RX_MODE_API_INTERRUPT": 2,
204                 "RX_MODE_API_ADAPTIVE":  3,
205                 "RX_MODE_API_DEFAULT":   4,
206         }
207 )
208
209 func (x RxMode) String() string {
210         s, ok := RxMode_name[uint32(x)]
211         if ok {
212                 return s
213         }
214         return "RxMode(" + strconv.Itoa(int(x)) + ")"
215 }
216
217 // SubIfFlags defines enum 'sub_if_flags'.
218 type SubIfFlags uint32
219
220 const (
221         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
222         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
223         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
224         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
225         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
226         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
227         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
228         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
229         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
230         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
231 )
232
233 var (
234         SubIfFlags_name = map[uint32]string{
235                 1:   "SUB_IF_API_FLAG_NO_TAGS",
236                 2:   "SUB_IF_API_FLAG_ONE_TAG",
237                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
238                 8:   "SUB_IF_API_FLAG_DOT1AD",
239                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
240                 32:  "SUB_IF_API_FLAG_DEFAULT",
241                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
242                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
243                 254: "SUB_IF_API_FLAG_MASK_VNET",
244                 256: "SUB_IF_API_FLAG_DOT1AH",
245         }
246         SubIfFlags_value = map[string]uint32{
247                 "SUB_IF_API_FLAG_NO_TAGS":           1,
248                 "SUB_IF_API_FLAG_ONE_TAG":           2,
249                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
250                 "SUB_IF_API_FLAG_DOT1AD":            8,
251                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
252                 "SUB_IF_API_FLAG_DEFAULT":           32,
253                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
254                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
255                 "SUB_IF_API_FLAG_MASK_VNET":         254,
256                 "SUB_IF_API_FLAG_DOT1AH":            256,
257         }
258 )
259
260 func (x SubIfFlags) String() string {
261         s, ok := SubIfFlags_name[uint32(x)]
262         if ok {
263                 return s
264         }
265         str := func(n uint32) string {
266                 s, ok := SubIfFlags_name[uint32(n)]
267                 if ok {
268                         return s
269                 }
270                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
271         }
272         for i := uint32(0); i <= 32; i++ {
273                 val := uint32(x)
274                 if val&(1<<i) != 0 {
275                         if s != "" {
276                                 s += "|"
277                         }
278                         s += str(1 << i)
279                 }
280         }
281         if s == "" {
282                 return str(uint32(x))
283         }
284         return s
285 }
286
287 // VirtioNetFeaturesFirst32 defines enum 'virtio_net_features_first_32'.
288 type VirtioNetFeaturesFirst32 uint32
289
290 const (
291         VIRTIO_NET_F_API_CSUM              VirtioNetFeaturesFirst32 = 1
292         VIRTIO_NET_F_API_GUEST_CSUM        VirtioNetFeaturesFirst32 = 2
293         VIRTIO_NET_F_API_GUEST_TSO4        VirtioNetFeaturesFirst32 = 128
294         VIRTIO_NET_F_API_GUEST_TSO6        VirtioNetFeaturesFirst32 = 256
295         VIRTIO_NET_F_API_GUEST_UFO         VirtioNetFeaturesFirst32 = 1024
296         VIRTIO_NET_F_API_HOST_TSO4         VirtioNetFeaturesFirst32 = 2048
297         VIRTIO_NET_F_API_HOST_TSO6         VirtioNetFeaturesFirst32 = 4096
298         VIRTIO_NET_F_API_HOST_UFO          VirtioNetFeaturesFirst32 = 16384
299         VIRTIO_NET_F_API_MRG_RXBUF         VirtioNetFeaturesFirst32 = 32768
300         VIRTIO_NET_F_API_CTRL_VQ           VirtioNetFeaturesFirst32 = 131072
301         VIRTIO_NET_F_API_GUEST_ANNOUNCE    VirtioNetFeaturesFirst32 = 2097152
302         VIRTIO_NET_F_API_MQ                VirtioNetFeaturesFirst32 = 4194304
303         VHOST_F_API_LOG_ALL                VirtioNetFeaturesFirst32 = 67108864
304         VIRTIO_F_API_ANY_LAYOUT            VirtioNetFeaturesFirst32 = 134217728
305         VIRTIO_F_API_INDIRECT_DESC         VirtioNetFeaturesFirst32 = 268435456
306         VHOST_USER_F_API_PROTOCOL_FEATURES VirtioNetFeaturesFirst32 = 1073741824
307 )
308
309 var (
310         VirtioNetFeaturesFirst32_name = map[uint32]string{
311                 1:          "VIRTIO_NET_F_API_CSUM",
312                 2:          "VIRTIO_NET_F_API_GUEST_CSUM",
313                 128:        "VIRTIO_NET_F_API_GUEST_TSO4",
314                 256:        "VIRTIO_NET_F_API_GUEST_TSO6",
315                 1024:       "VIRTIO_NET_F_API_GUEST_UFO",
316                 2048:       "VIRTIO_NET_F_API_HOST_TSO4",
317                 4096:       "VIRTIO_NET_F_API_HOST_TSO6",
318                 16384:      "VIRTIO_NET_F_API_HOST_UFO",
319                 32768:      "VIRTIO_NET_F_API_MRG_RXBUF",
320                 131072:     "VIRTIO_NET_F_API_CTRL_VQ",
321                 2097152:    "VIRTIO_NET_F_API_GUEST_ANNOUNCE",
322                 4194304:    "VIRTIO_NET_F_API_MQ",
323                 67108864:   "VHOST_F_API_LOG_ALL",
324                 134217728:  "VIRTIO_F_API_ANY_LAYOUT",
325                 268435456:  "VIRTIO_F_API_INDIRECT_DESC",
326                 1073741824: "VHOST_USER_F_API_PROTOCOL_FEATURES",
327         }
328         VirtioNetFeaturesFirst32_value = map[string]uint32{
329                 "VIRTIO_NET_F_API_CSUM":              1,
330                 "VIRTIO_NET_F_API_GUEST_CSUM":        2,
331                 "VIRTIO_NET_F_API_GUEST_TSO4":        128,
332                 "VIRTIO_NET_F_API_GUEST_TSO6":        256,
333                 "VIRTIO_NET_F_API_GUEST_UFO":         1024,
334                 "VIRTIO_NET_F_API_HOST_TSO4":         2048,
335                 "VIRTIO_NET_F_API_HOST_TSO6":         4096,
336                 "VIRTIO_NET_F_API_HOST_UFO":          16384,
337                 "VIRTIO_NET_F_API_MRG_RXBUF":         32768,
338                 "VIRTIO_NET_F_API_CTRL_VQ":           131072,
339                 "VIRTIO_NET_F_API_GUEST_ANNOUNCE":    2097152,
340                 "VIRTIO_NET_F_API_MQ":                4194304,
341                 "VHOST_F_API_LOG_ALL":                67108864,
342                 "VIRTIO_F_API_ANY_LAYOUT":            134217728,
343                 "VIRTIO_F_API_INDIRECT_DESC":         268435456,
344                 "VHOST_USER_F_API_PROTOCOL_FEATURES": 1073741824,
345         }
346 )
347
348 func (x VirtioNetFeaturesFirst32) String() string {
349         s, ok := VirtioNetFeaturesFirst32_name[uint32(x)]
350         if ok {
351                 return s
352         }
353         return "VirtioNetFeaturesFirst32(" + strconv.Itoa(int(x)) + ")"
354 }
355
356 // VirtioNetFeaturesLast32 defines enum 'virtio_net_features_last_32'.
357 type VirtioNetFeaturesLast32 uint32
358
359 const (
360         VIRTIO_F_API_VERSION_1 VirtioNetFeaturesLast32 = 1
361 )
362
363 var (
364         VirtioNetFeaturesLast32_name = map[uint32]string{
365                 1: "VIRTIO_F_API_VERSION_1",
366         }
367         VirtioNetFeaturesLast32_value = map[string]uint32{
368                 "VIRTIO_F_API_VERSION_1": 1,
369         }
370 )
371
372 func (x VirtioNetFeaturesLast32) String() string {
373         s, ok := VirtioNetFeaturesLast32_name[uint32(x)]
374         if ok {
375                 return s
376         }
377         return "VirtioNetFeaturesLast32(" + strconv.Itoa(int(x)) + ")"
378 }
379
380 // InterfaceIndex defines alias 'interface_index'.
381 type InterfaceIndex uint32
382
383 // MacAddress defines alias 'mac_address'.
384 type MacAddress [6]uint8
385
386 func ParseMacAddress(s string) (MacAddress, error) {
387         var macaddr MacAddress
388         mac, err := net.ParseMAC(s)
389         if err != nil {
390                 return macaddr, err
391         }
392         copy(macaddr[:], mac[:])
393         return macaddr, nil
394 }
395
396 func (x MacAddress) ToMAC() net.HardwareAddr {
397         return net.HardwareAddr(x[:])
398 }
399
400 func (x MacAddress) String() string {
401         return x.ToMAC().String()
402 }
403
404 func (x *MacAddress) MarshalText() ([]byte, error) {
405         return []byte(x.String()), nil
406 }
407
408 func (x *MacAddress) UnmarshalText(text []byte) error {
409         mac, err := ParseMacAddress(string(text))
410         if err != nil {
411                 return err
412         }
413         *x = mac
414         return nil
415 }
416
417 // CreateVhostUserIf defines message 'create_vhost_user_if'.
418 type CreateVhostUserIf struct {
419         IsServer            bool       `binapi:"bool,name=is_server" json:"is_server,omitempty"`
420         SockFilename        string     `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
421         Renumber            bool       `binapi:"bool,name=renumber" json:"renumber,omitempty"`
422         DisableMrgRxbuf     bool       `binapi:"bool,name=disable_mrg_rxbuf" json:"disable_mrg_rxbuf,omitempty"`
423         DisableIndirectDesc bool       `binapi:"bool,name=disable_indirect_desc" json:"disable_indirect_desc,omitempty"`
424         EnableGso           bool       `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
425         CustomDevInstance   uint32     `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
426         UseCustomMac        bool       `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"`
427         MacAddress          MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
428         Tag                 string     `binapi:"string[64],name=tag" json:"tag,omitempty"`
429 }
430
431 func (m *CreateVhostUserIf) Reset()               { *m = CreateVhostUserIf{} }
432 func (*CreateVhostUserIf) GetMessageName() string { return "create_vhost_user_if" }
433 func (*CreateVhostUserIf) GetCrcString() string   { return "591ee951" }
434 func (*CreateVhostUserIf) GetMessageType() api.MessageType {
435         return api.RequestMessage
436 }
437
438 func (m *CreateVhostUserIf) Size() (size int) {
439         if m == nil {
440                 return 0
441         }
442         size += 1     // m.IsServer
443         size += 256   // m.SockFilename
444         size += 1     // m.Renumber
445         size += 1     // m.DisableMrgRxbuf
446         size += 1     // m.DisableIndirectDesc
447         size += 1     // m.EnableGso
448         size += 4     // m.CustomDevInstance
449         size += 1     // m.UseCustomMac
450         size += 1 * 6 // m.MacAddress
451         size += 64    // m.Tag
452         return size
453 }
454 func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) {
455         if b == nil {
456                 b = make([]byte, m.Size())
457         }
458         buf := codec.NewBuffer(b)
459         buf.EncodeBool(m.IsServer)
460         buf.EncodeString(m.SockFilename, 256)
461         buf.EncodeBool(m.Renumber)
462         buf.EncodeBool(m.DisableMrgRxbuf)
463         buf.EncodeBool(m.DisableIndirectDesc)
464         buf.EncodeBool(m.EnableGso)
465         buf.EncodeUint32(m.CustomDevInstance)
466         buf.EncodeBool(m.UseCustomMac)
467         buf.EncodeBytes(m.MacAddress[:], 6)
468         buf.EncodeString(m.Tag, 64)
469         return buf.Bytes(), nil
470 }
471 func (m *CreateVhostUserIf) Unmarshal(b []byte) error {
472         buf := codec.NewBuffer(b)
473         m.IsServer = buf.DecodeBool()
474         m.SockFilename = buf.DecodeString(256)
475         m.Renumber = buf.DecodeBool()
476         m.DisableMrgRxbuf = buf.DecodeBool()
477         m.DisableIndirectDesc = buf.DecodeBool()
478         m.EnableGso = buf.DecodeBool()
479         m.CustomDevInstance = buf.DecodeUint32()
480         m.UseCustomMac = buf.DecodeBool()
481         copy(m.MacAddress[:], buf.DecodeBytes(6))
482         m.Tag = buf.DecodeString(64)
483         return nil
484 }
485
486 // CreateVhostUserIfReply defines message 'create_vhost_user_if_reply'.
487 type CreateVhostUserIfReply struct {
488         Retval    int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
489         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
490 }
491
492 func (m *CreateVhostUserIfReply) Reset()               { *m = CreateVhostUserIfReply{} }
493 func (*CreateVhostUserIfReply) GetMessageName() string { return "create_vhost_user_if_reply" }
494 func (*CreateVhostUserIfReply) GetCrcString() string   { return "5383d31f" }
495 func (*CreateVhostUserIfReply) GetMessageType() api.MessageType {
496         return api.ReplyMessage
497 }
498
499 func (m *CreateVhostUserIfReply) Size() (size int) {
500         if m == nil {
501                 return 0
502         }
503         size += 4 // m.Retval
504         size += 4 // m.SwIfIndex
505         return size
506 }
507 func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
508         if b == nil {
509                 b = make([]byte, m.Size())
510         }
511         buf := codec.NewBuffer(b)
512         buf.EncodeInt32(m.Retval)
513         buf.EncodeUint32(uint32(m.SwIfIndex))
514         return buf.Bytes(), nil
515 }
516 func (m *CreateVhostUserIfReply) Unmarshal(b []byte) error {
517         buf := codec.NewBuffer(b)
518         m.Retval = buf.DecodeInt32()
519         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
520         return nil
521 }
522
523 // DeleteVhostUserIf defines message 'delete_vhost_user_if'.
524 type DeleteVhostUserIf struct {
525         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
526 }
527
528 func (m *DeleteVhostUserIf) Reset()               { *m = DeleteVhostUserIf{} }
529 func (*DeleteVhostUserIf) GetMessageName() string { return "delete_vhost_user_if" }
530 func (*DeleteVhostUserIf) GetCrcString() string   { return "f9e6675e" }
531 func (*DeleteVhostUserIf) GetMessageType() api.MessageType {
532         return api.RequestMessage
533 }
534
535 func (m *DeleteVhostUserIf) Size() (size int) {
536         if m == nil {
537                 return 0
538         }
539         size += 4 // m.SwIfIndex
540         return size
541 }
542 func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) {
543         if b == nil {
544                 b = make([]byte, m.Size())
545         }
546         buf := codec.NewBuffer(b)
547         buf.EncodeUint32(uint32(m.SwIfIndex))
548         return buf.Bytes(), nil
549 }
550 func (m *DeleteVhostUserIf) Unmarshal(b []byte) error {
551         buf := codec.NewBuffer(b)
552         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
553         return nil
554 }
555
556 // DeleteVhostUserIfReply defines message 'delete_vhost_user_if_reply'.
557 type DeleteVhostUserIfReply struct {
558         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
559 }
560
561 func (m *DeleteVhostUserIfReply) Reset()               { *m = DeleteVhostUserIfReply{} }
562 func (*DeleteVhostUserIfReply) GetMessageName() string { return "delete_vhost_user_if_reply" }
563 func (*DeleteVhostUserIfReply) GetCrcString() string   { return "e8d4e804" }
564 func (*DeleteVhostUserIfReply) GetMessageType() api.MessageType {
565         return api.ReplyMessage
566 }
567
568 func (m *DeleteVhostUserIfReply) Size() (size int) {
569         if m == nil {
570                 return 0
571         }
572         size += 4 // m.Retval
573         return size
574 }
575 func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
576         if b == nil {
577                 b = make([]byte, m.Size())
578         }
579         buf := codec.NewBuffer(b)
580         buf.EncodeInt32(m.Retval)
581         return buf.Bytes(), nil
582 }
583 func (m *DeleteVhostUserIfReply) Unmarshal(b []byte) error {
584         buf := codec.NewBuffer(b)
585         m.Retval = buf.DecodeInt32()
586         return nil
587 }
588
589 // ModifyVhostUserIf defines message 'modify_vhost_user_if'.
590 type ModifyVhostUserIf struct {
591         SwIfIndex         InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
592         IsServer          bool           `binapi:"bool,name=is_server" json:"is_server,omitempty"`
593         SockFilename      string         `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
594         Renumber          bool           `binapi:"bool,name=renumber" json:"renumber,omitempty"`
595         EnableGso         bool           `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
596         CustomDevInstance uint32         `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
597 }
598
599 func (m *ModifyVhostUserIf) Reset()               { *m = ModifyVhostUserIf{} }
600 func (*ModifyVhostUserIf) GetMessageName() string { return "modify_vhost_user_if" }
601 func (*ModifyVhostUserIf) GetCrcString() string   { return "fcfeaf16" }
602 func (*ModifyVhostUserIf) GetMessageType() api.MessageType {
603         return api.RequestMessage
604 }
605
606 func (m *ModifyVhostUserIf) Size() (size int) {
607         if m == nil {
608                 return 0
609         }
610         size += 4   // m.SwIfIndex
611         size += 1   // m.IsServer
612         size += 256 // m.SockFilename
613         size += 1   // m.Renumber
614         size += 1   // m.EnableGso
615         size += 4   // m.CustomDevInstance
616         return size
617 }
618 func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) {
619         if b == nil {
620                 b = make([]byte, m.Size())
621         }
622         buf := codec.NewBuffer(b)
623         buf.EncodeUint32(uint32(m.SwIfIndex))
624         buf.EncodeBool(m.IsServer)
625         buf.EncodeString(m.SockFilename, 256)
626         buf.EncodeBool(m.Renumber)
627         buf.EncodeBool(m.EnableGso)
628         buf.EncodeUint32(m.CustomDevInstance)
629         return buf.Bytes(), nil
630 }
631 func (m *ModifyVhostUserIf) Unmarshal(b []byte) error {
632         buf := codec.NewBuffer(b)
633         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
634         m.IsServer = buf.DecodeBool()
635         m.SockFilename = buf.DecodeString(256)
636         m.Renumber = buf.DecodeBool()
637         m.EnableGso = buf.DecodeBool()
638         m.CustomDevInstance = buf.DecodeUint32()
639         return nil
640 }
641
642 // ModifyVhostUserIfReply defines message 'modify_vhost_user_if_reply'.
643 type ModifyVhostUserIfReply struct {
644         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
645 }
646
647 func (m *ModifyVhostUserIfReply) Reset()               { *m = ModifyVhostUserIfReply{} }
648 func (*ModifyVhostUserIfReply) GetMessageName() string { return "modify_vhost_user_if_reply" }
649 func (*ModifyVhostUserIfReply) GetCrcString() string   { return "e8d4e804" }
650 func (*ModifyVhostUserIfReply) GetMessageType() api.MessageType {
651         return api.ReplyMessage
652 }
653
654 func (m *ModifyVhostUserIfReply) Size() (size int) {
655         if m == nil {
656                 return 0
657         }
658         size += 4 // m.Retval
659         return size
660 }
661 func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
662         if b == nil {
663                 b = make([]byte, m.Size())
664         }
665         buf := codec.NewBuffer(b)
666         buf.EncodeInt32(m.Retval)
667         return buf.Bytes(), nil
668 }
669 func (m *ModifyVhostUserIfReply) Unmarshal(b []byte) error {
670         buf := codec.NewBuffer(b)
671         m.Retval = buf.DecodeInt32()
672         return nil
673 }
674
675 // SwInterfaceVhostUserDetails defines message 'sw_interface_vhost_user_details'.
676 type SwInterfaceVhostUserDetails struct {
677         SwIfIndex       InterfaceIndex           `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
678         InterfaceName   string                   `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
679         VirtioNetHdrSz  uint32                   `binapi:"u32,name=virtio_net_hdr_sz" json:"virtio_net_hdr_sz,omitempty"`
680         FeaturesFirst32 VirtioNetFeaturesFirst32 `binapi:"virtio_net_features_first_32,name=features_first_32" json:"features_first_32,omitempty"`
681         FeaturesLast32  VirtioNetFeaturesLast32  `binapi:"virtio_net_features_last_32,name=features_last_32" json:"features_last_32,omitempty"`
682         IsServer        bool                     `binapi:"bool,name=is_server" json:"is_server,omitempty"`
683         SockFilename    string                   `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
684         NumRegions      uint32                   `binapi:"u32,name=num_regions" json:"num_regions,omitempty"`
685         SockErrno       int32                    `binapi:"i32,name=sock_errno" json:"sock_errno,omitempty"`
686 }
687
688 func (m *SwInterfaceVhostUserDetails) Reset()               { *m = SwInterfaceVhostUserDetails{} }
689 func (*SwInterfaceVhostUserDetails) GetMessageName() string { return "sw_interface_vhost_user_details" }
690 func (*SwInterfaceVhostUserDetails) GetCrcString() string   { return "98530df1" }
691 func (*SwInterfaceVhostUserDetails) GetMessageType() api.MessageType {
692         return api.ReplyMessage
693 }
694
695 func (m *SwInterfaceVhostUserDetails) Size() (size int) {
696         if m == nil {
697                 return 0
698         }
699         size += 4   // m.SwIfIndex
700         size += 64  // m.InterfaceName
701         size += 4   // m.VirtioNetHdrSz
702         size += 4   // m.FeaturesFirst32
703         size += 4   // m.FeaturesLast32
704         size += 1   // m.IsServer
705         size += 256 // m.SockFilename
706         size += 4   // m.NumRegions
707         size += 4   // m.SockErrno
708         return size
709 }
710 func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) {
711         if b == nil {
712                 b = make([]byte, m.Size())
713         }
714         buf := codec.NewBuffer(b)
715         buf.EncodeUint32(uint32(m.SwIfIndex))
716         buf.EncodeString(m.InterfaceName, 64)
717         buf.EncodeUint32(m.VirtioNetHdrSz)
718         buf.EncodeUint32(uint32(m.FeaturesFirst32))
719         buf.EncodeUint32(uint32(m.FeaturesLast32))
720         buf.EncodeBool(m.IsServer)
721         buf.EncodeString(m.SockFilename, 256)
722         buf.EncodeUint32(m.NumRegions)
723         buf.EncodeInt32(m.SockErrno)
724         return buf.Bytes(), nil
725 }
726 func (m *SwInterfaceVhostUserDetails) Unmarshal(b []byte) error {
727         buf := codec.NewBuffer(b)
728         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
729         m.InterfaceName = buf.DecodeString(64)
730         m.VirtioNetHdrSz = buf.DecodeUint32()
731         m.FeaturesFirst32 = VirtioNetFeaturesFirst32(buf.DecodeUint32())
732         m.FeaturesLast32 = VirtioNetFeaturesLast32(buf.DecodeUint32())
733         m.IsServer = buf.DecodeBool()
734         m.SockFilename = buf.DecodeString(256)
735         m.NumRegions = buf.DecodeUint32()
736         m.SockErrno = buf.DecodeInt32()
737         return nil
738 }
739
740 // SwInterfaceVhostUserDump defines message 'sw_interface_vhost_user_dump'.
741 type SwInterfaceVhostUserDump struct {
742         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
743 }
744
745 func (m *SwInterfaceVhostUserDump) Reset()               { *m = SwInterfaceVhostUserDump{} }
746 func (*SwInterfaceVhostUserDump) GetMessageName() string { return "sw_interface_vhost_user_dump" }
747 func (*SwInterfaceVhostUserDump) GetCrcString() string   { return "f9e6675e" }
748 func (*SwInterfaceVhostUserDump) GetMessageType() api.MessageType {
749         return api.RequestMessage
750 }
751
752 func (m *SwInterfaceVhostUserDump) Size() (size int) {
753         if m == nil {
754                 return 0
755         }
756         size += 4 // m.SwIfIndex
757         return size
758 }
759 func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) {
760         if b == nil {
761                 b = make([]byte, m.Size())
762         }
763         buf := codec.NewBuffer(b)
764         buf.EncodeUint32(uint32(m.SwIfIndex))
765         return buf.Bytes(), nil
766 }
767 func (m *SwInterfaceVhostUserDump) Unmarshal(b []byte) error {
768         buf := codec.NewBuffer(b)
769         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
770         return nil
771 }
772
773 func init() { file_vhost_user_binapi_init() }
774 func file_vhost_user_binapi_init() {
775         api.RegisterMessage((*CreateVhostUserIf)(nil), "create_vhost_user_if_591ee951")
776         api.RegisterMessage((*CreateVhostUserIfReply)(nil), "create_vhost_user_if_reply_5383d31f")
777         api.RegisterMessage((*DeleteVhostUserIf)(nil), "delete_vhost_user_if_f9e6675e")
778         api.RegisterMessage((*DeleteVhostUserIfReply)(nil), "delete_vhost_user_if_reply_e8d4e804")
779         api.RegisterMessage((*ModifyVhostUserIf)(nil), "modify_vhost_user_if_fcfeaf16")
780         api.RegisterMessage((*ModifyVhostUserIfReply)(nil), "modify_vhost_user_if_reply_e8d4e804")
781         api.RegisterMessage((*SwInterfaceVhostUserDetails)(nil), "sw_interface_vhost_user_details_98530df1")
782         api.RegisterMessage((*SwInterfaceVhostUserDump)(nil), "sw_interface_vhost_user_dump_f9e6675e")
783 }
784
785 // Messages returns list of all messages in this module.
786 func AllMessages() []api.Message {
787         return []api.Message{
788                 (*CreateVhostUserIf)(nil),
789                 (*CreateVhostUserIfReply)(nil),
790                 (*DeleteVhostUserIf)(nil),
791                 (*DeleteVhostUserIfReply)(nil),
792                 (*ModifyVhostUserIf)(nil),
793                 (*ModifyVhostUserIfReply)(nil),
794                 (*SwInterfaceVhostUserDetails)(nil),
795                 (*SwInterfaceVhostUserDump)(nil),
796         }
797 }