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