Wanpipe Ethereal S514 Datascoping Using Ethereal, Wanpipe HDLC driver and S514 serial cards one can create a sufisticated datascope for any serial (RS232/V35) HDLC based protocol.
- Overview
- Wanpipe Driver Installation
- Wanpipe Configuration
- API Tracer to Etheral Format
Overview
A common datascoping scenario is to tap an RS232 line and connect the rx end of the tapped line to S514 Port PRIMARY and to connect tx end of the tapped line to S514 Port SECONDARY.
In this scenario the S514 CPU A -> Port PRI will be receiving the rx data stream S514 CPU B -> Port SEC will be receiving the tx data stream
From driver point of view, there will be two network interfaces: w1g1 and w2g1. The interface w1g1 will be connected to Port PRI and interface w2g1 will be connected to Port SEC.
In order to use Ethereal to decode the rx and tx stream, both rx and tx data streams must be first integrated together using an API applicatoin based on data timestamps. As incoming data is writen to a file, data must be writen in Ethereal Format.
Once the API application is finished tracing/integrating both streams into a file. The file can be opened with Ethereal application and analysed.
Wanpipe Driver Installation
- Download the latest STABLE driver.
- Untar the driver in /usr/src directory
- cd /wanpipe
- Run ./Setup install
Proceed with ALL default options. - Finish Installation
- Run: wanrouter hwprobe
Visually confirm that you have S514 cards in your computer
Wanpipe Configuration
- Copy the wanpipe1 configuration file into /etc/wanpipe directory.
- Rename it to wanpipe1.conf
- Copy the wanpipe2 configuration file into /etc/wanpipe directory.
- Rename it to wanpipe2.conf
- Run wanrouter hwprobe
Confirm the PCISLOT and PCIBUS info.
- Change wanpipe1.conf and wanpipe2.conf pci info based on wanrouter hwprobe.
- Configure both devices for boot start
--> wanrouter wanrc specify: wanpipe1 wanpipe2
- Start wanpipe devices
--> wanrouter start
- Check that wanpipe has started properly in /var/log/messages
--> tail -f /var/log/messages
API Tracer Application to Etheral Format
The Sample API applications are located in /etc/wanpipe/api/aft directory. Since the Sangoma API is identical for all S514 and AFT cards in this example we will be using the aft API sample code since it is the latest. Once an also take a look at /etc/wanpipe/api/chdlc/ for reference.
The Sangoma API is Socket based. One would open 2 sockets on interface w1g1 and interface w2g1. Then read each interface in an infinite loop and write all received rx data frames into a single ethereal formated file.
The example code on how to write ethereal formated code is in wanpipe source directory.
- cd wanpipe/utis/wanpipemon
- vi prot_trace.c
The prot_trace.c has the pcap functions that are used to create pcap/ethereal type file. You will notice that a print_pcap_file_header() function is called to write the inital pcap header before data frames are written into a file
The way that ethereal knows what protocol to trace is by fh.network variable in the pcap header. You can see all the protocol definitions in wanpipemon.c -> structure trace_prot_opt[].
This information should be enought for you to write your own sample applicatoin that reads rx and tx data stream and creates a pcap/ethereal trace file.
|