init_list(&c->tables);
init_list(&c->mpls_domains);
init_list(&c->symbols);
+ obstacle_target_init(&c->obstacles, &c->obstacles_cleared, c->pool, "Config");
+ c->cli = (struct cli_config_list) {};
memset(c->def_tables, 0, sizeof(c->def_tables));
c->shutdown = 1;
c->gr_down = gr;
struct proto_spec ps;
struct channel_limit cl;
struct timeformat *tf;
- mpls_label_stack *mls;
+ struct settle_config settle;
+ struct adata *ad;
const struct adata *bs;
struct aggr_item_node *ai;
+ struct cli_config *cli;
}
%token END CLI_MARKER INVALID_TOKEN ELSECOL DDOT
CF_DECLS
-CF_KEYWORDS(LOG, SYSLOG, NAME, STDERR, UDP, PORT, CLI)
-CF_KEYWORDS(ALL, DEBUG, TRACE, INFO, REMOTE, WARNING, ERROR, AUTH, FATAL, BUG)
-CF_KEYWORDS(DEBUG, LATENCY, LIMIT, WATCHDOG, WARNING, TIMEOUT, THREADS)
+CF_KEYWORDS(LOG, SYSLOG, ALL, DEBUG, TRACE, INFO, REMOTE, WARNING, ERROR, AUTH, FATAL, BUG, STDERR, SOFT, UDP, PORT, CLI)
+CF_KEYWORDS(NAME, CONFIRM, UNDO, CHECK, TIMEOUT, DEBUG, LATENCY, LIMIT, WATCHDOG, WARNING, STATUS)
+CF_KEYWORDS(PING, WAKEUP, SOCKETS, SCHEDULING, EVENTS, TIMERS, ALLOCATOR)
+CF_KEYWORDS(GRACEFUL, RESTART, FIXED)
-%type <i> log_mask log_mask_list log_cat cfg_timeout
+ %type <cli> cli_opts
+%type <i> log_mask log_mask_list log_cat cfg_timeout debug_unix latency_debug_mask latency_debug_flag latency_debug_list
%type <t> cfg_name
%type <tf> timeformat_which
%type <t> syslog_name
}
;
+ conf: cli ;
+
+ cli: CLI text cli_opts {
+ $3->name = $2;
+ cli_config_add_tail(&new_config->cli, $3);
+ } ;
+
+ cli_opts: ';' {
+ $$ = cfg_alloc(sizeof *$$);
+ *$$ = (typeof (*$$)) {
+ .config = new_config,
+ .mode = 0660,
+ };
+ };
+
+conf: THREADS expr {
+ if ($2 < 1) cf_error("Number of threads must be at least one.");
+ new_config->thread_count = $2;
+}
+
+
conf: debug_unix ;
debug_unix:
#include "lib/resource.h"
#include "lib/socket.h"
#include "lib/event.h"
+#include "lib/locking.h"
#include "lib/timer.h"
+ #include "lib/tlists.h"
#include "lib/string.h"
#include "nest/route.h"
#include "nest/protocol.h"
read_iproute_table(c, PATH_IPROUTE_DIR "/rt_scopes", "ips_", 255);
read_iproute_table(c, PATH_IPROUTE_DIR "/rt_tables", "ipt_", 0xffffffff);
#endif
+
+ cli_preconfig(c);
}
-int
+ static void cli_commit(struct config *new, struct config *old);
+
+void
sysdep_commit(struct config *new, struct config *old)
{
- log_switch(0, &new->logfiles, new->syslog_name);
+ if (!new->shutdown)
+ log_switch(0, &new->logfiles, new->syslog_name);
+
+ cli_commit(new, old);
- return 0;
+ bird_thread_commit(new, old);
}
static int
void io_init(void);
void io_loop(void);
void io_log_dump(void);
-int sk_open_unix(struct birdsock *s, const char *name);
-struct rfile *rf_open(struct pool *, const char *name, const char *mode);
-struct rfile *rf_fdopen(pool *p, int fd, const char *mode);
-void *rf_file(struct rfile *f);
+int sk_open_unix(struct birdsock *s, struct birdloop *, const char *name);
+
+enum rf_mode {
+ RF_APPEND = 1,
+ RF_FIXED,
+};
+
+struct rfile *rf_open(struct pool *, const char *name, enum rf_mode mode, off_t limit);
+off_t rf_size(struct rfile *);
+int rf_same(struct rfile *, struct rfile *);
+int rf_writev(struct rfile *, struct iovec *, int);
+void rf_write_crude(struct rfile *, const char *, int);
int rf_fileno(struct rfile *f);
- void test_old_bird(char *path);
+
+extern struct rfile rf_stderr;
+
+ void test_old_bird(const char *path);
ip_addr resolve_hostname(const char *host, int type, const char **err_msg);
/* krt.c bits */