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 */
40 CGW_HANDLED, /* number of handled CAN frames */
41 CGW_DROPPED, /* number of dropped CAN frames */
45 #define CGW_MAX (__CGW_MAX - 1)
47 #define CGW_MOD_FUNCS 4 /* AND OR XOR SET */
49 /* CAN frame elements that are affected by curr. 3 CAN frame modifications */
50 #define CGW_MOD_ID 0x01
51 #define CGW_MOD_DLC 0x02
52 #define CGW_MOD_DATA 0x04
54 #define CGW_FRAME_MODS 3 /* ID DLC DATA */
56 #define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
58 #define CGW_MODATTR_LEN (sizeof(struct can_frame) + 1)
61 * CAN rtnetlink attribute contents in detail
63 * CGW_FILTER (length 8 bytes):
64 * Sets a CAN receive filter for the gateway job specified by the
65 * struct can_filter described in include/linux/can.h
67 * CGW_MOD_XXX (length 17 bytes):
68 * Specifies a modification that's done to a received CAN frame before it is
69 * send out to the destination interface.
71 * <struct can_frame> data used as operator
72 * <u8> affected CAN frame elements
74 * Remark: The attribute data is a linear buffer. Beware of sending structs!