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