#include "netlink.h"
static ieee154_saddr_t my_short_addr;
+static uint16_t current_seqno;
extern struct in6_addr __my_address;
char proxy_dev[IFNAMSIZ], tun_dev[IFNAMSIZ];
fclose(fd);
}
+ if ((fd = fopen("/var/run/ip-driver.seq", "r")) != NULL) {
+ if (fscanf(fd, "%hi\n", ¤t_seqno) != 1) {
+ current_seqno = 0;
+ }
+ fclose(fd);
+ }
+
return (mcast_sock >= 0) ? 0 : -1;
}
return ret;
}
+
+uint16_t routing_get_seqno() {
+ return current_seqno;
+}
+
+uint16_t routing_incr_seqno() {
+ FILE *fd;
+ ++current_seqno;
+ if ((fd = fopen("/var/run/ip-driver.seq", "w")) != NULL) {
+ fprintf(fd, "%hi\n", current_seqno);
+ fclose(fd);
+ }
+ return current_seqno;
+}