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