[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/6] net/eth: Remove the unused tcp_hdr structure
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 5/6] net/eth: Remove the unused tcp_hdr structure |
Date: |
Thu, 8 Aug 2019 16:34:56 +0200 |
Commit 75020a70215 introduced 2 very similar structures:
tcp_header and tcp_hdr.
We replaced the uses of struct tcp_hdr with the equivalent
struct tcp_header. Remove the unused one.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
I prefer the TCP_FLAG_XXX name, but there is only one single use of
TCP_FLAG_ACK vs many use of the other set, so I'm keeping the set.
include/net/eth.h | 40 ++++++++--------------------------------
1 file changed, 8 insertions(+), 32 deletions(-)
diff --git a/include/net/eth.h b/include/net/eth.h
index 7f45c678e7..0b2584328a 100644
--- a/include/net/eth.h
+++ b/include/net/eth.h
@@ -72,7 +72,14 @@ typedef struct tcp_header {
#define TCP_HEADER_FLAGS(tcp) \
TCP_FLAGS_ONLY(be16_to_cpu((tcp)->th_offset_flags))
-#define TCP_FLAG_ACK 0x10
+#define TH_FIN 0x01
+#define TH_SYN 0x02
+#define TH_RST 0x04
+#define TH_PUSH 0x08
+#define TH_ACK 0x10
+#define TH_URG 0x20
+#define TH_ECE 0x40
+#define TH_CWR 0x80
#define TCP_HEADER_DATA_OFFSET(tcp) \
(((be16_to_cpu((tcp)->th_offset_flags) >> 12) & 0xf) << 2)
@@ -153,37 +160,6 @@ struct udp_hdr {
uint16_t uh_sum; /* udp checksum */
};
-struct tcp_hdr {
- u_short th_sport; /* source port */
- u_short th_dport; /* destination port */
- uint32_t th_seq; /* sequence number */
- uint32_t th_ack; /* acknowledgment number */
-#ifdef HOST_WORDS_BIGENDIAN
- u_char th_off : 4, /* data offset */
- th_x2:4; /* (unused) */
-#else
- u_char th_x2 : 4, /* (unused) */
- th_off:4; /* data offset */
-#endif
-
-#define TH_ELN 0x1 /* explicit loss notification */
-#define TH_ECN 0x2 /* explicit congestion notification */
-#define TH_FS 0x4 /* fast start */
-
- u_char th_flags;
-#define TH_FIN 0x01
-#define TH_SYN 0x02
-#define TH_RST 0x04
-#define TH_PUSH 0x08
-#define TH_ACK 0x10
-#define TH_URG 0x20
-#define TH_ECE 0x40
-#define TH_CWR 0x80
- u_short th_win; /* window */
- u_short th_sum; /* checksum */
- u_short th_urp; /* urgent pointer */
-};
-
#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt
#define ip6_ecn_acc ip6_ctlun.ip6_un3.ip6_un3_ecn
--
2.20.1
- [Qemu-devel] [PATCH 0/6] net/eth: Remove duplicated tcp/udp_hdr structures, Philippe Mathieu-Daudé, 2019/08/08
- [Qemu-devel] [RFC PATCH 1/6] hw/net/virtio-net: Use TCP_HEADER_FLAGS/TCP_HEADER_DATA_OFFSET macros, Philippe Mathieu-Daudé, 2019/08/08
- [Qemu-devel] [RFC PATCH 2/6] net/colo-compare: Use the tcp_header structure, Philippe Mathieu-Daudé, 2019/08/08
- [Qemu-devel] [PATCH 3/6] net/filter-rewriter: Use the tcp_header structure, Philippe Mathieu-Daudé, 2019/08/08
- [Qemu-devel] [RFC PATCH 4/6] hw/net/vmxnet3: Use the tcp_header structure, Philippe Mathieu-Daudé, 2019/08/08
- [Qemu-devel] [PATCH 5/6] net/eth: Remove the unused tcp_hdr structure,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 6/6] net/eth: Remove the single use of udp_hdr structure, Philippe Mathieu-Daudé, 2019/08/08
- Re: [Qemu-devel] [PATCH 0/6] net/eth: Remove duplicated tcp/udp_hdr structures, Dmitry Fleytman, 2019/08/12
- Re: [Qemu-devel] [PATCH 0/6] net/eth: Remove duplicated tcp/udp_hdr structures, Philippe Mathieu-Daudé, 2019/08/18