]> git.proxmox.com Git - mirror_iproute2.git/blob - ip/ip_common.h
Introduce ip vrf command
[mirror_iproute2.git] / ip / ip_common.h
1 int get_operstate(const char *name);
2 int print_linkinfo(const struct sockaddr_nl *who,
3 struct nlmsghdr *n, void *arg);
4 int print_linkinfo_brief(const struct sockaddr_nl *who,
5 struct nlmsghdr *n, void *arg);
6 int print_addrinfo(const struct sockaddr_nl *who,
7 struct nlmsghdr *n, void *arg);
8 int print_addrlabel(const struct sockaddr_nl *who,
9 struct nlmsghdr *n, void *arg);
10 int print_neigh(const struct sockaddr_nl *who,
11 struct nlmsghdr *n, void *arg);
12 int ipaddr_list_link(int argc, char **argv);
13 void ipaddr_get_vf_rate(int, int *, int *, int);
14 void iplink_usage(void) __attribute__((noreturn));
15
16 void iproute_reset_filter(int ifindex);
17 void ipmroute_reset_filter(int ifindex);
18 void ipaddr_reset_filter(int oneline, int ifindex);
19 void ipneigh_reset_filter(int ifindex);
20 void ipnetconf_reset_filter(int ifindex);
21
22 int print_route(const struct sockaddr_nl *who,
23 struct nlmsghdr *n, void *arg);
24 int print_mroute(const struct sockaddr_nl *who,
25 struct nlmsghdr *n, void *arg);
26 int print_prefix(const struct sockaddr_nl *who,
27 struct nlmsghdr *n, void *arg);
28 int print_rule(const struct sockaddr_nl *who,
29 struct nlmsghdr *n, void *arg);
30 int print_netconf(const struct sockaddr_nl *who,
31 struct rtnl_ctrl_data *ctrl,
32 struct nlmsghdr *n, void *arg);
33 void netns_map_init(void);
34 void netns_nsid_socket_init(void);
35 int print_nsid(const struct sockaddr_nl *who,
36 struct nlmsghdr *n, void *arg);
37 int do_ipaddr(int argc, char **argv);
38 int do_ipaddrlabel(int argc, char **argv);
39 int do_iproute(int argc, char **argv);
40 int do_iprule(int argc, char **argv);
41 int do_ipneigh(int argc, char **argv);
42 int do_ipntable(int argc, char **argv);
43 int do_iptunnel(int argc, char **argv);
44 int do_ip6tunnel(int argc, char **argv);
45 int do_iptuntap(int argc, char **argv);
46 int do_iplink(int argc, char **argv);
47 int do_ipmacsec(int argc, char **argv);
48 int do_ipmonitor(int argc, char **argv);
49 int do_multiaddr(int argc, char **argv);
50 int do_multiroute(int argc, char **argv);
51 int do_multirule(int argc, char **argv);
52 int do_netns(int argc, char **argv);
53 int do_xfrm(int argc, char **argv);
54 int do_ipl2tp(int argc, char **argv);
55 int do_ipfou(int argc, char **argv);
56 extern int do_ipila(int argc, char **argv);
57 int do_tcp_metrics(int argc, char **argv);
58 int do_ipnetconf(int argc, char **argv);
59 int do_iptoken(int argc, char **argv);
60 int do_ipvrf(int argc, char **argv);
61
62 int iplink_get(unsigned int flags, char *name, __u32 filt_mask);
63
64 static inline int rtm_get_table(struct rtmsg *r, struct rtattr **tb)
65 {
66 __u32 table = r->rtm_table;
67
68 if (tb[RTA_TABLE])
69 table = rta_getattr_u32(tb[RTA_TABLE]);
70 return table;
71 }
72
73 extern struct rtnl_handle rth;
74
75 #include <stdbool.h>
76
77 struct link_util {
78 struct link_util *next;
79 const char *id;
80 int maxattr;
81 int (*parse_opt)(struct link_util *, int, char **,
82 struct nlmsghdr *);
83 void (*print_opt)(struct link_util *, FILE *,
84 struct rtattr *[]);
85 void (*print_xstats)(struct link_util *, FILE *,
86 struct rtattr *);
87 void (*print_help)(struct link_util *, int, char **,
88 FILE *);
89 };
90
91 struct link_util *get_link_kind(const char *kind);
92
93 void br_dump_bridge_id(const struct ifla_bridge_id *id, char *buf, size_t len);
94
95 __u32 ipvrf_get_table(const char *name);
96 int name_is_vrf(const char *name);
97
98 #ifndef INFINITY_LIFE_TIME
99 #define INFINITY_LIFE_TIME 0xFFFFFFFFU
100 #endif
101
102 #ifndef LABEL_MAX_MASK
103 #define LABEL_MAX_MASK 0xFFFFFU
104 #endif