From eb51bb9b1fa2fbb339c583cb5b479246b0821dcc Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 27 Nov 2019 21:49:00 +0100 Subject: [PATCH] lib: random unused bits cleanup Signed-off-by: David Lamparter --- lib/buffer.c | 6 ------ lib/filter.c | 8 ++++---- lib/grammar_sandbox.c | 13 +++++++------ lib/sockopt.c | 15 --------------- lib/sockopt.h | 1 - lib/systemd.c | 2 +- lib/systemd.h | 1 - 7 files changed, 12 insertions(+), 34 deletions(-) diff --git a/lib/buffer.c b/lib/buffer.c index bb2cdb7e54..766b9791a5 100644 --- a/lib/buffer.c +++ b/lib/buffer.c @@ -114,12 +114,6 @@ char *buffer_getstr(struct buffer *b) return s; } -/* Return 1 if buffer is empty. */ -int buffer_empty(struct buffer *b) -{ - return (b->head == NULL); -} - /* Clear and free all allocated data. */ void buffer_reset(struct buffer *b) { diff --git a/lib/filter.c b/lib/filter.c index ed3ffe9c67..31e25d6001 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -2498,8 +2498,8 @@ DEFUN (no_ipv6_access_list_remark_comment, return no_ipv6_access_list_remark(self, vty, argc, argv); } -void config_write_access_zebra(struct vty *, struct filter *); -void config_write_access_cisco(struct vty *, struct filter *); +static void config_write_access_zebra(struct vty *, struct filter *); +static void config_write_access_cisco(struct vty *, struct filter *); /* show access-list command. */ static int filter_show(struct vty *vty, const char *name, afi_t afi) @@ -2685,7 +2685,7 @@ DEFUN (show_ipv6_access_list_name, return filter_show(vty, argv[idx_word]->arg, AFI_IP6); } -void config_write_access_cisco(struct vty *vty, struct filter *mfilter) +static void config_write_access_cisco(struct vty *vty, struct filter *mfilter) { struct filter_cisco *filter; @@ -2724,7 +2724,7 @@ void config_write_access_cisco(struct vty *vty, struct filter *mfilter) } } -void config_write_access_zebra(struct vty *vty, struct filter *mfilter) +static void config_write_access_zebra(struct vty *vty, struct filter *mfilter) { struct filter_zebra *filter; struct prefix *p; diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c index a23874a517..8ccdbfcbc1 100644 --- a/lib/grammar_sandbox.c +++ b/lib/grammar_sandbox.c @@ -38,9 +38,9 @@ DEFINE_MTYPE_STATIC(LIB, CMD_TOKENS, "Command desc") /** headers **/ void grammar_sandbox_init(void); -void pretty_print_graph(struct vty *vty, struct graph_node *, int, int, - struct graph_node **, size_t); -void init_cmdgraph(struct vty *, struct graph **); +static void pretty_print_graph(struct vty *vty, struct graph_node *, int, int, + struct graph_node **, size_t); +static void init_cmdgraph(struct vty *, struct graph **); /** shim interface commands **/ static struct graph *nodegraph = NULL, *nodegraph_free = NULL; @@ -491,8 +491,9 @@ void grammar_sandbox_init(void) * @param start the node to take as the root * @param level indent level for recursive calls, always pass 0 */ -void pretty_print_graph(struct vty *vty, struct graph_node *start, int level, - int desc, struct graph_node **stack, size_t stackpos) +static void pretty_print_graph(struct vty *vty, struct graph_node *start, + int level, int desc, struct graph_node **stack, + size_t stackpos) { // print this node char tokennum[32]; @@ -550,7 +551,7 @@ void pretty_print_graph(struct vty *vty, struct graph_node *start, int level, } /** stuff that should go in command.c + command.h */ -void init_cmdgraph(struct vty *vty, struct graph **graph) +static void init_cmdgraph(struct vty *vty, struct graph **graph) { // initialize graph, add start noe *graph = graph_new(); diff --git a/lib/sockopt.c b/lib/sockopt.c index 7726d74ff7..3b12d16cbc 100644 --- a/lib/sockopt.c +++ b/lib/sockopt.c @@ -121,21 +121,6 @@ int setsockopt_ipv6_pktinfo(int sock, int val) return ret; } -/* Set multicast hops val to the socket. */ -int setsockopt_ipv6_checksum(int sock, int val) -{ - int ret; - -#ifdef GNU_LINUX - ret = setsockopt(sock, IPPROTO_RAW, IPV6_CHECKSUM, &val, sizeof(val)); -#else - ret = setsockopt(sock, IPPROTO_IPV6, IPV6_CHECKSUM, &val, sizeof(val)); -#endif /* GNU_LINUX */ - if (ret < 0) - flog_err(EC_LIB_SOCKET, "can't setsockopt IPV6_CHECKSUM"); - return ret; -} - /* Set multicast hops val to the socket. */ int setsockopt_ipv6_multicast_hops(int sock, int val) { diff --git a/lib/sockopt.h b/lib/sockopt.h index f6b57b8e07..59d8a65964 100644 --- a/lib/sockopt.h +++ b/lib/sockopt.h @@ -33,7 +33,6 @@ extern int getsockopt_so_sendbuf(const int sock); extern int getsockopt_so_recvbuf(const int sock); extern int setsockopt_ipv6_pktinfo(int, int); -extern int setsockopt_ipv6_checksum(int, int); extern int setsockopt_ipv6_multicast_hops(int, int); extern int setsockopt_ipv6_unicast_hops(int, int); extern int setsockopt_ipv6_hoplimit(int, int); diff --git a/lib/systemd.c b/lib/systemd.c index 16fbbff380..81b0400ab9 100644 --- a/lib/systemd.c +++ b/lib/systemd.c @@ -32,7 +32,7 @@ * Wrapper this silliness if we * don't have systemd */ -void systemd_send_information(const char *info) +static void systemd_send_information(const char *info) { #if defined HAVE_SYSTEMD sd_notify(0, info); diff --git a/lib/systemd.h b/lib/systemd.h index 1f730720ce..d9885c5d9c 100644 --- a/lib/systemd.h +++ b/lib/systemd.h @@ -32,7 +32,6 @@ extern "C" { * To turn on systemd compilation, use --enable-systemd on * configure run. */ -void systemd_send_information(const char *info); void systemd_send_stopping(void); /* -- 2.39.5