| 1 |
/* |
| 2 |
* $OpenBSD: netstat.h,v 1.31 2005/02/10 14:25:08 itojun Exp $ |
| 3 |
*/ |
| 4 |
/* |
| 5 |
* $NetBSD: netstat.h,v 1.6 1996/05/07 02:55:05 thorpej Exp $ |
| 6 |
*/ |
| 7 |
|
| 8 |
/* |
| 9 |
* Copyright (c) 1992, 1993 |
| 10 |
* Regents of the University of California. All rights reserved. |
| 11 |
* |
| 12 |
* Redistribution and use in source and binary forms, with or without |
| 13 |
* modification, are permitted provided that the following conditions |
| 14 |
* are met: |
| 15 |
* 1. Redistributions of source code must retain the above copyright |
| 16 |
* notice, this list of conditions and the following disclaimer. |
| 17 |
* 2. Redistributions in binary form must reproduce the above copyright |
| 18 |
* notice, this list of conditions and the following disclaimer in the |
| 19 |
* documentation and/or other materials provided with the distribution. |
| 20 |
* 3. Neither the name of the University nor the names of its contributors |
| 21 |
* may be used to endorse or promote products derived from this software |
| 22 |
* without specific prior written permission. |
| 23 |
* |
| 24 |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
| 25 |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 26 |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 27 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
| 28 |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 29 |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 30 |
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 31 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 32 |
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
| 33 |
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 34 |
* SUCH DAMAGE. |
| 35 |
* |
| 36 |
* from: @(#)netstat.h 8.2 (Berkeley) 1/4/94 |
| 37 |
*/ |
| 38 |
|
| 39 |
#ifdef HAVE_SYS_CDEFS_H |
| 40 |
#include <sys/cdefs.h> |
| 41 |
#endif |
| 42 |
|
| 43 |
/* |
| 44 |
* What is the max length of a pointer printed with %p (including 0x)? |
| 45 |
*/ |
| 46 |
#define PLEN (LONG_BIT / 4 + 2) |
| 47 |
|
| 48 |
extern int aflag; /* show all sockets (including servers) */ |
| 49 |
extern int bflag; /* show bytes instead of packets */ |
| 50 |
extern int dflag; /* show i/f dropped packets */ |
| 51 |
extern int gflag; /* show group (multicast) routing or stats */ |
| 52 |
extern int iflag; /* show interfaces */ |
| 53 |
extern int lflag; /* show routing table with use and ref */ |
| 54 |
extern int Lflag; /* Legacy mibs */ |
| 55 |
extern int mflag; /* show memory stats */ |
| 56 |
extern int nflag; /* show addresses numerically */ |
| 57 |
extern int oflag; /* Open/Net-BSD style octet output */ |
| 58 |
extern int pflag; /* show given protocol */ |
| 59 |
extern int qflag; /* only display non-zero values for output */ |
| 60 |
extern int rflag; /* show routing tables (or routing stats) */ |
| 61 |
extern int Sflag; /* show source address in routing table */ |
| 62 |
extern int sflag; /* show protocol statistics */ |
| 63 |
extern int tflag; /* show i/f watchdog timers */ |
| 64 |
extern int vflag; /* be verbose */ |
| 65 |
|
| 66 |
extern int interval; /* repeat interval for i/f stats */ |
| 67 |
|
| 68 |
extern char *intrface; /* desired i/f for stats, or NULL for all i/fs */ |
| 69 |
|
| 70 |
extern int af; /* address family */ |
| 71 |
extern int max_getbulk; /* specifies the max-repeaters value to use with GETBULK requests */ |
| 72 |
|
| 73 |
extern char *__progname; /* program name, from crt0.o */ |
| 74 |
|
| 75 |
const char *plural(int); |
| 76 |
|
| 77 |
void tcpprotopr(const char *); |
| 78 |
void udpprotopr(const char *); |
| 79 |
void tcp_stats(const char *); |
| 80 |
void udp_stats(const char *); |
| 81 |
void ip_stats(const char *); |
| 82 |
void icmp_stats(const char *); |
| 83 |
|
| 84 |
void tcp6protopr(const char *); |
| 85 |
void udp6protopr(const char *); |
| 86 |
void ip6_stats(const char *); |
| 87 |
void icmp6_stats(const char *); |
| 88 |
|
| 89 |
void tcpxprotopr(const char *); |
| 90 |
void udpxprotopr(const char *); |
| 91 |
void listenxprotopr(const char *); |
| 92 |
void ipx_stats(const char *); |
| 93 |
void icmpx_stats(const char *); |
| 94 |
|
| 95 |
void pr_rthdr(int); |
| 96 |
void pr_encaphdr(void); |
| 97 |
void pr_family(int); |
| 98 |
void rt_stats(void); |
| 99 |
|
| 100 |
void get_ifname(char *, int); |
| 101 |
char *routename(in_addr_t); |
| 102 |
char *netname(in_addr_t, in_addr_t); |
| 103 |
char *ns_print(struct sockaddr *); |
| 104 |
void routepr(void); |
| 105 |
int route4pr(int); |
| 106 |
int route6pr(int); |
| 107 |
int routexpr(int); |
| 108 |
|
| 109 |
void intpr(int); |
| 110 |
void inetprint(const struct in_addr *, int, const char *, int); |
| 111 |
void inet6print(const struct in6_addr *, int, const char *, |
| 112 |
int); |