* Do you know the linux TCP stack?
@ 2005-03-05 14:31 Zdenek Radouch
2005-03-05 16:34 ` Vincent Guffens
2005-03-05 18:34 ` Andi Kleen
0 siblings, 2 replies; 5+ messages in thread
From: Zdenek Radouch @ 2005-03-05 14:31 UTC (permalink / raw)
To: netdev, linux-net
I ran out of ideas. Can't find the answers in any docs,
and I don't have time to read and analyze the source right now.
I will hire you to help me; I need the following to be done in
my net device driver:
With the ARP disabled (this is well documented so I believe I've done that),
while queueing the physical output, I need to get hold of the IP address
of where the packet is being sent. Yes, I mean IP address, not
Ethernet address, and yes this is not the destination addresses in
the IP header.
If you can do it, and are interested in helping me, please send me
a note, with your hourly consulting rate, or a suggestion of how
you'd like to be compensated for the work. Of course, if you'd
like to just send me an answer, that would be fine, too. :-)
Thanks.
-Zdenek
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Do you know the linux TCP stack?
2005-03-05 14:31 Do you know the linux TCP stack? Zdenek Radouch
@ 2005-03-05 16:34 ` Vincent Guffens
2005-03-05 17:11 ` Zdenek Radouch
2005-03-05 18:34 ` Andi Kleen
1 sibling, 1 reply; 5+ messages in thread
From: Vincent Guffens @ 2005-03-05 16:34 UTC (permalink / raw)
To: Zdenek Radouch; +Cc: netdev, linux-net
Zdenek Radouch wrote:
> I ran out of ideas. Can't find the answers in any docs,
> and I don't have time to read and analyze the source right now.
>
> I will hire you to help me; I need the following to be done in
> my net device driver:
>
> With the ARP disabled (this is well documented so I believe I've done that),
> while queueing the physical output, I need to get hold of the IP address
> of where the packet is being sent. Yes, I mean IP address, not
> Ethernet address, and yes this is not the destination addresses in
> the IP header.
can you not use the routing table ? In a normal setup, either the
network part of your destination IP matches the network part of a
directly connected network and the address your are looking for is the
destination IP in the packet or it does not match and the next IP is the
IP of the gateway found by routing.
Is it what you are looking for ?
--
Vincent Guffens
PhD Student UCL/CESAME
tel: +32 10 47 80 30
Value your freedom, or you will lose it, teaches history.
"Don't bother us with politics," respond those who don't want to learn.
-- Richard M. Stallman
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Do you know the linux TCP stack?
2005-03-05 16:34 ` Vincent Guffens
@ 2005-03-05 17:11 ` Zdenek Radouch
2005-03-05 18:39 ` David S. Miller
0 siblings, 1 reply; 5+ messages in thread
From: Zdenek Radouch @ 2005-03-05 17:11 UTC (permalink / raw)
To: netdev, linux-net
That's correct. The routing has already been done (I'm about to queue the
packet to the hardware), and all I need is to find the IP address that came
out of the routing function. As you said, the address may or may not be
the one in the IP header. So how do I get hold of it? In the BSD stack,
this address is part of the transmit API, but under Linux that does not seem
to be the case.
To illustrate this further, my hardware uses the interface IP addreses also
for the physical layer (instead of Ethernet addresses). Before I send the
packet
I need to fill the physical header. This would normally be done by ARP,
but in my case the IP to physical is an identity mapping. I just have no clue
how to implement it under a stack/API that seems to target mainly the Ethernet
model.
-Zdenek
At 05:34 PM 3/5/05 +0100, Vincent Guffens wrote:
>Zdenek Radouch wrote:
>> I ran out of ideas. Can't find the answers in any docs,
>> and I don't have time to read and analyze the source right now.
>>
>> I will hire you to help me; I need the following to be done in
>> my net device driver:
>>
>> With the ARP disabled (this is well documented so I believe I've done
that),
>> while queueing the physical output, I need to get hold of the IP address
>> of where the packet is being sent. Yes, I mean IP address, not
>> Ethernet address, and yes this is not the destination addresses in
>> the IP header.
>
>can you not use the routing table ? In a normal setup, either the
>network part of your destination IP matches the network part of a
>directly connected network and the address your are looking for is the
>destination IP in the packet or it does not match and the next IP is the
> IP of the gateway found by routing.
>
>Is it what you are looking for ?
>
>
>--
> Vincent Guffens
> PhD Student UCL/CESAME
> tel: +32 10 47 80 30
>Value your freedom, or you will lose it, teaches history.
>"Don't bother us with politics," respond those who don't want to learn.
> -- Richard M. Stallman
>-
>To unsubscribe from this list: send the line "unsubscribe linux-net" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Do you know the linux TCP stack?
2005-03-05 14:31 Do you know the linux TCP stack? Zdenek Radouch
2005-03-05 16:34 ` Vincent Guffens
@ 2005-03-05 18:34 ` Andi Kleen
1 sibling, 0 replies; 5+ messages in thread
From: Andi Kleen @ 2005-03-05 18:34 UTC (permalink / raw)
To: Zdenek Radouch; +Cc: netdev
Zdenek Radouch <zdenek@rcn.com> writes:
>
> If you can do it, and are interested in helping me, please send me
> a note, with your hourly consulting rate, or a suggestion of how
> you'd like to be compensated for the work. Of course, if you'd
> like to just send me an answer, that would be fine, too. :-)
((struct rtentry *)(skb->dst))->rt_spec_dst
You would need to make sure the packet is IP first, and even then
it may fail (e.g. injected IP packet from a packet socket)
-Andi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Do you know the linux TCP stack?
2005-03-05 17:11 ` Zdenek Radouch
@ 2005-03-05 18:39 ` David S. Miller
0 siblings, 0 replies; 5+ messages in thread
From: David S. Miller @ 2005-03-05 18:39 UTC (permalink / raw)
To: Zdenek Radouch; +Cc: netdev, linux-net
The routing entry used is in "skb->dst", cast it to a
"struct rtentry *" and look at the contents.
$5000.00USD please :-)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-03-05 18:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-05 14:31 Do you know the linux TCP stack? Zdenek Radouch
2005-03-05 16:34 ` Vincent Guffens
2005-03-05 17:11 ` Zdenek Radouch
2005-03-05 18:39 ` David S. Miller
2005-03-05 18:34 ` Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).