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