summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2023-01-26 16:53:47 +0100
committerDonald Sharp <sharpd@nvidia.com>2023-01-26 17:40:33 +0100
commit8586a88abbe22161244f5082b59c10a471c876be (patch)
tree1613689f8ec289be0a97358d4ad5ba2b0b8c52ee /lib
parentwatchfrr: dmn variable shadows previous declaration (diff)
downloadfrr-8586a88abbe22161244f5082b59c10a471c876be.tar.xz
frr-8586a88abbe22161244f5082b59c10a471c876be.zip
lib: Remove global variable exposure `struct host host`
This was only used in one place and we have accessor functions now. So let's use them. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/command.h3
-rw-r--r--lib/grammar_sandbox_main.c4
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/command.h b/lib/command.h
index bce4fb9e1..8f5d96053 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -619,9 +619,6 @@ extern void print_version(const char *);
extern int cmd_banner_motd_file(const char *);
extern void cmd_banner_motd_line(const char *line);
-/* struct host global, ick */
-extern struct host host;
-
struct cmd_variable_handler {
const char *tokenname, *varname;
void (*completions)(vector out, struct cmd_token *token);
diff --git a/lib/grammar_sandbox_main.c b/lib/grammar_sandbox_main.c
index 6469b4926..a7d6c5137 100644
--- a/lib/grammar_sandbox_main.c
+++ b/lib/grammar_sandbox_main.c
@@ -49,8 +49,8 @@ int main(int argc, char **argv)
/* Library inits. */
cmd_init(1);
- host.name = strdup("test");
- host.domainname = strdup("testdomainname");
+ cmd_hostname_set("test");
+ cmd_domainname_set("testdomainname");
vty_init(master, true);
lib_cmd_init();