25 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
27 #include <linux/kernel.h>
29 #include <linux/socket.h>
33 #include <linux/module.h>
35 #include <linux/time.h>
57 static const char procname[] =
"sctpprobe";
66 static void printl(
const char *
fmt, ...)
73 len =
vscnprintf(tbuf,
sizeof(tbuf), fmt, args);
89 size_t len, loff_t *ppos)
115 return error ? error :
cnt;
120 .open = sctpprobe_open,
121 .read = sctpprobe_read,
132 static __u32 lcwnd = 0;
135 sp = asoc->
peer.primary_path;
137 if ((
full || sp->cwnd != lcwnd) &&
143 now = timespec_sub(now, sctpw.tstart);
145 printl(
"%lu.%06lu ", (
unsigned long) now.
tv_sec,
148 printl(
"%p %5d %5d %5d %8d %5d ", asoc,
149 ep->
base.bind_addr.port, asoc->
peer.port,
154 if (sp == asoc->
peer.primary_path)
157 if (sp->ipaddr.sa.sa_family ==
AF_INET)
158 printl(
"%pI4 ", &sp->ipaddr.v4.sin_addr);
160 printl(
"%pI6 ", &sp->ipaddr.v6.sin6_addr);
162 printl(
"%2u %8u %8u %8u %8u %8u ",
163 sp->state, sp->cwnd, sp->ssthresh,
164 sp->flight_size, sp->partial_bytes_acked,
174 static struct jprobe sctp_recv_probe = {
176 .symbol_name =
"sctp_sf_eat_sack_6_2",
181 static __init int sctpprobe_init(
void)
209 static __exit void sctpprobe_exit(
void)