diff options
Diffstat (limited to 'usr.sbin/bgpd/bgpd.h')
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 84 |
1 files changed, 3 insertions, 81 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 970e6a686df..3eab2ca44b6 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.236 2009/06/06 06:04:10 claudio Exp $ */ +/* $OpenBSD: bgpd.h,v 1.237 2009/06/06 06:33:15 eric Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -30,6 +30,8 @@ #include <poll.h> #include <stdarg.h> +#include "imsg.h" + #define BGP_VERSION 4 #define BGP_PORT 179 #define CONFFILE "/etc/bgpd.conf" @@ -107,22 +109,6 @@ enum reconf_action { RECONF_DELETE }; -struct buf { - TAILQ_ENTRY(buf) entry; - u_char *buf; - size_t size; - size_t max; - size_t wpos; - size_t rpos; - int fd; -}; - -struct msgbuf { - TAILQ_HEAD(, buf) bufs; - u_int32_t queued; - int fd; -}; - struct bgpd_addr { sa_family_t af; union { @@ -175,12 +161,6 @@ struct bgpd_config { u_int16_t connectretry; }; -struct buf_read { - u_char buf[READ_BUF_SIZE]; - u_char *rptr; - size_t wpos; -}; - enum announce_type { ANNOUNCE_UNDEF, ANNOUNCE_SELF, @@ -285,24 +265,6 @@ struct network { TAILQ_ENTRY(network) entry; }; -/* ipc messages */ - -#define IMSG_HEADER_SIZE sizeof(struct imsg_hdr) -#define MAX_IMSGSIZE 8192 - -struct imsg_fd { - TAILQ_ENTRY(imsg_fd) entry; - int fd; -}; - -struct imsgbuf { - TAILQ_HEAD(fds, imsg_fd) fds; - struct buf_read r; - struct msgbuf w; - int fd; - pid_t pid; -}; - enum imsg_type { IMSG_NONE, IMSG_RECONF_CONF, @@ -363,18 +325,6 @@ enum imsg_type { IMSG_DEMOTE }; -struct imsg_hdr { - u_int32_t peerid; - pid_t pid; - enum imsg_type type; - u_int16_t len; -}; - -struct imsg { - struct imsg_hdr hdr; - void *data; -}; - struct demote_msg { char demote_group[IFNAMSIZ]; int level; @@ -756,21 +706,6 @@ void send_imsg_session(int, pid_t, void *, u_int16_t); int bgpd_redistribute(int, struct kroute *, struct kroute6 *); int bgpd_filternexthop(struct kroute *, struct kroute6 *); -/* buffer.c */ -struct buf *buf_open(size_t); -struct buf *buf_dynamic(size_t, size_t); -int buf_add(struct buf *, const void *, size_t); -void *buf_reserve(struct buf *, size_t); -void *buf_seek(struct buf *, size_t, size_t); -size_t buf_size(struct buf *); -size_t buf_left(struct buf *); -int buf_close(struct msgbuf *, struct buf *); -int buf_write(struct msgbuf *); -void buf_free(struct buf *); -void msgbuf_init(struct msgbuf *); -void msgbuf_clear(struct msgbuf *); -int msgbuf_write(struct msgbuf *); - /* log.c */ void log_init(int); void vlog(int, const char *, va_list); @@ -789,19 +724,6 @@ int cmdline_symset(char *); /* config.c */ int host(const char *, struct bgpd_addr *, u_int8_t *); -/* imsg.c */ -void imsg_init(struct imsgbuf *, int); -int imsg_read(struct imsgbuf *); -int imsg_get(struct imsgbuf *, struct imsg *); -int imsg_compose(struct imsgbuf *, enum imsg_type, u_int32_t, pid_t, int, - const void *, u_int16_t); -struct buf *imsg_create(struct imsgbuf *, enum imsg_type, u_int32_t, pid_t, - u_int16_t); -int imsg_add(struct buf *, const void *, u_int16_t); -int imsg_close(struct imsgbuf *, struct buf *); -void imsg_free(struct imsg *); -int imsg_get_fd(struct imsgbuf *); - /* kroute.c */ int kr_init(int, u_int); int kr_change(struct kroute_label *); |