<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Packet Sniffer Code in C using Winsock</title>
	<atom:link href="http://www.binarytides.com/blog/packet-sniffer-code-in-c-using-winsock/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.binarytides.com/blog/packet-sniffer-code-in-c-using-winsock/</link>
	<description>Socket Programming , Game Programming , PHP , Mysql , Ubuntu etc.</description>
	<lastBuildDate>Mon, 06 Feb 2012 13:27:59 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Binary Tides</title>
		<link>http://www.binarytides.com/blog/packet-sniffer-code-in-c-using-winsock/comment-page-1/#comment-31157</link>
		<dc:creator>Binary Tides</dc:creator>
		<pubDate>Sun, 25 Dec 2011 07:03:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=6#comment-31157</guid>
		<description>the code has been fixed.
however these are actually warnings instead of errors , try reducing the warning level in vc++ project settings.</description>
		<content:encoded><![CDATA[<p>the code has been fixed.<br />
however these are actually warnings instead of errors , try reducing the warning level in vc++ project settings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ebrahim</title>
		<link>http://www.binarytides.com/blog/packet-sniffer-code-in-c-using-winsock/comment-page-1/#comment-31128</link>
		<dc:creator>Ebrahim</dc:creator>
		<pubDate>Sat, 24 Dec 2011 15:29:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=6#comment-31128</guid>
		<description>I compiled the code using Microsoft visual C++ Express Edition. I got these errors.

1)  line (184): error C2664: &#039;WSAIoctl&#039; : cannot convert parameter 7 from &#039;int *&#039; to &#039;LPDWORD&#039;

2)  line (205): error C2440: &#039;initializing&#039; : cannot convert from &#039;char *&#039; to &#039;unsigned char *&#039;

3)  line (216): error C2664: &#039;recvfrom&#039; : cannot convert parameter 2 from &#039;unsigned char *&#039; to &#039;char *&#039;

4) line (453): error C2664: &#039;strlen&#039; : cannot convert parameter 1 from &#039;unsigned char [17]&#039; to &#039;const char *&#039;</description>
		<content:encoded><![CDATA[<p>I compiled the code using Microsoft visual C++ Express Edition. I got these errors.</p>
<p>1)  line (184): error C2664: &#8216;WSAIoctl&#8217; : cannot convert parameter 7 from &#8216;int *&#8217; to &#8216;LPDWORD&#8217;</p>
<p>2)  line (205): error C2440: &#8216;initializing&#8217; : cannot convert from &#8216;char *&#8217; to &#8216;unsigned char *&#8217;</p>
<p>3)  line (216): error C2664: &#8216;recvfrom&#8217; : cannot convert parameter 2 from &#8216;unsigned char *&#8217; to &#8216;char *&#8217;</p>
<p>4) line (453): error C2664: &#8216;strlen&#8217; : cannot convert parameter 1 from &#8216;unsigned char [17]&#8216; to &#8216;const char *&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Binary Tides</title>
		<link>http://www.binarytides.com/blog/packet-sniffer-code-in-c-using-winsock/comment-page-1/#comment-30756</link>
		<dc:creator>Binary Tides</dc:creator>
		<pubDate>Wed, 14 Dec 2011 09:44:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=6#comment-30756</guid>
		<description>yes ipv6 headers are different from ipv4 headers. 
the ethernet header &quot;protocol&quot; field has to be checked to identify whether packet is ipv4 or ipv6. ipv4 has protocol number 0x0800 whereas ipv6 has protocol number 0x86DD. Full list here :

http://www.iana.org/assignments/ethernet-numbers

but winsock sniffer will not provide the ethernet header. winpcap has to be used.</description>
		<content:encoded><![CDATA[<p>yes ipv6 headers are different from ipv4 headers.<br />
the ethernet header &#8220;protocol&#8221; field has to be checked to identify whether packet is ipv4 or ipv6. ipv4 has protocol number 0&#215;0800 whereas ipv6 has protocol number 0x86DD. Full list here :</p>
<p><a target="_blank" href="http://www.iana.org/assignments/ethernet-numbers"  rel="nofollow">http://www.iana.org/assignments/ethernet-numbers</a></p>
<p>but winsock sniffer will not provide the ethernet header. winpcap has to be used.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Binary Tides</title>
		<link>http://www.binarytides.com/blog/packet-sniffer-code-in-c-using-winsock/comment-page-1/#comment-30754</link>
		<dc:creator>Binary Tides</dc:creator>
		<pubDate>Wed, 14 Dec 2011 09:36:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=6#comment-30754</guid>
		<description>code has been fixed. should compile without any errors.</description>
		<content:encoded><![CDATA[<p>code has been fixed. should compile without any errors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Binary Tides</title>
		<link>http://www.binarytides.com/blog/packet-sniffer-code-in-c-using-winsock/comment-page-1/#comment-30400</link>
		<dc:creator>Binary Tides</dc:creator>
		<pubDate>Fri, 02 Dec 2011 07:16:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=6#comment-30400</guid>
		<description>Ethernet header is not available with winsock.
Winpcap library can be used. It provides the whole packet including the ethernet header.</description>
		<content:encoded><![CDATA[<p>Ethernet header is not available with winsock.<br />
Winpcap library can be used. It provides the whole packet including the ethernet header.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TheOtherGuy</title>
		<link>http://www.binarytides.com/blog/packet-sniffer-code-in-c-using-winsock/comment-page-1/#comment-6949</link>
		<dc:creator>TheOtherGuy</dc:creator>
		<pubDate>Wed, 03 Nov 2010 01:03:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=6#comment-6949</guid>
		<description>I tried to compile the code, and didn&#039;t work.

at line 114: it says log undeclared(first use in this function)

Is there something im doing wrong?</description>
		<content:encoded><![CDATA[<p>I tried to compile the code, and didn&#8217;t work.</p>
<p>at line 114: it says log undeclared(first use in this function)</p>
<p>Is there something im doing wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Its me</title>
		<link>http://www.binarytides.com/blog/packet-sniffer-code-in-c-using-winsock/comment-page-1/#comment-130</link>
		<dc:creator>Its me</dc:creator>
		<pubDate>Thu, 23 Apr 2009 13:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=6#comment-130</guid>
		<description>To sniff the ethernet header and its fields a packet sniffing library like winpcap can be used.</description>
		<content:encoded><![CDATA[<p>To sniff the ethernet header and its fields a packet sniffing library like winpcap can be used.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matoust</title>
		<link>http://www.binarytides.com/blog/packet-sniffer-code-in-c-using-winsock/comment-page-1/#comment-118</link>
		<dc:creator>matoust</dc:creator>
		<pubDate>Fri, 27 Feb 2009 22:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=6#comment-118</guid>
		<description>I have tested the code and it works great. I would also like to be able to display the whole packet including the Ethernet frame (preamble, MAC dest. , MAC source and soon).&lt;br/&gt;&lt;br/&gt;Do you know ho to configure the port to get the whole package?&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;Tomas Matousek</description>
		<content:encoded><![CDATA[<p>I have tested the code and it works great. I would also like to be able to display the whole packet including the Ethernet frame (preamble, MAC dest. , MAC source and soon).</p>
<p>Do you know ho to configure the port to get the whole package?</p>
<p>Thanks<br />Tomas Matousek</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bool</title>
		<link>http://www.binarytides.com/blog/packet-sniffer-code-in-c-using-winsock/comment-page-1/#comment-39</link>
		<dc:creator>Bool</dc:creator>
		<pubDate>Tue, 15 Apr 2008 10:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.binarytides.com/blog/?p=6#comment-39</guid>
		<description>hi there, this article was of great help :D, i&#039;m just playing around with Ragnarok Online (an MMORPG) and thanks to this I made a custom message logger, but I have got a problem.&lt;br/&gt;&lt;br/&gt;Today I tried to open the program in a Windows Vista machine, and it didn&#039;t logged anything, I recompiled it with some printfs in several parts of the code just to know where the program was not working and I noticed it was not reaching this if&lt;br/&gt;&lt;br/&gt;void ProcessPacket(unsigned char* Buffer, int Size)&lt;br/&gt;{&lt;br/&gt; iphdr = (IPV4_HDR *)Buffer;&lt;br/&gt; if(iphdr-&gt;ip_protocol==6){&lt;br/&gt;  InterceptPacket(Buffer,Size);&lt;br/&gt; }&lt;br/&gt; &lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;it only checks if it is tcp because those are the packets I&#039;m interested on, but I think the problem is that the machine could probably be using ipv6, so, my question is, how different are ipv6 headers and how can I distinguish ipv6 from ipv4? &lt;br/&gt;&lt;br/&gt;thanks for yout time</description>
		<content:encoded><![CDATA[<p>hi there, this article was of great help :D, i&#8217;m just playing around with Ragnarok Online (an MMORPG) and thanks to this I made a custom message logger, but I have got a problem.</p>
<p>Today I tried to open the program in a Windows Vista machine, and it didn&#8217;t logged anything, I recompiled it with some printfs in several parts of the code just to know where the program was not working and I noticed it was not reaching this if</p>
<p>void ProcessPacket(unsigned char* Buffer, int Size)<br />{<br /> iphdr = (IPV4_HDR *)Buffer;<br /> if(iphdr->ip_protocol==6){<br />  InterceptPacket(Buffer,Size);<br /> }</p>
<p>}</p>
<p>it only checks if it is tcp because those are the packets I&#8217;m interested on, but I think the problem is that the machine could probably be using ipv6, so, my question is, how different are ipv6 headers and how can I distinguish ipv6 from ipv4? </p>
<p>thanks for yout time</p>
]]></content:encoded>
	</item>
</channel>
</rss>

