diff options
author | Andre Detsch <adetsch@br.ibm.com> | 2009-04-14 14:23:59 -0300 |
---|---|---|
committer | Josh Stone <jistone@redhat.com> | 2009-04-14 10:42:53 -0700 |
commit | 5e868ddd8263d2f7b61a702891252cc2bacb1c07 (patch) | |
tree | 7482978638f8f41904d0f908715d8543ffec196d /testsuite/systemtap.examples/network/tcpdumplike.stp | |
parent | 7175b49227fb1f71f3bdd6060ef9f6499e42f035 (diff) | |
download | systemtap-steved-5e868ddd8263d2f7b61a702891252cc2bacb1c07.tar.gz systemtap-steved-5e868ddd8263d2f7b61a702891252cc2bacb1c07.tar.xz systemtap-steved-5e868ddd8263d2f7b61a702891252cc2bacb1c07.zip |
Add new TCP and IP functions
This patch adds some basic functions to the IP and TCP tapsets.
Mainly, it's possible to get the iphdr and tcphdr from a sk_buff structure.
As a consequence, a TCP probe called tcp.receive() was created and
is probed every time a TCP packet is received, and a lot of
useful fields is available, as the TCP flags.
Also a small example that works like tcpdump for received TCP packets was
created.
This patch was tested on x86 and ppc machines, on 2.6.18 kernel and also on
mainline one.
Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: Andre Detsch <adetsch@br.ibm.com>
Signed-off-by: Josh Stone <jistone@redhat.com>
Diffstat (limited to 'testsuite/systemtap.examples/network/tcpdumplike.stp')
-rw-r--r-- | testsuite/systemtap.examples/network/tcpdumplike.stp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/network/tcpdumplike.stp b/testsuite/systemtap.examples/network/tcpdumplike.stp new file mode 100644 index 00000000..4026e7a7 --- /dev/null +++ b/testsuite/systemtap.examples/network/tcpdumplike.stp @@ -0,0 +1,12 @@ +// A TCP dump like example + +probe begin, timer.s(1) { + printf("-----------------------------------------------------------------\n"); + printf(" Source IP Dest IP SPort DPort U A P R S F \n"); + printf("-----------------------------------------------------------------\n"); +} + +probe tcp.receive { + printf(" %15s %15s %5d %5d %d %d %d %d %d %d\n", + saddr, daddr, sport, dport, urg, ack, psh, rst, syn, fin) +} |