/build/buildd/libnl-1.0~pre6/include/netlink/route/rtnl.h

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-2006 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 /**
00018  * @name Realms
00019  * @{
00020  */
00021 
00022 typedef uint32_t        realm_t;
00023 
00024 /**
00025  * Mask specying the size of each realm part
00026  * @ingroup rtnl
00027  */
00028 #define RTNL_REALM_MASK (0xFFFF)
00029 
00030 /**
00031  * Extract FROM realm from a realms field
00032  */
00033 #define RTNL_REALM_FROM(realm) ((realm) >> 16)
00034 
00035 /**
00036  * Extract TO realm from a realms field
00037  */
00038 #define RTNL_REALM_TO(realm) ((realm) & RTNL_REALM_MASK)
00039 
00040 /**
00041  * Build a realms field
00042  */
00043 #define RTNL_MAKE_REALM(from, to) \
00044         ((RTNL_REALM_TO(from) << 16) & RTNL_REALM_TO(to))
00045 
00046 /** @} */
00047 
00048 
00049 /* General */
00050 extern int              nl_rtgen_request(struct nl_handle *, int, int, int);
00051 
00052 /* Routing Type Translations */
00053 extern char *           nl_rtntype2str(int, char *, size_t);
00054 extern int              nl_str2rtntype(const char *);
00055 
00056 /* Scope Translations */
00057 extern char *           rtnl_scope2str(int, char *, size_t);
00058 extern int              rtnl_str2scope(const char *);
00059 
00060 /* Realms Translations */
00061 extern char *           rtnl_realms2str(uint32_t, char *, size_t);
00062 
00063 #endif

Generated on Fri Apr 27 14:14:07 2007 for libnl by  doxygen 1.5.1