summaryrefslogtreecommitdiffstats
path: root/slirp/ip.h
diff options
context:
space:
mode:
authorPeter Maydell2019-02-07 19:53:25 +0100
committerPeter Maydell2019-02-07 19:53:25 +0100
commite47f81b617684c4546af286d307b69014a83538a (patch)
tree11e4e8c6482d092d91ed9faed327f341f3cc69f8 /slirp/ip.h
parentMerge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-4.0-pull-re... (diff)
parentslirp: API is extern C (diff)
downloadqemu-e47f81b617684c4546af286d307b69014a83538a.tar.gz
qemu-e47f81b617684c4546af286d307b69014a83538a.tar.xz
qemu-e47f81b617684c4546af286d307b69014a83538a.zip
Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging
More work towards libslirp Marc-André Lureau (27): slirp: generalize guestfwd with a callback based approach net/slirp: simplify checking for cmd: prefix net/slirp: free forwarding rules on cleanup net/slirp: fix leaks on forwarding rule registration error slirp: add callbacks for timer slirp: replace trace functions with DEBUG calls slirp: replace QEMU_PACKED with SLIRP_PACKED slirp: replace most qemu socket utilities with slirp own version slirp: replace qemu_set_nonblock() slirp: add unregister_poll_fd() callback slirp: replace qemu_notify_event() with a callback slirp: move QEMU state saving to a separate unit slirp: do not include qemu headers in libslirp.h public API header slirp: improve windows headers inclusion slirp: add slirp own version of pstrcpy slirp: remove qemu timer.h dependency slirp: remove now useless QEMU headers inclusions slirp: replace net/eth.h inclusion with own defines slirp: replace qemu qtailq with slirp own copy slirp: replace remaining qemu headers dependency slirp: prefer c99 types over BSD kind slirp: improve send_packet() callback slirp: replace global polling with per-instance & notifier slirp: remove slirp_instances list slirp: use polling callbacks, drop glib requirement slirp: pass opaque to all callbacks slirp: API is extern C Peter Maydell (2): slirp: Avoid marking naturally packed structs as QEMU_PACKED slirp: Don't mark struct ipq or struct ipasfrag as packed Samuel Thibault (3): slirp: Avoid unaligned 16bit memory access slirp: replace QEMU_BUILD_BUG_ON with G_STATIC_ASSERT slirp: Move g_spawn_async_with_fds_qemu compatibility to slirp/ # gpg: Signature made Thu 07 Feb 2019 14:02:41 GMT # gpg: using RSA key E61DBB15D4172BDEC97E92D9DB550E89F0FA54F3 # gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>" [unknown] # gpg: aka "Samuel Thibault <sthibault@debian.org>" [marginal] # gpg: aka "Samuel Thibault <samuel.thibault@gnu.org>" [unknown] # gpg: aka "Samuel Thibault <samuel.thibault@inria.fr>" [marginal] # gpg: aka "Samuel Thibault <samuel.thibault@labri.fr>" [marginal] # gpg: aka "Samuel Thibault <samuel.thibault@ens-lyon.org>" [marginal] # gpg: aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>" [unknown] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 900C B024 B679 31D4 0F82 304B D017 8C76 7D06 9EE6 # Subkey fingerprint: E61D BB15 D417 2BDE C97E 92D9 DB55 0E89 F0FA 54F3 * remotes/thibault/tags/samuel-thibault: (32 commits) slirp: API is extern C slirp: pass opaque to all callbacks slirp: use polling callbacks, drop glib requirement slirp: remove slirp_instances list slirp: replace global polling with per-instance & notifier slirp: improve send_packet() callback slirp: prefer c99 types over BSD kind slirp: replace remaining qemu headers dependency slirp: Move g_spawn_async_with_fds_qemu compatibility to slirp/ slirp: replace QEMU_BUILD_BUG_ON with G_STATIC_ASSERT slirp: replace qemu qtailq with slirp own copy slirp: replace net/eth.h inclusion with own defines slirp: remove now useless QEMU headers inclusions slirp: remove qemu timer.h dependency slirp: add slirp own version of pstrcpy slirp: improve windows headers inclusion slirp: do not include qemu headers in libslirp.h public API header slirp: move QEMU state saving to a separate unit slirp: replace qemu_notify_event() with a callback slirp: add unregister_poll_fd() callback ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'slirp/ip.h')
-rw-r--r--slirp/ip.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/slirp/ip.h b/slirp/ip.h
index 243b6c8b24..73a4d2a3d2 100644
--- a/slirp/ip.h
+++ b/slirp/ip.h
@@ -89,7 +89,7 @@ struct ip {
uint8_t ip_p; /* protocol */
uint16_t ip_sum; /* checksum */
struct in_addr ip_src,ip_dst; /* source and dest address */
-} QEMU_PACKED;
+} SLIRP_PACKED;
#define IP_MAXPACKET 65535 /* maximum packet size */
@@ -151,7 +151,7 @@ struct ip_timestamp {
n_long ipt_time;
} ipt_ta[1];
} ipt_timestamp;
-} QEMU_PACKED;
+} SLIRP_PACKED;
/* flag bits for ipt_flg */
#define IPOPT_TS_TSONLY 0 /* timestamps only */
@@ -181,11 +181,11 @@ struct ip_timestamp {
struct mbuf_ptr {
struct mbuf *mptr;
uint32_t dummy;
-} QEMU_PACKED;
+} SLIRP_PACKED;
#else
struct mbuf_ptr {
struct mbuf *mptr;
-} QEMU_PACKED;
+} SLIRP_PACKED;
#endif
struct qlink {
void *next, *prev;
@@ -201,7 +201,7 @@ struct ipovly {
uint16_t ih_len; /* protocol length */
struct in_addr ih_src; /* source internet address */
struct in_addr ih_dst; /* destination internet address */
-} QEMU_PACKED;
+} SLIRP_PACKED;
/*
* Ip reassembly queue structure. Each fragment
@@ -217,7 +217,7 @@ struct ipq {
uint8_t ipq_p; /* protocol of this fragment */
uint16_t ipq_id; /* sequence id for reassembly */
struct in_addr ipq_src,ipq_dst;
-} QEMU_PACKED;
+};
/*
* Ip header, when holding a fragment.
@@ -227,7 +227,10 @@ struct ipq {
struct ipasfrag {
struct qlink ipf_link;
struct ip ipf_ip;
-} QEMU_PACKED;
+};
+
+G_STATIC_ASSERT(offsetof(struct ipq, frag_link) ==
+ offsetof(struct ipasfrag, ipf_link));
#define ipf_off ipf_ip.ip_off
#define ipf_tos ipf_ip.ip_tos