static double tsumsq = 0.0;
static double maxwait = 0.0;
-#if !defined(__minix)
static int bufspace = IP_MAXPACKET;
-#endif /* !defined(__minix) */
static struct timespec now, clear_cache, last_tx, next_tx, first_tx;
static struct timespec last_rx, first_rx;
if ((sloop = prog_socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0)
err(EXIT_FAILURE, "Cannot create socket");
-#if !defined(__minix)
/*
* sloop is never read on. This prevents packets from
* queueing in its recv buffer.
*/
if (prog_shutdown(sloop, SHUT_RD) == -1)
warn("Cannot shutdown for read");
-#endif /* !defined(__minix) */
if (prog_setuid(prog_getuid()) == -1)
err(EXIT_FAILURE, "setuid");
- optlen);
(void) memcpy(opack_ip + 1, optspace, optlen);
-#if !defined(__minix)
if (prog_setsockopt(s, IPPROTO_IP, IP_HDRINCL,
(char *) &on, sizeof(on)) < 0)
err(EXIT_FAILURE, "Can't set special IP header");
-#endif /* !defined(__minix) */
opack_ip->ip_v = IPVERSION;
opack_ip->ip_hl = (sizeof(struct ip)+optlen) >> 2;
(void)printf("PING %s (%s): %d data bytes\n", hostname,
inet_ntoa(whereto.sin_addr), datalen);
-#if !defined(__minix)
/* When pinging the broadcast address, you can get a lot
* of answers. Doing something so evil is useful if you
* are trying to stress the ethernet, or just want to
*/
(void)prog_setsockopt(s, SOL_SOCKET, SO_SNDBUF,
(char*)&bufspace, sizeof(bufspace));
-#endif /* !defined(__minix) */
(void)signal(SIGINT, prefinish);
#include <netipsec/ipsec.h>
#endif
-#if defined(__minix)
-#include <net/gen/in.h>
-#include <net/gen/ip_io.h>
-#endif /* defined(__minix) */
-
#include "gnuc.h"
#ifdef HAVE_OS_PROTO_H
#include "os-proto.h"
* running our traceroute code will forgive us.
*/
#ifndef __hpux
-#if defined(__minix)
- sndsock = prog_socket(AF_INET, SOCK_RAW, IPPROTO_UDP);
-#else
sndsock = prog_socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
-#endif /* defined(__minix) */
#else
sndsock = socket(AF_INET, SOCK_RAW, IPPROTO_RAW
useicmp ? IPPROTO_ICMP : IPPROTO_UDP);
}
#endif
-#if !defined(__minix)
#ifdef SO_SNDBUF
if (prog_setsockopt(sndsock, SOL_SOCKET, SO_SNDBUF, (char *)&packlen,
sizeof(packlen)) < 0)
if (prog_setsockopt(sndsock, SOL_SOCKET, SO_DONTROUTE, &on,
sizeof(on)) < 0)
err(1, "setsockopt dontroute %d", tos);
-#endif /* !defined(__minix) */
/* Get the interface address list */
n = ifaddrlist(&al, errbuf, sizeof errbuf);
Printf("]\n");
}
-#if !defined(__minix)
#if !defined(IP_HDRINCL) && defined(IP_TTL)
if (prog_setsockopt(sndsock, IPPROTO_IP, IP_TTL,
(char *)&ttl, sizeof(ttl)) < 0)
err(1, "setsockopt ttl %d", ttl);
#endif
-#else
- {
- nwio_ipopt_t ipopts;
- memset(&ipopts, 0, sizeof(ipopts));
- ipopts.nwio_flags = NWIO_HDR_O_SPEC;
- ipopts.nwio_ttl = ttl;
- if(ioctl(sndsock, NWIOSIPOPT, &ipopts) < 0) {
- err(1, "ttl ioctl");
- }
- }
-#endif /* !defined(__minix) */
if (dump)
dump_packet();