added 'ull' prefix to unsigned long long constants to make gcc 3.3 happy
[oss-qm-packages.git] / include / util-ank.h
blob04ab16c474d29cf1866064f3687271cfde028ddb
1 #ifndef __UTILS_H__
2 #define __UTILS_H__ 1
4 #include <asm/types.h>
6 extern int preferred_family;
7 extern int show_stats;
8 extern int show_details;
9 extern int show_raw;
10 extern int resolve_hosts;
12 #ifndef IPPROTO_ESP
13 #define IPPROTO_ESP 50
14 #endif
15 #ifndef IPPROTO_AH
16 #define IPPROTO_AH 51
17 #endif
19 #define SPRINT_BSIZE 64
20 #define SPRINT_BUF(x) char x[SPRINT_BSIZE]
23 #define NEXT_ARG() \
24 argv++; \
25 if (--argc <= 0) \
26 usage();
28 typedef struct
30 __u8 family;
31 __u8 bytelen;
32 __s16 bitlen;
33 __u32 data[4];
34 } inet_prefix;
36 extern __u32 get_addr32(char *name);
37 extern int get_addr_1(inet_prefix *dst, char *arg, int family);
38 extern int get_prefix_1(inet_prefix *dst, char *arg, int family);
39 extern int get_addr(inet_prefix *dst, char *arg, int family);
40 extern int get_prefix(inet_prefix *dst, char *arg, int family);
42 extern int scan_number(char *arg, unsigned *val);
44 extern int get_integer(int *val, char *arg, int base);
45 extern int get_unsigned(unsigned *val, char *arg, int base);
46 #define get_byte get_u8
47 #define get_ushort get_u16
48 #define get_short get_s16
49 extern int get_u32(__u32 *val, char *arg, int base);
50 extern int get_u16(__u16 *val, char *arg, int base);
51 extern int get_s16(__s16 *val, char *arg, int base);
52 extern int get_u8(__u8 *val, char *arg, int base);
53 extern int get_s8(__s8 *val, char *arg, int base);
55 extern int get_tc_classid(__u32 *h, char *str);
56 extern int print_tc_classid(char *buf, int len, __u32 h);
57 extern char * sprint_tc_classid(__u32 h, char *buf);
59 /* static void usage(void) __attribute__((noreturn)); */
60 void invarg(char *) __attribute__((noreturn));
61 int matches(char *arg, char *pattern);
62 extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits);
64 extern int ipaddr_list(int argc, char **argv);
65 extern int iproute_monitor(int argc, char **argv);
66 extern int do_ipaddr(int argc, char **argv);
67 extern int do_iproute(int argc, char **argv);
68 extern int do_iprule(int argc, char **argv);
69 extern int do_ipneigh(int argc, char **argv);
70 extern int do_iptunnel(int argc, char **argv);
71 extern int do_iplink(int argc, char **argv);
72 extern int do_ipmonitor(int argc, char **argv);
73 extern int do_multiaddr(int argc, char **argv);
74 extern int do_qdisc(int argc, char **argv);
75 extern int do_class(int argc, char **argv);
76 extern int do_filter(int argc, char **argv);
78 extern const char *format_host(int af, void *addr, __u8 *abuf, int alen);
80 #endif /* __UTILS_H__ */