SCTP Discussions

Text archives Help


[SCTP-Discussion] RE: Seagull with SCTP support un Solaris 10


Chronological Thread 
  • From: Martin Mayer <Martin.Mayer AT bridgewatersystems.com>
  • To: venugopal iyer <venu AT sun.com>, Michael Tüxen <Michael.Tuexen AT micmac.franken.de>
  • Cc: "gull-users AT lists.sourceforge.net" <gull-users AT lists.sourceforge.net>, "sctp-discussion AT sctp.de" <sctp-discussion AT sctp.de>, "sctp-questions AT sun.com" <sctp-questions AT sun.com>
  • Subject: [SCTP-Discussion] RE: Seagull with SCTP support un Solaris 10
  • Date: Fri, 12 Jun 2009 10:45:30 -0400
  • Accept-language: en-US
  • Acceptlanguage: en-US
  • List-archive: <http://lists.franken.de/pipermail/sctp-discussion>
  • List-id: SCTP Discussions <sctp-discussion.sctp.de>

OK, I have Seagull 1.8.0 with SCTP support running on Solaris 10.

Many thanks to all on TO list for your support. I am copying the various
discussion groups to share my solution in case others attempt this in the
future.

Here was the main issue: Seagull as distributed is built using sctplib and
socketapilib. This implementation of SCTP cannot coexist with another kernel
SCTP stack. Solaris 10 comes with SCTP and it cannot be disabled. Sun does
provide their own sctp library so I basically had to build Seagull to use
Sun's SCTP. There are surely multiple ways to solve this but here's how I did
it:

1- I installed sctplib-1.0.8 and socketapi-2.2.0. (I still had to do this
because seagull needs ext_socket.h which comes from socketapi. In turn,
socketapi needs sctplib...) I could have also removed all references to
ext_socket.h from seagull but I chose the other way which seemed simpler.

2- I moved the position of #ifndef DHAVE_KERNEL_SCTP in ext_socket.h under
the first #include group

3- I changed 2 source files in Seagull (here are the snippets, you can search
the code for context.
C_SocketSCTP.cpp
================
#ifdef SUN_SCTP
// Typo in member variable name from Sun
events.sctp_adaption_layer_event = 1;
#else
events.sctp_adaptation_layer_event = 1;
#endif

#ifdef SUN_SCTP
case SCTP_ADDR_AVAILABLE:
SOCKET_DEBUG(0, "C_SocketSCTPWithData::sctp_event_handler() " <<
"ASSOC PEER: ADDRESS AVAILABLE");
break;
#else
case SCTP_ADDR_REACHABLE:
SOCKET_DEBUG(0, "C_SocketSCTPWithData::sctp_event_handler() " <<
"ASSOC PEER: ADDRESS REACHABLE");
break;
#endif

#ifndef SUN_SCTP
case SCTP_ADDR_CONFIRMED:
SOCKET_DEBUG(0, "C_SocketSCTPWithData::sctp_event_handler() " <<
"ASSOC PEER: ADDRESS CONFIRMED");
break;
#endif

#ifdef SUN_SCTP
// Typo
case SCTP_ADAPTION_INDICATION:
#else
case SCTP_ADAPTATION_INDICATION:
#endif


C_TransSCTP.cpp
===============
C_TransSCTP::C_TransSCTP() : C_TransIP() {
#ifndef SUN_SCTP
// Assume library is already initialized by kernel
sctp_initLibrary();
#endif
}

T_SelectDef C_TransSCTP::select_definition() {
GEN_DEBUG(0, "C_TransSCTP::select_definition () ");
#ifdef SUN_SCTP
// ext_select does not exist... not sure what to return but this seems
to work.
return 0;
#else
return (&ext_select);
#endif
}

4- I changed compile options in ./seagull.svn/build.conf as follows:
# Sun OS library generation definition
BUILD_LIBEXTSCTP_CC_SUNOS_SUN4U=g++
BUILD_LIBEXTSCTP_CC_FLAGS_SUNOS_SUN4U="-I/usr/include/netinet -
I/usr/include -I/usr/local/include -D_GNU_SOURCE -D_REENTRANT -
DSCTP_SOCKET_API -Wall -Werror -DSUN_SCTP -DHAVE_KERNEL_SCTP "
BUILD_LIBEXTSCTP_LD_SUNOS_SUN4U=g++
BUILD_LIBEXTSCTP_LD_FLAGS_SUNOS_SUN4U="-G -fPIC -lxnet -lsocket -lposix4"
BUILD_LIBEXTSCTP_LD_LIBS_SUNOS_SUN4U="-L/usr/lib -lsctp -lpthread -
lsocket -lposix4 -lxnet"


Note that I did not perform extensive testing. Seagull starts up and connects
to it's Diameter peer via SCTP. That's all I tried. It's a start.

Here's my wish list:
1- Would be nice to be able to turn off SCTP in Solaris. That way, legacy
applications wouldn't have to be rebuilt to use Sun's SCTP.

2- socketapilib should support building using another SCTP library. I can see
the intention was there with the configure option --with-sctplib=DIR but it's
still expecting a static library which in Sun's case, is not available.

3- seagull: Well, it's open source... but the distribution could include some
notes on how to build with kernel SCTP.

Thank you all, and good luck to others trying this.


Kind regards,
Martin Mayer




  • [SCTP-Discussion] RE: Seagull with SCTP support un Solaris 10, Martin Mayer, 06/12/2009

Archive powered by MHonArc 2.6.19+.

Top of page