Add an mbuf to ipinfo_t translator to finish cleanup of mbuf passing to TCP probes.
Reviewed by: markj MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9401
This commit is contained in:
parent
accb19a8bc
commit
82988b50a1
@ -238,6 +238,24 @@ translator ipinfo_t < uint8_t *p > {
|
||||
inet_ntoa6(&((struct ip6_hdr *)p)->ip6_dst);
|
||||
};
|
||||
|
||||
#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.5" IFF_LOOPBACK
|
||||
inline int IFF_LOOPBACK = 0x8;
|
||||
|
||||
|
@ -56,28 +56,28 @@ SDT_PROBE_DEFINE6_XLATE(ip, , , send,
|
||||
SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__established,
|
||||
"void *", "pktinfo_t *",
|
||||
"struct tcpcb *", "csinfo_t *",
|
||||
"uint8_t *", "ipinfo_t *",
|
||||
"struct mbuf *", "ipinfo_t *",
|
||||
"struct tcpcb *", "tcpsinfo_t *" ,
|
||||
"struct tcphdr *", "tcpinfoh_t *");
|
||||
|
||||
SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__refused,
|
||||
"void *", "pktinfo_t *",
|
||||
"struct tcpcb *", "csinfo_t *",
|
||||
"uint8_t *", "ipinfo_t *",
|
||||
"struct mbuf *", "ipinfo_t *",
|
||||
"struct tcpcb *", "tcpsinfo_t *" ,
|
||||
"struct tcphdr *", "tcpinfo_t *");
|
||||
|
||||
SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__established,
|
||||
"void *", "pktinfo_t *",
|
||||
"struct tcpcb *", "csinfo_t *",
|
||||
"uint8_t *", "ipinfo_t *",
|
||||
"struct mbuf *", "ipinfo_t *",
|
||||
"struct tcpcb *", "tcpsinfo_t *" ,
|
||||
"struct tcphdr *", "tcpinfoh_t *");
|
||||
|
||||
SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__refused,
|
||||
"void *", "pktinfo_t *",
|
||||
"struct tcpcb *", "csinfo_t *",
|
||||
"uint8_t *", "ipinfo_t *",
|
||||
"struct mbuf *", "ipinfo_t *",
|
||||
"struct tcpcb *", "tcpsinfo_t *" ,
|
||||
"struct tcphdr *", "tcpinfoh_t *");
|
||||
|
||||
@ -91,7 +91,7 @@ SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__request,
|
||||
SDT_PROBE_DEFINE5_XLATE(tcp, , , receive,
|
||||
"void *", "pktinfo_t *",
|
||||
"struct tcpcb *", "csinfo_t *",
|
||||
"uint8_t *", "ipinfo_t *",
|
||||
"struct mbuf *", "ipinfo_t *",
|
||||
"struct tcpcb *", "tcpsinfo_t *" ,
|
||||
"struct tcphdr *", "tcpinfoh_t *");
|
||||
|
||||
@ -113,7 +113,7 @@ SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__input,
|
||||
SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__output,
|
||||
"struct tcpcb *", "tcpsinfo_t *" ,
|
||||
"struct tcphdr *", "tcpinfo_t *",
|
||||
"uint8_t *", "ipinfo_t *");
|
||||
"struct mbuf *", "ipinfo_t *");
|
||||
|
||||
SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__user,
|
||||
"struct tcpcb *", "tcpsinfo_t *" ,
|
||||
@ -122,7 +122,7 @@ SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__user,
|
||||
SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__drop,
|
||||
"struct tcpcb *", "tcpsinfo_t *" ,
|
||||
"struct tcphdr *", "tcpinfo_t *",
|
||||
"uint8_t *", "ipinfo_t *");
|
||||
"struct mbuf *", "ipinfo_t *");
|
||||
|
||||
SDT_PROBE_DEFINE6_XLATE(tcp, , , state__change,
|
||||
"void *", "void *",
|
||||
|
Loading…
x
Reference in New Issue
Block a user