25 #include <linux/kernel.h>
27 #include <linux/socket.h>
28 #include <linux/dccp.h>
30 #include <linux/module.h>
44 static const char procname[] =
"dccpprobe";
53 static void printl(
const char *
fmt, ...)
63 now = timespec_sub(now, dccpw.tstart);
65 len =
sprintf(tbuf,
"%lu.%06lu ",
66 (
unsigned long) now.tv_sec,
68 len +=
vscnprintf(tbuf+len,
sizeof(tbuf)-len, fmt, args);
78 const struct inet_sock *inet = inet_sk(sk);
81 if (ccid_get_current_tx_ccid(dccp_sk(sk)) ==
DCCPC_CCID3)
82 hc = ccid3_hc_tx_sk(sk);
87 printl(
"%pI4:%u %pI4:%u %d %d %d %d %u %llu %llu %d\n",
94 printl(
"%pI4:%u %pI4:%u %d\n",
104 static struct jprobe dccp_send_probe = {
106 .symbol_name =
"dccp_sendmsg",
108 .entry = jdccp_sendmsg,
119 size_t len, loff_t *ppos)
145 return error ? error :
cnt;
150 .open = dccpprobe_open,
151 .read = dccpprobe_read,
155 static __init int setup_jprobe(
void)
160 request_module(
"dccp");
166 static __init int dccpprobe_init(
void)
177 ret = setup_jprobe();
181 pr_info(
"DCCP watch registered (port=%d)\n",
port);
191 static __exit void dccpprobe_exit(
void)