in_kdtrace.c revision 256281
150476Speter/*- 21802Sphk * Copyright (c) 2013 Mark Johnston <markj@FreeBSD.org> 31802Sphk * 4119071Sobrien * Redistribution and use in source and binary forms, with or without 544290Swollman * modification, are permitted provided that the following conditions are 644301Swollman * met: 7143334Scperciva * 1. Redistributions of source code must retain the above copyright 8220496Smarkm * notice, this list of conditions and the following disclaimer. 9220496Smarkm * 2. Redistributions in binary form must reproduce the above copyright 10220496Smarkm * notice, this list of conditions and the following disclaimer in 1155955Srgrimes * the documentation and/or other materials provided with the 12201381Sed * distribution. 13201381Sed * 14220496Smarkm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 159488Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1674385Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1774385Sphk * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 189488Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1974385Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2074385Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 219488Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2274385Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2374385Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2444437Sache * SUCH DAMAGE. 2544437Sache * 2644437Sache * $FreeBSD: stable/10/sys/netinet/in_kdtrace.c 255993 2013-10-02 17:14:12Z markj $ 2774385Sphk */ 2844437Sache 2974385Sphk#include <sys/cdefs.h> 3074385Sphk__FBSDID("$FreeBSD: stable/10/sys/netinet/in_kdtrace.c 255993 2013-10-02 17:14:12Z markj $"); 3144437Sache 3274385Sphk#include "opt_kdtrace.h" 3374385Sphk 34143334Scperciva#include <sys/param.h> 35143334Scperciva#include <sys/systm.h> 36143334Scperciva#include <sys/sdt.h> 37143334Scperciva 38220496SmarkmSDT_PROVIDER_DEFINE(ip); 39220496SmarkmSDT_PROVIDER_DEFINE(tcp); 40220496SmarkmSDT_PROVIDER_DEFINE(udp); 41220496Smarkm 4244290SwollmanSDT_PROBE_DEFINE6_XLATE(ip, , , receive, receive, 4344301Swollman "void *", "pktinfo_t *", 44143334Scperciva "void *", "csinfo_t *", 45220496Smarkm "uint8_t *", "ipinfo_t *", 46220496Smarkm "struct ifnet *", "ifinfo_t *", 471846Swollman "struct ip *", "ipv4info_t *", 4844301Swollman "struct ip6_hdr *", "ipv6info_t *"); 491802Sphk 5044290SwollmanSDT_PROBE_DEFINE6_XLATE(ip, , , send, send, 5144301Swollman "void *", "pktinfo_t *", 52218723Sdim "void *", "csinfo_t *", 5344290Swollman "uint8_t *", "ipinfo_t *", 5444301Swollman "struct ifnet *", "ifinfo_t *", 5544301Swollman "struct ip *", "ipv4info_t *", 56218723Sdim "struct ip6_hdr *", "ipv6info_t *"); 5744301Swollman 58218723SdimSDT_PROBE_DEFINE5_XLATE(tcp, , , accept_established, accept-established, 59218723Sdim "void *", "pktinfo_t *", 60218723Sdim "struct tcpcb *", "csinfo_t *", 6144290Swollman "uint8_t *", "ipinfo_t *", 621802Sphk "struct tcpcb *", "tcpsinfo_t *" , 6344290Swollman "struct tcphdr *", "tcpinfoh_t *"); 6444290Swollman 651802SphkSDT_PROBE_DEFINE5_XLATE(tcp, , , accept_refused, accept-refused, 661802Sphk "void *", "pktinfo_t *", 6744290Swollman "struct tcpcb *", "csinfo_t *", 6844290Swollman "uint8_t *", "ipinfo_t *", 691802Sphk "struct tcpcb *", "tcpsinfo_t *" , 701802Sphk "struct tcphdr *", "tcpinfo_t *"); 7144290Swollman 7244290SwollmanSDT_PROBE_DEFINE5_XLATE(tcp, , , connect_established, connect-established, 731802Sphk "void *", "pktinfo_t *", 7444290Swollman "struct tcpcb *", "csinfo_t *", 7544290Swollman "uint8_t *", "ipinfo_t *", 7644290Swollman "struct tcpcb *", "tcpsinfo_t *" , 7744290Swollman "struct tcphdr *", "tcpinfoh_t *"); 7844290Swollman 7944290SwollmanSDT_PROBE_DEFINE5_XLATE(tcp, , , connect_refused, connect-refused, 8044290Swollman "void *", "pktinfo_t *", 8144290Swollman "struct tcpcb *", "csinfo_t *", 8244290Swollman "uint8_t *", "ipinfo_t *", 8344290Swollman "struct tcpcb *", "tcpsinfo_t *" , 84143334Scperciva "struct tcphdr *", "tcpinfoh_t *"); 85143334Scperciva 86143334ScpercivaSDT_PROBE_DEFINE5_XLATE(tcp, , , connect_request, connect-request, 87143334Scperciva "void *", "pktinfo_t *", 88143334Scperciva "struct tcpcb *", "csinfo_t *", 89143334Scperciva "uint8_t *", "ipinfo_t *", 90220496Smarkm "struct tcpcb *", "tcpsinfo_t *" , 91220496Smarkm "struct tcphdr *", "tcpinfo_t *"); 92220496Smarkm 93220496SmarkmSDT_PROBE_DEFINE5_XLATE(tcp, , , receive, receive, 94220496Smarkm "void *", "pktinfo_t *", 95220496Smarkm "struct tcpcb *", "csinfo_t *", 9644301Swollman "uint8_t *", "ipinfo_t *", 9744301Swollman "struct tcpcb *", "tcpsinfo_t *" , 9844301Swollman "struct tcphdr *", "tcpinfoh_t *"); 9944301Swollman 10044301SwollmanSDT_PROBE_DEFINE5_XLATE(tcp, , , send, send, 10144301Swollman "void *", "pktinfo_t *", 10294367Sru "struct tcpcb *", "csinfo_t *", 10394367Sru "uint8_t *", "ipinfo_t *", 10494367Sru "struct tcpcb *", "tcpsinfo_t *" , 10594367Sru "struct tcphdr *", "tcpinfo_t *"); 10694367Sru 1071802SphkSDT_PROBE_DEFINE6_XLATE(tcp, , , state_change, state-change, 1081802Sphk "void *", "void *", 10939063Simp "struct tcpcb *", "csinfo_t *", 11039063Simp "void *", "void *", 11139063Simp "struct tcpcb *", "tcpsinfo_t *", 11239063Simp "void *", "void *", 11339063Simp "int", "tcplsinfo_t *"); 11439063Simp 11539063SimpSDT_PROBE_DEFINE5_XLATE(udp, , , receive, receive, 11639063Simp "void *", "pktinfo_t *", 1171802Sphk "struct inpcb *", "csinfo_t *", 1181802Sphk "uint8_t *", "ipinfo_t *", 11939063Simp "struct inpcb *", "udpsinfo_t *", 12039063Simp "struct udphdr *", "udpinfo_t *"); 12139063Simp 12239063SimpSDT_PROBE_DEFINE5_XLATE(udp, , , send, send, 12339063Simp "void *", "pktinfo_t *", 12439063Simp "struct inpcb *", "csinfo_t *", 125220496Smarkm "uint8_t *", "ipinfo_t *", 126220496Smarkm "struct inpcb *", "udpsinfo_t *", 127220496Smarkm "struct udphdr *", "udpinfo_t *"); 128220496Smarkm