#include <arpa/inet.h>
#include <fcntl.h>
#include <errno.h>
+#include <signal.h>
#ifndef SO_BUSY_POLL
#define SO_BUSY_POLL 46
int (*out_fn)(struct out_ctx *ctx, struct can_frame *cf);
};
+struct stats {
+ int store;
+ int send;
+} stats;
+
+void sigint(int v)
+{
+ printf("store:%d\nsend:%d\ntotal:%d\n",
+ stats.store, stats.send, stats.store + stats.send);
+ exit(0);
+}
+
enum in2out in_read(struct in_ctx *ctx, struct can_frame *cf)
{
int ret = read(ctx->s, cf, sizeof(*cf));
if (optind+1 < argc)
devout = argv[optind+1];
+ signal(SIGINT, sigint);
gw();
return 0;