lib: make parse_canframe CAN XL aware

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
Oliver Hartkopp
2024-02-28 22:00:19 +01:00
parent 3644a54d5b
commit 34a1cfad29
7 changed files with 164 additions and 71 deletions
+8
View File
@@ -306,6 +306,11 @@ int main(int argc, char **argv)
struct sockaddr_can addr = {
.can_family = AF_CAN,
};
struct can_raw_vcid_options vcid_opts = {
.flags = CAN_RAW_XL_VCID_RX_FILTER,
.rx_vcid = 0,
.rx_vcid_mask = 0,
};
char ctrlmsg[CMSG_SPACE(sizeof(struct timeval)) +
CMSG_SPACE(3 * sizeof(struct timespec)) +
CMSG_SPACE(sizeof(__u32))];
@@ -601,6 +606,9 @@ int main(int argc, char **argv)
/* try to switch the socket into CAN XL mode */
setsockopt(obj->s, SOL_CAN_RAW, CAN_RAW_XL_FRAMES, &canfx_on, sizeof(canfx_on));
/* try to enable the CAN XL VCID pass through mode */
setsockopt(obj->s, SOL_CAN_RAW, CAN_RAW_XL_VCID_OPTS, &vcid_opts, sizeof(vcid_opts));
if (rcvbuf_size) {
int curr_rcvbuf_size;
socklen_t curr_rcvbuf_size_len = sizeof(curr_rcvbuf_size);