| 1 | /* SPDX-License-Identifier: BSD-2-Clause */cxx . . $ `<file>/src/packet.h`/ |
| 2 | /* |
| 3 | * Copyright (C) 2024-2025 Linutronix GmbH |
| 4 | * Author Kurt Kanzenbach <[email protected]> |
| 5 | */ |
| 6 | |
| 7 | #ifndef PACKET_H |
| 8 | #define PACKET_Hcxx . . $ `src/packet.h:8:9`! |
| 9 | |
| 10 | #include <stdbool.h> |
| 11 | #include <stddef.h> |
| 12 | #include <stdint.h> |
| 13 | |
| 14 | #include <sys/socket.h> |
| 15 | |
| 16 | struct tx_control_msgcxx . . $ tx_control_msg# { |
| 17 | unsigned char controlcxx . . $ tx_control_msg#control.[CMSG_SPACEcxx . . $ `<external>/8962547315054503424/socket.h:309:9`!(sizeof(uint64_t))]; |
| 18 | } __attribute((packed)); |
| 19 | |
| 20 | struct packet_contextcxx . . $ packet_context# { |
| 21 | unsigned char *rx_framescxx . . $ packet_context#rx_frames.; |
| 22 | struct ioveccxx . . $ iovec# *rx_iovecscxx . . $ packet_context#rx_iovecs.; |
| 23 | struct ioveccxx . . $ iovec# *tx_iovecscxx . . $ packet_context#tx_iovecs.; |
| 24 | struct mmsghdrcxx . . $ mmsghdr# *rx_msgscxx . . $ packet_context#rx_msgs.; |
| 25 | struct mmsghdrcxx . . $ mmsghdr# *tx_msgscxx . . $ packet_context#tx_msgs.; |
| 26 | struct tx_control_msgcxx . . $ tx_control_msg# *tx_control_msgscxx . . $ packet_context#tx_control_msgs.; |
| 27 | size_t num_frames_per_cyclecxx . . $ packet_context#num_frames_per_cycle.; |
| 28 | }; |
| 29 | |
| 30 | struct packet_contextcxx . . $ packet_context# *packet_initcxx . . $ packet_init(6f6262789a319935).(size_t num_frames_per_cycle); |
| 31 | void packet_freecxx . . $ packet_free(b20c0f701b2a2d37).(struct packet_contextcxx . . $ packet_context# *context); |
| 32 | |
| 33 | struct packet_send_requestcxx . . $ packet_send_request# { |
| 34 | const char *traffic_classcxx . . $ packet_send_request#traffic_class.; |
| 35 | int socket_fdcxx . . $ packet_send_request#socket_fd.; |
| 36 | struct sockaddr_llcxx . . $ sockaddr_ll# *destinationcxx . . $ packet_send_request#destination.; |
| 37 | unsigned char *frame_datacxx . . $ packet_send_request#frame_data.; |
| 38 | size_t num_framescxx . . $ packet_send_request#num_frames.; |
| 39 | size_t frame_lengthcxx . . $ packet_send_request#frame_length.; |
| 40 | uint64_tcxx . . $ uint64_t# durationcxx . . $ packet_send_request#duration.; |
| 41 | uint64_tcxx . . $ uint64_t# tx_time_offsetcxx . . $ packet_send_request#tx_time_offset.; |
| 42 | uint32_tcxx . . $ uint32_t# meta_data_offsetcxx . . $ packet_send_request#meta_data_offset.; |
| 43 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! mirror_enabledcxx . . $ packet_send_request#mirror_enabled.; |
| 44 | boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! tx_time_enabledcxx . . $ packet_send_request#tx_time_enabled.; |
| 45 | }; |
| 46 | |
| 47 | int packet_send_messagescxx . . $ packet_send_messages(db4d6f7226235983).(struct packet_contextcxx . . $ packet_context# *context, struct packet_send_requestcxx . . $ packet_send_request# *send_req); |
| 48 | |
| 49 | struct packet_receive_requestcxx . . $ packet_receive_request# { |
| 50 | const char *traffic_classcxx . . $ packet_receive_request#traffic_class.; |
| 51 | int socket_fdcxx . . $ packet_receive_request#socket_fd.; |
| 52 | int (*receive_functioncxx . . $ packet_receive_request#receive_function.)(void *data, unsigned char *, size_t); |
| 53 | void *datacxx . . $ packet_receive_request#data.; |
| 54 | }; |
| 55 | |
| 56 | int packet_receive_messagescxx . . $ packet_receive_messages(dec9d97ca532b11c).(struct packet_contextcxx . . $ packet_context# *context, |
| 57 | struct packet_receive_requestcxx . . $ packet_receive_request# *recv_req); |
| 58 | |
| 59 | #endif /* PACKET_H */ |