go.ligato.io/vpp-agent/v3@v3.5.0/plugins/vpp/binapi/vpp2202/af_packet/af_packet.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 3 // Package af_packet contains generated bindings for API file af_packet.api. 4 // 5 // Contents: 6 // - 10 messages 7 package af_packet 8 9 import ( 10 api "go.fd.io/govpp/api" 11 codec "go.fd.io/govpp/codec" 12 ethernet_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2202/ethernet_types" 13 interface_types "go.ligato.io/vpp-agent/v3/plugins/vpp/binapi/vpp2202/interface_types" 14 ) 15 16 // This is a compile-time assertion to ensure that this generated file 17 // is compatible with the GoVPP api package it is being compiled against. 18 // A compilation error at this line likely means your copy of the 19 // GoVPP api package needs to be updated. 20 const _ = api.GoVppAPIPackageIsVersion2 21 22 const ( 23 APIFile = "af_packet" 24 APIVersion = "2.0.0" 25 VersionCrc = 0x589bd50e 26 ) 27 28 // AfPacketCreate defines message 'af_packet_create'. 29 type AfPacketCreate struct { 30 HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"` 31 UseRandomHwAddr bool `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"` 32 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"` 33 } 34 35 func (m *AfPacketCreate) Reset() { *m = AfPacketCreate{} } 36 func (*AfPacketCreate) GetMessageName() string { return "af_packet_create" } 37 func (*AfPacketCreate) GetCrcString() string { return "a190415f" } 38 func (*AfPacketCreate) GetMessageType() api.MessageType { 39 return api.RequestMessage 40 } 41 42 func (m *AfPacketCreate) Size() (size int) { 43 if m == nil { 44 return 0 45 } 46 size += 1 * 6 // m.HwAddr 47 size += 1 // m.UseRandomHwAddr 48 size += 64 // m.HostIfName 49 return size 50 } 51 func (m *AfPacketCreate) Marshal(b []byte) ([]byte, error) { 52 if b == nil { 53 b = make([]byte, m.Size()) 54 } 55 buf := codec.NewBuffer(b) 56 buf.EncodeBytes(m.HwAddr[:], 6) 57 buf.EncodeBool(m.UseRandomHwAddr) 58 buf.EncodeString(m.HostIfName, 64) 59 return buf.Bytes(), nil 60 } 61 func (m *AfPacketCreate) Unmarshal(b []byte) error { 62 buf := codec.NewBuffer(b) 63 copy(m.HwAddr[:], buf.DecodeBytes(6)) 64 m.UseRandomHwAddr = buf.DecodeBool() 65 m.HostIfName = buf.DecodeString(64) 66 return nil 67 } 68 69 // AfPacketCreateReply defines message 'af_packet_create_reply'. 70 type AfPacketCreateReply struct { 71 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 72 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 73 } 74 75 func (m *AfPacketCreateReply) Reset() { *m = AfPacketCreateReply{} } 76 func (*AfPacketCreateReply) GetMessageName() string { return "af_packet_create_reply" } 77 func (*AfPacketCreateReply) GetCrcString() string { return "5383d31f" } 78 func (*AfPacketCreateReply) GetMessageType() api.MessageType { 79 return api.ReplyMessage 80 } 81 82 func (m *AfPacketCreateReply) Size() (size int) { 83 if m == nil { 84 return 0 85 } 86 size += 4 // m.Retval 87 size += 4 // m.SwIfIndex 88 return size 89 } 90 func (m *AfPacketCreateReply) Marshal(b []byte) ([]byte, error) { 91 if b == nil { 92 b = make([]byte, m.Size()) 93 } 94 buf := codec.NewBuffer(b) 95 buf.EncodeInt32(m.Retval) 96 buf.EncodeUint32(uint32(m.SwIfIndex)) 97 return buf.Bytes(), nil 98 } 99 func (m *AfPacketCreateReply) Unmarshal(b []byte) error { 100 buf := codec.NewBuffer(b) 101 m.Retval = buf.DecodeInt32() 102 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 103 return nil 104 } 105 106 // AfPacketCreateV2 defines message 'af_packet_create_v2'. 107 type AfPacketCreateV2 struct { 108 HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"` 109 UseRandomHwAddr bool `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"` 110 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"` 111 RxFrameSize uint32 `binapi:"u32,name=rx_frame_size" json:"rx_frame_size,omitempty"` 112 TxFrameSize uint32 `binapi:"u32,name=tx_frame_size" json:"tx_frame_size,omitempty"` 113 RxFramesPerBlock uint32 `binapi:"u32,name=rx_frames_per_block" json:"rx_frames_per_block,omitempty"` 114 TxFramesPerBlock uint32 `binapi:"u32,name=tx_frames_per_block" json:"tx_frames_per_block,omitempty"` 115 Flags uint32 `binapi:"u32,name=flags" json:"flags,omitempty"` 116 NumRxQueues uint16 `binapi:"u16,name=num_rx_queues,default=1" json:"num_rx_queues,omitempty"` 117 } 118 119 func (m *AfPacketCreateV2) Reset() { *m = AfPacketCreateV2{} } 120 func (*AfPacketCreateV2) GetMessageName() string { return "af_packet_create_v2" } 121 func (*AfPacketCreateV2) GetCrcString() string { return "4aff0436" } 122 func (*AfPacketCreateV2) GetMessageType() api.MessageType { 123 return api.RequestMessage 124 } 125 126 func (m *AfPacketCreateV2) 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 size += 4 // m.RxFrameSize 134 size += 4 // m.TxFrameSize 135 size += 4 // m.RxFramesPerBlock 136 size += 4 // m.TxFramesPerBlock 137 size += 4 // m.Flags 138 size += 2 // m.NumRxQueues 139 return size 140 } 141 func (m *AfPacketCreateV2) Marshal(b []byte) ([]byte, error) { 142 if b == nil { 143 b = make([]byte, m.Size()) 144 } 145 buf := codec.NewBuffer(b) 146 buf.EncodeBytes(m.HwAddr[:], 6) 147 buf.EncodeBool(m.UseRandomHwAddr) 148 buf.EncodeString(m.HostIfName, 64) 149 buf.EncodeUint32(m.RxFrameSize) 150 buf.EncodeUint32(m.TxFrameSize) 151 buf.EncodeUint32(m.RxFramesPerBlock) 152 buf.EncodeUint32(m.TxFramesPerBlock) 153 buf.EncodeUint32(m.Flags) 154 buf.EncodeUint16(m.NumRxQueues) 155 return buf.Bytes(), nil 156 } 157 func (m *AfPacketCreateV2) Unmarshal(b []byte) error { 158 buf := codec.NewBuffer(b) 159 copy(m.HwAddr[:], buf.DecodeBytes(6)) 160 m.UseRandomHwAddr = buf.DecodeBool() 161 m.HostIfName = buf.DecodeString(64) 162 m.RxFrameSize = buf.DecodeUint32() 163 m.TxFrameSize = buf.DecodeUint32() 164 m.RxFramesPerBlock = buf.DecodeUint32() 165 m.TxFramesPerBlock = buf.DecodeUint32() 166 m.Flags = buf.DecodeUint32() 167 m.NumRxQueues = buf.DecodeUint16() 168 return nil 169 } 170 171 // AfPacketCreateV2Reply defines message 'af_packet_create_v2_reply'. 172 type AfPacketCreateV2Reply struct { 173 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 174 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 175 } 176 177 func (m *AfPacketCreateV2Reply) Reset() { *m = AfPacketCreateV2Reply{} } 178 func (*AfPacketCreateV2Reply) GetMessageName() string { return "af_packet_create_v2_reply" } 179 func (*AfPacketCreateV2Reply) GetCrcString() string { return "5383d31f" } 180 func (*AfPacketCreateV2Reply) GetMessageType() api.MessageType { 181 return api.ReplyMessage 182 } 183 184 func (m *AfPacketCreateV2Reply) Size() (size int) { 185 if m == nil { 186 return 0 187 } 188 size += 4 // m.Retval 189 size += 4 // m.SwIfIndex 190 return size 191 } 192 func (m *AfPacketCreateV2Reply) Marshal(b []byte) ([]byte, error) { 193 if b == nil { 194 b = make([]byte, m.Size()) 195 } 196 buf := codec.NewBuffer(b) 197 buf.EncodeInt32(m.Retval) 198 buf.EncodeUint32(uint32(m.SwIfIndex)) 199 return buf.Bytes(), nil 200 } 201 func (m *AfPacketCreateV2Reply) Unmarshal(b []byte) error { 202 buf := codec.NewBuffer(b) 203 m.Retval = buf.DecodeInt32() 204 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 205 return nil 206 } 207 208 // AfPacketDelete defines message 'af_packet_delete'. 209 type AfPacketDelete struct { 210 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"` 211 } 212 213 func (m *AfPacketDelete) Reset() { *m = AfPacketDelete{} } 214 func (*AfPacketDelete) GetMessageName() string { return "af_packet_delete" } 215 func (*AfPacketDelete) GetCrcString() string { return "863fa648" } 216 func (*AfPacketDelete) GetMessageType() api.MessageType { 217 return api.RequestMessage 218 } 219 220 func (m *AfPacketDelete) Size() (size int) { 221 if m == nil { 222 return 0 223 } 224 size += 64 // m.HostIfName 225 return size 226 } 227 func (m *AfPacketDelete) Marshal(b []byte) ([]byte, error) { 228 if b == nil { 229 b = make([]byte, m.Size()) 230 } 231 buf := codec.NewBuffer(b) 232 buf.EncodeString(m.HostIfName, 64) 233 return buf.Bytes(), nil 234 } 235 func (m *AfPacketDelete) Unmarshal(b []byte) error { 236 buf := codec.NewBuffer(b) 237 m.HostIfName = buf.DecodeString(64) 238 return nil 239 } 240 241 // AfPacketDeleteReply defines message 'af_packet_delete_reply'. 242 type AfPacketDeleteReply struct { 243 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 244 } 245 246 func (m *AfPacketDeleteReply) Reset() { *m = AfPacketDeleteReply{} } 247 func (*AfPacketDeleteReply) GetMessageName() string { return "af_packet_delete_reply" } 248 func (*AfPacketDeleteReply) GetCrcString() string { return "e8d4e804" } 249 func (*AfPacketDeleteReply) GetMessageType() api.MessageType { 250 return api.ReplyMessage 251 } 252 253 func (m *AfPacketDeleteReply) Size() (size int) { 254 if m == nil { 255 return 0 256 } 257 size += 4 // m.Retval 258 return size 259 } 260 func (m *AfPacketDeleteReply) Marshal(b []byte) ([]byte, error) { 261 if b == nil { 262 b = make([]byte, m.Size()) 263 } 264 buf := codec.NewBuffer(b) 265 buf.EncodeInt32(m.Retval) 266 return buf.Bytes(), nil 267 } 268 func (m *AfPacketDeleteReply) Unmarshal(b []byte) error { 269 buf := codec.NewBuffer(b) 270 m.Retval = buf.DecodeInt32() 271 return nil 272 } 273 274 // AfPacketDetails defines message 'af_packet_details'. 275 type AfPacketDetails struct { 276 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 277 HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty"` 278 } 279 280 func (m *AfPacketDetails) Reset() { *m = AfPacketDetails{} } 281 func (*AfPacketDetails) GetMessageName() string { return "af_packet_details" } 282 func (*AfPacketDetails) GetCrcString() string { return "58c7c042" } 283 func (*AfPacketDetails) GetMessageType() api.MessageType { 284 return api.ReplyMessage 285 } 286 287 func (m *AfPacketDetails) Size() (size int) { 288 if m == nil { 289 return 0 290 } 291 size += 4 // m.SwIfIndex 292 size += 64 // m.HostIfName 293 return size 294 } 295 func (m *AfPacketDetails) Marshal(b []byte) ([]byte, error) { 296 if b == nil { 297 b = make([]byte, m.Size()) 298 } 299 buf := codec.NewBuffer(b) 300 buf.EncodeUint32(uint32(m.SwIfIndex)) 301 buf.EncodeString(m.HostIfName, 64) 302 return buf.Bytes(), nil 303 } 304 func (m *AfPacketDetails) Unmarshal(b []byte) error { 305 buf := codec.NewBuffer(b) 306 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 307 m.HostIfName = buf.DecodeString(64) 308 return nil 309 } 310 311 // AfPacketDump defines message 'af_packet_dump'. 312 type AfPacketDump struct{} 313 314 func (m *AfPacketDump) Reset() { *m = AfPacketDump{} } 315 func (*AfPacketDump) GetMessageName() string { return "af_packet_dump" } 316 func (*AfPacketDump) GetCrcString() string { return "51077d14" } 317 func (*AfPacketDump) GetMessageType() api.MessageType { 318 return api.RequestMessage 319 } 320 321 func (m *AfPacketDump) Size() (size int) { 322 if m == nil { 323 return 0 324 } 325 return size 326 } 327 func (m *AfPacketDump) Marshal(b []byte) ([]byte, error) { 328 if b == nil { 329 b = make([]byte, m.Size()) 330 } 331 buf := codec.NewBuffer(b) 332 return buf.Bytes(), nil 333 } 334 func (m *AfPacketDump) Unmarshal(b []byte) error { 335 return nil 336 } 337 338 // AfPacketSetL4CksumOffload defines message 'af_packet_set_l4_cksum_offload'. 339 type AfPacketSetL4CksumOffload struct { 340 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 341 Set bool `binapi:"bool,name=set" json:"set,omitempty"` 342 } 343 344 func (m *AfPacketSetL4CksumOffload) Reset() { *m = AfPacketSetL4CksumOffload{} } 345 func (*AfPacketSetL4CksumOffload) GetMessageName() string { return "af_packet_set_l4_cksum_offload" } 346 func (*AfPacketSetL4CksumOffload) GetCrcString() string { return "319cd5c8" } 347 func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType { 348 return api.RequestMessage 349 } 350 351 func (m *AfPacketSetL4CksumOffload) Size() (size int) { 352 if m == nil { 353 return 0 354 } 355 size += 4 // m.SwIfIndex 356 size += 1 // m.Set 357 return size 358 } 359 func (m *AfPacketSetL4CksumOffload) Marshal(b []byte) ([]byte, error) { 360 if b == nil { 361 b = make([]byte, m.Size()) 362 } 363 buf := codec.NewBuffer(b) 364 buf.EncodeUint32(uint32(m.SwIfIndex)) 365 buf.EncodeBool(m.Set) 366 return buf.Bytes(), nil 367 } 368 func (m *AfPacketSetL4CksumOffload) Unmarshal(b []byte) error { 369 buf := codec.NewBuffer(b) 370 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 371 m.Set = buf.DecodeBool() 372 return nil 373 } 374 375 // AfPacketSetL4CksumOffloadReply defines message 'af_packet_set_l4_cksum_offload_reply'. 376 type AfPacketSetL4CksumOffloadReply struct { 377 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 378 } 379 380 func (m *AfPacketSetL4CksumOffloadReply) Reset() { *m = AfPacketSetL4CksumOffloadReply{} } 381 func (*AfPacketSetL4CksumOffloadReply) GetMessageName() string { 382 return "af_packet_set_l4_cksum_offload_reply" 383 } 384 func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string { return "e8d4e804" } 385 func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType { 386 return api.ReplyMessage 387 } 388 389 func (m *AfPacketSetL4CksumOffloadReply) Size() (size int) { 390 if m == nil { 391 return 0 392 } 393 size += 4 // m.Retval 394 return size 395 } 396 func (m *AfPacketSetL4CksumOffloadReply) Marshal(b []byte) ([]byte, error) { 397 if b == nil { 398 b = make([]byte, m.Size()) 399 } 400 buf := codec.NewBuffer(b) 401 buf.EncodeInt32(m.Retval) 402 return buf.Bytes(), nil 403 } 404 func (m *AfPacketSetL4CksumOffloadReply) Unmarshal(b []byte) error { 405 buf := codec.NewBuffer(b) 406 m.Retval = buf.DecodeInt32() 407 return nil 408 } 409 410 func init() { file_af_packet_binapi_init() } 411 func file_af_packet_binapi_init() { 412 api.RegisterMessage((*AfPacketCreate)(nil), "af_packet_create_a190415f") 413 api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet_create_reply_5383d31f") 414 api.RegisterMessage((*AfPacketCreateV2)(nil), "af_packet_create_v2_4aff0436") 415 api.RegisterMessage((*AfPacketCreateV2Reply)(nil), "af_packet_create_v2_reply_5383d31f") 416 api.RegisterMessage((*AfPacketDelete)(nil), "af_packet_delete_863fa648") 417 api.RegisterMessage((*AfPacketDeleteReply)(nil), "af_packet_delete_reply_e8d4e804") 418 api.RegisterMessage((*AfPacketDetails)(nil), "af_packet_details_58c7c042") 419 api.RegisterMessage((*AfPacketDump)(nil), "af_packet_dump_51077d14") 420 api.RegisterMessage((*AfPacketSetL4CksumOffload)(nil), "af_packet_set_l4_cksum_offload_319cd5c8") 421 api.RegisterMessage((*AfPacketSetL4CksumOffloadReply)(nil), "af_packet_set_l4_cksum_offload_reply_e8d4e804") 422 } 423 424 // Messages returns list of all messages in this module. 425 func AllMessages() []api.Message { 426 return []api.Message{ 427 (*AfPacketCreate)(nil), 428 (*AfPacketCreateReply)(nil), 429 (*AfPacketCreateV2)(nil), 430 (*AfPacketCreateV2Reply)(nil), 431 (*AfPacketDelete)(nil), 432 (*AfPacketDeleteReply)(nil), 433 (*AfPacketDetails)(nil), 434 (*AfPacketDump)(nil), 435 (*AfPacketSetL4CksumOffload)(nil), 436 (*AfPacketSetL4CksumOffloadReply)(nil), 437 } 438 }