capi.i 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. %module capi
  2. %{
  3. #include <netlink/route/rtnl.h>
  4. #include <netlink/route/link.h>
  5. #include <netlink/route/link/vlan.h>
  6. #include <netlink/route/link/macvlan.h>
  7. #include <netlink/route/link/vxlan.h>
  8. #include <netlink/route/link/bridge.h>
  9. #include <netlink/route/link/inet.h>
  10. #include <netlink/route/tc.h>
  11. #include <netlink/route/qdisc.h>
  12. #include <netlink/route/class.h>
  13. #include <netlink/route/classifier.h>
  14. #include <netlink/route/qdisc/htb.h>
  15. #include <netlink/route/addr.h>
  16. %}
  17. %include <stdint.i>
  18. %include <cstring.i>
  19. %inline %{
  20. struct nl_object *link2obj(struct rtnl_link *link)
  21. {
  22. return OBJ_CAST(link);
  23. }
  24. struct rtnl_link *obj2link(struct nl_object *obj)
  25. {
  26. return (struct rtnl_link *) obj;
  27. }
  28. struct rtnl_link *get_from_kernel(struct nl_sock *sk, int ifindex, const char *name)
  29. {
  30. struct rtnl_link *link;
  31. if (rtnl_link_get_kernel(sk, ifindex, name, &link) < 0)
  32. return NULL;
  33. return link;
  34. }
  35. uint32_t inet_get_conf(struct rtnl_link *link, const unsigned int id)
  36. {
  37. uint32_t result;
  38. if (rtnl_link_inet_get_conf(link, id, &result) < 0)
  39. return 0;
  40. return result;
  41. }
  42. %};
  43. extern struct nl_object *link2obj(struct rtnl_link *);
  44. extern struct rtnl_link *obj2link(struct nl_object *);
  45. /* <netlink/route/rtnl.h> */
  46. %cstring_output_maxsize(char *buf, size_t len)
  47. extern char * rtnl_scope2str(int, char *buf, size_t len);
  48. extern int rtnl_str2scope(const char *);
  49. /* <netlink/route/link.h> */
  50. extern struct rtnl_link *rtnl_link_alloc(void);
  51. extern struct rtnl_link *rtnl_link_get(struct nl_cache *, int);
  52. extern struct rtnl_link *rtnl_link_get_by_name(struct nl_cache *, const char *);
  53. extern int rtnl_link_build_add_request(struct rtnl_link *, int, struct nl_msg **);
  54. extern int rtnl_link_add(struct nl_sock *, struct rtnl_link *, int);
  55. extern int rtnl_link_build_change_request(struct rtnl_link *, struct rtnl_link *, int, struct nl_msg **);
  56. extern int rtnl_link_change(struct nl_sock *, struct rtnl_link *, struct rtnl_link *, int);
  57. extern int rtnl_link_build_delete_request(const struct rtnl_link *, struct nl_msg **);
  58. extern int rtnl_link_delete(struct nl_sock *, const struct rtnl_link *);
  59. extern int rtnl_link_build_get_request(int, const char *, struct nl_msg **);
  60. extern char *rtnl_link_stat2str(int, char *, size_t);
  61. extern int rtnl_link_str2stat(const char *);
  62. %cstring_output_maxsize(char *buf, size_t len)
  63. extern char *rtnl_link_flags2str(int, char *buf, size_t len);
  64. extern int rtnl_link_str2flags(const char *);
  65. %cstring_output_maxsize(char *buf, size_t len)
  66. extern char *rtnl_link_operstate2str(uint8_t, char *buf, size_t len);
  67. extern int rtnl_link_str2operstate(const char *);
  68. %cstring_output_maxsize(char *buf, size_t len)
  69. extern char *rtnl_link_mode2str(uint8_t, char *buf, size_t len);
  70. extern int rtnl_link_str2mode(const char *);
  71. extern void rtnl_link_set_qdisc(struct rtnl_link *, const char *);
  72. extern char *rtnl_link_get_qdisc(struct rtnl_link *);
  73. extern void rtnl_link_set_name(struct rtnl_link *, const char *);
  74. extern char *rtnl_link_get_name(struct rtnl_link *);
  75. extern void rtnl_link_set_flags(struct rtnl_link *, unsigned int);
  76. extern void rtnl_link_unset_flags(struct rtnl_link *, unsigned int);
  77. extern unsigned int rtnl_link_get_flags(struct rtnl_link *);
  78. extern void rtnl_link_set_mtu(struct rtnl_link *, unsigned int);
  79. extern unsigned int rtnl_link_get_mtu(struct rtnl_link *);
  80. extern void rtnl_link_set_txqlen(struct rtnl_link *, unsigned int);
  81. extern unsigned int rtnl_link_get_txqlen(struct rtnl_link *);
  82. extern void rtnl_link_set_ifindex(struct rtnl_link *, int);
  83. extern int rtnl_link_get_ifindex(struct rtnl_link *);
  84. extern void rtnl_link_set_family(struct rtnl_link *, int);
  85. extern int rtnl_link_get_family(struct rtnl_link *);
  86. extern void rtnl_link_set_arptype(struct rtnl_link *, unsigned int);
  87. extern unsigned int rtnl_link_get_arptype(struct rtnl_link *);
  88. extern void rtnl_link_set_addr(struct rtnl_link *, struct nl_addr *);
  89. extern struct nl_addr *rtnl_link_get_addr(struct rtnl_link *);
  90. extern void rtnl_link_set_broadcast(struct rtnl_link *, struct nl_addr *);
  91. extern struct nl_addr *rtnl_link_get_broadcast(struct rtnl_link *);
  92. extern void rtnl_link_set_link(struct rtnl_link *, int);
  93. extern int rtnl_link_get_link(struct rtnl_link *);
  94. extern void rtnl_link_set_master(struct rtnl_link *, int);
  95. extern int rtnl_link_get_master(struct rtnl_link *);
  96. extern void rtnl_link_set_operstate(struct rtnl_link *, uint8_t);
  97. extern uint8_t rtnl_link_get_operstate(struct rtnl_link *);
  98. extern void rtnl_link_set_linkmode(struct rtnl_link *, uint8_t);
  99. extern uint8_t rtnl_link_get_linkmode(struct rtnl_link *);
  100. extern const char *rtnl_link_get_ifalias(struct rtnl_link *);
  101. extern void rtnl_link_set_ifalias(struct rtnl_link *, const char *);
  102. extern int rtnl_link_get_num_vf(struct rtnl_link *, uint32_t *);
  103. extern uint64_t rtnl_link_get_stat(struct rtnl_link *, int);
  104. extern int rtnl_link_set_stat(struct rtnl_link *, const unsigned int, const uint64_t);
  105. extern int rtnl_link_set_type(struct rtnl_link *, const char *);
  106. extern char *rtnl_link_get_type(struct rtnl_link *);
  107. extern int rtnl_link_enslave(struct nl_sock * sock, struct rtnl_link * master, struct rtnl_link * slave);
  108. extern int rtnl_link_release(struct nl_sock * sock, struct rtnl_link * slave);
  109. /* <netlink/route/link/vlan.h> */
  110. struct vlan_map
  111. {
  112. uint32_t vm_from;
  113. uint32_t vm_to;
  114. };
  115. #define VLAN_PRIO_MAX 7
  116. %cstring_output_maxsize(char *buf, size_t len)
  117. extern char *rtnl_link_vlan_flags2str(int, char *buf, size_t len);
  118. extern int rtnl_link_vlan_str2flags(const char *);
  119. extern int rtnl_link_vlan_set_id(struct rtnl_link *, int);
  120. extern int rtnl_link_vlan_get_id(struct rtnl_link *);
  121. extern int rtnl_link_vlan_set_flags(struct rtnl_link *, unsigned int);
  122. extern int rtnl_link_vlan_unset_flags(struct rtnl_link *, unsigned int);
  123. extern unsigned int rtnl_link_vlan_get_flags(struct rtnl_link *);
  124. extern int rtnl_link_vlan_set_ingress_map(struct rtnl_link *, int, uint32_t);
  125. extern uint32_t *rtnl_link_vlan_get_ingress_map(struct rtnl_link *);
  126. extern int rtnl_link_vlan_set_egress_map(struct rtnl_link *, uint32_t, int);
  127. extern struct vlan_map *rtnl_link_vlan_get_egress_map(struct rtnl_link *, int *);
  128. /* <netlink/route/link/macvlan.h> */
  129. %cstring_output_maxsize(char *buf, size_t len)
  130. extern struct rtnl_link *rtnl_link_macvlan_alloc(void);
  131. extern int rtnl_link_is_macvlan(struct rtnl_link *);
  132. extern char * rtnl_link_macvlan_mode2str(int, char *, size_t);
  133. extern int rtnl_link_macvlan_str2mode(const char *);
  134. extern char * rtnl_link_macvlan_flags2str(int, char *, size_t);
  135. extern int rtnl_link_macvlan_str2flags(const char *);
  136. extern int rtnl_link_macvlan_set_mode(struct rtnl_link *, uint32_t);
  137. extern uint32_t rtnl_link_macvlan_get_mode(struct rtnl_link *);
  138. extern int rtnl_link_macvlan_set_flags(struct rtnl_link *, uint16_t);
  139. extern int rtnl_link_macvlan_unset_flags(struct rtnl_link *, uint16_t);
  140. extern uint16_t rtnl_link_macvlan_get_flags(struct rtnl_link *);
  141. /* <netlink/route/link/vxlan.h> */
  142. #define VXLAN_ID_MAX 16777215
  143. extern struct rtnl_link *rtnl_link_vxlan_alloc(void);
  144. extern int rtnl_link_is_vxlan(struct rtnl_link *);
  145. extern int rtnl_link_vxlan_set_id(struct rtnl_link *, uint32_t);
  146. extern int rtnl_link_vxlan_get_id(struct rtnl_link *, uint32_t *);
  147. extern int rtnl_link_vxlan_set_group(struct rtnl_link *, struct nl_addr *);
  148. extern int rtnl_link_vxlan_get_group(struct rtnl_link *, struct nl_addr **);
  149. extern int rtnl_link_vxlan_set_link(struct rtnl_link *, uint32_t);
  150. extern int rtnl_link_vxlan_get_link(struct rtnl_link *, uint32_t *);
  151. extern int rtnl_link_vxlan_set_local(struct rtnl_link *, struct nl_addr *);
  152. extern int rtnl_link_vxlan_get_local(struct rtnl_link *, struct nl_addr **);
  153. extern int rtnl_link_vxlan_set_ttl(struct rtnl_link *, uint8_t);
  154. extern int rtnl_link_vxlan_get_ttl(struct rtnl_link *);
  155. extern int rtnl_link_vxlan_set_tos(struct rtnl_link *, uint8_t);
  156. extern int rtnl_link_vxlan_get_tos(struct rtnl_link *);
  157. extern int rtnl_link_vxlan_set_learning(struct rtnl_link *, uint8_t);
  158. extern int rtnl_link_vxlan_get_learning(struct rtnl_link *);
  159. extern int rtnl_link_vxlan_enable_learning(struct rtnl_link *);
  160. extern int rtnl_link_vxlan_disable_learning(struct rtnl_link *);
  161. extern int rtnl_link_vxlan_set_ageing(struct rtnl_link *, uint32_t);
  162. extern int rtnl_link_vxlan_get_ageing(struct rtnl_link *, uint32_t *);
  163. extern int rtnl_link_vxlan_set_limit(struct rtnl_link *, uint32_t);
  164. extern int rtnl_link_vxlan_get_limit(struct rtnl_link *, uint32_t *);
  165. extern int rtnl_link_vxlan_set_port_range(struct rtnl_link *,
  166. struct ifla_vxlan_port_range *);
  167. extern int rtnl_link_vxlan_get_port_range(struct rtnl_link *,
  168. struct ifla_vxlan_port_range *);
  169. extern int rtnl_link_vxlan_set_proxy(struct rtnl_link *, uint8_t);
  170. extern int rtnl_link_vxlan_get_proxy(struct rtnl_link *);
  171. extern int rtnl_link_vxlan_enable_proxy(struct rtnl_link *);
  172. extern int rtnl_link_vxlan_disable_proxy(struct rtnl_link *);
  173. extern int rtnl_link_vxlan_set_rsc(struct rtnl_link *, uint8_t);
  174. extern int rtnl_link_vxlan_get_rsc(struct rtnl_link *);
  175. extern int rtnl_link_vxlan_enable_rsc(struct rtnl_link *);
  176. extern int rtnl_link_vxlan_disable_rsc(struct rtnl_link *);
  177. extern int rtnl_link_vxlan_set_l2miss(struct rtnl_link *, uint8_t);
  178. extern int rtnl_link_vxlan_get_l2miss(struct rtnl_link *);
  179. extern int rtnl_link_vxlan_enable_l2miss(struct rtnl_link *);
  180. extern int rtnl_link_vxlan_disable_l2miss(struct rtnl_link *);
  181. extern int rtnl_link_vxlan_set_l3miss(struct rtnl_link *, uint8_t);
  182. extern int rtnl_link_vxlan_get_l3miss(struct rtnl_link *);
  183. extern int rtnl_link_vxlan_enable_l3miss(struct rtnl_link *);
  184. extern int rtnl_link_vxlan_disable_l3miss(struct rtnl_link *);
  185. /* <netlink/route/link/bridge.h> */
  186. enum rtnl_link_bridge_flags {
  187. RTNL_BRIDGE_HAIRPIN_MODE = 0x0001,
  188. RTNL_BRIDGE_BPDU_GUARD = 0x0002,
  189. RTNL_BRIDGE_ROOT_BLOCK = 0x0004,
  190. RTNL_BRIDGE_FAST_LEAVE = 0x0008,
  191. };
  192. extern int rtnl_link_is_bridge(struct rtnl_link *);
  193. extern int rtnl_link_bridge_has_ext_info(struct rtnl_link *);
  194. extern int rtnl_link_bridge_set_port_state(struct rtnl_link *, uint8_t );
  195. extern int rtnl_link_bridge_get_port_state(struct rtnl_link *);
  196. extern int rtnl_link_bridge_set_priority(struct rtnl_link *, uint16_t);
  197. extern int rtnl_link_bridge_get_priority(struct rtnl_link *);
  198. extern int rtnl_link_bridge_set_cost(struct rtnl_link *, uint32_t);
  199. extern int rtnl_link_bridge_get_cost(struct rtnl_link *, uint32_t *);
  200. extern int rtnl_link_bridge_unset_flags(struct rtnl_link *, unsigned int);
  201. extern int rtnl_link_bridge_set_flags(struct rtnl_link *, unsigned int);
  202. extern int rtnl_link_bridge_get_flags(struct rtnl_link *);
  203. extern char * rtnl_link_bridge_flags2str(int, char *, size_t);
  204. extern int rtnl_link_bridge_str2flags(const char *);
  205. /* <netlink/route/link/inet.h> */
  206. %cstring_output_maxsize(char *buf, size_t len)
  207. extern const char *rtnl_link_inet_devconf2str(int, char *buf, size_t len);
  208. extern unsigned int rtnl_link_inet_str2devconf(const char *);
  209. extern int rtnl_link_inet_set_conf(struct rtnl_link *, const unsigned int, uint32_t);
  210. /* <netlink/route/tc.h> */
  211. %inline %{
  212. uint32_t tc_str2handle(const char *name)
  213. {
  214. uint32_t result;
  215. if (rtnl_tc_str2handle(name, &result) < 0)
  216. return 0;
  217. return result;
  218. }
  219. %};
  220. extern void rtnl_tc_set_ifindex(struct rtnl_tc *, int);
  221. extern int rtnl_tc_get_ifindex(struct rtnl_tc *);
  222. extern void rtnl_tc_set_link(struct rtnl_tc *, struct rtnl_link *);
  223. extern struct rtnl_link *rtnl_tc_get_link(struct rtnl_tc *);
  224. extern void rtnl_tc_set_mtu(struct rtnl_tc *, uint32_t);
  225. extern uint32_t rtnl_tc_get_mtu(struct rtnl_tc *);
  226. extern void rtnl_tc_set_mpu(struct rtnl_tc *, uint32_t);
  227. extern uint32_t rtnl_tc_get_mpu(struct rtnl_tc *);
  228. extern void rtnl_tc_set_overhead(struct rtnl_tc *, uint32_t);
  229. extern uint32_t rtnl_tc_get_overhead(struct rtnl_tc *);
  230. extern void rtnl_tc_set_linktype(struct rtnl_tc *, uint32_t);
  231. extern uint32_t rtnl_tc_get_linktype(struct rtnl_tc *);
  232. extern void rtnl_tc_set_handle(struct rtnl_tc *, uint32_t);
  233. extern uint32_t rtnl_tc_get_handle(struct rtnl_tc *);
  234. extern void rtnl_tc_set_parent(struct rtnl_tc *, uint32_t);
  235. extern uint32_t rtnl_tc_get_parent(struct rtnl_tc *);
  236. extern int rtnl_tc_set_kind(struct rtnl_tc *, const char *);
  237. extern char * rtnl_tc_get_kind(struct rtnl_tc *);
  238. extern uint64_t rtnl_tc_get_stat(struct rtnl_tc *, enum rtnl_tc_stat);
  239. extern int rtnl_tc_calc_txtime(int, int);
  240. extern int rtnl_tc_calc_bufsize(int, int);
  241. extern int rtnl_tc_calc_cell_log(int);
  242. extern int rtnl_tc_read_classid_file(void);
  243. %cstring_output_maxsize(char *buf, size_t len)
  244. extern char * rtnl_tc_handle2str(uint32_t, char *buf, size_t len);
  245. extern int rtnl_classid_generate(const char *, uint32_t *, uint32_t);
  246. /* <netlink/route/qdisc.h> */
  247. %inline %{
  248. struct nl_object *qdisc2obj(struct rtnl_qdisc *qdisc)
  249. {
  250. return OBJ_CAST(qdisc);
  251. }
  252. struct rtnl_qdisc *obj2qdisc(struct nl_object *obj)
  253. {
  254. return (struct rtnl_qdisc *) obj;
  255. }
  256. struct nl_object *class2obj(struct rtnl_class *cl)
  257. {
  258. return OBJ_CAST(cl);
  259. }
  260. struct rtnl_class *obj2class(struct nl_object *obj)
  261. {
  262. return (struct rtnl_class *) obj;
  263. }
  264. struct nl_object *cls2obj(struct rtnl_cls *cls)
  265. {
  266. return OBJ_CAST(cls);
  267. }
  268. struct rtnl_cls *obj2cls(struct nl_object *obj)
  269. {
  270. return (struct rtnl_cls *) obj;
  271. }
  272. struct rtnl_tc *obj2tc(struct nl_object *obj)
  273. {
  274. return TC_CAST(obj);
  275. }
  276. %};
  277. extern struct rtnl_qdisc *
  278. rtnl_qdisc_alloc(void);
  279. extern struct rtnl_qdisc *
  280. rtnl_qdisc_get(struct nl_cache *, int, uint32_t);
  281. extern struct rtnl_qdisc *
  282. rtnl_qdisc_get_by_parent(struct nl_cache *, int, uint32_t);
  283. extern int rtnl_qdisc_build_add_request(struct rtnl_qdisc *, int,
  284. struct nl_msg **);
  285. extern int rtnl_qdisc_add(struct nl_sock *, struct rtnl_qdisc *, int);
  286. extern int rtnl_qdisc_build_update_request(struct rtnl_qdisc *,
  287. struct rtnl_qdisc *,
  288. int, struct nl_msg **);
  289. extern int rtnl_qdisc_update(struct nl_sock *, struct rtnl_qdisc *,
  290. struct rtnl_qdisc *, int);
  291. extern int rtnl_qdisc_build_delete_request(struct rtnl_qdisc *,
  292. struct nl_msg **);
  293. extern int rtnl_qdisc_delete(struct nl_sock *, struct rtnl_qdisc *);
  294. /* <netlink/route/classifier.h> */
  295. extern struct rtnl_cls *rtnl_cls_alloc(void);
  296. extern void rtnl_cls_put(struct rtnl_cls *);
  297. extern int rtnl_cls_add(struct nl_sock *, struct rtnl_cls *, int);
  298. extern int rtnl_cls_delete(struct nl_sock *, struct rtnl_cls *,
  299. int);
  300. extern void rtnl_cls_set_prio(struct rtnl_cls *, uint16_t);
  301. extern uint16_t rtnl_cls_get_prio(struct rtnl_cls *);
  302. extern void rtnl_cls_set_protocol(struct rtnl_cls *, uint16_t);
  303. extern uint16_t rtnl_cls_get_protocol(struct rtnl_cls *);
  304. /* <netlink/route/qdisc/htb.h> */
  305. extern uint32_t rtnl_htb_get_rate2quantum(struct rtnl_qdisc *);
  306. extern int rtnl_htb_set_rate2quantum(struct rtnl_qdisc *, uint32_t);
  307. extern uint32_t rtnl_htb_get_defcls(struct rtnl_qdisc *);
  308. extern int rtnl_htb_set_defcls(struct rtnl_qdisc *, uint32_t);
  309. extern uint32_t rtnl_htb_get_prio(struct rtnl_class *);
  310. extern int rtnl_htb_set_prio(struct rtnl_class *, uint32_t);
  311. extern uint32_t rtnl_htb_get_rate(struct rtnl_class *);
  312. extern int rtnl_htb_set_rate(struct rtnl_class *, uint32_t);
  313. extern uint32_t rtnl_htb_get_ceil(struct rtnl_class *);
  314. extern int rtnl_htb_set_ceil(struct rtnl_class *, uint32_t);
  315. extern uint32_t rtnl_htb_get_rbuffer(struct rtnl_class *);
  316. extern int rtnl_htb_set_rbuffer(struct rtnl_class *, uint32_t);
  317. extern uint32_t rtnl_htb_get_cbuffer(struct rtnl_class *);
  318. extern int rtnl_htb_set_cbuffer(struct rtnl_class *, uint32_t);
  319. extern uint32_t rtnl_htb_get_quantum(struct rtnl_class *);
  320. extern int rtnl_htb_set_quantum(struct rtnl_class *, uint32_t);
  321. extern int rtnl_htb_get_level(struct rtnl_class *);
  322. /* <netlink/route/addr.h> */
  323. %inline %{
  324. struct nl_object *addr2obj(struct rtnl_addr *addr)
  325. {
  326. return OBJ_CAST(addr);
  327. }
  328. struct rtnl_addr *obj2addr(struct nl_object *obj)
  329. {
  330. return (struct rtnl_addr *) obj;
  331. }
  332. %};
  333. extern struct rtnl_addr *rtnl_addr_alloc(void);
  334. extern struct rtnl_addr *
  335. rtnl_addr_get(struct nl_cache *, int, struct nl_addr *);
  336. extern int rtnl_addr_build_add_request(struct rtnl_addr *, int,
  337. struct nl_msg **);
  338. extern int rtnl_addr_add(struct nl_sock *, struct rtnl_addr *, int);
  339. extern int rtnl_addr_build_delete_request(struct rtnl_addr *, int,
  340. struct nl_msg **);
  341. extern int rtnl_addr_delete(struct nl_sock *,
  342. struct rtnl_addr *, int);
  343. %cstring_output_maxsize(char *buf, size_t len)
  344. extern char * rtnl_addr_flags2str(int, char *buf, size_t len);
  345. extern int rtnl_addr_str2flags(const char *);
  346. extern int rtnl_addr_set_label(struct rtnl_addr *, const char *);
  347. extern char * rtnl_addr_get_label(struct rtnl_addr *);
  348. extern void rtnl_addr_set_ifindex(struct rtnl_addr *, int);
  349. extern int rtnl_addr_get_ifindex(struct rtnl_addr *);
  350. extern void rtnl_addr_set_link(struct rtnl_addr *, struct rtnl_link *);
  351. extern struct rtnl_link *
  352. rtnl_addr_get_link(struct rtnl_addr *);
  353. extern void rtnl_addr_set_family(struct rtnl_addr *, int);
  354. extern int rtnl_addr_get_family(struct rtnl_addr *);
  355. extern void rtnl_addr_set_prefixlen(struct rtnl_addr *, int);
  356. extern int rtnl_addr_get_prefixlen(struct rtnl_addr *);
  357. extern void rtnl_addr_set_scope(struct rtnl_addr *, int);
  358. extern int rtnl_addr_get_scope(struct rtnl_addr *);
  359. extern void rtnl_addr_set_flags(struct rtnl_addr *, unsigned int);
  360. extern void rtnl_addr_unset_flags(struct rtnl_addr *, unsigned int);
  361. extern unsigned int rtnl_addr_get_flags(struct rtnl_addr *);
  362. extern int rtnl_addr_set_local(struct rtnl_addr *,
  363. struct nl_addr *);
  364. extern struct nl_addr *rtnl_addr_get_local(struct rtnl_addr *);
  365. extern int rtnl_addr_set_peer(struct rtnl_addr *, struct nl_addr *);
  366. extern struct nl_addr *rtnl_addr_get_peer(struct rtnl_addr *);
  367. extern int rtnl_addr_set_broadcast(struct rtnl_addr *, struct nl_addr *);
  368. extern struct nl_addr *rtnl_addr_get_broadcast(struct rtnl_addr *);
  369. extern int rtnl_addr_set_multicast(struct rtnl_addr *, struct nl_addr *);
  370. extern struct nl_addr *rtnl_addr_get_multicast(struct rtnl_addr *);
  371. extern int rtnl_addr_set_anycast(struct rtnl_addr *, struct nl_addr *);
  372. extern struct nl_addr *rtnl_addr_get_anycast(struct rtnl_addr *);
  373. extern uint32_t rtnl_addr_get_valid_lifetime(struct rtnl_addr *);
  374. extern void rtnl_addr_set_valid_lifetime(struct rtnl_addr *, uint32_t);
  375. extern uint32_t rtnl_addr_get_preferred_lifetime(struct rtnl_addr *);
  376. extern void rtnl_addr_set_preferred_lifetime(struct rtnl_addr *, uint32_t);
  377. extern uint32_t rtnl_addr_get_create_time(struct rtnl_addr *);
  378. extern uint32_t rtnl_addr_get_last_update_time(struct rtnl_addr *);