7 #include "libnetlink.h"
11 extern int preferred_family;
12 extern int show_stats;
13 extern int show_details;
15 extern int resolve_hosts;
20 #define IPPROTO_ESP 50
26 #define IPPROTO_COMP 108
28 #ifndef IPSEC_PROTO_ANY
29 #define IPSEC_PROTO_ANY 255
32 #define SPRINT_BSIZE 64
33 #define SPRINT_BUF(x) char x[SPRINT_BSIZE]
35 extern void incomplete_command(void) __attribute__((noreturn));
37 #define NEXT_ARG() do { argv++; if (--argc <= 0) incomplete_command(); } while(0)
38 #define NEXT_ARG_OK() (argc - 1 > 0)
39 #define PREV_ARG() do { argv--; argc++; } while(0)
57 unsigned char a_addr[DN_MAXADDL];
60 #define IPX_NODE_LEN 6
64 u_int8_t ipx_node[IPX_NODE_LEN];
67 extern __u32 get_addr32(const char *name);
68 extern int get_addr_1(inet_prefix *dst, const char *arg, int family);
69 extern int get_prefix_1(inet_prefix *dst, char *arg, int family);
70 extern int get_addr(inet_prefix *dst, const char *arg, int family);
71 extern int get_prefix(inet_prefix *dst, char *arg, int family);
73 extern int get_integer(int *val, const char *arg, int base);
74 extern int get_unsigned(unsigned *val, const char *arg, int base);
75 #define get_byte get_u8
76 #define get_ushort get_u16
77 #define get_short get_s16
78 extern int get_u64(__u64 *val, const char *arg, int base);
79 extern int get_u32(__u32 *val, const char *arg, int base);
80 extern int get_u16(__u16 *val, const char *arg, int base);
81 extern int get_s16(__s16 *val, const char *arg, int base);
82 extern int get_u8(__u8 *val, const char *arg, int base);
83 extern int get_s8(__s8 *val, const char *arg, int base);
85 extern __u8* hexstring_n2a(const __u8 *str, int len, __u8 *buf, int blen);
86 extern __u8* hexstring_a2n(const __u8 *str, __u8 *buf, int blen);
88 extern const char *format_host(int af, int len, const void *addr,
89 char *buf, int buflen);
90 extern const char *rt_addr_n2a(int af, int len, const void *addr,
91 char *buf, int buflen);
93 void missarg(const char *) __attribute__((noreturn));
94 void invarg(const char *, const char *) __attribute__((noreturn));
95 void duparg(const char *, const char *) __attribute__((noreturn));
96 void duparg2(const char *, const char *) __attribute__((noreturn));
97 int matches(const char *arg, const char *pattern);
98 extern int inet_addr_match(const inet_prefix *a, const inet_prefix *b, int bits);
100 const char *dnet_ntop(int af, const void *addr, char *str, size_t len);
101 int dnet_pton(int af, const char *src, void *addr);
103 const char *ipx_ntop(int af, const void *addr, char *str, size_t len);
104 int ipx_pton(int af, const char *src, void *addr);
106 extern int __iproute2_hz_internal;
107 extern int __get_hz(void);
109 static __inline__ int get_hz(void)
111 if (__iproute2_hz_internal == 0)
112 __iproute2_hz_internal = __get_hz();
113 return __iproute2_hz_internal;
116 extern int __iproute2_user_hz_internal;
117 extern int __get_user_hz(void);
119 static __inline__ int get_user_hz(void)
121 if (__iproute2_user_hz_internal == 0)
122 __iproute2_user_hz_internal = __get_user_hz();
123 return __iproute2_user_hz_internal;
126 #endif /* __UTILS_H__ */