summaryrefslogtreecommitdiffstats
path: root/qemu/slirp/tcpip.h
diff options
context:
space:
mode:
authorDon Dugger <n0ano@n0ano.com>2016-06-03 03:33:22 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-06-03 03:33:23 +0000
commitda27230f80795d0028333713f036d44c53cb0e68 (patch)
treeb3d379eaf000adf72b36cb01cdf4d79c3e3f064c /qemu/slirp/tcpip.h
parent0e68cb048bb8aadb14675f5d4286d8ab2fc35449 (diff)
parent437fd90c0250dee670290f9b714253671a990160 (diff)
Merge "These changes are the raw update to qemu-2.6."
Diffstat (limited to 'qemu/slirp/tcpip.h')
-rw-r--r--qemu/slirp/tcpip.h40
1 files changed, 32 insertions, 8 deletions
diff --git a/qemu/slirp/tcpip.h b/qemu/slirp/tcpip.h
index 7974ce3d5..124b4a9f6 100644
--- a/qemu/slirp/tcpip.h
+++ b/qemu/slirp/tcpip.h
@@ -37,15 +37,32 @@
* Tcp+ip header, after ip options removed.
*/
struct tcpiphdr {
- struct ipovly ti_i; /* overlaid ip structure */
- struct tcphdr ti_t; /* tcp header */
+ struct mbuf_ptr ih_mbuf; /* backpointer to mbuf */
+ union {
+ struct {
+ struct in_addr ih_src; /* source internet address */
+ struct in_addr ih_dst; /* destination internet address */
+ uint8_t ih_x1; /* (unused) */
+ uint8_t ih_pr; /* protocol */
+ } ti_i4;
+ struct {
+ struct in6_addr ih_src;
+ struct in6_addr ih_dst;
+ uint8_t ih_x1;
+ uint8_t ih_nh;
+ } ti_i6;
+ } ti;
+ uint16_t ti_x0;
+ uint16_t ti_len; /* protocol length */
+ struct tcphdr ti_t; /* tcp header */
};
-#define ti_mbuf ti_i.ih_mbuf.mptr
-#define ti_x1 ti_i.ih_x1
-#define ti_pr ti_i.ih_pr
-#define ti_len ti_i.ih_len
-#define ti_src ti_i.ih_src
-#define ti_dst ti_i.ih_dst
+#define ti_mbuf ih_mbuf.mptr
+#define ti_pr ti.ti_i4.ih_pr
+#define ti_src ti.ti_i4.ih_src
+#define ti_dst ti.ti_i4.ih_dst
+#define ti_src6 ti.ti_i6.ih_src
+#define ti_dst6 ti.ti_i6.ih_dst
+#define ti_nh6 ti.ti_i6.ih_nh
#define ti_sport ti_t.th_sport
#define ti_dport ti_t.th_dport
#define ti_seq ti_t.th_seq
@@ -65,6 +82,13 @@ struct tcpiphdr {
#define tcpfrag_list_end(F, T) (tcpiphdr2qlink(F) == (struct qlink*)(T))
#define tcpfrag_list_empty(T) ((T)->seg_next == (struct tcpiphdr*)(T))
+/* This is the difference between the size of a tcpiphdr structure, and the
+ * size of actual ip+tcp headers, rounded up since we need to align data. */
+#define TCPIPHDR_DELTA\
+ (max(0,\
+ (sizeof(struct tcpiphdr)\
+ - sizeof(struct ip) - sizeof(struct tcphdr) + 3) & ~3))
+
/*
* Just a clean way to get to the first byte
* of the packet