linklayerprotocols/pppnif/te_ppp/te_vjcomp/config/TCSIM/tcsim2pcap
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 01:27:53 +0200
changeset 1 a579325b79dd
parent 0 af10295192d8
child 6 c64cefac6e99
permissions -rw-r--r--
Revision: 201005 Kit: 201005

#!/bin/sh
# Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of the License "Eclipse Public License v1.0"
# which accompanies this distribution, and is available
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
#
# Initial Contributors:
# Nokia Corporation - initial contribution.
#
# Contributors:
#
# Description:
# Convert the output of tcsim into a libpcap format packet file.
# Note: the timestamp is not converted
# Usage: tcsim2pcap <infile >outfile
# Ethereal <http://www.ethereal.com> is expected to be installed to get the
# text2pcap program.
# tcsim is a packet simulation tool used here to generate synthetic TCP/IP
# packets. It is part of tcng, the next generation traffic control architecture
# for the Linux operating system.  More information can be obtained at
# http://tcng.sourceforge.net/  This script was tested with tcng version 9f
# November 7, 2003
# danfa
# 
#

sed -e '/^[0-9\.]\+ [^E]/d' -e 's/^.*://' -e 's/\([0-9a-f][0-9a-f]\)\([0-9a-f][0-9a-f]\)/\1 \2/g' | \
sed -e 's/\([0-9a-f][0-9a-f]\)\([0-9a-f][0-9a-f]\)/\1 \2/g' -e 's/^/00000000/'|\
text2pcap -l 12 - -