Passing up per-socket data from NKE
Passing up per-socket data from NKE
- Subject: Passing up per-socket data from NKE
- From: Matt Slot <email@hidden>
- Date: Sat, 4 Sep 2010 07:07:47 -0400
I have an NKE that installs a control socket and a socket filter. I have a userland process which opens a control connection, and receives incoming TCP connections. I'd like to pass up some per-socket data to the userland process
The easiest way would be to write the data to the TCP stream on connect, but I'd prefer to pass it up "out of band" if possible. I looked at ioctl(SIOCGIFKPI), but I'm completely at a loss at how to make it work.
int controlSocket = -1;
controlSocket = socket(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL);
struct ctl_info controlInfo = {0};
strcpy(controlInfo.ctl_name, MY_KEXT_BUNDLEID);
ioctl(controlSocket, CTLIOCGINFO, &controlInfo);
struct ifreq myreq = {0};
myreq.ifr_ifru.ifru_kpi.ifk_module_id = controlInfo.ctl_id;
myreq.ifr_ifru.ifru_kpi.ifk_type = 1;
int tcpSocket = myAcceptTCPConnection();
ioctl(tcpSocket, SIOCGIFKPI, &myreq);
The last call is failing with ENXIO, and I never see the ioctl() come through.
Thanks,
Matt _______________________________________________
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