Re: How to know if a network adapter is connected

Tech-Archive recommends: Fix windows errors by optimizing your registry



If someone is sending data to your via datagram, you can tell who sent it
when the packet is received (don't need to bind). If someone is connecting
to you via stream socket, you can tell who connected when that happens
(don't need to bind).

Paul T.

"Helge Kruse" <Helge.Kruse-nospam@xxxxxxx> wrote in message
news:gd04go$5g5$00$1@xxxxxxxxxxxxxxxxxxxx

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:e2NbhcVLJHA.1304@xxxxxxxxxxxxxxxxxxxxxxx
Why? Why do you care which adapter is used?

Paul, as I understand fred_d he wrote a custom DHCP implementation. It
should respond with different content dependent on the network (adapter)
where the DHCP request has been received.

You can certainly get some information about whether a network adapter is
running or not but it's not clear to me why you'd ever need to do that
I see the need to bind sockets to adapters to identify where packets have
been received. The bind operation fails as long as the adapter's link
state is down (not connected to network).

Regards,
Helge



.



Relevant Pages

  • Re: UDP question.
    ... bind socket1.network adapter1... ... bind socket2 network adapter2 ... But I get the result is also 75000 packet per second, ... I am not really sure, but I think the bind to an adapter under linux only chooses the source ip, not really the adapter used to send the packets. ...
    (Linux-Kernel)
  • Re: servers address in ntp payload?
    ... >>>I agree that the IP address should not be in the NTP header. ... >>>>That's the MAC in the NTP packet. ... If you get a packet arriving from a>different address you should assume it's a different server and will be>considered unauthenticated until the authentication is established. ... There are a number of reasons to bind all of the IP>>>addresses individually. ...
    (comp.protocols.time.ntp)
  • Re: servers address in ntp payload?
    ... > No it is not a flaw in the protocol design. ... The address doesn't belong there, it belongs in the IP header which ... The ability to send the UDP packet back with the required IP address on a multihomed host is not even guaranteed, since such an ability is only in the SHOULD category and is not in the MUST category in RFC 1123. ... There are a number of reasons to bind all of the IP> addresses individually. ...
    (comp.protocols.time.ntp)
  • Re: servers address in ntp payload?
    ... That's the MAC in the NTP packet. ... considered unauthenticated until the authentication is established. ... There are a number of reasons to bind all of the IP ...
    (comp.protocols.time.ntp)
  • Re: Networks and wireless etc
    ... >> source address indicated in outgoing packets on that socket, ... if the packet was sent out ... > outgoing traffic goes from A1 and incoming is received on A2. ... Nope - the bind() doesn't do anything except establish the local IP address ...
    (microsoft.public.win32.programmer.networks)