Subject: Preprocessor constants indicated SCTP is available?

From: Craig Rodrigues <[email-masked]>
Date: Wed, 30 Oct 2002 10:31:39 -0500

Hi,

What preprocessor constants do the various SCTP implementations use
to indicate the presence of SCTP on a platform?

If I want to have a piece of code that optionally compiles in SCTP
stuff it is available on some platform, I'd like to do something like:

#include <unistd.h>
#include <sys/socket.h>

#ifdef SCTP_AVAILABLE

  sctp code here

#endif

The POSIX standard uses this approach.  For example, on a POSIX compliant
system, if you #include <unistd.h>, constants like
_POSIX_REALTIME_SIGNALS, _POSIX_THREADS, etc. will get defined
if those features are available on a system.

Thanksable on a system.

Thanks
-- 
Craig Rodrigues        Distributed Systems and Logistics, Office 6/325A
[email-masked]       BBN Technologies, a Verizon company
(617) 873-4725         Cambridge, MA

---

From: "Randall Stewart (cisco)" <[email-masked]>
Date: Wed, 30 Oct 2002 14:28:14 -0600

Craig:

Good question... maybe we should have some standard

SCTP_IS_PRESENT

defined in a standard place.. such as sctp.h

in lieu of this for the Apache APR work that I have been assiting in.. 
what they
did is fix their configure.in to generate a small program to do a

sd = socket(...,IPPROTO_SCTP);

and if it did NOT error it defines a apr.h variable

#define HAVE_SCTP 1

else if sd == -1

#define HAVE_SCTP 0

That way a

#if HAVE_SCTP

....

#endif

could be done in apache code..

R

-- 
Randall R. Stewart
ITD
Cisco Systems Inc.
[email-masked] 815-342-5222(cell) or 815-477-2127(office)