00001
00002
00003
00004
00005
00006
00007
00008
00009
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 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #define NL_PROB_MIN 0x0
00032
00033
00034
00035
00036
00037 #define NL_PROB_MAX 0xffffffff
00038
00039
00040
00041
00042 extern double nl_cancel_down_bytes(unsigned long long, char **);
00043 extern double nl_cancel_down_bits(unsigned long long, char **);
00044 extern double nl_cancel_down_us(uint32_t, char **);
00045
00046
00047 extern long nl_size2int(const char *);
00048 extern char * nl_size2str(const size_t, char *, const size_t);
00049 extern long nl_prob2int(const char *);
00050
00051
00052 extern int nl_get_user_hz(void);
00053 extern uint32_t nl_us2ticks(uint32_t);
00054 extern uint32_t nl_ticks2us(uint32_t);
00055 extern int nl_str2msec(const char *, uint64_t *);
00056 extern char * nl_msec2str(uint64_t, char *, size_t);
00057
00058
00059 extern char * nl_llproto2str(int, char *, size_t);
00060 extern int nl_str2llproto(const char *);
00061
00062
00063 extern char * nl_ether_proto2str(int, char *, size_t);
00064 extern int nl_str2ether_proto(const char *);
00065
00066
00067 extern char * nl_ip_proto2str(int, char *, size_t);
00068 extern int nl_str2ip_proto(const char *);
00069
00070
00071 extern void nl_new_line(struct nl_dump_params *);
00072 extern void nl_dump(struct nl_dump_params *, const char *, ...);
00073 extern void nl_dump_line(struct nl_dump_params *, const char *, ...);
00074
00075 #ifdef __cplusplus
00076 }
00077 #endif
00078
00079 #endif