rev |
line source |
pascal@15392
|
1 --- busybox-1.21.1/include/platform.h
|
pascal@15392
|
2 +++ busybox-1.21.1/include/platform.h
|
pascal@15392
|
3 @@ -453,6 +453,20 @@
|
pascal@15392
|
4 # undef HAVE_NET_ETHERNET_H
|
pascal@14748
|
5 #endif
|
pascal@14748
|
6
|
pascal@14748
|
7 +#if defined(__dietlibc__)
|
pascal@14748
|
8 +# define __aligned_u64 __u64 __attribute__((aligned(8)))
|
pascal@14748
|
9 +# define LOOP_SET_STATUS64 0x4C04
|
pascal@14748
|
10 +# define LOOP_GET_STATUS64 0x4C05
|
pascal@14748
|
11 +# define MAXSYMLINKS 20
|
pascal@14748
|
12 +# define S_TYPEISMQ(x) 0
|
pascal@14748
|
13 +# define S_TYPEISSEM(x) 0
|
pascal@14748
|
14 +# define S_TYPEISSHM(x) 0
|
pascal@14748
|
15 +# undef HAVE_STRVERSCMP
|
pascal@14748
|
16 +# undef HAVE_DPRINTF
|
pascal@14748
|
17 +# undef HAVE_STRCASESTR
|
pascal@14748
|
18 +# define ttyname_r(a,b,c) (strlcpy(b, ttyname(a), c) == 0)
|
pascal@14748
|
19 +#endif
|
pascal@14748
|
20 +
|
pascal@14748
|
21 /*
|
pascal@14748
|
22 * Now, define prototypes for all the functions defined in platform.c
|
pascal@14748
|
23 * These must come after all the HAVE_* macros are defined (or not)
|
pascal@14748
|
24 --- busybox-1.21.0/networking/ping.c
|
pascal@14748
|
25 +++ busybox-1.21.0/networking/ping.c
|
pascal@14748
|
26 @@ -29,6 +29,84 @@
|
pascal@14748
|
27 #include <netinet/ip_icmp.h>
|
pascal@14748
|
28 #include "libbb.h"
|
pascal@14748
|
29
|
pascal@14748
|
30 +#ifdef __dietlibc__
|
pascal@14748
|
31 +/* Dietlibc is missing the BSD definition 'struct icmp' */
|
pascal@14748
|
32 +/*
|
pascal@14748
|
33 + * Internal of an ICMP Router Advertisement
|
pascal@14748
|
34 + */
|
pascal@14748
|
35 +struct icmp_ra_addr
|
pascal@14748
|
36 +{
|
pascal@14748
|
37 + uint32_t ira_addr;
|
pascal@14748
|
38 + uint32_t ira_preference;
|
pascal@14748
|
39 +};
|
pascal@14748
|
40 +
|
pascal@14748
|
41 +struct icmp
|
pascal@14748
|
42 +{
|
pascal@14748
|
43 + uint8_t icmp_type; /* type of message, see below */
|
pascal@14748
|
44 + uint8_t icmp_code; /* type sub code */
|
pascal@14748
|
45 + uint16_t icmp_cksum; /* ones complement checksum of struct */
|
pascal@14748
|
46 + union
|
pascal@14748
|
47 + {
|
pascal@14748
|
48 + uint8_t ih_pptr; /* ICMP_PARAMPROB */
|
pascal@14748
|
49 + struct in_addr ih_gwaddr; /* gateway address */
|
pascal@14748
|
50 + struct ih_idseq /* echo datagram */
|
pascal@14748
|
51 + {
|
pascal@14748
|
52 + uint16_t icd_id;
|
pascal@14748
|
53 + uint16_t icd_seq;
|
pascal@14748
|
54 + } ih_idseq;
|
pascal@14748
|
55 + uint32_t ih_void;
|
pascal@14748
|
56 +
|
pascal@14748
|
57 + /* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
|
pascal@14748
|
58 + struct ih_pmtu
|
pascal@14748
|
59 + {
|
pascal@14748
|
60 + uint16_t ipm_void;
|
pascal@14748
|
61 + uint16_t ipm_nextmtu;
|
pascal@14748
|
62 + } ih_pmtu;
|
pascal@14748
|
63 +
|
pascal@14748
|
64 + struct ih_rtradv
|
pascal@14748
|
65 + {
|
pascal@14748
|
66 + uint8_t irt_num_addrs;
|
pascal@14748
|
67 + uint8_t irt_wpa;
|
pascal@14748
|
68 + uint16_t irt_lifetime;
|
pascal@14748
|
69 + } ih_rtradv;
|
pascal@14748
|
70 + } icmp_hun;
|
pascal@14748
|
71 +#define icmp_pptr icmp_hun.ih_pptr
|
pascal@14748
|
72 +#define icmp_gwaddr icmp_hun.ih_gwaddr
|
pascal@14748
|
73 +#define icmp_id icmp_hun.ih_idseq.icd_id
|
pascal@14748
|
74 +#define icmp_seq icmp_hun.ih_idseq.icd_seq
|
pascal@14748
|
75 +#define icmp_void icmp_hun.ih_void
|
pascal@14748
|
76 +#define icmp_pmvoid icmp_hun.ih_pmtu.ipm_void
|
pascal@14748
|
77 +#define icmp_nextmtu icmp_hun.ih_pmtu.ipm_nextmtu
|
pascal@14748
|
78 +#define icmp_num_addrs icmp_hun.ih_rtradv.irt_num_addrs
|
pascal@14748
|
79 +#define icmp_wpa icmp_hun.ih_rtradv.irt_wpa
|
pascal@14748
|
80 +#define icmp_lifetime icmp_hun.ih_rtradv.irt_lifetime
|
pascal@14748
|
81 + union
|
pascal@14748
|
82 + {
|
pascal@14748
|
83 + struct
|
pascal@14748
|
84 + {
|
pascal@14748
|
85 + uint32_t its_otime;
|
pascal@14748
|
86 + uint32_t its_rtime;
|
pascal@14748
|
87 + uint32_t its_ttime;
|
pascal@14748
|
88 + } id_ts;
|
pascal@14748
|
89 + struct
|
pascal@14748
|
90 + {
|
pascal@14748
|
91 + struct ip idi_ip;
|
pascal@14748
|
92 + /* options and then 64 bits of data */
|
pascal@14748
|
93 + } id_ip;
|
pascal@14748
|
94 + struct icmp_ra_addr id_radv;
|
pascal@14748
|
95 + uint32_t id_mask;
|
pascal@14748
|
96 + uint8_t id_data[1];
|
pascal@14748
|
97 + } icmp_dun;
|
pascal@14748
|
98 +#define icmp_otime icmp_dun.id_ts.its_otime
|
pascal@14748
|
99 +#define icmp_rtime icmp_dun.id_ts.its_rtime
|
pascal@14748
|
100 +#define icmp_ttime icmp_dun.id_ts.its_ttime
|
pascal@14748
|
101 +#define icmp_ip icmp_dun.id_ip.idi_ip
|
pascal@14748
|
102 +#define icmp_radv icmp_dun.id_radv
|
pascal@14748
|
103 +#define icmp_mask icmp_dun.id_mask
|
pascal@14748
|
104 +#define icmp_data icmp_dun.id_data
|
pascal@14748
|
105 +};
|
pascal@14748
|
106 +#endif /* __dietlibc__ */
|
pascal@14748
|
107 +
|
pascal@14748
|
108 #ifdef __BIONIC__
|
pascal@14748
|
109 /* should be in netinet/ip_icmp.h */
|
pascal@14748
|
110 # define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
|