# This file has been autogenerated by `make constants`.
# !! DO NOT CHANGE MANUALLY !!

# SPDX-FileCopyrightText: AISEC Pentesting Team
#
# SPDX-License-Identifier: Apache-2.0

import struct

CANFD_MTU = 72
CAN_MTU = 16

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/can.h
CAN_HEADER_FMT = struct.Struct("=IBB2x")

CANFD_BRS = 0x01
CANFD_ESI = 0x02

CAN_EFF_FLAG = 2147483648
CAN_ERR_FLAG = 536870912
CAN_RTR_FLAG = 1073741824

CAN_EFF_MASK = 536870911
CAN_INV_FILTER = 0x20000000  # TODO: Add to CPython
CAN_SFF_MASK = 2047

CAN_RAW = 1
CAN_RAW_FD_FRAMES = 5
CAN_RAW_FILTER = 1
CAN_RAW_JOIN_FILTERS = 6
SOL_CAN_RAW = 101
