Annotation of embedaddon/mtr/net.h, revision 1.1
1.1 ! misho 1: /*
! 2: mtr -- a network diagnostic tool
! 3: Copyright (C) 1997,1998 Matt Kimball
! 4:
! 5: This program is free software; you can redistribute it and/or modify
! 6: it under the terms of the GNU General Public License version 2 as
! 7: published by the Free Software Foundation.
! 8:
! 9: This program is distributed in the hope that it will be useful,
! 10: but WITHOUT ANY WARRANTY; without even the implied warranty of
! 11: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 12: GNU General Public License for more details.
! 13:
! 14: You should have received a copy of the GNU General Public License
! 15: along with this program; if not, write to the Free Software
! 16: Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
! 17: */
! 18:
! 19: /* Prototypes for functions in net.c */
! 20: #include <netdb.h>
! 21: #include <arpa/inet.h>
! 22: #include <netinet/in.h>
! 23: #include <sys/socket.h>
! 24: #ifdef ENABLE_IPV6
! 25: #include <netinet/ip6.h>
! 26: #include <netinet/icmp6.h>
! 27: #endif
! 28:
! 29: int net_preopen(void);
! 30: int net_selectsocket(void);
! 31: int net_open(struct hostent *host);
! 32: void net_reopen(struct hostent *address);
! 33: int net_set_interfaceaddress (char *InterfaceAddress);
! 34: void net_reset(void);
! 35: void net_close(void);
! 36: int net_waitfd(void);
! 37: void net_process_return(void);
! 38: void net_harvest_fds(void);
! 39:
! 40: int net_max(void);
! 41: int net_min(void);
! 42: int net_last(int at);
! 43: ip_t * net_addr(int at);
! 44: void * net_mpls(int at);
! 45: void * net_mplss(int, int);
! 46: int net_loss(int at);
! 47: int net_drop(int at);
! 48: int net_last(int at);
! 49: int net_best(int at);
! 50: int net_worst(int at);
! 51: int net_avg(int at);
! 52: int net_gmean(int at);
! 53: int net_stdev(int at);
! 54: int net_jitter(int at);
! 55: int net_jworst(int at);
! 56: int net_javg(int at);
! 57: int net_jinta(int at);
! 58: ip_t * net_addrs(int at, int i);
! 59: char *net_localaddr(void);
! 60:
! 61: int net_send_batch(void);
! 62: void net_end_transit(void);
! 63:
! 64: int calc_deltatime (float WaitTime);
! 65:
! 66: int net_returned(int at);
! 67: int net_xmit(int at);
! 68: int net_transit(int at);
! 69:
! 70: int net_up(int at);
! 71:
! 72: #define SAVED_PINGS 200
! 73: int* net_saved_pings(int at);
! 74: void net_save_xmit(int at);
! 75: void net_save_return(int at, int seq, int ms);
! 76: int net_duplicate(int at, int seq);
! 77:
! 78: void sockaddrtop( struct sockaddr * saddr, char * strptr, size_t len );
! 79: int addrcmp( char * a, char * b, int af );
! 80: void addrcpy( char * a, char * b, int af );
! 81:
! 82: void net_add_fds(fd_set *writefd, int *maxfd);
! 83: void net_process_fds(fd_set *writefd);
! 84:
! 85: #define MAXPATH 8
! 86: #define MaxHost 256
! 87: #define MinSequence 33000
! 88: #define MaxSequence 65536
! 89: #define MinPort 1024
! 90:
! 91: #define MAXPACKET 4470 /* largest test packet size */
! 92: #define MINPACKET 28 /* 20 bytes IP header and 8 bytes ICMP or UDP */
! 93: #define MAXLABELS 8 /* http://kb.juniper.net/KB2190 (+ 3 just in case) */
! 94:
! 95: /* stuff used by display such as report, curses... */
! 96: #define MAXFLD 20 /* max stats fields to display */
! 97:
! 98: #if defined (__STDC__) && __STDC__
! 99: #define CONST const
! 100: #else
! 101: #define CONST /* */
! 102: #endif
! 103:
! 104:
! 105: /* XXX This doesn't really belong in this header file, but as the
! 106: right c-files include it, it will have to do for now. */
! 107:
! 108: /* dynamic field drawing */
! 109: struct fields {
! 110: CONST unsigned char key;
! 111: CONST char *descr;
! 112: CONST char *title;
! 113: CONST char *format;
! 114: int length;
! 115: int (*net_xxx)();
! 116: };
! 117:
! 118: extern struct fields data_fields[MAXFLD];
! 119:
! 120:
! 121: /* keys: the value in the array is the index number in data_fields[] */
! 122: extern int fld_index[];
! 123: extern unsigned char fld_active[];
! 124: extern char available_options[];
! 125:
! 126: ip_t unspec_addr;
! 127:
! 128: /* MPLS label object */
! 129: struct mplslen {
! 130: unsigned long label[MAXLABELS]; /* label value */
! 131: uint8 exp[MAXLABELS]; /* experimental bits */
! 132: uint8 ttl[MAXLABELS]; /* MPLS TTL */
! 133: char s[MAXLABELS]; /* bottom of stack */
! 134: char labels; /* how many labels did we get? */
! 135: };
! 136:
! 137: void decodempls(int, char *, struct mplslen *, int);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>