<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Packet Filter API Problem...]]></title><description><![CDATA[<p>Hi,<br />
Ich hab ein &quot;kleines&quot; Problem mit der Packet Filter API...<br />
Ich hab alles nach meinem besten wissen so eingestellt das eigentlich alles geblockt werden muss...jegeliche Protocolle , jede IP und auf jeden Port...<br />
wenn ich das PRogramm gestartet habe kann ich auch mit dem IExplorer auch zu keiner Seite mehr connecten....soweit klapp es ja auch alles aber ich kann die site noch an pingen was eigentlich nicht mehr möglich sein sollte...vielcht wisst ihr was ich falsch gemacht habe....</p>
<pre><code class="language-cpp">#include &lt;stdio.h&gt;
#include &lt;Windows.h&gt;
#include &lt;conio.h&gt;
#include &quot;Iphlpapi.h&quot;
#include &quot;Fltdefs.h&quot;
#pragma comment( lib, &quot;Iphlpapi.lib&quot; ) // Laden der libs...
#pragma comment( lib, &quot;WS2_32.lib&quot; )

int main()
{
	BYTE localIp[]    = {127,0,0,1};
	INTERFACE_HANDLE ppInterface;

	if(PfCreateInterface(NULL,PF_ACTION_FORWARD,PF_ACTION_FORWARD,false,true,&amp;ppInterface)==NO_ERROR)
	{
		printf(&quot;PfCreateInterface..OK\n&quot;);
	}
	else
	{
		printf(&quot;PfCreateInterface..FAILED\n&quot;);
	}

	if(PfBindInterfaceToIPAddress(ppInterface,PF_IPV4,localIp)==NO_ERROR)
	{
		printf(&quot;PfBindInterfaceToIPAddress..OK\n&quot;);
	}
	else
	{
		printf(&quot;PfBindInterfaceToIPAddress..FAILED\n&quot;);
	}

	FILTER_HANDLE fHandle;

	BYTE Scrmask[]    = {0,0,0,0}; // 212.185.47.88
	BYTE Scraddr[]    = {0,0,0,0};

	BYTE Dstaddr[]    = {0,0,0,0};
	BYTE Dstmask[]    = {0,0,0,0};

	PF_FILTER_DESCRIPTOR Filter;

	Filter.DstAddr			= Dstaddr;
	Filter.DstMask			= Dstmask;
	Filter.dwFilterFlags	= FD_FLAGS_NOSYN;
	Filter.dwProtocol		= FILTER_PROTO_ANY;
	Filter.dwRule			= 0;
	Filter.pfatType			= PF_IPV4;
	Filter.SrcAddr			= Scraddr;
	Filter.SrcMask			= Scrmask;
	Filter.wDstPort			= FILTER_TCPUDP_PORT_ANY;
	Filter.wDstPortHighRange= FILTER_TCPUDP_PORT_ANY;
	Filter.wSrcPort			= FILTER_TCPUDP_PORT_ANY;
	Filter.wSrcPortHighRange= FILTER_TCPUDP_PORT_ANY;
	Filter.fLateBound		= LB_SRC_ADDR_USE_SRCADDR_FLAG|LB_SRC_ADDR_USE_DSTADDR_FLAG|LB_DST_ADDR_USE_SRCADDR_FLAG|LB_DST_ADDR_USE_DSTADDR_FLAG;

	if(PfAddFiltersToInterface(ppInterface, 1, &amp;Filter, 0, NULL, &amp;fHandle)==NO_ERROR)
	{
		printf(&quot;PfAddFiltersToInterface..OK\n&quot;);
	}
	else
	{
		printf(&quot;PfAddFiltersToInterface..FAILED\n&quot;);
	}

	getch();
	PfRemoveFilterHandles(ppInterface, 1, &amp;fHandle);
	PfUnBindInterface(ppInterface);
	PfDeleteInterface(ppInterface);
	return 0;
}
</code></pre>
<p>MFG NetZwerg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/99671/packet-filter-api-problem</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 10:56:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/99671.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 30 Jan 2005 21:23:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Packet Filter API Problem... on Sun, 30 Jan 2005 21:23:03 GMT]]></title><description><![CDATA[<p>Hi,<br />
Ich hab ein &quot;kleines&quot; Problem mit der Packet Filter API...<br />
Ich hab alles nach meinem besten wissen so eingestellt das eigentlich alles geblockt werden muss...jegeliche Protocolle , jede IP und auf jeden Port...<br />
wenn ich das PRogramm gestartet habe kann ich auch mit dem IExplorer auch zu keiner Seite mehr connecten....soweit klapp es ja auch alles aber ich kann die site noch an pingen was eigentlich nicht mehr möglich sein sollte...vielcht wisst ihr was ich falsch gemacht habe....</p>
<pre><code class="language-cpp">#include &lt;stdio.h&gt;
#include &lt;Windows.h&gt;
#include &lt;conio.h&gt;
#include &quot;Iphlpapi.h&quot;
#include &quot;Fltdefs.h&quot;
#pragma comment( lib, &quot;Iphlpapi.lib&quot; ) // Laden der libs...
#pragma comment( lib, &quot;WS2_32.lib&quot; )

int main()
{
	BYTE localIp[]    = {127,0,0,1};
	INTERFACE_HANDLE ppInterface;

	if(PfCreateInterface(NULL,PF_ACTION_FORWARD,PF_ACTION_FORWARD,false,true,&amp;ppInterface)==NO_ERROR)
	{
		printf(&quot;PfCreateInterface..OK\n&quot;);
	}
	else
	{
		printf(&quot;PfCreateInterface..FAILED\n&quot;);
	}

	if(PfBindInterfaceToIPAddress(ppInterface,PF_IPV4,localIp)==NO_ERROR)
	{
		printf(&quot;PfBindInterfaceToIPAddress..OK\n&quot;);
	}
	else
	{
		printf(&quot;PfBindInterfaceToIPAddress..FAILED\n&quot;);
	}

	FILTER_HANDLE fHandle;

	BYTE Scrmask[]    = {0,0,0,0}; // 212.185.47.88
	BYTE Scraddr[]    = {0,0,0,0};

	BYTE Dstaddr[]    = {0,0,0,0};
	BYTE Dstmask[]    = {0,0,0,0};

	PF_FILTER_DESCRIPTOR Filter;

	Filter.DstAddr			= Dstaddr;
	Filter.DstMask			= Dstmask;
	Filter.dwFilterFlags	= FD_FLAGS_NOSYN;
	Filter.dwProtocol		= FILTER_PROTO_ANY;
	Filter.dwRule			= 0;
	Filter.pfatType			= PF_IPV4;
	Filter.SrcAddr			= Scraddr;
	Filter.SrcMask			= Scrmask;
	Filter.wDstPort			= FILTER_TCPUDP_PORT_ANY;
	Filter.wDstPortHighRange= FILTER_TCPUDP_PORT_ANY;
	Filter.wSrcPort			= FILTER_TCPUDP_PORT_ANY;
	Filter.wSrcPortHighRange= FILTER_TCPUDP_PORT_ANY;
	Filter.fLateBound		= LB_SRC_ADDR_USE_SRCADDR_FLAG|LB_SRC_ADDR_USE_DSTADDR_FLAG|LB_DST_ADDR_USE_SRCADDR_FLAG|LB_DST_ADDR_USE_DSTADDR_FLAG;

	if(PfAddFiltersToInterface(ppInterface, 1, &amp;Filter, 0, NULL, &amp;fHandle)==NO_ERROR)
	{
		printf(&quot;PfAddFiltersToInterface..OK\n&quot;);
	}
	else
	{
		printf(&quot;PfAddFiltersToInterface..FAILED\n&quot;);
	}

	getch();
	PfRemoveFilterHandles(ppInterface, 1, &amp;fHandle);
	PfUnBindInterface(ppInterface);
	PfDeleteInterface(ppInterface);
	return 0;
}
</code></pre>
<p>MFG NetZwerg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/710744</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/710744</guid><dc:creator><![CDATA[NetZwerg]]></dc:creator><pubDate>Sun, 30 Jan 2005 21:23:03 GMT</pubDate></item><item><title><![CDATA[Reply to Packet Filter API Problem... on Sun, 30 Jan 2005 22:25:57 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>ping nutzt weder tcp noch udp. ping setzt nicht in der transportschicht im osi-modell auf sondern in der vermittlerschicht (icmp).</p>
<p>gruss<br />
msp</p>
]]></description><link>https://www.c-plusplus.net/forum/post/710791</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/710791</guid><dc:creator><![CDATA[msp]]></dc:creator><pubDate>Sun, 30 Jan 2005 22:25:57 GMT</pubDate></item><item><title><![CDATA[Reply to Packet Filter API Problem... on Mon, 31 Jan 2005 06:11:54 GMT]]></title><description><![CDATA[<p>HI,<br />
liegt den das an den Ports, die einentlich durch FILTER_TCPUDP_PORT_ANY ja nur auf 0 gesetzt werden...? Denn eigentlich ist es ja eingestellt das der Filter jegliches Protokoll filtern soll...<br />
Oder auf welche andere weise kann man Ping(und ähnliches) stoppen??</p>
<p>MFG NetZwerg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/710861</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/710861</guid><dc:creator><![CDATA[NetZwerg]]></dc:creator><pubDate>Mon, 31 Jan 2005 06:11:54 GMT</pubDate></item></channel></rss>