4 * Definitions for CAN frame Gateway/Router/Bridge
8 * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
9 * Copyright (c) 2002-2010 Volkswagen Group Electronic Research
10 * All rights reserved.
12 * Send feedback to <socketcan-users@lists.berlios.de>
19 #include <socketcan/can.h>
29 #define CAN_GW_TXFLAGS_LOOPBACK 0x01
31 /* CAN rtnetlink attribute definitions */
34 CGW_FILTER, /* specify struct can_filter on source CAN device */
35 CGW_MOD_AND, /* CAN frame modification binary AND */
36 CGW_MOD_OR, /* CAN frame modification binary OR */
37 CGW_MOD_XOR, /* CAN frame modification binary XOR */
38 CGW_MOD_SET, /* CAN frame modification set alternate values */
42 #define CGW_MAX (__CGW_MAX - 1)
44 #define CGW_MOD_FUNCS 4 /* AND OR XOR SET */
46 /* CAN frame elements that are affected by curr. 3 CAN frame modifications */
47 #define CGW_MOD_ID 0x01
48 #define CGW_MOD_DLC 0x02
49 #define CGW_MOD_DATA 0x04
51 #define CGW_FRAME_MODS 3 /* ID DLC DATA */
53 #define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
55 #define CGW_MODATTR_LEN (sizeof(struct can_frame) + 1)
58 * CAN rtnetlink attribute contents in detail
60 * CGW_FILTER (length 32 bytes):
61 * Sets a CAN receive filter for the gateway job specified by the
62 * struct can_filter described in include/linux/can.h
64 * CGW_MOD_XXX (length 17 bytes):
65 * Specifies a modification that's done to a received CAN frame before it is
66 * send out to the destination interface.
68 * <u8> affected CAN frame elements
69 * <struct can_frame> data used as operator
71 * Remark: The attribute data is a linear buffer. Beware of sending structs!