RTEMS CPU Kit with SuperCore  4.11.3
Data Structures | Macros | Functions | Variables
main_ping.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/uio.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netinet/ip_var.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
#include <math.h>
#include <netdb.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "err.h"
#include "sysexits.h"
#include <sys/select.h>
Include dependency graph for main_ping.c:

Data Structures

struct  tv32
 

Macros

#define INADDR_LEN   ((int)sizeof(in_addr_t))
 
#define TIMEVAL_LEN   ((int)sizeof(struct tv32))
 
#define MASK_LEN   (ICMP_MASKLEN - ICMP_MINLEN)
 
#define TS_LEN   (ICMP_TSLEN - ICMP_MINLEN)
 
#define DEFDATALEN   56 /* default data length */
 
#define FLOOD_BACKOFF   20000 /* usecs to back off if F_FLOOD mode */
 
#define MAXIPLEN   (sizeof(struct ip) + MAX_IPOPTLEN)
 
#define MAXICMPLEN   (ICMP_ADVLENMIN + MAX_IPOPTLEN)
 
#define MAXWAIT   10000 /* max ms to wait for response */
 
#define MAXALARM   (60 * 60) /* max seconds for alarm timeout */
 
#define MAXTOS   255
 
#define A(bit)   rcvd_tbl[(bit)>>3] /* identify byte in array */
 
#define B(bit)   (1 << ((bit) & 0x07)) /* identify bit in byte */
 
#define SET(bit)   (A(bit) |= B(bit))
 
#define CLR(bit)   (A(bit) &= (~B(bit)))
 
#define TST(bit)   (A(bit) & B(bit))
 
#define F_FLOOD   0x0001
 
#define F_INTERVAL   0x0002
 
#define F_NUMERIC   0x0004
 
#define F_PINGFILLED   0x0008
 
#define F_QUIET   0x0010
 
#define F_RROUTE   0x0020
 
#define F_SO_DEBUG   0x0040
 
#define F_SO_DONTROUTE   0x0080
 
#define F_VERBOSE   0x0100
 
#define F_QUIET2   0x0200
 
#define F_NOLOOP   0x0400
 
#define F_MTTL   0x0800
 
#define F_MIF   0x1000
 
#define F_AUDIBLE   0x2000
 
#define F_TTL   0x8000
 
#define F_MISSED   0x10000
 
#define F_ONCE   0x20000
 
#define F_HDRINCL   0x40000
 
#define F_MASK   0x80000
 
#define F_TIME   0x100000
 
#define F_SWEEP   0x200000
 
#define F_WAITTIME   0x400000
 
#define MAX_DUP_CHK   (8 * 128)
 
#define SECOPT   ""
 

Functions

 __FBSDID ("$FreeBSD$")
 
void stopit (sig)
 

Variables

int options
 
int mx_dup_ck = MAX_DUP_CHK
 
char rcvd_tbl [MAX_DUP_CHK/8]
 
struct sockaddr_in whereto
 
int datalen = DEFDATALEN
 
int maxpayload
 
int s
 
u_char outpackhdr [IP_MAXPACKET]
 
u_char * outpack
 
char BBELL = '\a'
 
char BSPACE = '\b'
 
char DOT = '.'
 
char * hostname
 
char * shostname
 
int ident
 
int uid
 
u_char icmp_type = ICMP_ECHO
 
u_char icmp_type_rsp = ICMP_ECHOREPLY
 
int phdr_len = 0
 
int send_len
 
long nmissedmax
 
long npackets
 
long nreceived
 
long nrepeats
 
long ntransmitted
 
long snpackets
 
long snreceived
 
long sntransmitted
 
int sweepmax
 
int sweepmin = 0
 
int sweepincr = 1
 
int interval = 1000
 
int waittime = MAXWAIT
 
long nrcvtimeout = 0
 
int timing
 
double tmin = 999999999.0
 
double tmax = 0.0
 
double tsum = 0.0
 
double tsumsq = 0.0
 
volatile sig_atomic_t finish_up
 
volatile sig_atomic_t siginfo_p