github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/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.10.0-dev 4 // VPP: 23.10-rc0~170-g6f1548434 5 // source: 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 package vhost_user 12 13 import ( 14 ethernet_types "github.com/networkservicemesh/govpp/binapi/ethernet_types" 15 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 16 virtio_types "github.com/networkservicemesh/govpp/binapi/virtio_types" 17 api "go.fd.io/govpp/api" 18 codec "go.fd.io/govpp/codec" 19 ) 20 21 // This is a compile-time assertion to ensure that this generated file 22 // is compatible with the GoVPP api package it is being compiled against. 23 // A compilation error at this line likely means your copy of the 24 // GoVPP api package needs to be updated. 25 const _ = api.GoVppAPIPackageIsVersion2 26 27 const ( 28 APIFile = "vhost_user" 29 APIVersion = "4.1.1" 30 VersionCrc = 0xd49ae8cd 31 ) 32 33 // vhost-user interface create request 34 // - is_server - our side is socket server 35 // - sock_filename - unix socket filename, used to speak with frontend 36 // - use_custom_mac - enable or disable the use of the provided hardware address 37 // - disable_mrg_rxbuf - disable the use of merge receive buffers 38 // - disable_indirect_desc - disable the use of indirect descriptors which driver can use 39 // - enable_gso - enable gso support (default 0) 40 // - enable_packed - enable packed ring support (default 0) 41 // - mac_address - hardware address to use if 'use_custom_mac' is set 42 // 43 // CreateVhostUserIf defines message 'create_vhost_user_if'. 44 // Deprecated: the message will be removed in the future versions 45 type CreateVhostUserIf struct { 46 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"` 47 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"` 48 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"` 49 DisableMrgRxbuf bool `binapi:"bool,name=disable_mrg_rxbuf" json:"disable_mrg_rxbuf,omitempty"` 50 DisableIndirectDesc bool `binapi:"bool,name=disable_indirect_desc" json:"disable_indirect_desc,omitempty"` 51 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"` 52 EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"` 53 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"` 54 UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"` 55 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"` 56 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` 57 } 58 59 func (m *CreateVhostUserIf) Reset() { *m = CreateVhostUserIf{} } 60 func (*CreateVhostUserIf) GetMessageName() string { return "create_vhost_user_if" } 61 func (*CreateVhostUserIf) GetCrcString() string { return "c785c6fc" } 62 func (*CreateVhostUserIf) GetMessageType() api.MessageType { 63 return api.RequestMessage 64 } 65 66 func (m *CreateVhostUserIf) Size() (size int) { 67 if m == nil { 68 return 0 69 } 70 size += 1 // m.IsServer 71 size += 256 // m.SockFilename 72 size += 1 // m.Renumber 73 size += 1 // m.DisableMrgRxbuf 74 size += 1 // m.DisableIndirectDesc 75 size += 1 // m.EnableGso 76 size += 1 // m.EnablePacked 77 size += 4 // m.CustomDevInstance 78 size += 1 // m.UseCustomMac 79 size += 1 * 6 // m.MacAddress 80 size += 64 // m.Tag 81 return size 82 } 83 func (m *CreateVhostUserIf) Marshal(b []byte) ([]byte, error) { 84 if b == nil { 85 b = make([]byte, m.Size()) 86 } 87 buf := codec.NewBuffer(b) 88 buf.EncodeBool(m.IsServer) 89 buf.EncodeString(m.SockFilename, 256) 90 buf.EncodeBool(m.Renumber) 91 buf.EncodeBool(m.DisableMrgRxbuf) 92 buf.EncodeBool(m.DisableIndirectDesc) 93 buf.EncodeBool(m.EnableGso) 94 buf.EncodeBool(m.EnablePacked) 95 buf.EncodeUint32(m.CustomDevInstance) 96 buf.EncodeBool(m.UseCustomMac) 97 buf.EncodeBytes(m.MacAddress[:], 6) 98 buf.EncodeString(m.Tag, 64) 99 return buf.Bytes(), nil 100 } 101 func (m *CreateVhostUserIf) Unmarshal(b []byte) error { 102 buf := codec.NewBuffer(b) 103 m.IsServer = buf.DecodeBool() 104 m.SockFilename = buf.DecodeString(256) 105 m.Renumber = buf.DecodeBool() 106 m.DisableMrgRxbuf = buf.DecodeBool() 107 m.DisableIndirectDesc = buf.DecodeBool() 108 m.EnableGso = buf.DecodeBool() 109 m.EnablePacked = buf.DecodeBool() 110 m.CustomDevInstance = buf.DecodeUint32() 111 m.UseCustomMac = buf.DecodeBool() 112 copy(m.MacAddress[:], buf.DecodeBytes(6)) 113 m.Tag = buf.DecodeString(64) 114 return nil 115 } 116 117 // vhost-user interface create response 118 // - retval - return code for the request 119 // - sw_if_index - interface the operation is applied to 120 // 121 // CreateVhostUserIfReply defines message 'create_vhost_user_if_reply'. 122 // Deprecated: the message will be removed in the future versions 123 type CreateVhostUserIfReply struct { 124 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 125 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 126 } 127 128 func (m *CreateVhostUserIfReply) Reset() { *m = CreateVhostUserIfReply{} } 129 func (*CreateVhostUserIfReply) GetMessageName() string { return "create_vhost_user_if_reply" } 130 func (*CreateVhostUserIfReply) GetCrcString() string { return "5383d31f" } 131 func (*CreateVhostUserIfReply) GetMessageType() api.MessageType { 132 return api.ReplyMessage 133 } 134 135 func (m *CreateVhostUserIfReply) Size() (size int) { 136 if m == nil { 137 return 0 138 } 139 size += 4 // m.Retval 140 size += 4 // m.SwIfIndex 141 return size 142 } 143 func (m *CreateVhostUserIfReply) Marshal(b []byte) ([]byte, error) { 144 if b == nil { 145 b = make([]byte, m.Size()) 146 } 147 buf := codec.NewBuffer(b) 148 buf.EncodeInt32(m.Retval) 149 buf.EncodeUint32(uint32(m.SwIfIndex)) 150 return buf.Bytes(), nil 151 } 152 func (m *CreateVhostUserIfReply) Unmarshal(b []byte) error { 153 buf := codec.NewBuffer(b) 154 m.Retval = buf.DecodeInt32() 155 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 156 return nil 157 } 158 159 // vhost-user interface create request 160 // - is_server - our side is socket server 161 // - sock_filename - unix socket filename, used to speak with frontend 162 // - use_custom_mac - enable or disable the use of the provided hardware address 163 // - disable_mrg_rxbuf - disable the use of merge receive buffers 164 // - disable_indirect_desc - disable the use of indirect descriptors which driver can use 165 // - enable_gso - enable gso support (default 0) 166 // - enable_packed - enable packed ring support (default 0) 167 // - enable_event_idx - enable event_idx support (default 0) 168 // - mac_address - hardware address to use if 'use_custom_mac' is set 169 // - renumber - if true, use custom_dev_instance is valid 170 // - custom_dev_instance - custom device instance number 171 // 172 // CreateVhostUserIfV2 defines message 'create_vhost_user_if_v2'. 173 type CreateVhostUserIfV2 struct { 174 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"` 175 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"` 176 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"` 177 DisableMrgRxbuf bool `binapi:"bool,name=disable_mrg_rxbuf" json:"disable_mrg_rxbuf,omitempty"` 178 DisableIndirectDesc bool `binapi:"bool,name=disable_indirect_desc" json:"disable_indirect_desc,omitempty"` 179 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"` 180 EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"` 181 EnableEventIdx bool `binapi:"bool,name=enable_event_idx" json:"enable_event_idx,omitempty"` 182 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"` 183 UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"` 184 MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"` 185 Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` 186 } 187 188 func (m *CreateVhostUserIfV2) Reset() { *m = CreateVhostUserIfV2{} } 189 func (*CreateVhostUserIfV2) GetMessageName() string { return "create_vhost_user_if_v2" } 190 func (*CreateVhostUserIfV2) GetCrcString() string { return "dba1cc1d" } 191 func (*CreateVhostUserIfV2) GetMessageType() api.MessageType { 192 return api.RequestMessage 193 } 194 195 func (m *CreateVhostUserIfV2) Size() (size int) { 196 if m == nil { 197 return 0 198 } 199 size += 1 // m.IsServer 200 size += 256 // m.SockFilename 201 size += 1 // m.Renumber 202 size += 1 // m.DisableMrgRxbuf 203 size += 1 // m.DisableIndirectDesc 204 size += 1 // m.EnableGso 205 size += 1 // m.EnablePacked 206 size += 1 // m.EnableEventIdx 207 size += 4 // m.CustomDevInstance 208 size += 1 // m.UseCustomMac 209 size += 1 * 6 // m.MacAddress 210 size += 64 // m.Tag 211 return size 212 } 213 func (m *CreateVhostUserIfV2) Marshal(b []byte) ([]byte, error) { 214 if b == nil { 215 b = make([]byte, m.Size()) 216 } 217 buf := codec.NewBuffer(b) 218 buf.EncodeBool(m.IsServer) 219 buf.EncodeString(m.SockFilename, 256) 220 buf.EncodeBool(m.Renumber) 221 buf.EncodeBool(m.DisableMrgRxbuf) 222 buf.EncodeBool(m.DisableIndirectDesc) 223 buf.EncodeBool(m.EnableGso) 224 buf.EncodeBool(m.EnablePacked) 225 buf.EncodeBool(m.EnableEventIdx) 226 buf.EncodeUint32(m.CustomDevInstance) 227 buf.EncodeBool(m.UseCustomMac) 228 buf.EncodeBytes(m.MacAddress[:], 6) 229 buf.EncodeString(m.Tag, 64) 230 return buf.Bytes(), nil 231 } 232 func (m *CreateVhostUserIfV2) Unmarshal(b []byte) error { 233 buf := codec.NewBuffer(b) 234 m.IsServer = buf.DecodeBool() 235 m.SockFilename = buf.DecodeString(256) 236 m.Renumber = buf.DecodeBool() 237 m.DisableMrgRxbuf = buf.DecodeBool() 238 m.DisableIndirectDesc = buf.DecodeBool() 239 m.EnableGso = buf.DecodeBool() 240 m.EnablePacked = buf.DecodeBool() 241 m.EnableEventIdx = buf.DecodeBool() 242 m.CustomDevInstance = buf.DecodeUint32() 243 m.UseCustomMac = buf.DecodeBool() 244 copy(m.MacAddress[:], buf.DecodeBytes(6)) 245 m.Tag = buf.DecodeString(64) 246 return nil 247 } 248 249 // vhost-user interface create response 250 // - retval - return code for the request 251 // - sw_if_index - interface the operation is applied to 252 // 253 // CreateVhostUserIfV2Reply defines message 'create_vhost_user_if_v2_reply'. 254 type CreateVhostUserIfV2Reply struct { 255 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 256 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 257 } 258 259 func (m *CreateVhostUserIfV2Reply) Reset() { *m = CreateVhostUserIfV2Reply{} } 260 func (*CreateVhostUserIfV2Reply) GetMessageName() string { return "create_vhost_user_if_v2_reply" } 261 func (*CreateVhostUserIfV2Reply) GetCrcString() string { return "5383d31f" } 262 func (*CreateVhostUserIfV2Reply) GetMessageType() api.MessageType { 263 return api.ReplyMessage 264 } 265 266 func (m *CreateVhostUserIfV2Reply) Size() (size int) { 267 if m == nil { 268 return 0 269 } 270 size += 4 // m.Retval 271 size += 4 // m.SwIfIndex 272 return size 273 } 274 func (m *CreateVhostUserIfV2Reply) Marshal(b []byte) ([]byte, error) { 275 if b == nil { 276 b = make([]byte, m.Size()) 277 } 278 buf := codec.NewBuffer(b) 279 buf.EncodeInt32(m.Retval) 280 buf.EncodeUint32(uint32(m.SwIfIndex)) 281 return buf.Bytes(), nil 282 } 283 func (m *CreateVhostUserIfV2Reply) Unmarshal(b []byte) error { 284 buf := codec.NewBuffer(b) 285 m.Retval = buf.DecodeInt32() 286 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 287 return nil 288 } 289 290 // vhost-user interface delete request 291 // DeleteVhostUserIf defines message 'delete_vhost_user_if'. 292 type DeleteVhostUserIf struct { 293 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 294 } 295 296 func (m *DeleteVhostUserIf) Reset() { *m = DeleteVhostUserIf{} } 297 func (*DeleteVhostUserIf) GetMessageName() string { return "delete_vhost_user_if" } 298 func (*DeleteVhostUserIf) GetCrcString() string { return "f9e6675e" } 299 func (*DeleteVhostUserIf) GetMessageType() api.MessageType { 300 return api.RequestMessage 301 } 302 303 func (m *DeleteVhostUserIf) Size() (size int) { 304 if m == nil { 305 return 0 306 } 307 size += 4 // m.SwIfIndex 308 return size 309 } 310 func (m *DeleteVhostUserIf) Marshal(b []byte) ([]byte, error) { 311 if b == nil { 312 b = make([]byte, m.Size()) 313 } 314 buf := codec.NewBuffer(b) 315 buf.EncodeUint32(uint32(m.SwIfIndex)) 316 return buf.Bytes(), nil 317 } 318 func (m *DeleteVhostUserIf) Unmarshal(b []byte) error { 319 buf := codec.NewBuffer(b) 320 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 321 return nil 322 } 323 324 // DeleteVhostUserIfReply defines message 'delete_vhost_user_if_reply'. 325 type DeleteVhostUserIfReply struct { 326 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 327 } 328 329 func (m *DeleteVhostUserIfReply) Reset() { *m = DeleteVhostUserIfReply{} } 330 func (*DeleteVhostUserIfReply) GetMessageName() string { return "delete_vhost_user_if_reply" } 331 func (*DeleteVhostUserIfReply) GetCrcString() string { return "e8d4e804" } 332 func (*DeleteVhostUserIfReply) GetMessageType() api.MessageType { 333 return api.ReplyMessage 334 } 335 336 func (m *DeleteVhostUserIfReply) Size() (size int) { 337 if m == nil { 338 return 0 339 } 340 size += 4 // m.Retval 341 return size 342 } 343 func (m *DeleteVhostUserIfReply) Marshal(b []byte) ([]byte, error) { 344 if b == nil { 345 b = make([]byte, m.Size()) 346 } 347 buf := codec.NewBuffer(b) 348 buf.EncodeInt32(m.Retval) 349 return buf.Bytes(), nil 350 } 351 func (m *DeleteVhostUserIfReply) Unmarshal(b []byte) error { 352 buf := codec.NewBuffer(b) 353 m.Retval = buf.DecodeInt32() 354 return nil 355 } 356 357 // vhost-user interface modify request 358 // - is_server - our side is socket server 359 // - sock_filename - unix socket filename, used to speak with frontend 360 // - enable_gso - enable gso support (default 0) 361 // - enable_packed - enable packed ring support (default 0) 362 // 363 // ModifyVhostUserIf defines message 'modify_vhost_user_if'. 364 // Deprecated: the message will be removed in the future versions 365 type ModifyVhostUserIf struct { 366 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 367 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"` 368 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"` 369 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"` 370 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"` 371 EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"` 372 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"` 373 } 374 375 func (m *ModifyVhostUserIf) Reset() { *m = ModifyVhostUserIf{} } 376 func (*ModifyVhostUserIf) GetMessageName() string { return "modify_vhost_user_if" } 377 func (*ModifyVhostUserIf) GetCrcString() string { return "0e71d40b" } 378 func (*ModifyVhostUserIf) GetMessageType() api.MessageType { 379 return api.RequestMessage 380 } 381 382 func (m *ModifyVhostUserIf) Size() (size int) { 383 if m == nil { 384 return 0 385 } 386 size += 4 // m.SwIfIndex 387 size += 1 // m.IsServer 388 size += 256 // m.SockFilename 389 size += 1 // m.Renumber 390 size += 1 // m.EnableGso 391 size += 1 // m.EnablePacked 392 size += 4 // m.CustomDevInstance 393 return size 394 } 395 func (m *ModifyVhostUserIf) Marshal(b []byte) ([]byte, error) { 396 if b == nil { 397 b = make([]byte, m.Size()) 398 } 399 buf := codec.NewBuffer(b) 400 buf.EncodeUint32(uint32(m.SwIfIndex)) 401 buf.EncodeBool(m.IsServer) 402 buf.EncodeString(m.SockFilename, 256) 403 buf.EncodeBool(m.Renumber) 404 buf.EncodeBool(m.EnableGso) 405 buf.EncodeBool(m.EnablePacked) 406 buf.EncodeUint32(m.CustomDevInstance) 407 return buf.Bytes(), nil 408 } 409 func (m *ModifyVhostUserIf) Unmarshal(b []byte) error { 410 buf := codec.NewBuffer(b) 411 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 412 m.IsServer = buf.DecodeBool() 413 m.SockFilename = buf.DecodeString(256) 414 m.Renumber = buf.DecodeBool() 415 m.EnableGso = buf.DecodeBool() 416 m.EnablePacked = buf.DecodeBool() 417 m.CustomDevInstance = buf.DecodeUint32() 418 return nil 419 } 420 421 // ModifyVhostUserIfReply defines message 'modify_vhost_user_if_reply'. 422 // Deprecated: the message will be removed in the future versions 423 type ModifyVhostUserIfReply struct { 424 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 425 } 426 427 func (m *ModifyVhostUserIfReply) Reset() { *m = ModifyVhostUserIfReply{} } 428 func (*ModifyVhostUserIfReply) GetMessageName() string { return "modify_vhost_user_if_reply" } 429 func (*ModifyVhostUserIfReply) GetCrcString() string { return "e8d4e804" } 430 func (*ModifyVhostUserIfReply) GetMessageType() api.MessageType { 431 return api.ReplyMessage 432 } 433 434 func (m *ModifyVhostUserIfReply) Size() (size int) { 435 if m == nil { 436 return 0 437 } 438 size += 4 // m.Retval 439 return size 440 } 441 func (m *ModifyVhostUserIfReply) Marshal(b []byte) ([]byte, error) { 442 if b == nil { 443 b = make([]byte, m.Size()) 444 } 445 buf := codec.NewBuffer(b) 446 buf.EncodeInt32(m.Retval) 447 return buf.Bytes(), nil 448 } 449 func (m *ModifyVhostUserIfReply) Unmarshal(b []byte) error { 450 buf := codec.NewBuffer(b) 451 m.Retval = buf.DecodeInt32() 452 return nil 453 } 454 455 // vhost-user interface modify request 456 // - is_server - our side is socket server 457 // - sock_filename - unix socket filename, used to speak with frontend 458 // - enable_gso - enable gso support (default 0) 459 // - enable_packed - enable packed ring support (default 0) 460 // - enable_event_idx - enable event idx support (default 0) 461 // - renumber - if true, use custom_dev_instance is valid 462 // - custom_dev_instance - custom device instance number 463 // 464 // ModifyVhostUserIfV2 defines message 'modify_vhost_user_if_v2'. 465 type ModifyVhostUserIfV2 struct { 466 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 467 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"` 468 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"` 469 Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"` 470 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"` 471 EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"` 472 EnableEventIdx bool `binapi:"bool,name=enable_event_idx" json:"enable_event_idx,omitempty"` 473 CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"` 474 } 475 476 func (m *ModifyVhostUserIfV2) Reset() { *m = ModifyVhostUserIfV2{} } 477 func (*ModifyVhostUserIfV2) GetMessageName() string { return "modify_vhost_user_if_v2" } 478 func (*ModifyVhostUserIfV2) GetCrcString() string { return "b2483771" } 479 func (*ModifyVhostUserIfV2) GetMessageType() api.MessageType { 480 return api.RequestMessage 481 } 482 483 func (m *ModifyVhostUserIfV2) Size() (size int) { 484 if m == nil { 485 return 0 486 } 487 size += 4 // m.SwIfIndex 488 size += 1 // m.IsServer 489 size += 256 // m.SockFilename 490 size += 1 // m.Renumber 491 size += 1 // m.EnableGso 492 size += 1 // m.EnablePacked 493 size += 1 // m.EnableEventIdx 494 size += 4 // m.CustomDevInstance 495 return size 496 } 497 func (m *ModifyVhostUserIfV2) Marshal(b []byte) ([]byte, error) { 498 if b == nil { 499 b = make([]byte, m.Size()) 500 } 501 buf := codec.NewBuffer(b) 502 buf.EncodeUint32(uint32(m.SwIfIndex)) 503 buf.EncodeBool(m.IsServer) 504 buf.EncodeString(m.SockFilename, 256) 505 buf.EncodeBool(m.Renumber) 506 buf.EncodeBool(m.EnableGso) 507 buf.EncodeBool(m.EnablePacked) 508 buf.EncodeBool(m.EnableEventIdx) 509 buf.EncodeUint32(m.CustomDevInstance) 510 return buf.Bytes(), nil 511 } 512 func (m *ModifyVhostUserIfV2) Unmarshal(b []byte) error { 513 buf := codec.NewBuffer(b) 514 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 515 m.IsServer = buf.DecodeBool() 516 m.SockFilename = buf.DecodeString(256) 517 m.Renumber = buf.DecodeBool() 518 m.EnableGso = buf.DecodeBool() 519 m.EnablePacked = buf.DecodeBool() 520 m.EnableEventIdx = buf.DecodeBool() 521 m.CustomDevInstance = buf.DecodeUint32() 522 return nil 523 } 524 525 // ModifyVhostUserIfV2Reply defines message 'modify_vhost_user_if_v2_reply'. 526 type ModifyVhostUserIfV2Reply struct { 527 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 528 } 529 530 func (m *ModifyVhostUserIfV2Reply) Reset() { *m = ModifyVhostUserIfV2Reply{} } 531 func (*ModifyVhostUserIfV2Reply) GetMessageName() string { return "modify_vhost_user_if_v2_reply" } 532 func (*ModifyVhostUserIfV2Reply) GetCrcString() string { return "e8d4e804" } 533 func (*ModifyVhostUserIfV2Reply) GetMessageType() api.MessageType { 534 return api.ReplyMessage 535 } 536 537 func (m *ModifyVhostUserIfV2Reply) Size() (size int) { 538 if m == nil { 539 return 0 540 } 541 size += 4 // m.Retval 542 return size 543 } 544 func (m *ModifyVhostUserIfV2Reply) Marshal(b []byte) ([]byte, error) { 545 if b == nil { 546 b = make([]byte, m.Size()) 547 } 548 buf := codec.NewBuffer(b) 549 buf.EncodeInt32(m.Retval) 550 return buf.Bytes(), nil 551 } 552 func (m *ModifyVhostUserIfV2Reply) Unmarshal(b []byte) error { 553 buf := codec.NewBuffer(b) 554 m.Retval = buf.DecodeInt32() 555 return nil 556 } 557 558 // Vhost-user interface details structure (fix this) 559 // - sw_if_index - index of the interface 560 // - interface_name - name of interface 561 // - virtio_net_hdr_sz - net header size 562 // - features_first_32 - interface features, first 32 bits 563 // - features_last_32 - interface features, last 32 bits 564 // - is_server - vhost-user server socket 565 // - sock_filename - socket filename 566 // - num_regions - number of used memory regions 567 // - sock_errno - socket errno 568 // 569 // SwInterfaceVhostUserDetails defines message 'sw_interface_vhost_user_details'. 570 type SwInterfaceVhostUserDetails struct { 571 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 572 InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"` 573 VirtioNetHdrSz uint32 `binapi:"u32,name=virtio_net_hdr_sz" json:"virtio_net_hdr_sz,omitempty"` 574 FeaturesFirst32 virtio_types.VirtioNetFeaturesFirst32 `binapi:"virtio_net_features_first_32,name=features_first_32" json:"features_first_32,omitempty"` 575 FeaturesLast32 virtio_types.VirtioNetFeaturesLast32 `binapi:"virtio_net_features_last_32,name=features_last_32" json:"features_last_32,omitempty"` 576 IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"` 577 SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"` 578 NumRegions uint32 `binapi:"u32,name=num_regions" json:"num_regions,omitempty"` 579 SockErrno int32 `binapi:"i32,name=sock_errno" json:"sock_errno,omitempty"` 580 } 581 582 func (m *SwInterfaceVhostUserDetails) Reset() { *m = SwInterfaceVhostUserDetails{} } 583 func (*SwInterfaceVhostUserDetails) GetMessageName() string { return "sw_interface_vhost_user_details" } 584 func (*SwInterfaceVhostUserDetails) GetCrcString() string { return "0cee1e53" } 585 func (*SwInterfaceVhostUserDetails) GetMessageType() api.MessageType { 586 return api.ReplyMessage 587 } 588 589 func (m *SwInterfaceVhostUserDetails) Size() (size int) { 590 if m == nil { 591 return 0 592 } 593 size += 4 // m.SwIfIndex 594 size += 64 // m.InterfaceName 595 size += 4 // m.VirtioNetHdrSz 596 size += 4 // m.FeaturesFirst32 597 size += 4 // m.FeaturesLast32 598 size += 1 // m.IsServer 599 size += 256 // m.SockFilename 600 size += 4 // m.NumRegions 601 size += 4 // m.SockErrno 602 return size 603 } 604 func (m *SwInterfaceVhostUserDetails) Marshal(b []byte) ([]byte, error) { 605 if b == nil { 606 b = make([]byte, m.Size()) 607 } 608 buf := codec.NewBuffer(b) 609 buf.EncodeUint32(uint32(m.SwIfIndex)) 610 buf.EncodeString(m.InterfaceName, 64) 611 buf.EncodeUint32(m.VirtioNetHdrSz) 612 buf.EncodeUint32(uint32(m.FeaturesFirst32)) 613 buf.EncodeUint32(uint32(m.FeaturesLast32)) 614 buf.EncodeBool(m.IsServer) 615 buf.EncodeString(m.SockFilename, 256) 616 buf.EncodeUint32(m.NumRegions) 617 buf.EncodeInt32(m.SockErrno) 618 return buf.Bytes(), nil 619 } 620 func (m *SwInterfaceVhostUserDetails) Unmarshal(b []byte) error { 621 buf := codec.NewBuffer(b) 622 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 623 m.InterfaceName = buf.DecodeString(64) 624 m.VirtioNetHdrSz = buf.DecodeUint32() 625 m.FeaturesFirst32 = virtio_types.VirtioNetFeaturesFirst32(buf.DecodeUint32()) 626 m.FeaturesLast32 = virtio_types.VirtioNetFeaturesLast32(buf.DecodeUint32()) 627 m.IsServer = buf.DecodeBool() 628 m.SockFilename = buf.DecodeString(256) 629 m.NumRegions = buf.DecodeUint32() 630 m.SockErrno = buf.DecodeInt32() 631 return nil 632 } 633 634 // Vhost-user interface dump request 635 // - sw_if_index - filter by sw_if_index 636 // 637 // SwInterfaceVhostUserDump defines message 'sw_interface_vhost_user_dump'. 638 type SwInterfaceVhostUserDump struct { 639 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` 640 } 641 642 func (m *SwInterfaceVhostUserDump) Reset() { *m = SwInterfaceVhostUserDump{} } 643 func (*SwInterfaceVhostUserDump) GetMessageName() string { return "sw_interface_vhost_user_dump" } 644 func (*SwInterfaceVhostUserDump) GetCrcString() string { return "f9e6675e" } 645 func (*SwInterfaceVhostUserDump) GetMessageType() api.MessageType { 646 return api.RequestMessage 647 } 648 649 func (m *SwInterfaceVhostUserDump) Size() (size int) { 650 if m == nil { 651 return 0 652 } 653 size += 4 // m.SwIfIndex 654 return size 655 } 656 func (m *SwInterfaceVhostUserDump) Marshal(b []byte) ([]byte, error) { 657 if b == nil { 658 b = make([]byte, m.Size()) 659 } 660 buf := codec.NewBuffer(b) 661 buf.EncodeUint32(uint32(m.SwIfIndex)) 662 return buf.Bytes(), nil 663 } 664 func (m *SwInterfaceVhostUserDump) Unmarshal(b []byte) error { 665 buf := codec.NewBuffer(b) 666 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 667 return nil 668 } 669 670 func init() { file_vhost_user_binapi_init() } 671 func file_vhost_user_binapi_init() { 672 api.RegisterMessage((*CreateVhostUserIf)(nil), "create_vhost_user_if_c785c6fc") 673 api.RegisterMessage((*CreateVhostUserIfReply)(nil), "create_vhost_user_if_reply_5383d31f") 674 api.RegisterMessage((*CreateVhostUserIfV2)(nil), "create_vhost_user_if_v2_dba1cc1d") 675 api.RegisterMessage((*CreateVhostUserIfV2Reply)(nil), "create_vhost_user_if_v2_reply_5383d31f") 676 api.RegisterMessage((*DeleteVhostUserIf)(nil), "delete_vhost_user_if_f9e6675e") 677 api.RegisterMessage((*DeleteVhostUserIfReply)(nil), "delete_vhost_user_if_reply_e8d4e804") 678 api.RegisterMessage((*ModifyVhostUserIf)(nil), "modify_vhost_user_if_0e71d40b") 679 api.RegisterMessage((*ModifyVhostUserIfReply)(nil), "modify_vhost_user_if_reply_e8d4e804") 680 api.RegisterMessage((*ModifyVhostUserIfV2)(nil), "modify_vhost_user_if_v2_b2483771") 681 api.RegisterMessage((*ModifyVhostUserIfV2Reply)(nil), "modify_vhost_user_if_v2_reply_e8d4e804") 682 api.RegisterMessage((*SwInterfaceVhostUserDetails)(nil), "sw_interface_vhost_user_details_0cee1e53") 683 api.RegisterMessage((*SwInterfaceVhostUserDump)(nil), "sw_interface_vhost_user_dump_f9e6675e") 684 } 685 686 // Messages returns list of all messages in this module. 687 func AllMessages() []api.Message { 688 return []api.Message{ 689 (*CreateVhostUserIf)(nil), 690 (*CreateVhostUserIfReply)(nil), 691 (*CreateVhostUserIfV2)(nil), 692 (*CreateVhostUserIfV2Reply)(nil), 693 (*DeleteVhostUserIf)(nil), 694 (*DeleteVhostUserIfReply)(nil), 695 (*ModifyVhostUserIf)(nil), 696 (*ModifyVhostUserIfReply)(nil), 697 (*ModifyVhostUserIfV2)(nil), 698 (*ModifyVhostUserIfV2Reply)(nil), 699 (*SwInterfaceVhostUserDetails)(nil), 700 (*SwInterfaceVhostUserDump)(nil), 701 } 702 }