aboutsummaryrefslogtreecommitdiffstats
path: root/sualibrary/docs/en/index-1.html
blob: 22a6aa73a8fd856f248534542f6adff6d67d5e50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE>The Sualibrary Handbook: Introduction</TITLE>
 <LINK HREF="index-2.html" REL=next>

 <LINK HREF="index.html#toc1" REL=contents>
</HEAD>
<BODY>
<A HREF="index-2.html">Next</A>
Previous
<A HREF="index.html#toc1">Contents</A>
<HR>
<H2><A NAME="s1">1. Introduction</A></H2>


<H2><A NAME="s1.1">1.1 General concept</A></H2>
<P>

The sualib-0.1.0 library release is the product of a cooperation between Siemens AG (ICM), Munich, Germany and Siemens Atea, Herentals Belgium.

It has been developed since late 2000 and has been planned to become a fairly complete prototype implementation of the SCCP User Adaptation

(SUA) protocol as described in [1].
<P>

The API of the function library was modeled after the API of the SCTPLIB[2], and most parameters

an functions should be self-explanatory to the user familiar with this document. In addition to the interface

functions between an Upper Layer Protocol (ULP) and an SUA instance, the library also provides a

number of helper functions that can be used to manage callback function routines to make them execute at

a certain point of time (i.e. timer-based), which may then be used for an asynchronous interprocess communication.

<P>

All of these functions may be made use of by simply linking the static libsua-library to an application,

and including the file sua.h . As SUA runs on top of  SCTP which operates on top of IP, SCTP chose to open a raw socket to catch all incoming packets with the IP protocol id byte set to 132 (=SCTP). For this, it is necessary that an application using the library functions have privileges to do so. On most Unix machines that means this application has to be run by root (i.e. be made setuid 0).

An application making use of the libsua-library can expect to be able to manage a large number of

associations (e.g. as a server, all bound to one port) as well as handle several so-called SCTP instances,

which may work on several different ports. Ports of incoming packets are checked whether they belong to

an already existing association or may start a new one.

<P>

The concept of the library is the following: After registration of a first SUA instance, sockets are opened

and an application may register timer events, or file descriptors, that asynchronously trigger execution of

callback functions. The function callbacks for these routines are passed in the registration functions, and

callbacks for SUA events are passed in a SUA_ulpCallbacks(described more closely in sections 6.2.1

and 6.5).

Then the application either calls the possibly blocking function sua_eventLoop(). While calling the former, it will react to a previously scheduled timer or any file descriptor event (by executing the registered callback functions). In case a timer is scheduled at a very late point in time, and no events happen on registered file descriptors (e.g. sockets), the program will sleep (because the system call poll() is used. In this case, the control flow is handled by the library, and the user must register appropriate callbacks for events and timers before handing control over to the sua_eventLoop() function. The proper use of the sua_eventLoop() is explained in some simple example programs in section 7.


<P>
<H2><A NAME="ss1.2">1.2 Changes</A>
</H2>

Changes in comparison with sualibrary 0.0.5:
<P>
- portable to different UNIX versions<P>
- tested on both Linux and FreeBSD vs 4.4<P>
- tested with both IPv4 and IPv6 networks<P>
- msg syntax updated to <draft-ietf-sigtran-sua-12.txt> (example: DNS names)<P><UL>
<LI><A HREF="index-3.html#ss3.1">3.1 General usage of the SUA library</A>
<LI><A HREF="index-3.html#ss3.2">3.2 Features of the implementation</A>
<LI><A HREF="index-3.html#ss3.3">3.3 What is missing</A>
</UL>
<P>

<H2><A name="ss1.3">1.3 Nomenclature </A></H2>

Throughout this document,
<P>
_ function names are written as func_name(),<P>
_ function parameters as parameter,<P>
_ data types as typename, and<P>
_ file names as name_of_file.<P>
_ constants as CONSTANT<P>

<P>
<P>
<HR>
<A HREF="index-2.html">Next</A>
Previous
<A HREF="index.html#toc1">Contents</A>
</BODY>
</HTML>