The Netsukuku Project
0.0.9
An Alternative routing method
|
#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"
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) |
#define DEF_TIMEOUT 5 |
#define HDRLEN ICMP_MINLEN |
#define MAXDATA (MAXPKT-HDRLEN-TIMLEN) |
#define MAXPACKET 65535 |
PING module
Copyright (C) 2001 Jeffrey Fulmer jdful This file is part of LIBPING mer@ armst rong .com
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 |
int elapsed_time | ( | struct timeval * | starttime | ) |
elapsed_time returns an int value for the difference between now and starttime in milliseconds.
|
static |
void JOEfreehostent | ( | struct hostent * | h | ) |
void JOEfreeprotoent | ( | struct protoent * | p | ) |
int myping | ( | const char * | hostname, |
int | t, | ||
struct ping_priv * | datum | ||
) |
struct ping_priv ping_priv_default | ( | void | ) |
int pinghost | ( | const char * | hostname | ) |
int pingthost | ( | const char * | hostname, |
int | t | ||
) |
|
static |
|
static |
int tpinghost | ( | const char * | hostname | ) |
int tpingthost | ( | const char * | hostname, |
int | t | ||
) |