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