<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=chikabanga2005@yahoo.com href="mailto:chikabanga2005@yahoo.com">joe
kibz</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, May 29, 2006 12:54 AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [Winpcap-users] Re : printing
pkt_data</DIV>
<DIV><FONT size=2></FONT><BR></DIV>
<DIV>Problem:</DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>I am having problems printing out pkt_data . I wanna print it first in
binary then actual text line by line just like in ethereal .</DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>Does anybody know how pkt_data captured can be printed out like that
?</DIV></BLOCKQUOTE>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Uhm, what do you mean by "line-by-line"? Which panel of
ethereal are you referring to (middle panel or botton panel)?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Printing in hex is quite simple (loop through packet data, and
print with "printf("%2.2x ", pkt_data[i])"). If you want to print the ascii
content, you can use the same loop and use something like</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>if (isalnum(pkt_data[i])</FONT></DIV>
<DIV><FONT size=2> printf("%c", pkt_data[i]);</FONT></DIV>
<DIV><FONT size=2>else</FONT></DIV>
<DIV><FONT size=2> printf(".");</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If you want a more "formatted" output, the you will probably
need to decode the packet protocols (like ethereal does).</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Have a nice day</FONT></DIV>
<DIV><FONT size=2>GV<BR></FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT size=2></FONT> </DIV>
<DIV>joe </DIV>
<P>
<HR SIZE=1>
Do you Yahoo!?<BR>Get on board. <A
href="http://us.rd.yahoo.com/evt=40791/*http://advision.webevents.yahoo.com/handraisers">You're
invited</A> to try the new Yahoo! Mail Beta.
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BLOCKQUOTE></BODY></HTML>