how do I call soreceive?
how do I call soreceive?
- Subject: how do I call soreceive?
- From: Bijoy Thomas <email@hidden>
- Date: Mon, 9 May 2005 14:38:45 -0400
Hi,
I am trying to understaned how to call soreceive from my kext. I am
trying to receive data from an ftp server upon connect. My soconnect
funtion returns 0 so I am assuming i have a good connect. I am trying
to get the welcome message from the ftp server just for confirmation.
The soreceive function looks fairly complex and my understanding is
that it can do a variety of functions based on its supplied arguments.
I just want to receive the welcome message. I do not want to pass it to
user space. Upon browsing the kernel sources, I guess this can be
accomplished by the following settings,
struct iovec aio;
struct uio auio;
aio.iov_base = &buf; //buf is a char[100] buf;
aio.iov_len = 100;
auio.uio_iov = &aio;
auio.uio_iovcnt = 1;
auio.uio_segflg = UIO_SYSSPACE; //we have a kernel space buffer
auio.uio_rw = UIO_READ;
auio.uio_offset = 0;
auio.uio_resid = 100;
auio.uio_procp = current_proc();
and passing this so soreceive with both the mbufs as NULL. ( I'm
guessing the mbufs are provided only if you want the detailed packet
header and accompanying data returned possibly as a list of mbufs). I
tried it this way but i'm getting a non zero return from soreceive. Any
suggestions/links?
Regards,
Bijoy Thomas.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden