* cleanup debugging calls
* logging and tracing; use appropriate log levels
* check log calls for trailing newlines
-
-* Fix router ID calculation
-* debug dump: dump router ID as well
+* replace all NUM's by expr's
- TOS not supported by kernel -> automatically drop routes with TOS<>0
+- config: executable config files
- fake multipath?
-- replace all NUM's by expr's
- config file: define ipaddr constants?
- counters (according to SNMP MIB?)
-- ifdef out some debugging code?
- better memory allocators
- default preferences of protocols: prefer BGP over OSPF/RIP external routes?
- secondary addresses -> subinterfaces
- better default protocol names
- config: comments at end of line -> explicit ';' needed?
-- remove post-config hooks?
- command-line arguments: name of config file
- static: check validity of route destination?
- device: configuration of interface patterns
- filter: logging of dropped routes (?)
-- limitation of memory consumption: per-process and total (?)
- adding of route: check whether all bits not covered by masklen are zero
-- switch: generate default route only if at least one BGP connection exists (?)
-
+- switch: generate default route only if at least one BGP connection exists (aggregate engine?)
- route recalculation timing + flap dampening (?)
-
-- "generate default route" switch for all IGP's
+- "generate default route" switch for all IGP's (via generic aggregate engine?)
- Check incoming packets and log errors!!
cf_lex_init_tables();
protos_preconfig(c);
cf_parse();
-#if 0 /* FIXME: We don't have interface list yet :( */
- if (!c->router_id && !(c->router_id = auto_router_id()))
- cf_error("Cannot determine router ID (no suitable network interface found), please configure it manually");
-#endif
filters_postconfig(); /* FIXME: Do we really need this? */
protos_postconfig(c);
return 1;
linpool *mem; /* Linear pool containing configuration data */
list protos; /* Configured protocol instances (struct proto_config) */
u32 router_id; /* Our Router ID */
- u16 this_as; /* Our Autonomous System Number */
char *err_msg; /* Parser error message */
int err_lino; /* Line containing error */
char *file_name; /* Name of configuration file */
#include "nest/protocol.h"
#include "lib/resource.h"
#include "lib/string.h"
+#include "conf/conf.h"
static pool *if_pool;
+static void auto_router_id(void);
+
/*
* Neighbor Cache
*
debug("Known network interfaces:\n");
WALK_LIST(i, iface_list)
if_dump(i);
+ debug("Router ID: %08x\n", config->router_id);
}
static inline int
{
struct iface *i, j;
+ if (!config->router_id)
+ auto_router_id();
+
WALK_LIST(i, iface_list)
if (i->flags & IF_UPDATED)
i->flags &= ~IF_UPDATED;
p->if_notify(p, IF_CHANGE_CREATE | ((i->flags & IF_UP) ? IF_CHANGE_UP : 0), NULL, i);
}
-u32
+static void
auto_router_id(void) /* FIXME: What if we run IPv6??? */
{
struct iface *i, *j;
(!j || ipa_to_u32(i->ip) < ipa_to_u32(j->ip)))
j = i;
if (!j)
- return 0;
+ die("Cannot determine router ID (no suitable network interface found), please configure it manually");
debug("Guessed router ID %I (%s)\n", j->ip, j->name);
- return ipa_to_u32(j->ip);
+ config->router_id = ipa_to_u32(j->ip);
}
void
void if_update(struct iface *);
void if_end_update(void);
void if_feed_baby(struct proto *);
-u32 auto_router_id(void);
/*
* Neighbor Cache. We hold (direct neighbor, protocol) pairs we've seen
for (cnt /= sizeof(struct ifreq); cnt; cnt--, r++)
{
bzero(&i, sizeof(i));
- debug("%s\n", r->ifr_ifrn.ifrn_name);
+ DBG("%s\n", r->ifr_ifrn.ifrn_name);
strncpy(i.name, r->ifr_ifrn.ifrn_name, sizeof(i.name) - 1);
i.name[sizeof(i.name) - 1] = 0;
get_sockaddr((struct sockaddr_in *) &r->ifr_addr, &i.ip, NULL);