summaryrefslogtreecommitdiffstats
path: root/tapset/networking.stp
blob: 9bd742da434482bef1c8b98deda42f4d1f718ac4 (plain)
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
// networking tapset
// Copyright (C) 2005, 2006 IBM Corp.
//
// 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.

///<chapter id="networking.stp">
///  <title>Networking Tapset</title>
///  <para>
///	This family of probe points is used to probe the activities of
///     network device. 
///  </para>

%{
#include <linux/netdevice.h>
%}

///<formalpara id="netdev.receive">
///  <title>netdev.receive</title>
///  <indexterm><primary>netdev.receive</primary></indexterm>
///  <para>Fires when data arrives on network device.</para>
///</formalpara>
///<para>
///  <variablelist><title>Arguments:</title>
///    <varlistentry><term>dev_name</term>
///       <listitem><para>
///          The name of the device. e.g: eth0, ath1
///       </para></listitem>
///    </varlistentry>
///
///    <varlistentry><term>length</term>
///       <listitem><para>
///           The length of the receiving buffer
///       </para></listitem>
///    </varlistentry>
///
///    <varlistentry><term>protocol</term>
///       <listitem><para>The possible values of protocol could be:
///         <table frame='all'><title>Protocol Values</title>
///         <tgroup cols='2' align='left' colsep='1' rowsep='1'>
///         <colspec colname='Value'/>
///         <colspec colname='Protocol'/>
///	    <thead>
///   	    <row><entry>Value</entry><entry>Protocol</entry></row>
///	    </thead>
///	    <tbody>
///   	    <row><entry>0800</entry><entry>IP</entry></row>
///   	    <row><entry>8100</entry><entry>802.1Q VLAN</entry></row>
///   	    <row><entry>0001</entry><entry>802.3</entry></row>
///   	    <row><entry>0002</entry><entry>AX.25</entry></row>
///   	    <row><entry>0004</entry><entry>802.2</entry></row>
///   	    <row><entry>8035</entry><entry>RARP</entry></row>
///   	    <row><entry>0005</entry><entry>SNAP</entry></row>
///   	    <row><entry>0805</entry><entry>X.25</entry></row>
///   	    <row><entry>0806</entry><entry>ARP</entry></row>
///   	    <row><entry>8137</entry><entry>IPX</entry></row>
///   	    <row><entry>0009</entry><entry>Localtalk</entry></row>
///   	    <row><entry>86DD</entry><entry>IPv6</entry></row>
///	    </tbody>
///	    </tgroup>
///	    </table>
///       </para></listitem>
///    </varlistentry>
///
///    <varlistentry><term>truesize</term>
///       <listitem><para>
///           The size of the received data.
///       </para></listitem>
///    </varlistentry>
///
///  </variablelist>
///</para>
/* Main device receive routine, be called when packet arrives on network device */
probe netdev.receive
	=  kernel.function("netif_receive_skb")
{
	dev_name = kernel_string($skb->dev->name)
	length = $skb->len
	protocol = $skb->protocol
	truesize = $skb->truesize
}

///<formalpara id="netdev.transmit">
///  <title>netdev.transmit</title>
///  <indexterm><primary>netdev.transmit</primary></indexterm>
///  <para> Fires when the network device wants to transmit a buffer.</para>
///</formalpara>
///<para>
///  <variablelist><title>Arguments:</title>
///    <varlistentry><term>dev_name</term>
///       <listitem><para>
///          The name of the device. e.g: eth0, ath1
///       </para></listitem>
///    </varlistentry>
///
///    <varlistentry><term>length</term>
///       <listitem><para>
///         The length of the transmit buffer
///       </para></listitem>
///    </varlistentry>
///
///    <varlistentry><term>protocol</term>
///       <listitem><para>
///         The protocol of this packet.
///       </para></listitem>
///    </varlistentry>
///
///    <varlistentry><term>truesize</term>
///       <listitem><para>
///         The size of the the data to be transmitted.
///       </para></listitem>
///    </varlistentry>
///
///  </variablelist>
///</para>
/* Queue a buffer for transmission to a network device */
probe netdev.transmit
	=  kernel.function("dev_queue_xmit")
{
	dev_name = kernel_string($skb->dev->name)
	length = $skb->len
	protocol = $skb->protocol
	truesize = $skb->truesize
}

///</chapter>