summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/bgpd.h
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-06-06 17:38:11 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-06-06 17:38:11 +0000
commitc2d42bcab482d8ff7df96f4a747d47aacb855904 (patch)
tree0bbf3fdfb1cb4024587c51defce1035eddbd3d05 /usr.sbin/bgpd/bgpd.h
parent249573f8161aafd6d278817f7ede3175091d36e8 (diff)
rework bgpd's handling of listening sockets. instead of one for each
supported address familiy, keep a tailq of an arbitary number of them. the new struct listen_addr contains the sockaddr and the fd. this fixes quite some nasty behaviour which was a consequence of the previous model. looks right deraadt@, and discussed with claudio
Diffstat (limited to 'usr.sbin/bgpd/bgpd.h')
-rw-r--r--usr.sbin/bgpd/bgpd.h34
1 files changed, 23 insertions, 11 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h
index 9ddd92d22c8..967c45d1de2 100644
--- a/usr.sbin/bgpd/bgpd.h
+++ b/usr.sbin/bgpd/bgpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.h,v 1.125 2004/05/21 15:36:40 claudio Exp $ */
+/* $OpenBSD: bgpd.h,v 1.126 2004/06/06 17:38:10 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -108,17 +108,28 @@ struct bgpd_addr {
#define addr32 ba.addr32
};
+#define DEFAULT_LISTENER 0x01
+
+struct listen_addr {
+ TAILQ_ENTRY(listen_addr) entry;
+ struct sockaddr_storage sa;
+ int fd;
+ enum reconf_action reconf;
+ u_int8_t flags;
+};
+
+TAILQ_HEAD(listen_addrs, listen_addr);
+
struct bgpd_config {
- int opts;
- u_int16_t as;
- u_int32_t bgpid;
- u_int32_t clusterid;
- u_int16_t holdtime;
- u_int16_t min_holdtime;
- int flags;
- int log;
- struct sockaddr_in listen_addr;
- struct sockaddr_in6 listen6_addr;
+ int opts;
+ u_int16_t as;
+ u_int32_t bgpid;
+ u_int32_t clusterid;
+ u_int16_t holdtime;
+ u_int16_t min_holdtime;
+ int flags;
+ int log;
+ struct listen_addrs *listen_addrs;
};
struct buf_read {
@@ -239,6 +250,7 @@ enum imsg_type {
IMSG_RECONF_CONF,
IMSG_RECONF_PEER,
IMSG_RECONF_FILTER,
+ IMSG_RECONF_LISTENER,
IMSG_RECONF_DONE,
IMSG_UPDATE,
IMSG_UPDATE_ERR,