[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180820230231.24723-5-stephen@networkplumber.org>
Date: Mon, 20 Aug 2018 16:02:31 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2 4/4] tc: drop extern from function prototypes
Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
tc/m_ematch.h | 35 +++++++++++++++--------------------
tc/m_pedit.h | 31 +++++++++++++++----------------
tc/tc_common.h | 30 +++++++++++++++---------------
tc/tc_red.h | 7 ++++---
4 files changed, 49 insertions(+), 54 deletions(-)
diff --git a/tc/m_ematch.h b/tc/m_ematch.h
index f634f19164fa..ff02d7ac9112 100644
--- a/tc/m_ematch.h
+++ b/tc/m_ematch.h
@@ -12,17 +12,16 @@
#define EMATCHKINDSIZ 16
-struct bstr
-{
+struct bstr {
char *data;
unsigned int len;
int quoted;
struct bstr *next;
};
-extern struct bstr * bstr_alloc(const char *text);
+struct bstr *bstr_alloc(const char *text);
-static inline struct bstr * bstr_new(char *data, unsigned int len)
+static inline struct bstr *bstr_new(char *data, unsigned int len)
{
struct bstr *b = calloc(1, sizeof(*b));
@@ -35,7 +34,7 @@ static inline struct bstr * bstr_new(char *data, unsigned int len)
return b;
}
-static inline int bstrcmp(struct bstr *b, const char *text)
+static inline int bstrcmp(const struct bstr *b, const char *text)
{
int len = strlen(text);
int d = b->len - len;
@@ -51,12 +50,10 @@ static inline struct bstr *bstr_next(struct bstr *b)
return b->next;
}
-extern unsigned long bstrtoul(const struct bstr *b);
-extern void bstr_print(FILE *fd, const struct bstr *b, int ascii);
-
+unsigned long bstrtoul(const struct bstr *b);
+void bstr_print(FILE *fd, const struct bstr *b, int ascii);
-struct ematch
-{
+struct ematch {
struct bstr *args;
int index;
int inverted;
@@ -66,7 +63,7 @@ struct ematch
struct ematch *next;
};
-static inline struct ematch * new_ematch(struct bstr *args, int inverted)
+static inline struct ematch *new_ematch(struct bstr *args, int inverted)
{
struct ematch *e = calloc(1, sizeof(*e));
@@ -79,14 +76,12 @@ static inline struct ematch * new_ematch(struct bstr *args, int inverted)
return e;
}
-extern void print_ematch_tree(const struct ematch *tree);
+void print_ematch_tree(const struct ematch *tree);
-
-struct ematch_util
-{
+struct ematch_util {
char kind[EMATCHKINDSIZ];
int kind_num;
- int (*parse_eopt)(struct nlmsghdr *,struct tcf_ematch_hdr *,
+ int (*parse_eopt)(struct nlmsghdr *, struct tcf_ematch_hdr *,
struct bstr *);
int (*parse_eopt_argv)(struct nlmsghdr *, struct tcf_ematch_hdr *,
int, char **);
@@ -95,7 +90,7 @@ struct ematch_util
struct ematch_util *next;
};
-static inline int parse_layer(struct bstr *b)
+static inline int parse_layer(const struct bstr *b)
{
if (*((char *) b->data) == 'l')
return TCF_LAYER_LINK;
@@ -107,9 +102,9 @@ static inline int parse_layer(struct bstr *b)
return INT_MAX;
}
-extern int em_parse_error(int err, struct bstr *args, struct bstr *carg,
+int em_parse_error(int err, struct bstr *args, struct bstr *carg,
struct ematch_util *, char *fmt, ...);
-extern int print_ematch(FILE *, const struct rtattr *);
-extern int parse_ematch(int *, char ***, int, struct nlmsghdr *);
+int print_ematch(FILE *, const struct rtattr *);
+int parse_ematch(int *, char ***, int, struct nlmsghdr *);
#endif
diff --git a/tc/m_pedit.h b/tc/m_pedit.h
index a8b069581509..b6b274bd08c7 100644
--- a/tc/m_pedit.h
+++ b/tc/m_pedit.h
@@ -71,23 +71,22 @@ struct m_pedit_util {
struct m_pedit_key *tkey);
};
-extern int pack_key(struct m_pedit_sel *sel, struct m_pedit_key *tkey);
-extern int pack_key32(__u32 retain, struct m_pedit_sel *sel,
- struct m_pedit_key *tkey);
-extern int pack_key16(__u32 retain, struct m_pedit_sel *sel,
- struct m_pedit_key *tkey);
-extern int pack_key8(__u32 retain, struct m_pedit_sel *sel,
+int pack_key(struct m_pedit_sel *sel, struct m_pedit_key *tkey);
+int pack_key32(__u32 retain, struct m_pedit_sel *sel,
+ struct m_pedit_key *tkey);
+int pack_key16(__u32 retain, struct m_pedit_sel *sel,
+ struct m_pedit_key *tkey);
+int pack_key8(__u32 retain, struct m_pedit_sel *sel,
struct m_pedit_key *tkey);
-extern int parse_val(int *argc_p, char ***argv_p, __u32 *val, int type);
-extern int parse_cmd(int *argc_p, char ***argv_p, __u32 len, int type,
- __u32 retain,
- struct m_pedit_sel *sel, struct m_pedit_key *tkey);
-extern int parse_offset(int *argc_p, char ***argv_p,
- struct m_pedit_sel *sel, struct m_pedit_key *tkey);
+int parse_val(int *argc_p, char ***argv_p, __u32 *val, int type);
+int parse_cmd(int *argc_p, char ***argv_p, __u32 len, int type,
+ __u32 retain,
+ struct m_pedit_sel *sel, struct m_pedit_key *tkey);
+int parse_offset(int *argc_p, char ***argv_p,
+ struct m_pedit_sel *sel, struct m_pedit_key *tkey);
int parse_pedit(struct action_util *a, int *argc_p, char ***argv_p,
int tca_id, struct nlmsghdr *n);
-extern int print_pedit(struct action_util *au, FILE *f, struct rtattr *arg);
-extern int pedit_print_xstats(struct action_util *au, FILE *f,
- struct rtattr *xstats);
-
+int print_pedit(struct action_util *au, FILE *f, struct rtattr *arg);
+int pedit_print_xstats(struct action_util *au, FILE *f,
+ struct rtattr *xstats);
#endif
diff --git a/tc/tc_common.h b/tc/tc_common.h
index 272d1727027d..371ca7d04602 100644
--- a/tc/tc_common.h
+++ b/tc/tc_common.h
@@ -5,26 +5,26 @@
extern struct rtnl_handle rth;
-extern int do_qdisc(int argc, char **argv);
-extern int do_class(int argc, char **argv);
-extern int do_filter(int argc, char **argv, void *buf, size_t buflen);
-extern int do_chain(int argc, char **argv, void *buf, size_t buflen);
-extern int do_action(int argc, char **argv, void *buf, size_t buflen);
-extern int do_tcmonitor(int argc, char **argv);
-extern int do_exec(int argc, char **argv);
+int do_qdisc(int argc, char **argv);
+int do_class(int argc, char **argv);
+int do_filter(int argc, char **argv, void *buf, size_t buflen);
+int do_chain(int argc, char **argv, void *buf, size_t buflen);
+int do_action(int argc, char **argv, void *buf, size_t buflen);
+int do_tcmonitor(int argc, char **argv);
+int do_exec(int argc, char **argv);
-extern int print_action(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
-extern int print_filter(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
-extern int print_qdisc(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
-extern int print_class(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
-extern void print_size_table(FILE *fp, const char *prefix, struct rtattr *rta);
+int print_action(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
+int print_filter(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
+int print_qdisc(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
+int print_class(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
+void print_size_table(FILE *fp, const char *prefix, struct rtattr *rta);
struct tc_estimator;
-extern int parse_estimator(int *p_argc, char ***p_argv, struct tc_estimator *est);
+int parse_estimator(int *p_argc, char ***p_argv, struct tc_estimator *est);
struct tc_sizespec;
-extern int parse_size_table(int *p_argc, char ***p_argv, struct tc_sizespec *s);
-extern int check_size_table_opts(struct tc_sizespec *s);
+int parse_size_table(int *p_argc, char ***p_argv, struct tc_sizespec *s);
+int check_size_table_opts(struct tc_sizespec *s);
extern int show_graph;
extern bool use_names;
diff --git a/tc/tc_red.h b/tc/tc_red.h
index 88fba58b7416..6c6e6b039732 100644
--- a/tc/tc_red.h
+++ b/tc/tc_red.h
@@ -2,8 +2,9 @@
#ifndef _TC_RED_H_
#define _TC_RED_H_ 1
-extern int tc_red_eval_P(unsigned qmin, unsigned qmax, double prob);
-extern int tc_red_eval_ewma(unsigned qmin, unsigned burst, unsigned avpkt);
-extern int tc_red_eval_idle_damping(int wlog, unsigned avpkt, unsigned bandwidth, __u8 *sbuf);
+int tc_red_eval_P(unsigned qmin, unsigned qmax, double prob);
+int tc_red_eval_ewma(unsigned qmin, unsigned burst, unsigned avpkt);
+int tc_red_eval_idle_damping(int wlog, unsigned avpkt, unsigned bandwidth,
+ __u8 *sbuf);
#endif
--
2.18.0
Powered by blists - more mailing lists