/*
- * $Id: icmp.cc,v 1.35 1997/04/30 03:12:08 wessels Exp $
+ * $Id: icmp.cc,v 1.36 1997/06/04 04:32:58 wessels Exp $
*
* DEBUG: section 37 ICMP Routines
* AUTHOR: Duane Wessels
static icmpQueueData *IcmpQueueHead = NULL;
-static void icmpRecv _PARAMS((int, void *));
+static PF icmpRecv;
static void icmpQueueSend _PARAMS((pingerEchoData * pkt,
int len,
void (*free_func) _PARAMS((void *))));
-static void icmpSend _PARAMS((int fd, icmpQueueData * queue));
+static PF icmpSend;
static void icmpHandleSourcePing _PARAMS((const struct sockaddr_in * from, const char *buf));
static void
static int fail_count = 0;
pingerReplyData preply;
static struct sockaddr_in F;
- commSetSelect(icmp_sock,
- COMM_SELECT_READ,
- icmpRecv,
- -1, 0);
+ commSetSelect(icmp_sock, COMM_SELECT_READ, icmpRecv, NULL, 0);
memset(&preply, '\0', sizeof(pingerReplyData));
n = recv(icmp_sock,
(char *) &preply,
q->free_func = free_func;
for (H = &IcmpQueueHead; *H; H = &(*H)->next);
*H = q;
- commSetSelect(icmp_sock,
- COMM_SELECT_WRITE,
- icmpSend,
- IcmpQueueHead, 0);
+ commSetSelect(icmp_sock, COMM_SELECT_WRITE, icmpSend, IcmpQueueHead, 0);
}
static void
-icmpSend(int fd, icmpQueueData * queue)
+icmpSend(int fd, void *data)
{
+ icmpQueueData *queue = data;
int x;
while ((queue = IcmpQueueHead)) {
x = send(icmp_sock,
}
/* Reinstate handler if needed */
if (IcmpQueueHead) {
- commSetSelect(fd,
- COMM_SELECT_WRITE,
- icmpSend,
- IcmpQueueHead, 0);
+ commSetSelect(fd, COMM_SELECT_WRITE, icmpSend, IcmpQueueHead, 0);
} else {
- commSetSelect(fd,
- COMM_SELECT_WRITE,
- NULL,
- NULL, 0);
+ commSetSelect(fd, COMM_SELECT_WRITE, NULL, NULL, 0);
}
}
_exit(1);
}
comm_close(child_sock);
- commSetSelect(icmp_sock,
- COMM_SELECT_READ,
- icmpRecv,
- -1, 0);
+ commSetSelect(icmp_sock, COMM_SELECT_READ, icmpRecv, NULL, 0);
commSetTimeout(icmp_sock, -1, NULL, NULL);
debug(29, 0, "Pinger socket opened on FD %d\n", icmp_sock);
#endif
/*
- * $Id: net_db.cc,v 1.36 1997/05/15 23:40:25 wessels Exp $
+ * $Id: net_db.cc,v 1.37 1997/06/04 04:32:59 wessels Exp $
*
* DEBUG: section 37 Network Measurement Database
* AUTHOR: Duane Wessels
net_db_name *x;
struct timeval start = current_time;
int count = 0;
- sprintf(path, "%s/netdb_state", swappath(0));
+ sprintf(path, "%s/netdb_state", storeSwapDir(0));
fp = fopen(path, "w");
if (fp == NULL) {
debug(50, 1, "netdbSaveState: %s: %s\n", path, xstrerror());
struct in_addr addr;
int count = 0;
struct timeval start = current_time;
- sprintf(path, "%s/netdb_state", swappath(0));
+ sprintf(path, "%s/netdb_state", storeSwapDir(0));
fp = fopen(path, "r");
if (fp == NULL)
return;