Changeset View
Changeset View
Standalone View
Standalone View
head/usr.bin/systat/ip6.c
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | |||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#include <sys/sysctl.h> | #include <sys/sysctl.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <netinet/in_systm.h> | #include <netinet/in_systm.h> | ||||
#include <netinet/ip.h> | #include <netinet/ip.h> | ||||
#include <netinet6/ip6_var.h> | #include <netinet6/ip6_var.h> | ||||
#include <inttypes.h> | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <paths.h> | #include <paths.h> | ||||
#include "systat.h" | #include "systat.h" | ||||
#include "extern.h" | #include "extern.h" | ||||
#include "mode.h" | #include "mode.h" | ||||
▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | #define DO(stat) ret->stat = (curstat.stat - sub->stat) / divisor | ||||
DO(ip6s_sources_none); | DO(ip6s_sources_none); | ||||
#undef DO | #undef DO | ||||
} | } | ||||
void | void | ||||
showip6(void) | showip6(void) | ||||
{ | { | ||||
struct ip6stat stats; | struct ip6stat stats; | ||||
u_long totalout; | uint64_t totalout; | ||||
domode(&stats); | domode(&stats); | ||||
totalout = stats.ip6s_forward + stats.ip6s_localout; | totalout = stats.ip6s_forward + stats.ip6s_localout; | ||||
#define DO(stat, row, col) \ | #define DO(stat, row, col) \ | ||||
mvwprintw(wnd, row, col, "%9lu", stats.stat) | mvwprintw(wnd, row, col, "%9"PRIu64, stats.stat) | ||||
DO(ip6s_total, 1, 0); | DO(ip6s_total, 1, 0); | ||||
mvwprintw(wnd, 1, 35, "%9lu", totalout); | mvwprintw(wnd, 1, 35, "%9"PRIu64, totalout); | ||||
DO(ip6s_tooshort, 2, 0); | DO(ip6s_tooshort, 2, 0); | ||||
DO(ip6s_localout, 2, 35); | DO(ip6s_localout, 2, 35); | ||||
DO(ip6s_toosmall, 3, 0); | DO(ip6s_toosmall, 3, 0); | ||||
DO(ip6s_odropped, 3, 35); | DO(ip6s_odropped, 3, 35); | ||||
DO(ip6s_badvers, 4, 0); | DO(ip6s_badvers, 4, 0); | ||||
DO(ip6s_ofragments, 4, 35); | DO(ip6s_ofragments, 4, 35); | ||||
DO(ip6s_fragments, 5, 0); | DO(ip6s_fragments, 5, 0); | ||||
DO(ip6s_cantfrag, 5, 35); | DO(ip6s_cantfrag, 5, 35); | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |