Dear All,
I have a function with input parameter as const u_char *p. So when I write like this printf("\n\n Char value p : %.2x",(unsigned int)p[1]). It gives me a hex value. How to print the whole p value which method is best to use. I need to analyse it as this supposed to represent a network data packet.
newbie14
0
Posting Pro
Recommended Answers
Jump to PostThe 16 is just the number of columns you want to display on a line. I picked 16 as the number of columns because you want it to be divisible by 2 (sizeof(short)), 4 (sizeof(int)) and 8 (sizeof(long long)). It might be more readable if I changed to code below …
Jump to PostIf on linux and you can get superuser privileges, your could use tcpdump. Tcpdump will allow you to see the activity on a network port (eth0 or eth1). It doesn't have the fancy GUI that wireshark does but you will see the packets your network port is seeing dumped to …
Jump to PostHow Wireshark displays the information is done very well. I think it will help you greatly.
Jump to PostFor the differences check to see what the protocol is in the Ethertype and in the IPv4 protocol. The example I explained was for just TCP. You might be seeing UDP, ARP, ICMP and etc...
Jump to PostIf the protocol in the IPv4 header is UDP then to find the length of the UDP header goto position ipStartOffset+ipHeaderLen*4+udpHeadLenPos which udpHeadLenPos=4 (see http://en.wikipedia.org/wiki/User_Datagram_Protocol). We will call the value you read from …
All 55 Replies
histrungalot
32
Junior Poster
newbie14
0
Posting Pro
Ab000dy_85
-3
Junior Poster in Training
newbie14
0
Posting Pro
histrungalot
32
Junior Poster
newbie14
0
Posting Pro
Ab000dy_85
-3
Junior Poster in Training
newbie14
0
Posting Pro
Ab000dy_85
-3
Junior Poster in Training
Ab000dy_85
-3
Junior Poster in Training
histrungalot
32
Junior Poster
newbie14
0
Posting Pro
newbie14
0
Posting Pro
histrungalot
32
Junior Poster
newbie14
0
Posting Pro
histrungalot
32
Junior Poster
Ab000dy_85
-3
Junior Poster in Training
newbie14
0
Posting Pro
newbie14
0
Posting Pro
histrungalot
32
Junior Poster
newbie14
0
Posting Pro
newbie14
0
Posting Pro
histrungalot
32
Junior Poster
newbie14
0
Posting Pro
histrungalot
32
Junior Poster
newbie14
0
Posting Pro
histrungalot
32
Junior Poster
newbie14
0
Posting Pro
histrungalot
32
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.