Changeset View
Changeset View
Standalone View
Standalone View
cddl/lib/libdtrace/udp.d
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
#pragma D binding "1.6.3" translator | #pragma D binding "1.6.3" translator | ||||
translator udpsinfo_t < struct inpcb *p > { | translator udpsinfo_t < struct inpcb *p > { | ||||
udps_addr = (uintptr_t)p; | udps_addr = (uintptr_t)p; | ||||
udps_lport = p == NULL ? 0 : ntohs(p->inp_inc.inc_ie.ie_lport); | udps_lport = p == NULL ? 0 : ntohs(p->inp_inc.inc_ie.ie_lport); | ||||
udps_rport = p == NULL ? 0 : ntohs(p->inp_inc.inc_ie.ie_fport); | udps_rport = p == NULL ? 0 : ntohs(p->inp_inc.inc_ie.ie_fport); | ||||
udps_laddr = p == NULL ? "" : | udps_laddr = p == NULL ? "" : | ||||
p->inp_vflag == INP_IPV4 ? | p->inp_vflag == INP_IPV4 ? | ||||
inet_ntoa(&p->inp_inc.inc_ie.ie_dependladdr.ie46_local.ia46_addr4.s_addr) : | inet_ntoa(&p->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) : | ||||
inet_ntoa6(&p->inp_inc.inc_ie.ie_dependladdr.ie6_local); | inet_ntoa6(&p->inp_inc.inc_ie.ie_dependladdr.id6_addr); | ||||
udps_raddr = p == NULL ? "" : | udps_raddr = p == NULL ? "" : | ||||
p->inp_vflag == INP_IPV4 ? | p->inp_vflag == INP_IPV4 ? | ||||
inet_ntoa(&p->inp_inc.inc_ie.ie_dependfaddr.ie46_foreign.ia46_addr4.s_addr) : | inet_ntoa(&p->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) : | ||||
inet_ntoa6(&p->inp_inc.inc_ie.ie_dependfaddr.ie6_foreign); | inet_ntoa6(&p->inp_inc.inc_ie.ie_dependfaddr.id6_addr); | ||||
}; | }; | ||||
#pragma D binding "1.6.3" translator | #pragma D binding "1.6.3" translator | ||||
translator udpinfo_t < struct udphdr *p > { | translator udpinfo_t < struct udphdr *p > { | ||||
udp_sport = p == NULL ? 0 : ntohs(p->uh_sport); | udp_sport = p == NULL ? 0 : ntohs(p->uh_sport); | ||||
udp_dport = p == NULL ? 0 : ntohs(p->uh_dport); | udp_dport = p == NULL ? 0 : ntohs(p->uh_dport); | ||||
udp_length = p == NULL ? 0 : ntohs(p->uh_ulen); | udp_length = p == NULL ? 0 : ntohs(p->uh_ulen); | ||||
udp_checksum = p == NULL ? 0 : ntohs(p->uh_sum); | udp_checksum = p == NULL ? 0 : ntohs(p->uh_sum); | ||||
udp_hdr = p; | udp_hdr = p; | ||||
}; | }; |