Dissecting network packets

Associate
Joined
19 Jun 2006
Posts
162
Location
Swansea, Wales
Hi,

I would like to dissect some packets in Java, specifically SIP and RTP packets.

I have used jpcap to sniff the packets off the network and the contents of the packet are placed in a byte array.

Does anyone have an idea of how to split this packet up so for example I can see what codecs have been specified etc.

I tried looking at the C source code of Wireshark to give me an idea but it seemed pretty complicated.

Any suggestions welcome.
 
RFC's are fine for the header information where the data is predefined. I also need to parse the SIP body where data can be variable. For example, it will hold the SIP address which could be anything from SIP:[email protected] to SIP:[email protected].

How can i search through a byte array looking for particular strings?

Also the byte array is going to be holding binary data. Is there an easy way to convert this to acsii before i start searching?
 
Visage said:
I'd hardly call whacking some bytes into a ByteBuffer and calling getInt, getLong, getShort etc hard.....

I'm a Java n00b so could you post a bit of a code example for this please? :)
 
Back
Top Bottom