libevent timeout_ -> evtimer_ ; ok jsyn@

This commit is contained in:
naddy 2002-07-18 15:46:50 +00:00
parent c1b088053b
commit a0a869b526
5 changed files with 104 additions and 10 deletions

View File

@ -1,10 +1,9 @@
# $OpenBSD: Makefile,v 1.2 2002/06/16 20:37:13 jsyn Exp $
# $OpenBSD: Makefile,v 1.3 2002/07/18 15:46:50 naddy Exp $
COMMENT= "ARP reply daemon"
DISTNAME= arpd-0.1
CATEGORIES= net
NEED_VERSION= 1.531
MAINTAINER= Jason Peel <jsyn@openbsd.org>

View File

@ -1,7 +1,18 @@
$OpenBSD: patch-arpd_c,v 1.1 2002/06/16 20:37:13 jsyn Exp $
$OpenBSD: patch-arpd_c,v 1.2 2002/07/18 15:46:50 naddy Exp $
--- arpd.c.orig Mon Apr 15 17:42:34 2002
+++ arpd.c Sun Jun 16 17:06:59 2002
@@ -156,7 +156,7 @@ arpd_send(eth_t *eth, int op,
+++ arpd.c Tue Jul 16 01:02:56 2002
@@ -22,10 +22,6 @@
#include <syslog.h>
#include <unistd.h>
-/* XXX - libevent */
-#undef timeout_pending
-#undef timeout_initialized
-
#include <event.h>
#include <dnet.h>
#include "tree.h"
@@ -156,7 +152,7 @@ arpd_send(eth_t *eth, int op,
spa->addr_ip, tha->addr_eth, tpa->addr_ip);
if (op == ARP_OP_REQUEST) {
@ -10,7 +21,7 @@ $OpenBSD: patch-arpd_c,v 1.1 2002/06/16 20:37:13 jsyn Exp $
addr_ntoa(tpa), addr_ntoa(spa));
} else if (op == ARP_OP_REPLY) {
syslog(LOG_INFO, "arp reply %s is-at %s",
@@ -173,7 +173,7 @@ arpd_lookup(struct addr *addr)
@@ -173,7 +169,7 @@ arpd_lookup(struct addr *addr)
int error;
if (addr_cmp(addr, &arpd_ifent.intf_addr) == 0) {
@ -19,7 +30,7 @@ $OpenBSD: patch-arpd_c,v 1.1 2002/06/16 20:37:13 jsyn Exp $
addr_ntoa(addr), addr_ntoa(&arpd_ifent.intf_link_addr));
return (0);
}
@@ -182,10 +182,10 @@ arpd_lookup(struct addr *addr)
@@ -182,10 +178,10 @@ arpd_lookup(struct addr *addr)
error = arp_get(arpd_arp, &arpent);
if (error == -1) {
@ -32,7 +43,56 @@ $OpenBSD: patch-arpd_c,v 1.1 2002/06/16 20:37:13 jsyn Exp $
addr_ntoa(addr), addr_ntoa(&arpent.arp_ha));
}
return (error);
@@ -314,7 +314,7 @@ arpd_recv_cb(u_char *u, const struct pca
@@ -194,9 +190,9 @@ arpd_lookup(struct addr *addr)
static void
arpd_free(struct arp_req *req)
{
- timeout_del(&req->active);
- timeout_del(&req->inactive);
- timeout_del(&req->discover);
+ evtimer_del(&req->active);
+ evtimer_del(&req->inactive);
+ evtimer_del(&req->discover);
free(req);
}
@@ -222,7 +218,7 @@ arpd_discover(struct arp_req *req, struc
arpd_send(arpd_eth, ARP_OP_REQUEST,
&arpd_ifent.intf_link_addr,
&arpd_ifent.intf_addr, &req->ha, &req->pa);
- timeout_add(&req->discover, &tv);
+ evtimer_add(&req->discover, &tv);
}
req->cnt++;
}
@@ -269,13 +265,13 @@ arpd_recv_cb(u_char *u, const struct pca
}
memcpy(&req->pa, &tmp.pa, sizeof(tmp.pa));
- timeout_set(&req->active, arpd_timeout, req);
- timeout_set(&req->inactive, arpd_timeout, req);
- timeout_set(&req->discover, arpd_discovercb, req);
+ evtimer_set(&req->active, arpd_timeout, req);
+ evtimer_set(&req->inactive, arpd_timeout, req);
+ evtimer_set(&req->discover, arpd_discovercb, req);
timerclear(&tv);
tv.tv_sec = ARPD_MAX_ACTIVE;
- timeout_add(&req->active, &tv);
+ evtimer_add(&req->active, &tv);
SPLAY_INSERT(tree, &arpd_reqs, req);
@@ -287,7 +283,7 @@ arpd_recv_cb(u_char *u, const struct pca
} else {
timerclear(&tv);
tv.tv_sec = ARPD_MAX_INACTIVE;
- timeout_add(&req->inactive, &tv);
+ evtimer_add(&req->inactive, &tv);
if (req->negative) {
syslog(LOG_DEBUG, "%s: %s is allocated",
@@ -314,7 +310,7 @@ arpd_recv_cb(u_char *u, const struct pca
if ((req = SPLAY_FIND(tree, &arpd_reqs, &tmp)) != NULL) {
addr_pack(&src.arp_ha, ADDR_TYPE_ETH, ETH_ADDR_BITS,
ethip->ar_sha, ETH_ADDR_LEN);

View File

@ -1,10 +1,9 @@
# $OpenBSD: Makefile,v 1.7 2002/06/16 15:36:57 naddy Exp $
# $OpenBSD: Makefile,v 1.8 2002/07/18 15:46:50 naddy Exp $
COMMENT= "voice over misconfigured internet telephones"
DISTNAME= vomit-0.2
CATEGORIES= security
NEED_VERSION= 1.500
HOMEPAGE= http://vomit.xtdnet.nl/

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-buffer_c,v 1.1 2002/07/18 15:46:50 naddy Exp $
--- buffer.c.orig Tue Jul 16 02:31:54 2002
+++ buffer.c Tue Jul 16 02:34:45 2002
@@ -253,7 +253,7 @@ buffer_output(bh bhd)
if (clen == -1) {
fprintf(stderr, "write(%d, %p, %d) -> %d\n",
- b->buf_fd, b->buf, b->bufentries * sizeof(int16_t), clen);
+ b->buf_fd, b->buf, b->bufentries * (int)sizeof(int16_t), clen);
if (errno == EAGAIN || errno == EINTR)
return (1);

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-pcapu_c,v 1.1 2002/07/18 15:46:50 naddy Exp $
--- pcapu.c.orig Tue Jul 16 02:30:31 2002
+++ pcapu.c Tue Jul 16 02:30:49 2002
@@ -89,7 +89,7 @@ pcap_cb(int fd, short event, void *arg)
voip_sniff((u_char *)pd, &pkthdr, pkt);
out:
- timeout_add(&pcapev, &tv);
+ evtimer_add(&pcapev, &tv);
}
pcap_t *
@@ -139,9 +139,9 @@ pcap_init(char *intf, char *file, char *
}
#endif
- timeout_set(&pcapev, pcap_cb, pd);
+ evtimer_set(&pcapev, pcap_cb, pd);
timerclear(&tv);
- timeout_add(&pcapev, &tv);
+ evtimer_add(&pcapev, &tv);
return (pd);
}