Is there any way to handle two Ethernet cards in VC++?

I want to write a program that reads a packet from one, delays 250ms,
and spits the packet out the other.

Re: two Ethernet cards by Scott

Scott
Sun Jul 23 17:58:27 CDT 2006

bob@coolgroups.com wrote:
> Is there any way to handle two Ethernet cards in VC++?
>
> I want to write a program that reads a packet from one, delays 250ms,
> and spits the packet out the other.
>

After creating a socket you can specify which card to use (by IP) in the
call to bind. (Or, in MFC, the last argument of CAsyncSocket::Create()).

--
Scott McPhillips [VC++ MVP]


Re: two Ethernet cards by bob

bob
Sun Jul 23 23:07:43 CDT 2006

I'm not sure the cards would have IP addresses.

I want to capture all the packets in promiscuous mode
from each card. Do I just give them random IPs?

Scott McPhillips [MVP] wrote:
> bob@coolgroups.com wrote:
> > Is there any way to handle two Ethernet cards in VC++?
> >
> > I want to write a program that reads a packet from one, delays 250ms,
> > and spits the packet out the other.
> >
>
> After creating a socket you can specify which card to use (by IP) in the
> call to bind. (Or, in MFC, the last argument of CAsyncSocket::Create()).
>
> --
> Scott McPhillips [VC++ MVP]


Re: two Ethernet cards by Carl

Carl
Mon Jul 24 00:04:05 CDT 2006

bob@coolgroups.com wrote:
> I'm not sure the cards would have IP addresses.
>
> I want to capture all the packets in promiscuous mode
> from each card. Do I just give them random IPs?

If you want to deal in raw packets, then you may need to work at a lower
larer than sockets (although I think raw sockets may do what you need).

It sounds, however, like you're trying to build a network bandwidth limiter,
or something similar. For that, you're probably best off using a more
direct connection to the lower-level networking layers via NDIS or TDI.

I'd suggest reposting your question in
microsoft.public.platformsdk.networking.

-cd