Magellan Linux

Annotation of /trunk/mkinitrd-magellan/busybox/networking/libiproute/utils.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 984 - (hide annotations) (download)
Sun May 30 11:32:42 2010 UTC (14 years ago) by niro
File MIME type: text/plain
File size: 2356 byte(s)
-updated to busybox-1.16.1 and enabled blkid/uuid support in default config
1 niro 532 /* vi: set sw=4 ts=4: */
2 niro 984 #ifndef UTILS_H
3     #define UTILS_H 1
4 niro 532
5     #include "libnetlink.h"
6     #include "ll_map.h"
7     #include "rtm_map.h"
8    
9 niro 984 PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
10 niro 532
11 niro 816 extern family_t preferred_family;
12     extern smallint show_stats; /* UNUSED */
13     extern smallint show_details; /* UNUSED */
14     extern smallint show_raw; /* UNUSED */
15     extern smallint resolve_hosts; /* UNUSED */
16     extern smallint oneline;
17     extern char _SL_;
18    
19 niro 532 #ifndef IPPROTO_ESP
20     #define IPPROTO_ESP 50
21     #endif
22     #ifndef IPPROTO_AH
23     #define IPPROTO_AH 51
24     #endif
25    
26     #define SPRINT_BSIZE 64
27     #define SPRINT_BUF(x) char x[SPRINT_BSIZE]
28    
29 niro 816 extern void incomplete_command(void) NORETURN;
30 niro 532
31 niro 816 #define NEXT_ARG() do { if (!*++argv) incomplete_command(); } while (0)
32 niro 532
33 niro 816 typedef struct {
34 niro 532 uint8_t family;
35     uint8_t bytelen;
36     int16_t bitlen;
37     uint32_t data[4];
38     } inet_prefix;
39    
40 niro 816 #define PREFIXLEN_SPECIFIED 1
41    
42 niro 532 #define DN_MAXADDL 20
43     #ifndef AF_DECnet
44     #define AF_DECnet 12
45     #endif
46    
47 niro 816 struct dn_naddr {
48     unsigned short a_len;
49     unsigned char a_addr[DN_MAXADDL];
50 niro 532 };
51    
52     #define IPX_NODE_LEN 6
53    
54     struct ipx_addr {
55     uint32_t ipx_net;
56     uint8_t ipx_node[IPX_NODE_LEN];
57     };
58    
59     extern uint32_t get_addr32(char *name);
60     extern int get_addr_1(inet_prefix *dst, char *arg, int family);
61 niro 984 /*extern int get_prefix_1(inet_prefix *dst, char *arg, int family);*/
62 niro 532 extern int get_addr(inet_prefix *dst, char *arg, int family);
63     extern int get_prefix(inet_prefix *dst, char *arg, int family);
64    
65 niro 984 extern unsigned get_unsigned(char *arg, const char *errmsg);
66     extern uint32_t get_u32(char *arg, const char *errmsg);
67     extern uint16_t get_u16(char *arg, const char *errmsg);
68 niro 532
69 niro 984 extern const char *rt_addr_n2a(int af, void *addr, char *buf, int buflen);
70     #ifdef RESOLVE_HOSTNAMES
71 niro 532 extern const char *format_host(int af, int len, void *addr, char *buf, int buflen);
72 niro 984 #else
73     #define format_host(af, len, addr, buf, buflen) \
74     rt_addr_n2a(af, addr, buf, buflen)
75     #endif
76 niro 532
77 niro 816 void invarg(const char *, const char *) NORETURN;
78     void duparg(const char *, const char *) NORETURN;
79     void duparg2(const char *, const char *) NORETURN;
80     int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits);
81 niro 532
82     const char *dnet_ntop(int af, const void *addr, char *str, size_t len);
83     int dnet_pton(int af, const char *src, void *addr);
84    
85     const char *ipx_ntop(int af, const void *addr, char *str, size_t len);
86     int ipx_pton(int af, const char *src, void *addr);
87    
88 niro 984 POP_SAVED_FUNCTION_VISIBILITY
89    
90 niro 816 #endif