]> git.proxmox.com Git - mirror_iproute2.git/blob - ip/ip_common.h
ip: add MACsec support
[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 int print_nsid(const struct sockaddr_nl *who,
35 struct nlmsghdr *n, void *arg);
36 int do_ipaddr(int argc, char **argv);
37 int do_ipaddrlabel(int argc, char **argv);
38 int do_iproute(int argc, char **argv);
39 int do_iprule(int argc, char **argv);
40 int do_ipneigh(int argc, char **argv);
41 int do_ipntable(int argc, char **argv);
42 int do_iptunnel(int argc, char **argv);
43 int do_ip6tunnel(int argc, char **argv);
44 int do_iptuntap(int argc, char **argv);
45 int do_iplink(int argc, char **argv);
46 int do_ipmacsec(int argc, char **argv);
47 int do_ipmonitor(int argc, char **argv);
48 int do_multiaddr(int argc, char **argv);
49 int do_multiroute(int argc, char **argv);
50 int do_multirule(int argc, char **argv);
51 int do_netns(int argc, char **argv);
52 int do_xfrm(int argc, char **argv);
53 int do_ipl2tp(int argc, char **argv);
54 int do_ipfou(int argc, char **argv);
55 int do_tcp_metrics(int argc, char **argv);
56 int do_ipnetconf(int argc, char **argv);
57 int do_iptoken(int argc, char **argv);
58 int iplink_get(unsigned int flags, char *name, __u32 filt_mask);
59
60 static inline int rtm_get_table(struct rtmsg *r, struct rtattr **tb)
61 {
62 __u32 table = r->rtm_table;
63
64 if (tb[RTA_TABLE])
65 table = rta_getattr_u32(tb[RTA_TABLE]);
66 return table;
67 }
68
69 extern struct rtnl_handle rth;
70
71 #include <stdbool.h>
72
73 struct link_util {
74 struct link_util *next;
75 const char *id;
76 int maxattr;
77 int (*parse_opt)(struct link_util *, int, char **,
78 struct nlmsghdr *);
79 void (*print_opt)(struct link_util *, FILE *,
80 struct rtattr *[]);
81 void (*print_xstats)(struct link_util *, FILE *,
82 struct rtattr *);
83 void (*print_help)(struct link_util *, int, char **,
84 FILE *);
85 bool slave;
86 };
87
88 struct link_util *get_link_kind(const char *kind);
89 struct link_util *get_link_slave_kind(const char *slave_kind);
90
91 void br_dump_bridge_id(const struct ifla_bridge_id *id, char *buf, size_t len);
92
93 #ifndef INFINITY_LIFE_TIME
94 #define INFINITY_LIFE_TIME 0xFFFFFFFFU
95 #endif
96
97 #ifndef LABEL_MAX_MASK
98 #define LABEL_MAX_MASK 0xFFFFFU
99 #endif