Re: Pass socket to kernel?
Re: Pass socket to kernel?
- Subject: Re: Pass socket to kernel?
- From: Josh Graessley <email@hidden>
- Date: Sat, 30 Dec 2006 03:42:06 -0800
There isn't a right way to do this.
One way to do this is register a socket filter. You can use a socket
option, I think it's SO_NKE to attach your filter to the socket from
user space. You absolutely must not call sock_close on this socket
from the kernel though. You need user space to be responsible for
opening and closing the socket. There are some tricky issues in the
handoff from user space to kernel and the pieces you would need to
accomplish this are not part of the KPI.
-josh
On Dec 30, 2006, at 3:16 AM, email@hidden wrote:
I'm writing a remote file system KEXT that uses the socket KPI, but
some of the work has to be done from user space via an app (e.g. the
authentication process, which requires user interaction).
What's the correct way to pass a socket from my app to the kernel for
use with the socket KPI? My app will connect to a server, do some
exchanges to authenticate, then I want to hand off that socket to the
kernel to do the rest (it has to hook into the mass storage stack).
Once the socket is handed off, I want the app to be able to quit
without the kernel-side of the socket being closed (i.e. sock_retain).
I see references to doing this type of thing in kpi_socket.h file, but
I wasn't sure how to get the underlying socket_t from the socket file
descriptor to use from the kernel side. Do I have to write a socket
filter to get the socket_t?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog 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.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden