aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-06-05 17:11:42 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-06-05 17:11:42 +0000
commita48d505695367905155ab463993ccdae41250ae7 (patch)
treefc45613e2ed78257489f7a1679f004d979201e27
parentefa0f8b2352e980e3c1b2d90e1d130ccd7257c69 (diff)
downloadslirp-a48d505695367905155ab463993ccdae41250ae7.zip
slirp-a48d505695367905155ab463993ccdae41250ae7.tar.gz
slirp-a48d505695367905155ab463993ccdae41250ae7.tar.bz2
64 bit fixes (initial patch by Gwenole Beauchesne)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1458 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--bootp.c2
-rw-r--r--bootp.h6
-rw-r--r--ip_icmp.h2
-rw-r--r--libslirp.h8
-rw-r--r--slirp_config.h3
-rw-r--r--udp.c18
-rw-r--r--udp.h1
7 files changed, 27 insertions, 13 deletions
diff --git a/bootp.c b/bootp.c
index fc1639a..7ea25b6 100644
--- a/bootp.c
+++ b/bootp.c
@@ -239,7 +239,7 @@ udp_output2(NULL, m, &saddr, &daddr, IPTOS_LOWDELAY);
void bootp_input(struct mbuf *m)
{
- struct bootp_t *bp = (struct bootp_t *)m->m_data;
+ struct bootp_t *bp = mtod(m, struct bootp_t *);
if (bp->bp_op == BOOTP_REQUEST) {
bootp_reply(bp);
diff --git a/bootp.h b/bootp.h
index 774dd17..2456bd2 100644
--- a/bootp.h
+++ b/bootp.h
@@ -97,9 +97,9 @@ struct bootp_t {
uint8_t bp_htype;
uint8_t bp_hlen;
uint8_t bp_hops;
- unsigned long bp_xid;
- unsigned short bp_secs;
- unsigned short unused;
+ uint32_t bp_xid;
+ uint16_t bp_secs;
+ uint16_t unused;
struct in_addr bp_ciaddr;
struct in_addr bp_yiaddr;
struct in_addr bp_siaddr;
diff --git a/ip_icmp.h b/ip_icmp.h
index 40a6e62..9148593 100644
--- a/ip_icmp.h
+++ b/ip_icmp.h
@@ -83,7 +83,7 @@ struct icmp {
struct ip idi_ip;
/* options and then 64 bits of data */
} id_ip;
- u_long id_mask;
+ uint32_t id_mask;
char id_data[1];
} icmp_dun;
#define icmp_otime icmp_dun.id_ts.its_otime
diff --git a/libslirp.h b/libslirp.h
index c8fb3bf..f6d7702 100644
--- a/libslirp.h
+++ b/libslirp.h
@@ -9,6 +9,10 @@ int inet_aton(const char *cp, struct in_addr *ia);
#include <arpa/inet.h>
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void slirp_init(void);
void slirp_select_fill(int *pnfds, fd_set *readfds, fd_set *writefds,
@@ -29,4 +33,8 @@ int slirp_add_exec(int do_pty, const char *args, int addr_low_byte,
extern const char *tftp_prefix;
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/slirp_config.h b/slirp_config.h
index 6ee9b6d..ed89993 100644
--- a/slirp_config.h
+++ b/slirp_config.h
@@ -150,8 +150,7 @@
#define SIZEOF_INT 4
/* Define to sizeof(char *) */
-/* XXX: patch it */
-#define SIZEOF_CHAR_P 4
+#define SIZEOF_CHAR_P (HOST_LONG_BITS / 8)
/* Define if you have random() */
#undef HAVE_RANDOM
diff --git a/udp.c b/udp.c
index 0c91e05..3a9fb09 100644
--- a/udp.c
+++ b/udp.c
@@ -410,10 +410,16 @@ struct mbuf *m;
#endif
struct cu_header {
- char dest[8];
- short family;
- u_short port;
- u_long addr;
+ uint16_t d_family; // destination family
+ uint16_t d_port; // destination port
+ uint32_t d_addr; // destination address
+ uint16_t s_family; // source family
+ uint16_t s_port; // source port
+ uint32_t s_addr; // source address
+ uint32_t seqn; // sequence number
+ uint16_t message; // message
+ uint16_t data_type; // data type
+ uint16_t pkt_len; // packet length
} * cu_head;
switch (so->so_emu) {
@@ -599,8 +605,8 @@ struct mbuf *m;
if (getsockname(so->s, (struct sockaddr *)&addr, &addrlen) < 0)
return;
cu_head = mtod(m, struct cu_header *);
- cu_head->port = addr.sin_port;
- cu_head->addr = (u_long)our_addr.s_addr;
+ cu_head->s_port = addr.sin_port;
+ cu_head->s_addr = our_addr.s_addr;
}
return;
diff --git a/udp.h b/udp.h
index c559ae5..b55a78d 100644
--- a/udp.h
+++ b/udp.h
@@ -94,6 +94,7 @@ struct udpstat {
extern struct udpstat udpstat;
extern struct socket udb;
+struct mbuf;
void udp_init _P((void));
void udp_input _P((register struct mbuf *, int));