Subject: RE: Preprocessor constants indicated SCTP is available?

From: Tuexen Michael <[email-masked]>
Date: Thu, 31 Oct 2002 11:55:17 +0100

Dear all,

we use a constant 

HAVE_KERNEL_SCTP

to handle the case where an kernel implementation of SCTP is
available. If not our userland implementation is used.

It would be nice if kernel implementations could define
such a constant such we are able to provide SCTP services 
in userland if no kernel services are available.

However, it is not a big deal, but it would simplify things.

Best regards
Michael

Michael Tuexen   Tel.:   +49 89 722 47210
Siemens AG       Fax:    +49 89 722 48212
ICN WN CC SE 7   e-mail: [email-masked]

> -----Original Message-----
> From: Randall Stewart (cisco) [mailto:[email-masked]]
> Sent: Wednesday, October 30, 2002 9:28 PM
> To: Craig Rodrigues
> Cc: [email-masked]
> Subject: Re: Preprocessor constants indicated SCTP is available?
> 
> 
> 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
> 
> Craig Rodrigues wrote:
> 
> >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
> >  
> >
> 
> 
> -- 
> Randall R. Stewart
> ITD
> Cisco Systems Inc.
> [email-masked] 815-342-5222(cell) or 815-477-2127(office)
> 
> 
>

---

From: "Randall Stewart (cisco)" <[email-masked]>
Date: Thu, 31 Oct 2002 09:00:59 -0600

La Monte:

I jive with most of your items but I do have  questions:

_POSIX_SCTP_ESP
_POSIX_SCTP_IPAH - supports RFC2402 IP Authentication Header??,
_POSIX_SCTP_ISAKMP - supports RFC2408 ISAKMP??,
_POSIX_SCTP_IKE

How in the world are these SCTP things... if the O/S supports 
ESP/IPAH/IKE etc is
this not an issue with the underlying O/S?

I also assume that :

_POSIX_SCTP_SAFE_MAC - MAC secret key is cryptographic (RFC1750),

means that you are using a SHA-1 or MD5 type  encrytpt on the cookies?
Or do you mean it to mean we are using Good random numbers in pciking
the INIT-TSN and VTAG?

R

La Monte Henry Piggy Yarroll wrote:

>May I suggest the somewhat presumptuous _POSIX_SCTP?  We should also
>define _POSIX_SCTP_PRSCTP, _POSIX_SCTP_ADDIP, and similar symbols for
>any optional features in the RFC. 
>
>A quick scan of the MAY clauses shows mostly minor behavioral and
>implementation options.  The only ones I can IMAGINE being useful to
>an application writer are:
>
>_POSIX_SCTP_BUNDLING		- supports outbound bundling,
>_POSIX_SCTP_FRAGMENTATION	- supports outbound fragmentation,
>_POSIX_SCTP_ESP			- supports IP Encapsulating Security Payload,
>_POSIX_SCTP_ECN			- supports Explicit Congestion Notification,
>
>A quick scan of SHOULD clauses turns up:
>
>_POSIX_SCTP_HOSTNAME		- can generate HOSTNAME-based INITs,
>_POSIX_SCTP_SMALL_COOKIE	- implementation generates a small cookie :-),
>_POSIX_SCTP_RESTART		- generates RESTART notifications,
>_POSIX_SCTP_DELAYED_ACK		- implements delayed ACK,
>_POSIX_SCTP_GAP_ACK		- will generate SACK GAP ACK blocks,
>_POSIX_SCTP_DUP			- will generate SACK DUP reports,
>_POSIX_SCTP_REVOCATION		- can revoke GAP ACKd DATA,
>_POSIX_SCTP_GAP_DISABLES_DACK	- GAP reports disable delayed ACK,
>_POSIX_SCTP_PATH_FAILURE	- generates notification on path failure,
>_POSIX_SCTP_IPAH		- supports RFC2402 IP Authentication Header??,
>_POSIX_SCTP_ISAKMP		- supports RFC2408 ISAKMP??,
>_POSIX_SCTP_IKE			- supports RFC2409 Internet Key Exchange??,
>_POSIX_SCTP_SAFE_MAC		- MAC secret key is cryptographic (RFC1750),
>
>On Thu, 31 Oct 2002 11:55:17 +0100, Tuexen Michael <[email-masked]>
> wrote:
>  
>
>>Dear all,
>>
>>we use a constant 
>>
>>HAVE_KERNEL_SCTP
>>

---

From: "La Monte Henry Piggy Yarroll" <[email-masked]>
Date: Thu, 31 Oct 2002 08:25:37 -0600

---

From: Craig Rodrigues <[email-masked]>
Date: Thu, 31 Oct 2002 10:45:42 -0500

> _POSIX_SCTP_ECN			- supports Explicit Congestion Notification,

Lamonte,

You're on the right track for what I'm looking for.  
I think it is great, and will make writing portable code a lot easier!!
If all the SCTP implementations could agree on something, that would be super.
 
The only thing is, I caution you about using _POSIX_ as the prefix, since none
of these constants have gone through the standards process yet,
so they are not "officially"  approved by POSIX.

It might be OK, but I would consult with a standards guru before proceeding.

-- 
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: Thu, 31 Oct 2002 10:07:53 -0600

Craig:

Why don't we just use

_HAVE_SCTP_xxxxxx

and then define these all in the next pass of the sockets draft..
if posix standardizes it then you can do a

define _POSIX_SCTP_xxxx        _HAVE_SCTP_xxxx

R

---

From: Craig Rodrigues <[email-masked]>
Date: Thu, 31 Oct 2002 12:23:02 -0500

> define _POSIX_SCTP_xxxx        _HAVE_SCTP_xxxx

Sounds good to me.  I would even just leave the _HAVE prefix out of it.

#define _SCTP_xxxx 1

When the standards people realize what an awesome thing SCTP is, they
can do:
#define _POSIX_SCTP_xxx _SCTP_xxx

or whatever.

By the way, for those who are curious, the latest 
POSIX standard (IEEE Std 1003.1-2001) has merged with the
latest Single Unix Specification, and it is all free to read on the web:

http://www.opengroup.org/onlinepubs/007904975/toc.htm