You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(33) |
Jun
(14) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(19) |
Jun
(13) |
Jul
|
Aug
(1) |
Sep
(9) |
Oct
(8) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(14) |
Jul
|
Aug
|
Sep
(7) |
Oct
(7) |
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(15) |
2017 |
Jan
(11) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <rb...@us...> - 2011-09-04 19:37:40
|
Revision: 154 http://callflow.svn.sourceforge.net/callflow/?rev=154&view=rev Author: rbos Date: 2011-09-04 19:37:34 +0000 (Sun, 04 Sep 2011) Log Message: ----------- Fix: look for the first true SIP line in the callflow.short cache, in the case the first lines in this cache are comment lines they must be ignored. Modified Paths: -------------- callflow Modified: callflow =================================================================== --- callflow 2011-09-04 19:34:49 UTC (rev 153) +++ callflow 2011-09-04 19:37:34 UTC (rev 154) @@ -733,7 +733,7 @@ # (SIP) Messages will be presented in right frame sed 's/coords=/target=\"msg\" coords=/' $DESTDIR/index_frameless.html > $DESTDIR/graph.html - firstFrame=$(awk -F "|" '{ if (NR == 1) print $3 }' $DESTDIR/callflow.short) + firstFrame=$(grep -v "^#" $DESTDIR/callflow.short | awk -F "|" '{ if (NR == 1) print $3 }') ( echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\"" echo " \"http://www.w3.org/TR/html4/frameset.dtd\">" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-09-04 19:34:55
|
Revision: 153 http://callflow.svn.sourceforge.net/callflow/?rev=153&view=rev Author: rbos Date: 2011-09-04 19:34:49 +0000 (Sun, 04 Sep 2011) Log Message: ----------- Preserve the spaces in comments Fix: if the first word in a comment line, was directly connected to the "#" comment character the first word was skipped Modified Paths: -------------- scripts/callflow.awk Modified: scripts/callflow.awk =================================================================== --- scripts/callflow.awk 2011-09-04 19:30:25 UTC (rev 152) +++ scripts/callflow.awk 2011-09-04 19:34:49 UTC (rev 153) @@ -45,7 +45,7 @@ printf " .pkt-text { color: red; font-family: Trebuchet MS,Helvetica, sans-serif;\n"; printf " font-size: 8pt; stroke: none; fill: black;}\n"; printf " .comment-text { color: black; font-family: Trebuchet MS,Helvetica, sans-serif;\n"; - printf " font-size: 9pt; font-style: italic; stroke: none; fill: green;}\n"; + printf " font-size: 9pt; stroke: none; fill: green;}\n"; printf " .host-text { color: black; font-family: Trebuchet MS,Helvetica,sans-serif;\n"; printf " font-size: 10pt; stroke:none; fill:blue;}\n"; printf " .title-text { color: black; font-family: Trebuchet MS,Helvetica,sans-serif;\n"; @@ -115,34 +115,24 @@ y = NR; y = y * yLineSpace + ystart; - if($0 ~ "^#") { - output = ""; - split($0, A, " ") + if ($0 ~ "^#") { - for (i=2; i <= length(A); i++) { + # The "!" is link identifier + LINK = index($0, "!") + if (LINK == 0) { + # There is no link, everything behind the first "#" is the comment + sub("#", "", $0) + printf("<text x=\"%d\" y=\"%d\" class=\"comment-text\" xml:space=\"preserve\">%s</text>\n", leftMargin + 5, y, $0); - if (A[i] == "!") - break; - output = output " " A[i]; - } - - link = ""; - if (A[i] == "!") { - - i++; - for(;i <= length(A); i++) { - link = link " " A[i]; - } - } - - if (link != "") { - - printf("<text x=\"%d\" y=\"%d\" class=\"link\">%s</text>\n", 50, y, output); - printf(" <area href=\"%s\" coords=\"%d,%d,%d,%d\"/>\n", link, 50, y-yLineSpace+2, w, y+1) >> "imagemap"; - } else { + # Make the comment a hyperlink + # - Everything before the "!" is the link text + # - Everything behind the "!" is the hyperlink + output = substr($0, 2, LINK - 2) + link = substr($0, LINK + 1) - printf("<text x=\"%d\" y=\"%d\" class=\"comment-text\">%s</text>\n", 50, y, output); + printf("<text x=\"%d\" y=\"%d\" class=\"link\" xml:space=\"preserve\">%s</text>\n", leftMargin + 5, y, output); + printf(" <area href=\"%s\" coords=\"%d,%d,%d,%d\"/>\n", link, leftMargin + 5, y-yLineSpace+2, w, y+1) >> "imagemap"; } } else { @@ -168,11 +158,11 @@ l2 = sprintf("%s:%s", $7,$8); for (i=0; i<numHosts; i++) { - if(l1 ~ hosts[i]) { + if (l1 ~ hosts[i]) { x1 = strtonum(lookup[hosts[i]]); } - if(l2 ~ hosts[i]) { + if (l2 ~ hosts[i]) { x2 = strtonum(lookup[hosts[i]]); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-09-04 19:30:31
|
Revision: 152 http://callflow.svn.sourceforge.net/callflow/?rev=152&view=rev Author: rbos Date: 2011-09-04 19:30:25 +0000 (Sun, 04 Sep 2011) Log Message: ----------- Prevent that comment lines (lines starting with "#") are processed as SIP messages. Modified Paths: -------------- scripts/removedups.sh Modified: scripts/removedups.sh =================================================================== --- scripts/removedups.sh 2011-08-31 21:14:23 UTC (rev 151) +++ scripts/removedups.sh 2011-09-04 19:30:25 UTC (rev 152) @@ -78,7 +78,8 @@ # here anyway again, as this "remove duplicated frames mode" seems to be # the better one. The others may be removed, including the md5sum # processing done above. - awk -F"|" '{print $3, $1}' $DESTDIR/callflow.short | while read FRAME TIME; do + # The code block /^[^#]/ takes care that comments skipped + awk -F"|" '/^[^#]/ {print $3, $1}' $DESTDIR/callflow.short | while read FRAME TIME; do MD5SUM=$(mkmd5sum $DESTDIR/frames/Frame${FRAME}.html | sed 's/ .*//') echo "$FRAME|$TIME|$MD5SUM" done > $TMPDIR/md5sums.$$ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-08-31 21:14:29
|
Revision: 151 http://callflow.svn.sourceforge.net/callflow/?rev=151&view=rev Author: rbos Date: 2011-08-31 21:14:23 +0000 (Wed, 31 Aug 2011) Log Message: ----------- correct typo Modified Paths: -------------- callflow Modified: callflow =================================================================== --- callflow 2011-06-22 15:42:47 UTC (rev 150) +++ callflow 2011-08-31 21:14:23 UTC (rev 151) @@ -112,7 +112,7 @@ # - The string (ITU) shows up in the protocol description "ISUP(ITU)". # awk doesn't like the "(" and ")", hence remove them. # - Short the string "with session description" to just SDP. - # - Megaco has a "|" in its info sting, this character is however the + # - Megaco has a "|" in its info string, this character is however the # field separator in the output file, remove it. The actual string # being removed is " |=". tshark -r $inputfile $FARG "$FVAL" -t a \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-22 15:42:53
|
Revision: 150 http://callflow.svn.sourceforge.net/callflow/?rev=150&view=rev Author: rbos Date: 2011-06-22 15:42:47 +0000 (Wed, 22 Jun 2011) Log Message: ----------- Frame number > 9999 or not shown correctly the most left character is not displayed completely. This change corrects it. Modified Paths: -------------- callflow Modified: callflow =================================================================== --- callflow 2011-06-14 20:00:39 UTC (rev 149) +++ callflow 2011-06-22 15:42:47 UTC (rev 150) @@ -600,7 +600,7 @@ bottomMargin = 50 showTime = "$SHOW_TIME" if ( showTime == "yes" ) { - leftMargin = 120 + leftMargin = 125 } else { leftMargin = 50 } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-14 20:00:45
|
Revision: 149 http://callflow.svn.sourceforge.net/callflow/?rev=149&view=rev Author: rbos Date: 2011-06-14 20:00:39 +0000 (Tue, 14 Jun 2011) Log Message: ----------- - Add a reference on the callflow diagram back to the landing page - Style the footer on the callflow diagram Modified Paths: -------------- callflow Modified: callflow =================================================================== --- callflow 2011-06-13 19:04:01 UTC (rev 148) +++ callflow 2011-06-14 20:00:39 UTC (rev 149) @@ -654,6 +654,8 @@ echo " <head>" echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>" echo " <title>$PRGNAME - $TITLE</title>" + + # Do not use an external style sheet, as it is visible that the stylesheet is loaded echo " <style type=\"text/css\">" echo ".callflow-image img {" echo " display: block;" @@ -661,6 +663,11 @@ echo " margin-left: auto;" echo " margin-right: auto;" echo "}" + echo "p.footer {" + echo " border-top: 1px solid #aaa;" + echo " font-size: small;" + echo " padding: 0.1em 1em 0 1em;" + echo "}" echo " </style>" echo " </head>" echo " <body>" @@ -669,8 +676,10 @@ echo " <p>" echo " <img src=\"callflow.png\" usemap=\"#callflowmap\" alt=\"Call flow sequence diagram for $inputfile\"/>" echo " </p>" - echo " <p>" + echo " <p class=\"footer\">" echo " <a href=\"$TRACEFILE\">Trace source</a>" + echo " <br/>" + echo " <a href=\"index.html\" target=\"_parent\">Back to landing page</a>" echo " </p>" echo " </div>" echo " </body>" @@ -691,6 +700,11 @@ echo " margin-left: auto;" echo " margin-right: auto;" echo "}" + echo "p.footer {" + echo " border-top: 1px solid #aaa;" + echo " font-size: small;" + echo " padding: 0.1em 1em 0 1em;" + echo "}" echo " </style>" echo " <script type=\"text/javascript\" src=\"js/overlib.js\"></script>" echo " <script type=\"text/javascript\" src=\"js/callflow.js\"></script>" @@ -701,8 +715,10 @@ echo " <p>" echo " <img src=\"callflow.png\" usemap=\"#callflowmap\" alt=\"Call flow sequence diagram for $inputfile\"/>" echo " </p>" - echo " <p>" + echo " <p class=\"footer\">" echo " <a href=\"$TRACEFILE\">Trace source</a>" + echo " <br/>" + echo " <a href=\"index.html\" target=\"_parent\">Back to landing page</a>" echo " </p>" echo " </div>" echo " </body>" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-13 19:04:07
|
Revision: 148 http://callflow.svn.sourceforge.net/callflow/?rev=148&view=rev Author: rbos Date: 2011-06-13 19:04:01 +0000 (Mon, 13 Jun 2011) Log Message: ----------- Archive support added (files, zip, bzip2) Modified Paths: -------------- callflow man/callflow.1 Modified: callflow =================================================================== --- callflow 2011-06-13 08:34:56 UTC (rev 147) +++ callflow 2011-06-13 19:04:01 UTC (rev 148) @@ -214,6 +214,12 @@ --help Print this help and exit --version, -v Print version + --archive <archive type> + Create an archive with the files for showing the callflow + diagram. Available archive types are: files, bzip2 and zip. + The archive type files just list the files required for the + callflow diagram. It can be used to create an archive with it. + --browser Launch a browser with the callflow. @@ -267,7 +273,7 @@ # Command line argument parsing, the allowed arguments are # alphabetically listed, keep it this way please. -LOPT="browser" +LOPT="archive:,browser" LOPT="$LOPT,capture-filter:,help,list-nodes,no-loops,no-time,nodenames:,refresh-cache" LOPT="$LOPT,remove-duplicate-frames,title:,width-between-nodes:,version" @@ -289,6 +295,10 @@ --help) help; exit ;; -h) usage; exit;; + --archive) + ARCHIVE="yes" + OPT_ARCHIVE_TYPE=$2; shift + ;; --browser) START_BROWSER="yes" ;; @@ -392,6 +402,21 @@ fi } +if [[ "$ARCHIVE" == "yes" ]]; then + + case "$OPT_ARCHIVE_TYPE" in + + bzip2|files|zip) ARCHIVE_TYPE="$OPT_ARCHIVE_TYPE" + ;; + + *) + echo "$PRGNAME: error: archive type ($OPT_ARCHIVE_TYPE) does not exist" >&2 + exit + ;; + esac + +fi + if [[ -z "$OPT_SHOW_TIME" ]]; then SHOW_TIME=yes else @@ -611,8 +636,16 @@ # Build callflow.png if inkscape is available if which inkscape >/dev/null 2>&1; then - inkscape --export-dpi=90 -C --export-background=white --export-png=$DESTDIR/callflow.png $DESTDIR/callflow.svg + # Inkscape does not have a quiet option, it might get one in version 0.49 + # Workaround; sent the output to /dev/null in case the files to be archived + # will be listed on the screen + if [[ "$ARCHIVE_TYPE" == "files" ]]; then + inkscape --export-dpi=90 -C --export-background=white --export-png=$DESTDIR/callflow.png $DESTDIR/callflow.svg >/dev/null 2>&1 + else + inkscape --export-dpi=90 -C --export-background=white --export-png=$DESTDIR/callflow.png $DESTDIR/callflow.svg + fi + # Build HTML files # Frameless; (SIP) messages will be presented in the same window as the callflow picture ( echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"" @@ -718,6 +751,40 @@ exit 1 fi +if [[ "$ARCHIVE" == "yes" ]]; then + + # Be specific in the files to be included in the archive + ODIR="$PWD" + cd $DESTDIR + DIRS="frames images js" + FILES=$(find $DIRS -type f) + cd "$ODIR" + + FILES="$FILES $TRACEFILE callflow.png graph.html" + FILES="$FILES index_dynamic.html index_frame_bottom.html index_frameless.html" + FILES="$FILES index_frame_right.html index.html" + ARCHIVE_FILES=$(tr " " "\n" <<< "$FILES" | sort) + + if [[ "$ARCHIVE_TYPE" == "files" ]]; then + echo "$ARCHIVE_FILES" + exit 0 + else + + ARCHIVE_NAME=$(basename $DESTDIR) + FILES=$(sed "s,^,$ARCHIVE_NAME/," <<< "$ARCHIVE_FILES") + + cd $DESTDIR/.. + if [[ "$ARCHIVE_TYPE" == "zip" ]]; then + zip --quiet $DESTDIR/$ARCHIVE_NAME.zip $FILES + echo "$PRGNAME: zip archive available at \"$DESTDIR/$ARCHIVE_NAME.zip\"" + else + tar cjf $DESTDIR/$ARCHIVE_NAME.tar.bz2 $FILES + echo "$PRGNAME: bzip2 archive available at \"$DESTDIR/$ARCHIVE_NAME.tar.bz2\"" + fi + cd "$ODIR" + fi +fi + if [[ "$START_BROWSER" == "yes" ]]; then # Start the browser in the background if [[ -z "$WEBSERVER_URL" ]]; then Modified: man/callflow.1 =================================================================== --- man/callflow.1 2011-06-13 08:34:56 UTC (rev 147) +++ man/callflow.1 2011-06-13 19:04:01 UTC (rev 148) @@ -55,6 +55,16 @@ .TP .PD 0 +.B --archive <archive type> +Create an archive with the files for showing the callflow diagram. Available archive types are: files, bzip2 and zip. The archive type \fIfiles\fR just list the files required for the callflow diagram. It can be used to create an archive with it. + +.TP +.PD 0 +.B --browser +Launch a browser with the callflow. + +.TP +.PD 0 .BI -f " filter" .TP .PD This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-13 08:35:02
|
Revision: 147 http://callflow.svn.sourceforge.net/callflow/?rev=147&view=rev Author: rbos Date: 2011-06-13 08:34:56 +0000 (Mon, 13 Jun 2011) Log Message: ----------- Added possibility to launch browser from callflow to view he callflow diagram as soon as callflow is ready Modified Paths: -------------- callflow Modified: callflow =================================================================== --- callflow 2011-06-11 19:29:13 UTC (rev 146) +++ callflow 2011-06-13 08:34:56 UTC (rev 147) @@ -214,6 +214,9 @@ --help Print this help and exit --version, -v Print version + --browser + Launch a browser with the callflow. + --capture-filter <filter>, -f <filter> A filter can be used to show only those frames that match the given filter criteria. This filter is for traces that have been @@ -264,7 +267,8 @@ # Command line argument parsing, the allowed arguments are # alphabetically listed, keep it this way please. -LOPT="capture-filter:,help,list-nodes,no-loops,no-time,nodenames:,refresh-cache" +LOPT="browser" +LOPT="$LOPT,capture-filter:,help,list-nodes,no-loops,no-time,nodenames:,refresh-cache" LOPT="$LOPT,remove-duplicate-frames,title:,width-between-nodes:,version" # Note that we use `"$@"' to let each command-line parameter expand to a @@ -285,6 +289,9 @@ --help) help; exit ;; -h) usage; exit;; + --browser) + START_BROWSER="yes" + ;; --capture-filter|-f) # Overwrite the default filter previously red from the configuration file OPT_FILTER=$2; shift @@ -711,12 +718,21 @@ exit 1 fi -echo -echo "The output can be viewed with a browser: " -if [[ -z "$WEBSERVER_URL" ]]; then - echo " ${BROWSER:=firefox} $DESTDIR/index.html" +if [[ "$START_BROWSER" == "yes" ]]; then + # Start the browser in the background + if [[ -z "$WEBSERVER_URL" ]]; then + "${BROWSER:=firefox}" "$DESTDIR/index.html" & + else + "${BROWSER:=firefox}" "$WEBSERVER_URL/$DESTDIR/index.html" & + fi else - echo " ${BROWSER:=firefox} $WEBSERVER_URL/$DESTDIR/index.html" + echo + echo "The output can be viewed with a browser: " + if [[ -z "$WEBSERVER_URL" ]]; then + echo " ${BROWSER:=firefox} $DESTDIR/index.html" + else + echo " ${BROWSER:=firefox} $WEBSERVER_URL/$DESTDIR/index.html" + fi fi exit 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-11 19:29:19
|
Revision: 146 http://callflow.svn.sourceforge.net/callflow/?rev=146&view=rev Author: rbos Date: 2011-06-11 19:29:13 +0000 (Sat, 11 Jun 2011) Log Message: ----------- Add information about the payload format Modified Paths: -------------- scripts/long2html.awk Modified: scripts/long2html.awk =================================================================== --- scripts/long2html.awk 2011-06-11 19:15:07 UTC (rev 145) +++ scripts/long2html.awk 2011-06-11 19:29:13 UTC (rev 146) @@ -218,6 +218,12 @@ PL[id] = $0 id++ + # The payload has the following format: + # 0000 74 2d 4c 65 6e 67 74 68 3a 20 32 31 33 0d 0a 50 t-Length: 213..P + # 0010 2d 41 73 73 65 72 74 65 64 2d 49 64 65 6e 74 69 -Asserted-Identi + # .... + # 0160 76 65 64 2d 55 73 65 72 3a 20 3c 73 69 70 3a 62 ved-User: <sip:b + # The following code block displays the data in a human readable format if ((length($1) == 4) && ($1 != "Data")) { PAYLOAD = substr($0, 7, 50) L = split(PAYLOAD, CHARS, " ") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-11 19:15:14
|
Revision: 145 http://callflow.svn.sourceforge.net/callflow/?rev=145&view=rev Author: rbos Date: 2011-06-11 19:15:07 +0000 (Sat, 11 Jun 2011) Log Message: ----------- - Show fragmented frame information, this is mostly the 2nd frame The 1st frame is often missing Modified Paths: -------------- conf/callflow.conf scripts/long2html.awk Modified: conf/callflow.conf =================================================================== --- conf/callflow.conf 2011-06-11 13:06:51 UTC (rev 144) +++ conf/callflow.conf 2011-06-11 19:15:07 UTC (rev 145) @@ -15,9 +15,14 @@ darkslategrey midnightblue maroon teal goldenrod gray darkolivegreen darkcyan brown peru mediumorchild navy saddlebrown coral" -# FILTER, used to filter flow, default "sip or diameter or isup or megaco" -# This filter is used as well as a DISPLAY filter in tshark/wireshark. -FILTER="sip or diameter or isup or megaco" +# FILTER, used to select the frames of interest. +# Default "sip or diameter or isup or megaco (ip.frag_offset > 1300)" +# +# The (ip.frag_offset > 1300) clause is added to obtain at least some information +# when a frame is fragmented. Due to its size the INVITE message gets quickly +# fragmented, and due to sniffers not capable as re-assembling these frames, +# SIP INVITE messages seem to disappear.... +FILTER="sip or diameter or isup or megaco or (ip.frag_offset > 1300)" # BROWSER, the name of the browser to be used # Default value: firefox Modified: scripts/long2html.awk =================================================================== --- scripts/long2html.awk 2011-06-11 13:06:51 UTC (rev 144) +++ scripts/long2html.awk 2011-06-11 19:15:07 UTC (rev 145) @@ -1,10 +1,35 @@ -BEGIN{ +# Hexadecimal to decimal convertor +function hex2dec(str) { + hstr = "0123456789abcdef" + res = 0 + n = split(tolower(str), digit, "") + + for(j = 1; j <= n; j++) { + num = index(hstr, digit[j]) - 1 + res = res + (num*16^(n-j)) + } + + return res +} + +BEGIN { first = 1 } /^Frame [0-9]+: (.*)/ { # New frame, closing <pre> and html> from previous frame before compute new filename if (first == 0) { + + if (protocol == "DATA") { + printf "\n" > filename + printf "<div class=\"sip\">Raw data</div>\n" > filename + printf "<hr/>\n" > filename + L = length(PL) + for (i = 0; i <= L; i++) { + print PL[i] > filename + } + } + printf " </pre>\n" >filename printf " </body>\n" >filename printf "</html>\n" >filename @@ -31,16 +56,18 @@ printf " <body>\n" >filename printf " <pre class=\"msg\">\n" >filename print $0 >filename - # Print time + + # Print Arrival Time getline gsub("^ *", "") - print $0 >filename; + print $0 >filename discard = 1 protocol = "" } + /^Internet Protocol,/ { - print $0 >filename + print $0 > filename discard = 1 } /^Internet Protocol$/ { @@ -66,25 +93,46 @@ /^Session Initiation Protocol/ { discard = 0 protocol = "SIP" + printf "\n" > filename } + /^Diameter Protocol/ { discard = 0 } + /^WebSocket Protocol/ { discard = 0 } + /^Hypertext Transfer Protocol/ { discard = 0 } + /^Call Specification Language/ { discard = 0 } + /^Stream Control Transmission Protocol/ { discard = 0 + protocol = "SCTP" + printf "\n" > filename } + +/^Data/ { + discard = 0 + protocol = "DATA" + delete PL + id = 0 + printf "\n" > filename + printf "<div class=\"sip\">Fragmented data</div>\n" > filename +} + /^MEGACO/ { discard = 0 + protocol = "MEGACO" + printf "\n" > filename } + { if (discard == 0) { @@ -92,7 +140,7 @@ gsub(">","\\>") gsub("<","\\<") - if (protocol == "SIP") { + if ((protocol == "SIP") || (protocol == "MEGACO")) { MARK = "no" # Abbreviated SIP messages @@ -106,6 +154,7 @@ if ($1 == "v:" ) MARK = "sip" # SIP messages + if ($0 ~ "MEGACO" ) MARK = "sip" if ($0 ~ "Session Initiation Protocol" ) MARK = "sip" if ($1 ~ "Accept:" ) MARK = "sip" if ($1 ~ "Alert-Info:" ) MARK = "sip" @@ -153,14 +202,31 @@ if ($0 ~ "Time Description, active time") MARK = "media" if (MARK == "sip") { - printf "<div class=\"sip\">%s</div>\n", $0 > filename; + printf "<div class=\"sip\">%s</div>\n", $0 > filename } else if (MARK == "media") { - printf "<div class=\"media\">%s</div>\n", $0 > filename; + printf "<div class=\"media\">%s</div>\n", $0 > filename } else { - print $0 > filename; + print $0 > filename } + + } else if (protocol == "DATA") { + + # Memorize the current PayLoad (PL) line, so it can be dumped + # in a raw data block later + PL[id] = $0 + id++ + + if ((length($1) == 4) && ($1 != "Data")) { + PAYLOAD = substr($0, 7, 50) + L = split(PAYLOAD, CHARS, " ") + for (i = 1; i <= L; i++) { + dec = hex2dec(CHARS[i]) + printf "%c", dec > filename + } + } + } else { print $0 > filename; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-11 13:06:59
|
Revision: 144 http://callflow.svn.sourceforge.net/callflow/?rev=144&view=rev Author: rbos Date: 2011-06-11 13:06:51 +0000 (Sat, 11 Jun 2011) Log Message: ----------- # BROWSER, the name of the browser to be used # Default value: firefox # Possible values are: firefox, konqueror, chromium, epiphany, opera BROWSER= # WEBSERVER_URL, in case callflow is run on a remote server and the # callflow # can be reached via a browser on the remote server, the URL can be # specified # here. Example: WEBSERVER_URL=http://call.flow.eg/~user/callflow WEBSERVER_URL= # WIDTH_BETWEEN_NODES, the distance between the adjacent nodes in the # callflow diagram.i # Default value = 200 # Minimun value = 100, Maximum value = 250, WIDTH_BETWEEN_NODES= # SIP_MSG_FONT_SIZE, font size for the SIP messages frame. # Default font size: small # Possible values are CSS defined font size values like small, medium, # large # All values are listed at e.g.: # http://www.w3schools.com/css/pr_font_font-size.asp SIP_MSG_FONT_SIZE= Modified Paths: -------------- callflow conf/callflow.conf css/callflow.css Modified: callflow =================================================================== --- callflow 2011-06-05 19:49:16 UTC (rev 143) +++ callflow 2011-06-11 13:06:51 UTC (rev 144) @@ -352,15 +352,24 @@ fi if [[ -z "$OPT_WIDTH_BETWEEN_NODES" ]]; then - WIDTH_BETWEEN_NODES=200 -else + if [[ -z "$WIDTH_BETWEEN_NODES" ]]; then + WIDTH_BETWEEN_NODES=200 + else + # In case the WIDTH_BETWEEN_NODES has been defined in the configuration + # file callflow.conf, prepare it to be verified. + OPT_WIDTH_BETWEEN_NODES=$WIDTH_BETWEEN_NODES + fi +fi + +if [[ -n "$OPT_WIDTH_BETWEEN_NODES" ]]; then + if [[ $OPT_WIDTH_BETWEEN_NODES -gt 250 ]]; then - echo "$PRGNAME: error: width between nodes too big" >&2 + echo "$PRGNAME: error: width ($OPT_WIDTH_BETWEEN_NODES) between nodes too big" >&2 exit 1 fi if [[ $OPT_WIDTH_BETWEEN_NODES -lt 100 ]]; then - echo "$PRGNAME: error: width between nodes too small" >&2 + echo "$PRGNAME: error: width ($OPT_WIDTH_BETWEEN_NODES) between nodes too small" >&2 exit 1 fi @@ -492,11 +501,13 @@ # Create Frames mkdir -p $DESTDIR/frames awk -f $SETUPDIR/scripts/long2html.awk -v destDir=$DESTDIR < $DESTDIR/callflow.long + for FILE in $SETUPDIR/css/callflow.css $HOME/.callflow/callflow.css callflow.css; do [[ -f $FILE ]] && STYLESHEET=$FILE done -cp $STYLESHEET $DESTDIR/frames +sed s/@SIP_MSG_FONT_SIZE@/${SIP_MSG_FONT_SIZE:-small}/ $STYLESHEET > $DESTDIR/frames/callflow.css + # Remove duplicate Frame if [ $removeDF = 1 ]; then #echo "Removing duplicate frames" @@ -657,11 +668,12 @@ echo " </body>" echo "</html>" ) > $DESTDIR/index_dynamic.html + + \rm imagemap #Copy JavaScript files into DESTDIR cp -af $SETUPDIR/js $DESTDIR/ - # (SIP) Messages will be presented in right frame sed 's/coords=/target=\"msg\" coords=/' $DESTDIR/index_frameless.html > $DESTDIR/graph.html @@ -701,8 +713,11 @@ echo echo "The output can be viewed with a browser: " -echo " ${BROWSER:=firefox} $DESTDIR/index.html" +if [[ -z "$WEBSERVER_URL" ]]; then + echo " ${BROWSER:=firefox} $DESTDIR/index.html" +else + echo " ${BROWSER:=firefox} $WEBSERVER_URL/$DESTDIR/index.html" +fi -\rm imagemap exit 0; Modified: conf/callflow.conf =================================================================== --- conf/callflow.conf 2011-06-05 19:49:16 UTC (rev 143) +++ conf/callflow.conf 2011-06-11 13:06:51 UTC (rev 144) @@ -19,6 +19,28 @@ # This filter is used as well as a DISPLAY filter in tshark/wireshark. FILTER="sip or diameter or isup or megaco" +# BROWSER, the name of the browser to be used +# Default value: firefox +# Possible values are: firefox, konqueror, chromium, epiphany, opera +BROWSER= + +# WEBSERVER_URL, in case callflow is run on a remote server and the callflow +# can be reached via a browser on the remote server, the URL can be specified +# here. Example: WEBSERVER_URL=http://call.flow.eg/~user/callflow +WEBSERVER_URL= + +# WIDTH_BETWEEN_NODES, the distance between the adjacent nodes in the +# callflow diagram.i +# Default value = 200 +# Minimun value = 100, Maximum value = 250, +WIDTH_BETWEEN_NODES= + +# SIP_MSG_FONT_SIZE, font size for the SIP messages frame. +# Default font size: small +# Possible values are CSS defined font size values like small, medium, large +# All values are listed at e.g.: http://www.w3schools.com/css/pr_font_font-size.asp +SIP_MSG_FONT_SIZE= + # Duplicate packet removal: # # REMOVE_DUP_MODE, how aggressive should callflow be with respect to removing Modified: css/callflow.css =================================================================== --- css/callflow.css 2011-06-05 19:49:16 UTC (rev 143) +++ css/callflow.css 2011-06-11 13:06:51 UTC (rev 144) @@ -34,7 +34,7 @@ pre.msg { color: #1f1f1f; - font-size: small; + font-size: @SIP_MSG_FONT_SIZE@; } div.sip { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-05 19:49:22
|
Revision: 143 http://callflow.svn.sourceforge.net/callflow/?rev=143&view=rev Author: rbos Date: 2011-06-05 19:49:16 +0000 (Sun, 05 Jun 2011) Log Message: ----------- - First check that the Max time delta is not passed. - Added warnings for the algorithm's that are deprecated Modified Paths: -------------- scripts/removedups.sh Modified: scripts/removedups.sh =================================================================== --- scripts/removedups.sh 2011-06-05 19:39:47 UTC (rev 142) +++ scripts/removedups.sh 2011-06-05 19:49:16 UTC (rev 143) @@ -1,7 +1,7 @@ #!/bin/bash # script to be called with these arguments: # removedups.sh DESTDIR FRAMEDIR TMPDIR MODE -# MODE: REMOVE_MIRROR_DUPS, REMOVE_ALL_DUPS +# MODE: REMOVE_MIRROR_DUPS_2, REMOVE_MIRROR_DUPS, REMOVE_ALL_DUPS function mkmd5sum { grep -v "title" $1 | @@ -29,7 +29,7 @@ for i in Frame*html; do #echo $i >&2 MD5SUM=$(mkmd5sum $i) - N=${i##Frame} # ## is used to remove Frame from FrameXX.html (N is like XX.html) + N=${i##Frame} # ## is used to remove Frame from FrameXX.html (N is like XX.html) #echo $N >&2 sed "s/ -$//;s/^/${N%%.html} /" <<< $MD5SUM done | sort -n > $TMPDIR/md5sums.$$ @@ -37,8 +37,12 @@ if [[ $MODE = "REMOVE_MIRROR_DUPS" ]]; then - # This mode removes a package if the subsequent frames are the same. - # The package that is kept is the first one sent, the subsequent one is skipped + ( echo "$MODE is deprecated, may be removed in the future without notice," + echo " please use \"REMOVE_MIRROR_DUPS_2\" instead." + ) >&2 + + # This mode removes a frame if the prior and the current frame are the same. + # The frame kept is the first one sent, the current one is removed. # This is often encountered on traces that are obtained via port mirroring # on a router. @@ -70,8 +74,14 @@ elif [[ $MODE = "REMOVE_MIRROR_DUPS_2" ]]; then - sed -i 's/ /|/g' $TMPDIR/md5sums.$$ - join -t "|" --nocheck-order -1 3 $DESTDIR/callflow.short $TMPDIR/md5sums.$$ > $TMPDIR/md5sum-2.$$ + # The md5sum calculation has been performed before already. Do it + # here anyway again, as this "remove duplicated frames mode" seems to be + # the better one. The others may be removed, including the md5sum + # processing done above. + awk -F"|" '{print $3, $1}' $DESTDIR/callflow.short | while read FRAME TIME; do + MD5SUM=$(mkmd5sum $DESTDIR/frames/Frame${FRAME}.html | sed 's/ .*//') + echo "$FRAME|$TIME|$MD5SUM" + done > $TMPDIR/md5sums.$$ awk 'BEGIN { FS = "|" @@ -87,7 +97,7 @@ FRAME[NR] = $1 TIME[NR] = $2 - MD5SUM[NR] = $12 + MD5SUM[NR] = $3 } END { @@ -110,32 +120,41 @@ if (DEBUG) printf "DEBUG 1: i = %d, Frame = %d, Time = %s, MD5SUM = %s\n", i, FRAME[i], TIME[i], MD5SUM[i] if (DEBUG) printf "DEBUG 2: p = %d, Frame = %d, Time = %s, MD5SUM = %s\n", p, FRAME[p], TIME[p], MD5SUM[p] - if (MD5SUM[i] == MD5SUM[p]) { + # Time format is: 11:41:00.134538, use only the seconds (last part) + # The previous frame may have timestamp 11:40:59.921807 + # The delta in seconds (00.134538 - 59.921807) will be negative for + # those 2 frames, in this case add 60 seconds to it. + split(TIME[i], TC, ":") + split(TIME[p], TP, ":") + TIME_DELTA = TC[3] - TP[3] + if ( TIME_DELTA < 0 ) TIME_DELTA += 60 + if ( TIME_DELTA > MAX_TIME_DELTA ) CONT = 0 + if (DEBUG) printf "DEBUG 5: TC = %s, TP = %s, Delta = %s\n", TC[3], TP[3], TIME_DELTA + + if ( TIME_DELTA > MAX_TIME_DELTA ) { CONT = 0 - SEEN = "yes" + if (DEBUG) printf "DEBUG 9: STOP: passed time delta (%s)\n", MAX_TIME_DELTA } else { - DELTA++ - if ( DELTA > MAX_FRAME_DELTA ) { + if (MD5SUM[i] == MD5SUM[p]) { CONT = 0 + SEEN = "yes" + if (DEBUG) printf "DEBUG 6: STOP: not unique\n" } else { - p = i - DELTA + DELTA++ - if ( p < 1 ) { + if ( DELTA > MAX_FRAME_DELTA ) { CONT = 0 + if (DEBUG) printf "DEBUG 7: STOP: max frame delta (%s) reached\n", MAX_FRAME_DELTA } else { - # Time format is: 11:41:00.134538, use only the seconds (last part) - # The previous frame may have time stamp 11:40:59.921807 - # The delta in seconds (00.134538 - 59.921807) will be negative for - # those 2 frames, in this case add 60 seconds to it. - split(TIME[i], TC, ":") - split(TIME[p], TP, ":") - TIME_DELTA = TC[3] - TP[3] - if ( TIME_DELTA < 0 ) TIME_DELTA += 60 - if ( TIME_DELTA > MAX_TIME_DELTA ) CONT = 0 - if (DEBUG) printf "DEBUG 3: TC = %s, TP = %s, Delta = %s\n", TC[3], TP[3], TIME_DELTA + p = i - DELTA + + if ( p < 1 ) { + CONT = 0 + if (DEBUG) printf "DEBUG 8: STOP: previous frame array index < 1\n" + } } } } @@ -147,10 +166,14 @@ } } - }' $TMPDIR/md5sum-2.$$ > $TMPDIR/pckts.$$ + }' $TMPDIR/md5sums.$$ > $TMPDIR/pckts.$$ elif [[ $MODE = "REMOVE_ALL_DUPS" ]]; then + ( echo "$MODE is deprecated, may be removed in the future without notice," + echo " please use \"REMOVE_MIRROR_DUPS_2\" instead." + ) >&2 + # This mode removes any duplicate package it encounters.... for M in $(awk '{print $2}' $TMPDIR/md5sums.$$ | sort -u); do grep $M $TMPDIR/md5sums.$$ | head -1 @@ -200,6 +223,5 @@ #Remove temp files rm -f $TMPDIR/pckts.$$ rm -f $TMPDIR/md5sums.$$ -rm -f $TMPDIR/md5sums-2.$$ rm -f $TMPDIR/callflow.short.$$ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-05 19:39:53
|
Revision: 142 http://callflow.svn.sourceforge.net/callflow/?rev=142&view=rev Author: rbos Date: 2011-06-05 19:39:47 +0000 (Sun, 05 Jun 2011) Log Message: ----------- different wording in order file warning message Modified Paths: -------------- callflow Modified: callflow =================================================================== --- callflow 2011-06-05 13:01:00 UTC (rev 141) +++ callflow 2011-06-05 19:39:47 UTC (rev 142) @@ -539,7 +539,7 @@ #echo Using the following order: #cat $finalOrderFile else - echo "$PRGNAME: warning: order file not found -- using auto generated" + echo "$PRGNAME: warning: no \"order\" file found -- using auto generated" finalOrderFile=$TMPDIR/callflow.auto-uniq.$PPID fi This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-05 13:01:06
|
Revision: 141 http://callflow.svn.sourceforge.net/callflow/?rev=141&view=rev Author: rbos Date: 2011-06-05 13:01:00 +0000 (Sun, 05 Jun 2011) Log Message: ----------- - Alias are now listed in final callflow diagram if the file that defines the element or node names is found. - Add description for node names - Cleanup of manpage Modified Paths: -------------- callflow man/callflow.1 scripts/list-nodes.awk Modified: callflow =================================================================== --- callflow 2011-06-05 09:09:57 UTC (rev 140) +++ callflow 2011-06-05 13:01:00 UTC (rev 141) @@ -223,16 +223,20 @@ filter can be obtained from the tshark man page. A useful filter for SIP traffic is "sip". + --list-nodes, -o + List the unique nodes in the trace file + (Don't forget to redirect output in another file. + Example of use: $PRGNAME --list-nodes capture.cap > order) + --no-loops Prevent flows from and to the same equipment to be represented. --no-time Do not show the time. - --list-nodes, -o - List the unique nodes in the trace file - (Don't forget to redirect output in another file. - Example of use: $PRGNAME --list-nodes capture.cap > order) + --nodenames + A file containing the element or node names that belong to the + addresses shown in the callflow. --refresh-cache Refresh the contents of the callflow.short and callflow.long @@ -260,7 +264,7 @@ # Command line argument parsing, the allowed arguments are # alphabetically listed, keep it this way please. -LOPT="capture-filter:,help,list-nodes,no-loops,no-time,refresh-cache" +LOPT="capture-filter:,help,list-nodes,no-loops,no-time,nodenames:,refresh-cache" LOPT="$LOPT,remove-duplicate-frames,title:,width-between-nodes:,version" # Note that we use `"$@"' to let each command-line parameter expand to a @@ -298,6 +302,9 @@ OPT_SHOW_TIME=no #echo " * Time will not be shown" ;; + --nodenames) + OPT_NODENAMES=$2; shift + ;; --refresh-cache) OPT_REFRESH_CACHE=yes ;; @@ -360,6 +367,15 @@ WIDTH_BETWEEN_NODES=$OPT_WIDTH_BETWEEN_NODES fi +[[ -n "$OPT_NODENAMES" ]] && { + if [[ -f "$OPT_NODENAMES" ]]; then + NODENAMES="$OPT_NODENAMES" + else + echo "$PRGNAME: error: nodenames file does not exist (--nodenames)" >&2 + exit 1 + fi +} + if [[ -z "$OPT_SHOW_TIME" ]]; then SHOW_TIME=yes else @@ -415,11 +431,19 @@ # order file ################################## # Build the order file and exit +[[ -z "$NODENAMES" ]] && { + for FILE in $HOME/.callflow/nodenames.conf nodenames.conf; do + if [[ -f $FILE ]]; then + NODENAMES=$FILE + fi + done +} + if [[ $ORDER = 1 ]]; then [[ $USE_CACHE == "no" ]] && make_long_and_short_caches - awk -f $SETUPDIR/scripts/list-nodes.awk $DESTDIR/callflow.short + awk -f $SETUPDIR/scripts/list-nodes.awk -v NODENAMES=$NODENAMES $DESTDIR/callflow.short exit 0 fi @@ -485,7 +509,8 @@ # common ################################## # Compute nodes -awk -f $SETUPDIR/scripts/list-nodes.awk $DESTDIR/callflow.short > $TMPDIR/callflow.auto-uniq.$PPID +awk -f $SETUPDIR/scripts/list-nodes.awk -v NODENAMES=$NODENAMES \ + $DESTDIR/callflow.short > $TMPDIR/callflow.auto-uniq.$PPID # orderFile if [ $orderFile != none ]; then Modified: man/callflow.1 =================================================================== --- man/callflow.1 2011-06-05 09:09:57 UTC (rev 140) +++ man/callflow.1 2011-06-05 13:01:00 UTC (rev 141) @@ -1,4 +1,4 @@ -.TH CALLFLOW 1 "2010/04/22" callflow "callflow - Sequence Diagram Generator" +.TH CALLFLOW 1 "2011/06/05" callflow "callflow - Sequence Diagram Generator" .SH NAME @@ -14,6 +14,7 @@ .SS Using callflow With callflow in your path, just type: callflow capture-file.cap +.sp 0 (see below for more options) This will produce a directory named like your capture file in your working directory (eg: if file is capture-file.cap, the directory will be capture-file). @@ -57,7 +58,7 @@ .BI -f " filter" .TP .PD -.BI --cap-filter " filter" +.BI --capture-filter " filter" A filter can be used to show only those frames that match the given filter criteria. This filter is for traces that have been captured with programs such as wireshark, snoop, tcpdump, thsark and the like. Callflow uses tshark's DISPLAY filter functionality to filter the trace. More information about tshark's DISPLAY filter can be obtained from the tshark man page. A useful filter for SIP traffic is "sip". .TP @@ -66,7 +67,7 @@ .TP .PD .B --list-nodes -List the unique nodes in the trace file (don't forget to redirect output in another file. Example of use: callflow --list-nodes capture.cap > order). +List the unique nodes in the trace file (don't forget to redirect output in another file. Example of use: callflow --list-nodes capture.cap > order). See the description of the file \fIorder\fR in the \fIfiles\fR section. .TP .PD 0 @@ -80,6 +81,20 @@ .TP .PD 0 +.B --nodenames <filename> +A file containing the element or node names that belong to the +addresses shown in the callflow. The file is space separated, the first column +contains the IP address of the node the rest of the line is the node alias. +E.g.: +.sp 0 +10.10.20.30 Subscriber A +.sp 0 +10.20.100.111 Asterisk +.sp 0 +See the description of the file \fInodenames.conf\fR in the \fIfiles\fR section. + +.TP +.PD 0 .B -d .TP .PD @@ -92,17 +107,11 @@ Specify the title of the callflow. If not specified the file name containing the trace will be used. .TP -.PD 0 -.B -t -.TP -.PD 0 -.B -c -.TP .PD -.B --use-cache +.B --refresh-cache Use callflow and callflow.long files from FILE directory. .sp 0 -Note 1: if -t and --remove-duplicate-frames are used, only -t is executed. +Note 1: if --refresh-cache and --remove-duplicate-frames are used, only --refresh-cache is executed. .sp 0 Note 2: this option sould not be selected on the first run. @@ -156,7 +165,7 @@ Duplicates are determined by examining each line in foo, and comparing frames/Frame<#>.html with all previously seen frames. .SS "Session ID" to Sequence Lines -Callflow colors every frame based on the specific pattern: 'Call-Id:' or 'i:' (for abbreviated SIP messages. +Callflow colors every frame based on the specific pattern: 'Call-Id:' or 'i:' (for abbreviated SIP messages). .SH TWEAKING TSHARK PREFERENCE @@ -273,12 +282,18 @@ .SH "FILES" +.SS callflow.conf The system-wide configuration file \fI/etc/callflow.conf\fR, and the personal ones \fI$HOME/.callflow.conf\fR and \fIcallflow.conf\fR are used by callflow. If the system-wide configuration file exists, it is read first, overriding the default settings. If the personal configuration files exists, they are read next, overriding any previous values. +.SS order +The file order is expected in the current working directory, and determines the order of the nodes in the callflow. +.SS nodenames.conf +The file nodenames.conf is expected in respectively $HOME/.callflow, the current working directory or the file can be defined with the argument --nodenames. The last nodenames.conf file (or the file specified with --nodenames) found will be used. + .SH TO DO It would be much nicer to take the tshark filtered output and build an intermediate XML representation of it. Then use XSLT to transform it into the SVG file. This way you could write up illustrative sequence diagrams more easily and make use of more tools that can manipulate XML. Modified: scripts/list-nodes.awk =================================================================== --- scripts/list-nodes.awk 2011-06-05 09:09:57 UTC (rev 140) +++ scripts/list-nodes.awk 2011-06-05 13:01:00 UTC (rev 141) @@ -55,9 +55,24 @@ } } END { + + # Create an array with node names, the index is the IP address of the node + if (NODENAMES != "") { + while ( getline < NODENAMES > 0 ) { + sub(" ", "|") + NAMES[$1] = $2 + } + } + MAX = length(POS) for (i=0; i < MAX; i++) { - print DEVICES[i], POS[i] + if (POS[i] in NAMES) { + ID = POS[i] + ALIAS = NAMES[ID] + } else { + ALIAS = POS[i] + } + print DEVICES[i], ALIAS } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-05 09:10:03
|
Revision: 140 http://callflow.svn.sourceforge.net/callflow/?rev=140&view=rev Author: rbos Date: 2011-06-05 09:09:57 +0000 (Sun, 05 Jun 2011) Log Message: ----------- correct REMOVE_DUP_MODE to REMOVE_MIRROR_DUPS_2 Modified Paths: -------------- conf/callflow.conf Modified: conf/callflow.conf =================================================================== --- conf/callflow.conf 2011-06-05 09:03:25 UTC (rev 139) +++ conf/callflow.conf 2011-06-05 09:09:57 UTC (rev 140) @@ -37,7 +37,7 @@ # # REMOVE_ALL_DUPS: # remove any duplicate frame in trace -REMOVE_DUP_MODE="REMOVE_ALL_DUPS_2" +REMOVE_DUP_MODE="REMOVE_MIRROR_DUPS_2" #END This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-05 09:03:31
|
Revision: 139 http://callflow.svn.sourceforge.net/callflow/?rev=139&view=rev Author: rbos Date: 2011-06-05 09:03:25 +0000 (Sun, 05 Jun 2011) Log Message: ----------- - Added new remove duplicate mode This one will remove duplicate frames when the same frame is seen in a window of max 0.5 seconds or max 5 frames prior to the current frame. - list-nodes now groups the same IP addresses on the same line in the order that the IP address appears in the trace file. The IP address is used as alias for all the IP address / port combinatons - Some small changes to the manual page Modified Paths: -------------- README conf/callflow.conf man/callflow.1 scripts/list-nodes.awk scripts/removedups.sh Modified: README =================================================================== --- README 2011-06-03 07:11:44 UTC (rev 138) +++ README 2011-06-05 09:03:25 UTC (rev 139) @@ -25,9 +25,7 @@ In this, you will find at least: - callflow.svg file, - callflow.png file, - - index.html file, - - index_dynamic.html file, - - index_with_frames.html file, + - several index.html files, - graph.html file, - frames directory with FrameX.html files inside. @@ -106,10 +104,7 @@ ===================================== By default, callflow colors every frame based on a specific pattern: 'Call-Id:'. This pattern is a header followed by an identifier that indicates which "SIP dialog" this packet belongs to. Callflow can use the same color for all flows that have the same identifier. -You can change the pattern by using the --session-token option: -callflow --session-token capture-file.cap; - Tweaking ~/.wireshark/preferences for frames/Frame*.html ======================================================= @@ -119,7 +114,7 @@ tcp.tcp_summary_in_tree udp.udp_summary_in_tree -If any of these items are set to TRUE, then only the summary line will appear in frames/Frame*.html. Otherwise, the gory details will be displayed. +If any of these items are set to TRUE, then only the summary line will appear in frames/Frame*.html. Otherwise, the glory details will be displayed. Creating diagrams manually @@ -131,7 +126,7 @@ The first file (.short) contains the trace information, one transaction per line, in the following format: - <time>|<trace-filename>|<frame #>|<src node>|<src port>|<direction-sessionID>|<dest node>|<dest port>|<protocol>|<summary>|<remark> + <time>|<trace-filename>|<frame #>|<src node>|<src port>|<sessionID>|<dest node>|<dest port>|<protocol>|<summary>|<remark> For example: @@ -202,14 +197,10 @@ We will now use "mycapture/callflow.short" and "mycapture/callflow.long" text files for further processing: Remove retransmitted SIP packets: -$ callflow -d mycapture.cap +$ callflow --remove-duplicate-frames mycapture.cap -Add "Session ID" to Sequence Lines: -$ echo "Call-Id:" > session -$ callflow -s mycapture.cap - Add any desired comments to callflow, then regenerate diagram (repeat as needed): -$ callflow -t mycapture.cap +$ callflow mycapture.cap How it works @@ -217,7 +208,7 @@ Well, this is kind of ugly: - a. check for order, session, title, filter files + a. look for the order file b. run tshark twice to get short and long output files c. use long2html.awk to convert long output file into frame*.html files d. get all the unique nodes from the short output file @@ -257,3 +248,4 @@ Authors ======= see AUTHORS file provided with this package. + Modified: conf/callflow.conf =================================================================== --- conf/callflow.conf 2011-06-03 07:11:44 UTC (rev 138) +++ conf/callflow.conf 2011-06-05 09:03:25 UTC (rev 139) @@ -19,11 +19,25 @@ # This filter is used as well as a DISPLAY filter in tshark/wireshark. FILTER="sip or diameter or isup or megaco" +# Duplicate packet removal: +# # REMOVE_DUP_MODE, how aggressive should callflow be with respect to removing -# duplicate frames. There are 2 modes: -# REMOVE_MIRROR_DUPS: remove duplicate frames in subsequent frames -# REMOVE_ALL_DUPS: remove any duplicate frame in trace -REMOVE_DUP_MODE="REMOVE_ALL_DUPS" +# duplicate frames. +# +# There are 3 modes: +# REMOVE_MIRROR_DUPS_2: +# remove frame if duplicate when the same frame is seen +# in 5 previous frames or in a window of max 0.5 seconds (the 5 frames have to +# be transmitted within the 0.5 seconds window). This mode can be compared +# to tshark's -d, -D and -w arguments. +# This is the most advanced remove duplicate frame mode, and adviced to be used +# +# REMOVE_MIRROR_DUPS: +# remove frame if prior frame is the same +# +# REMOVE_ALL_DUPS: +# remove any duplicate frame in trace +REMOVE_DUP_MODE="REMOVE_ALL_DUPS_2" #END Modified: man/callflow.1 =================================================================== --- man/callflow.1 2011-06-03 07:11:44 UTC (rev 138) +++ man/callflow.1 2011-06-05 09:03:25 UTC (rev 139) @@ -176,7 +176,7 @@ The first file (.short) contains the trace information, one transaction per line, in the following format: - <time>|<trace-filename>|<frame #>|<src node>|<src port>|<direction-sessionID>|<dest node>|<dest port>|<protocol>|<summary>|<remark> + <time>|<trace-filename>|<frame #>|<src node>|<src port>|<sessionID>|<dest node>|<dest port>|<protocol>|<summary>|<remark> .I For example: @@ -245,16 +245,16 @@ .SS Remove retransmitted SIP packets: We will now use "mycapture/callflow.short" and "mycapture/callflow.long" text files for further processing: - $ callflow -d mycapture.cap + $ callflow --remove-duplicate-frames mycapture.cap .SS Add any desired comments to callflow, then regenerate diagram (repeat as needed): - $ callflow -t mycapture.cap + $ callflow mycapture.cap .SH HOW IT WORKS Well, this is kind of ugly: - a. check for order, session, title, filter files + a. look for the order files b. run tshark twice to get short and long output files c. use long2html.awk to convert long output file into frame*.html files d. get all the unique nodes from the short output file @@ -297,3 +297,4 @@ Man page created by Arnaud Morin <arn...@gm...>. See AUTHORS file provided with this package to see all project contributors. + Modified: scripts/list-nodes.awk =================================================================== --- scripts/list-nodes.awk 2011-06-03 07:11:44 UTC (rev 138) +++ scripts/list-nodes.awk 2011-06-05 09:03:25 UTC (rev 139) @@ -3,33 +3,61 @@ BEGIN { FS = "|" CNT = 0 + DEBUG = 0 } { if ($0 !~ "#" ) { - ADDRESS[0] = sprintf ("%s:%s", $4, $5) - ADDRESS[1] = sprintf ("%s:%s", $7, $8) + # IP address only + ADDRESS[0] = sprintf ("%s", $4) + ADDRESS[1] = sprintf ("%s", $7) - for (i=0; i <= 1; i++) { + # IP address with port + ADDRPRT[0] = sprintf ("%s:%s", $4, $5) + ADDRPRT[1] = sprintf ("%s:%s", $7, $8) + + for (i = 0; i <= 1; i++) { ADR = ADDRESS[i] - if (NODES[ADR] != 1) { + if (!(ADR in NODES)) { # The order in which the nodes appear is important, for this - # reason 2 arrays are used. The order is important to keep as - # it gives an indication how the SIP messages flow from one + # reason 2 arrays are used. The order is important to keep, + # as it gives an indication how the SIP messages flow from one # system to the other. - NODES[ADR] = 1 - ORDER[CNT] = ADDRESS[i] - # printf("Order: %s\nCNT: %s\n", ORDER[CNT], CNT) + NODES[ADR] = CNT + POS[CNT] = ADDRESS[i] + if (DEBUG) printf("Order: %s\nCNT: %s\n", POS[CNT], CNT) CNT++ } + + # Lookup whether the IP address + port have been seen before + POSITION = NODES[ADR] + if (DEBUG) printf("pos: %s\n", POSITION) + + L = split(DEVICES[POSITION], DEV, "|") + Found = 0 + for (j = 0; j <= L; j++) { + if (DEV[j] == ADDRPRT[i]) { + Found = 1 + break + } + } + + if (Found == 0) { + L = length(DEVICES[POSITION]) + if (L == 0 ) { + DEVICES[POSITION] = ADDRPRT[i] + } else { + DEVICES[POSITION] = ADDRPRT[i] "|" DEVICES[POSITION] + } + if (DEBUG) printf ("Fnd = 0: %s\n", DEVICES[POSITION]) + } } } } END { - MAX = length(ORDER) + MAX = length(POS) for (i=0; i < MAX; i++) { - print ORDER[i] + print DEVICES[i], POS[i] } - } Modified: scripts/removedups.sh =================================================================== --- scripts/removedups.sh 2011-06-03 07:11:44 UTC (rev 138) +++ scripts/removedups.sh 2011-06-05 09:03:25 UTC (rev 139) @@ -31,7 +31,7 @@ MD5SUM=$(mkmd5sum $i) N=${i##Frame} # ## is used to remove Frame from FrameXX.html (N is like XX.html) #echo $N >&2 - sed "s/-$//;s/^/${N%%.html} /" <<< $MD5SUM + sed "s/ -$//;s/^/${N%%.html} /" <<< $MD5SUM done | sort -n > $TMPDIR/md5sums.$$ ) @@ -68,12 +68,93 @@ }' $TMPDIR/md5sums.$$ > $TMPDIR/pckts.$$ +elif [[ $MODE = "REMOVE_MIRROR_DUPS_2" ]]; then + + sed -i 's/ /|/g' $TMPDIR/md5sums.$$ + join -t "|" --nocheck-order -1 3 $DESTDIR/callflow.short $TMPDIR/md5sums.$$ > $TMPDIR/md5sum-2.$$ + + awk 'BEGIN { + FS = "|" + DEBUG = 0 + + # In SIP the first retry can be after 0.5 seconds + MAX_TIME_DELTA = 0.5 + + # The number of previous frames to investigate + MAX_FRAME_DELTA = 5 + + } { + + FRAME[NR] = $1 + TIME[NR] = $2 + MD5SUM[NR] = $12 + + } END { + + # The first frame can always be printed + if (DEBUG) print FRAME[1], TIME[1], MD5SUM[1] + print FRAME[1] + + for (i = 2; i <= NR; i++) { + + if (DEBUG) print "NEW: i =", i + + # p: previous frame + DELTA = 1 + p = i - DELTA + + SEEN = "no" + CONT = 1 + while (CONT) { + + if (DEBUG) printf "DEBUG 1: i = %d, Frame = %d, Time = %s, MD5SUM = %s\n", i, FRAME[i], TIME[i], MD5SUM[i] + if (DEBUG) printf "DEBUG 2: p = %d, Frame = %d, Time = %s, MD5SUM = %s\n", p, FRAME[p], TIME[p], MD5SUM[p] + + if (MD5SUM[i] == MD5SUM[p]) { + CONT = 0 + SEEN = "yes" + } else { + DELTA++ + + if ( DELTA > MAX_FRAME_DELTA ) { + CONT = 0 + } else { + + p = i - DELTA + + if ( p < 1 ) { + CONT = 0 + } else { + + # Time format is: 11:41:00.134538, use only the seconds (last part) + # The previous frame may have time stamp 11:40:59.921807 + # The delta in seconds (00.134538 - 59.921807) will be negative for + # those 2 frames, in this case add 60 seconds to it. + split(TIME[i], TC, ":") + split(TIME[p], TP, ":") + TIME_DELTA = TC[3] - TP[3] + if ( TIME_DELTA < 0 ) TIME_DELTA += 60 + if ( TIME_DELTA > MAX_TIME_DELTA ) CONT = 0 + if (DEBUG) printf "DEBUG 3: TC = %s, TP = %s, Delta = %s\n", TC[3], TP[3], TIME_DELTA + } + } + } + } + + if (SEEN == "no") { + if (DEBUG) print "UNIQUE:", FRAME[i], TIME[i], MD5SUM[i] + print FRAME[i] + } + } + + }' $TMPDIR/md5sum-2.$$ > $TMPDIR/pckts.$$ + elif [[ $MODE = "REMOVE_ALL_DUPS" ]]; then # This mode removes any duplicate package it encounters.... for M in $(awk '{print $2}' $TMPDIR/md5sums.$$ | sort -u); do grep $M $TMPDIR/md5sums.$$ | head -1 - done | awk '{print $1}' | sort -n > $TMPDIR/pckts.$$ + done | awk '{print $1}' | sort -n > $TMPDIR/pckts.$$ else echo "error: unknow mode: \"$MODE\"" >&2 @@ -117,7 +198,8 @@ }' >&2 #Remove temp files +rm -f $TMPDIR/pckts.$$ rm -f $TMPDIR/md5sums.$$ -rm -f $TMPDIR/pckts.$$ +rm -f $TMPDIR/md5sums-2.$$ rm -f $TMPDIR/callflow.short.$$ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-06-03 07:11:51
|
Revision: 138 http://callflow.svn.sourceforge.net/callflow/?rev=138&view=rev Author: rbos Date: 2011-06-03 07:11:44 +0000 (Fri, 03 Jun 2011) Log Message: ----------- - Based the session information on the tshark output of sip.Call-ID this includes the SIP headers Call-ID abd 'i' (for abbreviated SIP messages) - Because of this change the option to configure the Call-ID has been removed (from callflow, callflow.conf and the man page) Modified Paths: -------------- callflow conf/callflow.conf man/callflow.1 scripts/callflow.awk Modified: callflow =================================================================== --- callflow 2011-05-28 12:40:21 UTC (rev 137) +++ callflow 2011-06-03 07:11:44 UTC (rev 138) @@ -15,7 +15,6 @@ removeDF=0 # do not remove duplicate frames ORDER=0 # do not build order file localLoop=1 # take into account flows from and to the same element (rounded flows) -WITH_SESSION=yes readonly VersionSVN="$Id$"; #DO NOT EDIT THIS LINE BY HAND, DATE IS AUTOMATICALLY ADDED BY SUBVERSION readonly PRGVRSN=$(awk '{split($4, A, "-"); print A[1] A[2] A[3] "." $3}' <<< "$VersionSVN") readonly PRGNAME=$(basename $0) @@ -70,52 +69,128 @@ tshark -r $inputfile $FARG "$FVAL" -V > $DESTDIR/callflow.long + # Create a datafile with the data needed to create the callflow. + # This is done in 2 steps, because of the following reasons: the tshark command + # with the '-T fields' argument, provides the IP addresses and SIP CSeq and Call-ID + # data. Some additional information about the Call-ID; this field can show up + # in (at least) 2 ways in SIP messages. The field can indeed be called "Call-ID", + # but just "i" in abbreviated SIP messages! Both formats can be used in 1 call. + tshark -r $inputfile $FARG "$FVAL" -t a -T fields -E separator='|' \ + -e frame.number -e ip.src -e ip.dst -e sip.CSeq -e sip.Call-ID | awk ' + BEGIN { + FS = "|" + OFS = "|" + NOC = 1 # Number Of Call-IDs + } + { + # Map the often very long Call-IDs to a short index, with only 1 or 2 digits + if (( $5 != "" ) && ( CALLID[$5] == "" )) { + CALLID[$5] = NOC + NOC++ + } + + printf "%s||%s|%s|%s|{%s}\n", $1, $2, $3, $4, CALLID[$5] + + }' > $TMPDIR/${PRGNAME}-tshark-1.$$ + + # The second step in getting SIP data required by callflow. This step delivers + # the source and destination ports independent whether the datagram is UDP or + # TCP based. As SIP can be delivered over UDP or TCP using this tshark command + # seems to be good choice. Further more this command delivers the frame information + # (summary), that can not be obtained with tshart '-T fields' command above. + # + # For messages containing ISUP payload this step could deliver the IP addresses + # when using % variables %ns and %nd (network source and destination). If the + # % variables %s and %d are used the highest source and destination addresses are + # used, in case of ISUP message that are the OPC and DPC data, for details see + # wireshark bug 5969. + # + # The available % variables can be found at: + # http://anonsvn.wireshark.org/viewvc/trunk/epan/column.c?view=markup + # + # Information about the stream editor (sed) manipulations: # - The string (ITU) shows up in the protocol description "ISUP(ITU)". # awk doesn't like the "(" and ")", hence remove them. - # - Megaco has "with session description" in its info string, shorten - # this to just SDP. + # - Short the string "with session description" to just SDP. # - Megaco has a "|" in its info sting, this character is however the # field separator in the output file, remove it. The actual string # being removed is " |=". tshark -r $inputfile $FARG "$FVAL" -t a \ - -o 'column.format: "No.", "%m", "Time", "%t", "Src", "%s", "Port", "%S", "Ignored", "%m", "Dest", "%d", "Port", "%D", "Protocol", "%p", "Info", "%i"' | - sed 's/^[[:blank:]]*//; - s/\([0-9]\{3\}\)000 /\1 /; - s/with session description/SDP/g; - s/[[:blank:]]*|=/ /; - s/(ITU)//' | awk '{ + -o 'column.format: "No.", "%m", "Time", %t, "Protocol", "%p", "srcport", %S, "dstport", %D, "Info", "%i"' | + sed -e 's/^[[:blank:]]*//' \ + -e 's/[[:blank:]]*|=/=/' \ + -e 's/ Status: / /' \ + -e 's/ Request: / /' \ + -e 's/(ITU)//' \ + -e 's/with session description/SDP/g' | awk '{ - # The match and the substr are working together to get the string starting - # at field 9 till the end of the line. This provides the frame summary line. - # But the frame summary may contain characters that influence the match, - # such as the "(" and ")" characters. Therefor look for the end of the - # protocol field (8) as the protocol field contains most likely regular - # ascii characters. + split($0, A, " ") - # The A[0, "start"] gives the start position of the $8 - match($0, $8, A) - SUMMARY_START = A[0, "start"] + length($8) + 1 - SUMMARY = substr($0, SUMMARY_START) - printf("%s|%s|%s|%s||%s|%s|%s|%s\n", $1, $2, $3, $4, $6, $7, $8, SUMMARY) + for (i = 1; i <= 5; i++) { + printf "%s|", $i + } - }' > $TMPDIR/${PRGNAME}-tshark-1.$$ + L = length(A) + for (i = 6; i < L; i++) { + printf "%s ", $i + } - tshark -r $inputfile $FARG "$FVAL" -t a \ - -o 'column.format: "No.", "%m", "Cseq", "%Cus:sip.CSeq"' | - sed 's/^[[:blank:]]*//;s/ /|/' > $TMPDIR/${PRGNAME}-tshark-2.$$ + printf "%s\n", $L - ( # echo "time|no|trace|src|srcport|dir|dst|dstport|prot|summary|remark" - join -t "|" --nocheck-order $TMPDIR/${PRGNAME}-tshark-1.$$ $TMPDIR/${PRGNAME}-tshark-2.$$ | awk -F "|" '{ - printf("%s||%s|", $2, $1) - for ( N = 3; N < NF; N++) { - printf("%s|", $N) - } - printf("%s\n", $N) - }' - ) > $DESTDIR/callflow.short + }' > $TMPDIR/${PRGNAME}-tshark-2.$$ + + # Join the 2 datafiles that have been obtained above together + join -t "|" --nocheck-order $TMPDIR/${PRGNAME}-tshark-1.$$ $TMPDIR/${PRGNAME}-tshark-2.$$ > $TMPDIR/${PRGNAME}-tshark-3.$$ - rm $TMPDIR/${PRGNAME}-tshark-1.$$ $TMPDIR/${PRGNAME}-tshark-2.$$ + # Order the fields + awk 'BEGIN { + FS = "|" + # The order in which the fields will be arranged in the output file + # 1: time + # 2: tracefile + # 3: frame.number + # 4: ip.src + # 5: ip.srcport + # 6: session information + # 7: ip.dst + # 8: ip.dstport + # 9: protocol + # 10: info field + # 11: SIP CSeq + + # The array (A) that the 'split' command creates, maps the input fields + # to the output file order. As example: input field 7 is mapped to + # output field 1 and input field 5 is mapped to output field 11. + split("7 2 1 3 9 6 4 10 8 11 5", A, " ") + } + { + # Look for "200 OK" or "200 Ok" and add the SIP method, from the + # call sequence field to the 200 OK message. + # + # Attention: use the input fields values and not the ones mentioned in + # the BEGIN part. + # - $5 contains the sip.CSeq data. + # - $8 contains the protocol + # - $11 contains the info field data. + if (($8 ~ "SIP") && ($11 ~ "200 O")) { + # split the call sequence message (#ID SIP_method) + split($5, S, " ") + $11 = sprintf("%s (%s)", $11, S[2]) + } + + # Perform the actual mapping of the input to the output fields + L = length(A) + for (i = 1; i < L; i++) { + printf "%s|", $A[i] + } + + printf "%s\n", $A[L] + + }' $TMPDIR/${PRGNAME}-tshark-3.$$ > $DESTDIR/callflow.short + + rm $TMPDIR/${PRGNAME}-tshark-[123].$$ + TRACE_FILE=$(basename $inputfile) MD5SUM=$(md5sum $inputfile | awk '{print $1}') echo "$TRACE_FILE|$MD5SUM|$FVAL" > $DESTDIR/metadb @@ -151,10 +226,6 @@ --no-loops Prevent flows from and to the same equipment to be represented. - --no-session-token - Disable the session detection (show ID and colorization), for more - information see the --session-token argument. - --no-time Do not show the time. @@ -173,16 +244,6 @@ Remove duplicate frames while computing. This option should not be selected on the first run. - --session-token <session> - Add a session ID to sequence lines and color lines related - to this session ID. - This option is available by default and the value is - 'Call-Id:' (depending on your callflow configuration). - You should use this option in order to overwrite the default - value. - If you want to disable the session detection (show ID and - colorization), you should use: --no-session-token. - --title <title> Use <title> as title in the callflow. If not specified the name of file containing the trace will be used instead. Surround @@ -199,8 +260,8 @@ # Command line argument parsing, the allowed arguments are # alphabetically listed, keep it this way please. -LOPT="capture-filter:,help,list-nodes,no-loops,no-session-token,no-time,refresh-cache" -LOPT="$LOPT,remove-duplicate-frames,session-token:,title:,width-between-nodes:,version" +LOPT="capture-filter:,help,list-nodes,no-loops,no-time,refresh-cache" +LOPT="$LOPT,remove-duplicate-frames,title:,width-between-nodes:,version" # Note that we use `"$@"' to let each command-line parameter expand to a # separate word. The quotes around `$@' are essential! @@ -233,9 +294,6 @@ noLocalLoop=1; #echo " * Flows from and to the same equipment will not be shown" ;; - --no-session-token) - WITH_SESSION=no - ;; --no-time) OPT_SHOW_TIME=no #echo " * Time will not be shown" @@ -248,14 +306,6 @@ removeDF=1 #echo " * Duplicate frames will be removed" ;; - --session-token) - SESSION="$2"; shift - if [[ -n "$SESSION" ]]; then - WITH_SESSION=yes - else - WITH_SESSION=no - fi - ;; --title) OPT_TITLE="$2"; shift #echo " * Title to use: $OPT_TITLE" @@ -431,13 +481,6 @@ mv $DESTDIR/callflow.short.new $DESTDIR/callflow.short fi -# Add session ID and colorization -if [[ $WITH_SESSION == "yes" ]]; then - awk -f $SETUPDIR/scripts/marksession.awk -v session_token="$SESSION" -v destDir=$DESTDIR < $DESTDIR/callflow.short > $DESTDIR/callflow.short.new - rm $DESTDIR/callflow.short - mv $DESTDIR/callflow.short.new $DESTDIR/callflow.short -fi - ################################## # common ################################## Modified: conf/callflow.conf =================================================================== --- conf/callflow.conf 2011-05-28 12:40:21 UTC (rev 137) +++ conf/callflow.conf 2011-06-03 07:11:44 UTC (rev 138) @@ -15,14 +15,10 @@ darkslategrey midnightblue maroon teal goldenrod gray darkolivegreen darkcyan brown peru mediumorchild navy saddlebrown coral" -# FILTER, used to filter flow, default "sip or diameter or isup or megaco" +# FILTER, used to filter flow, default "sip or diameter or isup or megaco" # This filter is used as well as a DISPLAY filter in tshark/wireshark. FILTER="sip or diameter or isup or megaco" -# SESSION, used to 'catch' session in trace file -# This session filter is used as a Regular Expression -SESSION="Call-Id:" - # REMOVE_DUP_MODE, how aggressive should callflow be with respect to removing # duplicate frames. There are 2 modes: # REMOVE_MIRROR_DUPS: remove duplicate frames in subsequent frames Modified: man/callflow.1 =================================================================== --- man/callflow.1 2011-05-28 12:40:21 UTC (rev 137) +++ man/callflow.1 2011-06-03 07:11:44 UTC (rev 138) @@ -74,12 +74,6 @@ Prevent flows from and to the same equipment to be represented. .TP -.PD -.B --no-session-token -Disable the session detection (show ID and colorization), for more information -see the --session-token argument. - -.TP .PD 0 .B --no-time Do not show the time. @@ -94,11 +88,6 @@ .TP .PD 0 -.BI --session-token "session" -Add a session ID to sequence lines and color lines related to this session ID. This option is enabled by default and the value is 'Call-Id:' (depending on your callflow configuration). You should use this option in order to overwrite the default value. If you want to disable the session detection (show ID and colorization), you should --no-session-token. - -.TP -.PD 0 .BI --title " title" Specify the title of the callflow. If not specified the file name containing the trace will be used. @@ -166,13 +155,10 @@ Duplicates are determined by examining each line in foo, and comparing frames/Frame<#>.html with all previously seen frames. -.SS Adding "Session ID" to Sequence Lines -By default, callflow colors every frame based on a specific pattern: 'Call-Id:'. This pattern is a header followed by an identifier that indicates which "SIP dialog" this packet belongs to. Callflow can use the same color for all flows that have the same identifier. +.SS "Session ID" to Sequence Lines +Callflow colors every frame based on the specific pattern: 'Call-Id:' or 'i:' (for abbreviated SIP messages. -You can change the pattern by using the --session-token option: -callflow --session-token capture-file.cap; - .SH TWEAKING TSHARK PREFERENCE You can change the level of detail provided in the "Internet Protocol", "User Datagram Protocol", and "Transmission Control Protocol" sections of the detailed frames/Frame*.html pages by tweaking the following entries in your ~/.wireshark/preferences: @@ -261,10 +247,6 @@ We will now use "mycapture/callflow.short" and "mycapture/callflow.long" text files for further processing: $ callflow -d mycapture.cap -.SS Add "Session ID" to Sequence Lines: - $ echo "Call-Id:" > session - $ callflow -s mycapture.cap - .SS Add any desired comments to callflow, then regenerate diagram (repeat as needed): $ callflow -t mycapture.cap Modified: scripts/callflow.awk =================================================================== --- scripts/callflow.awk 2011-05-28 12:40:21 UTC (rev 137) +++ scripts/callflow.awk 2011-06-03 07:11:44 UTC (rev 138) @@ -191,12 +191,7 @@ } printf ("</text>\n") - output = $9" "$10; - - gsub("SIP(/SDP|/XML|) *(Status|Request): *","", output); - gsub(", with session description *$"," w/SDP",output); - - line(x1,x2,y,output,c); + line(x1,x2,y,$10,c); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-05-28 12:40:27
|
Revision: 137 http://callflow.svn.sourceforge.net/callflow/?rev=137&view=rev Author: rbos Date: 2011-05-28 12:40:21 +0000 (Sat, 28 May 2011) Log Message: ----------- Some megaco improvements Modified Paths: -------------- callflow Modified: callflow =================================================================== --- callflow 2011-05-28 12:04:32 UTC (rev 136) +++ callflow 2011-05-28 12:40:21 UTC (rev 137) @@ -70,11 +70,21 @@ tshark -r $inputfile $FARG "$FVAL" -V > $DESTDIR/callflow.long - # The string (ITU) shows up in the protocol description "ISUP(ITU)". - # awk doesn't like the "(" and ")", hence remove them. + # - The string (ITU) shows up in the protocol description "ISUP(ITU)". + # awk doesn't like the "(" and ")", hence remove them. + # - Megaco has "with session description" in its info string, shorten + # this to just SDP. + # - Megaco has a "|" in its info sting, this character is however the + # field separator in the output file, remove it. The actual string + # being removed is " |=". tshark -r $inputfile $FARG "$FVAL" -t a \ -o 'column.format: "No.", "%m", "Time", "%t", "Src", "%s", "Port", "%S", "Ignored", "%m", "Dest", "%d", "Port", "%D", "Protocol", "%p", "Info", "%i"' | - sed 's/^[[:blank:]]*//;s/\([0-9]\{3\}\)000 /\1 /;s/(ITU)//' | awk '{ + sed 's/^[[:blank:]]*//; + s/\([0-9]\{3\}\)000 /\1 /; + s/with session description/SDP/g; + s/[[:blank:]]*|=/ /; + s/(ITU)//' | awk '{ + # The match and the substr are working together to get the string starting # at field 9 till the end of the line. This provides the frame summary line. # But the frame summary may contain characters that influence the match, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-05-28 12:04:38
|
Revision: 136 http://callflow.svn.sourceforge.net/callflow/?rev=136&view=rev Author: rbos Date: 2011-05-28 12:04:32 +0000 (Sat, 28 May 2011) Log Message: ----------- - Fix a bug caused by protocol ISUP in callflow - Change the default capture filter to include isup and megaco. - Add support for protocols ISUP and Megaco in long2html Modified Paths: -------------- callflow conf/callflow.conf scripts/long2html.awk Modified: callflow =================================================================== --- callflow 2011-05-26 21:49:13 UTC (rev 135) +++ callflow 2011-05-28 12:04:32 UTC (rev 136) @@ -70,9 +70,11 @@ tshark -r $inputfile $FARG "$FVAL" -V > $DESTDIR/callflow.long + # The string (ITU) shows up in the protocol description "ISUP(ITU)". + # awk doesn't like the "(" and ")", hence remove them. tshark -r $inputfile $FARG "$FVAL" -t a \ -o 'column.format: "No.", "%m", "Time", "%t", "Src", "%s", "Port", "%S", "Ignored", "%m", "Dest", "%d", "Port", "%D", "Protocol", "%p", "Info", "%i"' | - sed 's/^[[:blank:]]*//;s/\([0-9]\{3\}\)000 /\1 /' | awk '{ + sed 's/^[[:blank:]]*//;s/\([0-9]\{3\}\)000 /\1 /;s/(ITU)//' | awk '{ # The match and the substr are working together to get the string starting # at field 9 till the end of the line. This provides the frame summary line. # But the frame summary may contain characters that influence the match, Modified: conf/callflow.conf =================================================================== --- conf/callflow.conf 2011-05-26 21:49:13 UTC (rev 135) +++ conf/callflow.conf 2011-05-28 12:04:32 UTC (rev 136) @@ -15,9 +15,9 @@ darkslategrey midnightblue maroon teal goldenrod gray darkolivegreen darkcyan brown peru mediumorchild navy saddlebrown coral" -# FILTER, used to filter flow, default "sip or diameter" +# FILTER, used to filter flow, default "sip or diameter or isup or megaco" # This filter is used as well as a DISPLAY filter in tshark/wireshark. -FILTER="sip or diameter" +FILTER="sip or diameter or isup or megaco" # SESSION, used to 'catch' session in trace file # This session filter is used as a Regular Expression @@ -27,7 +27,7 @@ # duplicate frames. There are 2 modes: # REMOVE_MIRROR_DUPS: remove duplicate frames in subsequent frames # REMOVE_ALL_DUPS: remove any duplicate frame in trace -REMOVE_DUP_MODE=REMOVE_ALL_DUPS +REMOVE_DUP_MODE="REMOVE_ALL_DUPS" #END Modified: scripts/long2html.awk =================================================================== --- scripts/long2html.awk 2011-05-26 21:49:13 UTC (rev 135) +++ scripts/long2html.awk 2011-05-28 12:04:32 UTC (rev 136) @@ -1,5 +1,5 @@ BEGIN{ - first = 1; + first = 1 } /^Frame [0-9]+: (.*)/ { @@ -35,55 +35,65 @@ getline gsub("^ *", "") print $0 >filename; - discard = 1; + + discard = 1 + protocol = "" } /^Internet Protocol,/ { - print $0 >filename; - discard = 1; + print $0 >filename + discard = 1 } /^Internet Protocol$/ { - discard = 0; + discard = 0 } /^User Datagram Protocol,/ { - print $0 >filename; - discard = 1; + print $0 >filename + discard = 1 } /^User Datagram Protocol$/ { - discard = 0; + discard = 0 } /^Transmission Control Protocol,/ { - print $0 >filename; - discard = 1; + print $0 >filename + discard = 1 } /^Transmission Control Protocol$/ { - discard = 0; + discard = 0 } /^Internet Control Message Protocol/ { - discard = 0; + discard = 0 } /^Session Initiation Protocol/ { - discard = 0; + discard = 0 + protocol = "SIP" } /^Diameter Protocol/ { - discard = 0; + discard = 0 } /^WebSocket Protocol/ { - discard = 0; + discard = 0 } /^Hypertext Transfer Protocol/ { - discard = 0; + discard = 0 } /^Call Specification Language/ { - discard = 0; + discard = 0 } +/^Stream Control Transmission Protocol/ { + discard = 0 +} +/^MEGACO/ { + discard = 0 +} { - if (discard==0) - { - - gsub("&","\\&"); - gsub(">","\\>"); - gsub("<","\\<"); + if (discard == 0) { + gsub("&","\\&") + gsub(">","\\>") + gsub("<","\\<") + + if (protocol == "SIP") { + MARK = "no" # Abbreviated SIP messages if ($1 == "c:" ) MARK = "sip" @@ -151,7 +161,10 @@ } else { print $0 > filename; } + } else { + print $0 > filename; } + } } END { printf " </pre>\n" >filename This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-05-26 21:49:19
|
Revision: 135 http://callflow.svn.sourceforge.net/callflow/?rev=135&view=rev Author: rbos Date: 2011-05-26 21:49:13 +0000 (Thu, 26 May 2011) Log Message: ----------- Add Proxy-Authenticate as SIP tag Modified Paths: -------------- scripts/long2html.awk Modified: scripts/long2html.awk =================================================================== --- scripts/long2html.awk 2011-05-26 21:36:33 UTC (rev 134) +++ scripts/long2html.awk 2011-05-26 21:49:13 UTC (rev 135) @@ -114,6 +114,7 @@ if ($1 ~ "Min-SE:" ) MARK = "sip" if ($1 ~ "P-[A-Z][a-z].*:" ) MARK = "sip" if ($1 ~ "Privacy:" ) MARK = "sip" + if ($1 ~ "Proxy-Authenticate:" ) MARK = "sip" if ($1 ~ "RAck:" ) MARK = "sip" if ($1 ~ "Remote-Party-ID:" ) MARK = "sip" if ($1 ~ "Require:" ) MARK = "sip" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-05-26 21:36:39
|
Revision: 134 http://callflow.svn.sourceforge.net/callflow/?rev=134&view=rev Author: rbos Date: 2011-05-26 21:36:33 +0000 (Thu, 26 May 2011) Log Message: ----------- - The remove duplicate frame mode can now be controlled with a setting in callflow.conf. The setting is REMOVE_DUP_MODE. For now the default is REMOVE_ALL_DUPS, but that will most likely change to REMOVE_MIRROR_DUPS in the future - Don't show the nodes in alphabetical order when there is no order file, but show them in the order they appear in the trace - Mark some more SIP tags, among them are abbreviated SIP tags. Modified Paths: -------------- callflow conf/callflow.conf scripts/long2html.awk Modified: callflow =================================================================== --- callflow 2011-05-24 21:55:49 UTC (rev 133) +++ callflow 2011-05-26 21:36:33 UTC (rev 134) @@ -414,7 +414,7 @@ # Remove duplicate Frame if [ $removeDF = 1 ]; then #echo "Removing duplicate frames" - $SETUPDIR/scripts/removedups.sh $DESTDIR $DESTDIR/frames $TMPDIR REMOVE_ALL_DUPS + $SETUPDIR/scripts/removedups.sh $DESTDIR $DESTDIR/frames $TMPDIR ${REMOVE_DUP_MODE:-REMOVE_ALL_DUPS} rm $DESTDIR/callflow.short mv $DESTDIR/callflow.short.new $DESTDIR/callflow.short fi @@ -430,8 +430,7 @@ # common ################################## # Compute nodes -awk -F"|" '{ if ($0 !~ "^#") { printf("%s:%s\n%s:%s\n", $4, $5, $7, $8) }}' $DESTDIR/callflow.short | - sort -u > $TMPDIR/callflow.auto-uniq.$PPID +awk -f $SETUPDIR/scripts/list-nodes.awk $DESTDIR/callflow.short > $TMPDIR/callflow.auto-uniq.$PPID # orderFile if [ $orderFile != none ]; then @@ -460,7 +459,7 @@ #echo Using the following order: #cat $finalOrderFile else - echo "$PRGNAME: warning: order file not found -- using alphabetical" + echo "$PRGNAME: warning: order file not found -- using auto generated" finalOrderFile=$TMPDIR/callflow.auto-uniq.$PPID fi Modified: conf/callflow.conf =================================================================== --- conf/callflow.conf 2011-05-24 21:55:49 UTC (rev 133) +++ conf/callflow.conf 2011-05-26 21:36:33 UTC (rev 134) @@ -23,4 +23,11 @@ # This session filter is used as a Regular Expression SESSION="Call-Id:" +# REMOVE_DUP_MODE, how aggressive should callflow be with respect to removing +# duplicate frames. There are 2 modes: +# REMOVE_MIRROR_DUPS: remove duplicate frames in subsequent frames +# REMOVE_ALL_DUPS: remove any duplicate frame in trace +REMOVE_DUP_MODE=REMOVE_ALL_DUPS + #END + Modified: scripts/long2html.awk =================================================================== --- scripts/long2html.awk 2011-05-24 21:55:49 UTC (rev 133) +++ scripts/long2html.awk 2011-05-26 21:36:33 UTC (rev 134) @@ -85,8 +85,20 @@ gsub("<","\\<"); MARK = "no" + # Abbreviated SIP messages + if ($1 == "c:" ) MARK = "sip" + if ($1 == "f:" ) MARK = "sip" + if ($1 == "i:" ) MARK = "sip" + if ($1 == "k:" ) MARK = "sip" + if ($1 == "l:" ) MARK = "sip" + if ($1 == "m:" ) MARK = "sip" + if ($1 == "t:" ) MARK = "sip" + if ($1 == "v:" ) MARK = "sip" + + # SIP messages if ($0 ~ "Session Initiation Protocol" ) MARK = "sip" if ($1 ~ "Accept:" ) MARK = "sip" + if ($1 ~ "Alert-Info:" ) MARK = "sip" if ($1 ~ "Allow:" ) MARK = "sip" if ($1 ~ "Allow-Events:" ) MARK = "sip" if ($0 ~ "Call-ID:" ) MARK = "sip" @@ -99,7 +111,7 @@ if ($1 ~ "Date:" ) MARK = "sip" if ($1 ~ "Expires:" ) MARK = "sip" if ($1 ~ "From:" ) MARK = "sip" - if ($1 ~ "From:" ) MARK = "sip" + if ($1 ~ "Min-SE:" ) MARK = "sip" if ($1 ~ "P-[A-Z][a-z].*:" ) MARK = "sip" if ($1 ~ "Privacy:" ) MARK = "sip" if ($1 ~ "RAck:" ) MARK = "sip" @@ -116,6 +128,7 @@ if ($1 ~ "User-Agent:" ) MARK = "sip" if ($1 ~ "Via:" ) MARK = "sip" + # SDP part if ($0 ~ "Session Description Protocol") MARK = "media" if ($0 ~ "Connection Information") MARK = "media" # Use ... here. Actually "(a)" should be used, but awk does not like the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-05-24 21:55:56
|
Revision: 133 http://callflow.svn.sourceforge.net/callflow/?rev=133&view=rev Author: rbos Date: 2011-05-24 21:55:49 +0000 (Tue, 24 May 2011) Log Message: ----------- Spacing, Add SIP tag: Request-Disposition Modified Paths: -------------- scripts/long2html.awk scripts/removedups.sh Modified: scripts/long2html.awk =================================================================== --- scripts/long2html.awk 2011-05-24 21:17:19 UTC (rev 132) +++ scripts/long2html.awk 2011-05-24 21:55:49 UTC (rev 133) @@ -106,6 +106,7 @@ if ($1 ~ "Remote-Party-ID:" ) MARK = "sip" if ($1 ~ "Require:" ) MARK = "sip" if ($1 ~ "Request-Line:" ) MARK = "sip" + if ($1 ~ "Request-Disposition:" ) MARK = "sip" if ($1 ~ "Route:" ) MARK = "sip" if ($1 ~ "RSeq:" ) MARK = "sip" if ($1 ~ "Server:" ) MARK = "sip" Modified: scripts/removedups.sh =================================================================== --- scripts/removedups.sh 2011-05-24 21:17:19 UTC (rev 132) +++ scripts/removedups.sh 2011-05-24 21:55:49 UTC (rev 133) @@ -1,7 +1,7 @@ #!/bin/bash # script to be called with these arguments: # removedups.sh DESTDIR FRAMEDIR TMPDIR MODE -# MODE: REMOVE_MIRROR_DUPS, REMOVE_ALL_DUPS +# MODE: REMOVE_MIRROR_DUPS, REMOVE_ALL_DUPS function mkmd5sum { grep -v "title" $1 | This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-05-24 21:17:25
|
Revision: 132 http://callflow.svn.sourceforge.net/callflow/?rev=132&view=rev Author: rbos Date: 2011-05-24 21:17:19 +0000 (Tue, 24 May 2011) Log Message: ----------- Add modes to the removedups.sh script. The modes are: REMOVE_MIRROR_DUPS, REMOVE_ALL_DUPS REMOVE_MIRROR_DUPS: This mode removes a package if the subsequent frames are the same. The package that is kept is the first one sent, the subsequent one is skipped This is often encountered on traces that are obtained via port mirroring on a router. REMOVE_ALL_DUPS: Is the current (old) mode A command line option is to be added to enable REMOVE_MIRROR_DUPS. It can be used now, but one needs to change the call to removedups.sh in the callflow script Modified Paths: -------------- callflow scripts/removedups.sh Modified: callflow =================================================================== --- callflow 2011-05-24 20:32:12 UTC (rev 131) +++ callflow 2011-05-24 21:17:19 UTC (rev 132) @@ -414,7 +414,7 @@ # Remove duplicate Frame if [ $removeDF = 1 ]; then #echo "Removing duplicate frames" - $SETUPDIR/scripts/removedups.sh $DESTDIR $DESTDIR/frames $TMPDIR + $SETUPDIR/scripts/removedups.sh $DESTDIR $DESTDIR/frames $TMPDIR REMOVE_ALL_DUPS rm $DESTDIR/callflow.short mv $DESTDIR/callflow.short.new $DESTDIR/callflow.short fi Modified: scripts/removedups.sh =================================================================== --- scripts/removedups.sh 2011-05-24 20:32:12 UTC (rev 131) +++ scripts/removedups.sh 2011-05-24 21:17:19 UTC (rev 132) @@ -1,6 +1,7 @@ #!/bin/bash # script to be called with these arguments: -# removedups.sh DESTDIR FRAMEDIR TMPDIR +# removedups.sh DESTDIR FRAMEDIR TMPDIR MODE +# MODE: REMOVE_MIRROR_DUPS, REMOVE_ALL_DUPS function mkmd5sum { grep -v "title" $1 | @@ -13,7 +14,7 @@ grep -v "Release Time (ms): [[:digit:]]*" | md5sum } -if [ $# -ne 3 ]; then +if [ $# -ne 4 ]; then echo "Bad arguments: $#" exit 1 fi @@ -21,6 +22,7 @@ DESTDIR=$1 FRAMEDIR=$2 TMPDIR=$3 +MODE=$4 #echo Making md5sums >&2 ( cd $FRAMEDIR @@ -33,11 +35,51 @@ done | sort -n > $TMPDIR/md5sums.$$ ) -#echo Looking for unique frames >&2 -for M in $(awk '{print $2}' $TMPDIR/md5sums.$$ | sort -u); do - grep $M $TMPDIR/md5sums.$$ | head -1 -done | awk '{print $1}' | sort -n > $TMPDIR/pckts.$$ +if [[ $MODE = "REMOVE_MIRROR_DUPS" ]]; then + + # This mode removes a package if the subsequent frames are the same. + # The package that is kept is the first one sent, the subsequent one is skipped + # This is often encountered on traces that are obtained via port mirroring + # on a router. + awk '{ + FRAMES[NR] = $0 + + } END { + + # Print first frame number + split(FRAMES[1], F, " ") + print F[1] + PREV_MD5 = F[2] + + MAX = length(FRAMES) + for (i=2; i<=MAX; i++) { + + split(FRAMES[i], F, " ") + CUR_MD5 = F[2] + + if (CUR_MD5 != PREV_MD5) { + # Print the current frame number + printf "%s\n", F[1] + } + + PREV_MD5 = CUR_MD5 + } + + }' $TMPDIR/md5sums.$$ > $TMPDIR/pckts.$$ + +elif [[ $MODE = "REMOVE_ALL_DUPS" ]]; then + + # This mode removes any duplicate package it encounters.... + for M in $(awk '{print $2}' $TMPDIR/md5sums.$$ | sort -u); do + grep $M $TMPDIR/md5sums.$$ | head -1 + done | awk '{print $1}' | sort -n > $TMPDIR/pckts.$$ + +else + echo "error: unknow mode: \"$MODE\"" >&2 + exit 1 +fi + # Output the frame (number) that are not duplicated awk -F"|" -v PKGS="$TMPDIR/pckts.$$" 'BEGIN { while ( getline < PKGS > 0 ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-05-24 20:32:18
|
Revision: 131 http://callflow.svn.sourceforge.net/callflow/?rev=131&view=rev Author: rbos Date: 2011-05-24 20:32:12 +0000 (Tue, 24 May 2011) Log Message: ----------- - Move the order file declaration to the order file section - Make it possible to read the order file from the DESTDIR as well as the current directory Modified Paths: -------------- callflow Modified: callflow =================================================================== --- callflow 2011-05-24 19:42:47 UTC (rev 130) +++ callflow 2011-05-24 20:32:12 UTC (rev 131) @@ -57,12 +57,6 @@ FVAL="$FILTER" fi -if [[ -f order ]]; then - orderFile=order -else - orderFile=none -fi - if [[ -f colors ]]; then COLORS=$(cat colors) fi @@ -368,6 +362,14 @@ exit 0 fi +if [[ -f order ]]; then + orderFile=order +elif [[ -f $DESTDIR/order ]]; then + orderFile=$DESTDIR/order +else + orderFile=none +fi + ################################## # Build short and long files ################################## This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <rb...@us...> - 2011-05-24 19:42:53
|
Revision: 130 http://callflow.svn.sourceforge.net/callflow/?rev=130&view=rev Author: rbos Date: 2011-05-24 19:42:47 +0000 (Tue, 24 May 2011) Log Message: ----------- - Added some comments for better understanding of the script - Moved the statistics part down, as it is less important to rest of the script Modified Paths: -------------- scripts/removedups.sh Modified: scripts/removedups.sh =================================================================== --- scripts/removedups.sh 2011-05-24 19:30:19 UTC (rev 129) +++ scripts/removedups.sh 2011-05-24 19:42:47 UTC (rev 130) @@ -1,6 +1,6 @@ #!/bin/bash -# script to be called with these parameters: -# mkmdsum DESTDIR FRAMEDIR TMPDIR +# script to be called with these arguments: +# removedups.sh DESTDIR FRAMEDIR TMPDIR function mkmd5sum { grep -v "title" $1 | @@ -13,10 +13,8 @@ grep -v "Release Time (ms): [[:digit:]]*" | md5sum } - -if [ $# -ne 3 ] -then - echo Bad arguments $# +if [ $# -ne 3 ]; then + echo "Bad arguments: $#" exit 1 fi @@ -40,6 +38,25 @@ grep $M $TMPDIR/md5sums.$$ | head -1 done | awk '{print $1}' | sort -n > $TMPDIR/pckts.$$ +# Output the frame (number) that are not duplicated +awk -F"|" -v PKGS="$TMPDIR/pckts.$$" 'BEGIN { + while ( getline < PKGS > 0 ) { + # $1 contains the frame number to be included + cmd[$1] = "INCLUDE" + } +} +{ + # The user may have added comments to the cache (callflow.short), these + # comments must be kept! + if ($1 ~ "#" ) { + print $0 + + # $3 from callflow.short contains the frame number + } else if (cmd[$3] == "INCLUDE") print $0 + +}' $DESTDIR/callflow.short > $DESTDIR/callflow.short.new + +# Provide statistics wc -l $TMPDIR/md5sums.$$ $TMPDIR/pckts.$$ | awk ' NR == 1 { FRAMES = $1 } NR == 2 { LEFT = $1 } @@ -57,21 +74,6 @@ } }' >&2 -# Join the files -awk -F"|" -v PKGS="$TMPDIR/pckts.$$" 'BEGIN { - while ( getline < PKGS > 0 ) { - cmd[$0] = "INCLUDE" - } -} -{ - # The user may have added comments to the cache (callflow.short), these - # comments must be kept! - if ($1 ~ "#" ) { - print $0 - } else if (cmd[$3] == "INCLUDE") print $0 - -}' $DESTDIR/callflow.short > $DESTDIR/callflow.short.new - #Remove temp files rm -f $TMPDIR/md5sums.$$ rm -f $TMPDIR/pckts.$$ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |