github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/vhost_user/vhost_user.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.4.0-dev 4 // VPP: 23.02-rc0~189-g57127b32a 5 // source: /usr/share/vpp/api/plugins/vhost_user.api.json 6 7 // Package vhost_user contains generated bindings for API file vhost_user.api. 8 // 9 // Contents: 10 // 12 messages 11 // 12 package vhost_user 13 14 import ( 15 api "git.fd.io/govpp.git/api" 16 codec "git.fd.io/govpp.git/codec" 17 ethernet_types "github.com/edwarnicke/govpp/binapi/ethernet_types" 18 interface_types "github.com/edwarnicke/govpp/binapi/interface_types" 19 virtio_types "github.com/edwarnicke/govpp/binapi/virtio_types" 20 ) 21 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 27 28 const ( 29 APIFile = "vhost_user" 30 APIVersion = "4.1.1" 31 VersionCrc = 0xd49ae8cd 32 ) 33 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"` 48 } 49 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 55 } 56 57 func (m *CreateVhostUserIf) Size() (size int) { 58 if m == nil { 59 return 0 60 } 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 71 size += 64 // m.Tag 72 return size 73 } 74 func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) { 75 if b == nil { 76 b = make([]byte, m.Size()) 77 } 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 91 } 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) 105 return nil 106 } 107 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"` 113 } 114 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 120 } 121 122 func (m *CreateVhostUserIfReply) Size() (size int) { 123 if m == nil { 124 return 0 125 } 126 size += 4 // m.Retval 127 size += 4 // m.SwIfIndex 128 return size 129 } 130 func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) { 131 if b == nil { 132 b = make([]byte, m.Size()) 133 } 134 buf := codec.NewBuffer(b) 135 buf.EncodeInt32(m.Retval) 136 buf.EncodeUint32(uint32(m.SwIfIndex)) 137 return buf.Bytes(), nil 138 } 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()) 143 return nil 144 } 145 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"` 160 } 161 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 167 } 168 169 func (m *CreateVhostUserIfV2) Size() (size int) { 170 if m == nil { 171 return 0 172 } 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 184 size += 64 // m.Tag 185 return size 186 } 187 func (m *CreateVhostUserIfV2) Marshal(b []byte) ([]byte, error) { 188 if b == nil { 189 b = make([]byte, m.Size()) 190 } 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 205 } 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) 220 return nil 221 } 222 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"` 227 } 228 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 234 } 235 236 func (m *CreateVhostUserIfV2Reply) Size() (size int) { 237 if m == nil { 238 return 0 239 } 240 size += 4 // m.Retval 241 size += 4 // m.SwIfIndex 242 return size 243 } 244 func (m *CreateVhostUserIfV2Reply) Marshal(b []byte) ([]byte, error) { 245 if b == nil { 246 b = make([]byte, m.Size()) 247 } 248 buf := codec.NewBuffer(b) 249 buf.EncodeInt32(m.Retval) 250 buf.EncodeUint32(uint32(m.SwIfIndex)) 251 return buf.Bytes(), nil 252 } 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()) 257 return nil 258 } 259 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"` 263 } 264 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 270 } 271 272 func (m *DeleteVhostUserIf) Size() (size int) { 273 if m == nil { 274 return 0 275 } 276 size += 4 // m.SwIfIndex 277 return size 278 } 279 func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) { 280 if b == nil { 281 b = make([]byte, m.Size()) 282 } 283 buf := codec.NewBuffer(b) 284 buf.EncodeUint32(uint32(m.SwIfIndex)) 285 return buf.Bytes(), nil 286 } 287 func (m *DeleteVhostUserIf) Unmarshal(b []byte) error { 288 buf := codec.NewBuffer(b) 289 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 290 return nil 291 } 292 293 // DeleteVhostUserIfReply defines message 'delete_vhost_user_if_reply'. 294 type DeleteVhostUserIfReply struct { 295 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 296 } 297 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 303 } 304 305 func (m *DeleteVhostUserIfReply) Size() (size int) { 306 if m == nil { 307 return 0 308 } 309 size += 4 // m.Retval 310 return size 311 } 312 func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) { 313 if b == nil { 314 b = make([]byte, m.Size()) 315 } 316 buf := codec.NewBuffer(b) 317 buf.EncodeInt32(m.Retval) 318 return buf.Bytes(), nil 319 } 320 func (m *DeleteVhostUserIfReply) Unmarshal(b []byte) error { 321 buf := codec.NewBuffer(b) 322 m.Retval = buf.DecodeInt32() 323 return nil 324 } 325 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"` 336 } 337 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 343 } 344 345 func (m *ModifyVhostUserIf) Size() (size int) { 346 if m == nil { 347 return 0 348 } 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 356 return size 357 } 358 func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) { 359 if b == nil { 360 b = make([]byte, m.Size()) 361 } 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 371 } 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() 381 return nil 382 } 383 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"` 388 } 389 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 395 } 396 397 func (m *ModifyVhostUserIfReply) Size() (size int) { 398 if m == nil { 399 return 0 400 } 401 size += 4 // m.Retval 402 return size 403 } 404 func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) { 405 if b == nil { 406 b = make([]byte, m.Size()) 407 } 408 buf := codec.NewBuffer(b) 409 buf.EncodeInt32(m.Retval) 410 return buf.Bytes(), nil 411 } 412 func (m *ModifyVhostUserIfReply) Unmarshal(b []byte) error { 413 buf := codec.NewBuffer(b) 414 m.Retval = buf.DecodeInt32() 415 return nil 416 } 417 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"` 428 } 429 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 435 } 436 437 func (m *ModifyVhostUserIfV2) Size() (size int) { 438 if m == nil { 439 return 0 440 } 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 449 return size 450 } 451 func (m *ModifyVhostUserIfV2) Marshal(b []byte) ([]byte, error) { 452 if b == nil { 453 b = make([]byte, m.Size()) 454 } 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 465 } 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() 476 return nil 477 } 478 479 // ModifyVhostUserIfV2Reply defines message 'modify_vhost_user_if_v2_reply'. 480 type ModifyVhostUserIfV2Reply struct { 481 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 482 } 483 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 489 } 490 491 func (m *ModifyVhostUserIfV2Reply) Size() (size int) { 492 if m == nil { 493 return 0 494 } 495 size += 4 // m.Retval 496 return size 497 } 498 func (m *ModifyVhostUserIfV2Reply) Marshal(b []byte) ([]byte, error) { 499 if b == nil { 500 b = make([]byte, m.Size()) 501 } 502 buf := codec.NewBuffer(b) 503 buf.EncodeInt32(m.Retval) 504 return buf.Bytes(), nil 505 } 506 func (m *ModifyVhostUserIfV2Reply) Unmarshal(b []byte) error { 507 buf := codec.NewBuffer(b) 508 m.Retval = buf.DecodeInt32() 509 return nil 510 } 511 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"` 523 } 524 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 530 } 531 532 func (m *SwInterfaceVhostUserDetails) Size() (size int) { 533 if m == nil { 534 return 0 535 } 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 545 return size 546 } 547 func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) { 548 if b == nil { 549 b = make([]byte, m.Size()) 550 } 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 562 } 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() 574 return nil 575 } 576 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"` 580 } 581 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 587 } 588 589 func (m *SwInterfaceVhostUserDump) Size() (size int) { 590 if m == nil { 591 return 0 592 } 593 size += 4 // m.SwIfIndex 594 return size 595 } 596 func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) { 597 if b == nil { 598 b = make([]byte, m.Size()) 599 } 600 buf := codec.NewBuffer(b) 601 buf.EncodeUint32(uint32(m.SwIfIndex)) 602 return buf.Bytes(), nil 603 } 604 func (m *SwInterfaceVhostUserDump) Unmarshal(b []byte) error { 605 buf := codec.NewBuffer(b) 606 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 607 return nil 608 } 609 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") 624 } 625 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), 641 } 642 }