SCTP Programmer's Guide

3 Compiling and Running Applications that Use the SCTP
Socket APIs
This chapter discusses how to compile and run an application using the SCTP APIs.
SCTP offers one-to-one and one-to-many APIs. Applications can use these APIs to use
the protocol-specific features of SCTP.
The following libraries contain both the one-to-one and one-to-many APIs:
libxnet
libsctp
The libxnet library is an XOPEN library, and the libsctp library is an HP-specific
library.
This chapter addresses the following topics:
“Compiling Applications that Use the SCTP APIs” (page 69)
“Running Sample Applications that use the SCTP APIs” (page 70)
Compiling Applications that Use the SCTP APIs
Before compiling an application, ensure the following:
The SCTP product is installed in your system. The SCTP product is available for
download at:
http://www.software.hp.com
The XOPEN_SOURCE_EXTENDED macro is defined in the application program.
NOTE: If the macro is not defined in your application program, you can define
it while compiling the application.
To compile an application program that uses the SCTP APIs, enter the following
command at the HP-UX prompt:
# cc o <output_filename> -D_XOPEN_SOURCE_EXTENDED
<input_filename> -lxnet lsctp
where:
output_filename
Specifies the executable file name.
-D_XOPEN_SOURCE_EXTENDED Specifies the XOPEN macro. You need to specify
this macro while compiling only if you have not
defined it in your application program. For more
information on the XOPEN_SOURCE_EXTENDED
macro, see xopen_networking(7).
input_filename
Specifies the name of the application program.
Compiling Applications that Use the SCTP APIs 69