Hi linux-net
Apologies to those who bothered to read my earlier mail - "writing new
versions of connect () and accept()". Its nonsense. But I still need a
solution!!, so heres what I now think I should write.

And for those fortunate people who didnt read it, heres the problem
again.

Im trying to write a simple connection oriented protocol using the
packet interface of linux.
I have a smallish header on top of ethernet's.

will something like this work for accept and connect?

accept (sk, ...)
{
    skb = skb_recv_datagram(sk, flags, noblock = 0, &err) // block till
we get a connection request      packet.

    wakeup because we recieved a packet . Check our header to see if the
CONNECT flag is set.
    if yes, send off the ACK

    skb_free_datagram (sk, skb);
    return;
    //sys_connect and inet_connect will do the other stuff - duplicating
the socket and sock, etc.

//inet_connect will need some modification since right now it does a lot
of tcp specific stuff :-( (kernel 2.0.36 atleast)

    //both skb_recv_datagram() and skb_free_datagram () take care of
locking sk and such stuff,
so I dont have to bother.

}

connect (sk, ...)
{
    send off a connection request packet

    skb = skb_recv_datagram (sk, flags, noblock = 0, &err); //again,
block till the connect ack comes.
    //woken up when a packet recieved. Check if its a connection
ackowledgement.
if so, return success after doing a skb_free_datagram (sk, skb).

}

Thanks once again
Akshay

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to