The Netsukuku Project  0.0.9
An Alternative routing method
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
libping.c File Reference
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <pthread.h>
#include <stdlib.h>
#include "libping.h"
#include "xmalloc.h"
#include "log.h"
Include dependency graph for libping.c:

Macros

#define MAXPACKET   65535
 
#define PKTSIZE   64
 
#define HDRLEN   ICMP_MINLEN
 
#define DATALEN   (PKTSIZE-HDRLEN)
 
#define MAXDATA   (MAXPKT-HDRLEN-TIMLEN)
 
#define DEF_TIMEOUT   5
 
#define PROTO_BUF_LEN   1024
 

Functions

struct ping_priv ping_priv_default (void)
 
int elapsed_time (struct timeval *starttime)
 
void JOEfreeprotoent (struct protoent *p)
 
void JOEfreehostent (struct hostent *h)
 
static int in_checksum (u_short *buf, int len)
 
static int send_ping (const char *host, struct sockaddr_in *taddr, struct ping_priv *datum)
 
static int recv_ping (struct sockaddr_in *taddr, struct ping_priv *datum)
 
int myping (const char *hostname, int t, struct ping_priv *datum)
 
int pinghost (const char *hostname)
 
int pingthost (const char *hostname, int t)
 
int tpinghost (const char *hostname)
 
int tpingthost (const char *hostname, int t)
 

Macro Definition Documentation

#define DATALEN   (PKTSIZE-HDRLEN)
#define DEF_TIMEOUT   5
#define HDRLEN   ICMP_MINLEN
#define MAXDATA   (MAXPKT-HDRLEN-TIMLEN)
#define MAXPACKET   65535

PING module

Copyright (C) 2001 Jeffrey Fulmer jdful.nosp@m.mer@.nosp@m.armst.nosp@m.rong.nosp@m..com This file is part of LIBPING

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


This code has been lightly modified to adapt it in the Netsukuku source code.

#define PKTSIZE   64
#define PROTO_BUF_LEN   1024

Function Documentation

int elapsed_time ( struct timeval *  starttime)

elapsed_time returns an int value for the difference between now and starttime in milliseconds.

Here is the call graph for this function:

Here is the caller graph for this function:

static int in_checksum ( u_short *  buf,
int  len 
)
static

Here is the caller graph for this function:

void JOEfreehostent ( struct hostent *  h)
void JOEfreeprotoent ( struct protoent *  p)
int myping ( const char *  hostname,
int  t,
struct ping_priv datum 
)

Here is the call graph for this function:

Here is the caller graph for this function:

struct ping_priv ping_priv_default ( void  )

Here is the caller graph for this function:

int pinghost ( const char *  hostname)

Here is the call graph for this function:

int pingthost ( const char *  hostname,
int  t 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static int recv_ping ( struct sockaddr_in *  taddr,
struct ping_priv datum 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int send_ping ( const char *  host,
struct sockaddr_in *  taddr,
struct ping_priv datum 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

int tpinghost ( const char *  hostname)

Here is the call graph for this function:

int tpingthost ( const char *  hostname,
int  t 
)

Here is the call graph for this function: