fprintf(stderr, " -d <dst_dev> (destination netdevice)\n");
fprintf(stderr, "Options: -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, " -f <filter> (set CAN filter)\n");
fprintf(stderr, " -m <mod> (set frame modifications)\n");
fprintf(stderr, " -x <from_idx>:<to_idx>:<result_idx>:<init_xor_val> (XOR checksum)\n");
struct nlmsghdr *nlh;
unsigned int src_ifindex = 0;
unsigned int dst_ifindex = 0;
- __u32 handled, dropped;
+ __u32 handled, dropped, deleted;
int rtlen;
handled = 0;
dropped = 0;
+ deleted = 0;
src_ifindex = 0;
dst_ifindex = 0;
dropped = *(__u32 *)RTA_DATA(rta);
break;
+ case CGW_DELETED:
+ deleted = *(__u32 *)RTA_DATA(rta);
+ break;
+
default:
printf("Unknown attribute %d!", rta->rta_type);
return -EINVAL;
if (rtc->flags & CGW_FLAGS_CAN_SRC_TSTAMP)
printf("-t ");
+ if (rtc->flags & CGW_FLAGS_CAN_IIF_TX_OK)
+ printf("-i ");
+
/* second parse for mod attributes */
rta = (struct rtattr *) RTCAN_RTA(rtc);
rtlen = RTCAN_PAYLOAD(nlh);
case CGW_DST_IF:
case CGW_HANDLED:
case CGW_DROPPED:
+ case CGW_DELETED:
break;
default:
}
}
- printf("# %d handled %d dropped\n", handled, dropped); /* end of entry */
+ /* end of entry */
+ printf("# %d handled %d dropped %d deleted\n",
+ handled, dropped, deleted);
/* jump to next NLMSG in the given buffer */
nlh = NLMSG_NEXT(nlh, len);
memset(&cs_xor, 0, sizeof(cs_xor));
memset(&cs_crc8, 0, sizeof(cs_crc8));
- while ((opt = getopt(argc, argv, "ADFLs:d:tef:c:p:x:m:?")) != -1) {
+ while ((opt = getopt(argc, argv, "ADFLs:d:teif:c:p:x:m:?")) != -1) {
switch (opt) {
case 'A':
flags |= CGW_FLAGS_CAN_ECHO;
break;
+ case 'i':
+ flags |= CGW_FLAGS_CAN_IIF_TX_OK;
+ break;
+
case 'f':
if (sscanf(optarg, "%x:%x", &filter.can_id,
&filter.can_mask) == 2) {
CGW_SRC_IF, /* ifindex of source network interface */
CGW_DST_IF, /* ifindex of destination network interface */
CGW_FILTER, /* specify struct can_filter on source CAN device */
+ CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */
__CGW_MAX
};
#define CGW_FLAGS_CAN_ECHO 0x01
#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02
+#define CGW_FLAGS_CAN_IIF_TX_OK 0x04
#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */