github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/af_packet/af_packet.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/core/af_packet.api.json 6 7 // Package af_packet contains generated bindings for API file af_packet.api. 8 // 9 // Contents: 10 // 2 enums 11 // 12 messages 12 // 13 package af_packet 14 15 import ( 16 "strconv" 17 18 api "git.fd.io/govpp.git/api" 19 codec "git.fd.io/govpp.git/codec" 20 ethernet_types "github.com/edwarnicke/govpp/binapi/ethernet_types" 21 interface_types "github.com/edwarnicke/govpp/binapi/interface_types" 22 ) 23 24 // This is a compile-time assertion to ensure that this generated file 25 // is compatible with the GoVPP api package it is being compiled against. 26 // A compilation error at this line likely means your copy of the 27 // GoVPP api package needs to be updated. 28 const _ = api.GoVppAPIPackageIsVersion2 29 30 const ( 31 APIFile = "af_packet" 32 APIVersion = "2.0.0" 33 VersionCrc = 0x5b12de21 34 ) 35 36 // AfPacketFlags defines enum 'af_packet_flags'. 37 type AfPacketFlags uint32 38 39 const ( 40 AF_PACKET_API_FLAG_QDISC_BYPASS AfPacketFlags = 1 41 AF_PACKET_API_FLAG_CKSUM_GSO AfPacketFlags = 2 42 AF_PACKET_API_FLAG_VERSION_2 AfPacketFlags = 8 43 ) 44 45 var ( 46 AfPacketFlags_name = map[uint32]string{ 47 1: "AF_PACKET_API_FLAG_QDISC_BYPASS", 48 2: "AF_PACKET_API_FLAG_CKSUM_GSO", 49 8: "AF_PACKET_API_FLAG_VERSION_2", 50 } 51 AfPacketFlags_value = map[string]uint32{ 52 "AF_PACKET_API_FLAG_QDISC_BYPASS": 1, 53 "AF_PACKET_API_FLAG_CKSUM_GSO": 2, 54 "AF_PACKET_API_FLAG_VERSION_2": 8, 55 } 56 ) 57 58 func (x AfPacketFlags) String() string { 59 s, ok := AfPacketFlags_name[uint32(x)] 60 if ok { 61 return s 62 } 63 str := func(n uint32) string { 64 s, ok := AfPacketFlags_name[uint32(n)] 65 if ok { 66 return s 67 } 68 return "AfPacketFlags(" + strconv.Itoa(int(n)) + ")" 69 } 70 for i := uint32(0); i <= 32; i++ { 71 val := uint32(x) 72 if val&(1<<i) != 0 { 73 if s != "" { 74 s += "|" 75 } 76 s += str(1 << i) 77 } 78 } 79 if s == "" { 80 return str(uint32(x)) 81 } 82 return s 83 } 84 85 // AfPacketMode defines enum 'af_packet_mode'. 86 type AfPacketMode uint32 87 88 const ( 89 AF_PACKET_API_MODE_ETHERNET AfPacketMode = 1 90 AF_PACKET_API_MODE_IP AfPacketMode = 2 91 ) 92 93 var ( 94 AfPacketMode_name = map[uint32]string{ 95 1: "AF_PACKET_API_MODE_ETHERNET", 96 2: "AF_PACKET_API_MODE_IP", 97 } 98 AfPacketMode_value = map[string]uint32{ 99 "AF_PACKET_API_MODE_ETHERNET": 1, 100 "AF_PACKET_API_MODE_IP": 2, 101 } 102 ) 103 104 func (x AfPacketMode) String() string { 105 s, ok := AfPacketMode_name[uint32(x)] 106 if ok { 107 return s 108 } 109 return "AfPacketMode(" + strconv.Itoa(int(x)) + ")" 110 } 111 112 // AfPacketCreate defines message 'af_packet_create'. 113 type AfPacketCreate struct { 114 HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"` 115 UseRandomHwAddr bool `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"` 116 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"` 117 } 118 119 func (m *AfPacketCreate) Reset() { *m = AfPacketCreate{} } 120 func (*AfPacketCreate) GetMessageName() string { return "af_packet_create" } 121 func (*AfPacketCreate) GetCrcString() string { return "a190415f" } 122 func (*AfPacketCreate) GetMessageType() api.MessageType { 123 return api.RequestMessage 124 } 125 126 func (m *AfPacketCreate) Size() (size int) { 127 if m == nil { 128 return 0 129 } 130 size += 1 * 6 // m.HwAddr 131 size += 1 // m.UseRandomHwAddr 132 size += 64 // m.HostIfName 133 return size 134 } 135 func (m *AfPacketCreate) Marshal(b []byte) ([]byte, error) { 136 if b == nil { 137 b = make([]byte, m.Size()) 138 } 139 buf := codec.NewBuffer(b) 140 buf.EncodeBytes(m.HwAddr[:], 6) 141 buf.EncodeBool(m.UseRandomHwAddr) 142 buf.EncodeString(m.HostIfName, 64) 143 return buf.Bytes(), nil 144 } 145 func (m *AfPacketCreate) Unmarshal(b []byte) error { 146 buf := codec.NewBuffer(b) 147 copy(m.HwAddr[:], buf.DecodeBytes(6)) 148 m.UseRandomHwAddr = buf.DecodeBool() 149 m.HostIfName = buf.DecodeString(64) 150 return nil 151 } 152 153 // AfPacketCreateReply defines message 'af_packet_create_reply'. 154 type AfPacketCreateReply struct { 155 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 156 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 157 } 158 159 func (m *AfPacketCreateReply) Reset() { *m = AfPacketCreateReply{} } 160 func (*AfPacketCreateReply) GetMessageName() string { return "af_packet_create_reply" } 161 func (*AfPacketCreateReply) GetCrcString() string { return "5383d31f" } 162 func (*AfPacketCreateReply) GetMessageType() api.MessageType { 163 return api.ReplyMessage 164 } 165 166 func (m *AfPacketCreateReply) Size() (size int) { 167 if m == nil { 168 return 0 169 } 170 size += 4 // m.Retval 171 size += 4 // m.SwIfIndex 172 return size 173 } 174 func (m *AfPacketCreateReply) Marshal(b []byte) ([]byte, error) { 175 if b == nil { 176 b = make([]byte, m.Size()) 177 } 178 buf := codec.NewBuffer(b) 179 buf.EncodeInt32(m.Retval) 180 buf.EncodeUint32(uint32(m.SwIfIndex)) 181 return buf.Bytes(), nil 182 } 183 func (m *AfPacketCreateReply) Unmarshal(b []byte) error { 184 buf := codec.NewBuffer(b) 185 m.Retval = buf.DecodeInt32() 186 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 187 return nil 188 } 189 190 // AfPacketCreateV2 defines message 'af_packet_create_v2'. 191 type AfPacketCreateV2 struct { 192 HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"` 193 UseRandomHwAddr bool `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"` 194 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"` 195 RxFrameSize uint32 `binapi:"u32,name=rx_frame_size" json:"rx_frame_size,omitempty"` 196 TxFrameSize uint32 `binapi:"u32,name=tx_frame_size" json:"tx_frame_size,omitempty"` 197 RxFramesPerBlock uint32 `binapi:"u32,name=rx_frames_per_block" json:"rx_frames_per_block,omitempty"` 198 TxFramesPerBlock uint32 `binapi:"u32,name=tx_frames_per_block" json:"tx_frames_per_block,omitempty"` 199 Flags uint32 `binapi:"u32,name=flags" json:"flags,omitempty"` 200 NumRxQueues uint16 `binapi:"u16,name=num_rx_queues,default=1" json:"num_rx_queues,omitempty"` 201 } 202 203 func (m *AfPacketCreateV2) Reset() { *m = AfPacketCreateV2{} } 204 func (*AfPacketCreateV2) GetMessageName() string { return "af_packet_create_v2" } 205 func (*AfPacketCreateV2) GetCrcString() string { return "4aff0436" } 206 func (*AfPacketCreateV2) GetMessageType() api.MessageType { 207 return api.RequestMessage 208 } 209 210 func (m *AfPacketCreateV2) Size() (size int) { 211 if m == nil { 212 return 0 213 } 214 size += 1 * 6 // m.HwAddr 215 size += 1 // m.UseRandomHwAddr 216 size += 64 // m.HostIfName 217 size += 4 // m.RxFrameSize 218 size += 4 // m.TxFrameSize 219 size += 4 // m.RxFramesPerBlock 220 size += 4 // m.TxFramesPerBlock 221 size += 4 // m.Flags 222 size += 2 // m.NumRxQueues 223 return size 224 } 225 func (m *AfPacketCreateV2) Marshal(b []byte) ([]byte, error) { 226 if b == nil { 227 b = make([]byte, m.Size()) 228 } 229 buf := codec.NewBuffer(b) 230 buf.EncodeBytes(m.HwAddr[:], 6) 231 buf.EncodeBool(m.UseRandomHwAddr) 232 buf.EncodeString(m.HostIfName, 64) 233 buf.EncodeUint32(m.RxFrameSize) 234 buf.EncodeUint32(m.TxFrameSize) 235 buf.EncodeUint32(m.RxFramesPerBlock) 236 buf.EncodeUint32(m.TxFramesPerBlock) 237 buf.EncodeUint32(m.Flags) 238 buf.EncodeUint16(m.NumRxQueues) 239 return buf.Bytes(), nil 240 } 241 func (m *AfPacketCreateV2) Unmarshal(b []byte) error { 242 buf := codec.NewBuffer(b) 243 copy(m.HwAddr[:], buf.DecodeBytes(6)) 244 m.UseRandomHwAddr = buf.DecodeBool() 245 m.HostIfName = buf.DecodeString(64) 246 m.RxFrameSize = buf.DecodeUint32() 247 m.TxFrameSize = buf.DecodeUint32() 248 m.RxFramesPerBlock = buf.DecodeUint32() 249 m.TxFramesPerBlock = buf.DecodeUint32() 250 m.Flags = buf.DecodeUint32() 251 m.NumRxQueues = buf.DecodeUint16() 252 return nil 253 } 254 255 // AfPacketCreateV2Reply defines message 'af_packet_create_v2_reply'. 256 type AfPacketCreateV2Reply struct { 257 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 258 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 259 } 260 261 func (m *AfPacketCreateV2Reply) Reset() { *m = AfPacketCreateV2Reply{} } 262 func (*AfPacketCreateV2Reply) GetMessageName() string { return "af_packet_create_v2_reply" } 263 func (*AfPacketCreateV2Reply) GetCrcString() string { return "5383d31f" } 264 func (*AfPacketCreateV2Reply) GetMessageType() api.MessageType { 265 return api.ReplyMessage 266 } 267 268 func (m *AfPacketCreateV2Reply) Size() (size int) { 269 if m == nil { 270 return 0 271 } 272 size += 4 // m.Retval 273 size += 4 // m.SwIfIndex 274 return size 275 } 276 func (m *AfPacketCreateV2Reply) Marshal(b []byte) ([]byte, error) { 277 if b == nil { 278 b = make([]byte, m.Size()) 279 } 280 buf := codec.NewBuffer(b) 281 buf.EncodeInt32(m.Retval) 282 buf.EncodeUint32(uint32(m.SwIfIndex)) 283 return buf.Bytes(), nil 284 } 285 func (m *AfPacketCreateV2Reply) Unmarshal(b []byte) error { 286 buf := codec.NewBuffer(b) 287 m.Retval = buf.DecodeInt32() 288 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 289 return nil 290 } 291 292 // AfPacketCreateV3 defines message 'af_packet_create_v3'. 293 type AfPacketCreateV3 struct { 294 Mode AfPacketMode `binapi:"af_packet_mode,name=mode" json:"mode,omitempty"` 295 HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"` 296 UseRandomHwAddr bool `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"` 297 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"` 298 RxFrameSize uint32 `binapi:"u32,name=rx_frame_size" json:"rx_frame_size,omitempty"` 299 TxFrameSize uint32 `binapi:"u32,name=tx_frame_size" json:"tx_frame_size,omitempty"` 300 RxFramesPerBlock uint32 `binapi:"u32,name=rx_frames_per_block" json:"rx_frames_per_block,omitempty"` 301 TxFramesPerBlock uint32 `binapi:"u32,name=tx_frames_per_block" json:"tx_frames_per_block,omitempty"` 302 Flags AfPacketFlags `binapi:"af_packet_flags,name=flags" json:"flags,omitempty"` 303 NumRxQueues uint16 `binapi:"u16,name=num_rx_queues,default=1" json:"num_rx_queues,omitempty"` 304 NumTxQueues uint16 `binapi:"u16,name=num_tx_queues,default=1" json:"num_tx_queues,omitempty"` 305 } 306 307 func (m *AfPacketCreateV3) Reset() { *m = AfPacketCreateV3{} } 308 func (*AfPacketCreateV3) GetMessageName() string { return "af_packet_create_v3" } 309 func (*AfPacketCreateV3) GetCrcString() string { return "b3a809d4" } 310 func (*AfPacketCreateV3) GetMessageType() api.MessageType { 311 return api.RequestMessage 312 } 313 314 func (m *AfPacketCreateV3) Size() (size int) { 315 if m == nil { 316 return 0 317 } 318 size += 4 // m.Mode 319 size += 1 * 6 // m.HwAddr 320 size += 1 // m.UseRandomHwAddr 321 size += 64 // m.HostIfName 322 size += 4 // m.RxFrameSize 323 size += 4 // m.TxFrameSize 324 size += 4 // m.RxFramesPerBlock 325 size += 4 // m.TxFramesPerBlock 326 size += 4 // m.Flags 327 size += 2 // m.NumRxQueues 328 size += 2 // m.NumTxQueues 329 return size 330 } 331 func (m *AfPacketCreateV3) Marshal(b []byte) ([]byte, error) { 332 if b == nil { 333 b = make([]byte, m.Size()) 334 } 335 buf := codec.NewBuffer(b) 336 buf.EncodeUint32(uint32(m.Mode)) 337 buf.EncodeBytes(m.HwAddr[:], 6) 338 buf.EncodeBool(m.UseRandomHwAddr) 339 buf.EncodeString(m.HostIfName, 64) 340 buf.EncodeUint32(m.RxFrameSize) 341 buf.EncodeUint32(m.TxFrameSize) 342 buf.EncodeUint32(m.RxFramesPerBlock) 343 buf.EncodeUint32(m.TxFramesPerBlock) 344 buf.EncodeUint32(uint32(m.Flags)) 345 buf.EncodeUint16(m.NumRxQueues) 346 buf.EncodeUint16(m.NumTxQueues) 347 return buf.Bytes(), nil 348 } 349 func (m *AfPacketCreateV3) Unmarshal(b []byte) error { 350 buf := codec.NewBuffer(b) 351 m.Mode = AfPacketMode(buf.DecodeUint32()) 352 copy(m.HwAddr[:], buf.DecodeBytes(6)) 353 m.UseRandomHwAddr = buf.DecodeBool() 354 m.HostIfName = buf.DecodeString(64) 355 m.RxFrameSize = buf.DecodeUint32() 356 m.TxFrameSize = buf.DecodeUint32() 357 m.RxFramesPerBlock = buf.DecodeUint32() 358 m.TxFramesPerBlock = buf.DecodeUint32() 359 m.Flags = AfPacketFlags(buf.DecodeUint32()) 360 m.NumRxQueues = buf.DecodeUint16() 361 m.NumTxQueues = buf.DecodeUint16() 362 return nil 363 } 364 365 // AfPacketCreateV3Reply defines message 'af_packet_create_v3_reply'. 366 type AfPacketCreateV3Reply struct { 367 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 368 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 369 } 370 371 func (m *AfPacketCreateV3Reply) Reset() { *m = AfPacketCreateV3Reply{} } 372 func (*AfPacketCreateV3Reply) GetMessageName() string { return "af_packet_create_v3_reply" } 373 func (*AfPacketCreateV3Reply) GetCrcString() string { return "5383d31f" } 374 func (*AfPacketCreateV3Reply) GetMessageType() api.MessageType { 375 return api.ReplyMessage 376 } 377 378 func (m *AfPacketCreateV3Reply) Size() (size int) { 379 if m == nil { 380 return 0 381 } 382 size += 4 // m.Retval 383 size += 4 // m.SwIfIndex 384 return size 385 } 386 func (m *AfPacketCreateV3Reply) Marshal(b []byte) ([]byte, error) { 387 if b == nil { 388 b = make([]byte, m.Size()) 389 } 390 buf := codec.NewBuffer(b) 391 buf.EncodeInt32(m.Retval) 392 buf.EncodeUint32(uint32(m.SwIfIndex)) 393 return buf.Bytes(), nil 394 } 395 func (m *AfPacketCreateV3Reply) Unmarshal(b []byte) error { 396 buf := codec.NewBuffer(b) 397 m.Retval = buf.DecodeInt32() 398 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 399 return nil 400 } 401 402 // AfPacketDelete defines message 'af_packet_delete'. 403 type AfPacketDelete struct { 404 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"` 405 } 406 407 func (m *AfPacketDelete) Reset() { *m = AfPacketDelete{} } 408 func (*AfPacketDelete) GetMessageName() string { return "af_packet_delete" } 409 func (*AfPacketDelete) GetCrcString() string { return "863fa648" } 410 func (*AfPacketDelete) GetMessageType() api.MessageType { 411 return api.RequestMessage 412 } 413 414 func (m *AfPacketDelete) Size() (size int) { 415 if m == nil { 416 return 0 417 } 418 size += 64 // m.HostIfName 419 return size 420 } 421 func (m *AfPacketDelete) Marshal(b []byte) ([]byte, error) { 422 if b == nil { 423 b = make([]byte, m.Size()) 424 } 425 buf := codec.NewBuffer(b) 426 buf.EncodeString(m.HostIfName, 64) 427 return buf.Bytes(), nil 428 } 429 func (m *AfPacketDelete) Unmarshal(b []byte) error { 430 buf := codec.NewBuffer(b) 431 m.HostIfName = buf.DecodeString(64) 432 return nil 433 } 434 435 // AfPacketDeleteReply defines message 'af_packet_delete_reply'. 436 type AfPacketDeleteReply struct { 437 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 438 } 439 440 func (m *AfPacketDeleteReply) Reset() { *m = AfPacketDeleteReply{} } 441 func (*AfPacketDeleteReply) GetMessageName() string { return "af_packet_delete_reply" } 442 func (*AfPacketDeleteReply) GetCrcString() string { return "e8d4e804" } 443 func (*AfPacketDeleteReply) GetMessageType() api.MessageType { 444 return api.ReplyMessage 445 } 446 447 func (m *AfPacketDeleteReply) Size() (size int) { 448 if m == nil { 449 return 0 450 } 451 size += 4 // m.Retval 452 return size 453 } 454 func (m *AfPacketDeleteReply) Marshal(b []byte) ([]byte, error) { 455 if b == nil { 456 b = make([]byte, m.Size()) 457 } 458 buf := codec.NewBuffer(b) 459 buf.EncodeInt32(m.Retval) 460 return buf.Bytes(), nil 461 } 462 func (m *AfPacketDeleteReply) Unmarshal(b []byte) error { 463 buf := codec.NewBuffer(b) 464 m.Retval = buf.DecodeInt32() 465 return nil 466 } 467 468 // AfPacketDetails defines message 'af_packet_details'. 469 type AfPacketDetails struct { 470 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 471 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"` 472 } 473 474 func (m *AfPacketDetails) Reset() { *m = AfPacketDetails{} } 475 func (*AfPacketDetails) GetMessageName() string { return "af_packet_details" } 476 func (*AfPacketDetails) GetCrcString() string { return "58c7c042" } 477 func (*AfPacketDetails) GetMessageType() api.MessageType { 478 return api.ReplyMessage 479 } 480 481 func (m *AfPacketDetails) Size() (size int) { 482 if m == nil { 483 return 0 484 } 485 size += 4 // m.SwIfIndex 486 size += 64 // m.HostIfName 487 return size 488 } 489 func (m *AfPacketDetails) Marshal(b []byte) ([]byte, error) { 490 if b == nil { 491 b = make([]byte, m.Size()) 492 } 493 buf := codec.NewBuffer(b) 494 buf.EncodeUint32(uint32(m.SwIfIndex)) 495 buf.EncodeString(m.HostIfName, 64) 496 return buf.Bytes(), nil 497 } 498 func (m *AfPacketDetails) Unmarshal(b []byte) error { 499 buf := codec.NewBuffer(b) 500 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 501 m.HostIfName = buf.DecodeString(64) 502 return nil 503 } 504 505 // AfPacketDump defines message 'af_packet_dump'. 506 type AfPacketDump struct{} 507 508 func (m *AfPacketDump) Reset() { *m = AfPacketDump{} } 509 func (*AfPacketDump) GetMessageName() string { return "af_packet_dump" } 510 func (*AfPacketDump) GetCrcString() string { return "51077d14" } 511 func (*AfPacketDump) GetMessageType() api.MessageType { 512 return api.RequestMessage 513 } 514 515 func (m *AfPacketDump) Size() (size int) { 516 if m == nil { 517 return 0 518 } 519 return size 520 } 521 func (m *AfPacketDump) Marshal(b []byte) ([]byte, error) { 522 if b == nil { 523 b = make([]byte, m.Size()) 524 } 525 buf := codec.NewBuffer(b) 526 return buf.Bytes(), nil 527 } 528 func (m *AfPacketDump) Unmarshal(b []byte) error { 529 return nil 530 } 531 532 // AfPacketSetL4CksumOffload defines message 'af_packet_set_l4_cksum_offload'. 533 type AfPacketSetL4CksumOffload struct { 534 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 535 Set bool `binapi:"bool,name=set" json:"set,omitempty"` 536 } 537 538 func (m *AfPacketSetL4CksumOffload) Reset() { *m = AfPacketSetL4CksumOffload{} } 539 func (*AfPacketSetL4CksumOffload) GetMessageName() string { return "af_packet_set_l4_cksum_offload" } 540 func (*AfPacketSetL4CksumOffload) GetCrcString() string { return "319cd5c8" } 541 func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType { 542 return api.RequestMessage 543 } 544 545 func (m *AfPacketSetL4CksumOffload) Size() (size int) { 546 if m == nil { 547 return 0 548 } 549 size += 4 // m.SwIfIndex 550 size += 1 // m.Set 551 return size 552 } 553 func (m *AfPacketSetL4CksumOffload) Marshal(b []byte) ([]byte, error) { 554 if b == nil { 555 b = make([]byte, m.Size()) 556 } 557 buf := codec.NewBuffer(b) 558 buf.EncodeUint32(uint32(m.SwIfIndex)) 559 buf.EncodeBool(m.Set) 560 return buf.Bytes(), nil 561 } 562 func (m *AfPacketSetL4CksumOffload) Unmarshal(b []byte) error { 563 buf := codec.NewBuffer(b) 564 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 565 m.Set = buf.DecodeBool() 566 return nil 567 } 568 569 // AfPacketSetL4CksumOffloadReply defines message 'af_packet_set_l4_cksum_offload_reply'. 570 type AfPacketSetL4CksumOffloadReply struct { 571 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 572 } 573 574 func (m *AfPacketSetL4CksumOffloadReply) Reset() { *m = AfPacketSetL4CksumOffloadReply{} } 575 func (*AfPacketSetL4CksumOffloadReply) GetMessageName() string { 576 return "af_packet_set_l4_cksum_offload_reply" 577 } 578 func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string { return "e8d4e804" } 579 func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType { 580 return api.ReplyMessage 581 } 582 583 func (m *AfPacketSetL4CksumOffloadReply) Size() (size int) { 584 if m == nil { 585 return 0 586 } 587 size += 4 // m.Retval 588 return size 589 } 590 func (m *AfPacketSetL4CksumOffloadReply) Marshal(b []byte) ([]byte, error) { 591 if b == nil { 592 b = make([]byte, m.Size()) 593 } 594 buf := codec.NewBuffer(b) 595 buf.EncodeInt32(m.Retval) 596 return buf.Bytes(), nil 597 } 598 func (m *AfPacketSetL4CksumOffloadReply) Unmarshal(b []byte) error { 599 buf := codec.NewBuffer(b) 600 m.Retval = buf.DecodeInt32() 601 return nil 602 } 603 604 func init() { file_af_packet_binapi_init() } 605 func file_af_packet_binapi_init() { 606 api.RegisterMessage((*AfPacketCreate)(nil), "af_packet_create_a190415f") 607 api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet_create_reply_5383d31f") 608 api.RegisterMessage((*AfPacketCreateV2)(nil), "af_packet_create_v2_4aff0436") 609 api.RegisterMessage((*AfPacketCreateV2Reply)(nil), "af_packet_create_v2_reply_5383d31f") 610 api.RegisterMessage((*AfPacketCreateV3)(nil), "af_packet_create_v3_b3a809d4") 611 api.RegisterMessage((*AfPacketCreateV3Reply)(nil), "af_packet_create_v3_reply_5383d31f") 612 api.RegisterMessage((*AfPacketDelete)(nil), "af_packet_delete_863fa648") 613 api.RegisterMessage((*AfPacketDeleteReply)(nil), "af_packet_delete_reply_e8d4e804") 614 api.RegisterMessage((*AfPacketDetails)(nil), "af_packet_details_58c7c042") 615 api.RegisterMessage((*AfPacketDump)(nil), "af_packet_dump_51077d14") 616 api.RegisterMessage((*AfPacketSetL4CksumOffload)(nil), "af_packet_set_l4_cksum_offload_319cd5c8") 617 api.RegisterMessage((*AfPacketSetL4CksumOffloadReply)(nil), "af_packet_set_l4_cksum_offload_reply_e8d4e804") 618 } 619 620 // Messages returns list of all messages in this module. 621 func AllMessages() []api.Message { 622 return []api.Message{ 623 (*AfPacketCreate)(nil), 624 (*AfPacketCreateReply)(nil), 625 (*AfPacketCreateV2)(nil), 626 (*AfPacketCreateV2Reply)(nil), 627 (*AfPacketCreateV3)(nil), 628 (*AfPacketCreateV3Reply)(nil), 629 (*AfPacketDelete)(nil), 630 (*AfPacketDeleteReply)(nil), 631 (*AfPacketDetails)(nil), 632 (*AfPacketDump)(nil), 633 (*AfPacketSetL4CksumOffload)(nil), 634 (*AfPacketSetL4CksumOffloadReply)(nil), 635 } 636 }