2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
4 * Copyright (c) 2013 Mark Johnston <markj@FreeBSD.org>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 #include <sys/cdefs.h>
32 __FBSDID("$FreeBSD$");
34 #include <sys/param.h>
35 #include <sys/systm.h>
38 SDT_PROVIDER_DEFINE(ip);
39 SDT_PROVIDER_DEFINE(tcp);
40 SDT_PROVIDER_DEFINE(udp);
41 SDT_PROVIDER_DEFINE(udplite);
43 SDT_PROBE_DEFINE6_XLATE(ip, , , receive,
44 "void *", "pktinfo_t *",
45 "void *", "csinfo_t *",
46 "uint8_t *", "ipinfo_t *",
47 "struct ifnet *", "ifinfo_t *",
48 "struct ip *", "ipv4info_t *",
49 "struct ip6_hdr *", "ipv6info_t *");
51 SDT_PROBE_DEFINE6_XLATE(ip, , , send,
52 "void *", "pktinfo_t *",
53 "void *", "csinfo_t *",
54 "uint8_t *", "ipinfo_t *",
55 "struct ifnet *", "ifinfo_t *",
56 "struct ip *", "ipv4info_t *",
57 "struct ip6_hdr *", "ipv6info_t *");
59 SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__established,
60 "void *", "pktinfo_t *",
61 "struct tcpcb *", "csinfo_t *",
62 "struct mbuf *", "ipinfo_t *",
63 "struct tcpcb *", "tcpsinfo_t *" ,
64 "struct tcphdr *", "tcpinfoh_t *");
66 SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__refused,
67 "void *", "pktinfo_t *",
68 "struct tcpcb *", "csinfo_t *",
69 "struct mbuf *", "ipinfo_t *",
70 "struct tcpcb *", "tcpsinfo_t *" ,
71 "struct tcphdr *", "tcpinfo_t *");
73 SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__established,
74 "void *", "pktinfo_t *",
75 "struct tcpcb *", "csinfo_t *",
76 "struct mbuf *", "ipinfo_t *",
77 "struct tcpcb *", "tcpsinfo_t *" ,
78 "struct tcphdr *", "tcpinfoh_t *");
80 SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__refused,
81 "void *", "pktinfo_t *",
82 "struct tcpcb *", "csinfo_t *",
83 "struct mbuf *", "ipinfo_t *",
84 "struct tcpcb *", "tcpsinfo_t *" ,
85 "struct tcphdr *", "tcpinfoh_t *");
87 SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__request,
88 "void *", "pktinfo_t *",
89 "struct tcpcb *", "csinfo_t *",
90 "uint8_t *", "ipinfo_t *",
91 "struct tcpcb *", "tcpsinfo_t *" ,
92 "struct tcphdr *", "tcpinfo_t *");
94 SDT_PROBE_DEFINE5_XLATE(tcp, , , receive,
95 "void *", "pktinfo_t *",
96 "struct tcpcb *", "csinfo_t *",
97 "struct mbuf *", "ipinfo_t *",
98 "struct tcpcb *", "tcpsinfo_t *" ,
99 "struct tcphdr *", "tcpinfoh_t *");
101 SDT_PROBE_DEFINE5_XLATE(tcp, , , send,
102 "void *", "pktinfo_t *",
103 "struct tcpcb *", "csinfo_t *",
104 "uint8_t *", "ipinfo_t *",
105 "struct tcpcb *", "tcpsinfo_t *" ,
106 "struct tcphdr *", "tcpinfo_t *");
108 SDT_PROBE_DEFINE1_XLATE(tcp, , , siftr,
109 "struct pkt_node *", "siftrinfo_t *");
111 SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__input,
112 "struct tcpcb *", "tcpsinfo_t *" ,
113 "struct tcphdr *", "tcpinfoh_t *",
114 "struct mbuf *", "ipinfo_t *");
116 SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__output,
117 "struct tcpcb *", "tcpsinfo_t *" ,
118 "struct tcphdr *", "tcpinfo_t *",
119 "struct mbuf *", "ipinfo_t *");
121 SDT_PROBE_DEFINE2_XLATE(tcp, , , debug__user,
122 "struct tcpcb *", "tcpsinfo_t *" ,
125 SDT_PROBE_DEFINE3_XLATE(tcp, , , debug__drop,
126 "struct tcpcb *", "tcpsinfo_t *" ,
127 "struct tcphdr *", "tcpinfoh_t *",
128 "struct mbuf *", "ipinfo_t *");
130 SDT_PROBE_DEFINE6_XLATE(tcp, , , state__change,
132 "struct tcpcb *", "csinfo_t *",
134 "struct tcpcb *", "tcpsinfo_t *",
136 "int", "tcplsinfo_t *");
138 SDT_PROBE_DEFINE6_XLATE(tcp, , , receive__autoresize,
140 "struct tcpcb *", "csinfo_t *",
141 "struct mbuf *", "ipinfo_t *",
142 "struct tcpcb *", "tcpsinfo_t *" ,
143 "struct tcphdr *", "tcpinfoh_t *",
146 SDT_PROBE_DEFINE5_XLATE(udp, , , receive,
147 "void *", "pktinfo_t *",
148 "struct inpcb *", "csinfo_t *",
149 "uint8_t *", "ipinfo_t *",
150 "struct inpcb *", "udpsinfo_t *",
151 "struct udphdr *", "udpinfo_t *");
153 SDT_PROBE_DEFINE5_XLATE(udp, , , send,
154 "void *", "pktinfo_t *",
155 "struct inpcb *", "csinfo_t *",
156 "uint8_t *", "ipinfo_t *",
157 "struct inpcb *", "udpsinfo_t *",
158 "struct udphdr *", "udpinfo_t *");
160 SDT_PROBE_DEFINE5_XLATE(udplite, , , receive,
161 "void *", "pktinfo_t *",
162 "struct inpcb *", "csinfo_t *",
163 "uint8_t *", "ipinfo_t *",
164 "struct inpcb *", "udplitesinfo_t *",
165 "struct udphdr *", "udpliteinfo_t *");
167 SDT_PROBE_DEFINE5_XLATE(udplite, , , send,
168 "void *", "pktinfo_t *",
169 "struct inpcb *", "csinfo_t *",
170 "uint8_t *", "ipinfo_t *",
171 "struct inpcb *", "udplitesinfo_t *",
172 "struct udphdr *", "udpliteinfo_t *");