Re: Raw Socket
- From: Rainer Temme <Rainer.Temme@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 05 Sep 2006 22:15:27 +0200
markpapadakis wrote:
zwhermes@xxxxxxxxx wrote:How can i use a Raw Socket to send a packet through a certain ethernet
card in a computer with several ethernet cards? I still have no idea
about that. I will really appreciate your help. Thanks.
o Examine the source code of programs that utilize this functionality.
o To send them over a given NIC, just bind() your socket's fd to that
NIC's assigned IP address.
o http://mixter.void.ru/rawip.html
Nope, binding a socket-fd to one of the local IP addresses only
makes sure, this address will be used as source address. If a packet
is routed out via a certain adapter or not is still depending on
the destination IP (and where that is routed to is looked up in the
routing table).
Nevertheless, I don't understand the wish to send a packet out via
a certain adapter...
If it is the 'right' way out for the given destination, then the
routingtable should route the packet there as well.
If its the 'wrong' way out, why would one want to send it there.
Whereas, the wish to us a certain of more than one local addresses
(as pointed out by Mark) is very useful at times.
Rainer
.
- Follow-Ups:
- Re: Raw Socket
- From: Chris Friesen
- Re: Raw Socket
- From: Frank Cusack
- Re: Raw Socket
- From: markpapadakis
- Re: Raw Socket
- References:
- Raw Socket
- From: zwhermes
- Re: Raw Socket
- From: markpapadakis
- Raw Socket
- Prev by Date: Re: Linux select command issues
- Next by Date: Re: Linux select command issues
- Previous by thread: Re: Raw Socket
- Next by thread: Re: Raw Socket
- Index(es):
Relevant Pages
|
Loading