8 #include "libnetlink.h"
12 extern int preferred_family;
13 extern int show_stats;
14 extern int show_details;
16 extern int resolve_hosts;
21 #define IPPROTO_ESP 50
27 #define SPRINT_BSIZE 64
28 #define SPRINT_BUF(x) char x[SPRINT_BSIZE]
30 extern void incomplete_command(void) ATTRIBUTE_NORETURN;
32 #define NEXT_ARG() do { argv++; if (--argc <= 0) incomplete_command(); } while(0)
50 unsigned char a_addr[DN_MAXADDL];
53 #define IPX_NODE_LEN 6
57 uint8_t ipx_node[IPX_NODE_LEN];
60 extern __u32 get_addr32(char *name);
61 extern int get_addr_1(inet_prefix *dst, char *arg, int family);
62 extern int get_prefix_1(inet_prefix *dst, char *arg, int family);
63 extern int get_addr(inet_prefix *dst, char *arg, int family);
64 extern int get_prefix(inet_prefix *dst, char *arg, int family);
66 extern int get_integer(int *val, char *arg, int base);
67 extern int get_unsigned(unsigned *val, char *arg, int base);
68 #define get_byte get_u8
69 #define get_ushort get_u16
70 #define get_short get_s16
71 extern int get_u32(__u32 *val, char *arg, int base);
72 extern int get_u16(__u16 *val, char *arg, int base);
73 extern int get_s16(__s16 *val, char *arg, int base);
74 extern int get_u8(__u8 *val, char *arg, int base);
75 extern int get_s8(__s8 *val, char *arg, int base);
77 extern const char *format_host(int af, int len, void *addr, char *buf, int buflen);
78 extern const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen);
80 void invarg(const char * const, const char * const) ATTRIBUTE_NORETURN;
81 void duparg(char *, char *) ATTRIBUTE_NORETURN;
82 void duparg2(char *, char *) ATTRIBUTE_NORETURN;
83 int matches(char *arg, char *pattern);
84 extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits);
86 const char *dnet_ntop(int af, const void *addr, char *str, size_t len);
87 int dnet_pton(int af, const char *src, void *addr);
89 const char *ipx_ntop(int af, const void *addr, char *str, size_t len);
90 int ipx_pton(int af, const char *src, void *addr);
92 extern int __iproute2_hz_internal;
93 extern int __get_hz(void);
95 static __inline__ int get_hz(void)
97 if (__iproute2_hz_internal == 0)
98 __iproute2_hz_internal = __get_hz();
99 return __iproute2_hz_internal;
102 #endif /* __UTILS_H__ */