1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/core/vhost_user.api.json
7 // Package vhost_user contains generated bindings for API file vhost_user.api.
20 api "git.fd.io/govpp.git/api"
21 codec "git.fd.io/govpp.git/codec"
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
31 APIFile = "vhost_user"
33 VersionCrc = 0xb547a33d
36 // IfStatusFlags defines enum 'if_status_flags'.
37 type IfStatusFlags uint32
40 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
41 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
45 IfStatusFlags_name = map[uint32]string{
46 1: "IF_STATUS_API_FLAG_ADMIN_UP",
47 2: "IF_STATUS_API_FLAG_LINK_UP",
49 IfStatusFlags_value = map[string]uint32{
50 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
51 "IF_STATUS_API_FLAG_LINK_UP": 2,
55 func (x IfStatusFlags) String() string {
56 s, ok := IfStatusFlags_name[uint32(x)]
60 str := func(n uint32) string {
61 s, ok := IfStatusFlags_name[uint32(n)]
65 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
67 for i := uint32(0); i <= 32; i++ {
82 // IfType defines enum 'if_type'.
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
93 IfType_name = map[uint32]string{
94 1: "IF_API_TYPE_HARDWARE",
97 4: "IF_API_TYPE_PIPE",
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,
107 func (x IfType) String() string {
108 s, ok := IfType_name[uint32(x)]
112 return "IfType(" + strconv.Itoa(int(x)) + ")"
115 // LinkDuplex defines enum 'link_duplex'.
116 type LinkDuplex uint32
119 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
120 LINK_DUPLEX_API_HALF LinkDuplex = 1
121 LINK_DUPLEX_API_FULL LinkDuplex = 2
125 LinkDuplex_name = map[uint32]string{
126 0: "LINK_DUPLEX_API_UNKNOWN",
127 1: "LINK_DUPLEX_API_HALF",
128 2: "LINK_DUPLEX_API_FULL",
130 LinkDuplex_value = map[string]uint32{
131 "LINK_DUPLEX_API_UNKNOWN": 0,
132 "LINK_DUPLEX_API_HALF": 1,
133 "LINK_DUPLEX_API_FULL": 2,
137 func (x LinkDuplex) String() string {
138 s, ok := LinkDuplex_name[uint32(x)]
142 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
145 // MtuProto defines enum 'mtu_proto'.
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
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",
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,
173 func (x MtuProto) String() string {
174 s, ok := MtuProto_name[uint32(x)]
178 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
181 // RxMode defines enum 'rx_mode'.
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
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",
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,
209 func (x RxMode) String() string {
210 s, ok := RxMode_name[uint32(x)]
214 return "RxMode(" + strconv.Itoa(int(x)) + ")"
217 // SubIfFlags defines enum 'sub_if_flags'.
218 type SubIfFlags uint32
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
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",
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,
260 func (x SubIfFlags) String() string {
261 s, ok := SubIfFlags_name[uint32(x)]
265 str := func(n uint32) string {
266 s, ok := SubIfFlags_name[uint32(n)]
270 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
272 for i := uint32(0); i <= 32; i++ {
282 return str(uint32(x))
287 // VirtioNetFeaturesFirst32 defines enum 'virtio_net_features_first_32'.
288 type VirtioNetFeaturesFirst32 uint32
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
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",
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,
348 func (x VirtioNetFeaturesFirst32) String() string {
349 s, ok := VirtioNetFeaturesFirst32_name[uint32(x)]
353 return "VirtioNetFeaturesFirst32(" + strconv.Itoa(int(x)) + ")"
356 // VirtioNetFeaturesLast32 defines enum 'virtio_net_features_last_32'.
357 type VirtioNetFeaturesLast32 uint32
360 VIRTIO_F_API_VERSION_1 VirtioNetFeaturesLast32 = 1
364 VirtioNetFeaturesLast32_name = map[uint32]string{
365 1: "VIRTIO_F_API_VERSION_1",
367 VirtioNetFeaturesLast32_value = map[string]uint32{
368 "VIRTIO_F_API_VERSION_1": 1,
372 func (x VirtioNetFeaturesLast32) String() string {
373 s, ok := VirtioNetFeaturesLast32_name[uint32(x)]
377 return "VirtioNetFeaturesLast32(" + strconv.Itoa(int(x)) + ")"
380 // InterfaceIndex defines alias 'interface_index'.
381 type InterfaceIndex uint32
383 // MacAddress defines alias 'mac_address'.
384 type MacAddress [6]uint8
386 func ParseMacAddress(s string) (MacAddress, error) {
387 var macaddr MacAddress
388 mac, err := net.ParseMAC(s)
392 copy(macaddr[:], mac[:])
396 func (x MacAddress) ToMAC() net.HardwareAddr {
397 return net.HardwareAddr(x[:])
400 func (x MacAddress) String() string {
401 return x.ToMAC().String()
404 func (x *MacAddress) MarshalText() ([]byte, error) {
405 return []byte(x.String()), nil
408 func (x *MacAddress) UnmarshalText(text []byte) error {
409 mac, err := ParseMacAddress(string(text))
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"`
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
438 func (m *CreateVhostUserIf) Size() (size int) {
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
454 func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) {
456 b = make([]byte, m.Size())
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
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)
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"`
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
499 func (m *CreateVhostUserIfReply) Size() (size int) {
503 size += 4 // m.Retval
504 size += 4 // m.SwIfIndex
507 func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
509 b = make([]byte, m.Size())
511 buf := codec.NewBuffer(b)
512 buf.EncodeInt32(m.Retval)
513 buf.EncodeUint32(uint32(m.SwIfIndex))
514 return buf.Bytes(), nil
516 func (m *CreateVhostUserIfReply) Unmarshal(b []byte) error {
517 buf := codec.NewBuffer(b)
518 m.Retval = buf.DecodeInt32()
519 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
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"`
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
535 func (m *DeleteVhostUserIf) Size() (size int) {
539 size += 4 // m.SwIfIndex
542 func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) {
544 b = make([]byte, m.Size())
546 buf := codec.NewBuffer(b)
547 buf.EncodeUint32(uint32(m.SwIfIndex))
548 return buf.Bytes(), nil
550 func (m *DeleteVhostUserIf) Unmarshal(b []byte) error {
551 buf := codec.NewBuffer(b)
552 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
556 // DeleteVhostUserIfReply defines message 'delete_vhost_user_if_reply'.
557 type DeleteVhostUserIfReply struct {
558 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
568 func (m *DeleteVhostUserIfReply) Size() (size int) {
572 size += 4 // m.Retval
575 func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
577 b = make([]byte, m.Size())
579 buf := codec.NewBuffer(b)
580 buf.EncodeInt32(m.Retval)
581 return buf.Bytes(), nil
583 func (m *DeleteVhostUserIfReply) Unmarshal(b []byte) error {
584 buf := codec.NewBuffer(b)
585 m.Retval = buf.DecodeInt32()
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"`
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
606 func (m *ModifyVhostUserIf) Size() (size int) {
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
618 func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) {
620 b = make([]byte, m.Size())
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
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()
642 // ModifyVhostUserIfReply defines message 'modify_vhost_user_if_reply'.
643 type ModifyVhostUserIfReply struct {
644 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
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
654 func (m *ModifyVhostUserIfReply) Size() (size int) {
658 size += 4 // m.Retval
661 func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
663 b = make([]byte, m.Size())
665 buf := codec.NewBuffer(b)
666 buf.EncodeInt32(m.Retval)
667 return buf.Bytes(), nil
669 func (m *ModifyVhostUserIfReply) Unmarshal(b []byte) error {
670 buf := codec.NewBuffer(b)
671 m.Retval = buf.DecodeInt32()
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"`
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
695 func (m *SwInterfaceVhostUserDetails) Size() (size int) {
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
710 func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) {
712 b = make([]byte, m.Size())
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
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()
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"`
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
752 func (m *SwInterfaceVhostUserDump) Size() (size int) {
756 size += 4 // m.SwIfIndex
759 func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) {
761 b = make([]byte, m.Size())
763 buf := codec.NewBuffer(b)
764 buf.EncodeUint32(uint32(m.SwIfIndex))
765 return buf.Bytes(), nil
767 func (m *SwInterfaceVhostUserDump) Unmarshal(b []byte) error {
768 buf := codec.NewBuffer(b)
769 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
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")
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),