Looks like the OS X header files are aware of the SCTP protocol, but the libraries don't actually implement it. You can hack it in with third-party extensions.
I get the same thing results on OS X 10.8.3. When installing socat, it detects SCTP support in configure and sets that WITH_SCTP definition.
$ ./configure | grep -i sctp configure: WARNING: include file netpacket/packet.h not found, disabling interface checking whether to include SCTP support... yes checking for IPPROTO_SCTP... yes
However, if you look in configure
, it's a really simple test. The "whether to include SCTP support" is whether --enable-sctp was specified, and is on by default. And the "checking for IPPROTO_SCTP" just defines whether that protocol constant is defined in the header files. That is, the headers could be aware of that protocol and have a value to represent it, but the underlying system might not implement actually using. I think that's the case here: the OS X kernel doesn't provide an SCTP implementation.
There's "preliminary" third party support for SCTP under newer versions of OS X: https://nplab.fh-muenster.de/groups/wiki/wiki/f366c/. Installing this got SCTP working for me in homebrew's socat
.
[@ in ~] $ socat -d -d sctp-listen:99999 - 2013/04/24 22:19:38 socat[270] E socket(2, 1, 132): Protocol not supported 2013/04/24 22:19:38 socat[270] N exit(1) [✘ @ in ~] $ sudo kextload /System/Library/Extensions/SCTP.kext [✘ @ in ~] $ socat -d -d -d sctp-listen:99999 - [...snip...] 2013/04/24 22:20:51 socat[291] I socket(2, 1, 132) -> 3 2013/04/24 22:20:51 socat[291] I starting accept loop 2013/04/24 22:20:51 socat[291] N listening on LEN=16 AF=2 0.0.0.0:34463
Caution: this is a third-party kernel extension, it's "preliminary", there's not a whole lot of documentation, and I can't vouch for the source. This is likely to be fragile, and it may be hard to recover from mistakes. I would do this in a virtual machine, and not in your main machine. VMs are great for experimenting with low level stuff and various machine configurations. (Case in point: to figure out this question I did a bunch of messing around with my machine and some questionable things as root, and afterwards, I reverted my VM to a snapshot and it's like it never happened.)
Another option is looking at the "userland" (non-kernel) SCTP support in libusrsctp
, available in Homebrew. This won't get socat
working with SCTP, but may support your other hobby programming with it.