Stefan Werner wrote: I want to send UDP packets from kernel space and am currently struggling with the sosocket() call. It appears to be close to undocumented and almost an hour of research on google did not turn up much. I'd be very happy if I could get a simple code snippet that will allow me to send a void* buffer (I haven't figured out how to use mbuf yet) to a remote IP/Port. I found a little code in the nfs source code, but I couldn't quite figure out where exactly the payload is and what the other values mean. The interface is found in xnu/bsd/sys/socketvar.h. To create a socket you call socreate. sosend is used to send both UDP and TCP packets. This is determined by arguments passed to socreate. MacOSX uses the FreeBSD implementation of socket calls and is documented in "The Design and Implementation of the 4.4BSD Operating System" published by Addison Wesley. -- Wally Crooze +-------------------------------------------------------+ | ,-_|\ Wally Crooze <wallycrooze@pobox.com> | | / \ | | \_,-._/ | | v | +-------------------------------------------------------+ _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Wally Crooze