summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldpd/labelmapping.c
diff options
context:
space:
mode:
authorrenato <renato@openbsd.org>2016-05-23 19:09:25 +0000
committerrenato <renato@openbsd.org>2016-05-23 19:09:25 +0000
commitc28a25a1463c46f98e1aa4db41e1d80505f68682 (patch)
tree9d5a3f05682077daecc59e521beacf1bca6ddf54 /usr.sbin/ldpd/labelmapping.c
parentIntroduce the 'ldpctl clear neighbors' command. (diff)
downloadwireguard-openbsd-c28a25a1463c46f98e1aa4db41e1d80505f68682.tar.xz
wireguard-openbsd-c28a25a1463c46f98e1aa4db41e1d80505f68682.zip
Make functions and variables static whenever possible.
The benefits of this include: * clean up of the ldpd global namespace; * improved readability; * more hints to the compiler/linker to generate more efficient code. Whenever possible, move global static variables to a smaller scope (function). All extern variables are now declared in header files to avoid unnecessary duplication. This patch also cleans up the indentation of all function prototypes and global variables.
Diffstat (limited to 'usr.sbin/ldpd/labelmapping.c')
-rw-r--r--usr.sbin/ldpd/labelmapping.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/ldpd/labelmapping.c b/usr.sbin/ldpd/labelmapping.c
index ed98c95c4bf..3697f483466 100644
--- a/usr.sbin/ldpd/labelmapping.c
+++ b/usr.sbin/ldpd/labelmapping.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: labelmapping.c,v 1.43 2016/05/23 18:58:48 renato Exp $ */
+/* $OpenBSD: labelmapping.c,v 1.44 2016/05/23 19:09:25 renato Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -38,11 +38,11 @@
#include "log.h"
#include "ldpe.h"
-void gen_label_tlv(struct ibuf *, uint32_t);
-void gen_reqid_tlv(struct ibuf *, uint32_t);
-
-int tlv_decode_label(struct nbr *, struct ldp_msg *, char *, uint16_t,
- uint32_t *);
+static void enqueue_pdu(struct nbr *, struct ibuf *, uint16_t);
+static void gen_label_tlv(struct ibuf *, uint32_t);
+static int tlv_decode_label(struct nbr *, struct ldp_msg *, char *,
+ uint16_t, uint32_t *);
+static void gen_reqid_tlv(struct ibuf *, uint32_t);
static void
enqueue_pdu(struct nbr *nbr, struct ibuf *buf, uint16_t size)
@@ -439,7 +439,7 @@ err:
}
/* Other TLV related functions */
-void
+static void
gen_label_tlv(struct ibuf *buf, uint32_t label)
{
struct label_tlv lt;
@@ -451,7 +451,7 @@ gen_label_tlv(struct ibuf *buf, uint32_t label)
ibuf_add(buf, &lt, sizeof(lt));
}
-int
+static int
tlv_decode_label(struct nbr *nbr, struct ldp_msg *lm, char *buf,
uint16_t len, uint32_t *label)
{
@@ -498,7 +498,7 @@ tlv_decode_label(struct nbr *nbr, struct ldp_msg *lm, char *buf,
return (sizeof(lt));
}
-void
+static void
gen_reqid_tlv(struct ibuf *buf, uint32_t reqid)
{
struct reqid_tlv rt;