int last_ttl; /* last TTL specified */
u_int32 addr_refid; /* IPv4 addr or IPv6 hash */
int num_mcast; /* No. of IP addresses in multicast socket */
+ u_long starttime; /* current_time as of creation of interface structure */
volatile long received; /* number of incoming packets */
long sent; /* number of outgoing packets */
long notsent; /* number of send failures */
int32 received; /* number of incoming packets */
int32 sent; /* number of outgoing packets */
int32 notsent; /* number of send failures */
+ int32 uptime; /* number of seconds this interface was active */
u_int32 scopeid; /* Scope used for Multicasting */
u_int32 ifindex; /* interface index - from system */
u_int32 ifnum; /* sequential interface number */
if (interface->fd != INVALID_SOCKET)
{
- msyslog(LOG_INFO, "Deleting interface #%d %s, %s#%d",
+ msyslog(LOG_INFO, "Deleting interface #%d %s, %s#%d, interface stats: received=%ld, sent=%ld, dropped=%ld, active_time=%ld secs",
interface->ifnum,
interface->name,
stoa((&interface->sin)),
- NTP_PORT); /* XXX should extract port from sin structure */
+ NTP_PORT, /* XXX should extract port from sin structure */
+ interface->received,
+ interface->sent,
+ interface->notsent,
+ current_time - interface->starttime);
+
close_and_delete_fd_from_list(interface->fd);
}
ifs->scopeid = htonl(interface->scopeid);
ifs->ifindex = htonl(interface->ifindex);
ifs->ifnum = htonl(interface->ifnum);
+ ifs->uptime = htonl(current_time - interface->starttime);
ifs->ignore_packets = interface->ignore_packets;
ifs->peercnt = htonl(interface->peercnt);
ifs->action = interface_info->action;
offsetof(errcnt) = 52
offsetof(stbcnt) = 56
-sizeof(struct info_if_stats) = 136
+sizeof(struct info_if_stats) = 140
offsetof(unaddr) = 0
offsetof(unbcast) = 16
offsetof(unmask) = 32
offsetof(received) = 100
offsetof(sent) = 104
offsetof(notsent) = 108
-offsetof(scopeid) = 112
-offsetof(ifindex) = 116
-offsetof(ifnum) = 120
-offsetof(ignore_packets) = 124
-offsetof(peercnt) = 128
-offsetof(action) = 132
+offsetof(uptime) = 112
+offsetof(scopeid) = 116
+offsetof(ifindex) = 120
+offsetof(ifnum) = 124
+offsetof(ignore_packets) = 128
+offsetof(peercnt) = 132
+offsetof(action) = 136
sizeof(struct info_dns_assoc) = 32
offsetof(peeraddr) = 0
(u_long)ntohl(ik->errcnt));
}
-#define IF_LIST_FMT "%2d %c %48s %c %c %12.12s %03x %3d %2d %5d %5d %5d %2d %2d %3d\n"
-#define IF_LIST_FMT_STR "%2s %c %48s %c %c %12.12s %3s %3s %2s %5s %5s %5s %2s %2s %3s\n"
+#define IF_LIST_FMT "%2d %c %48s %c %c %12.12s %03x %3d %2d %5d %5d %5d %2d %2d %3d %7d\n"
+#define IF_LIST_FMT_STR "%2s %c %48s %c %c %12.12s %3s %3s %2s %5s %5s %5s %2s %2s %3s %7s\n"
#define IF_LIST_AFMT_STR " %48s %c\n"
-#define IF_LIST_LABELS "#", 'A', "Address/Mask/Broadcast", 'T', 'E', "IF name", "Flg", "TL", "#M", "recv", "sent", "drop", "S", "IX", "PC"
-#define IF_LIST_LINE "=============================================================================================================\n"
+#define IF_LIST_LABELS "#", 'A', "Address/Mask/Broadcast", 'T', 'E', "IF name", "Flg", "TL", "#M", "recv", "sent", "drop", "S", "IX", "PC", "uptime"
+#define IF_LIST_LINE "=====================================================================================================================\n"
static void
iflist(
ntohl(ifs->notsent),
ntohl(ifs->scopeid),
ntohl(ifs->ifindex),
- ntohl(ifs->peercnt));
+ ntohl(ifs->peercnt),
+ ntohl(ifs->uptime));
if (!ntohl(ifs->v6_flag)) {
memcpy((char *)&GET_INADDR(saddr), (char *)&ifs->unbcast.addr, sizeof(ifs->unbcast.addr));