summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-tcpdumplike.xml116
-rw-r--r--doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml2
-rwxr-xr-xdoc/Tapset_Reference_Guide/publicanize.sh4
-rwxr-xr-x[-rw-r--r--]testsuite/buildko/two.stp0
-rwxr-xr-x[-rw-r--r--]testsuite/buildok/thirty.stp0
-rwxr-xr-x[-rw-r--r--]testsuite/systemtap.base/bz10078.stp0
6 files changed, 119 insertions, 3 deletions
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-tcpdumplike.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-tcpdumplike.xml
new file mode 100644
index 00000000..cd42edc6
--- /dev/null
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-tcpdumplike.xml
@@ -0,0 +1,116 @@
+<?xml version='1.0'?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+]>
+
+
+ <section id="tcpdumplikesect">
+ <title>Monitoring TCP Packets</title>
+<indexterm>
+<primary>script examples</primary>
+<secondary>monitoring TCP packets</secondary>
+</indexterm>
+
+<indexterm>
+<primary>examples of SystemTap scripts</primary>
+<secondary>monitoring TCP packets</secondary>
+</indexterm>
+
+<indexterm>
+<primary>monitoring TCP packets</primary>
+<secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+<indexterm>
+ <primary>TCP packets, monitoring</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+<indexterm>
+ <primary>TCP packets, monitoring</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+<!--
+<indexterm>
+ <primary>script examples</primary>
+ <secondary>net/socket.c, tracing functions from</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>examples of SystemTap scripts</primary>
+ <secondary>net/socket.c, tracing functions from</secondary>
+</indexterm>
+
+<indexterm>
+ <primary>net/socket.c, tracing functions from</primary>
+ <secondary>examples of SystemTap scripts</secondary>
+</indexterm>
+-->
+
+<para>
+ This section illustrates how to monitor TCP packets received by the system. This is useful in
+ analyzing network traffic generated by applications running on the system.
+</para>
+
+
+<formalpara id="tcpdumplike">
+ <title>tcpdumplike.stp</title>
+<para>
+<programlisting>
+ <xi:include parse="text" href="extras/testsuite/systemtap.examples/network/tcpdumplike.stp" xmlns:xi="http://www.w3.org/2001/XInclude" />
+</programlisting>
+</para>
+</formalpara>
+
+<para>
+ While <xref linkend="tcpdumplike"/> is running, it will print out the following information
+ about any received TCP packets in real time:
+</para>
+
+<itemizedlist>
+ <listitem><para>Source and destination IP address (<command>saddr</command>,
+ <command>daddr</command>, respectively)</para></listitem>
+ <listitem><para>Source and destination ports (<command>sport</command>, <command>dport</command>,
+ respectively)</para></listitem>
+ <listitem><para>Packet flags</para></listitem>
+</itemizedlist>
+
+<para>
+ To determine the flags used by the packet, <xref linkend="tcpdumplike"/> uses the following
+ functions:
+</para>
+
+<itemizedlist>
+ <listitem><para><command>urg</command> - urgent</para></listitem>
+ <listitem><para><command>ack</command> - acknowledgement</para></listitem>
+ <listitem><para><command>psh</command> - push</para></listitem>
+ <listitem><para><command>rst</command> - reset</para></listitem>
+ <listitem><para><command>syn</command> - synchronize</para></listitem>
+ <listitem><para><command>fin</command> - finished</para></listitem>
+</itemizedlist>
+
+<para>
+ The aforementioned functions return <command>1</command> or <command>0</command> to
+ specify whether the packet uses the corresponding flag.
+</para>
+
+<example id="tcpdumplikeoutput">
+ <title><xref linkend="tcpdumplike"/> Sample Output</title>
+<screen>
+-----------------------------------------------------------------
+ Source IP Dest IP SPort DPort U A P R S F
+-----------------------------------------------------------------
+ 209.85.229.147 10.0.2.15 80 20373 0 1 1 0 0 0
+ 92.122.126.240 10.0.2.15 80 53214 0 1 0 0 1 0
+ 92.122.126.240 10.0.2.15 80 53214 0 1 0 0 0 0
+ 209.85.229.118 10.0.2.15 80 63433 0 1 0 0 1 0
+ 209.85.229.118 10.0.2.15 80 63433 0 1 0 0 0 0
+ 209.85.229.147 10.0.2.15 80 21141 0 1 1 0 0 0
+ 209.85.229.147 10.0.2.15 80 21141 0 1 1 0 0 0
+ 209.85.229.147 10.0.2.15 80 21141 0 1 1 0 0 0
+ 209.85.229.147 10.0.2.15 80 21141 0 1 1 0 0 0
+ 209.85.229.147 10.0.2.15 80 21141 0 1 1 0 0 0
+ 209.85.229.118 10.0.2.15 80 63433 0 1 1 0 0 0
+[...]
+</screen>
+</example>
+
+</section>
+
diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml
index 4d999b53..eeab9b27 100644
--- a/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml
+++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_SystemTap_Scripts.xml
@@ -42,7 +42,7 @@
<xi:include href="Useful_Scripts-nettop.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Useful_Scripts-sockettrace.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="Useful_Scripts-tcp_connections.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
-
+ <xi:include condition="fedora" href="Useful_Scripts-tcpdumplike.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
</section>
<section id="mainsect-disk">
<title>Disk</title>
diff --git a/doc/Tapset_Reference_Guide/publicanize.sh b/doc/Tapset_Reference_Guide/publicanize.sh
index 0d1b134e..a0ccc9b8 100755
--- a/doc/Tapset_Reference_Guide/publicanize.sh
+++ b/doc/Tapset_Reference_Guide/publicanize.sh
@@ -1,8 +1,8 @@
#!/bin/bash
INFILE="../SystemTap_Tapset_Reference/tapsets.xml"
OUTFILE="en-US/Tapset_Reference_Guide.xml"
-TMPFILE='mktemp' || exit 1
-TMPFILE2='mktemp' || exit 1
+TMPFILE=`mktemp` || exit 1
+TMPFILE2=`mktemp` || exit 1
do_help()
{
diff --git a/testsuite/buildko/two.stp b/testsuite/buildko/two.stp
index 25350dc0..25350dc0 100644..100755
--- a/testsuite/buildko/two.stp
+++ b/testsuite/buildko/two.stp
diff --git a/testsuite/buildok/thirty.stp b/testsuite/buildok/thirty.stp
index 042bae56..042bae56 100644..100755
--- a/testsuite/buildok/thirty.stp
+++ b/testsuite/buildok/thirty.stp
diff --git a/testsuite/systemtap.base/bz10078.stp b/testsuite/systemtap.base/bz10078.stp
index 0318e4e9..0318e4e9 100644..100755
--- a/testsuite/systemtap.base/bz10078.stp
+++ b/testsuite/systemtap.base/bz10078.stp