what do you mean by "Packet Data" ?? do you mean the packet payload or the fields values ??
for the fields values you have to take every one of them individually
for the packet payload you have to make an object (for instance lets call it packetObj) that represent the packet type (TCP or UDP) you are handling and then use (packetObj.Payload) to get the data you want
oh and for the ASCII thingy , just use (System.Encoding) Class , it has everything you need from ASCII to Unicode
i hope this is enough , if you want more then just ask :)
I'm trying something like this..
IpV4Datagram ip = packet.Ethernet.IpV4;
//UdpDatagram udp = ip.Udp;
TcpDatagram tcp = ip.Tcp;
//Filter HTTP traffic
//trying to set up the acii encoded string
Encoding ascii = Encoding.ASCII;
String output = ascii.GetString(ip.Payload); //<---yes error
// print ip addresses and udp ports
// textbox.AppendText(ip.Source + ":" + udp.SourcePort.Equals(80) + " -> " + ip.Destination + ":" + udp.DestinationPort);
textbox.AppendText(ip.Source + ":" + tcp.SourcePort + "->" + ip.Destination + ":" +
tcp.DestinationPort + "---" + "[I'M TRYING TO OUTPUT THE PAYLOAD HERE]");
I'd appreciate any advice!