netstat.h revision 263335
1164640Sflz/*- 298186Sgordon * Copyright (c) 1992, 1993 378344Sobrien * Regents of the University of California. All rights reserved. 4157473Sflz * 578344Sobrien * Redistribution and use in source and binary forms, with or without 678344Sobrien * modification, are permitted provided that the following conditions 778344Sobrien * are met: 878344Sobrien * 1. Redistributions of source code must retain the above copyright 978344Sobrien * notice, this list of conditions and the following disclaimer. 1078344Sobrien * 2. Redistributions in binary form must reproduce the above copyright 1178344Sobrien * notice, this list of conditions and the following disclaimer in the 1278344Sobrien * documentation and/or other materials provided with the distribution. 1378344Sobrien * 4. Neither the name of the University nor the names of its contributors 1478344Sobrien * may be used to endorse or promote products derived from this software 1578344Sobrien * without specific prior written permission. 1678344Sobrien * 1778344Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1878344Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1978344Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2078344Sobrien * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2178344Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2278344Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2378344Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2478344Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2578344Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2678344Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2778344Sobrien * SUCH DAMAGE. 2878344Sobrien * 2978344Sobrien * @(#)netstat.h 8.2 (Berkeley) 1/4/94 3078344Sobrien * $FreeBSD: stable/10/usr.bin/netstat/netstat.h 263335 2014-03-19 09:36:29Z glebius $ 3178344Sobrien */ 3278344Sobrien 3378344Sobrien#include <sys/cdefs.h> 3478344Sobrien 3578344Sobrienextern int Aflag; /* show addresses of protocol control block */ 3678344Sobrienextern int aflag; /* show all sockets (including servers) */ 3778344Sobrienextern int bflag; /* show i/f total bytes in/out */ 3878344Sobrienextern int dflag; /* show i/f dropped packets */ 3978344Sobrienextern int gflag; /* show group (multicast) routing or stats */ 4078344Sobrienextern int hflag; /* show counters in human readable format */ 4178344Sobrienextern int iflag; /* show interfaces */ 42157473Sflzextern int Lflag; /* show size of listen queues */ 43169668Smtmextern int mflag; /* show memory stats */ 44157473Sflzextern int noutputs; /* how much outputs before we exit */ 4578344Sobrienextern int numeric_addr; /* show addresses numerically */ 4698186Sgordonextern int numeric_port; /* show ports numerically */ 4798186Sgordonextern int rflag; /* show routing tables (or routing stats) */ 4898186Sgordonextern int sflag; /* show protocol statistics */ 49131550Scpercivaextern int Tflag; /* show TCP control block info */ 50131550Scpercivaextern int Wflag; /* wide display */ 51131550Scpercivaextern int xflag; /* extended display, includes all socket buffer info */ 52131550Scpercivaextern int zflag; /* zero stats */ 5398186Sgordon 5498186Sgordonextern int interval; /* repeat interval for i/f stats */ 5598186Sgordon 56103018Sgordonextern char *interface; /* desired i/f for stats, or NULL for all i/fs */ 57124832Smtmextern int unit; /* unit number for above */ 58124832Smtm 59161435Syarextern int live; /* true if we are examining a live system */ 60161435Syar 6198186Sgordonstruct nlist; 62103018Sgordonint kread(u_long addr, void *buf, size_t size); 6398186Sgordonint kread_counters(u_long addr, void *buf, size_t size); 6498186Sgordonint kresolve_list(struct nlist *); 6598186Sgordonconst char *plural(uintmax_t); 6698186Sgordonconst char *plurales(uintmax_t); 6798186Sgordonconst char *pluralies(uintmax_t); 6898186Sgordon 6998186Sgordonstruct sockaddr; 7098186Sgordonstruct socket; 7198186Sgordonstruct xsocket; 7278344Sobrienint sotoxsocket(struct socket *, struct xsocket *); 7378344Sobrienvoid protopr(u_long, const char *, int, int); 7478344Sobrienvoid tcp_stats(u_long, const char *, int, int); 7578344Sobrienvoid udp_stats(u_long, const char *, int, int); 7698186Sgordon#ifdef SCTP 7798186Sgordonvoid sctp_protopr(u_long, const char *, int, int); 7898186Sgordonvoid sctp_stats(u_long, const char *, int, int); 7998186Sgordon#endif 8098186Sgordonvoid arp_stats(u_long, const char *, int, int); 8198186Sgordonvoid ip_stats(u_long, const char *, int, int); 8298186Sgordonvoid icmp_stats(u_long, const char *, int, int); 8398186Sgordonvoid igmp_stats(u_long, const char *, int, int); 8498186Sgordonvoid pim_stats(u_long, const char *, int, int); 8598186Sgordonvoid carp_stats(u_long, const char *, int, int); 8698186Sgordonvoid pfsync_stats(u_long, const char *, int, int); 8798186Sgordon#ifdef IPSEC 8898186Sgordonvoid ipsec_stats(u_long, const char *, int, int); 8998186Sgordonvoid esp_stats(u_long, const char *, int, int); 9098186Sgordonvoid ah_stats(u_long, const char *, int, int); 9198186Sgordonvoid ipcomp_stats(u_long, const char *, int, int); 9298186Sgordon#endif 93103018Sgordon 9498186Sgordon#ifdef INET6 9598186Sgordonvoid ip6_stats(u_long, const char *, int, int); 9698186Sgordonvoid ip6_ifstats(char *); 9798186Sgordonvoid icmp6_stats(u_long, const char *, int, int); 9898186Sgordonvoid icmp6_ifstats(char *); 9998186Sgordonvoid pim6_stats(u_long, const char *, int, int); 10098186Sgordonvoid rip6_stats(u_long, const char *, int, int); 10198186Sgordonvoid mroute6pr(void); 10298186Sgordonvoid mrt6_stats(void); 10398186Sgordon 10498186Sgordonstruct sockaddr_in6; 10598186Sgordonstruct in6_addr; 10698186Sgordonvoid in6_fillscopeid(struct sockaddr_in6 *); 10798186Sgordonchar *routename6(struct sockaddr_in6 *); 10898186Sgordonconst char *netname6(struct sockaddr_in6 *, struct in6_addr *); 10998186Sgordonvoid inet6print(struct in6_addr *, int, const char *, int); 11098186Sgordon#endif /*INET6*/ 11198186Sgordon 11298186Sgordon#ifdef IPSEC 11398186Sgordonvoid pfkey_stats(u_long, const char *, int, int); 11498186Sgordon#endif 11598186Sgordon 11698186Sgordonvoid mbpr(void *, u_long); 11798186Sgordon 118146490Sschweikhvoid netisr_stats(void *); 11998186Sgordon 12098186Sgordonvoid hostpr(u_long, u_long); 12198186Sgordonvoid impstats(u_long, u_long); 12298186Sgordon 12398186Sgordonvoid intpr(int, void (*)(char *), int); 12498186Sgordon 12598186Sgordonvoid pr_rthdr(int); 12678344Sobrienvoid pr_family(int); 12778344Sobrienvoid rt_stats(void); 12878344Sobrienvoid flowtable_stats(void); 12978344Sobrienchar *ipx_pnet(struct sockaddr *); 13078344Sobrienchar *ipx_phost(struct sockaddr *); 13178344Sobrienchar *ns_phost(struct sockaddr *); 13278344Sobrienvoid upHex(char *); 13398186Sgordon 13478344Sobrienchar *routename(in_addr_t); 13578344Sobrienchar *netname(in_addr_t, in_addr_t); 13678344Sobrienchar *atalk_print(struct sockaddr *, int); 13778344Sobrienchar *atalk_print2(struct sockaddr *, struct sockaddr *, int); 13878344Sobrienchar *ipx_print(struct sockaddr *); 13978344Sobrienchar *ns_print(struct sockaddr *); 14078344Sobrienvoid routepr(int, int); 14178344Sobrien 14278344Sobrienvoid ipxprotopr(u_long, const char *, int, int); 14378344Sobrienvoid spx_stats(u_long, const char *, int, int); 14478344Sobrienvoid ipx_stats(u_long, const char *, int, int); 14578344Sobrienvoid ipxerr_stats(u_long, const char *, int, int); 146157473Sflz 14778344Sobrienvoid nsprotopr(u_long, const char *, int, int); 14878344Sobrienvoid spp_stats(u_long, const char *, int, int); 14978344Sobrienvoid idp_stats(u_long, const char *, int, int); 15078344Sobrienvoid nserr_stats(u_long, const char *, int, int); 15178344Sobrien 152157473Sflzvoid atalkprotopr(u_long, const char *, int, int); 15398186Sgordonvoid ddp_stats(u_long, const char *, int, int); 15498186Sgordon 15578344Sobrien#ifdef NETGRAPH 15698186Sgordonvoid netgraphprotopr(u_long, const char *, int, int); 15798186Sgordon#endif 15898186Sgordon 159126286Smtmvoid unixpr(u_long, u_long, u_long, u_long, u_long); 16098186Sgordon 16198186Sgordonvoid esis_stats(u_long, const char *, int, int); 16298186Sgordonvoid clnp_stats(u_long, const char *, int, int); 16398186Sgordonvoid cltp_stats(u_long, const char *, int, int); 16498186Sgordonvoid iso_protopr(u_long, const char *, int, int); 165169668Smtmvoid iso_protopr1(u_long, int); 166169668Smtmvoid tp_protopr(u_long, const char *, int, int); 167169668Smtmvoid tp_inproto(u_long); 168169668Smtmvoid tp_stats(caddr_t, caddr_t); 16978344Sobrien 170169668Smtmvoid mroutepr(void); 171169668Smtmvoid mrt_stats(void); 172169668Smtmvoid bpf_stats(char *); 173169668Smtm