diff options
author | brooks <brooks@FreeBSD.org> | 2004-09-08 04:50:55 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2004-09-08 04:50:55 +0000 |
commit | 143d77da28b1eae3998141ecdbf493f35562a44e (patch) | |
tree | a7d4a1fc271674863cbdba33a966ff9ffbd7cf3d | |
parent | daf9c8d7593cfe8d6117f47b81c179d3198595ff (diff) | |
download | FreeBSD-src-143d77da28b1eae3998141ecdbf493f35562a44e.zip FreeBSD-src-143d77da28b1eae3998141ecdbf493f35562a44e.tar.gz |
Re-add ifi_epoch, to struct if_data, this time replacing ifi_unused
to avoid ABI changes. It is set to the last time the interface
counters were zeroed, currently the time if_attach() was called. It is
intentended to be a valid value for RFC2233's ifCounterDiscontinuityTime
and to make it easier for applications to verify that the interface they
find at a given index is the one that was there last time they looked.
Due to space constraints ifi_epoch is a time_t rather then a struct
timeval. SNMP would prefer higher precision, but this unlikely to be
useful in practice.
-rw-r--r-- | sys/net/if.c | 1 | ||||
-rw-r--r-- | sys/net/if.h | 5 | ||||
-rw-r--r-- | sys/sys/param.h | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 1ba833e..7a84bf8 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -384,6 +384,7 @@ if_attach(struct ifnet *ifp) TAILQ_INIT(&ifp->if_multiaddrs); knlist_init(&ifp->if_klist, NULL); getmicrotime(&ifp->if_lastchange); + ifp->if_data.ifi_epoch = time_second; #ifdef MAC mac_init_ifnet(ifp); diff --git a/sys/net/if.h b/sys/net/if.h index 8b32fd1..77ffb1a 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -102,7 +102,10 @@ struct if_data { u_long ifi_iqdrops; /* dropped on input, this interface */ u_long ifi_noproto; /* destined for unsupported protocol */ u_long ifi_hwassist; /* HW offload capabilities */ - u_long ifi_unused; /* XXX was ifi_xmittiming */ + time_t ifi_epoch; /* time of attach or stat reset */ +#ifdef __alpha__ + u_int ifi_timepad; /* time_t is int, not long on alpha */ +#endif struct timeval ifi_lastchange; /* time of last administrative change */ }; diff --git a/sys/sys/param.h b/sys/sys/param.h index 7fad9e9..8b062df 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -57,7 +57,7 @@ * is created, otherwise 1. */ #undef __FreeBSD_version -#define __FreeBSD_version 600002 /* Master, propagated to newvers */ +#define __FreeBSD_version 600003 /* Master, propagated to newvers */ #ifndef LOCORE #include <sys/types.h> |