diff options
| author | Oliver Hartkopp <socketcan@hartkopp.net> | 2013-08-26 09:05:36 -0400 |
|---|---|---|
| committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-08-29 16:58:24 -0400 |
| commit | 391ac1282dd7ff1cb8245cccc5262e8e4173edc4 (patch) | |
| tree | 891c2d57e8b2424b72e07815b7f203317257c93e /include/uapi/linux | |
| parent | 1149108e2fbf98899447d4567901bf07825ee576 (diff) | |
can: gw: add a per rule limitation of frame hops
Usually the received CAN frames can be processed/routed as much as 'max_hops'
times (which is given at module load time of the can-gw module).
Introduce a new configuration option to reduce the number of possible hops
for a specific gateway rule to a value smaller then max_hops.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/can/gw.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/uapi/linux/can/gw.h b/include/uapi/linux/can/gw.h index ae07bec74f4b..4e27c82b564a 100644 --- a/include/uapi/linux/can/gw.h +++ b/include/uapi/linux/can/gw.h | |||
| @@ -45,6 +45,7 @@ enum { | |||
| 45 | CGW_DST_IF, /* ifindex of destination network interface */ | 45 | CGW_DST_IF, /* ifindex of destination network interface */ |
| 46 | CGW_FILTER, /* specify struct can_filter on source CAN device */ | 46 | CGW_FILTER, /* specify struct can_filter on source CAN device */ |
| 47 | CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */ | 47 | CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */ |
| 48 | CGW_LIM_HOPS, /* limit the number of hops of this specific rule */ | ||
| 48 | __CGW_MAX | 49 | __CGW_MAX |
| 49 | }; | 50 | }; |
| 50 | 51 | ||
| @@ -116,13 +117,19 @@ enum { | |||
| 116 | * Sets a CAN receive filter for the gateway job specified by the | 117 | * Sets a CAN receive filter for the gateway job specified by the |
| 117 | * struct can_filter described in include/linux/can.h | 118 | * struct can_filter described in include/linux/can.h |
| 118 | * | 119 | * |
| 119 | * CGW_MOD_XXX (length 17 bytes): | 120 | * CGW_MOD_(AND|OR|XOR|SET) (length 17 bytes): |
| 120 | * Specifies a modification that's done to a received CAN frame before it is | 121 | * Specifies a modification that's done to a received CAN frame before it is |
| 121 | * send out to the destination interface. | 122 | * send out to the destination interface. |
| 122 | * | 123 | * |
| 123 | * <struct can_frame> data used as operator | 124 | * <struct can_frame> data used as operator |
| 124 | * <u8> affected CAN frame elements | 125 | * <u8> affected CAN frame elements |
| 125 | * | 126 | * |
| 127 | * CGW_LIM_HOPS (length 1 byte): | ||
| 128 | * Limit the number of hops of this specific rule. Usually the received CAN | ||
| 129 | * frame can be processed as much as 'max_hops' times (which is given at module | ||
| 130 | * load time of the can-gw module). This value is used to reduce the number of | ||
| 131 | * possible hops for this gateway rule to a value smaller then max_hops. | ||
| 132 | * | ||
| 126 | * CGW_CS_XOR (length 4 bytes): | 133 | * CGW_CS_XOR (length 4 bytes): |
| 127 | * Set a simple XOR checksum starting with an initial value into | 134 | * Set a simple XOR checksum starting with an initial value into |
| 128 | * data[result-idx] using data[start-idx] .. data[end-idx] | 135 | * data[result-idx] using data[start-idx] .. data[end-idx] |
