summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2017-02-27 12:17:22 +0100
committerThomas Haller <thaller@redhat.com>2017-02-27 14:01:22 +0100
commit5d4a545dec75669f062cfad71b6e61c5536842df (patch)
tree33c4998d7623de6e923d50f052b00aa035862890 /tests
parent2435d7be0d1b21e77a23fde61685dd9a9e617bcf (diff)
downloadlibnl-5d4a545dec75669f062cfad71b6e61c5536842df.tar.gz
all: enable -Wmissing-prototype warning for all components
Diffstat (limited to 'tests')
-rw-r--r--tests/check-addr.c2
-rw-r--r--tests/check-all.c3
-rw-r--r--tests/test-complex-HTB-with-hash-filters.c22
-rw-r--r--tests/test-create-bridge.c2
-rw-r--r--tests/util.h4
5 files changed, 19 insertions, 14 deletions
diff --git a/tests/check-addr.c b/tests/check-addr.c
index 39f3ede4..48a2d931 100644
--- a/tests/check-addr.c
+++ b/tests/check-addr.c
@@ -12,6 +12,8 @@
#include <check.h>
#include <netlink/addr.h>
+#include "util.h"
+
START_TEST(addr_alloc)
{
struct nl_addr *addr;
diff --git a/tests/check-all.c b/tests/check-all.c
index e4318024..042452dd 100644
--- a/tests/check-all.c
+++ b/tests/check-all.c
@@ -11,8 +11,7 @@
#include <check.h>
-extern Suite *make_nl_addr_suite(void);
-extern Suite *make_nl_attr_suite(void);
+#include "util.h"
static Suite *main_suite(void)
{
diff --git a/tests/test-complex-HTB-with-hash-filters.c b/tests/test-complex-HTB-with-hash-filters.c
index 48cf5e32..453f8016 100644
--- a/tests/test-complex-HTB-with-hash-filters.c
+++ b/tests/test-complex-HTB-with-hash-filters.c
@@ -29,7 +29,7 @@
#define TC_HANDLE(maj, min) (TC_H_MAJ((maj) << 16) | TC_H_MIN(min))
/* some functions are copied from iproute-tc tool */
-int get_u32(__u32 *val, const char *arg, int base)
+static int get_u32(__u32 *val, const char *arg, int base)
{
unsigned long res;
char *ptr;
@@ -43,7 +43,7 @@ int get_u32(__u32 *val, const char *arg, int base)
return 0;
}
-int get_u32_handle(__u32 *handle, const char *str)
+static int get_u32_handle(__u32 *handle, const char *str)
{
__u32 htid=0, hash=0, nodeid=0;
char *tmp = strchr(str, ':');
@@ -78,7 +78,7 @@ int get_u32_handle(__u32 *handle, const char *str)
return 0;
}
-uint32_t get_u32_parse_handle(const char *cHandle)
+static uint32_t get_u32_parse_handle(const char *cHandle)
{
uint32_t handle=0;
@@ -94,7 +94,7 @@ uint32_t get_u32_parse_handle(const char *cHandle)
return handle;
}
-int get_tc_classid(__u32 *h, const char *str)
+static int get_tc_classid(__u32 *h, const char *str)
{
__u32 maj, min;
char *p;
@@ -134,7 +134,7 @@ ok:
* Function that adds a new filter and attach it to a hash table
*
*/
-int u32_add_filter_on_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio,
+static int u32_add_filter_on_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio,
uint32_t keyval, uint32_t keymask, int keyoff, int keyoffmask,
uint32_t htid, uint32_t classid
)
@@ -186,7 +186,7 @@ int u32_add_filter_on_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint3
* and set next hash table link with hash mask
*
*/
-int u32_add_filter_on_ht_with_hashmask(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio,
+static int u32_add_filter_on_ht_with_hashmask(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio,
uint32_t keyval, uint32_t keymask, int keyoff, int keyoffmask,
uint32_t htid, uint32_t htlink, uint32_t hmask, uint32_t hoffset
)
@@ -237,7 +237,7 @@ int u32_add_filter_on_ht_with_hashmask(struct nl_sock *sock, struct rtnl_link *r
/*
* function that creates a new hash table
*/
-int u32_add_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio, uint32_t htid, uint32_t divisor)
+static int u32_add_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio, uint32_t htid, uint32_t divisor)
{
int err;
@@ -276,7 +276,7 @@ int u32_add_ht(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t prio,
/*
* function that adds a new HTB qdisc and set the default class for unclassified traffic
*/
-int qdisc_add_HTB(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t defaultClass)
+static int qdisc_add_HTB(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t defaultClass)
{
struct rtnl_qdisc *qdisc;
@@ -326,7 +326,7 @@ int qdisc_add_HTB(struct nl_sock *sock, struct rtnl_link *rtnlLink, uint32_t def
/*
* function that adds a new HTB class and set its parameters
*/
-int class_add_HTB(struct nl_sock *sock, struct rtnl_link *rtnlLink,
+static int class_add_HTB(struct nl_sock *sock, struct rtnl_link *rtnlLink,
uint32_t parentMaj, uint32_t parentMin,
uint32_t childMaj, uint32_t childMin,
uint64_t rate, uint64_t ceil,
@@ -388,7 +388,7 @@ int class_add_HTB(struct nl_sock *sock, struct rtnl_link *rtnlLink,
/*
* function that adds a HTB root class and set its parameters
*/
-int class_add_HTB_root(struct nl_sock *sock, struct rtnl_link *rtnlLink,
+static int class_add_HTB_root(struct nl_sock *sock, struct rtnl_link *rtnlLink,
uint64_t rate, uint64_t ceil,
uint32_t burst, uint32_t cburst
)
@@ -443,7 +443,7 @@ int class_add_HTB_root(struct nl_sock *sock, struct rtnl_link *rtnlLink,
/*
* function that adds a new SFQ qdisc as a leaf for a HTB class
*/
-int qdisc_add_SFQ_leaf(struct nl_sock *sock, struct rtnl_link *rtnlLink,
+static int qdisc_add_SFQ_leaf(struct nl_sock *sock, struct rtnl_link *rtnlLink,
uint32_t parentMaj, uint32_t parentMin,
int quantum, int limit, int perturb
)
diff --git a/tests/test-create-bridge.c b/tests/test-create-bridge.c
index 7202cd7e..c4bec375 100644
--- a/tests/test-create-bridge.c
+++ b/tests/test-create-bridge.c
@@ -5,7 +5,7 @@
#define TEST_BRIDGE_NAME "testbridge"
#define TEST_INTERFACE_NAME "testtap1"
-int create_bridge(struct nl_sock *sk, struct nl_cache *link_cache, const char *name) {
+static int create_bridge(struct nl_sock *sk, struct nl_cache *link_cache, const char *name) {
struct rtnl_link *link;
int err;
diff --git a/tests/util.h b/tests/util.h
index c6753835..cd383ef8 100644
--- a/tests/util.h
+++ b/tests/util.h
@@ -3,3 +3,7 @@
#define nl_fail_if(condition, error, message) \
fail_if((condition), "nlerr=%d (%s): %s", \
(error), nl_geterror(error), (message))
+
+Suite *make_nl_attr_suite(void);
+Suite *make_nl_addr_suite(void);
+