Subject: Calling kernel socket routines?
To: None <port-alpha@netbsd.org>
From: Paul Mather <paul@gromit.dlib.vt.edu>
List: port-alpha
Date: 03/14/2001 10:38:55
I apologise in advance that this isn't the most ideal place to post this
query, but I know there are several kernel developers on here, so it
seemed a good place to ask.

I'm looking for man pages for the kernel so* socket routines, e.g.,
socreate, sosend, soreceive, etc.  There are lots of man pages in
section 9 for all kinds of kernel facilities, but not, it seems, these
functions.  Is it not legitimate to call them from within kernel code?
If not, what is the "legitimate" means to access sockets from within the
kernel?

Looking at /usr/src/sys/kern/uipc_socket.c, it seems that for, say,
sosend, the data you want to send can be supplied either via the "uio"
or the "top" parameter, and if you want to write control data, you
supply it via the "control" parameter.  If the socket hasn't previously
been connected via soconnect, you supply the destination address in
"addr".  It seems that whichever is inapplicable, you set to NULL in the
call.  Is this correct?  Also, for soreceive, whatever you are not
interested in getting back (e.g., remote addr) you set to NULL in the
call, otherwise you supply the address of a pointer to the appropriate
type?

Sorry if this is a bit off-topic, but like I said, I would RTFM if I
could. :-)

Any help is genuinely appreciated.

Cheers,

Paul.

e-mail: paul@gromit.dlib.vt.edu

"Without music to decorate it, time is just a bunch of boring production
 deadlines or dates by which bills must be paid."
        --- Frank Vincent Zappa