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

00001 /*
00002  * netlink/utils.h              Utility Functions
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_UTILS_H_
00013 #define NETLINK_UTILS_H_
00014 
00015 #include <netlink/netlink.h>
00016 #include <netlink/list.h>
00017 
00018 /**
00019  * @name Probability Constants
00020  * @{
00021  */
00022 
00023 /**
00024  * Lower probability limit
00025  * @ingroup utils
00026  */
00027 #define NL_PROB_MIN 0x0
00028 
00029 /**
00030  * Upper probability limit
00031  * @ingroup utils
00032  */
00033 #define NL_PROB_MAX 0xffffffff
00034 
00035 /** @} */
00036 
00037 extern char *   nl_geterror(void);
00038 extern int      nl_get_errno(void);
00039 
00040 /* unit pretty-printing */
00041 extern double   nl_cancel_down_bytes(unsigned long long, char **);
00042 extern double   nl_cancel_down_bits(unsigned long long, char **);
00043 extern double   nl_cancel_down_us(uint32_t, char **);
00044 
00045 /* generic unit translations */
00046 extern long     nl_size2int(const char *);
00047 extern long     nl_prob2int(const char *);
00048 
00049 /* time translations */
00050 extern int      nl_get_hz(void);
00051 extern uint32_t nl_us2ticks(uint32_t);
00052 extern uint32_t nl_ticks2us(uint32_t);
00053 extern char *   nl_msec2str(uint64_t, char *, size_t);
00054 
00055 /* link layer protocol translations */
00056 extern char *   nl_llproto2str(int, char *, size_t);
00057 extern int      nl_str2llproto(const char *);
00058 
00059 /* ethernet protocol translations */
00060 extern char *   nl_ether_proto2str(int, char *, size_t);
00061 extern int      nl_str2ether_proto(const char *);
00062 
00063 
00064 #endif

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