Julian Anastasov wrote:
Hello,
On Tue, 11 Sep 2001, Padraig Brady wrote:
Chris, I'm only filling in the TCP header, and I realise the IP header
will be
filled appropriately when sent. However I need to calculate the checksum for
the TCP header which is actually calculated for the pseudo header:
The checksum is calculated for you in raw_getrawfrag()
For IP not *TCP*. I must do this myself I think, but it's fine, I can do
this easily.
So I need to determine the source address before sending...
getsockname() gives it to you after connect() to the
DGRAM socket.
I don't have to worry about source routing, but thanks for the info. I
don't think
I have to call connect() so, do I?
You have to, if you need the source address
Great I don't have to do it so.
I'm still unsure how to get a source port that will never clash with
existing connections, but that's not a major problem.
Hm, then you have to create a normal TCP socket and to
receive port with bind(). I don't know your goals, so you have to
take into account everything you know.
Basically I'm building a TCP header and need to use a local port number that
wont clash with anything. I'll just use rand() for the moment, if there
is nothing
better?
thanks,
Padraig.
|