github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/vlib/vlib.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: core/vlib.api.json 6 7 // Package vlib contains generated bindings for API file vlib.api. 8 // 9 // Contents: 10 // - 1 struct 11 // - 18 messages 12 package vlib 13 14 import ( 15 api "go.fd.io/govpp/api" 16 codec "go.fd.io/govpp/codec" 17 ) 18 19 // This is a compile-time assertion to ensure that this generated file 20 // is compatible with the GoVPP api package it is being compiled against. 21 // A compilation error at this line likely means your copy of the 22 // GoVPP api package needs to be updated. 23 const _ = api.GoVppAPIPackageIsVersion2 24 25 const ( 26 APIFile = "vlib" 27 APIVersion = "1.0.0" 28 VersionCrc = 0x9a9e84e4 29 ) 30 31 // ThreadData defines type 'thread_data'. 32 type ThreadData struct { 33 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` 34 Name string `binapi:"string[64],name=name" json:"name,omitempty"` 35 Type string `binapi:"string[64],name=type" json:"type,omitempty"` 36 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` 37 CPUID uint32 `binapi:"u32,name=cpu_id" json:"cpu_id,omitempty"` 38 Core uint32 `binapi:"u32,name=core" json:"core,omitempty"` 39 CPUSocket uint32 `binapi:"u32,name=cpu_socket" json:"cpu_socket,omitempty"` 40 } 41 42 // Set the next node for a given node request 43 // - node_name[] - node to add the next node to 44 // - next_name[] - node to add as the next node 45 // 46 // AddNodeNext defines message 'add_node_next'. 47 type AddNodeNext struct { 48 NodeName string `binapi:"string[64],name=node_name" json:"node_name,omitempty"` 49 NextName string `binapi:"string[64],name=next_name" json:"next_name,omitempty"` 50 } 51 52 func (m *AddNodeNext) Reset() { *m = AddNodeNext{} } 53 func (*AddNodeNext) GetMessageName() string { return "add_node_next" } 54 func (*AddNodeNext) GetCrcString() string { return "2457116d" } 55 func (*AddNodeNext) GetMessageType() api.MessageType { 56 return api.RequestMessage 57 } 58 59 func (m *AddNodeNext) Size() (size int) { 60 if m == nil { 61 return 0 62 } 63 size += 64 // m.NodeName 64 size += 64 // m.NextName 65 return size 66 } 67 func (m *AddNodeNext) Marshal(b []byte) ([]byte, error) { 68 if b == nil { 69 b = make([]byte, m.Size()) 70 } 71 buf := codec.NewBuffer(b) 72 buf.EncodeString(m.NodeName, 64) 73 buf.EncodeString(m.NextName, 64) 74 return buf.Bytes(), nil 75 } 76 func (m *AddNodeNext) Unmarshal(b []byte) error { 77 buf := codec.NewBuffer(b) 78 m.NodeName = buf.DecodeString(64) 79 m.NextName = buf.DecodeString(64) 80 return nil 81 } 82 83 // IP Set the next node for a given node response 84 // - retval - return code for the add next node request 85 // - next_index - the index of the next node if success, else ~0 86 // 87 // AddNodeNextReply defines message 'add_node_next_reply'. 88 type AddNodeNextReply struct { 89 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 90 NextIndex uint32 `binapi:"u32,name=next_index" json:"next_index,omitempty"` 91 } 92 93 func (m *AddNodeNextReply) Reset() { *m = AddNodeNextReply{} } 94 func (*AddNodeNextReply) GetMessageName() string { return "add_node_next_reply" } 95 func (*AddNodeNextReply) GetCrcString() string { return "2ed75f32" } 96 func (*AddNodeNextReply) GetMessageType() api.MessageType { 97 return api.ReplyMessage 98 } 99 100 func (m *AddNodeNextReply) Size() (size int) { 101 if m == nil { 102 return 0 103 } 104 size += 4 // m.Retval 105 size += 4 // m.NextIndex 106 return size 107 } 108 func (m *AddNodeNextReply) Marshal(b []byte) ([]byte, error) { 109 if b == nil { 110 b = make([]byte, m.Size()) 111 } 112 buf := codec.NewBuffer(b) 113 buf.EncodeInt32(m.Retval) 114 buf.EncodeUint32(m.NextIndex) 115 return buf.Bytes(), nil 116 } 117 func (m *AddNodeNextReply) Unmarshal(b []byte) error { 118 buf := codec.NewBuffer(b) 119 m.Retval = buf.DecodeInt32() 120 m.NextIndex = buf.DecodeUint32() 121 return nil 122 } 123 124 // Process a vpe parser cli string request 125 // - cmd_in_shmem - pointer to cli command string 126 // 127 // Cli defines message 'cli'. 128 type Cli struct { 129 CmdInShmem uint64 `binapi:"u64,name=cmd_in_shmem" json:"cmd_in_shmem,omitempty"` 130 } 131 132 func (m *Cli) Reset() { *m = Cli{} } 133 func (*Cli) GetMessageName() string { return "cli" } 134 func (*Cli) GetCrcString() string { return "23bfbfff" } 135 func (*Cli) GetMessageType() api.MessageType { 136 return api.RequestMessage 137 } 138 139 func (m *Cli) Size() (size int) { 140 if m == nil { 141 return 0 142 } 143 size += 8 // m.CmdInShmem 144 return size 145 } 146 func (m *Cli) Marshal(b []byte) ([]byte, error) { 147 if b == nil { 148 b = make([]byte, m.Size()) 149 } 150 buf := codec.NewBuffer(b) 151 buf.EncodeUint64(m.CmdInShmem) 152 return buf.Bytes(), nil 153 } 154 func (m *Cli) Unmarshal(b []byte) error { 155 buf := codec.NewBuffer(b) 156 m.CmdInShmem = buf.DecodeUint64() 157 return nil 158 } 159 160 // CliInband defines message 'cli_inband'. 161 type CliInband struct { 162 Cmd string `binapi:"string[],name=cmd" json:"cmd,omitempty"` 163 } 164 165 func (m *CliInband) Reset() { *m = CliInband{} } 166 func (*CliInband) GetMessageName() string { return "cli_inband" } 167 func (*CliInband) GetCrcString() string { return "f8377302" } 168 func (*CliInband) GetMessageType() api.MessageType { 169 return api.RequestMessage 170 } 171 172 func (m *CliInband) Size() (size int) { 173 if m == nil { 174 return 0 175 } 176 size += 4 + len(m.Cmd) // m.Cmd 177 return size 178 } 179 func (m *CliInband) Marshal(b []byte) ([]byte, error) { 180 if b == nil { 181 b = make([]byte, m.Size()) 182 } 183 buf := codec.NewBuffer(b) 184 buf.EncodeString(m.Cmd, 0) 185 return buf.Bytes(), nil 186 } 187 func (m *CliInband) Unmarshal(b []byte) error { 188 buf := codec.NewBuffer(b) 189 m.Cmd = buf.DecodeString(0) 190 return nil 191 } 192 193 // CliInbandReply defines message 'cli_inband_reply'. 194 type CliInbandReply struct { 195 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 196 Reply string `binapi:"string[],name=reply" json:"reply,omitempty"` 197 } 198 199 func (m *CliInbandReply) Reset() { *m = CliInbandReply{} } 200 func (*CliInbandReply) GetMessageName() string { return "cli_inband_reply" } 201 func (*CliInbandReply) GetCrcString() string { return "05879051" } 202 func (*CliInbandReply) GetMessageType() api.MessageType { 203 return api.ReplyMessage 204 } 205 206 func (m *CliInbandReply) Size() (size int) { 207 if m == nil { 208 return 0 209 } 210 size += 4 // m.Retval 211 size += 4 + len(m.Reply) // m.Reply 212 return size 213 } 214 func (m *CliInbandReply) Marshal(b []byte) ([]byte, error) { 215 if b == nil { 216 b = make([]byte, m.Size()) 217 } 218 buf := codec.NewBuffer(b) 219 buf.EncodeInt32(m.Retval) 220 buf.EncodeString(m.Reply, 0) 221 return buf.Bytes(), nil 222 } 223 func (m *CliInbandReply) Unmarshal(b []byte) error { 224 buf := codec.NewBuffer(b) 225 m.Retval = buf.DecodeInt32() 226 m.Reply = buf.DecodeString(0) 227 return nil 228 } 229 230 // vpe parser cli string response 231 // - retval - return code for request 232 // - reply_in_shmem - Reply string from cli processing if any 233 // 234 // CliReply defines message 'cli_reply'. 235 type CliReply struct { 236 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 237 ReplyInShmem uint64 `binapi:"u64,name=reply_in_shmem" json:"reply_in_shmem,omitempty"` 238 } 239 240 func (m *CliReply) Reset() { *m = CliReply{} } 241 func (*CliReply) GetMessageName() string { return "cli_reply" } 242 func (*CliReply) GetCrcString() string { return "06d68297" } 243 func (*CliReply) GetMessageType() api.MessageType { 244 return api.ReplyMessage 245 } 246 247 func (m *CliReply) Size() (size int) { 248 if m == nil { 249 return 0 250 } 251 size += 4 // m.Retval 252 size += 8 // m.ReplyInShmem 253 return size 254 } 255 func (m *CliReply) Marshal(b []byte) ([]byte, error) { 256 if b == nil { 257 b = make([]byte, m.Size()) 258 } 259 buf := codec.NewBuffer(b) 260 buf.EncodeInt32(m.Retval) 261 buf.EncodeUint64(m.ReplyInShmem) 262 return buf.Bytes(), nil 263 } 264 func (m *CliReply) Unmarshal(b []byte) error { 265 buf := codec.NewBuffer(b) 266 m.Retval = buf.DecodeInt32() 267 m.ReplyInShmem = buf.DecodeUint64() 268 return nil 269 } 270 271 // f64 types are not standardized across the wire. Sense wire format in each direction by sending the f64 value 1.0. 272 // - f64_one - The constant of 1.0. If you send a different value, expect an rv=VNET_API_ERROR_API_ENDIAN_FAILED. 273 // 274 // GetF64EndianValue defines message 'get_f64_endian_value'. 275 type GetF64EndianValue struct { 276 F64One float64 `binapi:"f64,name=f64_one,default=1" json:"f64_one,omitempty"` 277 } 278 279 func (m *GetF64EndianValue) Reset() { *m = GetF64EndianValue{} } 280 func (*GetF64EndianValue) GetMessageName() string { return "get_f64_endian_value" } 281 func (*GetF64EndianValue) GetCrcString() string { return "809fcd44" } 282 func (*GetF64EndianValue) GetMessageType() api.MessageType { 283 return api.RequestMessage 284 } 285 286 func (m *GetF64EndianValue) Size() (size int) { 287 if m == nil { 288 return 0 289 } 290 size += 8 // m.F64One 291 return size 292 } 293 func (m *GetF64EndianValue) Marshal(b []byte) ([]byte, error) { 294 if b == nil { 295 b = make([]byte, m.Size()) 296 } 297 buf := codec.NewBuffer(b) 298 buf.EncodeFloat64(m.F64One) 299 return buf.Bytes(), nil 300 } 301 func (m *GetF64EndianValue) Unmarshal(b []byte) error { 302 buf := codec.NewBuffer(b) 303 m.F64One = buf.DecodeFloat64() 304 return nil 305 } 306 307 // get_f64_endian_value reply message 308 // - retval - return value - VNET_API_ERROR_API_ENDIAN_FAILED if f64_one != 1.0 309 // - f64_one_result - The value of 'f64 1.0' 310 // 311 // GetF64EndianValueReply defines message 'get_f64_endian_value_reply'. 312 type GetF64EndianValueReply struct { 313 Retval uint32 `binapi:"u32,name=retval" json:"retval,omitempty"` 314 F64OneResult float64 `binapi:"f64,name=f64_one_result" json:"f64_one_result,omitempty"` 315 } 316 317 func (m *GetF64EndianValueReply) Reset() { *m = GetF64EndianValueReply{} } 318 func (*GetF64EndianValueReply) GetMessageName() string { return "get_f64_endian_value_reply" } 319 func (*GetF64EndianValueReply) GetCrcString() string { return "7e02e404" } 320 func (*GetF64EndianValueReply) GetMessageType() api.MessageType { 321 return api.ReplyMessage 322 } 323 324 func (m *GetF64EndianValueReply) Size() (size int) { 325 if m == nil { 326 return 0 327 } 328 size += 4 // m.Retval 329 size += 8 // m.F64OneResult 330 return size 331 } 332 func (m *GetF64EndianValueReply) Marshal(b []byte) ([]byte, error) { 333 if b == nil { 334 b = make([]byte, m.Size()) 335 } 336 buf := codec.NewBuffer(b) 337 buf.EncodeUint32(m.Retval) 338 buf.EncodeFloat64(m.F64OneResult) 339 return buf.Bytes(), nil 340 } 341 func (m *GetF64EndianValueReply) Unmarshal(b []byte) error { 342 buf := codec.NewBuffer(b) 343 m.Retval = buf.DecodeUint32() 344 m.F64OneResult = buf.DecodeFloat64() 345 return nil 346 } 347 348 // Verify f64 wire format by sending a value and receiving the value + 1.0 349 // - f64_value - The value you want to test. Default: 1.0. 350 // 351 // GetF64IncrementByOne defines message 'get_f64_increment_by_one'. 352 type GetF64IncrementByOne struct { 353 F64Value float64 `binapi:"f64,name=f64_value,default=1" json:"f64_value,omitempty"` 354 } 355 356 func (m *GetF64IncrementByOne) Reset() { *m = GetF64IncrementByOne{} } 357 func (*GetF64IncrementByOne) GetMessageName() string { return "get_f64_increment_by_one" } 358 func (*GetF64IncrementByOne) GetCrcString() string { return "b64f027e" } 359 func (*GetF64IncrementByOne) GetMessageType() api.MessageType { 360 return api.RequestMessage 361 } 362 363 func (m *GetF64IncrementByOne) Size() (size int) { 364 if m == nil { 365 return 0 366 } 367 size += 8 // m.F64Value 368 return size 369 } 370 func (m *GetF64IncrementByOne) Marshal(b []byte) ([]byte, error) { 371 if b == nil { 372 b = make([]byte, m.Size()) 373 } 374 buf := codec.NewBuffer(b) 375 buf.EncodeFloat64(m.F64Value) 376 return buf.Bytes(), nil 377 } 378 func (m *GetF64IncrementByOne) Unmarshal(b []byte) error { 379 buf := codec.NewBuffer(b) 380 m.F64Value = buf.DecodeFloat64() 381 return nil 382 } 383 384 // get_f64_increment_by_one reply 385 // - f64_value - The input f64_value incremented by 1.0. 386 // 387 // GetF64IncrementByOneReply defines message 'get_f64_increment_by_one_reply'. 388 type GetF64IncrementByOneReply struct { 389 Retval uint32 `binapi:"u32,name=retval" json:"retval,omitempty"` 390 F64Value float64 `binapi:"f64,name=f64_value" json:"f64_value,omitempty"` 391 } 392 393 func (m *GetF64IncrementByOneReply) Reset() { *m = GetF64IncrementByOneReply{} } 394 func (*GetF64IncrementByOneReply) GetMessageName() string { return "get_f64_increment_by_one_reply" } 395 func (*GetF64IncrementByOneReply) GetCrcString() string { return "d25dbaa3" } 396 func (*GetF64IncrementByOneReply) GetMessageType() api.MessageType { 397 return api.ReplyMessage 398 } 399 400 func (m *GetF64IncrementByOneReply) Size() (size int) { 401 if m == nil { 402 return 0 403 } 404 size += 4 // m.Retval 405 size += 8 // m.F64Value 406 return size 407 } 408 func (m *GetF64IncrementByOneReply) Marshal(b []byte) ([]byte, error) { 409 if b == nil { 410 b = make([]byte, m.Size()) 411 } 412 buf := codec.NewBuffer(b) 413 buf.EncodeUint32(m.Retval) 414 buf.EncodeFloat64(m.F64Value) 415 return buf.Bytes(), nil 416 } 417 func (m *GetF64IncrementByOneReply) Unmarshal(b []byte) error { 418 buf := codec.NewBuffer(b) 419 m.Retval = buf.DecodeUint32() 420 m.F64Value = buf.DecodeFloat64() 421 return nil 422 } 423 424 // Query relative index via node names 425 // - node_name - name of node to find relative index from 426 // - next_name - next node from node_name to find relative index of 427 // 428 // GetNextIndex defines message 'get_next_index'. 429 type GetNextIndex struct { 430 NodeName string `binapi:"string[64],name=node_name" json:"node_name,omitempty"` 431 NextName string `binapi:"string[64],name=next_name" json:"next_name,omitempty"` 432 } 433 434 func (m *GetNextIndex) Reset() { *m = GetNextIndex{} } 435 func (*GetNextIndex) GetMessageName() string { return "get_next_index" } 436 func (*GetNextIndex) GetCrcString() string { return "2457116d" } 437 func (*GetNextIndex) GetMessageType() api.MessageType { 438 return api.RequestMessage 439 } 440 441 func (m *GetNextIndex) Size() (size int) { 442 if m == nil { 443 return 0 444 } 445 size += 64 // m.NodeName 446 size += 64 // m.NextName 447 return size 448 } 449 func (m *GetNextIndex) Marshal(b []byte) ([]byte, error) { 450 if b == nil { 451 b = make([]byte, m.Size()) 452 } 453 buf := codec.NewBuffer(b) 454 buf.EncodeString(m.NodeName, 64) 455 buf.EncodeString(m.NextName, 64) 456 return buf.Bytes(), nil 457 } 458 func (m *GetNextIndex) Unmarshal(b []byte) error { 459 buf := codec.NewBuffer(b) 460 m.NodeName = buf.DecodeString(64) 461 m.NextName = buf.DecodeString(64) 462 return nil 463 } 464 465 // Reply for get next node index 466 // - retval - return value 467 // - next_index - index of the next_node 468 // 469 // GetNextIndexReply defines message 'get_next_index_reply'. 470 type GetNextIndexReply struct { 471 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 472 NextIndex uint32 `binapi:"u32,name=next_index" json:"next_index,omitempty"` 473 } 474 475 func (m *GetNextIndexReply) Reset() { *m = GetNextIndexReply{} } 476 func (*GetNextIndexReply) GetMessageName() string { return "get_next_index_reply" } 477 func (*GetNextIndexReply) GetCrcString() string { return "2ed75f32" } 478 func (*GetNextIndexReply) GetMessageType() api.MessageType { 479 return api.ReplyMessage 480 } 481 482 func (m *GetNextIndexReply) Size() (size int) { 483 if m == nil { 484 return 0 485 } 486 size += 4 // m.Retval 487 size += 4 // m.NextIndex 488 return size 489 } 490 func (m *GetNextIndexReply) Marshal(b []byte) ([]byte, error) { 491 if b == nil { 492 b = make([]byte, m.Size()) 493 } 494 buf := codec.NewBuffer(b) 495 buf.EncodeInt32(m.Retval) 496 buf.EncodeUint32(m.NextIndex) 497 return buf.Bytes(), nil 498 } 499 func (m *GetNextIndexReply) Unmarshal(b []byte) error { 500 buf := codec.NewBuffer(b) 501 m.Retval = buf.DecodeInt32() 502 m.NextIndex = buf.DecodeUint32() 503 return nil 504 } 505 506 // GetNodeGraph defines message 'get_node_graph'. 507 type GetNodeGraph struct{} 508 509 func (m *GetNodeGraph) Reset() { *m = GetNodeGraph{} } 510 func (*GetNodeGraph) GetMessageName() string { return "get_node_graph" } 511 func (*GetNodeGraph) GetCrcString() string { return "51077d14" } 512 func (*GetNodeGraph) GetMessageType() api.MessageType { 513 return api.RequestMessage 514 } 515 516 func (m *GetNodeGraph) Size() (size int) { 517 if m == nil { 518 return 0 519 } 520 return size 521 } 522 func (m *GetNodeGraph) Marshal(b []byte) ([]byte, error) { 523 if b == nil { 524 b = make([]byte, m.Size()) 525 } 526 buf := codec.NewBuffer(b) 527 return buf.Bytes(), nil 528 } 529 func (m *GetNodeGraph) Unmarshal(b []byte) error { 530 return nil 531 } 532 533 // get_node_graph_reply 534 // - retval - return code 535 // - reply_in_shmem - result from vlib_node_serialize, in shared 536 // memory. Process with vlib_node_unserialize, remember to switch 537 // heaps and free the result. 538 // 539 // GetNodeGraphReply defines message 'get_node_graph_reply'. 540 type GetNodeGraphReply struct { 541 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 542 ReplyInShmem uint64 `binapi:"u64,name=reply_in_shmem" json:"reply_in_shmem,omitempty"` 543 } 544 545 func (m *GetNodeGraphReply) Reset() { *m = GetNodeGraphReply{} } 546 func (*GetNodeGraphReply) GetMessageName() string { return "get_node_graph_reply" } 547 func (*GetNodeGraphReply) GetCrcString() string { return "06d68297" } 548 func (*GetNodeGraphReply) GetMessageType() api.MessageType { 549 return api.ReplyMessage 550 } 551 552 func (m *GetNodeGraphReply) Size() (size int) { 553 if m == nil { 554 return 0 555 } 556 size += 4 // m.Retval 557 size += 8 // m.ReplyInShmem 558 return size 559 } 560 func (m *GetNodeGraphReply) Marshal(b []byte) ([]byte, error) { 561 if b == nil { 562 b = make([]byte, m.Size()) 563 } 564 buf := codec.NewBuffer(b) 565 buf.EncodeInt32(m.Retval) 566 buf.EncodeUint64(m.ReplyInShmem) 567 return buf.Bytes(), nil 568 } 569 func (m *GetNodeGraphReply) Unmarshal(b []byte) error { 570 buf := codec.NewBuffer(b) 571 m.Retval = buf.DecodeInt32() 572 m.ReplyInShmem = buf.DecodeUint64() 573 return nil 574 } 575 576 // Get node index using name request 577 // - node_name[] - name of the node 578 // 579 // GetNodeIndex defines message 'get_node_index'. 580 type GetNodeIndex struct { 581 NodeName string `binapi:"string[64],name=node_name" json:"node_name,omitempty"` 582 } 583 584 func (m *GetNodeIndex) Reset() { *m = GetNodeIndex{} } 585 func (*GetNodeIndex) GetMessageName() string { return "get_node_index" } 586 func (*GetNodeIndex) GetCrcString() string { return "f1984c64" } 587 func (*GetNodeIndex) GetMessageType() api.MessageType { 588 return api.RequestMessage 589 } 590 591 func (m *GetNodeIndex) Size() (size int) { 592 if m == nil { 593 return 0 594 } 595 size += 64 // m.NodeName 596 return size 597 } 598 func (m *GetNodeIndex) Marshal(b []byte) ([]byte, error) { 599 if b == nil { 600 b = make([]byte, m.Size()) 601 } 602 buf := codec.NewBuffer(b) 603 buf.EncodeString(m.NodeName, 64) 604 return buf.Bytes(), nil 605 } 606 func (m *GetNodeIndex) Unmarshal(b []byte) error { 607 buf := codec.NewBuffer(b) 608 m.NodeName = buf.DecodeString(64) 609 return nil 610 } 611 612 // Get node index using name request 613 // - retval - return code for the request 614 // - node_index - index of the desired node if found, else ~0 615 // 616 // GetNodeIndexReply defines message 'get_node_index_reply'. 617 type GetNodeIndexReply struct { 618 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 619 NodeIndex uint32 `binapi:"u32,name=node_index" json:"node_index,omitempty"` 620 } 621 622 func (m *GetNodeIndexReply) Reset() { *m = GetNodeIndexReply{} } 623 func (*GetNodeIndexReply) GetMessageName() string { return "get_node_index_reply" } 624 func (*GetNodeIndexReply) GetCrcString() string { return "a8600b89" } 625 func (*GetNodeIndexReply) GetMessageType() api.MessageType { 626 return api.ReplyMessage 627 } 628 629 func (m *GetNodeIndexReply) Size() (size int) { 630 if m == nil { 631 return 0 632 } 633 size += 4 // m.Retval 634 size += 4 // m.NodeIndex 635 return size 636 } 637 func (m *GetNodeIndexReply) Marshal(b []byte) ([]byte, error) { 638 if b == nil { 639 b = make([]byte, m.Size()) 640 } 641 buf := codec.NewBuffer(b) 642 buf.EncodeInt32(m.Retval) 643 buf.EncodeUint32(m.NodeIndex) 644 return buf.Bytes(), nil 645 } 646 func (m *GetNodeIndexReply) Unmarshal(b []byte) error { 647 buf := codec.NewBuffer(b) 648 m.Retval = buf.DecodeInt32() 649 m.NodeIndex = buf.DecodeUint32() 650 return nil 651 } 652 653 // show_threads display the information about vpp 654 // 655 // threads running on system along with their process id, 656 // cpu id, physical core and cpu socket. 657 // 658 // ShowThreads defines message 'show_threads'. 659 type ShowThreads struct{} 660 661 func (m *ShowThreads) Reset() { *m = ShowThreads{} } 662 func (*ShowThreads) GetMessageName() string { return "show_threads" } 663 func (*ShowThreads) GetCrcString() string { return "51077d14" } 664 func (*ShowThreads) GetMessageType() api.MessageType { 665 return api.RequestMessage 666 } 667 668 func (m *ShowThreads) Size() (size int) { 669 if m == nil { 670 return 0 671 } 672 return size 673 } 674 func (m *ShowThreads) Marshal(b []byte) ([]byte, error) { 675 if b == nil { 676 b = make([]byte, m.Size()) 677 } 678 buf := codec.NewBuffer(b) 679 return buf.Bytes(), nil 680 } 681 func (m *ShowThreads) Unmarshal(b []byte) error { 682 return nil 683 } 684 685 // show_threads_reply 686 // - retval - return code 687 // - count - number of threads in thread_data array 688 // - thread_data - array of thread data 689 // 690 // ShowThreadsReply defines message 'show_threads_reply'. 691 type ShowThreadsReply struct { 692 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 693 Count uint32 `binapi:"u32,name=count" json:"-"` 694 ThreadData []ThreadData `binapi:"thread_data[count],name=thread_data" json:"thread_data,omitempty"` 695 } 696 697 func (m *ShowThreadsReply) Reset() { *m = ShowThreadsReply{} } 698 func (*ShowThreadsReply) GetMessageName() string { return "show_threads_reply" } 699 func (*ShowThreadsReply) GetCrcString() string { return "efd78e83" } 700 func (*ShowThreadsReply) GetMessageType() api.MessageType { 701 return api.ReplyMessage 702 } 703 704 func (m *ShowThreadsReply) Size() (size int) { 705 if m == nil { 706 return 0 707 } 708 size += 4 // m.Retval 709 size += 4 // m.Count 710 for j1 := 0; j1 < len(m.ThreadData); j1++ { 711 var s1 ThreadData 712 _ = s1 713 if j1 < len(m.ThreadData) { 714 s1 = m.ThreadData[j1] 715 } 716 size += 4 // s1.ID 717 size += 64 // s1.Name 718 size += 64 // s1.Type 719 size += 4 // s1.PID 720 size += 4 // s1.CPUID 721 size += 4 // s1.Core 722 size += 4 // s1.CPUSocket 723 } 724 return size 725 } 726 func (m *ShowThreadsReply) Marshal(b []byte) ([]byte, error) { 727 if b == nil { 728 b = make([]byte, m.Size()) 729 } 730 buf := codec.NewBuffer(b) 731 buf.EncodeInt32(m.Retval) 732 buf.EncodeUint32(uint32(len(m.ThreadData))) 733 for j0 := 0; j0 < len(m.ThreadData); j0++ { 734 var v0 ThreadData // ThreadData 735 if j0 < len(m.ThreadData) { 736 v0 = m.ThreadData[j0] 737 } 738 buf.EncodeUint32(v0.ID) 739 buf.EncodeString(v0.Name, 64) 740 buf.EncodeString(v0.Type, 64) 741 buf.EncodeUint32(v0.PID) 742 buf.EncodeUint32(v0.CPUID) 743 buf.EncodeUint32(v0.Core) 744 buf.EncodeUint32(v0.CPUSocket) 745 } 746 return buf.Bytes(), nil 747 } 748 func (m *ShowThreadsReply) Unmarshal(b []byte) error { 749 buf := codec.NewBuffer(b) 750 m.Retval = buf.DecodeInt32() 751 m.Count = buf.DecodeUint32() 752 m.ThreadData = make([]ThreadData, m.Count) 753 for j0 := 0; j0 < len(m.ThreadData); j0++ { 754 m.ThreadData[j0].ID = buf.DecodeUint32() 755 m.ThreadData[j0].Name = buf.DecodeString(64) 756 m.ThreadData[j0].Type = buf.DecodeString(64) 757 m.ThreadData[j0].PID = buf.DecodeUint32() 758 m.ThreadData[j0].CPUID = buf.DecodeUint32() 759 m.ThreadData[j0].Core = buf.DecodeUint32() 760 m.ThreadData[j0].CPUSocket = buf.DecodeUint32() 761 } 762 return nil 763 } 764 765 func init() { file_vlib_binapi_init() } 766 func file_vlib_binapi_init() { 767 api.RegisterMessage((*AddNodeNext)(nil), "add_node_next_2457116d") 768 api.RegisterMessage((*AddNodeNextReply)(nil), "add_node_next_reply_2ed75f32") 769 api.RegisterMessage((*Cli)(nil), "cli_23bfbfff") 770 api.RegisterMessage((*CliInband)(nil), "cli_inband_f8377302") 771 api.RegisterMessage((*CliInbandReply)(nil), "cli_inband_reply_05879051") 772 api.RegisterMessage((*CliReply)(nil), "cli_reply_06d68297") 773 api.RegisterMessage((*GetF64EndianValue)(nil), "get_f64_endian_value_809fcd44") 774 api.RegisterMessage((*GetF64EndianValueReply)(nil), "get_f64_endian_value_reply_7e02e404") 775 api.RegisterMessage((*GetF64IncrementByOne)(nil), "get_f64_increment_by_one_b64f027e") 776 api.RegisterMessage((*GetF64IncrementByOneReply)(nil), "get_f64_increment_by_one_reply_d25dbaa3") 777 api.RegisterMessage((*GetNextIndex)(nil), "get_next_index_2457116d") 778 api.RegisterMessage((*GetNextIndexReply)(nil), "get_next_index_reply_2ed75f32") 779 api.RegisterMessage((*GetNodeGraph)(nil), "get_node_graph_51077d14") 780 api.RegisterMessage((*GetNodeGraphReply)(nil), "get_node_graph_reply_06d68297") 781 api.RegisterMessage((*GetNodeIndex)(nil), "get_node_index_f1984c64") 782 api.RegisterMessage((*GetNodeIndexReply)(nil), "get_node_index_reply_a8600b89") 783 api.RegisterMessage((*ShowThreads)(nil), "show_threads_51077d14") 784 api.RegisterMessage((*ShowThreadsReply)(nil), "show_threads_reply_efd78e83") 785 } 786 787 // Messages returns list of all messages in this module. 788 func AllMessages() []api.Message { 789 return []api.Message{ 790 (*AddNodeNext)(nil), 791 (*AddNodeNextReply)(nil), 792 (*Cli)(nil), 793 (*CliInband)(nil), 794 (*CliInbandReply)(nil), 795 (*CliReply)(nil), 796 (*GetF64EndianValue)(nil), 797 (*GetF64EndianValueReply)(nil), 798 (*GetF64IncrementByOne)(nil), 799 (*GetF64IncrementByOneReply)(nil), 800 (*GetNextIndex)(nil), 801 (*GetNextIndexReply)(nil), 802 (*GetNodeGraph)(nil), 803 (*GetNodeGraphReply)(nil), 804 (*GetNodeIndex)(nil), 805 (*GetNodeIndexReply)(nil), 806 (*ShowThreads)(nil), 807 (*ShowThreadsReply)(nil), 808 } 809 }