]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
ip: Consolidate ip, xdp and lwtunnel parse/dump prototypes in ip_common.h
authorSerhey Popovych <serhe.popovych@gmail.com>
Wed, 31 Jan 2018 08:15:06 +0000 (10:15 +0200)
committerDavid Ahern <dsahern@gmail.com>
Fri, 2 Feb 2018 22:55:12 +0000 (14:55 -0800)
Having iplink_parse() and @struct iplink_req in include/utils.h does not
reflect it's IP nature: move to ip/ip_common.h.

Move contents of ip/iplink_xdp.h and ip/iproute_lwtunnel.h to
ip/ip_common.h since they are small (i.e. only two function prototypes):
ip/iplink_bridge.c and ip/iplink_vrf.c prototypes already there.

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
include/utils.h
ip/ip_common.h
ip/ipaddress.c
ip/iplink.c
ip/iplink_xdp.c
ip/iproute.c
ip/iproute_lwtunnel.c
ip/iproute_lwtunnel.h [deleted file]
ip/xdp.h [deleted file]

index 0394268e1276f7c7d47c3495844b391156440236..f81928abe78ce45e8da0c9f7a4ddb1ca8c59c279 100644 (file)
@@ -272,16 +272,6 @@ extern int cmdlineno;
 ssize_t getcmdline(char **line, size_t *len, FILE *in);
 int makeargs(char *line, char *argv[], int maxargs);
 
-struct iplink_req {
-       struct nlmsghdr         n;
-       struct ifinfomsg        i;
-       char                    buf[1024];
-};
-
-int iplink_parse(int argc, char **argv, struct iplink_req *req,
-               char **name, char **type, char **link, char **dev,
-               int *group, int *index);
-
 int do_each_netns(int (*func)(char *nsname, void *arg), void *arg,
                bool show_label);
 
index f5adbad959aa76cf256ccf2e58085273431f5dfa..1397d99b6745b1895ac4ffb359854cd3d66ca190 100644 (file)
@@ -108,6 +108,12 @@ static inline int rtm_get_table(struct rtmsg *r, struct rtattr **tb)
 
 extern struct rtnl_handle rth;
 
+struct iplink_req {
+       struct nlmsghdr         n;
+       struct ifinfomsg        i;
+       char                    buf[1024];
+};
+
 struct link_util {
        struct link_util        *next;
        const char              *id;
@@ -128,11 +134,26 @@ struct link_util {
 
 struct link_util *get_link_kind(const char *kind);
 
+int iplink_parse(int argc, char **argv, struct iplink_req *req,
+                char **name, char **type, char **link, char **dev,
+                int *group, int *index);
+
+/* iplink_bridge.c */
 void br_dump_bridge_id(const struct ifla_bridge_id *id, char *buf, size_t len);
 int bridge_parse_xstats(struct link_util *lu, int argc, char **argv);
 int bridge_print_xstats(const struct sockaddr_nl *who,
                        struct nlmsghdr *n, void *arg);
 
+/* iproute_lwtunnel.c */
+int lwt_parse_encap(struct rtattr *rta, size_t len, int *argcp, char ***argvp);
+void lwt_print_encap(FILE *fp, struct rtattr *encap_type, struct rtattr *encap);
+
+/* iplink_xdp.c */
+int xdp_parse(int *argc, char ***argv, struct iplink_req *req, __u32 ifindex,
+             bool generic, bool drv, bool offload);
+void xdp_dump(FILE *fp, struct rtattr *tb, bool link, bool details);
+
+/* iplink_vrf.c */
 __u32 ipvrf_get_table(const char *name);
 int name_is_vrf(const char *name);
 
index b18b6f44c9609cc1e89bbd34efa1982aa1fd90ba..4707c2b7b4e308bb5975b7240bc74d769a279c43 100644 (file)
@@ -34,7 +34,6 @@
 #include "utils.h"
 #include "ll_map.h"
 #include "ip_common.h"
-#include "xdp.h"
 #include "color.h"
 
 enum {
index 882cd13103c800940e2c6581766dd57b33253e8a..8231fae7f3775cefd921403e8a5b8edfea648381 100644 (file)
@@ -31,7 +31,6 @@
 #include "rt_names.h"
 #include "utils.h"
 #include "ip_common.h"
-#include "xdp.h"
 #include "namespace.h"
 
 #define IPLINK_IOCTL_COMPAT    1
index 6eeb820af0c34fed6267bfb2c6e33b9c59b28d2e..83826358aa227a5563ecf859d2bd61f5d79ea12b 100644 (file)
@@ -14,9 +14,9 @@
 
 #include <linux/bpf.h>
 
-#include "json_print.h"
-#include "xdp.h"
 #include "bpf_util.h"
+#include "utils.h"
+#include "ip_common.h"
 
 extern int force;
 
index bf886fda9d761cbb86fe740aadf0d08106854dd5..7616c0d95290c57ff5b2284a41296b671f2f3a3e 100644 (file)
@@ -28,7 +28,6 @@
 #include "rt_names.h"
 #include "utils.h"
 #include "ip_common.h"
-#include "iproute_lwtunnel.h"
 
 #ifndef RTAX_RTTVAR
 #define RTAX_RTTVAR RTAX_HOPS
index ffa897a3f3dd1c76ef399cffddabee12aafcc0d4..f7fbc6287932b4d73c76a5753ae0b224c09094cc 100644 (file)
@@ -22,9 +22,9 @@
 #include <errno.h>
 
 #include "rt_names.h"
-#include "utils.h"
-#include "iproute_lwtunnel.h"
 #include "bpf_util.h"
+#include "utils.h"
+#include "ip_common.h"
 #include "ila_common.h"
 
 #include <linux/seg6.h>
diff --git a/ip/iproute_lwtunnel.h b/ip/iproute_lwtunnel.h
deleted file mode 100644 (file)
index be003ce..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __LWTUNNEL_H__
-#define __LETUNNEL_H__ 1
-
-int lwt_parse_encap(struct rtattr *rta, size_t len, int *argcp, char ***argvp);
-void lwt_print_encap(FILE *fp, struct rtattr *encap_type,
-                    struct rtattr *encap);
-
-#endif
diff --git a/ip/xdp.h b/ip/xdp.h
deleted file mode 100644 (file)
index 7e10696..0000000
--- a/ip/xdp.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#ifndef __XDP__
-#define __XDP__
-
-#include "utils.h"
-
-int xdp_parse(int *argc, char ***argv, struct iplink_req *req, __u32 ifindex,
-             bool generic, bool drv, bool offload);
-void xdp_dump(FILE *fp, struct rtattr *tb, bool link, bool details);
-
-#endif /* __XDP__ */