osx - homebrew socat on OS X Mountain Lion, sctp "Protocol not supported" -


i working hard on hobby program involves sctp protocol, grasp basics, tried install socat using homebrew, socat netcat-like tool testing various protocoles. without success on os x mountain lion far. here install & error log:

$ brew install socat ==> installing socat dependency: readline ==> downloading http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz ######################################################################## 100.0% tar: failed set default locale ==> patching patching file callback.c patching file input.c patching file patchlevel patching file support/shobj-conf patching file vi_mode.c ==> ./configure --prefix=/usr/local/cellar/readline/6.2.4 --mandir=/usr/local/ce ==> make install ==> caveats formula keg-only: not symlinked /usr/local.  os x provides bsd libedit library, shadows libreadline. in order prevent conflicts when programs libreadline defaulting gnu readline installation keg-only.  there no consequences of you. if build own software , requires formula, you'll need add build variables:      ldflags:  -l/usr/local/opt/readline/lib     cppflags: -i/usr/local/opt/readline/include  ==> summary ??  /usr/local/cellar/readline/6.2.4: 31 files, 1.6m, built in 34 seconds ==> installing socat ==> downloading http://www.dest-unreach.org/socat/download/socat-1.7.2.1.tar.bz2 ######################################################################## 100.0% tar: failed set default locale ==> downloading patches ######################################################################## 100.0% ==> patching patching file xioexit.c ==> ./configure --prefix=/usr/local/cellar/socat/1.7.2.1 --mandir=/usr/local/cel ==> make install   /usr/local/cellar/socat/1.7.2.1: 8 files, 624k, built in 41 seconds 

you see, homebrew finished compiling , installed socat successfully. verify sctp enabled

$ socat -v socat gerhard rieger - see www.dest-unreach.org socat version 1.7.2.1 on mar 25 2013 08:43:00    running on darwin version darwin kernel version 12.2.1: thu oct 18 12:13:47 pdt 2012; root:xnu-2050.20.9~1/release_x86_64, release 12.2.1, machine x86_64 features:   #define with_stdio 1   #define with_fdnum 1   #define with_file 1   #define with_creat 1   #define with_gopen 1   #define with_termios 1   #define with_pipe 1   #define with_unix 1   #undef with_abstract_unixsocket   #define with_ip4 1   #define with_ip6 1   #define with_rawip 1   #define with_genericsocket 1   #undef with_interface   #define with_tcp 1   #define with_udp 1   #define with_sctp 1   #define with_listen 1   #define with_socks4 1   #define with_socks4a 1   #define with_proxy 1   #define with_system 1   #define with_exec 1   #define with_readline 1   #undef with_tun   #define with_pty 1   #define with_openssl 1   #undef with_fips   #undef with_libwrap   #define with_sycls 1   #define with_filan 1   #define with_retry 1   #define with_msglevel 0 /*debug*/ 

to try simple sctp connection

$ socat -  sctp4:my_server:19191 2013/03/25 08:45:46 socat[18838] e socket(2, 1, 132): protocol not supported 

and failed. on socat homepage declares os x support, apparently sctp migh not. perhaps it's few people use sctp, , googled error everywhere , couldn't find useful yet.

i tried same thing on gentoo/debian server , both worked fine, can not make work under os x. new os x world, tips please?

looks os x header files aware of sctp protocol, libraries don't implement it. can hack in third-party extensions.

i same thing results on os x 10.8.3. when installing socat, detects sctp support in configure , sets with_sctp definition.

 $ ./configure | grep -i sctp configure: warning: include file netpacket/packet.h not found, disabling interface checking whether include sctp support... yes checking ipproto_sctp... yes 

however, if in configure, it's simple test. "whether include sctp support" whether --enable-sctp specified, , on default. , "checking ipproto_sctp" defines whether protocol constant defined in header files. is, headers aware of protocol , have value represent it, underlying system might not implement using. think that's case here: os x kernel doesn't provide sctp implementation.

there's "preliminary" third party support sctp under newer versions of os x: https://nplab.fh-muenster.de/groups/wiki/wiki/f366c/. installing got sctp working 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] socket(2, 1, 132) -> 3 2013/04/24 22:20:51 socat[291] starting accept loop 2013/04/24 22:20:51 socat[291] n listening on len=16 af=2 0.0.0.0:34463 

caution: third-party kernel extension, it's "preliminary", there's not whole lot of documentation, , can't vouch source. fragile, , may hard recover mistakes. in virtual machine, , not in main machine. vms great experimenting low level stuff , various machine configurations. (case in point: figure out question did bunch of messing around machine , questionable things root, , afterwards, reverted vm snapshot , it's never happened.)

another option looking @ "userland" (non-kernel) sctp support in libusrsctp, available in homebrew. won't socat working sctp, may support other hobby programming it.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -