cangw: make help text fit into 80 colums again
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>pull/201/head
parent
819a03f6e2
commit
f3ced10007
56
cangw.c
56
cangw.c
|
|
@ -225,39 +225,39 @@ void print_usage(char *prg)
|
|||
fprintf(stderr, "%s - manage PF_CAN netlink gateway.\n", prg);
|
||||
fprintf(stderr, "\nUsage: %s [options]\n\n", prg);
|
||||
fprintf(stderr, "Commands:\n");
|
||||
fprintf(stderr, " -A (add a new rule)\n");
|
||||
fprintf(stderr, " -D (delete a rule)\n");
|
||||
fprintf(stderr, " -F (flush / delete all rules)\n");
|
||||
fprintf(stderr, " -L (list all rules)\n");
|
||||
fprintf(stderr, " -A (add a new rule)\n");
|
||||
fprintf(stderr, " -D (delete a rule)\n");
|
||||
fprintf(stderr, " -F (flush / delete all rules)\n");
|
||||
fprintf(stderr, " -L (list all rules)\n");
|
||||
fprintf(stderr, "Mandatory:\n");
|
||||
fprintf(stderr, " -s <src_dev> (source netdevice)\n");
|
||||
fprintf(stderr, " -d <dst_dev> (destination netdevice)\n");
|
||||
fprintf(stderr, " -s <src_dev> (source netdevice)\n");
|
||||
fprintf(stderr, " -d <dst_dev> (destination netdevice)\n");
|
||||
fprintf(stderr, "Options:\n");
|
||||
fprintf(stderr, " -X (this is a CAN FD rule)\n");
|
||||
fprintf(stderr, " -t (preserve src_dev rx timestamp)\n");
|
||||
fprintf(stderr, " -e (echo sent frames - recommended on vcanx)\n");
|
||||
fprintf(stderr, " -i (allow to route to incoming interface)\n");
|
||||
fprintf(stderr, " -u <uid> (user defined modification identifier)\n");
|
||||
fprintf(stderr, " -l <hops> (limit the number of frame hops / routings)\n");
|
||||
fprintf(stderr, " -f <filter> (set CAN filter)\n");
|
||||
fprintf(stderr, " -m <mod> (set Classic CAN frame modifications)\n");
|
||||
fprintf(stderr, " -M <MOD> (set CAN FD frame modifications)\n");
|
||||
fprintf(stderr, " -x <from_idx>:<to_idx>:<result_idx>:<init_xor_val> (XOR checksum)\n");
|
||||
fprintf(stderr, " -c <from>:<to>:<result>:<init_val>:<xor_val>:<crctab[256]> (CRC8 cs)\n");
|
||||
fprintf(stderr, " -p <profile>:[<profile_data>] (CRC8 checksum profile & parameters)\n");
|
||||
fprintf(stderr, " -X (this is a CAN FD rule)\n");
|
||||
fprintf(stderr, " -t (preserve src_dev rx timestamp)\n");
|
||||
fprintf(stderr, " -e (echo sent frames - recommended on vcanx)\n");
|
||||
fprintf(stderr, " -i (allow to route to incoming interface)\n");
|
||||
fprintf(stderr, " -u <uid> (user defined modification identifier)\n");
|
||||
fprintf(stderr, " -l <hops> (limit the number of frame hops / routings)\n");
|
||||
fprintf(stderr, " -f <filter> (set CAN filter)\n");
|
||||
fprintf(stderr, " -m <mod> (set Classic CAN frame modifications)\n");
|
||||
fprintf(stderr, " -M <MOD> (set CAN FD frame modifications)\n");
|
||||
fprintf(stderr, " -x <from_idx>:<to_idx>:<result_idx>:<init_xor_val> (XOR checksum)\n");
|
||||
fprintf(stderr, " -c <from>:<to>:<result>:<init_val>:<xor_val>:<crctab[256]> (CRC8 cs)\n");
|
||||
fprintf(stderr, " -p <profile>:[<profile_data>] (CRC8 checksum profile & parameters)\n");
|
||||
fprintf(stderr, "\nValues are given and expected in hexadecimal values. Leading 0s can be omitted.\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "<filter> is a <value><mask> CAN identifier filter:\n");
|
||||
fprintf(stderr, " <can_id>:<can_mask>\t(matches when <received_can_id> & mask == can_id & mask)\n");
|
||||
fprintf(stderr, " <can_id>~<can_mask>\t(matches when <received_can_id> & mask != can_id & mask)\n");
|
||||
fprintf(stderr, " <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)\n");
|
||||
fprintf(stderr, " <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "<mod> is a CAN frame modification instruction consisting of\n");
|
||||
fprintf(stderr, "<instruction>:<can_frame-elements>:<can_id>.<can_dlc>.<can_data>\n");
|
||||
fprintf(stderr, " <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\n");
|
||||
fprintf(stderr, " <can_frame-elements> is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata\n");
|
||||
fprintf(stderr, " <can_id> is an u32 value containing the CAN Identifier\n");
|
||||
fprintf(stderr, " <can_dlc> is an u8 value containing the data length code (0 .. 8)\n");
|
||||
fprintf(stderr, " <can_data> is always eight(!) u8 values containing the CAN frames data\n");
|
||||
fprintf(stderr, " <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\n");
|
||||
fprintf(stderr, " <can_frame-elements> is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata\n");
|
||||
fprintf(stderr, " <can_id> is an u32 value containing the CAN Identifier\n");
|
||||
fprintf(stderr, " <can_dlc> is an u8 value containing the data length code (0 .. 8)\n");
|
||||
fprintf(stderr, " <can_data> is always eight(!) u8 values containing the CAN frames data\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "<MOD> is a CAN FD frame modification instruction consisting of\n");
|
||||
fprintf(stderr, "<instruction>:<canfd_frame-elements>:<can_id>.<flags>.<len>.<can_data>\n");
|
||||
|
|
@ -270,9 +270,9 @@ void print_usage(char *prg)
|
|||
fprintf(stderr, "The max. four modifications are performed in the order AND -> OR -> XOR -> SET\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "Supported CRC 8 profiles:\n");
|
||||
fprintf(stderr, " Profile '%d' (1U8) - add one additional u8 value\n", CGW_CRC8PRF_1U8);
|
||||
fprintf(stderr, " Profile '%d' (16U8) - add u8 value from table[16] indexed by (data[1] & 0xF)\n", CGW_CRC8PRF_16U8);
|
||||
fprintf(stderr, " Profile '%d' (SFFID_XOR) - add u8 value (can_id & 0xFF) ^ (can_id >> 8 & 0xFF)\n", CGW_CRC8PRF_SFFID_XOR);
|
||||
fprintf(stderr, " Profile '%d' (1U8) add one additional u8 value\n", CGW_CRC8PRF_1U8);
|
||||
fprintf(stderr, " Profile '%d' (16U8) add u8 value from table[16] indexed by (data[1] & 0xF)\n", CGW_CRC8PRF_16U8);
|
||||
fprintf(stderr, " Profile '%d' (SFFID_XOR) add u8 value (can_id & 0xFF) ^ (can_id >> 8 & 0xFF)\n", CGW_CRC8PRF_SFFID_XOR);
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "Examples:\n");
|
||||
fprintf(stderr, "%s -A -s can0 -d vcan3 -e -f 123:C00007FF -m SET:IL:333.4.1122334455667788\n", prg);
|
||||
|
|
|
|||
Loading…
Reference in New Issue