summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_var.h
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2014-08-16 13:50:15 +0000
committerbz <bz@FreeBSD.org>2014-08-16 13:50:15 +0000
commit6f5b0b94bcc341ada89cd4674a3b07804b7cf9be (patch)
tree894ce9a194b61542810094913795a726d2129cc0 /sys/netinet/tcp_var.h
parenta771dfd28a60ce30bfffc98d3cf898c9b97ec08c (diff)
downloadFreeBSD-src-6f5b0b94bcc341ada89cd4674a3b07804b7cf9be.zip
FreeBSD-src-6f5b0b94bcc341ada89cd4674a3b07804b7cf9be.tar.gz
MFC r266596:
Move the tcp_fields_to_host() and tcp_fields_to_net() (inline) functions to the tcp_var.h header file in order to avoid further duplication with upcoming commits. Reviewed by: np
Diffstat (limited to 'sys/netinet/tcp_var.h')
-rw-r--r--sys/netinet/tcp_var.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index e3197e5..5935fcd 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -736,6 +736,27 @@ u_long tcp_seq_subtract(u_long, u_long );
void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type);
+static inline void
+tcp_fields_to_host(struct tcphdr *th)
+{
+
+ th->th_seq = ntohl(th->th_seq);
+ th->th_ack = ntohl(th->th_ack);
+ th->th_win = ntohs(th->th_win);
+ th->th_urp = ntohs(th->th_urp);
+}
+
+#ifdef TCP_SIGNATURE
+static inline void
+tcp_fields_to_net(struct tcphdr *th)
+{
+
+ th->th_seq = htonl(th->th_seq);
+ th->th_ack = htonl(th->th_ack);
+ th->th_win = htons(th->th_win);
+ th->th_urp = htons(th->th_urp);
+}
+#endif
#endif /* _KERNEL */
#endif /* _NETINET_TCP_VAR_H_ */
OpenPOWER on IntegriCloud