1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: .vppapi/core/vhost_user.api.json
7 // Package vhost_user contains generated bindings for API file vhost_user.api.
17 api "git.fd.io/govpp.git/api"
18 codec "git.fd.io/govpp.git/codec"
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
30 APIFile = "vhost_user"
32 VersionCrc = 0xb547a33d
35 // IfStatusFlags defines enum 'if_status_flags'.
36 type IfStatusFlags uint32
39 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
40 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
44 IfStatusFlags_name = map[uint32]string{
45 1: "IF_STATUS_API_FLAG_ADMIN_UP",
46 2: "IF_STATUS_API_FLAG_LINK_UP",
48 IfStatusFlags_value = map[string]uint32{
49 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
50 "IF_STATUS_API_FLAG_LINK_UP": 2,
54 func (x IfStatusFlags) String() string {
55 s, ok := IfStatusFlags_name[uint32(x)]
59 str := func(n uint32) string {
60 s, ok := IfStatusFlags_name[uint32(n)]
64 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
66 for i := uint32(0); i <= 32; i++ {
81 // IfType defines enum 'if_type'.
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
92 IfType_name = map[uint32]string{
93 1: "IF_API_TYPE_HARDWARE",
96 4: "IF_API_TYPE_PIPE",
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,
106 func (x IfType) String() string {
107 s, ok := IfType_name[uint32(x)]
111 return "IfType(" + strconv.Itoa(int(x)) + ")"
114 // LinkDuplex defines enum 'link_duplex'.
115 type LinkDuplex uint32
118 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
119 LINK_DUPLEX_API_HALF LinkDuplex = 1
120 LINK_DUPLEX_API_FULL LinkDuplex = 2
124 LinkDuplex_name = map[uint32]string{
125 0: "LINK_DUPLEX_API_UNKNOWN",
126 1: "LINK_DUPLEX_API_HALF",
127 2: "LINK_DUPLEX_API_FULL",
129 LinkDuplex_value = map[string]uint32{
130 "LINK_DUPLEX_API_UNKNOWN": 0,
131 "LINK_DUPLEX_API_HALF": 1,
132 "LINK_DUPLEX_API_FULL": 2,
136 func (x LinkDuplex) String() string {
137 s, ok := LinkDuplex_name[uint32(x)]
141 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
144 // MtuProto defines enum 'mtu_proto'.
148 MTU_PROTO_API_L3 MtuProto = 1
149 MTU_PROTO_API_IP4 MtuProto = 2
150 MTU_PROTO_API_IP6 MtuProto = 3
151 MTU_PROTO_API_MPLS MtuProto = 4
152 MTU_PROTO_API_N MtuProto = 5
156 MtuProto_name = map[uint32]string{
157 1: "MTU_PROTO_API_L3",
158 2: "MTU_PROTO_API_IP4",
159 3: "MTU_PROTO_API_IP6",
160 4: "MTU_PROTO_API_MPLS",
161 5: "MTU_PROTO_API_N",
163 MtuProto_value = map[string]uint32{
164 "MTU_PROTO_API_L3": 1,
165 "MTU_PROTO_API_IP4": 2,
166 "MTU_PROTO_API_IP6": 3,
167 "MTU_PROTO_API_MPLS": 4,
168 "MTU_PROTO_API_N": 5,
172 func (x MtuProto) String() string {
173 s, ok := MtuProto_name[uint32(x)]
177 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
180 // RxMode defines enum 'rx_mode'.
184 RX_MODE_API_UNKNOWN RxMode = 0
185 RX_MODE_API_POLLING RxMode = 1
186 RX_MODE_API_INTERRUPT RxMode = 2
187 RX_MODE_API_ADAPTIVE RxMode = 3
188 RX_MODE_API_DEFAULT RxMode = 4
192 RxMode_name = map[uint32]string{
193 0: "RX_MODE_API_UNKNOWN",
194 1: "RX_MODE_API_POLLING",
195 2: "RX_MODE_API_INTERRUPT",
196 3: "RX_MODE_API_ADAPTIVE",
197 4: "RX_MODE_API_DEFAULT",
199 RxMode_value = map[string]uint32{
200 "RX_MODE_API_UNKNOWN": 0,
201 "RX_MODE_API_POLLING": 1,
202 "RX_MODE_API_INTERRUPT": 2,
203 "RX_MODE_API_ADAPTIVE": 3,
204 "RX_MODE_API_DEFAULT": 4,
208 func (x RxMode) String() string {
209 s, ok := RxMode_name[uint32(x)]
213 return "RxMode(" + strconv.Itoa(int(x)) + ")"
216 // SubIfFlags defines enum 'sub_if_flags'.
217 type SubIfFlags uint32
220 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
221 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
222 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
223 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
224 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
225 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
226 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
227 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
228 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
229 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
233 SubIfFlags_name = map[uint32]string{
234 1: "SUB_IF_API_FLAG_NO_TAGS",
235 2: "SUB_IF_API_FLAG_ONE_TAG",
236 4: "SUB_IF_API_FLAG_TWO_TAGS",
237 8: "SUB_IF_API_FLAG_DOT1AD",
238 16: "SUB_IF_API_FLAG_EXACT_MATCH",
239 32: "SUB_IF_API_FLAG_DEFAULT",
240 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
241 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
242 254: "SUB_IF_API_FLAG_MASK_VNET",
243 256: "SUB_IF_API_FLAG_DOT1AH",
245 SubIfFlags_value = map[string]uint32{
246 "SUB_IF_API_FLAG_NO_TAGS": 1,
247 "SUB_IF_API_FLAG_ONE_TAG": 2,
248 "SUB_IF_API_FLAG_TWO_TAGS": 4,
249 "SUB_IF_API_FLAG_DOT1AD": 8,
250 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
251 "SUB_IF_API_FLAG_DEFAULT": 32,
252 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
253 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
254 "SUB_IF_API_FLAG_MASK_VNET": 254,
255 "SUB_IF_API_FLAG_DOT1AH": 256,
259 func (x SubIfFlags) String() string {
260 s, ok := SubIfFlags_name[uint32(x)]
264 str := func(n uint32) string {
265 s, ok := SubIfFlags_name[uint32(n)]
269 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
271 for i := uint32(0); i <= 32; i++ {
281 return str(uint32(x))
286 // VirtioNetFeaturesFirst32 defines enum 'virtio_net_features_first_32'.
287 type VirtioNetFeaturesFirst32 uint32
290 VIRTIO_NET_F_API_CSUM VirtioNetFeaturesFirst32 = 1
291 VIRTIO_NET_F_API_GUEST_CSUM VirtioNetFeaturesFirst32 = 2
292 VIRTIO_NET_F_API_GUEST_TSO4 VirtioNetFeaturesFirst32 = 128
293 VIRTIO_NET_F_API_GUEST_TSO6 VirtioNetFeaturesFirst32 = 256
294 VIRTIO_NET_F_API_GUEST_UFO VirtioNetFeaturesFirst32 = 1024
295 VIRTIO_NET_F_API_HOST_TSO4 VirtioNetFeaturesFirst32 = 2048
296 VIRTIO_NET_F_API_HOST_TSO6 VirtioNetFeaturesFirst32 = 4096
297 VIRTIO_NET_F_API_HOST_UFO VirtioNetFeaturesFirst32 = 16384
298 VIRTIO_NET_F_API_MRG_RXBUF VirtioNetFeaturesFirst32 = 32768
299 VIRTIO_NET_F_API_CTRL_VQ VirtioNetFeaturesFirst32 = 131072
300 VIRTIO_NET_F_API_GUEST_ANNOUNCE VirtioNetFeaturesFirst32 = 2097152
301 VIRTIO_NET_F_API_MQ VirtioNetFeaturesFirst32 = 4194304
302 VHOST_F_API_LOG_ALL VirtioNetFeaturesFirst32 = 67108864
303 VIRTIO_F_API_ANY_LAYOUT VirtioNetFeaturesFirst32 = 134217728
304 VIRTIO_F_API_INDIRECT_DESC VirtioNetFeaturesFirst32 = 268435456
305 VHOST_USER_F_API_PROTOCOL_FEATURES VirtioNetFeaturesFirst32 = 1073741824
309 VirtioNetFeaturesFirst32_name = map[uint32]string{
310 1: "VIRTIO_NET_F_API_CSUM",
311 2: "VIRTIO_NET_F_API_GUEST_CSUM",
312 128: "VIRTIO_NET_F_API_GUEST_TSO4",
313 256: "VIRTIO_NET_F_API_GUEST_TSO6",
314 1024: "VIRTIO_NET_F_API_GUEST_UFO",
315 2048: "VIRTIO_NET_F_API_HOST_TSO4",
316 4096: "VIRTIO_NET_F_API_HOST_TSO6",
317 16384: "VIRTIO_NET_F_API_HOST_UFO",
318 32768: "VIRTIO_NET_F_API_MRG_RXBUF",
319 131072: "VIRTIO_NET_F_API_CTRL_VQ",
320 2097152: "VIRTIO_NET_F_API_GUEST_ANNOUNCE",
321 4194304: "VIRTIO_NET_F_API_MQ",
322 67108864: "VHOST_F_API_LOG_ALL",
323 134217728: "VIRTIO_F_API_ANY_LAYOUT",
324 268435456: "VIRTIO_F_API_INDIRECT_DESC",
325 1073741824: "VHOST_USER_F_API_PROTOCOL_FEATURES",
327 VirtioNetFeaturesFirst32_value = map[string]uint32{
328 "VIRTIO_NET_F_API_CSUM": 1,
329 "VIRTIO_NET_F_API_GUEST_CSUM": 2,
330 "VIRTIO_NET_F_API_GUEST_TSO4": 128,
331 "VIRTIO_NET_F_API_GUEST_TSO6": 256,
332 "VIRTIO_NET_F_API_GUEST_UFO": 1024,
333 "VIRTIO_NET_F_API_HOST_TSO4": 2048,
334 "VIRTIO_NET_F_API_HOST_TSO6": 4096,
335 "VIRTIO_NET_F_API_HOST_UFO": 16384,
336 "VIRTIO_NET_F_API_MRG_RXBUF": 32768,
337 "VIRTIO_NET_F_API_CTRL_VQ": 131072,
338 "VIRTIO_NET_F_API_GUEST_ANNOUNCE": 2097152,
339 "VIRTIO_NET_F_API_MQ": 4194304,
340 "VHOST_F_API_LOG_ALL": 67108864,
341 "VIRTIO_F_API_ANY_LAYOUT": 134217728,
342 "VIRTIO_F_API_INDIRECT_DESC": 268435456,
343 "VHOST_USER_F_API_PROTOCOL_FEATURES": 1073741824,
347 func (x VirtioNetFeaturesFirst32) String() string {
348 s, ok := VirtioNetFeaturesFirst32_name[uint32(x)]
352 return "VirtioNetFeaturesFirst32(" + strconv.Itoa(int(x)) + ")"
355 // VirtioNetFeaturesLast32 defines enum 'virtio_net_features_last_32'.
356 type VirtioNetFeaturesLast32 uint32
359 VIRTIO_F_API_VERSION_1 VirtioNetFeaturesLast32 = 1
363 VirtioNetFeaturesLast32_name = map[uint32]string{
364 1: "VIRTIO_F_API_VERSION_1",
366 VirtioNetFeaturesLast32_value = map[string]uint32{
367 "VIRTIO_F_API_VERSION_1": 1,
371 func (x VirtioNetFeaturesLast32) String() string {
372 s, ok := VirtioNetFeaturesLast32_name[uint32(x)]
376 return "VirtioNetFeaturesLast32(" + strconv.Itoa(int(x)) + ")"
379 // InterfaceIndex defines alias 'interface_index'.
380 type InterfaceIndex uint32
382 // MacAddress defines alias 'mac_address'.
383 type MacAddress [6]uint8
385 func ParseMacAddress(s string) (MacAddress, error) {
386 var macaddr MacAddress
387 mac, err := net.ParseMAC(s)
391 copy(macaddr[:], mac[:])
394 func (x MacAddress) ToMAC() net.HardwareAddr {
395 return net.HardwareAddr(x[:])
397 func (x MacAddress) String() string {
398 return x.ToMAC().String()
400 func (x *MacAddress) MarshalText() ([]byte, error) {
401 return []byte(x.String()), nil
403 func (x *MacAddress) UnmarshalText(text []byte) error {
404 mac, err := ParseMacAddress(string(text))
412 // CreateVhostUserIf defines message 'create_vhost_user_if'.
413 type CreateVhostUserIf struct {
414 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
415 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
416 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
417 DisableMrgRxbuf bool `binapi:"bool,name=disable_mrg_rxbuf" json:"disable_mrg_rxbuf,omitempty"`
418 DisableIndirectDesc bool `binapi:"bool,name=disable_indirect_desc" json:"disable_indirect_desc,omitempty"`
419 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
420 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
421 UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"`
422 MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
423 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
426 func (m *CreateVhostUserIf) Reset() { *m = CreateVhostUserIf{} }
427 func (*CreateVhostUserIf) GetMessageName() string { return "create_vhost_user_if" }
428 func (*CreateVhostUserIf) GetCrcString() string { return "591ee951" }
429 func (*CreateVhostUserIf) GetMessageType() api.MessageType {
430 return api.RequestMessage
433 func (m *CreateVhostUserIf) Size() (size int) {
437 size += 1 // m.IsServer
438 size += 256 // m.SockFilename
439 size += 1 // m.Renumber
440 size += 1 // m.DisableMrgRxbuf
441 size += 1 // m.DisableIndirectDesc
442 size += 1 // m.EnableGso
443 size += 4 // m.CustomDevInstance
444 size += 1 // m.UseCustomMac
445 size += 1 * 6 // m.MacAddress
449 func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) {
451 b = make([]byte, m.Size())
453 buf := codec.NewBuffer(b)
454 buf.EncodeBool(m.IsServer)
455 buf.EncodeString(m.SockFilename, 256)
456 buf.EncodeBool(m.Renumber)
457 buf.EncodeBool(m.DisableMrgRxbuf)
458 buf.EncodeBool(m.DisableIndirectDesc)
459 buf.EncodeBool(m.EnableGso)
460 buf.EncodeUint32(m.CustomDevInstance)
461 buf.EncodeBool(m.UseCustomMac)
462 buf.EncodeBytes(m.MacAddress[:], 6)
463 buf.EncodeString(m.Tag, 64)
464 return buf.Bytes(), nil
466 func (m *CreateVhostUserIf) Unmarshal(b []byte) error {
467 buf := codec.NewBuffer(b)
468 m.IsServer = buf.DecodeBool()
469 m.SockFilename = buf.DecodeString(256)
470 m.Renumber = buf.DecodeBool()
471 m.DisableMrgRxbuf = buf.DecodeBool()
472 m.DisableIndirectDesc = buf.DecodeBool()
473 m.EnableGso = buf.DecodeBool()
474 m.CustomDevInstance = buf.DecodeUint32()
475 m.UseCustomMac = buf.DecodeBool()
476 copy(m.MacAddress[:], buf.DecodeBytes(6))
477 m.Tag = buf.DecodeString(64)
481 // CreateVhostUserIfReply defines message 'create_vhost_user_if_reply'.
482 type CreateVhostUserIfReply struct {
483 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
484 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
487 func (m *CreateVhostUserIfReply) Reset() { *m = CreateVhostUserIfReply{} }
488 func (*CreateVhostUserIfReply) GetMessageName() string { return "create_vhost_user_if_reply" }
489 func (*CreateVhostUserIfReply) GetCrcString() string { return "5383d31f" }
490 func (*CreateVhostUserIfReply) GetMessageType() api.MessageType {
491 return api.ReplyMessage
494 func (m *CreateVhostUserIfReply) Size() (size int) {
498 size += 4 // m.Retval
499 size += 4 // m.SwIfIndex
502 func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
504 b = make([]byte, m.Size())
506 buf := codec.NewBuffer(b)
507 buf.EncodeInt32(m.Retval)
508 buf.EncodeUint32(uint32(m.SwIfIndex))
509 return buf.Bytes(), nil
511 func (m *CreateVhostUserIfReply) Unmarshal(b []byte) error {
512 buf := codec.NewBuffer(b)
513 m.Retval = buf.DecodeInt32()
514 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
518 // DeleteVhostUserIf defines message 'delete_vhost_user_if'.
519 type DeleteVhostUserIf struct {
520 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
523 func (m *DeleteVhostUserIf) Reset() { *m = DeleteVhostUserIf{} }
524 func (*DeleteVhostUserIf) GetMessageName() string { return "delete_vhost_user_if" }
525 func (*DeleteVhostUserIf) GetCrcString() string { return "f9e6675e" }
526 func (*DeleteVhostUserIf) GetMessageType() api.MessageType {
527 return api.RequestMessage
530 func (m *DeleteVhostUserIf) Size() (size int) {
534 size += 4 // m.SwIfIndex
537 func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) {
539 b = make([]byte, m.Size())
541 buf := codec.NewBuffer(b)
542 buf.EncodeUint32(uint32(m.SwIfIndex))
543 return buf.Bytes(), nil
545 func (m *DeleteVhostUserIf) Unmarshal(b []byte) error {
546 buf := codec.NewBuffer(b)
547 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
551 // DeleteVhostUserIfReply defines message 'delete_vhost_user_if_reply'.
552 type DeleteVhostUserIfReply struct {
553 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
556 func (m *DeleteVhostUserIfReply) Reset() { *m = DeleteVhostUserIfReply{} }
557 func (*DeleteVhostUserIfReply) GetMessageName() string { return "delete_vhost_user_if_reply" }
558 func (*DeleteVhostUserIfReply) GetCrcString() string { return "e8d4e804" }
559 func (*DeleteVhostUserIfReply) GetMessageType() api.MessageType {
560 return api.ReplyMessage
563 func (m *DeleteVhostUserIfReply) Size() (size int) {
567 size += 4 // m.Retval
570 func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
572 b = make([]byte, m.Size())
574 buf := codec.NewBuffer(b)
575 buf.EncodeInt32(m.Retval)
576 return buf.Bytes(), nil
578 func (m *DeleteVhostUserIfReply) Unmarshal(b []byte) error {
579 buf := codec.NewBuffer(b)
580 m.Retval = buf.DecodeInt32()
584 // ModifyVhostUserIf defines message 'modify_vhost_user_if'.
585 type ModifyVhostUserIf struct {
586 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
587 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
588 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
589 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
590 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
591 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
594 func (m *ModifyVhostUserIf) Reset() { *m = ModifyVhostUserIf{} }
595 func (*ModifyVhostUserIf) GetMessageName() string { return "modify_vhost_user_if" }
596 func (*ModifyVhostUserIf) GetCrcString() string { return "fcfeaf16" }
597 func (*ModifyVhostUserIf) GetMessageType() api.MessageType {
598 return api.RequestMessage
601 func (m *ModifyVhostUserIf) Size() (size int) {
605 size += 4 // m.SwIfIndex
606 size += 1 // m.IsServer
607 size += 256 // m.SockFilename
608 size += 1 // m.Renumber
609 size += 1 // m.EnableGso
610 size += 4 // m.CustomDevInstance
613 func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) {
615 b = make([]byte, m.Size())
617 buf := codec.NewBuffer(b)
618 buf.EncodeUint32(uint32(m.SwIfIndex))
619 buf.EncodeBool(m.IsServer)
620 buf.EncodeString(m.SockFilename, 256)
621 buf.EncodeBool(m.Renumber)
622 buf.EncodeBool(m.EnableGso)
623 buf.EncodeUint32(m.CustomDevInstance)
624 return buf.Bytes(), nil
626 func (m *ModifyVhostUserIf) Unmarshal(b []byte) error {
627 buf := codec.NewBuffer(b)
628 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
629 m.IsServer = buf.DecodeBool()
630 m.SockFilename = buf.DecodeString(256)
631 m.Renumber = buf.DecodeBool()
632 m.EnableGso = buf.DecodeBool()
633 m.CustomDevInstance = buf.DecodeUint32()
637 // ModifyVhostUserIfReply defines message 'modify_vhost_user_if_reply'.
638 type ModifyVhostUserIfReply struct {
639 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
642 func (m *ModifyVhostUserIfReply) Reset() { *m = ModifyVhostUserIfReply{} }
643 func (*ModifyVhostUserIfReply) GetMessageName() string { return "modify_vhost_user_if_reply" }
644 func (*ModifyVhostUserIfReply) GetCrcString() string { return "e8d4e804" }
645 func (*ModifyVhostUserIfReply) GetMessageType() api.MessageType {
646 return api.ReplyMessage
649 func (m *ModifyVhostUserIfReply) Size() (size int) {
653 size += 4 // m.Retval
656 func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
658 b = make([]byte, m.Size())
660 buf := codec.NewBuffer(b)
661 buf.EncodeInt32(m.Retval)
662 return buf.Bytes(), nil
664 func (m *ModifyVhostUserIfReply) Unmarshal(b []byte) error {
665 buf := codec.NewBuffer(b)
666 m.Retval = buf.DecodeInt32()
670 // SwInterfaceVhostUserDetails defines message 'sw_interface_vhost_user_details'.
671 type SwInterfaceVhostUserDetails struct {
672 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
673 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
674 VirtioNetHdrSz uint32 `binapi:"u32,name=virtio_net_hdr_sz" json:"virtio_net_hdr_sz,omitempty"`
675 FeaturesFirst32 VirtioNetFeaturesFirst32 `binapi:"virtio_net_features_first_32,name=features_first_32" json:"features_first_32,omitempty"`
676 FeaturesLast32 VirtioNetFeaturesLast32 `binapi:"virtio_net_features_last_32,name=features_last_32" json:"features_last_32,omitempty"`
677 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
678 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
679 NumRegions uint32 `binapi:"u32,name=num_regions" json:"num_regions,omitempty"`
680 SockErrno int32 `binapi:"i32,name=sock_errno" json:"sock_errno,omitempty"`
683 func (m *SwInterfaceVhostUserDetails) Reset() { *m = SwInterfaceVhostUserDetails{} }
684 func (*SwInterfaceVhostUserDetails) GetMessageName() string { return "sw_interface_vhost_user_details" }
685 func (*SwInterfaceVhostUserDetails) GetCrcString() string { return "98530df1" }
686 func (*SwInterfaceVhostUserDetails) GetMessageType() api.MessageType {
687 return api.ReplyMessage
690 func (m *SwInterfaceVhostUserDetails) Size() (size int) {
694 size += 4 // m.SwIfIndex
695 size += 64 // m.InterfaceName
696 size += 4 // m.VirtioNetHdrSz
697 size += 4 // m.FeaturesFirst32
698 size += 4 // m.FeaturesLast32
699 size += 1 // m.IsServer
700 size += 256 // m.SockFilename
701 size += 4 // m.NumRegions
702 size += 4 // m.SockErrno
705 func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) {
707 b = make([]byte, m.Size())
709 buf := codec.NewBuffer(b)
710 buf.EncodeUint32(uint32(m.SwIfIndex))
711 buf.EncodeString(m.InterfaceName, 64)
712 buf.EncodeUint32(m.VirtioNetHdrSz)
713 buf.EncodeUint32(uint32(m.FeaturesFirst32))
714 buf.EncodeUint32(uint32(m.FeaturesLast32))
715 buf.EncodeBool(m.IsServer)
716 buf.EncodeString(m.SockFilename, 256)
717 buf.EncodeUint32(m.NumRegions)
718 buf.EncodeInt32(m.SockErrno)
719 return buf.Bytes(), nil
721 func (m *SwInterfaceVhostUserDetails) Unmarshal(b []byte) error {
722 buf := codec.NewBuffer(b)
723 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
724 m.InterfaceName = buf.DecodeString(64)
725 m.VirtioNetHdrSz = buf.DecodeUint32()
726 m.FeaturesFirst32 = VirtioNetFeaturesFirst32(buf.DecodeUint32())
727 m.FeaturesLast32 = VirtioNetFeaturesLast32(buf.DecodeUint32())
728 m.IsServer = buf.DecodeBool()
729 m.SockFilename = buf.DecodeString(256)
730 m.NumRegions = buf.DecodeUint32()
731 m.SockErrno = buf.DecodeInt32()
735 // SwInterfaceVhostUserDump defines message 'sw_interface_vhost_user_dump'.
736 type SwInterfaceVhostUserDump struct {
737 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
740 func (m *SwInterfaceVhostUserDump) Reset() { *m = SwInterfaceVhostUserDump{} }
741 func (*SwInterfaceVhostUserDump) GetMessageName() string { return "sw_interface_vhost_user_dump" }
742 func (*SwInterfaceVhostUserDump) GetCrcString() string { return "f9e6675e" }
743 func (*SwInterfaceVhostUserDump) GetMessageType() api.MessageType {
744 return api.RequestMessage
747 func (m *SwInterfaceVhostUserDump) Size() (size int) {
751 size += 4 // m.SwIfIndex
754 func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) {
756 b = make([]byte, m.Size())
758 buf := codec.NewBuffer(b)
759 buf.EncodeUint32(uint32(m.SwIfIndex))
760 return buf.Bytes(), nil
762 func (m *SwInterfaceVhostUserDump) Unmarshal(b []byte) error {
763 buf := codec.NewBuffer(b)
764 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
768 func init() { file_vhost_user_binapi_init() }
769 func file_vhost_user_binapi_init() {
770 api.RegisterMessage((*CreateVhostUserIf)(nil), "create_vhost_user_if_591ee951")
771 api.RegisterMessage((*CreateVhostUserIfReply)(nil), "create_vhost_user_if_reply_5383d31f")
772 api.RegisterMessage((*DeleteVhostUserIf)(nil), "delete_vhost_user_if_f9e6675e")
773 api.RegisterMessage((*DeleteVhostUserIfReply)(nil), "delete_vhost_user_if_reply_e8d4e804")
774 api.RegisterMessage((*ModifyVhostUserIf)(nil), "modify_vhost_user_if_fcfeaf16")
775 api.RegisterMessage((*ModifyVhostUserIfReply)(nil), "modify_vhost_user_if_reply_e8d4e804")
776 api.RegisterMessage((*SwInterfaceVhostUserDetails)(nil), "sw_interface_vhost_user_details_98530df1")
777 api.RegisterMessage((*SwInterfaceVhostUserDump)(nil), "sw_interface_vhost_user_dump_f9e6675e")
780 // Messages returns list of all messages in this module.
781 func AllMessages() []api.Message {
782 return []api.Message{
783 (*CreateVhostUserIf)(nil),
784 (*CreateVhostUserIfReply)(nil),
785 (*DeleteVhostUserIf)(nil),
786 (*DeleteVhostUserIfReply)(nil),
787 (*ModifyVhostUserIf)(nil),
788 (*ModifyVhostUserIfReply)(nil),
789 (*SwInterfaceVhostUserDetails)(nil),
790 (*SwInterfaceVhostUserDump)(nil),