diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-02-25 17:40:47 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-02-25 17:40:47 +0000 |
commit | 0881f489b26d9f34324c43f0def89c85248d36e5 (patch) | |
tree | 76439cd1885b13a539fe3b2c0f3e1fa3e389be2b /usr.sbin/ldpd/ldpe.h | |
parent | ecbcc1cc41bb11020536019149cfbf54bc080809 (diff) |
Do not use bufferevent for something that's already covered in the imsg
buffer API. This fixes a few possible problems in session_read and does
some further cleanup in various places. Wrap msgbuf into evbuf to add
libevent functionality and use buf_read to handle the read side of a
session. OK michele@ and dlg@ did not see anything evil
Diffstat (limited to 'usr.sbin/ldpd/ldpe.h')
-rw-r--r-- | usr.sbin/ldpd/ldpe.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/usr.sbin/ldpd/ldpe.h b/usr.sbin/ldpd/ldpe.h index 2cbf7750c33..8c709d0f0e1 100644 --- a/usr.sbin/ldpd/ldpe.h +++ b/usr.sbin/ldpd/ldpe.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ldpe.h,v 1.5 2010/02/22 09:44:04 claudio Exp $ */ +/* $OpenBSD: ldpe.h,v 1.6 2010/02/25 17:40:46 claudio Exp $ */ /* * Copyright (c) 2004, 2005, 2008 Esben Norby <norby@openbsd.org> @@ -38,7 +38,8 @@ struct mapping_entry { struct nbr { LIST_ENTRY(nbr) entry, hash; - struct bufferevent *bev; + struct evbuf wbuf; + struct event rev; struct event inactivity_timer; struct event keepalive_timer; struct event keepalive_timeout; @@ -50,17 +51,16 @@ struct nbr { struct mapping_head release_list; struct mapping_head abortreq_list; - int fd; - struct in_addr addr; struct in_addr id; + struct buf_read *rbuf; struct iface *iface; time_t uptime; - u_int32_t peerid; /* unique ID in DB */ + int fd; int state; u_int16_t lspace; @@ -177,7 +177,6 @@ void nbr_reset_idtimer(struct nbr *); int nbr_pending_idtimer(struct nbr *); int nbr_act_session_establish(struct nbr *, int); -int nbr_close_connection(struct nbr *); void nbr_mapping_add(struct nbr *, struct mapping_head *, struct map *); @@ -195,10 +194,10 @@ int gen_ldp_hdr(struct buf *, struct iface *, u_int16_t); int gen_msg_tlv(struct buf *, u_int32_t, u_int16_t); int send_packet(struct iface *, void *, size_t, struct sockaddr_in *); void disc_recv_packet(int, short, void *); -void session_recv_packet(int, short, void *); +void session_accept(int, short, void *); -void session_read(struct bufferevent *, void *); -void session_error(struct bufferevent *, short, void *); +void session_read(int, short, void *); +void session_write(int, short, void *); void session_close(struct nbr *); void session_shutdown(struct nbr *, u_int32_t, u_int32_t, u_int32_t); |