summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authorsmh <smh@FreeBSD.org>2017-04-24 16:31:28 +0000
committersmh <smh@FreeBSD.org>2017-04-24 16:31:28 +0000
commit5f7e779f9ffada568a00fd3d20896316ecf69996 (patch)
treefe6aba59a930b30016ee7d2ec96ff36628b01719 /cddl
parente7481cb7514ab48287a87757be4290e9ce05b949 (diff)
downloadFreeBSD-src-5f7e779f9ffada568a00fd3d20896316ecf69996.zip
FreeBSD-src-5f7e779f9ffada568a00fd3d20896316ecf69996.tar.gz
Partial MFC r316676 and the required r313045
MFC r316676: Use estimated RTT for receive buffer auto resizing instead of timestamps. This is a partial MFC as stable/10 doesn't include the TCP stack modularisation. MFC r313045: Add an mbuf to ipinfo_t translator to finish cleanup of mbuf passing to TCP probes. This is a partial MFC (missing debug__output & debug__drop changes) due to the massive amount of additional dtrace changes that would be required for a full MFC. Relnotes: Yes Sponsored by: Multiplay
Diffstat (limited to 'cddl')
-rw-r--r--cddl/lib/libdtrace/ip.d18
1 files changed, 18 insertions, 0 deletions
diff --git a/cddl/lib/libdtrace/ip.d b/cddl/lib/libdtrace/ip.d
index f8fa9b1..15dfc34 100644
--- a/cddl/lib/libdtrace/ip.d
+++ b/cddl/lib/libdtrace/ip.d
@@ -240,6 +240,24 @@ translator ipinfo_t < uint8_t *p > {
#pragma D binding "1.0" IFF_LOOPBACK
inline int IFF_LOOPBACK = 0x8;
+#pragma D binding "1.13" translator
+translator ipinfo_t < struct mbuf *m > {
+ ip_ver = m == NULL ? 0 : ((struct ip *)m->m_data)->ip_v;
+ ip_plength = m == NULL ? 0 :
+ ((struct ip *)m->m_data)->ip_v == 4 ?
+ ntohs(((struct ip *)m->m_data)->ip_len) -
+ (((struct ip *)m->m_data)->ip_hl << 2):
+ ntohs(((struct ip6_hdr *)m->m_data)->ip6_ctlun.ip6_un1.ip6_un1_plen);
+ ip_saddr = m == NULL ? 0 :
+ ((struct ip *)m->m_data)->ip_v == 4 ?
+ inet_ntoa(&((struct ip *)m->m_data)->ip_src.s_addr) :
+ inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_src);
+ ip_daddr = m == NULL ? 0 :
+ ((struct ip *)m->m_data)->ip_v == 4 ?
+ inet_ntoa(&((struct ip *)m->m_data)->ip_dst.s_addr) :
+ inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_dst);
+};
+
#pragma D binding "1.0" translator
translator ifinfo_t < struct ifnet *p > {
if_name = p->if_xname;
OpenPOWER on IntegriCloud