diff --git a/cangw.c b/cangw.c index a6b1697..af4d862 100644 --- a/cangw.c +++ b/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 (source netdevice)\n"); - fprintf(stderr, " -d (destination netdevice)\n"); + fprintf(stderr, " -s (source netdevice)\n"); + fprintf(stderr, " -d (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 (user defined modification identifier)\n"); - fprintf(stderr, " -l (limit the number of frame hops / routings)\n"); - fprintf(stderr, " -f (set CAN filter)\n"); - fprintf(stderr, " -m (set Classic CAN frame modifications)\n"); - fprintf(stderr, " -M (set CAN FD frame modifications)\n"); - fprintf(stderr, " -x ::: (XOR checksum)\n"); - fprintf(stderr, " -c ::::: (CRC8 cs)\n"); - fprintf(stderr, " -p :[] (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 (user defined modification identifier)\n"); + fprintf(stderr, " -l (limit the number of frame hops / routings)\n"); + fprintf(stderr, " -f (set CAN filter)\n"); + fprintf(stderr, " -m (set Classic CAN frame modifications)\n"); + fprintf(stderr, " -M (set CAN FD frame modifications)\n"); + fprintf(stderr, " -x ::: (XOR checksum)\n"); + fprintf(stderr, " -c ::::: (CRC8 cs)\n"); + fprintf(stderr, " -p :[] (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, " is a CAN identifier filter:\n"); - fprintf(stderr, " :\t(matches when & mask == can_id & mask)\n"); - fprintf(stderr, " ~\t(matches when & mask != can_id & mask)\n"); + fprintf(stderr, " : (matches when & mask == can_id & mask)\n"); + fprintf(stderr, " ~ (matches when & mask != can_id & mask)\n"); fprintf(stderr, "\n"); fprintf(stderr, " is a CAN frame modification instruction consisting of\n"); fprintf(stderr, "::..\n"); - fprintf(stderr, " is one of 'AND' 'OR' 'XOR' 'SET'\n"); - fprintf(stderr, " is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata\n"); - fprintf(stderr, " is an u32 value containing the CAN Identifier\n"); - fprintf(stderr, " is an u8 value containing the data length code (0 .. 8)\n"); - fprintf(stderr, " is always eight(!) u8 values containing the CAN frames data\n"); + fprintf(stderr, " is one of 'AND' 'OR' 'XOR' 'SET'\n"); + fprintf(stderr, " is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata\n"); + fprintf(stderr, " is an u32 value containing the CAN Identifier\n"); + fprintf(stderr, " is an u8 value containing the data length code (0 .. 8)\n"); + fprintf(stderr, " is always eight(!) u8 values containing the CAN frames data\n"); fprintf(stderr, "\n"); fprintf(stderr, " is a CAN FD frame modification instruction consisting of\n"); fprintf(stderr, "::...\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);