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_ECHO 0x01
30 #define CAN_GW_TXFLAGS_SRC_TSTAMP 0x02
32 /* CAN rtnetlink attribute definitions */
35 CGW_FILTER, /* specify struct can_filter on source CAN device */
36 CGW_MOD_AND, /* CAN frame modification binary AND */
37 CGW_MOD_OR, /* CAN frame modification binary OR */
38 CGW_MOD_XOR, /* CAN frame modification binary XOR */
39 CGW_MOD_SET, /* CAN frame modification set alternate values */
43 #define CGW_MAX (__CGW_MAX - 1)
45 #define CGW_MOD_FUNCS 4 /* AND OR XOR SET */
47 /* CAN frame elements that are affected by curr. 3 CAN frame modifications */
48 #define CGW_MOD_ID 0x01
49 #define CGW_MOD_DLC 0x02
50 #define CGW_MOD_DATA 0x04
52 #define CGW_FRAME_MODS 3 /* ID DLC DATA */
54 #define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
56 #define CGW_MODATTR_LEN (sizeof(struct can_frame) + 1)
59 * CAN rtnetlink attribute contents in detail
61 * CGW_FILTER (length 8 bytes):
62 * Sets a CAN receive filter for the gateway job specified by the
63 * struct can_filter described in include/linux/can.h
65 * CGW_MOD_XXX (length 17 bytes):
66 * Specifies a modification that's done to a received CAN frame before it is
67 * send out to the destination interface.
69 * <struct can_frame> data used as operator
70 * <u8> affected CAN frame elements
72 * Remark: The attribute data is a linear buffer. Beware of sending structs!