Commit 9c073fe0 authored by Mike Frysinger's avatar Mike Frysinger

statistics: sort tables statically (and constify)

Rather than do the sorting at runtime, run the tables through `sort`.
This lets us constify them and speed up runtime slightly.
parent 70c3a90b
......@@ -116,9 +116,7 @@
/* prototypes for statistics.c */
void parsesnmp(int, int, int);
void inittab(void);
void parsesnmp6(int, int, int);
void inittab6(void);
typedef enum {
SS_FREE = 0, /* not allocated */
......@@ -2099,14 +2097,12 @@ int main
if (!strcmp(afname, "inet")) {
#if HAVE_AFINET
inittab();
parsesnmp(flag_raw, flag_tcp, flag_udp);
#else
ENOSUPP("netstat", "AF INET");
#endif
} else if(!strcmp(afname, "inet6")) {
#if HAVE_AFINET6
inittab6();
parsesnmp6(flag_raw, flag_tcp, flag_udp);
#else
ENOSUPP("netstat", "AF INET6");
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment