Re: how do I call soreceive?
Re: how do I call soreceive?
- Subject: Re: how do I call soreceive?
- From: Josh Graessley <email@hidden>
- Date: Mon, 9 May 2005 11:51:25 -0700
What is the value of the non-zero return?
On Mac OS X 10.4, you will need to call sock_receive or
sock_receivembuf instead of soreceive. If you require a kernel
extension, you will need to write two versions, one for versions of
Mac OS X prior to 10.4 and one for 10.4 and later.
-josh
On May 9, 2005, at 11:38 AM, Bijoy Thomas wrote:
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:
40apple.com
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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