2 * netlink/route/rtnl.h Routing Netlink
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation version 2.1
9 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
12 #ifndef NETLINK_RTNL_H_
13 #define NETLINK_RTNL_H_
15 #include <netlink/netlink.h>
22 typedef uint32_t realm_t;
25 * Mask specying the size of each realm part
28 #define RTNL_REALM_MASK (0xFFFF)
31 * Extract FROM realm from a realms field
33 #define RTNL_REALM_FROM(realm) ((realm) >> 16)
36 * Extract TO realm from a realms field
38 #define RTNL_REALM_TO(realm) ((realm) & RTNL_REALM_MASK)
41 * Build a realms field
43 #define RTNL_MAKE_REALM(from, to) \
44 ((RTNL_REALM_TO(from) << 16) & RTNL_REALM_TO(to))
50 extern int nl_rtgen_request(struct nl_handle *, int, int, int);
52 /* Routing Type Translations */
53 extern char * nl_rtntype2str(int, char *, size_t);
54 extern int nl_str2rtntype(const char *);
56 /* Scope Translations */
57 extern char * rtnl_scope2str(int, char *, size_t);
58 extern int rtnl_str2scope(const char *);
60 /* Realms Translations */
61 extern char * rtnl_realms2str(uint32_t, char *, size_t);