wok-current view busybox/stuff/busybox-1.27-diet.u @ rev 21273

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