summaryrefslogtreecommitdiff
path: root/lib/libfrr.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libfrr.c')
-rw-r--r--lib/libfrr.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c
index 800596c563..8e7777a1a9 100644
--- a/lib/libfrr.c
+++ b/lib/libfrr.c
@@ -99,6 +99,7 @@ static void opt_extend(const struct optspec *os)
#define OPTION_TCLI 1005
#define OPTION_DB_FILE 1006
#define OPTION_LOGGING 1007
+#define OPTION_LIMIT_FDS 1008
static const struct option lo_always[] = {
{"help", no_argument, NULL, 'h'},
@@ -113,6 +114,7 @@ static const struct option lo_always[] = {
{"log-level", required_argument, NULL, OPTION_LOGLEVEL},
{"tcli", no_argument, NULL, OPTION_TCLI},
{"command-log-always", no_argument, NULL, OPTION_LOGGING},
+ {"limit-fds", required_argument, NULL, OPTION_LIMIT_FDS},
{NULL}};
static const struct optspec os_always = {
"hvdM:F:N:",
@@ -126,7 +128,8 @@ static const struct optspec os_always = {
" --moduledir Override modules directory\n"
" --log Set Logging to stdout, syslog, or file:<name>\n"
" --log-level Set Logging Level to use, debug, info, warn, etc\n"
- " --tcli Use transaction-based CLI\n",
+ " --tcli Use transaction-based CLI\n"
+ " --limit-fds Limit number of fds supported\n",
lo_always};
@@ -552,6 +555,9 @@ static int frr_opt(int opt)
case OPTION_LOGGING:
di->log_always = true;
break;
+ case OPTION_LIMIT_FDS:
+ di->limit_fds = strtoul(optarg, &err, 0);
+ break;
default:
return 1;
}
@@ -739,6 +745,11 @@ enum frr_cli_mode frr_get_cli_mode(void)
return di ? di->cli_mode : FRR_CLI_CLASSIC;
}
+uint32_t frr_get_fd_limit(void)
+{
+ return di ? di->limit_fds : 0;
+}
+
static int rcvd_signal = 0;
static void rcv_signal(int signum)