1 /* vi: set sw=4 ts=4: */
5 #include "libnetlink.h"
10 # pragma GCC visibility push(hidden)
13 extern family_t preferred_family;
14 extern smallint show_stats; /* UNUSED */
15 extern smallint show_details; /* UNUSED */
16 extern smallint show_raw; /* UNUSED */
17 extern smallint resolve_hosts; /* UNUSED */
18 extern smallint oneline;
22 #define IPPROTO_ESP 50
28 #define SPRINT_BSIZE 64
29 #define SPRINT_BUF(x) char x[SPRINT_BSIZE]
31 extern void incomplete_command(void) NORETURN;
33 #define NEXT_ARG() do { if (!*++argv) incomplete_command(); } while (0)
42 #define PREFIXLEN_SPECIFIED 1
51 unsigned char a_addr[DN_MAXADDL];
54 #define IPX_NODE_LEN 6
58 uint8_t ipx_node[IPX_NODE_LEN];
61 extern uint32_t get_addr32(char *name);
62 extern int get_addr_1(inet_prefix *dst, char *arg, int family);
63 /*extern int get_prefix_1(inet_prefix *dst, char *arg, int family);*/
64 extern int get_addr(inet_prefix *dst, char *arg, int family);
65 extern int get_prefix(inet_prefix *dst, char *arg, int family);
67 extern unsigned get_unsigned(char *arg, const char *errmsg);
68 extern uint32_t get_u32(char *arg, const char *errmsg);
69 extern uint16_t get_u16(char *arg, const char *errmsg);
71 extern const char *rt_addr_n2a(int af, void *addr, char *buf, int buflen);
72 #ifdef RESOLVE_HOSTNAMES
73 extern const char *format_host(int af, int len, void *addr, char *buf, int buflen);
75 #define format_host(af, len, addr, buf, buflen) \
76 rt_addr_n2a(af, addr, buf, buflen)
79 void invarg(const char *, const char *) NORETURN;
80 void duparg(const char *, const char *) NORETURN;
81 void duparg2(const char *, const char *) NORETURN;
82 int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits);
84 const char *dnet_ntop(int af, const void *addr, char *str, size_t len);
85 int dnet_pton(int af, const char *src, void *addr);
87 const char *ipx_ntop(int af, const void *addr, char *str, size_t len);
88 int ipx_pton(int af, const char *src, void *addr);
90 #if __GNUC_PREREQ(4,1)
91 # pragma GCC visibility pop
94 #endif /* __UTILS_H__ */