This file is indexed.

/usr/share/systemtap/tapset/linux/udp.stp is in systemtap-common 2.3-1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
// UDP tapset
// Copyright (C) 2006 Intel Corporation.
// Copyright (C) 2013 Red Hat, Inc.
//
// This file is part of systemtap, and is free software.  You can
// redistribute it and/or modify it under the terms of the GNU General
// Public License (GPL); either version 2, or (at your option) any
// later version.
// <tapsetdescription>
// This family of probe points is used to probe events that occur in the UDP layer. 
// </tapsetdescription>

/* Helper functions analogous (or even identical) those in tcp.stp */
function __get_skb_udphdr:long (skb:long) { return __get_skb_tcphdr(skb) }
function __udp_sock_sport (sock) { return __tcp_sock_sport (sock) }
function __udp_sock_dport (sock) { return __tcp_sock_dport (sock) }

function __udp_skb_dport(udphdr) { return ntohs(@cast(udphdr, "udphdr")->dest) }
function __udp_skb_sport(udphdr) { return ntohs(@cast(udphdr, "udphdr")->source) }





/**
  * probe udp.sendmsg - Fires whenever a process sends a UDP message  
  * @name: The name of this probe
  * @sock: Network socket used by the process 
  * @size: Number of bytes sent by the process
  * @family: IP address family
  * @saddr: A string representing the source IP address
  * @daddr: A string representing the destination IP address
  * @sport: UDP source port
  * @dport: UDP destination port
  *
  * Context:
  *   The process which sent a UDP message 
  */
probe udp.sendmsg = kernel.function("udp_sendmsg") {
	name = "udp.sendmsg"
	sock    = $sk
	size    = $len
        %( systemtap_v >= "2.3" %?
	family  = __ip_sock_family($sk)
	saddr   = format_ipaddr(__ip_sock_saddr($sk), __ip_sock_family($sk))
	daddr   = format_ipaddr(__ip_sock_daddr($sk), __ip_sock_family($sk))
	sport   = __udp_sock_sport($sk)
	dport   = __udp_sock_dport($sk)
           %)
}

/**
  * probe udp.sendmsg.return - Fires whenever an attempt to send a UDP message is completed
  * @name: The name of this probe
  * @size: Number of bytes sent by the process
  *
  * Context:
  *   The process which sent a UDP message
  */
probe udp.sendmsg.return = kernel.function("udp_sendmsg").return {
	name = "udp.sendmsg"
	size = $return 
        %( systemtap_v >= "2.3" %?
	family  = __ip_sock_family($sk)
	saddr   = format_ipaddr(__ip_sock_saddr($sk), __ip_sock_family($sk))
	daddr   = format_ipaddr(__ip_sock_daddr($sk), __ip_sock_family($sk))
	sport   = __udp_sock_sport($sk)
	dport   = __udp_sock_dport($sk)
        %)
}

/**
  * probe udp.recvmsg - Fires whenever a UDP message is received
  * @name: The name of this probe
  * @sock: Network socket used by the process
  * @size: Number of bytes received by the process
  * @family: IP address family
  * @saddr: A string representing the source IP address
  * @daddr: A string representing the destination IP address
  * @sport: UDP source port
  * @dport: UDP destination port
  *
  * Context:
  *  The process which received a UDP message
  */
probe udp.recvmsg = kernel.function("udp_recvmsg") {
	name = "udp.recvmsg"
	sock    = $sk
	size    = $len
        %( systemtap_v >= "2.3" %?
	family  = __ip_sock_family($sk)
	saddr   = format_ipaddr(__ip_sock_saddr($sk), __ip_sock_family($sk))
	daddr   = format_ipaddr(__ip_sock_daddr($sk), __ip_sock_family($sk))
	sport   = __udp_sock_sport($sk)
	dport   = __udp_sock_dport($sk)
        %)
}

/**
  * probe udp.recvmsg.return - Fires whenever an attempt to receive a UDP message received is completed
  * @name: The name of this probe
  * @size: Number of bytes received by the process
  * @family: IP address family
  * @saddr: A string representing the source IP address
  * @daddr: A string representing the destination IP address
  * @sport: UDP source port
  * @dport: UDP destination port
  *
  * Context:
  *  The process which received a UDP message
  */
probe udp.recvmsg.return = kernel.function("udp_recvmsg").return {
	name = "udp.recvmsg"
	size = $return 
        %( systemtap_v >= "2.3" %?
	family  = __ip_sock_family($sk)
	saddr   = format_ipaddr(__ip_sock_saddr($sk), __ip_sock_family($sk))
	daddr   = format_ipaddr(__ip_sock_daddr($sk), __ip_sock_family($sk))
	sport   = __udp_sock_sport($sk)
	dport   = __udp_sock_dport($sk)
        %)
}

/**
  * probe udp.disconnect - Fires when a process requests for a UDP disconnection
  * @name: The name of this probe
  * @sock: Network socket used by the process
  * @flags: Flags (e.g. FIN, etc)  
  * @family: IP address family
  * @saddr: A string representing the source IP address
  * @daddr: A string representing the destination IP address
  * @sport: UDP source port
  * @dport: UDP destination port
  *
  * Context:
  *  The process which requests a UDP disconnection 
  */
probe udp.disconnect = kernel.function("udp_disconnect") {
	name = "udp.disconnect"
	sock  = $sk
	flags = $flags
        %( systemtap_v >= "2.3" %?
	family  = __ip_sock_family($sk)
	saddr   = format_ipaddr(__ip_sock_saddr($sk), __ip_sock_family($sk))
	daddr   = format_ipaddr(__ip_sock_daddr($sk), __ip_sock_family($sk))
	sport   = __udp_sock_sport($sk)
	dport   = __udp_sock_dport($sk)
        %)
}

/**
  * probe udp.disconnect.return - UDP has been disconnected successfully
  * @name: The name of this probe
  * @ret: Error code (0: no error) 
  * @family: IP address family
  * @saddr: A string representing the source IP address
  * @daddr: A string representing the destination IP address
  * @sport: UDP source port
  * @dport: UDP destination port
  *
  * Context:
  *  The process which requested a UDP disconnection
  */
probe udp.disconnect.return = kernel.function("udp_disconnect").return {
	name = "udp.disconnect"
	ret = $return 
        %( systemtap_v >= "2.3" %?
	family  = __ip_sock_family($sk)
	saddr   = format_ipaddr(__ip_sock_saddr($sk), __ip_sock_family($sk))
	daddr   = format_ipaddr(__ip_sock_daddr($sk), __ip_sock_family($sk))
	sport   = __udp_sock_sport($sk)
	dport   = __udp_sock_dport($sk)
        %)
}