diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/session.c | 14 | ||||
-rw-r--r-- | usr.sbin/bgpd/session.h | 3 |
2 files changed, 15 insertions, 2 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 6fab38bfd8e..fe20bd8151c 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.210 2004/12/23 15:15:55 henning Exp $ */ +/* $OpenBSD: session.c,v 1.211 2004/12/23 17:24:03 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -2390,6 +2390,18 @@ getpeerbyaddr(struct bgpd_addr *addr) } struct peer * +getpeerbydesc(const char *descr) +{ + struct peer *p; + + for (p = peers; p != NULL && strcmp(p->conf.descr, descr); + p = p->next) + ; /* nothing */ + + return (p); +} + +struct peer * getpeerbyip(struct sockaddr *ip) { struct peer *p, *newpeer, *loose = NULL; diff --git a/usr.sbin/bgpd/session.h b/usr.sbin/bgpd/session.h index 103dc5fc368..9d45d121ec9 100644 --- a/usr.sbin/bgpd/session.h +++ b/usr.sbin/bgpd/session.h @@ -1,4 +1,4 @@ -/* $OpenBSD: session.h,v 1.74 2004/12/23 15:15:55 henning Exp $ */ +/* $OpenBSD: session.h,v 1.75 2004/12/23 17:24:03 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -184,6 +184,7 @@ pid_t session_main(struct bgpd_config *, struct peer *, struct mrt_head *, int[2], int[2], int[2]); void bgp_fsm(struct peer *, enum session_events); struct peer *getpeerbyaddr(struct bgpd_addr *); +struct peer *getpeerbydesc(const char *); int imsg_compose_parent(int, pid_t, void *, u_int16_t); int imsg_compose_rde(int, pid_t, void *, u_int16_t); |