]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/m_ematch.h
bridge: fdb: add support for src_vni option
[mirror_iproute2.git] / tc / m_ematch.h
index f634f19164faf17bd75ca8a0ed5a7b429937b774..c4443ee22942d38dad0ab72a943bbb895743f542 100644 (file)
 
 #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,9 @@ 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);
 
-struct ematch
-{
+struct ematch {
        struct bstr     *args;
        int             index;
        int             inverted;
@@ -66,7 +62,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 +75,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 +89,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 +101,10 @@ static inline int parse_layer(struct bstr *b)
                return INT_MAX;
 }
 
-extern int em_parse_error(int err, struct bstr *args, struct bstr *carg,
+__attribute__((format(printf, 5, 6)))
+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