1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0
5 // source: /usr/share/vpp/api/core/vhost_user.api.json
7 // Package vhost_user contains generated bindings for API file vhost_user.api.
15 api "git.fd.io/govpp.git/api"
16 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 virtio_types "git.fd.io/govpp.git/binapi/virtio_types"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
29 APIFile = "vhost_user"
31 VersionCrc = 0xd49ae8cd
34 // CreateVhostUserIf defines message 'create_vhost_user_if'.
35 // Deprecated: the message will be removed in the future versions
36 type CreateVhostUserIf struct {
37 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
38 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
39 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
40 DisableMrgRxbuf bool `binapi:"bool,name=disable_mrg_rxbuf" json:"disable_mrg_rxbuf,omitempty"`
41 DisableIndirectDesc bool `binapi:"bool,name=disable_indirect_desc" json:"disable_indirect_desc,omitempty"`
42 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
43 EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"`
44 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
45 UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"`
46 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
47 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
50 func (m *CreateVhostUserIf) Reset() { *m = CreateVhostUserIf{} }
51 func (*CreateVhostUserIf) GetMessageName() string { return "create_vhost_user_if" }
52 func (*CreateVhostUserIf) GetCrcString() string { return "c785c6fc" }
53 func (*CreateVhostUserIf) GetMessageType() api.MessageType {
54 return api.RequestMessage
57 func (m *CreateVhostUserIf) Size() (size int) {
61 size += 1 // m.IsServer
62 size += 256 // m.SockFilename
63 size += 1 // m.Renumber
64 size += 1 // m.DisableMrgRxbuf
65 size += 1 // m.DisableIndirectDesc
66 size += 1 // m.EnableGso
67 size += 1 // m.EnablePacked
68 size += 4 // m.CustomDevInstance
69 size += 1 // m.UseCustomMac
70 size += 1 * 6 // m.MacAddress
74 func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) {
76 b = make([]byte, m.Size())
78 buf := codec.NewBuffer(b)
79 buf.EncodeBool(m.IsServer)
80 buf.EncodeString(m.SockFilename, 256)
81 buf.EncodeBool(m.Renumber)
82 buf.EncodeBool(m.DisableMrgRxbuf)
83 buf.EncodeBool(m.DisableIndirectDesc)
84 buf.EncodeBool(m.EnableGso)
85 buf.EncodeBool(m.EnablePacked)
86 buf.EncodeUint32(m.CustomDevInstance)
87 buf.EncodeBool(m.UseCustomMac)
88 buf.EncodeBytes(m.MacAddress[:], 6)
89 buf.EncodeString(m.Tag, 64)
90 return buf.Bytes(), nil
92 func (m *CreateVhostUserIf) Unmarshal(b []byte) error {
93 buf := codec.NewBuffer(b)
94 m.IsServer = buf.DecodeBool()
95 m.SockFilename = buf.DecodeString(256)
96 m.Renumber = buf.DecodeBool()
97 m.DisableMrgRxbuf = buf.DecodeBool()
98 m.DisableIndirectDesc = buf.DecodeBool()
99 m.EnableGso = buf.DecodeBool()
100 m.EnablePacked = buf.DecodeBool()
101 m.CustomDevInstance = buf.DecodeUint32()
102 m.UseCustomMac = buf.DecodeBool()
103 copy(m.MacAddress[:], buf.DecodeBytes(6))
104 m.Tag = buf.DecodeString(64)
108 // CreateVhostUserIfReply defines message 'create_vhost_user_if_reply'.
109 // Deprecated: the message will be removed in the future versions
110 type CreateVhostUserIfReply struct {
111 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
112 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
115 func (m *CreateVhostUserIfReply) Reset() { *m = CreateVhostUserIfReply{} }
116 func (*CreateVhostUserIfReply) GetMessageName() string { return "create_vhost_user_if_reply" }
117 func (*CreateVhostUserIfReply) GetCrcString() string { return "5383d31f" }
118 func (*CreateVhostUserIfReply) GetMessageType() api.MessageType {
119 return api.ReplyMessage
122 func (m *CreateVhostUserIfReply) Size() (size int) {
126 size += 4 // m.Retval
127 size += 4 // m.SwIfIndex
130 func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
132 b = make([]byte, m.Size())
134 buf := codec.NewBuffer(b)
135 buf.EncodeInt32(m.Retval)
136 buf.EncodeUint32(uint32(m.SwIfIndex))
137 return buf.Bytes(), nil
139 func (m *CreateVhostUserIfReply) Unmarshal(b []byte) error {
140 buf := codec.NewBuffer(b)
141 m.Retval = buf.DecodeInt32()
142 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
146 // CreateVhostUserIfV2 defines message 'create_vhost_user_if_v2'.
147 type CreateVhostUserIfV2 struct {
148 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
149 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
150 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
151 DisableMrgRxbuf bool `binapi:"bool,name=disable_mrg_rxbuf" json:"disable_mrg_rxbuf,omitempty"`
152 DisableIndirectDesc bool `binapi:"bool,name=disable_indirect_desc" json:"disable_indirect_desc,omitempty"`
153 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
154 EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"`
155 EnableEventIdx bool `binapi:"bool,name=enable_event_idx" json:"enable_event_idx,omitempty"`
156 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
157 UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"`
158 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
159 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
162 func (m *CreateVhostUserIfV2) Reset() { *m = CreateVhostUserIfV2{} }
163 func (*CreateVhostUserIfV2) GetMessageName() string { return "create_vhost_user_if_v2" }
164 func (*CreateVhostUserIfV2) GetCrcString() string { return "dba1cc1d" }
165 func (*CreateVhostUserIfV2) GetMessageType() api.MessageType {
166 return api.RequestMessage
169 func (m *CreateVhostUserIfV2) Size() (size int) {
173 size += 1 // m.IsServer
174 size += 256 // m.SockFilename
175 size += 1 // m.Renumber
176 size += 1 // m.DisableMrgRxbuf
177 size += 1 // m.DisableIndirectDesc
178 size += 1 // m.EnableGso
179 size += 1 // m.EnablePacked
180 size += 1 // m.EnableEventIdx
181 size += 4 // m.CustomDevInstance
182 size += 1 // m.UseCustomMac
183 size += 1 * 6 // m.MacAddress
187 func (m *CreateVhostUserIfV2) Marshal(b []byte) ([]byte, error) {
189 b = make([]byte, m.Size())
191 buf := codec.NewBuffer(b)
192 buf.EncodeBool(m.IsServer)
193 buf.EncodeString(m.SockFilename, 256)
194 buf.EncodeBool(m.Renumber)
195 buf.EncodeBool(m.DisableMrgRxbuf)
196 buf.EncodeBool(m.DisableIndirectDesc)
197 buf.EncodeBool(m.EnableGso)
198 buf.EncodeBool(m.EnablePacked)
199 buf.EncodeBool(m.EnableEventIdx)
200 buf.EncodeUint32(m.CustomDevInstance)
201 buf.EncodeBool(m.UseCustomMac)
202 buf.EncodeBytes(m.MacAddress[:], 6)
203 buf.EncodeString(m.Tag, 64)
204 return buf.Bytes(), nil
206 func (m *CreateVhostUserIfV2) Unmarshal(b []byte) error {
207 buf := codec.NewBuffer(b)
208 m.IsServer = buf.DecodeBool()
209 m.SockFilename = buf.DecodeString(256)
210 m.Renumber = buf.DecodeBool()
211 m.DisableMrgRxbuf = buf.DecodeBool()
212 m.DisableIndirectDesc = buf.DecodeBool()
213 m.EnableGso = buf.DecodeBool()
214 m.EnablePacked = buf.DecodeBool()
215 m.EnableEventIdx = buf.DecodeBool()
216 m.CustomDevInstance = buf.DecodeUint32()
217 m.UseCustomMac = buf.DecodeBool()
218 copy(m.MacAddress[:], buf.DecodeBytes(6))
219 m.Tag = buf.DecodeString(64)
223 // CreateVhostUserIfV2Reply defines message 'create_vhost_user_if_v2_reply'.
224 type CreateVhostUserIfV2Reply struct {
225 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
226 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
229 func (m *CreateVhostUserIfV2Reply) Reset() { *m = CreateVhostUserIfV2Reply{} }
230 func (*CreateVhostUserIfV2Reply) GetMessageName() string { return "create_vhost_user_if_v2_reply" }
231 func (*CreateVhostUserIfV2Reply) GetCrcString() string { return "5383d31f" }
232 func (*CreateVhostUserIfV2Reply) GetMessageType() api.MessageType {
233 return api.ReplyMessage
236 func (m *CreateVhostUserIfV2Reply) Size() (size int) {
240 size += 4 // m.Retval
241 size += 4 // m.SwIfIndex
244 func (m *CreateVhostUserIfV2Reply) Marshal(b []byte) ([]byte, error) {
246 b = make([]byte, m.Size())
248 buf := codec.NewBuffer(b)
249 buf.EncodeInt32(m.Retval)
250 buf.EncodeUint32(uint32(m.SwIfIndex))
251 return buf.Bytes(), nil
253 func (m *CreateVhostUserIfV2Reply) Unmarshal(b []byte) error {
254 buf := codec.NewBuffer(b)
255 m.Retval = buf.DecodeInt32()
256 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
260 // DeleteVhostUserIf defines message 'delete_vhost_user_if'.
261 type DeleteVhostUserIf struct {
262 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
265 func (m *DeleteVhostUserIf) Reset() { *m = DeleteVhostUserIf{} }
266 func (*DeleteVhostUserIf) GetMessageName() string { return "delete_vhost_user_if" }
267 func (*DeleteVhostUserIf) GetCrcString() string { return "f9e6675e" }
268 func (*DeleteVhostUserIf) GetMessageType() api.MessageType {
269 return api.RequestMessage
272 func (m *DeleteVhostUserIf) Size() (size int) {
276 size += 4 // m.SwIfIndex
279 func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) {
281 b = make([]byte, m.Size())
283 buf := codec.NewBuffer(b)
284 buf.EncodeUint32(uint32(m.SwIfIndex))
285 return buf.Bytes(), nil
287 func (m *DeleteVhostUserIf) Unmarshal(b []byte) error {
288 buf := codec.NewBuffer(b)
289 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
293 // DeleteVhostUserIfReply defines message 'delete_vhost_user_if_reply'.
294 type DeleteVhostUserIfReply struct {
295 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
298 func (m *DeleteVhostUserIfReply) Reset() { *m = DeleteVhostUserIfReply{} }
299 func (*DeleteVhostUserIfReply) GetMessageName() string { return "delete_vhost_user_if_reply" }
300 func (*DeleteVhostUserIfReply) GetCrcString() string { return "e8d4e804" }
301 func (*DeleteVhostUserIfReply) GetMessageType() api.MessageType {
302 return api.ReplyMessage
305 func (m *DeleteVhostUserIfReply) Size() (size int) {
309 size += 4 // m.Retval
312 func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
314 b = make([]byte, m.Size())
316 buf := codec.NewBuffer(b)
317 buf.EncodeInt32(m.Retval)
318 return buf.Bytes(), nil
320 func (m *DeleteVhostUserIfReply) Unmarshal(b []byte) error {
321 buf := codec.NewBuffer(b)
322 m.Retval = buf.DecodeInt32()
326 // ModifyVhostUserIf defines message 'modify_vhost_user_if'.
327 // Deprecated: the message will be removed in the future versions
328 type ModifyVhostUserIf struct {
329 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
330 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
331 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
332 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
333 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
334 EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"`
335 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
338 func (m *ModifyVhostUserIf) Reset() { *m = ModifyVhostUserIf{} }
339 func (*ModifyVhostUserIf) GetMessageName() string { return "modify_vhost_user_if" }
340 func (*ModifyVhostUserIf) GetCrcString() string { return "0e71d40b" }
341 func (*ModifyVhostUserIf) GetMessageType() api.MessageType {
342 return api.RequestMessage
345 func (m *ModifyVhostUserIf) Size() (size int) {
349 size += 4 // m.SwIfIndex
350 size += 1 // m.IsServer
351 size += 256 // m.SockFilename
352 size += 1 // m.Renumber
353 size += 1 // m.EnableGso
354 size += 1 // m.EnablePacked
355 size += 4 // m.CustomDevInstance
358 func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) {
360 b = make([]byte, m.Size())
362 buf := codec.NewBuffer(b)
363 buf.EncodeUint32(uint32(m.SwIfIndex))
364 buf.EncodeBool(m.IsServer)
365 buf.EncodeString(m.SockFilename, 256)
366 buf.EncodeBool(m.Renumber)
367 buf.EncodeBool(m.EnableGso)
368 buf.EncodeBool(m.EnablePacked)
369 buf.EncodeUint32(m.CustomDevInstance)
370 return buf.Bytes(), nil
372 func (m *ModifyVhostUserIf) Unmarshal(b []byte) error {
373 buf := codec.NewBuffer(b)
374 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
375 m.IsServer = buf.DecodeBool()
376 m.SockFilename = buf.DecodeString(256)
377 m.Renumber = buf.DecodeBool()
378 m.EnableGso = buf.DecodeBool()
379 m.EnablePacked = buf.DecodeBool()
380 m.CustomDevInstance = buf.DecodeUint32()
384 // ModifyVhostUserIfReply defines message 'modify_vhost_user_if_reply'.
385 // Deprecated: the message will be removed in the future versions
386 type ModifyVhostUserIfReply struct {
387 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
390 func (m *ModifyVhostUserIfReply) Reset() { *m = ModifyVhostUserIfReply{} }
391 func (*ModifyVhostUserIfReply) GetMessageName() string { return "modify_vhost_user_if_reply" }
392 func (*ModifyVhostUserIfReply) GetCrcString() string { return "e8d4e804" }
393 func (*ModifyVhostUserIfReply) GetMessageType() api.MessageType {
394 return api.ReplyMessage
397 func (m *ModifyVhostUserIfReply) Size() (size int) {
401 size += 4 // m.Retval
404 func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) {
406 b = make([]byte, m.Size())
408 buf := codec.NewBuffer(b)
409 buf.EncodeInt32(m.Retval)
410 return buf.Bytes(), nil
412 func (m *ModifyVhostUserIfReply) Unmarshal(b []byte) error {
413 buf := codec.NewBuffer(b)
414 m.Retval = buf.DecodeInt32()
418 // ModifyVhostUserIfV2 defines message 'modify_vhost_user_if_v2'.
419 type ModifyVhostUserIfV2 struct {
420 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
421 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
422 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
423 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
424 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
425 EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"`
426 EnableEventIdx bool `binapi:"bool,name=enable_event_idx" json:"enable_event_idx,omitempty"`
427 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
430 func (m *ModifyVhostUserIfV2) Reset() { *m = ModifyVhostUserIfV2{} }
431 func (*ModifyVhostUserIfV2) GetMessageName() string { return "modify_vhost_user_if_v2" }
432 func (*ModifyVhostUserIfV2) GetCrcString() string { return "b2483771" }
433 func (*ModifyVhostUserIfV2) GetMessageType() api.MessageType {
434 return api.RequestMessage
437 func (m *ModifyVhostUserIfV2) Size() (size int) {
441 size += 4 // m.SwIfIndex
442 size += 1 // m.IsServer
443 size += 256 // m.SockFilename
444 size += 1 // m.Renumber
445 size += 1 // m.EnableGso
446 size += 1 // m.EnablePacked
447 size += 1 // m.EnableEventIdx
448 size += 4 // m.CustomDevInstance
451 func (m *ModifyVhostUserIfV2) Marshal(b []byte) ([]byte, error) {
453 b = make([]byte, m.Size())
455 buf := codec.NewBuffer(b)
456 buf.EncodeUint32(uint32(m.SwIfIndex))
457 buf.EncodeBool(m.IsServer)
458 buf.EncodeString(m.SockFilename, 256)
459 buf.EncodeBool(m.Renumber)
460 buf.EncodeBool(m.EnableGso)
461 buf.EncodeBool(m.EnablePacked)
462 buf.EncodeBool(m.EnableEventIdx)
463 buf.EncodeUint32(m.CustomDevInstance)
464 return buf.Bytes(), nil
466 func (m *ModifyVhostUserIfV2) Unmarshal(b []byte) error {
467 buf := codec.NewBuffer(b)
468 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
469 m.IsServer = buf.DecodeBool()
470 m.SockFilename = buf.DecodeString(256)
471 m.Renumber = buf.DecodeBool()
472 m.EnableGso = buf.DecodeBool()
473 m.EnablePacked = buf.DecodeBool()
474 m.EnableEventIdx = buf.DecodeBool()
475 m.CustomDevInstance = buf.DecodeUint32()
479 // ModifyVhostUserIfV2Reply defines message 'modify_vhost_user_if_v2_reply'.
480 type ModifyVhostUserIfV2Reply struct {
481 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
484 func (m *ModifyVhostUserIfV2Reply) Reset() { *m = ModifyVhostUserIfV2Reply{} }
485 func (*ModifyVhostUserIfV2Reply) GetMessageName() string { return "modify_vhost_user_if_v2_reply" }
486 func (*ModifyVhostUserIfV2Reply) GetCrcString() string { return "e8d4e804" }
487 func (*ModifyVhostUserIfV2Reply) GetMessageType() api.MessageType {
488 return api.ReplyMessage
491 func (m *ModifyVhostUserIfV2Reply) Size() (size int) {
495 size += 4 // m.Retval
498 func (m *ModifyVhostUserIfV2Reply) Marshal(b []byte) ([]byte, error) {
500 b = make([]byte, m.Size())
502 buf := codec.NewBuffer(b)
503 buf.EncodeInt32(m.Retval)
504 return buf.Bytes(), nil
506 func (m *ModifyVhostUserIfV2Reply) Unmarshal(b []byte) error {
507 buf := codec.NewBuffer(b)
508 m.Retval = buf.DecodeInt32()
512 // SwInterfaceVhostUserDetails defines message 'sw_interface_vhost_user_details'.
513 type SwInterfaceVhostUserDetails struct {
514 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
515 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
516 VirtioNetHdrSz uint32 `binapi:"u32,name=virtio_net_hdr_sz" json:"virtio_net_hdr_sz,omitempty"`
517 FeaturesFirst32 virtio_types.VirtioNetFeaturesFirst32 `binapi:"virtio_net_features_first_32,name=features_first_32" json:"features_first_32,omitempty"`
518 FeaturesLast32 virtio_types.VirtioNetFeaturesLast32 `binapi:"virtio_net_features_last_32,name=features_last_32" json:"features_last_32,omitempty"`
519 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
520 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
521 NumRegions uint32 `binapi:"u32,name=num_regions" json:"num_regions,omitempty"`
522 SockErrno int32 `binapi:"i32,name=sock_errno" json:"sock_errno,omitempty"`
525 func (m *SwInterfaceVhostUserDetails) Reset() { *m = SwInterfaceVhostUserDetails{} }
526 func (*SwInterfaceVhostUserDetails) GetMessageName() string { return "sw_interface_vhost_user_details" }
527 func (*SwInterfaceVhostUserDetails) GetCrcString() string { return "0cee1e53" }
528 func (*SwInterfaceVhostUserDetails) GetMessageType() api.MessageType {
529 return api.ReplyMessage
532 func (m *SwInterfaceVhostUserDetails) Size() (size int) {
536 size += 4 // m.SwIfIndex
537 size += 64 // m.InterfaceName
538 size += 4 // m.VirtioNetHdrSz
539 size += 4 // m.FeaturesFirst32
540 size += 4 // m.FeaturesLast32
541 size += 1 // m.IsServer
542 size += 256 // m.SockFilename
543 size += 4 // m.NumRegions
544 size += 4 // m.SockErrno
547 func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) {
549 b = make([]byte, m.Size())
551 buf := codec.NewBuffer(b)
552 buf.EncodeUint32(uint32(m.SwIfIndex))
553 buf.EncodeString(m.InterfaceName, 64)
554 buf.EncodeUint32(m.VirtioNetHdrSz)
555 buf.EncodeUint32(uint32(m.FeaturesFirst32))
556 buf.EncodeUint32(uint32(m.FeaturesLast32))
557 buf.EncodeBool(m.IsServer)
558 buf.EncodeString(m.SockFilename, 256)
559 buf.EncodeUint32(m.NumRegions)
560 buf.EncodeInt32(m.SockErrno)
561 return buf.Bytes(), nil
563 func (m *SwInterfaceVhostUserDetails) Unmarshal(b []byte) error {
564 buf := codec.NewBuffer(b)
565 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
566 m.InterfaceName = buf.DecodeString(64)
567 m.VirtioNetHdrSz = buf.DecodeUint32()
568 m.FeaturesFirst32 = virtio_types.VirtioNetFeaturesFirst32(buf.DecodeUint32())
569 m.FeaturesLast32 = virtio_types.VirtioNetFeaturesLast32(buf.DecodeUint32())
570 m.IsServer = buf.DecodeBool()
571 m.SockFilename = buf.DecodeString(256)
572 m.NumRegions = buf.DecodeUint32()
573 m.SockErrno = buf.DecodeInt32()
577 // SwInterfaceVhostUserDump defines message 'sw_interface_vhost_user_dump'.
578 type SwInterfaceVhostUserDump struct {
579 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
582 func (m *SwInterfaceVhostUserDump) Reset() { *m = SwInterfaceVhostUserDump{} }
583 func (*SwInterfaceVhostUserDump) GetMessageName() string { return "sw_interface_vhost_user_dump" }
584 func (*SwInterfaceVhostUserDump) GetCrcString() string { return "f9e6675e" }
585 func (*SwInterfaceVhostUserDump) GetMessageType() api.MessageType {
586 return api.RequestMessage
589 func (m *SwInterfaceVhostUserDump) Size() (size int) {
593 size += 4 // m.SwIfIndex
596 func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) {
598 b = make([]byte, m.Size())
600 buf := codec.NewBuffer(b)
601 buf.EncodeUint32(uint32(m.SwIfIndex))
602 return buf.Bytes(), nil
604 func (m *SwInterfaceVhostUserDump) Unmarshal(b []byte) error {
605 buf := codec.NewBuffer(b)
606 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
610 func init() { file_vhost_user_binapi_init() }
611 func file_vhost_user_binapi_init() {
612 api.RegisterMessage((*CreateVhostUserIf)(nil), "create_vhost_user_if_c785c6fc")
613 api.RegisterMessage((*CreateVhostUserIfReply)(nil), "create_vhost_user_if_reply_5383d31f")
614 api.RegisterMessage((*CreateVhostUserIfV2)(nil), "create_vhost_user_if_v2_dba1cc1d")
615 api.RegisterMessage((*CreateVhostUserIfV2Reply)(nil), "create_vhost_user_if_v2_reply_5383d31f")
616 api.RegisterMessage((*DeleteVhostUserIf)(nil), "delete_vhost_user_if_f9e6675e")
617 api.RegisterMessage((*DeleteVhostUserIfReply)(nil), "delete_vhost_user_if_reply_e8d4e804")
618 api.RegisterMessage((*ModifyVhostUserIf)(nil), "modify_vhost_user_if_0e71d40b")
619 api.RegisterMessage((*ModifyVhostUserIfReply)(nil), "modify_vhost_user_if_reply_e8d4e804")
620 api.RegisterMessage((*ModifyVhostUserIfV2)(nil), "modify_vhost_user_if_v2_b2483771")
621 api.RegisterMessage((*ModifyVhostUserIfV2Reply)(nil), "modify_vhost_user_if_v2_reply_e8d4e804")
622 api.RegisterMessage((*SwInterfaceVhostUserDetails)(nil), "sw_interface_vhost_user_details_0cee1e53")
623 api.RegisterMessage((*SwInterfaceVhostUserDump)(nil), "sw_interface_vhost_user_dump_f9e6675e")
626 // Messages returns list of all messages in this module.
627 func AllMessages() []api.Message {
628 return []api.Message{
629 (*CreateVhostUserIf)(nil),
630 (*CreateVhostUserIfReply)(nil),
631 (*CreateVhostUserIfV2)(nil),
632 (*CreateVhostUserIfV2Reply)(nil),
633 (*DeleteVhostUserIf)(nil),
634 (*DeleteVhostUserIfReply)(nil),
635 (*ModifyVhostUserIf)(nil),
636 (*ModifyVhostUserIfReply)(nil),
637 (*ModifyVhostUserIfV2)(nil),
638 (*ModifyVhostUserIfV2Reply)(nil),
639 (*SwInterfaceVhostUserDetails)(nil),
640 (*SwInterfaceVhostUserDump)(nil),