diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-01-26 17:40:50 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-01-26 17:40:50 +0000 |
commit | 6509f2a92158a5ae0a602a01494b95b9b0c2820a (patch) | |
tree | d9b373292c4f4ebe349facbf75c8bebab22fdbe9 /usr.sbin/bgpd/rde.h | |
parent | bebe8c10e5e02a1f829ee1ad4638411fbe2442ec (diff) |
Massiv rework of the control imsg flow. Main changes:
- dedicated pipe between the SE and the RDE for control messages
- restartable RB tree dumps in the RDE
- queuing limits both in the SE and RDE
The result is a dramatic decrease of memory consumption on operations like
bgpctl show rib. Previously all messages where first stored in the RDE
then passed to the SE where they got queued in case bgpctl was not fast enough.
Now only a small number of messages is generated and passed to the SE and
the SE has an additional limit instead of acting like an infinite buffer.
Without this the bgpd on bgpd.networx.ch would not survive a single minute.
looks good henning@
Diffstat (limited to 'usr.sbin/bgpd/rde.h')
-rw-r--r-- | usr.sbin/bgpd/rde.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index 702b3d01abe..0c0c624be40 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.96 2006/11/10 14:47:32 henning Exp $ */ +/* $OpenBSD: rde.h,v 1.97 2007/01/26 17:40:49 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and @@ -240,6 +240,20 @@ struct pt_entry6 { struct in6_addr prefix6; }; +struct pt_context { + union { + struct pt_entry p; + struct pt_entry4 p4; + struct pt_entry6 p6; + } pu; +#define ctx_p pu.p +#define ctx_p4 pu.p4 +#define ctx_p6 pu.p6 + /* only count and done should be accessed by callers */ + unsigned int count; + int done; +}; + struct prefix { LIST_ENTRY(prefix) prefix_l, path_l; struct rde_aspath *aspath; @@ -370,6 +384,8 @@ void pt_remove(struct pt_entry *); struct pt_entry *pt_lookup(struct bgpd_addr *); void pt_dump(void (*)(struct pt_entry *, void *), void *, sa_family_t); +void pt_dump_r(void (*)(struct pt_entry *, void *), void *, + sa_family_t, struct pt_context *); /* rde_filter.c */ enum filter_actions rde_filter(struct rde_aspath **, struct filter_head *, |