#define TIME_MICROS(TM) (((int64_t) (TM)->tv_sec * 1000000) + (TM)->tv_usec )
#define DIFF_MICROS(TM1,TM2) ( TIME_MICROS(TM1) - TIME_MICROS(TM2) )
-// RECENT(T,M) is the time logic for requiring a gap time (in
+// RECENT_MICROS(T,M) is the time logic for requiring a gap time (in
// milliseconds) before shifting a MAC to a new remote. The limit is
-// 6000 for broadcast and 20000 for unicast.
-#define RECENT(T,M) ((M) < ((T)? 6000 : 20000 ))
+// 6s for broadcast and 20s for unicast.
+#define RECENT_MICROS(T,M) ((M) < ((T)? 6000000 : 20000000 ))
// VERYOLD_MICROSS is used for discarding downlink remotes whose latest
// activity is older than this.
// The packet source MAC has arrived on other than its
// previous channel. It thus gets dropped if tap/stdin is the
// primary channel, or the time since the last packet for that
- // interface is less than RECENT, with different limits for
- // broadcast and unicast.
+ // interface is less than RECENT_MICROS, with different limits
+ // for broadcast and unicast.
int64_t dmac = DIFF_MICROS( &now, &x->rec_when);
- if ( x->remote->spec == 0 || RECENT( *buf & 1, dmac ) ) {
+ if ( x->remote->spec == 0 || RECENT_MICROS( *buf & 1, dmac ) ) {
if ( verbose >= 2 ) {
fprintf(
stderr,