summaryrefslogtreecommitdiff
path: root/usr.sbin/eigrpd/printconf.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@cvs.openbsd.org>2016-09-02 16:44:34 +0000
committerRenato Westphal <renato@cvs.openbsd.org>2016-09-02 16:44:34 +0000
commitfcf9752bb7cfa0955234368e43600610c4308242 (patch)
treef12e2cdd668aab5d8339150fa1af1dfada1dda77 /usr.sbin/eigrpd/printconf.c
parentdcaa3316f517f3e75debd2dc1ae2838de28a7b02 (diff)
Make functions and variables static whenever possible.
style(9) says: "Function prototypes for private functions (i.e., functions not used elsewhere) go at the top of the first source module. In userland, functions local to one source module should be declared 'static'". The benefits of doing so include: * clean up of the eigrpd global namespace; * improved readability; * more hints to the compiler/linker to generate more efficient code. Additional changes: * Declare all extern variables in header files; * Clean up the indentation of all function prototypes and global variables. ok claudio@ benno@
Diffstat (limited to 'usr.sbin/eigrpd/printconf.c')
-rw-r--r--usr.sbin/eigrpd/printconf.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/usr.sbin/eigrpd/printconf.c b/usr.sbin/eigrpd/printconf.c
index a4ba0c3c6e7..826ef1d2436 100644
--- a/usr.sbin/eigrpd/printconf.c
+++ b/usr.sbin/eigrpd/printconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printconf.c,v 1.5 2016/09/02 16:29:55 renato Exp $ */
+/* $OpenBSD: printconf.c,v 1.6 2016/09/02 16:44:33 renato Exp $ */
/*
* Copyright (c) 2015 Renato Westphal <renato@openbsd.org>
@@ -24,15 +24,15 @@
#include "eigrpd.h"
#include "log.h"
-void print_mainconf(struct eigrpd_conf *);
-const char *print_no(uint16_t);
-void print_redist_metric(struct redist_metric *);
-void print_redistribute(struct eigrp *);
-void print_iface(struct eigrp_iface *);
-void print_as(struct eigrp *);
-void print_af(struct eigrpd_conf *, int);
+static void print_mainconf(struct eigrpd_conf *);
+static const char *print_no(uint16_t);
+static void print_redist_metric(struct redist_metric *);
+static void print_redistribute(struct eigrp *);
+static void print_iface(struct eigrp_iface *);
+static void print_as(struct eigrp *);
+static void print_af(struct eigrpd_conf *, int);
-void
+static void
print_mainconf(struct eigrpd_conf *conf)
{
printf("router-id %s\n", inet_ntoa(conf->rtr_id));
@@ -48,7 +48,7 @@ print_mainconf(struct eigrpd_conf *conf)
printf("fib-priority-summary %u\n", conf->fib_priority_summary);
}
-const char *
+static const char *
print_no(uint16_t type)
{
if (type & REDIST_NO)
@@ -57,14 +57,14 @@ print_no(uint16_t type)
return ("");
}
-void
+static void
print_redist_metric(struct redist_metric *metric)
{
printf(" %u %u %u %u %u", metric->bandwidth, metric->delay,
metric->reliability, metric->load, metric->mtu);
}
-void
+static void
print_redistribute(struct eigrp *eigrp)
{
struct redistribute *r;
@@ -108,7 +108,7 @@ print_redistribute(struct eigrp *eigrp)
}
}
-void
+static void
print_iface(struct eigrp_iface *ei)
{
struct summary_addr *summary;
@@ -127,7 +127,7 @@ print_iface(struct eigrp_iface *ei)
printf("\t\t}\n");
}
-void
+static void
print_as(struct eigrp *eigrp)
{
struct eigrp_iface *ei;
@@ -147,7 +147,7 @@ print_as(struct eigrp *eigrp)
printf("\t}\n");
}
-void
+static void
print_af(struct eigrpd_conf *conf, int af)
{
struct eigrp *eigrp;