]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit 'f3b6661d' into thread-merge-2.16
authorMaria Matejka <mq@ucw.cz>
Thu, 28 Nov 2024 11:00:45 +0000 (12:00 +0100)
committerMaria Matejka <mq@ucw.cz>
Thu, 28 Nov 2024 11:00:45 +0000 (12:00 +0100)
1  2 
conf/conf.c
conf/confbase.Y
doc/bird.sgml
nest/cli.h
sysdep/unix/config.Y
sysdep/unix/io.c
sysdep/unix/main.c
sysdep/unix/unix.h

diff --cc conf/conf.c
index 9f2596911d068d175b81f2609157747d2b551d5b,805fdbd47401f4c5d4c466ccb346dc61866d49bb..cfe484cbce204a0f33f911998e3501effa5611a3
@@@ -588,7 -552,7 +588,8 @@@ order_shutdown(int gr
    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;
diff --cc conf/confbase.Y
index 99fb3d7abb3a6dd6401bcf1ad1b4f08e268b9952,4bf70ccfa6d7da4e7500d70cf09df2d592f31219..f3b0db617ca48cfa69c2ba72ecf4ea5d2f48e599
@@@ -101,10 -97,10 +101,11 @@@ CF_DECL
    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
diff --cc doc/bird.sgml
Simple merge
diff --cc nest/cli.h
Simple merge
index 6df86c2f6a9a3eb12df88b2a58cbd5eae039c209,665b0b0974ed15a8e4f5bbc40c2f0993e18a02ce..29dd31c16999bd6b9dbf065938d5bf0320444a84
@@@ -17,12 -17,12 +17,13 @@@ static struct log_config *this_log
  
  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
@@@ -122,12 -124,21 +123,27 @@@ mrtdump_base
     }
   ;
  
+ 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:
Simple merge
index 38b96fe5b8498f87c296473b61d98ba40968c2cd,17f7edb567fbbcde1adecafe4273bdf038fe73fc..a31526791babadef1e853334f968e8e2d674519a
@@@ -28,8 -28,8 +28,9 @@@
  #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"
@@@ -200,15 -200,18 +203,20 @@@ sysdep_preconfig(struct config *c
    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
index e9b8758d748d08504c7a0b645058c8e01a61a387,33ece06cd9b61027d39b832b308712bf7a8ce6d9..3f0f2a9bebb54727bdcc7179d2456e7bf2462794
@@@ -114,23 -107,12 +114,23 @@@ extern volatile sig_atomic_t async_shut
  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 */