diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-02-07 13:39:59 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2007-02-07 13:39:59 +0000 |
commit | bb4378f54dde688d5132078973e428d6c68aa229 (patch) | |
tree | d13b90dbd07f350536bb77d3a308509fa72ae245 | |
parent | d2e1fab1c1884d2b52a8d0ce7a62ca22b0612229 (diff) |
remove unused functions and variables which have been copied from
ospfd(8) (can be re-imported later if required).
-rw-r--r-- | usr.sbin/hoststated/buffer.c | 12 | ||||
-rw-r--r-- | usr.sbin/hoststated/control.c | 27 | ||||
-rw-r--r-- | usr.sbin/hoststated/hce.c | 22 | ||||
-rw-r--r-- | usr.sbin/hoststated/hoststated.h | 4 | ||||
-rw-r--r-- | usr.sbin/hoststated/parse.y | 3 | ||||
-rw-r--r-- | usr.sbin/relayd/buffer.c | 12 | ||||
-rw-r--r-- | usr.sbin/relayd/control.c | 27 | ||||
-rw-r--r-- | usr.sbin/relayd/hce.c | 22 | ||||
-rw-r--r-- | usr.sbin/relayd/parse.y | 3 | ||||
-rw-r--r-- | usr.sbin/relayd/relayd.h | 4 |
10 files changed, 10 insertions, 126 deletions
diff --git a/usr.sbin/hoststated/buffer.c b/usr.sbin/hoststated/buffer.c index 4d85f78ea57..0c957aa8642 100644 --- a/usr.sbin/hoststated/buffer.c +++ b/usr.sbin/hoststated/buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.5 2007/01/29 14:23:31 pyr Exp $ */ +/* $OpenBSD: buffer.c,v 1.6 2007/02/07 13:39:58 reyk Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -117,16 +117,6 @@ buf_reserve(struct buf *buf, size_t len) return (b); } -void * -buf_seek(struct buf *buf, size_t pos, size_t len) -{ - /* only allowed to seek in already written parts */ - if (pos + len > buf->wpos) - return (NULL); - - return (buf->buf + pos); -} - int buf_close(struct msgbuf *msgbuf, struct buf *buf) { diff --git a/usr.sbin/hoststated/control.c b/usr.sbin/hoststated/control.c index a24b86deada..20e1cc04ff5 100644 --- a/usr.sbin/hoststated/control.c +++ b/usr.sbin/hoststated/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.11 2007/02/01 20:03:39 pyr Exp $ */ +/* $OpenBSD: control.c,v 1.12 2007/02/07 13:39:58 reyk Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -40,7 +40,6 @@ struct ctl_connlist ctl_conns; struct ctl_conn *control_connbyfd(int); -struct ctl_conn *control_connbypid(pid_t); void control_close(int); int @@ -156,18 +155,6 @@ control_connbyfd(int fd) return (c); } -struct ctl_conn * -control_connbypid(pid_t pid) -{ - struct ctl_conn *c; - - for (c = TAILQ_FIRST(&ctl_conns); c != NULL && c->ibuf.pid != pid; - c = TAILQ_NEXT(c, entry)) - ; /* nothing */ - - return (c); -} - void control_close(int fd) { @@ -338,18 +325,6 @@ control_dispatch_imsg(int fd, short event, void *arg) imsg_event_add(&c->ibuf); } -int -control_imsg_relay(struct imsg *imsg) -{ - struct ctl_conn *c; - - if ((c = control_connbypid(imsg->hdr.pid)) == NULL) - return (0); - - return (imsg_compose(&c->ibuf, imsg->hdr.type, 0, imsg->hdr.pid, - imsg->data, imsg->hdr.len - IMSG_HEADER_SIZE)); -} - void control_imsg_forward(struct imsg *imsg) { diff --git a/usr.sbin/hoststated/hce.c b/usr.sbin/hoststated/hce.c index ac887311164..12a77baf36c 100644 --- a/usr.sbin/hoststated/hce.c +++ b/usr.sbin/hoststated/hce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hce.c,v 1.12 2007/01/29 14:23:31 pyr Exp $ */ +/* $OpenBSD: hce.c,v 1.13 2007/02/07 13:39:58 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -45,7 +45,6 @@ void hce_shutdown(void); void hce_dispatch_imsg(int, short, void *); void hce_dispatch_parent(int, short, void *); void hce_launch_checks(int, short, void *); -int hce_checks_done(void); static struct hoststated *env = NULL; struct imsgbuf *ibuf_pfe; @@ -207,25 +206,6 @@ hce_launch_checks(int fd, short event, void *arg) evtimer_add(&env->ev, &tv); } -int -hce_checks_done() -{ - struct table *table; - struct host *host; - - TAILQ_FOREACH(table, &env->tables, entry) { - if (table->flags & F_DISABLE) - continue; - TAILQ_FOREACH(host, &table->hosts, entry) { - if (host->flags & F_DISABLE) - continue; - if (!(host->flags & F_CHECK_DONE)) - return (0); - } - } - return (1); -} - void hce_notify_done(struct host *host, const char *msg) { diff --git a/usr.sbin/hoststated/hoststated.h b/usr.sbin/hoststated/hoststated.h index cf8272ba065..5599e1cf569 100644 --- a/usr.sbin/hoststated/hoststated.h +++ b/usr.sbin/hoststated/hoststated.h @@ -1,4 +1,4 @@ -/* $OpenBSD: hoststated.h,v 1.22 2007/02/07 13:30:17 reyk Exp $ */ +/* $OpenBSD: hoststated.h,v 1.23 2007/02/07 13:39:58 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -285,7 +285,6 @@ int control_init(void); int control_listen(void); void control_accept(int, short, void *); void control_dispatch_imsg(int, short, void *); -int control_imsg_relay(struct imsg *); void control_imsg_forward(struct imsg *); void control_cleanup(void); @@ -311,7 +310,6 @@ struct buf *buf_open(size_t); struct buf *buf_dynamic(size_t, size_t); int buf_add(struct buf *, void *, size_t); void *buf_reserve(struct buf *, size_t); -void *buf_seek(struct buf *, size_t, size_t); int buf_close(struct msgbuf *, struct buf *); void buf_free(struct buf *); void msgbuf_init(struct msgbuf *); diff --git a/usr.sbin/hoststated/parse.y b/usr.sbin/hoststated/parse.y index 9d9ea912914..af8c69d7d35 100644 --- a/usr.sbin/hoststated/parse.y +++ b/usr.sbin/hoststated/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.21 2007/02/07 13:30:17 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.22 2007/02/07 13:39:58 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -50,7 +50,6 @@ static FILE *fin = NULL; static int lineno = 1; static int errors = 0; const char *infile; -char *start_state; objid_t last_service_id = 0; objid_t last_table_id = 0; objid_t last_host_id = 0; diff --git a/usr.sbin/relayd/buffer.c b/usr.sbin/relayd/buffer.c index 4d85f78ea57..0c957aa8642 100644 --- a/usr.sbin/relayd/buffer.c +++ b/usr.sbin/relayd/buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buffer.c,v 1.5 2007/01/29 14:23:31 pyr Exp $ */ +/* $OpenBSD: buffer.c,v 1.6 2007/02/07 13:39:58 reyk Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -117,16 +117,6 @@ buf_reserve(struct buf *buf, size_t len) return (b); } -void * -buf_seek(struct buf *buf, size_t pos, size_t len) -{ - /* only allowed to seek in already written parts */ - if (pos + len > buf->wpos) - return (NULL); - - return (buf->buf + pos); -} - int buf_close(struct msgbuf *msgbuf, struct buf *buf) { diff --git a/usr.sbin/relayd/control.c b/usr.sbin/relayd/control.c index a24b86deada..20e1cc04ff5 100644 --- a/usr.sbin/relayd/control.c +++ b/usr.sbin/relayd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.11 2007/02/01 20:03:39 pyr Exp $ */ +/* $OpenBSD: control.c,v 1.12 2007/02/07 13:39:58 reyk Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -40,7 +40,6 @@ struct ctl_connlist ctl_conns; struct ctl_conn *control_connbyfd(int); -struct ctl_conn *control_connbypid(pid_t); void control_close(int); int @@ -156,18 +155,6 @@ control_connbyfd(int fd) return (c); } -struct ctl_conn * -control_connbypid(pid_t pid) -{ - struct ctl_conn *c; - - for (c = TAILQ_FIRST(&ctl_conns); c != NULL && c->ibuf.pid != pid; - c = TAILQ_NEXT(c, entry)) - ; /* nothing */ - - return (c); -} - void control_close(int fd) { @@ -338,18 +325,6 @@ control_dispatch_imsg(int fd, short event, void *arg) imsg_event_add(&c->ibuf); } -int -control_imsg_relay(struct imsg *imsg) -{ - struct ctl_conn *c; - - if ((c = control_connbypid(imsg->hdr.pid)) == NULL) - return (0); - - return (imsg_compose(&c->ibuf, imsg->hdr.type, 0, imsg->hdr.pid, - imsg->data, imsg->hdr.len - IMSG_HEADER_SIZE)); -} - void control_imsg_forward(struct imsg *imsg) { diff --git a/usr.sbin/relayd/hce.c b/usr.sbin/relayd/hce.c index ac887311164..12a77baf36c 100644 --- a/usr.sbin/relayd/hce.c +++ b/usr.sbin/relayd/hce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hce.c,v 1.12 2007/01/29 14:23:31 pyr Exp $ */ +/* $OpenBSD: hce.c,v 1.13 2007/02/07 13:39:58 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -45,7 +45,6 @@ void hce_shutdown(void); void hce_dispatch_imsg(int, short, void *); void hce_dispatch_parent(int, short, void *); void hce_launch_checks(int, short, void *); -int hce_checks_done(void); static struct hoststated *env = NULL; struct imsgbuf *ibuf_pfe; @@ -207,25 +206,6 @@ hce_launch_checks(int fd, short event, void *arg) evtimer_add(&env->ev, &tv); } -int -hce_checks_done() -{ - struct table *table; - struct host *host; - - TAILQ_FOREACH(table, &env->tables, entry) { - if (table->flags & F_DISABLE) - continue; - TAILQ_FOREACH(host, &table->hosts, entry) { - if (host->flags & F_DISABLE) - continue; - if (!(host->flags & F_CHECK_DONE)) - return (0); - } - } - return (1); -} - void hce_notify_done(struct host *host, const char *msg) { diff --git a/usr.sbin/relayd/parse.y b/usr.sbin/relayd/parse.y index 9d9ea912914..af8c69d7d35 100644 --- a/usr.sbin/relayd/parse.y +++ b/usr.sbin/relayd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.21 2007/02/07 13:30:17 reyk Exp $ */ +/* $OpenBSD: parse.y,v 1.22 2007/02/07 13:39:58 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -50,7 +50,6 @@ static FILE *fin = NULL; static int lineno = 1; static int errors = 0; const char *infile; -char *start_state; objid_t last_service_id = 0; objid_t last_table_id = 0; objid_t last_host_id = 0; diff --git a/usr.sbin/relayd/relayd.h b/usr.sbin/relayd/relayd.h index 2e2b94381f2..1db8659f377 100644 --- a/usr.sbin/relayd/relayd.h +++ b/usr.sbin/relayd/relayd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: relayd.h,v 1.22 2007/02/07 13:30:17 reyk Exp $ */ +/* $OpenBSD: relayd.h,v 1.23 2007/02/07 13:39:58 reyk Exp $ */ /* * Copyright (c) 2006 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -285,7 +285,6 @@ int control_init(void); int control_listen(void); void control_accept(int, short, void *); void control_dispatch_imsg(int, short, void *); -int control_imsg_relay(struct imsg *); void control_imsg_forward(struct imsg *); void control_cleanup(void); @@ -311,7 +310,6 @@ struct buf *buf_open(size_t); struct buf *buf_dynamic(size_t, size_t); int buf_add(struct buf *, void *, size_t); void *buf_reserve(struct buf *, size_t); -void *buf_seek(struct buf *, size_t, size_t); int buf_close(struct msgbuf *, struct buf *); void buf_free(struct buf *); void msgbuf_init(struct msgbuf *); |