Forum Replies Created
-
AuthorPosts
-
snetcfg is shipped in source code to all WinpkFilter licensees.
Looks like ndisapi.lib still does not link into your application for some reason…
You have to start from PassThur sample.
For the authorized users you just pass packet through. When you detect HTTP GET request from unauthorized user you should generate HTTP redirect response packet. Since you pass all network packets through your application you can easily inspect/modify the traffic flow.
Current version f WInpkFilter installer does not recognize Windows 7, but you can install WinpkFilter drivers manually. It works just fine.
February 17, 2009 at 7:42 am in reply to: virtual MACs from NDIS_WAN_LINE_UP/NDIS_WAN_LINE_DOWN #6766WinpkFilter 3.0.4 does not support this feature. Although it was added in the development version and available to WinpkFilter customers. The new added API allows to retrieve the information about currently active WAN connections. Structures for getting this information are defined as the following:
typedef
struct _RAS_LINK_INFO
{
#define RAS_LINK_BUFFER_LENGTH 1024
ULONG LinkSpeed; // Specifies the speed of the link, in units of 100 bps.
// Zero indicates no change from the speed returned when the protocol called NdisRequest with OID_GEN_LINK_SPEED.
ULONG MaximumTotalSize; // Specifies the maximum number of bytes per packet that the protocol can send over the network.
// Zero indicates no change from the value returned when the protocol called NdisRequest with OID_GEN_MAXIMUM_TOTAL_SIZE.
UCHAR RemoteAddress [ETHER_ADDR_LENGTH]; // Represents the address of the remote node on the link in Ethernet-style format. NDISWAN supplies this value.
UCHAR LocalAddress [ETHER_ADDR_LENGTH]; // Represents the protocol-determined context for indications on this link in Ethernet-style format.
ULONG ProtocolBufferLength;// Specifies the number of bytes in the buffer at ProtocolBuffer
UCHAR ProtocolBuffer [RAS_LINK_BUFFER_LENGTH]; // Containing protocol-specific information supplied by a higher-level component that makes connections through NDISWAN
// to the appropriate protocol(s). Maximum size is 600 bytes (on Windows Vista)
} RAS_LINK_INFO, *PRAS_LINK_INFO;
typedef
struct _RAS_LINKS
{
#define RAS_LINKS_MAX 256
ULONG nNumberOfLinks;
RAS_LINK_INFO RasLinks[RAS_LINKS_MAX];
} RAS_LINKS, *PRAS_LINKS;Thanks. Happy New Year to you too!
I’ve been a bit overloaded last time. Need to find some free time to complete the new release. Hopefully in March.
February 17, 2009 at 7:34 am in reply to: How to know the captured package belong to which process? #6771You can use IP helper API to query current active connections table and match your packet against this table using IP address and port information you have. Since Windows XP connections table contains process ID. Another way is using LSP or TDI filter driver.
Most probably there is something wrong with structures definitions. Or you may be trying to process non TCP packet.
How do you expect to use VirtNet?
All samples are ok for WiFi.
Yes, you are right.
Yes, sure you can. Old table is dropped and new one is set.
Under “using MSTCP default behavior” I mean that you may modify incoming/outgoing packets and let TCP/IP route them. Like in case of NAT, WIndows TCP/IP stack by default routes packets coming from LAN into default gateway interface (connected to the Internet). To implement NAT you can only capture packets from external (Internet connected) network interface:
– For outgoing packets change source IP address to Internet interface assigned one and port allocated/according NAT table
-For incoming packets change destination IP/port according NAT tableThis way you use Microsoft TCP/IP routing and don’t have to implement it on your own.
Is that clear now?
Internet Gateway is only available in C++.
PassThru is basic packet filtering sample.
Under MSTCP I mean Microsoft TCP/IP stack implementation. You don’t have to use it from your application, but you can use its default behavior to solve the routing task.
Of course you can implement the routing by yourself. You can read packet from one interface, check/modify and forward to another using NDISAPI interface. You have to support you own routing table and etc.. to implement this properly. IHMO it is doable, but there is easier way…
Personally I prefer to let the MSTCP to do the routing work like it is done in Internet Gateway advanced sample http://www.ntkernel.com/w&p.php?id=31. This is very similar to what you need but the routing operation is performed by MSTCP, so probably it should help you to start.
-
AuthorPosts