|
NAMEdtrace_ip —
a DTrace provider for tracing events related to the IPv4 and
IPv6 protocols
SYNOPSISip:::receive (pktinfo_t
*, csinfo_t *,
ipinfo_t *,
ifinfo_t *,
ipv4info_t *,
ipv6info_t *);
DESCRIPTIONThe DTraceip provider allows users to trace events in
the ip(4) and
ip6(4)
protocol implementations. The ip:::send () probe fires
whenever the kernel prepares to transmit an IP packet, and the
ip:::receive () probe fires whenever the kernel
receives an IP packet. The arguments to these probes can be used to obtain
detailed information about the IP headers of the corresponding packet, as well
as the network interface on which the packet was sent or received. Unlike the
dtrace_tcp(4)
and
dtrace_udp(4)
providers, ip provider probes are triggered by
forwarded packets. That is, the probes will fire on packets that are not
destined to the local host.
ARGUMENTSThe pktinfo_t argument is currently unimplemented and is included for compatibility with other implementations of this provider. Its fields are:
The csinfo_t argument is currently unimplemented and is included for compatibility with other implementations of this provider. Its fields are:
The ipinfo_t argument contains IP fields common to both IPv4 and IPv6 packets. Its fields are:
The ifinfo_t argument describes the outgoing
and incoming interfaces for the packet in the
The ipv4info_t argument contains the fields
of the IP header for IPv4 packets. This argument is
The ipv6info_t argument contains the fields
of the IP header for IPv6 packets. Its fields are not set for IPv4 packets;
as with the ipv4info_t argument, the
FILES
EXAMPLESThe following script counts received packets by remote host address.ip:::receive { @num[args[2]->ip_saddr] = count(); } This script will print some details of each IP packet as it is sent or received by the kernel: #pragma D option quiet #pragma D option switchrate=10Hz dtrace:::BEGIN { printf(" %10s %30s %-30s %8s %6s\n", "DELTA(us)", "SOURCE", "DEST", "INT", "BYTES"); last = timestamp; } ip:::send { this->elapsed = (timestamp - last) / 1000; printf(" %10d %30s -> %-30s %8s %6d\n", this->elapsed, args[2]->ip_saddr, args[2]->ip_daddr, args[3]->if_name, args[2]->ip_plength); last = timestamp; } ip:::receive { this->elapsed = (timestamp - last) / 1000; printf(" %10d %30s <- %-30s %8s %6d\n", this->elapsed, args[2]->ip_daddr, args[2]->ip_saddr, args[3]->if_name, args[2]->ip_plength); last = timestamp; } COMPATIBILITYThis provider is compatible with theip providers found
in Solaris and Darwin.
SEE ALSOdtrace(1), dtrace_tcp(4), dtrace_udp(4), ip(4), ip6(4), ifnet(9), SDT(9)HISTORYTheip provider first appeared in
FreeBSD 10.0.
AUTHORSThis manual page was written by Mark Johnston <markj@FreeBSD.org>.
Visit the GSP FreeBSD Man Page Interface. |