Hi Rami,

You have two options.

A) Internally we (Anders) has developed a prototype kernel socket interface. This interface is similar to the user land socket programming api and hence is much simpler to use. We can provide you the prototype to use and provide feedback. The only issue here is that it's a prototype and may change before it becomes part of real Solaris, however the changes to your code should be very minimal if any as the interfaces that you will use are unlikely to change.

B) Attached is a pseudo code to use the tli interfaces in the kernel. The issue with this interface is that it's not simple to use and does not support sending on tcp. That is why one has to use other methods to send the data out.

Let me know if you prefer using Ander's prototype.

Rao


Rami Rosen wrote:
Hi Rao,

Thanks.

We have a non STREAMS kernel module.
We want to create a TCP kernel socket which will **ONLY** transmit data, and 
not receive.

Should the api be similar to the user land socket api or should
it be different ?

>From our point of view it does not matter, as long as it achieves TCP functionality.
Do we need polling in the kernel or do we need event
ports or both ...

We use it only to transmit. As I understand, polling is used for the receive queue since the receive queue is the bottleneck under most circumstances. (At least it is so in Linux).
So as far as I understand, we don't
need polling. We need to know that a transmit was completed succssfully.
I will gladly answer more questions,

Regards,
Rami
This message posted from opensolaris.org
_______________________________________________
networking-discuss mailing list
[email protected]

        vnode_t *kvp, *vp;
        TIUSER  *tiptr;
        int     err = 0;
        struct t_call           *server;

        /*
         * open an endpoint
         */
        if (lookupname("/dev/tcp", UIO_SYSSPACE, FOLLOW, NULLVPP,
            &kvp) == 0) {
                if (t_kopen((file_t *)NULL, kvp->v_rdev, FREAD|FWRITE,
                    &tiptr, CRED()) == 0) {
                        vp = tiptr->fp->f_vnode;
                } else {
                        VN_RELE(kvp);
                        return (EPROTO);
                }
        }

        /*
         * Bind to a local address
         */
        if ((i = t_kbind(tiptr, NULL, NULL)) != 0) {
                VN_RELE(kvp);
                return (EPROTO);
        }

        /*
         * Connect to the server
         */
        if ((error = t_kalloc(tiptr, T_CALL, T_ADDR,
            (char **)&server)) != 0) {
        }

        server->addr.len = addrp->len;
        bcopy(addrp->buf, server->addr.buf, server->addr.len);

        if ((error = t_kconnect(tiptr, server, NULL)) != 0) {
        }

        /*
         * Send out data
         */
        put(tiptr->fp->f_vnode->v_stream->sd_wrq->q_next, mp);
        OR
        kstrputmsg(tiptr->fp->f_vnode,,,,,,,)

        /*
         * close the endpoint
         */
        t_kclose(tiptr, 1);
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to