libnl
3.2.3
|
00001 /* 00002 * netlink/route/rtnl.h Routing Netlink 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation version 2.1 00007 * of the License. 00008 * 00009 * Copyright (c) 2003-2008 Thomas Graf <tgraf@suug.ch> 00010 */ 00011 00012 #ifndef NETLINK_RTNL_H_ 00013 #define NETLINK_RTNL_H_ 00014 00015 #include <netlink/netlink.h> 00016 00017 #ifdef __cplusplus 00018 extern "C" { 00019 #endif 00020 00021 /** 00022 * @name Realms 00023 * @{ 00024 */ 00025 00026 /** 00027 * Mask specying the size of each realm part 00028 * @ingroup rtnl 00029 */ 00030 #define RTNL_REALM_MASK (0xFFFF) 00031 00032 /** 00033 * Extract FROM realm from a realms field 00034 */ 00035 #define RTNL_REALM_FROM(realm) ((realm) >> 16) 00036 00037 /** 00038 * Extract TO realm from a realms field 00039 */ 00040 #define RTNL_REALM_TO(realm) ((realm) & RTNL_REALM_MASK) 00041 00042 /** 00043 * Build a realms field 00044 */ 00045 #define RTNL_MAKE_REALM(from, to) \ 00046 ((RTNL_REALM_TO(from) << 16) & RTNL_REALM_TO(to)) 00047 00048 /** @} */ 00049 00050 00051 /* General */ 00052 extern int nl_rtgen_request(struct nl_sock *, int, int, int); 00053 00054 /* Routing Type Translations */ 00055 extern char * nl_rtntype2str(int, char *, size_t); 00056 extern int nl_str2rtntype(const char *); 00057 00058 /* Scope Translations */ 00059 extern char * rtnl_scope2str(int, char *, size_t); 00060 extern int rtnl_str2scope(const char *); 00061 00062 /* Realms Translations */ 00063 extern char * rtnl_realms2str(uint32_t, char *, size_t); 00064 00065 #ifdef __cplusplus 00066 } 00067 #endif 00068 00069 #endif