├── .github
└── workflows
│ ├── freebsd.yml
│ ├── linux.yml
│ ├── multiarch.yml
│ └── packaging.yml
├── AUTHORS
├── BUGS
├── COPYING
├── ChangeLog
├── INSTALL
├── Makefile.am
├── Makefile.nmake
├── NEWS
├── README
├── README.win32
├── TODO
├── autogen.sh
├── bootstrap
├── ci
├── build-tool
├── ci-build
├── ci-install
├── ci-setup
├── ci-test
└── get-dependencies
├── config.nmake
├── configure.ac
├── debian
├── changelog
├── compat
├── control
├── copyright
├── libsctplib-dev.install
├── libsctplib1.install
├── libsctplib1.symbols
├── rules
├── sctplib-doc.doc-base
├── sctplib-doc.docs
├── source
│ ├── format
│ └── lintian-overrides
├── upstream
│ ├── metadata
│ └── signing-key.asc
└── watch
├── freebsd
└── sctplib
│ ├── Makefile
│ ├── distinfo
│ ├── pkg-descr
│ └── test-packaging
├── packaging.conf
├── rpm
└── sctplib.spec
├── sctplib
├── Makefile.am
├── docs
│ ├── Makefile.am
│ ├── en
│ │ ├── Makefile.am
│ │ ├── index-1.html
│ │ ├── index-2.html
│ │ ├── index-3.html
│ │ ├── index-4.html
│ │ ├── index-5.html
│ │ ├── index-6.html
│ │ ├── index.html
│ │ └── index.sgml
│ ├── sctplib
│ │ ├── Makefile.am
│ │ ├── doc.txt
│ │ ├── sctp-modules.fig
│ │ └── sctp-modules.png
│ └── sctplibDoxy.txt
├── manual
│ ├── Makefile.am
│ ├── commands.doc
│ ├── commands.html
│ ├── commands.pdf
│ ├── fixunder.sty
│ ├── functions.sty
│ ├── sctp-api.pdf
│ └── sctp-api.tex
├── programs
│ ├── Makefile.am
│ ├── Makefile.nmake
│ ├── chargen_server.c
│ ├── chat.c
│ ├── combined_server.c
│ ├── daytime_server.c
│ ├── discard_server.c
│ ├── echo_monitor.c
│ ├── echo_server.c
│ ├── echo_tool.c
│ ├── localcom.c
│ ├── main.c
│ ├── mini-ulp.c
│ ├── mini-ulp.h
│ ├── monitor.c
│ ├── parser.c
│ ├── script1
│ ├── script2
│ ├── sctp_wrapper.c
│ ├── sctp_wrapper.h
│ ├── sctptest.h
│ ├── terminal.c
│ ├── test_tool.c
│ ├── testengine.c
│ ├── testsctp-batch
│ └── testsctp.c
└── sctp
│ ├── Makefile.am
│ ├── Makefile.nmake
│ ├── SCTP-control.c
│ ├── SCTP-control.h
│ ├── adaptation.c
│ ├── adaptation.h
│ ├── auxiliary.c
│ ├── auxiliary.h
│ ├── bundling.h
│ ├── chunkHandler.c
│ ├── chunkHandler.h
│ ├── distribution.c
│ ├── distribution.h
│ ├── errorhandler.c
│ ├── errorhandler.h
│ ├── flowcontrol.c
│ ├── flowcontrol.h
│ ├── globals.c
│ ├── globals.h
│ ├── md5.c
│ ├── md5.h
│ ├── messages.h
│ ├── pathmanagement.c
│ ├── pathmanagement.h
│ ├── rbundling.c
│ ├── recvctrl.c
│ ├── recvctrl.h
│ ├── reltransfer.c
│ ├── reltransfer.h
│ ├── sbundling.c
│ ├── sctp.h
│ ├── streamengine.c
│ ├── streamengine.h
│ ├── timer_list.c
│ └── timer_list.h
├── website.config
└── win32-setup.sh
/.github/workflows/freebsd.yml:
--------------------------------------------------------------------------------
1 | # GitHub Actions Scripts
2 | # Copyright (C) 2021-2024 by Thomas Dreibholz
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU General Public License as published by
6 | # the Free Software Foundation, either version 3 of the License, or
7 | # (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 | #
17 | # Contact: dreibh@simula.no
18 |
19 | name: FreeBSD CI Tests
20 |
21 | on:
22 | push:
23 | branches:
24 | - master
25 | - dreibh/github-actions
26 | - dreibh/github-actions-freebsd
27 |
28 | jobs:
29 | build_job:
30 |
31 | # ###### Build matrix ###################################################
32 | strategy:
33 | matrix:
34 | include:
35 |
36 | # ====== FreeBSD 14.1 =============================================
37 | - label: "FreeBSD 14.1: Clang/x86_64"
38 | release: 14.1
39 | cc: clang
40 | cxx: clang++
41 |
42 |
43 | # ###### Build commands #################################################
44 | name: ${{ matrix.label }}
45 | runs-on: ubuntu-latest
46 | steps:
47 | - uses: actions/checkout@v4
48 | - name: Test in FreeBSD
49 | id: test
50 | uses: vmactions/freebsd-vm@v1
51 | with:
52 | release: ${{ matrix.release }}
53 | usesh: true
54 | run: |
55 | ASSUME_ALWAYS_YES=yes pkg install -y bash
56 | CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} ci/ci-setup compile
57 | CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} ci/ci-install compile
58 | CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} ci/ci-build compile
59 |
--------------------------------------------------------------------------------
/.github/workflows/linux.yml:
--------------------------------------------------------------------------------
1 | # GitHub Actions Scripts
2 | # Copyright (C) 2021-2024 by Thomas Dreibholz
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU General Public License as published by
6 | # the Free Software Foundation, either version 3 of the License, or
7 | # (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 | #
17 | # Contact: dreibh@simula.no
18 |
19 | name: Linux CI Tests
20 |
21 | on:
22 | push:
23 | branches:
24 | - master
25 | - dreibh/github-actions
26 |
27 | jobs:
28 | build_job:
29 |
30 | # ###### Build matrix ###################################################
31 | strategy:
32 | matrix:
33 | include:
34 |
35 | # ====== Ubuntu Linux =============================================
36 | - label: "Ubuntu 24.04 (Noble Numbat) with GCC"
37 | image: ubuntu:24.04
38 | cc: gcc
39 | cxx: g++
40 | - label: "Ubuntu 22.04 (Jammy Jellyfish) with GCC"
41 | image: ubuntu:22.04
42 | cc: gcc
43 | cxx: g++
44 | - label: "Ubuntu 20.04 (Focal Fossa) with GCC"
45 | image: ubuntu:20.04
46 | cc: gcc
47 | cxx: g++
48 |
49 | # ====== Debian Linux =============================================
50 | - label: "Debian 12 (Bookworm) with GCC"
51 | image: debian:bookworm
52 | cc: gcc
53 | cxx: g++
54 | - label: "Debian 11 (Bullseye) with GCC"
55 | image: debian:bullseye
56 | cc: gcc
57 | cxx: g++
58 |
59 | # ====== Fedora Linux =============================================
60 | - label: "Fedora 40 with Clang"
61 | image: fedora:40
62 | cc: clang
63 | cxx: clang++
64 |
65 |
66 | # ###### Build commands #################################################
67 | name: ${{ matrix.label }}
68 | runs-on: ubuntu-latest
69 | container:
70 | image: ${{ matrix.image }}
71 | steps:
72 | # NOTE: actions/checkout@v4 does not work for old Ubuntu 18.04!
73 | - uses: actions/checkout@v4
74 | - name: Build
75 | shell: bash
76 | run: |
77 | CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} ARCH= ci/ci-setup compile
78 | CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} ARCH= ci/ci-install compile
79 | CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} ARCH= ci/ci-build compile
80 |
--------------------------------------------------------------------------------
/.github/workflows/multiarch.yml:
--------------------------------------------------------------------------------
1 | # GitHub Actions Scripts
2 | # Copyright (C) 2021-2024 by Thomas Dreibholz
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU General Public License as published by
6 | # the Free Software Foundation, either version 3 of the License, or
7 | # (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 | #
17 | # Contact: dreibh@simula.no
18 |
19 | name: Linux Multi-Arch Tests
20 |
21 | on:
22 | push:
23 | branches:
24 | - master
25 | - dreibh/github-actions
26 |
27 | jobs:
28 | build_job:
29 |
30 | # ###### Build matrix ###################################################
31 | strategy:
32 | matrix:
33 | include:
34 |
35 | # ====== Ubuntu Linux =============================================
36 | - label: "Ubuntu 22.04 (Noble Numbat): Clang/ARMv8"
37 | arch: aarch64
38 | distro: ubuntu22.04
39 | cc: clang
40 | cxx: clang++
41 | - label: "Ubuntu 22.04 (Noble Numbat): GCC/S390x"
42 | arch: s390x
43 | distro: ubuntu22.04
44 | cc: gcc
45 | cxx: g++
46 | - label: "Ubuntu 22.04 (Noble Numbat): GCC/RISC-V"
47 | arch: riscv64
48 | distro: ubuntu22.04
49 | cc: gcc
50 | cxx: g++
51 |
52 | # ====== Debian Linux =============================================
53 | - label: "Debian 12 (Bookworm): GCC/i386"
54 | arch: i386
55 | distro: bookworm
56 | cc: gcc
57 | cxx: g++
58 | - label: "Debian 12 (Bookworm): Clang/ARMv7"
59 | arch: arm32v7
60 | distro: bookworm
61 | cc: clang
62 | cxx: clang++
63 |
64 | # ====== Fedora Linux =============================================
65 | - label: "Fedora 41: GCC/PPC64"
66 | arch: ppc64le
67 | distro: fedora41
68 | cc: gcc
69 | cxx: g++
70 |
71 |
72 | # ###### Build commands #################################################
73 | name: ${{ matrix.label }}
74 | runs-on: ubuntu-latest
75 | steps:
76 | - uses: actions/checkout@v4
77 | # NOTE: dreibh/run-on-arch-action provides the upstream
78 | # uraimo/run-on-arch-action action, with additional dockerfiles
79 | # needed for the builds here!
80 | - uses: dreibh/run-on-arch-action@dreibh/tests
81 | name: Build
82 | id: build
83 | with:
84 | arch: ${{ matrix.arch }}
85 | distro: ${{ matrix.distro }}
86 | run: |
87 | CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} ci/ci-setup compile
88 | CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} ci/ci-install compile
89 | CC=${{ matrix.cc }} CXX=${{ matrix.cxx }} ci/ci-build compile
90 |
--------------------------------------------------------------------------------
/.github/workflows/packaging.yml:
--------------------------------------------------------------------------------
1 | # GitHub Actions Scripts
2 | # Copyright (C) 2021-2024 by Thomas Dreibholz
3 | #
4 | # This program is free software: you can redistribute it and/or modify
5 | # it under the terms of the GNU General Public License as published by
6 | # the Free Software Foundation, either version 3 of the License, or
7 | # (at your option) any later version.
8 | #
9 | # This program is distributed in the hope that it will be useful,
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | # GNU General Public License for more details.
13 | #
14 | # You should have received a copy of the GNU General Public License
15 | # along with this program. If not, see .
16 | #
17 | # Contact: dreibh@simula.no
18 |
19 | name: Packaging CI Tests
20 |
21 | on:
22 | push:
23 | branches:
24 | - master
25 | - dreibh/github-actions
26 |
27 | jobs:
28 | # ====== Ubuntu Linux =====================================================
29 | ubuntu-packaging:
30 | name: Ubuntu Packaging
31 | runs-on: ubuntu-24.04
32 | steps:
33 | - uses: actions/checkout@v4
34 | - name: Packaging
35 | shell: bash
36 | run: |
37 | sudo CC=gcc CXX=g++ OS=ubuntu DIST=noble ARCH= ci/ci-setup package
38 | sudo CC=gcc CXX=g++ OS=ubuntu DIST=noble ARCH= ci/ci-install package
39 | sudo CC=gcc CXX=g++ OS=ubuntu DIST=noble ARCH= ci/ci-build package
40 | sudo ci/ci-test
41 |
42 | # ====== Debian Linux =====================================================
43 | debian-packaging:
44 | name: Debian Packaging
45 | runs-on: ubuntu-latest
46 | container:
47 | image: debian:unstable
48 | options: --privileged
49 | steps:
50 | - uses: actions/checkout@v4
51 | - name: Packaging
52 | shell: bash
53 | run: |
54 | CC=gcc CXX=g++ OS=debian DIST=unstable ARCH= ci/ci-setup package
55 | CC=gcc CXX=g++ OS=debian DIST=unstable ARCH= ci/ci-install package
56 | CC=gcc CXX=g++ OS=debian DIST=unstable ARCH= ci/ci-build package
57 | # ci/ci-test <- Not running on Ubuntu!
58 |
59 | # ====== Fedora Linux =====================================================
60 | fedora-packaging:
61 | name: Fedora Packaging
62 | runs-on: ubuntu-latest
63 | container:
64 | # Using Fedora 39 here, due to problems with Mock!
65 | # => https://github.com/rpm-software-management/mock/issues/1487
66 | image: fedora:39
67 | options: --privileged --cap-add=SYS_ADMIN
68 | steps:
69 | - uses: actions/checkout@v4
70 | - name: Packaging
71 | shell: bash
72 | run: |
73 | CC=clang CXX=clang++ ARCH= ci/ci-setup package
74 | CC=clang CXX=clang++ ARCH= ci/ci-install package
75 | CC=clang CXX=clang++ ARCH= ci/ci-build package
76 | ci/ci-test
77 |
--------------------------------------------------------------------------------
/AUTHORS:
--------------------------------------------------------------------------------
1 | The main authors:
2 |
3 | Andreas Jungmaier
4 | Thomas Dreibholz
5 | Michael Tüxen
6 | Herbert Hölzlwimmer
7 |
8 |
9 | Many thanks to all other contributors, such as:
10 |
11 | Gerd Bohnenstengel added new socket functions (RFC2292BIS)
12 | for Solaris8 and FreeBSD 4.2 KAME, 4.7.2001
13 | Marc Boucher
14 | Armando Caro
15 | Janardhan Iyengar
16 | Stefan Jansen
17 | Andreas Lang
18 | Alfred Lupper added defines for solaris, 27.6.2001
19 | Stephan Schulte
20 | Achim Weber
21 | Amedeo Bonfiglio
22 |
23 |
24 | and many others ...
25 |
26 | (if you belong here, just drop a note to thomas.dreibholz@gmail.com)
27 |
--------------------------------------------------------------------------------
/BUGS:
--------------------------------------------------------------------------------
1 | 1. Unrecognised Parameter in ch_addUnrecognizedParameter():
2 | Inhalt des Parameters wird nicht korrekt eingetragen. Wireshark meldet
3 | Malformed Packet.
4 |
5 | PROBLEM BEHOBEN!
6 |
7 | 2. Unrecognised Parameter in ch_enterErrorCauseData():
8 | Inhalt des Parameters wird nicht korrekt eingetragen. Wireshark meldet
9 | Malformed Packet.
10 |
11 | PROBLEM BEHOBEN!
12 |
13 |
14 | 3. Interface mit 2 globalen IPv6-Adressen, INIT auf 1. Adresse
15 | => INIT_ACK geht über 2. Adresse hinaus.
16 |
17 |
18 | 4. Bulk Transfer mit Fragmentierung:
19 | Abbruch nach SACK von letztem Fragment eines langen Chunks
20 | Grund: QueueStatusChange Notification wird bei SACK nicht gegeben.
21 |
22 | PROBLEM BEHOBEN!
23 |
--------------------------------------------------------------------------------
/INSTALL:
--------------------------------------------------------------------------------
1 | Note
2 | =================
3 | Special Option to be used when calling ./configure :
4 | ./configure --disable-ipv6 (guess what this does :-)
5 | ./configure --enable-shared (configures to build a shared version
6 | of the libsctp. This can be found in
7 | the subdirectory sctplib/sctp/.libs !)
8 |
9 |
10 | Basic Installation
11 | ==================
12 |
13 | These are generic installation instructions.
14 |
15 | The `configure' shell script attempts to guess correct values for
16 | various system-dependent variables used during compilation. It uses
17 | those values to create a `Makefile' in each directory of the package.
18 | It may also create one or more `.h' files containing system-dependent
19 | definitions. Finally, it creates a shell script `config.status' that
20 | you can run in the future to recreate the current configuration, a file
21 | `config.cache' that saves the results of its tests to speed up
22 | reconfiguring, and a file `config.log' containing compiler output
23 | (useful mainly for debugging `configure').
24 |
25 | If you need to do unusual things to compile the package, please try
26 | to figure out how `configure' could check whether to do them, and mail
27 | diffs or instructions to the address given in the `README' so they can
28 | be considered for the next release. If at some point `config.cache'
29 | contains results you don't want to keep, you may remove or edit it.
30 |
31 | The file `configure.in' is used to create `configure' by a program
32 | called `autoconf'. You only need `configure.in' if you want to change
33 | it or regenerate `configure' using a newer version of `autoconf'.
34 |
35 | The simplest way to compile this package is:
36 |
37 | 1. `cd' to the directory containing the package's source code and type
38 | `./configure' to configure the package for your system. If you're
39 | using `csh' on an old version of System V, you might need to type
40 | `sh ./configure' instead to prevent `csh' from trying to execute
41 | `configure' itself.
42 |
43 | Running `configure' takes a while. While running, it prints some
44 | messages telling which features it is checking for.
45 |
46 | 2. Type `make' to compile the package.
47 |
48 | 3. Type `make install' to install the programs and any data files and
49 | documentation.
50 |
51 | 4. You can remove the program binaries and object files from the
52 | source code directory by typing `make clean'.
53 |
54 | Compilers and Options
55 | =====================
56 |
57 | Some systems require unusual options for compilation or linking that
58 | the `configure' script does not know about. You can give `configure'
59 | initial values for variables by setting them in the environment. Using
60 | a Bourne-compatible shell, you can do that on the command line like
61 | this:
62 | CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
63 |
64 | Or on systems that have the `env' program, you can do it like this:
65 | env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
66 |
67 | Compiling For Multiple Architectures
68 | ====================================
69 |
70 | You can compile the package for more than one kind of computer at the
71 | same time, by placing the object files for each architecture in their
72 | own directory. To do this, you must use a version of `make' that
73 | supports the `VPATH' variable, such as GNU `make'. `cd' to the
74 | directory where you want the object files and executables to go and run
75 | the `configure' script. `configure' automatically checks for the
76 | source code in the directory that `configure' is in and in `..'.
77 |
78 | If you have to use a `make' that does not supports the `VPATH'
79 | variable, you have to compile the package for one architecture at a time
80 | in the source code directory. After you have installed the package for
81 | one architecture, use `make distclean' before reconfiguring for another
82 | architecture.
83 |
84 | Installation Names
85 | ==================
86 |
87 | By default, `make install' will install the package's files in
88 | `/usr/local/bin', `/usr/local/man', etc. You can specify an
89 | installation prefix other than `/usr/local' by giving `configure' the
90 | option `--prefix=PATH'.
91 |
92 | You can specify separate installation prefixes for
93 | architecture-specific files and architecture-independent files. If you
94 | give `configure' the option `--exec-prefix=PATH', the package will use
95 | PATH as the prefix for installing programs and libraries.
96 | Documentation and other data files will still use the regular prefix.
97 |
98 | If the package supports it, you can cause programs to be installed
99 | with an extra prefix or suffix on their names by giving `configure' the
100 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
101 |
102 | Optional Features
103 | =================
104 |
105 | Some packages pay attention to `--enable-FEATURE' options to
106 | `configure', where FEATURE indicates an optional part of the package.
107 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE
108 | is something like `gnu-as' or `x' (for the X Window System). The
109 | `README' should mention any `--enable-' and `--with-' options that the
110 | package recognizes.
111 |
112 | For packages that use the X Window System, `configure' can usually
113 | find the X include and library files automatically, but if it doesn't,
114 | you can use the `configure' options `--x-includes=DIR' and
115 | `--x-libraries=DIR' to specify their locations.
116 |
117 | Specifying the System Type
118 | ==========================
119 |
120 | There may be some features `configure' can not figure out
121 | automatically, but needs to determine by the type of host the package
122 | will run on. Usually `configure' can figure that out, but if it prints
123 | a message saying it can not guess the host type, give it the
124 | `--host=TYPE' option. TYPE can either be a short name for the system
125 | type, such as `sun4', or a canonical name with three fields:
126 | CPU-COMPANY-SYSTEM
127 |
128 | See the file `config.sub' for the possible values of each field. If
129 | `config.sub' isn't included in this package, then this package doesn't
130 | need to know the host type.
131 |
132 | If you are building compiler tools for cross-compiling, you can also
133 | use the `--target=TYPE' option to select the type of system they will
134 | produce code for and the `--build=TYPE' option to select the type of
135 | system on which you are compiling the package.
136 |
137 | Sharing Defaults
138 | ================
139 |
140 | If you want to set default values for `configure' scripts to share,
141 | you can create a site shell script called `config.site' that gives
142 | default values for variables like `CC', `cache_file', and `prefix'.
143 | `configure' looks for `PREFIX/share/config.site' if it exists, then
144 | `PREFIX/etc/config.site' if it exists. Or, you can set the
145 | `CONFIG_SITE' environment variable to the location of the site script.
146 | A warning: not all `configure' scripts look for a site script.
147 |
148 | Operation Controls
149 | ==================
150 |
151 | `configure' recognizes the following options to control how it
152 | operates.
153 |
154 | `--cache-file=FILE'
155 | Use and save the results of the tests in FILE instead of
156 | `./config.cache'. Set FILE to `/dev/null' to disable caching, for
157 | debugging `configure'.
158 |
159 | `--help'
160 | Print a summary of the options to `configure', and exit.
161 |
162 | `--quiet'
163 | `--silent'
164 | `-q'
165 | Do not print messages saying which checks are being made.
166 |
167 | `--srcdir=DIR'
168 | Look for the package's source code in directory DIR. Usually
169 | `configure' can determine that directory automatically.
170 |
171 | `--version'
172 | Print the version of Autoconf used to generate the `configure'
173 | script, and exit.
174 |
175 | `configure' also accepts some other, not widely useful, options.
176 |
177 |
--------------------------------------------------------------------------------
/Makefile.am:
--------------------------------------------------------------------------------
1 | SUBDIRS = sctplib
2 |
3 | EXTRA_DIST = \
4 | AUTHORS \
5 | COPYING \
6 | ChangeLog \
7 | INSTALL \
8 | README \
9 | TODO \
10 | config.nmake \
11 | Makefile.nmake \
12 | README.win32 \
13 | win32-setup.sh \
14 | debian/source/format \
15 | debian/source/lintian-overrides \
16 | debian/upstream/signing-key.asc \
17 | debian/upstream/metadata \
18 | debian/compat \
19 | debian/libsctplib-dev.install \
20 | debian/libsctplib1.install \
21 | debian/rules \
22 | debian/sctplib-doc.doc-base \
23 | debian/sctplib-doc.docs \
24 | debian/control \
25 | debian/copyright \
26 | debian/watch \
27 | debian/changelog \
28 | freebsd/sctplib/distinfo \
29 | freebsd/sctplib/pkg-descr \
30 | freebsd/sctplib/test-packaging \
31 | freebsd/sctplib/Makefile \
32 | rpm/sctplib.spec
33 |
34 | ACLOCAL_AMFLAGS = -I m4
35 |
--------------------------------------------------------------------------------
/Makefile.nmake:
--------------------------------------------------------------------------------
1 | ## Makefile for building sctp.lib and some servers with Microsoft C and nmake
2 | ## Use: nmake all -f makefile.nmake
3 | #
4 |
5 | include config.nmake
6 |
7 | all:
8 | cd sctplib\sctp
9 | nmake -f Makefile.nmake
10 | cd ..
11 | cd programs
12 | nmake all -f Makefile.nmake
13 | cd ..
14 |
15 | clean:
16 | cd sctplib\sctp
17 | nmake clean -f Makefile.nmake
18 | cd ..
19 | cd programs
20 | nmake clean -f Makefile.nmake
21 | cd ..
22 |
23 | REQUIRED_APPS=\
24 | $(SH) \
25 | unzip \
26 | wget
27 |
28 | verify_apps:
29 | @$(SH) win32-setup.sh --appverify $(REQUIRED_APPS)
30 |
31 | setup: verify_apps
32 | @$(SH) win32-setup.sh --download "$(WIN32_LIBS)" \
33 | glib gtk2.12/glib-2.14.3.zip
34 | @$(SH) win32-setup.sh --download "$(WIN32_LIBS)" \
35 | glib gtk2.12/glib-dev-2.14.3.zip
36 | @$(SH) win32-setup.sh --download "$(WIN32_LIBS)" \
37 | libiconv-1.9.1.bin.woe32 libiconv-1.9.1.bin.woe32.zip
38 | @$(SH) win32-setup.sh --download "$(WIN32_LIBS)" \
39 | gettext-0.14.5 gettext-0.14.5.zip
40 | copy $(WIN32_LIBS)\glib\bin\libglib-2.0-0.dll C:\WINDOWS\system32
41 | copy $(ICONV_DIR)\bin\iconv.dll C:\WINDOWS\system32
42 | copy $(GETTEXT_DIR)\bin\intl.dll C:\WINDOWS\system32
43 |
--------------------------------------------------------------------------------
/NEWS:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | ---------------------------------------------------------------------------------
2 |
3 | This source code repository contains an implementation of the
4 | Stream Control Transmission Protocol, as per RFC 4960.
5 |
6 | ---------------------------------------------------------------------------------
7 |
8 | Copyright (C) 2000 by Siemens AG, Munich, Germany.
9 | Copyright (C) 2001-2004 Andreas Jungmaier
10 | Copyright (C) 2004-2017 Thomas Dreibholz
11 |
12 | Realized in co-operation between Siemens AG and
13 | the Institute of Computer Networking Technology, University of
14 | Essen, Germany.
15 |
16 | Acknowledgement
17 | This work was partially funded by the Bundesministerium für Bildung und
18 | Forschung (BMBF) of the Federal Republic of Germany (Förderkennzeichen 01AK045).
19 | The authors alone are responsible for the contents.
20 |
21 | ---------------------------------------------------------------------------------
22 |
23 | Please note that you must have glib version 1.2 and/or 2.0 installed in order for
24 | the compilation to succeed! GLIB is a generic C-library for things like lists,
25 | arrays, timers etc. Should you not have it installed, you can obtain it for most
26 | OS's from ftp://www.gtk.org/pub/gtk/
27 |
28 | ---------------------------------------------------------------------------------
29 |
30 | Just use
31 | prompt> tar xvfz sctplib-1.0.14-XYZ.tar.gz
32 | and you get a new directory
33 | sctplib-1.0.14-XYZ
34 |
35 | cd into that and type
36 | ./configure
37 | or
38 | ./configure --help
39 |
40 |
41 | After that use make (or gmake under FreeBSD) to compile the
42 | library! Happy SCTPing! :-)
43 |
44 | It contains a number of files that are shortly described hereafter:
45 | AUTHORS : People who have produced this code.
46 | COPYING : The license to be applied for using/compiling/distributing
47 | this code.
48 | INSTALL : Basic installation notes.
49 | NEWS : Changes from release to release.
50 | README : This file
51 | TODO : A more or less complete list of missing features/known
52 | problems, etc.
53 | sctplib : A directory containig the files belonging to the SCTP
54 | implementation. This will contain the actual executable
55 | called .
56 | sctplib/sctp : contains the files for the actual library, which will be named
57 | libsctp.a. Also contains the necessary include file sctp.h
58 |
59 | sctplib/manual : A subdirectory containing some tex files and a PDF manual,
60 | describing general implementation features, the API, and
61 | the example programs. Now also in PostScript.
62 | PLEASE NOTE: THIS DOCUMENTATION IS SLIGHTLY OUT OF DATE !
63 | IF YOU DO NOT LIKE THIS, FEEL FREE TO CONTRIBUTE UPDATES...
64 | But promised: we will be working on that, and there will be
65 | a new manual after release of sctplib-1.0.14 !
66 |
67 | sctplib/docs: This subdirectory will contain documentation after the build
68 | process, that has been automatically derived from the source code.
69 |
--------------------------------------------------------------------------------
/README.win32:
--------------------------------------------------------------------------------
1 | 31/08/2009
2 |
3 | Sctplib for Windows
4 |
5 | * Download the latest sctplib sources (sctplib-1.0.9) and unpack them
6 | in a directory of your choice
7 |
8 | * In addition you need some files of the glib library.
9 |
10 | There are two ways to get the files installed:
11 |
12 | 1. If you have already Cygwin installed:
13 | o Make sure that Cygwin is installed with bash, wget and unzip
14 | o Go to sctplib-1.0.8 and type
15 | nmake setup -f Makefile.nmake
16 | o The glib files will be downloaded and unzipped in the
17 | directory C:\win32-libs
18 | o In case you want them unzipped in a different directory, you
19 | have to change the Variable WIN32_LIBS in config.nmake
20 |
21 | 2. If Cygwin is not installed on your computer:
22 | o Make a directory C:\win32-libs
23 | o Download gtk2.12/glib-2.14.3.zip and gtk2.12/glib-dev-2.14.3.zip preferably
24 | from http://anonsvn.wireshark.org/wireshark-win32-libs/tags/2007-11-20/packages
25 | o Unzip the files in C:\win32-libs\glib
26 | o Download libiconv-1.9.1.bin.woe32.zip and gettext-0.14.5.zip preferably
27 | from http://anonsvn.wireshark.org/wireshark-win32-libs/tags/2007-11-20/packages
28 | o Unzip the files in C:\win32-libs\libiconv-1.9.1.bin.woe32 and
29 | C:\win32-libs\gettext-0.14.5 respectively
30 | o In case you want them unzipped in a different directory, you have
31 | to change the Variable WIN32_LIBS in config.nmake
32 | o Copy glib\bin\libglib-2.0-0.dll libiconv-1.9.1.bin.woe32\bin\iconv.dll
33 |
34 | gettext-0.14.5\bin\intl.dll to C:\WINDOWS\system32
35 |
36 | * Now you can compile the sctplib and additional programs with
37 | nmake all -f Makefile.nmake.
38 |
--------------------------------------------------------------------------------
/TODO:
--------------------------------------------------------------------------------
1 | No, this implementation is NOT CARRIER GRADE :-)
2 |
3 | - Implement ICMP handling.
4 |
5 | ======================================================================
6 | Things to do:
7 | ======================================================================
8 | (these are minor things that should be cleaned up):
9 |
10 | -> check whether we delete an existing assoc, when we get a new
11 | INIT with invalid parameters (shouldn't happen)
12 |
13 | -> number of streams, and their defaults are now stored in distribution
14 | (for the defaults), streamengine (for the actual work), SCTP-control
15 | (for the negotiation). This is ugly. Any suggestions ?
16 |
17 | -> Error-Chunk-Handling must be further implemented, tested
18 |
19 | -> Calls to sctp_send() may only be done after CommmUP notification.
20 | This should be mentioned in the documentation...
21 |
22 | ======================================================================
23 |
24 |
25 | SHOWSTOPPERS :
26 | 1. update documentation to reflect latest changes. this is an
27 | eternal issue of software development...however, you may use
28 | doxygen to generate a fairly up to date documentation of all
29 | functions. Just type "make doxygen" in the sctplib/docs/
30 | directory (make sure doxygen is installed as /usr/bin/doxygen.
31 |
32 | 2. Send Sutdown-Ack back to the source address of the SHUTDOWN message !
33 |
34 | 3. Reinitialization of Associaton (Restart) may change association parameters
35 | (Number of streams, address-list etc.) -> needs testing !
36 | Restart may change IP addresses -> now we check only whether we have
37 | the same number of paths !
38 |
39 | 4. When we receive data froma previously deactivated path, that path
40 | should be activated ! Check this !
41 |
42 | ======================================================================
43 | NICE TO HAVE (we are working on this - slowly :-) :
44 | ======================================================================
45 | - use of the "Don't bundle" feature. (isn't this obsolete, really ? )
46 | This needs an API discussion first...as of now there does not seem
47 | to be a need for this feature.
48 |
49 | - SeizePort-Functions should use Bit-mapped array or something similar to
50 | store used ports. Then we could randomly use and free these.
51 |
52 | - Implemente SHA-1 as well as MD-5.
53 |
54 | - Replace timer lists by a more sophisticated data structure.
55 |
56 | - Add ECN support.
57 |
--------------------------------------------------------------------------------
/autogen.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Build Scripts
4 | # Copyright (C) 2002-2025 by Thomas Dreibholz
5 | #
6 | # This program is free software: you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation, either version 3 of the License, or
9 | # (at your option) any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | # GNU General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU General Public License
17 | # along with this program. If not, see .
18 | #
19 | # Contact: thomas.dreibholz@gmail.com
20 |
21 | # Bash options:
22 | set -eu
23 |
24 |
25 | CMAKE_OPTIONS=""
26 | COMMAND=""
27 | CORES=
28 |
29 | while [ $# -gt 0 ] ; do
30 | if [[ "$1" =~ ^(-|--)use-clang$ ]] ; then
31 | # Use these settings for CLang:
32 | export CXX=clang++
33 | export CC=clang
34 | elif [[ "$1" =~ ^(-|--)use-clang-scan-build$ ]] ; then
35 | # Use these settings for CLang:
36 | export CXX=clang++
37 | export CC=clang
38 | # Ensure build with CLang Static Analyzer
39 | mkdir -p scan-build-reports
40 | COMMAND="scan-build -o scan-build-reports"
41 | elif [[ "$1" =~ ^(-|--)use-gcc$ ]] ; then
42 | # Use these settings for GCC:
43 | export CXX=g++
44 | export CC=gcc
45 | elif [[ "$1" =~ ^(-|--)use-gcc-analyzer$ ]] ; then
46 | # Use these settings for GCC:
47 | export CXX=g++
48 | export CC=gcc
49 | export CFLAGS=-fanalyzer
50 | export CXXFLAGS=-fanalyzer
51 | CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON"
52 | CORES=1 # The analyzer takes a *huge* amount of memory!
53 | elif [[ "$1" =~ ^(-|--)debug$ ]] ; then
54 | # Enable debugging build:
55 | CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_BUILD_TYPE=Debug"
56 | elif [[ "$1" =~ ^(-|--)release$ ]] ; then
57 | # Enable debugging build:
58 | CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_BUILD_TYPE=Release"
59 | elif [[ "$1" =~ ^(-|--)release-with-debinfo$ ]] ; then
60 | # Enable debugging build:
61 | CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_BUILD_TYPE=RelWithDebInfo"
62 | elif [[ "$1" =~ ^(-|--)verbose$ ]] ; then
63 | # Enable verbose Makefile:
64 | CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_VERBOSE_MAKEFILE=ON"
65 | elif [[ "$1" =~ ^(-|--)cores ]] ; then
66 | if [[ ! "$2" =~ ^[0-9]*$ ]] ; then
67 | echo >&2 "ERROR: Number of cores must be an integer number!"
68 | exit 1
69 | fi
70 | CORES="$2"
71 | shift
72 | elif [ "$1" == "--" ] ; then
73 | shift
74 | break
75 | else
76 | echo >&2 "Usage: autogen.sh [--use-clang|--use-clang-scan-build|--use-gcc|--use-gcc-analyzer] [--debug|--release|--release-with-debinfo] [--cores N] [--verbose] -- (further CMake/Configure options)"
77 | exit 1
78 | fi
79 | shift
80 | done
81 |
82 | if [ "$(uname)" != "FreeBSD" ] ; then
83 | installPrefix="/usr"
84 | else
85 | installPrefix="/usr/local"
86 | fi
87 |
88 |
89 | # ====== Configure with CMake ===============================================
90 | if [ -e CMakeLists.txt ] ; then
91 | rm -f CMakeCache.txt
92 | if [ "$*" != "" ] ; then
93 | CMAKE_OPTIONS="${CMAKE_OPTIONS} $*"
94 | fi
95 | echo "CMake options:${CMAKE_OPTIONS} . -DCMAKE_INSTALL_PREFIX=\"${installPrefix}\""
96 | # shellcheck disable=SC2048,SC2086
97 | ${COMMAND} cmake ${CMAKE_OPTIONS} . -DCMAKE_INSTALL_PREFIX="${installPrefix}"
98 |
99 | # ====== Configure with AutoConf/AutoMake ===================================
100 | elif [ -e bootstrap ] ; then
101 | ./bootstrap
102 | ./configure $*
103 |
104 | else
105 | echo >&2 "ERROR: Failed to configure with CMake or AutoMake/AutoConf!"
106 | exit 1
107 | fi
108 |
109 |
110 | # ====== Obtain number of cores =============================================
111 | # Try Linux
112 | if [ "${CORES}" == "" ] ; then
113 | CORES=$(getconf _NPROCESSORS_ONLN 2>/dev/null || true)
114 | if [ "${CORES}" == "" ] ; then
115 | # Try FreeBSD
116 | CORES=$(sysctl -a | grep 'hw.ncpu' | cut -d ':' -f2 | tr -d ' ' || true)
117 | fi
118 | if [ "${CORES}" == "" ] ; then
119 | CORES="1"
120 | fi
121 | echo "This system has ${CORES} cores!"
122 | fi
123 |
124 |
125 | # ====== Build ==============================================================
126 | ${COMMAND} make -j"${CORES}"
127 |
--------------------------------------------------------------------------------
/bootstrap:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | set -x
3 |
4 | rm -rf admin
5 | mkdir admin
6 |
7 | if [ -e /usr/bin/glibtoolize ] ; then
8 | glibtoolize --force
9 | elif [ -e /usr/bin/libtoolize ] ; then
10 | libtoolize --force
11 | elif [ -e /usr/local/bin/libtoolize ] ; then
12 | libtoolize --force
13 | else
14 | echo "ERROR: I cannot find libtoolize or glibtoolize!"
15 | exit 1
16 | fi
17 |
18 | if [ -e /usr/local/share/aclocal ] ; then
19 | aclocal -I /usr/local/share/aclocal
20 | else
21 | aclocal -I /usr/share/aclocal
22 | fi
23 | autoheader
24 | automake --gnu --add-missing --copy
25 | autoconf
26 |
--------------------------------------------------------------------------------
/ci/ci-build:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # GitHub Actions Scripts
4 | # Copyright (C) 2021-2024 by Thomas Dreibholz
5 | #
6 | # This program is free software: you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation, either version 3 of the License, or
9 | # (at your option) any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | # GNU General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU General Public License
17 | # along with this program. If not, see .
18 | #
19 | # Contact: thomas.dreibholz@gmail.com
20 |
21 | # Bash options:
22 | set -eu
23 |
24 |
25 | # ====== Check arguments ====================================================
26 | if [ $# -lt 1 ] ; then
27 | echo >&2 "Usage: $0 compile|package|... ..."
28 | exit 1
29 | fi
30 |
31 |
32 | # ====== Check/set environment variables ====================================
33 | DIRNAME="$(dirname "$0")"
34 | UNAME="$(uname)"
35 | if [ ! -e /etc/os-release ] ; then
36 | echo >&2 "ERROR: /etc/os-release does not exist!"
37 | exit 1
38 | fi
39 | . /etc/os-release
40 |
41 |
42 | # ###### Configure ##########################################################
43 |
44 | # ====== Configure with CMake ===============================================
45 | if [ -e CMakeLists.txt ] ; then
46 | cmake .
47 |
48 | # ====== Configure with autoconf/automake (via bootstrap script) ============
49 | elif [ -e configure.ac ] || [ -e configure.in ] ; then
50 | if [ -e autogen.sh ] ; then
51 | ./autogen.sh
52 | elif [ -e bootstrap ] ; then
53 | ./bootstrap
54 | ./configure
55 | else
56 | ./configure
57 | fi
58 | else
59 | echo >&2 "WARNING: No build system detected. Trying to just call \"make\" ..."
60 | fi
61 |
62 | # ====== Obtain MAKEFLAGS to utilise all cores ==============================
63 | if [ "${UNAME}" == "Linux" ] ; then
64 | cores=$(getconf _NPROCESSORS_ONLN 2>/dev/null || true)
65 | MAKEFLAGS="-j${cores}"
66 | elif [ "${UNAME}" == "FreeBSD" ] ; then
67 | cores=$(sysctl -a | grep 'hw.ncpu' | cut -d ':' -f2 | tr -d ' ')
68 | MAKEFLAGS="-j${cores}"
69 | else
70 | MAKEFLAGS=""
71 | fi
72 |
73 |
74 | # ###### Perform builds #####################################################
75 | while [ $# -gt 0 ] ; do
76 | TOOL="$1"
77 | shift
78 |
79 |
80 | # ====== Compile =========================================================
81 | if [ "${TOOL}" == "compile" ] ; then
82 |
83 | MAKEFLAGS=${MAKEFLAGS} make # VERBOSE=1
84 |
85 |
86 | # # ====== Coverity Scan ===================================================
87 | # elif [ "${TOOL}" == "coverity" ] ; then
88 | # # ------ Build --------------------------------------------------------
89 | # cd coverity
90 | # export PATH="coverity/$(ls -d cov*)/bin:$PATH"
91 | # cd ..
92 | #
93 | # MAKEFLAGS=${MAKEFLAGS} cov-build --dir cov-int make
94 | # tar czf coverity-results.tar.gz cov-int
95 | # ls -l coverity-results.tar.gz
96 | #
97 | # # ------ Upload results -----------------------------------------------
98 | # if [ "${TRAVIS_BRANCH}" == "${COVERITY_SCAN_BRANCH}" ] ; then
99 | # curl --form token=${COVERITY_SCAN_TOKEN} \
100 | # --form email=${COVERITY_SCAN_NOTIFICATION_EMAIL} \
101 | # --form file=@coverity-results.tar.gz \
102 | # --form version="master branch head" \
103 | # --form description="$(git log -1|head -1)" \
104 | # https://scan.coverity.com/builds?project=${COVERITY_PROJECT}
105 | # CURL_RESULT=$?
106 | # echo "curl returned ${CURL_RESULT}"
107 | # if [ $CURL_RESULT -ne 0 ]; then
108 | # echo >&2 "ERROR: Upload to Coverity Scan failed; curl returned ${CURL_RESULT}!"
109 | # exit 1
110 | # fi
111 | # else
112 | # echo >&2 "###### NOTE: This branch \"${TRAVIS_BRANCH}\" is not the scan branch \"${COVERITY_SCAN_BRANCH}\"! Skipping upload! ######"
113 | # fi
114 |
115 |
116 | # ====== Package =======================================================
117 | elif [ "${TOOL}" == "package" ] ; then
118 |
119 | if [ ! -v OS ] || [ "${OS}" == "" ] ; then
120 | OS="${ID}"
121 | fi
122 | if [ ! -v ARCH ] || [ "${ARCH}" == "" ] ; then
123 | ARCH="$(uname -m)"
124 | fi
125 |
126 | if [ "${OS}" == "ubuntu" ] || [ "${OS}" == "debian" ] ; then
127 | architecture="${ARCH//x86_64/amd64}"
128 | if [ ! -v DIST ] || [ "${DIST}" == "" ] ; then
129 | distribution="${VERSION_CODENAME}"
130 | else
131 | distribution="${DIST}"
132 | fi
133 | "${DIRNAME}"/build-tool build-deb "${distribution}" --skip-signing --architecture="${architecture}"
134 |
135 | # ====== Fedora ==========================================================
136 | elif [ "${OS}" == "fedora" ] ; then
137 |
138 | architecture="${ARCH}"
139 | if [ ! -v DIST ] || [ "${DIST}" == "" ] ; then
140 | distribution="${VERSION_ID}"
141 | else
142 | distribution="${DIST}"
143 | fi
144 | LD_PRELOAD=/usr/lib64/nosync/nosync.so \
145 | "${DIRNAME}"/build-tool build-rpm "fedora-${distribution}" --skip-signing --architecture="${architecture}"
146 |
147 | # ====== Unknown =========================================================
148 | else
149 | echo >&2 "ERROR: Unsupported distribution ${ID} for packaging!"
150 | exit 1
151 | fi
152 |
153 |
154 | # ====== Invalid setting =================================================
155 | else
156 | echo >&2 "ERROR: Invalid setting of TOOL=${TOOL}!"
157 | exit 1
158 | fi
159 |
160 | done
161 |
--------------------------------------------------------------------------------
/ci/ci-install:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # GitHub Actions Scripts
4 | # Copyright (C) 2021-2024 by Thomas Dreibholz
5 | #
6 | # This program is free software: you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation, either version 3 of the License, or
9 | # (at your option) any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | # GNU General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU General Public License
17 | # along with this program. If not, see .
18 | #
19 | # Contact: thomas.dreibholz@gmail.com
20 |
21 | # Bash options:
22 | set -eu
23 |
24 |
25 | DIRNAME="$(dirname "$0")"
26 | "${DIRNAME}"/get-dependencies --install
27 |
--------------------------------------------------------------------------------
/ci/ci-setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # GitHub Actions Scripts
4 | # Copyright (C) 2021-2024 by Thomas Dreibholz
5 | #
6 | # This program is free software: you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation, either version 3 of the License, or
9 | # (at your option) any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | # GNU General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU General Public License
17 | # along with this program. If not, see .
18 | #
19 | # Contact: thomas.dreibholz@gmail.com
20 |
21 | # Bash options:
22 | set -eu
23 |
24 |
25 | # ====== Check arguments ====================================================
26 | USE_PACKAGING=0
27 | while [ $# -gt 0 ] ; do
28 | if [ "$1" == "package" ] ; then
29 | USE_PACKAGING=1
30 | fi
31 | shift
32 | done
33 |
34 |
35 | # ====== Check/set environment variables ====================================
36 | if [ ! -e /etc/os-release ] ; then
37 | echo >&2 "ERROR: /etc/os-release does not exist!"
38 | exit 1
39 | fi
40 | . /etc/os-release
41 |
42 |
43 | # ====== Ubuntu/Deban =======================================================
44 | if [ "${ID}" == "ubuntu" ] || [ "${ID}" == "debian" ] ; then
45 | PACKAGES="python3 python3-distro"
46 | if [ -v CC ] ; then
47 | if [[ "${CC}" =~ .*gcc.* ]] ; then
48 | PACKAGES="${PACKAGES} gcc"
49 | elif [[ "${CC}" =~ .*clang.* ]] ; then
50 | PACKAGES="${PACKAGES} clang"
51 | fi
52 | fi
53 | if [ ${USE_PACKAGING} -eq 1 ] ; then
54 | # Need to install pbuilder as well:
55 | PACKAGES="${PACKAGES} build-essential debian-archive-keyring debian-ports-archive-keyring devscripts distro-info eatmydata fakeroot pbuilder qemu-user-static sudo"
56 | fi
57 |
58 | apt-get update -qq
59 | # DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -qy
60 | # shellcheck disable=SC2086
61 | DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::=--force-confold -o Dpkg::Options::=--force-confdef --no-install-recommends \
62 | ${PACKAGES}
63 |
64 | if [ "${ID}" == "ubuntu" ] ; then
65 | # Add PPA dreibh/ppa for Ubuntu:
66 | DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::=--force-confold -o Dpkg::Options::=--force-confdef --no-install-recommends \
67 | software-properties-common
68 | apt-add-repository -y ppa:dreibh/ppa || true
69 | apt-get update -q
70 | fi
71 |
72 | if [ ${USE_PACKAGING} -eq 1 ] ; then
73 | # ====== pbuilder environment =========================================
74 | # Example for GitHub Actions:
75 | # https://github.com/jrl-umi3218/github-actions/tree/master/setup-pbuilder
76 |
77 | if [ ! -v OS ] || [ "${OS}" == "" ] ; then
78 | OS="${ID}"
79 | fi
80 | if [ ! -v DIST ] || [ "${DIST}" == "" ] ; then
81 | DIST="${VERSION_CODENAME}"
82 | fi
83 | if [ ! -v ARCH ] || [ "${ARCH}" == "" ] ; then
84 | ARCH="$(dpkg --print-architecture)"
85 | fi
86 |
87 | if [ "${OS}" == "ubuntu" ] ; then
88 | COMPONENTS="main universe"
89 | MIRRORSITE=http://dk.archive.ubuntu.com/ubuntu/
90 | KEYRING="/usr/share/keyrings/ubuntu-archive-keyring.gpg"
91 | elif [ "${OS}" == "debian" ] ; then
92 | COMPONENTS="main"
93 | if [ "${ARCH}" == "m68k" ] || [ "${ARCH}" == "riscv64" ] ; then
94 | # Debian Ports (special architectures)
95 | MIRRORSITE="http://ftp.ports.debian.org/debian-ports/"
96 | KEYRING="/usr/share/keyrings/debian-ports-archive-keyring.gpg"
97 | else
98 | # Debian (supported architectures)
99 | MIRRORSITE="http://ftp.dk.debian.org/debian/"
100 | KEYRING="/usr/share/keyrings/debian-archive-keyring.gpg"
101 | fi
102 | else
103 | echo >&2 "ERROR: Unknown distribution ${ID}!"
104 | exit 1
105 | fi
106 |
107 | cores=$(getconf _NPROCESSORS_ONLN 2>/dev/null || true)
108 | cat >/etc/pbuilderrc < /etc/dpkg/dpkg.cfg.d/02apt-speedup" | \
153 | OS="${OS}" DISTRIBUTION="${DIST}" ARCHITECTURE="${ARCH}" pbuilder login --save-after-exec
154 |
155 | # ====== Add ppa:dreibh/ppa, updates and backports =================
156 | if [ "${OS}" == "ubuntu" ] ; then
157 | # Add PPA dreibh/ppa for Ubuntu:
158 | OS="${OS}" DISTRIBUTION="${DIST}" ARCHITECTURE="${ARCH}" pbuilder login --save-after-login <&2 "ERROR: Unable to inject PPA configuration into Mock configuration file /etc/mock/${OS}-${DIST}-${ARCH}.cfg!"
201 | exit 1
202 | fi
203 | fi
204 | fi
205 |
206 |
207 | # ====== FreeBSD ============================================================
208 | elif [ "${ID}" == "freebsd" ] ; then
209 | PACKAGES="autoconf automake bash gcc libtool git python3 py311-distro"
210 |
211 | # shellcheck disable=SC2086
212 | ASSUME_ALWAYS_YES=yes pkg install -y ${PACKAGES}
213 |
214 | if [ ! -e /usr/ports/.git ] ; then
215 | rm -rf /usr/ports/* /usr/ports/.??* || true
216 | mkdir -p /usr/ports
217 | cd /usr/ports
218 | git init -b main
219 | git remote add freebsd https://git.freebsd.org/ports.git
220 | git remote set-url --push freebsd ssh://git@gitrepo.freebsd.org/ports.git
221 | git config --add remote.freebsd.fetch "+refs/notes/*:refs/notes/*"
222 | git config pull.rebase true
223 | git pull --depth=1 freebsd main
224 | git branch --set-upstream-to=freebsd/main main
225 | fi
226 |
227 | # ====== Unknown ============================================================
228 | else
229 |
230 | echo >&2 "ERROR: Unknown distribution ${ID}!"
231 | exit 1
232 |
233 | fi
234 |
--------------------------------------------------------------------------------
/ci/ci-test:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # GitHub Actions Scripts
4 | # Copyright (C) 2021-2024 by Thomas Dreibholz
5 | #
6 | # This program is free software: you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation, either version 3 of the License, or
9 | # (at your option) any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | # GNU General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU General Public License
17 | # along with this program. If not, see .
18 | #
19 | # Contact: thomas.dreibholz@gmail.com
20 |
21 | # Bash options:
22 | set -eu
23 |
24 |
25 | # ====== Check/set environment variables ====================================
26 | ID="$(uname)"
27 | if [ ! -e /etc/os-release ] ; then
28 | echo >&2 "ERROR: /etc/os-release does not exist!"
29 | exit 1
30 | fi
31 | . /etc/os-release
32 |
33 |
34 | # ====== Ubuntu/Deban =======================================================
35 | if [ "${ID}" == "ubuntu" ] || [ "${ID}" == "debian" ] ; then
36 |
37 | # ====== pbuilder environment ============================================
38 | CHANGELOG_HEADER="$(head -n1 debian/changelog)"
39 | # PACKAGE="$(echo "${CHANGELOG_HEADER}" | sed -e "s/(.*//" -e "s/ //g")"
40 | PACKAGE_VERSION="$(echo "${CHANGELOG_HEADER}" | sed -e "s/.*(//" -e "s/).*//" -e "s/ //g" -e "s/ //g" -e "s/^[0-9]://g")"
41 | # shellcheck disable=SC2001
42 | OUTPUT_VERSION="$(echo "${PACKAGE_VERSION}" | sed -e "s/\(ubuntu\|ppa\)[0-9]*$/\1/")"
43 | # shellcheck disable=SC2001
44 | DEBIAN_VERSION="$(echo "${OUTPUT_VERSION}" | sed -e "s/\(ubuntu\|ppa\)$//1")"
45 |
46 | packages=""
47 | if [ $# -eq 0 ] ; then
48 | echo "Looking for *${DEBIAN_VERSION}*.deb in /var/cache/pbuilder/result ..."
49 | packages="$(find /var/cache/pbuilder/result -name "*${DEBIAN_VERSION}*.deb")"
50 | fi
51 | while [ $# -gt 0 ] ; do
52 | echo "Looking for $1*${DEBIAN_VERSION}*.deb in /var/cache/pbuilder/result ..."
53 | packages="${packages} $(find /var/cache/pbuilder/result -name "$1*${DEBIAN_VERSION}*.deb")"
54 | shift
55 | done
56 | packages=$(echo "${packages}" | xargs -n1 | sort -u | xargs)
57 | if [ "${packages}" == "" ] ; then
58 | echo >&2 "ERROR: No packages have been found!"
59 | exit 1
60 | fi
61 |
62 | echo "Installing ${packages} ..."
63 | # shellcheck disable=SC2086
64 | DEBIAN_FRONTEND=noninteractive eatmydata apt-get install -fy ${packages} || {
65 | echo "NOTE: apt-get failed -> trying dpkg instead of apt-get for local file!"
66 | # NOTE: Older "apt-get" versions do not handle local files!
67 | # shellcheck disable=SC2086
68 | if ! DEBIAN_FRONTEND=noninteractive eatmydata dpkg -i "${packages}" ; then
69 | echo "There may be some dependencies missing. Trying to install them ..."
70 | DEBIAN_FRONTEND=noninteractive eatmydata apt-get install -fy -o Dpkg::Options::="--force-confold" -o Dpkg::Options::="--force-confdef" --no-install-recommends
71 | echo "Retrying to install ${packages} ..."
72 | DEBIAN_FRONTEND=noninteractive eatmydata dpkg -i ${packages}
73 | fi
74 | }
75 | echo "Done!"
76 |
77 |
78 | # ====== Fedora =============================================================
79 | elif [ "${ID}" == "fedora" ] ; then
80 |
81 | # ====== mock environment ================================================
82 | # PACKAGE=$(grep "^Name:" rpm/*.spec | head -n1 | sed -e "s/Name://g" -e "s/[ \t]*//g")
83 | PACKAGE_VERSION=$(grep "^Version:" rpm/*.spec | head -n1 | sed -e "s/Version://g" -e "s/[ \t]*//g")
84 |
85 | release=$(bash -c "LANG=C.UTF-8 ; cat /etc/fedora-release | sed -e \"s/^\(.*\) release \([0-9]*\) (\(.*\))$/\2/g\"" | sed -e "s/[^0-9]//g")
86 | arch=$(uname -m | sed -e "s/[^0-9a-zA-Z_+-]//g")
87 | if ! cd /var/lib/mock/fedora-"${release}"-"${arch}"/result ; then
88 | if cd /var/lib/mock/fedora-rawhide-"${arch}"/result ; then
89 | release="rawhide"
90 | else
91 | echo >&2 "ERROR: No results have been found!"
92 | exit 1
93 | fi
94 | fi
95 |
96 | packages=""
97 | if [ $# -eq 0 ] ; then
98 | echo "Looking for *${PACKAGE_VERSION}*.rpm in /var/lib/mock/fedora-${release}-${arch}/result ..."
99 | packages="$(find /var/lib/mock/fedora-"${release}"-"${arch}"/result -name "*${PACKAGE_VERSION}*.rpm" | grep -v "\.src\.rpm$")"
100 | fi
101 | while [ $# -gt 0 ] ; do
102 | echo "Looking for $1*${PACKAGE_VERSION}*.rpm in /var/lib/mock/fedora-${release}-${arch}/result ..."
103 | packages="${packages} $(find /var/lib/mock/fedora-"${release}"-"${arch}"/result -name "$1*${PACKAGE_VERSION}*.rpm" | grep -v "\.src\.rpm$")"
104 | shift
105 | done
106 | packages=$(echo "${packages}" | xargs -n1 | sort -u | xargs)
107 | if [ "${packages}" == "" ] ; then
108 | echo >&2 "ERROR: No packages have been found!"
109 | exit 1
110 | fi
111 |
112 | echo "Installing ${packages} ..."
113 | # shellcheck disable=SC2086
114 | LD_PRELOAD=/usr/lib64/nosync/nosync.so dnf install -y --allowerasing ${packages}
115 | echo "Done!"
116 |
117 |
118 | # ====== FreeBSD ============================================================
119 | elif [ "${ID}" == "freebsd" ] ; then
120 |
121 | # TDB
122 | true
123 |
124 |
125 | # ====== Unknown ============================================================
126 | else
127 |
128 | echo >&2 "ERROR: Unexpected system ${ID}!"
129 | exit 1
130 |
131 | fi
132 |
--------------------------------------------------------------------------------
/ci/get-dependencies:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | # -*- coding: utf-8 -*-
3 | #
4 | # GitHub Actions Scripts
5 | # Copyright (C) 2018-2025 by Thomas Dreibholz
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, either version 3 of the License, or
10 | # (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU General Public License
18 | # along with this program. If not, see .
19 | #
20 | # Contact: thomas.dreibholz@gmail.com
21 |
22 | import distro
23 | import glob
24 | import os
25 | import re
26 | import subprocess
27 | import sys
28 |
29 |
30 | # ###### Extract Deb file dependencies ######################################
31 | debDepLine = re.compile(r'^(.*:[ \t]*)(.*)$')
32 | debDepItem = re.compile(r'^([a-zA-Z0-9-+\.]+)[\s]*(|\|.*|\(.*)[\s]*$')
33 | def extractDebDependencies(line, system):
34 | dependencies = []
35 | distribution = distro.codename()
36 |
37 | # Remove "build-depends:", etc.:
38 | m = debDepLine.match(line)
39 | if m != None:
40 | line = m.group(2)
41 | line = line.strip()
42 |
43 | # Split into segments
44 | for l in line.split(','):
45 | l = l.strip()
46 | m = debDepItem.match(l)
47 | if m != None:
48 | dependency = l
49 |
50 | # ------ Ugly work-around for cmake --------------------------------
51 | # We need cmake >= 3.0!
52 | if ((m.group(1) == 'cmake') or (m.group(1) == 'cmake3')):
53 | if ((system == 'debian') or (system == 'ubuntu')):
54 | try:
55 | if distribution in [ 'trusty' ]:
56 | dependency = 'cmake3'
57 | except:
58 | pass
59 |
60 | dependencies.append(dependency)
61 |
62 | return dependencies
63 |
64 |
65 | # ###### Extract RPM spec dependencies ######################################
66 | rpmDepLine = re.compile(r'^(.*:[ \t]*)(.*)$')
67 | rpmDepItem = re.compile(r'^([a-zA-Z0-9-+\.]+)[\s]*(|or[ \t]*.*|\(.*)[\s]*$')
68 | def extractRPMDependencies(line, system):
69 | dependencies = []
70 | distribution = distro.codename()
71 |
72 | # Remove "build-depends:", etc.:
73 | m = rpmDepLine.match(line)
74 | if m != None:
75 | dependency = m.group(2).strip()
76 | dependencies.append(dependency)
77 |
78 | return dependencies
79 |
80 |
81 | # ###### Main program #######################################################
82 |
83 | # ====== Check arguments ====================================================
84 | system = None
85 | runInstall = False
86 | i = 1
87 | while i < len(sys.argv):
88 | if sys.argv[i] == '-s' or sys.argv[i] == '--system':
89 | if i + 1 < len(sys.argv):
90 | system = sys.argv[i + 1]
91 | i = i + 1
92 | else:
93 | sys.stderr.write('ERROR: Invalid system setting!\n')
94 | sys.exit(1)
95 | elif sys.argv[i] == '-i' or sys.argv[i] == '--install':
96 | runInstall = True
97 | elif sys.argv[i] == '-h' or sys.argv[i] == '--help':
98 | sys.stderr.write('Usage: ' + sys.argv[0] + ' [-h|--help] [-s|--system debian|ubuntu|fedora|freebsd|auto] [-i|--install]\n')
99 | sys.exit(0)
100 | else:
101 | sys.stderr.write('ERROR: Bad parameter ' + sys.argv[i] + '!\n')
102 | sys.exit(1)
103 | i = i + 1
104 |
105 | if system == None:
106 | with open("/etc/os-release") as osReleaseFile:
107 | osRelease = { }
108 | for line in osReleaseFile:
109 | key, value = line.rstrip().split("=")
110 | osRelease[key] = value.strip('"')
111 | system = osRelease['ID']
112 |
113 | # ====== Debian/Ubuntu ======================================================
114 | dependencies = [ ]
115 | if ((system == 'debian') or (system == 'ubuntu')):
116 | if os.path.exists('debian/control'):
117 | with open('debian/control', 'r', encoding='utf-8') as fp:
118 | inside = False
119 | for line in fp:
120 | if not line:
121 | break
122 | line_lower = line.lower()
123 | if inside:
124 | if line.startswith((' ', "\t")):
125 | dependencies = dependencies + extractDebDependencies(line, system)
126 | continue
127 | elif line.startswith('#'):
128 | continue
129 | inside = False
130 | if line_lower.startswith(('build-depends:', 'build-depends-indep:')):
131 | dependencies = dependencies + extractDebDependencies(line, system)
132 | inside = True
133 |
134 | aptCall = [ 'apt-get', 'satisfy', '-qy' ]
135 | i=0
136 | for dependency in sorted(set(dependencies)):
137 | if i > 0:
138 | sys.stdout.write(', ')
139 | sys.stdout.write(dependency)
140 | aptCall.append(dependency)
141 | i = i + 1
142 | sys.stdout.write('\n')
143 |
144 | if runInstall == True:
145 | subprocess.call(aptCall,
146 | env = { 'DEBIAN_FRONTEND': 'noninteractive' })
147 |
148 | else:
149 | sys.stderr.write('ERROR: Unable to locate Debian control file!\n')
150 | sys.exit(1)
151 |
152 |
153 | # ====== Fedora =============================================================
154 | elif system == 'fedora':
155 | specFiles = glob.glob('rpm/*.spec')
156 | if len(specFiles) == 1:
157 | with open(specFiles[0], 'r', encoding='utf-8') as fp:
158 | inside = False
159 | for line in fp:
160 | if not line:
161 | break
162 | line_lower = line.lower()
163 | if inside:
164 | if line.startswith('#'):
165 | continue
166 | inside = False
167 | if line_lower.startswith('buildrequires:'):
168 | dependencies = dependencies + extractRPMDependencies(line, system)
169 | inside = True
170 |
171 | dnfCall = [ 'dnf', 'install', '-y' ]
172 | i=0
173 | for dependency in sorted(set(dependencies)):
174 | if i > 0:
175 | sys.stdout.write(', ')
176 | sys.stdout.write(dependency)
177 | dnfCall.append(dependency)
178 | i = i + 1
179 | sys.stdout.write('\n')
180 |
181 | if runInstall == True:
182 | subprocess.call(dnfCall)
183 |
184 | else:
185 | sys.stderr.write('ERROR: Unable to locate RPM spec file!\n')
186 | sys.exit(1)
187 |
188 |
189 | # ====== FreeBSD ============================================================
190 | elif system == 'freebsd':
191 | freeBSDMakefile = glob.glob('freebsd/*/Makefile')
192 | if len(freeBSDMakefile) == 1:
193 | freeBSDDirectory = os.path.dirname(freeBSDMakefile[0])
194 |
195 | cmd = 'make build-depends-list && make run-depends-list'
196 | try:
197 | os.chdir(freeBSDDirectory)
198 | output = subprocess.check_output(cmd, shell=True)
199 | except Exception as e:
200 | sys.stderr.write('ERROR: Getting FreeBSD dependencies failed: ' + str(e) + '\n')
201 | sys.exit(1)
202 |
203 | if output != None:
204 | ports = output.decode('utf-8').splitlines()
205 | for port in ports:
206 | if port[0:3] != '---':
207 | basename = os.path.basename(port)
208 | if basename == 'glib20':
209 | basename = 'glib' # May be there is a better solution here?
210 | dependencies.append(basename)
211 |
212 | for dependency in sorted(set(dependencies)):
213 | sys.stdout.write(dependency + ' ')
214 | sys.stdout.write('\n')
215 |
216 | if runInstall == True:
217 | subprocess.call([ 'pkg', 'install', '-y' ] + dependencies)
218 |
219 | else:
220 | sys.stderr.write('ERROR: Unable to locate FreeBSD port makefile!\n')
221 | sys.exit(1)
222 |
223 |
224 | # ====== Error ==============================================================
225 | else:
226 | sys.stderr.write('ERROR: Invalid system name "' + system + '"!\n')
227 | sys.exit(1)
228 |
--------------------------------------------------------------------------------
/config.nmake:
--------------------------------------------------------------------------------
1 | WIN32_LIBS=C:\win32-libs
2 |
3 | GLIB_VERSION=2.12
4 | GLIB_DIR=$(WIN32_LIBS)\glib\include\glib-2.0
5 | GLIB_DIR2=$(WIN32_LIBS)\glib\lib\glib-2.0\include
6 | ICONV_DIR=$(WIN32_LIBS)\libiconv-1.9.1.bin.woe32
7 | GETTEXT_DIR=$(WIN32_LIBS)\gettext-0.14.5
8 |
9 |
10 |
11 | SH=bash
12 |
13 | PATH=$(PATH);c:\cygwin\bin
14 |
15 |
--------------------------------------------------------------------------------
/debian/changelog:
--------------------------------------------------------------------------------
1 | sctplib (1:1.0.32~rc1.3-1ubuntu1) jammy; urgency=medium
2 |
3 | * New upstream release.
4 | * debian/control: Updated standards version to 4.7.0.
5 | * Closes: #934049 (ITP).
6 |
7 | -- Thomas Dreibholz Wed, 09 Oct 2024 16:25:22 +0200
8 |
9 | sctplib (1:1.0.31-1ubuntu1) jammy; urgency=medium
10 |
11 | * New upstream release.
12 |
13 | -- Thomas Dreibholz Wed, 06 Dec 2023 16:54:15 +0100
14 |
15 | sctplib (1:1.0.30-1ubuntu1) jammy; urgency=medium
16 |
17 | * New upstream release.
18 | * debian/control: Updated standards version to 4.6.2.
19 |
20 | -- Thomas Dreibholz Sun, 22 Jan 2023 22:48:59 +1100
21 |
22 | sctplib (1:1.0.29-1ubuntu1) jammy; urgency=medium
23 |
24 | * New upstream release.
25 | * debian/control: Updated standards version to 4.6.1.
26 |
27 | -- Thomas Dreibholz Sun, 11 Sep 2022 13:06:05 +0200
28 |
29 | sctplib (1:1.0.28-1ubuntu1) jammy; urgency=medium
30 |
31 | * New upstream release.
32 |
33 | -- Thomas Dreibholz Thu, 17 Feb 2022 12:25:40 +0100
34 |
35 | sctplib (1:1.0.27-1ubuntu1) hirsute; urgency=medium
36 |
37 | * New upstream release.
38 | * debian/control: Updated standards version to 4.6.0.1.
39 |
40 | -- Thomas Dreibholz Wed, 16 Feb 2022 12:39:25 +0100
41 |
42 | sctplib (1:1.0.26-1ubuntu1) hirsute; urgency=medium
43 |
44 | * New upstream release.
45 | * debian/control: Updated standards version to 4.5.0.3.
46 |
47 | -- Thomas Dreibholz Fri, 13 Nov 2020 19:00:25 +0100
48 |
49 | sctplib (1:1.0.25-1ubuntu1) focal; urgency=medium
50 |
51 | * New upstream release.
52 | * debian/control: Updated standards version to 4.5.0.0.
53 |
54 | -- Thomas Dreibholz Fri, 07 Feb 2020 13:21:57 +0100
55 |
56 | sctplib (1:1.0.24-1ubuntu1) eoan; urgency=medium
57 |
58 | * New upstream release.
59 |
60 | -- Thomas Dreibholz Wed, 14 Aug 2019 14:01:49 +0200
61 |
62 | sctplib (1:1.0.23-1ubuntu1) eoan; urgency=medium
63 |
64 | * New upstream version.
65 |
66 | -- Thomas Dreibholz Wed, 07 Aug 2019 17:40:55 +0200
67 |
68 | sctplib (1:1.0.22-1ubuntu1) eoan; urgency=medium
69 |
70 | * New upstream version.
71 | * Initial Ubuntu release (LP: #228052).
72 |
73 | -- Thomas Dreibholz Wed, 27 Feb 2019 08:08:08 +0800
74 |
--------------------------------------------------------------------------------
/debian/compat:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/debian/control:
--------------------------------------------------------------------------------
1 | Source: sctplib
2 | Section: net
3 | Priority: optional
4 | Maintainer: Thomas Dreibholz
5 | Homepage: https://www.nntb.no/~dreibh/sctplib/index.html
6 | Vcs-Git: https://github.com/dreibh/sctplib.git
7 | Vcs-Browser: https://github.com/dreibh/sctplib
8 | Build-Depends: autoconf,
9 | automake,
10 | debhelper (>= 9),
11 | ghostscript,
12 | libglib2.0-dev,
13 | libtool,
14 | texlive-fonts-recommended,
15 | texlive-latex-base,
16 | texlive-latex-extra
17 | Standards-Version: 4.7.0
18 | Rules-Requires-Root: no
19 |
20 | Package: libsctplib1
21 | Section: libs
22 | Architecture: any
23 | Depends: ${misc:Depends},
24 | ${shlibs:Depends}
25 | Description: User-space implementation of the SCTP protocol RFC 4960
26 | This package contains the shared library for SCTPLIB.
27 | .
28 | The SCTPLIB library is a fairly complete prototype implementation of the
29 | Stream Control Transmission Protocol (SCTP), a message-oriented reliable
30 | transport protocol that supports multi-homing, and multiple message streams
31 | multiplexed within an SCTP connection (also named association). SCTP is
32 | described in RFC 4960. This implementation is the product of a cooperation
33 | between Siemens AG (ICN), Munich, Germany and the Computer Networking
34 | Technology Group at the IEM of the University of Essen, Germany.
35 | .
36 | The API of the library was modeled after Section 10 of RFC 4960, and most
37 | parameters and functions should be self-explanatory to the user familiar with
38 | this document. In addition to these interface functions between an Upper
39 | Layer Protocol (ULP) and an SCTP instance, the library also provides a number
40 | of helper functions that can be used to manage callback function routines to
41 | make them execute at a certain point of time (i.e. timer-based) or open and
42 | bind UDP sockets on a configurable port, which may then be used for an
43 | asynchronous interprocess communication.
44 |
45 | Package: libsctplib-dev
46 | Section: libdevel
47 | Architecture: any
48 | Depends: libsctplib1 (= ${binary:Version}),
49 | ${misc:Depends},
50 | ${shlibs:Depends}
51 | Recommends: sctplib-doc
52 | Description: Headers and libraries of the user-space SCTP implementation SCTPLIB
53 | This package contains development files for SCTPLIB.
54 | .
55 | The SCTPLIB library is a fairly complete prototype implementation of the
56 | Stream Control Transmission Protocol (SCTP), a message-oriented reliable
57 | transport protocol that supports multi-homing, and multiple message streams
58 | multiplexed within an SCTP connection (also named association). SCTP is
59 | described in RFC 4960. This implementation is the product of a cooperation
60 | between Siemens AG (ICN), Munich, Germany and the Computer Networking
61 | Technology Group at the IEM of the University of Essen, Germany.
62 | .
63 | The API of the library was modeled after Section 10 of RFC 4960, and most
64 | parameters and functions should be self-explanatory to the user familiar with
65 | this document. In addition to these interface functions between an Upper
66 | Layer Protocol (ULP) and an SCTP instance, the library also provides a number
67 | of helper functions that can be used to manage callback function routines to
68 | make them execute at a certain point of time (i.e. timer-based) or open and
69 | bind UDP sockets on a configurable port, which may then be used for an
70 | asynchronous interprocess communication.
71 |
72 | Package: sctplib-doc
73 | Provides: sctplib-docs
74 | Replaces: sctplib-docs
75 | Section: doc
76 | Architecture: all
77 | Depends: libsctplib1,
78 | ${misc:Depends},
79 | ${shlibs:Depends}
80 | Conflicts: sctplib-stable-doc
81 | Description: Documentation of the user-space SCTP implementation SCTPLIB
82 | This package contains documentation files for SCTPLIB.
83 | .
84 | The SCTPLIB library is a fairly complete prototype implementation of the
85 | Stream Control Transmission Protocol (SCTP), a message-oriented reliable
86 | transport protocol that supports multi-homing, and multiple message streams
87 | multiplexed within an SCTP connection (also named association). SCTP is
88 | described in RFC 4960. This implementation is the product of a cooperation
89 | between Siemens AG (ICN), Munich, Germany and the Computer Networking
90 | Technology Group at the IEM of the University of Essen, Germany.
91 |
--------------------------------------------------------------------------------
/debian/copyright:
--------------------------------------------------------------------------------
1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2 | Upstream-Name: sctplib
3 | Upstream-Contact: Thomas Dreibholz
4 | Source: https://www.nntb.no/~dreibh/sctplib/
5 |
6 | Files: *
7 | Copyright:
8 | Copyright (C) 2001-2019 Thomas Dreibholz
9 | Copyright (C) 2000-2005 Andreas Jungmaier
10 | Copyright (C) 2000-2005 Michael Tüxen
11 | Copyright (C) 2000 Siemens AG, Munich, Germany.
12 | License: LGPL-2.1+
13 | This library is free software; you can redistribute it and/or
14 | modify it under the terms of the GNU Lesser General Public
15 | License as published by the Free Software Foundation; either
16 | version 2.1 of the License, or (at your option) any later version.
17 | .
18 | This library is distributed in the hope that it will be useful,
19 | but WITHOUT ANY WARRANTY; without even the implied warranty of
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 | Lesser General Public License for more details.
22 | .
23 | You should have received a copy of the GNU Lesser General Public
24 | License along with this library; if not, write to the Free Software
25 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 | .
27 | On Debian systems, the complete text of the GNU Lesser General
28 | Public License can be found in `/usr/share/common-licenses/LGPL-2.1'.
29 |
--------------------------------------------------------------------------------
/debian/libsctplib-dev.install:
--------------------------------------------------------------------------------
1 | usr/include/sctp.h
2 | usr/lib/*/libsctplib*.a
3 | usr/lib/*/libsctplib*.la
4 | usr/lib/*/libsctplib*.so
5 |
--------------------------------------------------------------------------------
/debian/libsctplib1.install:
--------------------------------------------------------------------------------
1 | usr/lib/*/libsctplib.so.*
2 |
--------------------------------------------------------------------------------
/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 |
3 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all
4 |
5 | %:
6 | dh $@ --parallel
7 |
8 | override_dh_auto_configure:
9 | dh_auto_configure -- --enable-sctp-over-udp --disable-maintainer-mode
10 |
11 | override_dh_installchangelogs:
12 | dh_installchangelogs -k ChangeLog
13 |
14 | override_dh_install:
15 | dh_install
16 | sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'`
17 |
--------------------------------------------------------------------------------
/debian/sctplib-doc.doc-base:
--------------------------------------------------------------------------------
1 | Document: sctplib
2 | Title: Documentation of the SCTP implementation SCTPLIB
3 | Author: Thomas Dreibholz
4 | Abstract: Documentation of the SCTP implementation SCTPLIB
5 | Section: Network/Communication
6 |
7 | Format: PDF
8 | Files: /usr/share/doc/sctplib-doc/*.pdf.gz
9 |
--------------------------------------------------------------------------------
/debian/sctplib-doc.docs:
--------------------------------------------------------------------------------
1 | sctplib/manual/*.pdf
2 |
--------------------------------------------------------------------------------
/debian/source/format:
--------------------------------------------------------------------------------
1 | 3.0 (quilt)
2 |
--------------------------------------------------------------------------------
/debian/source/lintian-overrides:
--------------------------------------------------------------------------------
1 | # Some source files have long lines:
2 | sctplib source: very-long-line-length-in-source-file
3 |
--------------------------------------------------------------------------------
/debian/upstream/metadata:
--------------------------------------------------------------------------------
1 | Name: SCTPLIB
2 | Repository: https://github.com/dreibh/sctplib.git
3 | Repository-Browse: https://github.com/dreibh/sctplib
4 | Bug-Submit: https://github.com/dreibh/sctplib/issues
5 | Contact: Thomas Dreibholz
6 | Security-Contact: Thomas Dreibholz
7 |
--------------------------------------------------------------------------------
/debian/watch:
--------------------------------------------------------------------------------
1 | version=4
2 | opts=pgpsigurlmangle=s/$/.asc/ \
3 | https://www.nntb.no/~dreibh/sctplib/ download/sctplib-(.*)\.tar\.gz
4 |
--------------------------------------------------------------------------------
/freebsd/sctplib/Makefile:
--------------------------------------------------------------------------------
1 | PORTNAME= sctplib
2 | DISTVERSION= 1.0.32~rc1.3
3 | CATEGORIES= net
4 | MASTER_SITES= https://www.nntb.no/~dreibh/sctplib/download/
5 |
6 | MAINTAINER= thomas.dreibholz@gmail.com
7 | COMMENT= User-space implementation of the SCTP protocol RFC 4960
8 | WWW= https://www.nntb.no/~dreibh/sctplib/
9 |
10 | LICENSE= GPLv3+
11 | LICENSE_FILE= ${WRKSRC}/COPYING
12 |
13 | USES= gnome libtool pkgconfig
14 | USE_GNOME= glib20
15 | USE_LDCONFIG= yes
16 |
17 | GNU_CONFIGURE= yes
18 | CONFIGURE_ARGS= --enable-sctp-over-udp
19 | INSTALL_TARGET= install-strip
20 | PLIST_FILES= include/sctp.h \
21 | lib/libsctplib.a \
22 | lib/libsctplib.so \
23 | lib/libsctplib.so.1 \
24 | lib/libsctplib.so.1.0.8
25 |
26 | .include
27 |
--------------------------------------------------------------------------------
/freebsd/sctplib/distinfo:
--------------------------------------------------------------------------------
1 | TIMESTAMP = 1701949801
2 | SHA256 (sctplib-1.0.31.tar.gz) = c8d75b2fa91904b6ff952e52215d845b9da7706ddba8cbc88d2ac3ee5321a3f2
3 | SIZE (sctplib-1.0.31.tar.gz) = 1123414
4 |
--------------------------------------------------------------------------------
/freebsd/sctplib/pkg-descr:
--------------------------------------------------------------------------------
1 | The SCTPLIB library is a prototype implementation of the Stream Control
2 | Transmission Protocol (SCTP), a message-oriented reliable transport protocol
3 | that supports multi-homing, and multiple message streams multiplexed within an
4 | SCTP connection (also named association). SCTP is described in RFC 4960. The
5 | API of the library is modeled after Section 10 of RFC 4960, and most
6 | parameters and functions should be self-explanatory to the user familiar with
7 | this document. In addition to these interface functions between an Upper Layer
8 | Protocol (ULP) and an SCTP instance, the library also provides a number of
9 | helper functions that can be used to manage callbacks and timers, as well as
10 | UDP sockets for simple IPC. Furthermore, SCTPLIB provides support for UDP
11 | encapsulation, making it possible to co-exist with kernel SCTP
12 | implementations.
13 |
--------------------------------------------------------------------------------
/freebsd/sctplib/test-packaging:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Free Packaging Test Script
4 | # Copyright (C) 2010-2024 by Thomas Dreibholz
5 | #
6 | # This program is free software: you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation, either version 3 of the License, or
9 | # (at your option) any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | # GNU General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU General Public License
17 | # along with this program. If not, see .
18 | #
19 | # Contact: thomas.dreibholz@gmail.com
20 |
21 | PACKAGE=`cat Makefile | grep "^PORTNAME=" | sed -e "s/^PORTNAME=//g" | tr -d " \t"`
22 | UPSTREAM_VERSION=`cat Makefile | grep "^PORTVERSION=" | sed -e "s/^PORTVERSION=//g" | tr -d " \t"`
23 | PORTREVISION=`cat Makefile | grep "^PORTREVISION=" | sed -e "s/^PORTREVISION=//g" | tr -d " \t"`
24 | CATEGORY=`cat Makefile | grep "^CATEGORIES=" | sed -e "s/^CATEGORIES=//g" | tr -d " \t"`
25 |
26 | PACKAGE_VERSION="${UPSTREAM_VERSION}"
27 | if [ "${PORTREVISION}" != "" ] ; then
28 | PACKAGE_VERSION="${UPSTREAM_VERSION}_${PORTREVISION}"
29 | fi
30 |
31 |
32 | echo "######################################################################"
33 | echo "PACKAGE: ${PACKAGE}"
34 | echo "UPSTREAM_VERSION: ${UPSTREAM_VERSION}"
35 | echo "PACKAGE_VERSION: ${PACKAGE_VERSION}"
36 | echo "CATEGORY: ${CATEGORY}"
37 | echo "######################################################################"
38 |
39 |
40 | if [ -e work ] ; then
41 | rm -rf work
42 | fi
43 | rm -f ${PACKAGE}-${PACKAGE_VERSION}.txz
44 | find /usr/ports/packages -name "${PACKAGE}*.txz" | xargs rm -f
45 |
46 |
47 | echo "1. ###### make deinstall ##############################################" && \
48 | make deinstall && \
49 | echo "2. ###### make install ################################################" && \
50 | make install && \
51 | echo "3. ###### make package ################################################" && \
52 | make package && \
53 | echo "4. ###### make deinstall ##############################################" && \
54 | make deinstall && \
55 | echo "5. ###### pkg add #####################################################" && \
56 | if [ ! -e "/usr/ports/packages/All/${PACKAGE}-${PACKAGE_VERSION}.pkg" ] ; then
57 | echo >&2 "ERROR: Package /usr/ports/packages/All/${PACKAGE}-${PACKAGE_VERSION}.pkg not found!"
58 | exit 1
59 | fi && \
60 | pkg add /usr/ports/packages/All/${PACKAGE}-${PACKAGE_VERSION}.pkg && \
61 | echo "6. ###### make deinstall ##############################################" && \
62 | make deinstall && \
63 | echo "7. ###### make reinstall ##############################################" && \
64 | make reinstall && \
65 | echo "8. ###### make package ################################################" && \
66 | make package && \
67 | echo "9. ###### tar tzvf *.pkg ##############################################" && \
68 | tar tzvf /usr/ports/packages/All/${PACKAGE}-${PACKAGE_VERSION}.pkg && \
69 | echo "Running portlint ..." && \
70 | portlint && \
71 | echo "====== Successfully completed! ======"
72 |
--------------------------------------------------------------------------------
/packaging.conf:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # ---------------------------------------------------------
4 | CONFOPT=""
5 | MAKE_DIST="./bootstrap && ./configure $CONFOPT && make dist"
6 | NOT_TARGET_DISTRIBUTIONS="lucid" # <<-- Distrubutions which are *not* supported!
7 | MAINTAINER="Thomas Dreibholz "
8 | MAINTAINER_KEY="21412672518D8B2D1862EFEF5CD5D12AA0877B49"
9 | SKIP_PACKAGE_SIGNING=0 # <<-- Must be set to 0 (=off) for PPA upload!
10 | # ---------------------------------------------------------
11 |
--------------------------------------------------------------------------------
/rpm/sctplib.spec:
--------------------------------------------------------------------------------
1 | Name: sctplib
2 | Version: 1.0.32~rc1.3
3 | Release: 1
4 | Summary: User-space implementation of the SCTP protocol RFC 4960
5 | License: LGPL-2.1-or-later
6 | Group: Applications/Internet
7 | URL: https://www.nntb.no/~dreibh/sctplib/
8 | Source: https://www.nntb.no/~dreibh/sctplib/download/%{name}-%{version}.tar.gz
9 |
10 | AutoReqProv: on
11 | BuildRequires: autoconf
12 | BuildRequires: automake
13 | BuildRequires: ghostscript
14 | BuildRequires: glib2-devel
15 | BuildRequires: libtool
16 | BuildRequires: texlive-collection-fontsrecommended
17 | BuildRequires: texlive-collection-latex
18 | BuildRequires: texlive-collection-latexextra
19 | BuildRoot: %{_tmppath}/%{name}-%{version}-build
20 |
21 | Requires: %{name}-libsctplib
22 | Requires: %{name}-libsctplib-devel
23 | Requires: %{name}-docs
24 |
25 |
26 | %description
27 | The sctplib library is a fairly complete prototype implementation of the
28 | Stream Control Transmission Protocol (SCTP), a message-oriented reliable
29 | transport protocol that supports multi-homing, and multiple message streams
30 | multiplexed within an SCTP connection (also named association). SCTP is
31 | described in RFC 4960. This implementation is the product of a cooperation
32 | between Siemens AG (ICN), Munich, Germany and the Computer Networking
33 | Technology Group at the IEM of the University of Essen, Germany.
34 | The API of the library was modeled after Section 10 of RFC 4960, and most
35 | parameters and functions should be self-explanatory to the user familiar with
36 | this document. In addition to these interface functions between an Upper
37 | Layer Protocol (ULP) and an SCTP instance, the library also provides a number
38 | of helper functions that can be used to manage callback function routines to
39 | make them execute at a certain point of time (i.e. timer-based) or open and
40 | bind UDP sockets on a configurable port, which may then be used for an
41 | asynchronous interprocess communication.
42 |
43 | %prep
44 | %setup -q
45 |
46 | %build
47 | autoreconf -i
48 |
49 | %configure --prefix=/usr --enable-sctp-over-udp --disable-maintainer-mode
50 | make %{?_smp_mflags}
51 |
52 | %install
53 | make DESTDIR=%{buildroot} install
54 |
55 | %files
56 |
57 | %package libsctplib
58 | Summary: User-space implementation of the SCTP protocol RFC 4960
59 | Group: System Environment/Libraries
60 |
61 | %description libsctplib
62 | This package contains the shared library for SCTPLIB.
63 | The SCTPLIB library is a fairly complete prototype implementation of the
64 | Stream Control Transmission Protocol (SCTP), a message-oriented reliable
65 | transport protocol that supports multi-homing, and multiple message streams
66 | multiplexed within an SCTP connection (also named association). SCTP is
67 | described in RFC 4960. This implementation is the product of a cooperation
68 | between Siemens AG (ICN), Munich, Germany and the Computer Networking
69 | Technology Group at the IEM of the University of Essen, Germany.
70 | The API of the library was modeled after Section 10 of RFC 4960, and most
71 | parameters and functions should be self-explanatory to the user familiar with
72 | this document. In addition to these interface functions between an Upper
73 | Layer Protocol (ULP) and an SCTP instance, the library also provides a number
74 | of helper functions that can be used to manage callback function routines to
75 | make them execute at a certain point of time (i.e. timer-based) or open and
76 | bind UDP sockets on a configurable port, which may then be used for an
77 | asynchronous interprocess communication.
78 |
79 | %files libsctplib
80 | %{_libdir}/libsctplib.so.*
81 |
82 |
83 | %package libsctplib-devel
84 | Summary: Headers and libraries of the user-space SCTP implementation SCTPLIB
85 | Group: Development/Libraries
86 | Requires: %{name}-libsctplib = %{version}-%{release}
87 |
88 | %description libsctplib-devel
89 | This package contains development files for SCTPLIB.
90 | The SCTPLIB library is a fairly complete prototype implementation of the
91 | Stream Control Transmission Protocol (SCTP), a message-oriented reliable
92 | transport protocol that supports multi-homing, and multiple message streams
93 | multiplexed within an SCTP connection (also named association). SCTP is
94 | described in RFC 4960. This implementation is the product of a cooperation
95 | between Siemens AG (ICN), Munich, Germany and the Computer Networking
96 | Technology Group at the IEM of the University of Essen, Germany.
97 | The API of the library was modeled after Section 10 of RFC 4960, and most
98 | parameters and functions should be self-explanatory to the user familiar with
99 | this document. In addition to these interface functions between an Upper
100 | Layer Protocol (ULP) and an SCTP instance, the library also provides a number
101 | of helper functions that can be used to manage callback function routines to
102 | make them execute at a certain point of time (i.e. timer-based) or open and
103 | bind UDP sockets on a configurable port, which may then be used for an
104 | asynchronous interprocess communication.
105 |
106 | %files libsctplib-devel
107 | %{_includedir}/sctp.h
108 | %{_libdir}/libsctplib*.a
109 | %{_libdir}/libsctplib*.so
110 |
111 |
112 | %package docs
113 | Summary: Documentation of the user-space SCTP implementation SCTPLIB
114 | Group: System Environment/Libraries
115 | BuildArch: noarch
116 | Requires: %{name}-libsctplib = %{version}-%{release}
117 |
118 | %description docs
119 | This package contains documentation files for SCTPLIB.
120 | The SCTPLIB library is a fairly complete prototype implementation of the
121 | Stream Control Transmission Protocol (SCTP), a message-oriented reliable
122 | transport protocol that supports multi-homing, and multiple message streams
123 | multiplexed within an SCTP connection (also named association). SCTP is
124 | described in RFC 4960. This implementation is the product of a cooperation
125 | between Siemens AG (ICN), Munich, Germany and the Computer Networking
126 | Technology Group at the IEM of the University of Essen, Germany.
127 |
128 | %files docs
129 | %doc sctplib/manual/*.pdf
130 |
131 |
132 | %changelog
133 | * Wed Dec 06 2023 Thomas Dreibholz - 1.0.31
134 | - New upstream release.
135 | * Sun Jan 22 2023 Thomas Dreibholz - 1.0.30
136 | - New upstream release.
137 | * Sun Sep 11 2022 Thomas Dreibholz - 1.0.29
138 | - New upstream release.
139 | * Thu Feb 17 2022 Thomas Dreibholz - 1.0.28
140 | - New upstream release.
141 | * Wed Feb 16 2022 Thomas Dreibholz - 1.0.27
142 | - New upstream release.
143 | * Fri Nov 13 2020 Thomas Dreibholz - 1.0.26
144 | - New upstream release.
145 | * Fri Feb 07 2020 Thomas Dreibholz - 1.0.25
146 | - New upstream release.
147 | * Wed Aug 14 2019 Thomas Dreibholz - 1.0.24
148 | - New upstream release.
149 | * Wed Aug 07 2019 Thomas Dreibholz - 1.0.23
150 | - New upstream release.
151 | * Tue Aug 06 2019 Thomas Dreibholz - 1.0.22
152 | - New upstream release.
153 | * Fri Jun 14 2019 Thomas Dreibholz - 1.0.22
154 | - New upstream release.
155 |
--------------------------------------------------------------------------------
/sctplib/Makefile.am:
--------------------------------------------------------------------------------
1 | SUBDIRS = docs sctp manual programs
2 |
--------------------------------------------------------------------------------
/sctplib/docs/Makefile.am:
--------------------------------------------------------------------------------
1 | SUBDIRS = en sctplib
2 |
3 | EXTRA_DIST = sctplibDoxy.txt
4 |
5 | doxygen:
6 | /usr/bin/doxygen sctplibDoxy.txt
7 |
--------------------------------------------------------------------------------
/sctplib/docs/en/Makefile.am:
--------------------------------------------------------------------------------
1 | EXTRA_DIST = index.html index-1.html index-2.html index-3.html index-4.html index-5.html index-6.html
2 |
--------------------------------------------------------------------------------
/sctplib/docs/en/index-1.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | The Sctplib Handbook: Introduction
6 |
7 |
8 |
9 |
10 |
11 | Next
12 | Previous
13 | Contents
14 |
15 |
Sctplib Copyright 2001 Andreas Jungmaier , ajung@exp-math.uni-essen.de
18 |
19 |
This program is free software; you can redistribute it and/or modify
20 | it under the terms of the GNU General Public License as published by
21 | the Free Software Foundation; either version 2 of the License, or
22 | (at your option) any later version.
23 |
This program is distributed in the hope that it will be useful,
24 | but WITHOUT ANY WARRANTY; without even the implied warranty of
25 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 | GNU General Public License for more details.
27 |
You should have received a copy of the GNU General Public License
28 | along with this program; if not, write to the Free Software
29 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 |
28 |
29 | In order to compile and install Sctplib on your system, type the following in
30 | the base directory of the Sctplib distribution:
31 |
32 |
33 | % ./configure
34 | % make
35 | % make install
36 |
37 |
38 |
39 | Since Sctplib uses autoconf you should have not trouble
40 | compiling it.
41 | Should you run into problems please report them to the the author at
42 |
43 |
44 |
45 |
46 | Usage
47 | General Usage
48 |
49 | Another Section
50 |
51 |
52 | Questions and Answers
53 |
54 | Copyright
55 |
56 | Sctplib Copyright 2001 Andreas Jungmaier , ajung@exp-math.uni-essen.de
57 |
58 |
59 | This program is free software; you can redistribute it and/or modify
60 | it under the terms of the GNU General Public License as published by
61 | the Free Software Foundation; either version 2 of the License, or
62 | (at your option) any later version.
63 |
64 | This program is distributed in the hope that it will be useful,
65 | but WITHOUT ANY WARRANTY; without even the implied warranty of
66 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67 | GNU General Public License for more details.
68 |
69 | You should have received a copy of the GNU General Public License
70 | along with this program; if not, write to the Free Software
71 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/sctplib/docs/sctplib/Makefile.am:
--------------------------------------------------------------------------------
1 | EXTRA_DIST = doc.txt sctp-modules.fig sctp-modules.png
2 |
--------------------------------------------------------------------------------
/sctplib/docs/sctplib/doc.txt:
--------------------------------------------------------------------------------
1 | /** @name SCTP Documentation
2 |
3 | \begin{center}
4 | {\Large{\bf Documentation of SCTP Source Code}}
5 | \end{center}
6 |
7 | The current version of this SCTP projects implements SCTP according
8 | to RFC 2960.
9 | This RFC describes in section 1.3 a number of functional components of
10 | the protocol which each implementation would have to provide.
11 | Consequently, we have adopted a module concept in our SCTP software
12 | development project, which was partly derived from
13 | an SDL specification we did from an earlier version of the draft.
14 |
15 | \IMG{../sctp-modules.png}
16 |
17 | The image presents the modules we implemented together with the
18 | approximate data/control flow.
19 | We distinguish between SCTP instances (usually there will be one SCTP
20 | instance per host - this is what we mostly tested),
21 | and associations. Since an SCTP instance may connect to several SCTP
22 | endpoints (i. e. it may have a number of established SCTP associations),
23 | it can have multiple instances of data structures belonging to an association.
24 |
25 | Therefore the data arriving from an upper layer protocol (ULP) or the
26 | network must be dispatched accordingly to the correct
27 | association. That is done by the Association Distribution Layer (cf.
28 | \Ref{distribution}).
29 | The Adaptation Layer (\Ref{adaptation}) takes care of network input and
30 | output as well as timer functions. The protocol can register call-back functions
31 | associated with a timer, that will be called after a certain
32 | time has passed.
33 |
34 | So there are two kinds of events, that SCTP must react to :
35 | \begin{itemize}
36 | \item Network Read Events
37 | \item Timer Events
38 | \end{itemize}
39 |
40 | For both events the Association Distribution Layer sets the
41 | correct association, and schedules the necessary functions. If data
42 | arrives on the network, it is validated and then passed to the
43 | Bundling Module (see \Ref{bundling}), where the single chunks that
44 | may be part of an SCTP packet
45 | are passed on to the relevant module. That may be either :
46 | \begin{itemize}
47 | \item SCTP Controller (see \Ref{sctp-control}) which deals with chunks that
48 | change the association's state
49 | \item SCTP Reception Controller (see \Ref{recvctrl}), which keeps track of
50 | data chunks
51 | \item SCTP Retransmission Handler (\Ref{reltransfer}) that deals with SACK chunks
52 | \item Path Management (\Ref{pathmanagement}) for Heartbeat Chunks
53 | \end{itemize}
54 |
55 | Timer events trigger the execution of callback functions, often when a
56 | timer expires that initializes re-transmission of data.
57 | This is used for heartbeats, initialization and shutdown timers, timer
58 | based ULP actions, the data re-transmission, the sending of delayed SACKs
59 | and the timed reduction of the congestion window if no data is to be sent.
60 |
61 | If the association state changes, if data arrives or the ULP is to be
62 | notified of a change of path state, data is passed
63 | from the SCTP protocol instance to the ULP. Currently this is
64 | implemented via function callbacks within one program (i.e.
65 | the ULP has functions registered at the very beginning of the program,
66 | that are to be called if some notification is due).
67 | Right now, there is only {\bf one} ULP instance. In the future the
68 | communication between SCTP and the ULP shall be done
69 | with a locally bound UDP socket, that will be used to register a ULP
70 | instance with the SCTP instance.
71 | Thus it will be possible to asynchronously call functions of the SCTP
72 | protocol engine from a process that sends data on
73 | a local UDP socket, and is passed the results and other notification
74 | messages back over that socket.
75 |
76 | Any data chunks that are received are held back in the
77 | Stream Engine, if they do not arrive in order.
78 | Normally the chunks are reordered at that level. All chunks are
79 | immediately being delivered up to the
80 | highest stream sequence number that has consecutively arrived.
81 |
82 |
83 | @memo Documentation for SCTP implementation
84 | */
85 |
86 | //@{
87 | /** @name Library Interface */
88 | //@{
89 | /** @name sctp.h */
90 | //@{
91 | //@Include: sctp.dxx
92 | //@}
93 | //@}
94 |
95 | /** @name Protocol Engine */
96 | //@{
97 |
98 | /** @name Association Distribution */
99 | //@{
100 | //@Include: distribution.dxx
101 | //@}
102 |
103 | /** @name Sender Bundling Module */
104 | //@{
105 | //@Include: sbundling.dxx
106 | //@}
107 |
108 | /** @name Receive Bundling Module */
109 | //@{
110 | //@Include: rbundling.dxx
111 | //@}
112 |
113 | /** @name SCTP State Machine Controller */
114 | //@{
115 | //@Include: SCTP-control.dxx
116 | //@}
117 |
118 | /** @name Path Management Module */
119 | //@{
120 | //@Include: pathmanagement.dxx
121 | //@}
122 |
123 | /** @name Reception Control Module */
124 | //@{
125 | //@Include: recvctrl.dxx
126 | //@}
127 |
128 | /** @name Stream Engine */
129 | //@{
130 | //@Include: streamengine.dxx
131 | //@}
132 |
133 | /** @name Flow Control */
134 | //@{
135 | //@Include: flowcontrol.dxx
136 | //@}
137 |
138 | /** @name Reliable Transfer */
139 | //@{
140 | //@Include: reltransfer.dxx
141 | //@}
142 |
143 | /** @name Error Handler */
144 | //@{
145 | //@Include: errorhandler.dxx
146 | //@}
147 |
148 | /** @name OS Adaptation Layer */
149 | //@{
150 | //@Include: adaptation.dxx
151 | //@}
152 |
153 | //@}
154 |
155 | /** @name Upper Layer */
156 | //@{
157 | /** @name Main Program */
158 | //@{
159 | //@Include: main.dxx
160 | //@}
161 | /** @name Upper Layer Protocol */
162 | //@{
163 | //@Include: mini-ulp.dxx
164 | //@}
165 | //@}
166 |
167 | /** @name Helper Modules */
168 | //@{
169 | /** @name Chunk Assembler */
170 | //@{
171 | //@Include: chunkHandler.dxx
172 | //@}
173 | /** @name Globally Used Functions and Definitions */
174 | //@{
175 | //@Include: globals.dxx
176 | //@}
177 | /** @name Doubly Linked List */
178 | //@{
179 | //@Include: dll_main.dxx
180 | //@}
181 | /** @name Timer List Functions */
182 | //@{
183 | //@Include: timer_list.dxx
184 | //@}
185 | /** @name Helper Functions */
186 | //@{
187 | //@Include: auxiliary.dxx
188 | //@}
189 | //@}
190 |
191 | //@}
192 |
--------------------------------------------------------------------------------
/sctplib/docs/sctplib/sctp-modules.fig:
--------------------------------------------------------------------------------
1 | #FIG 3.2
2 | Landscape
3 | Center
4 | Metric
5 | A4
6 | 94.00
7 | Single
8 | -2
9 | 1200 2
10 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 0 0 2
11 | 10350 1125 10350 2070
12 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 1 0 2
13 | 1 1 2.00 90.00 120.00
14 | 8100 2070 8100 1125
15 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 1 1 2
16 | 1 1 2.00 90.00 120.00
17 | 1 1 2.00 90.00 120.00
18 | 4950 2070 4950 1125
19 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 1 1 2
20 | 1 1 2.00 90.00 120.00
21 | 1 1 2.00 90.00 120.00
22 | 2700 2070 2700 1125
23 | 2 1 0 1 0 20 100 0 -1 0.000 0 0 -1 0 0 5
24 | 1890 2115 1890 2070 3690 2070 3690 3420 3645 3420
25 | 2 1 0 1 0 20 100 0 -1 0.000 0 0 -1 0 0 5
26 | 4095 2160 4095 2115 5895 2115 5895 3465 5850 3465
27 | 2 1 0 1 0 20 100 0 -1 0.000 0 0 -1 0 0 5
28 | 4140 2115 4140 2070 5940 2070 5940 3420 5895 3420
29 | 2 1 0 1 0 26 100 0 -1 0.000 0 0 -1 0 0 5
30 | 6795 2160 6795 2115 11295 2115 11295 2790 11250 2790
31 | 2 1 0 1 0 26 100 0 -1 0.000 0 0 -1 0 0 5
32 | 6840 2115 6840 2070 11340 2070 11340 2745 11295 2745
33 | 2 1 0 1 0 26 100 0 -1 0.000 0 0 -1 0 0 5
34 | 6795 3285 6795 3240 11295 3240 11295 4365 11250 4365
35 | 2 1 0 1 0 26 100 0 -1 0.000 0 0 -1 0 0 5
36 | 6840 3240 6840 3195 11340 3195 11340 4320 11295 4320
37 | 2 1 0 1 0 26 100 0 -1 0.000 0 0 -1 0 0 5
38 | 6795 5085 6795 5040 11295 5040 11295 5715 11250 5715
39 | 2 1 0 1 0 26 100 0 -1 0.000 0 0 -1 0 0 5
40 | 6840 5040 6840 4995 11340 4995 11340 5670 11295 5670
41 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 0 0 2
42 | 10350 2835 10350 3195
43 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 0 0 2
44 | 10350 4410 10350 4995
45 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 0 0 2
46 | 8100 6390 8100 5760
47 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 0 0 2
48 | 8100 4995 8100 4410
49 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 0 0 2
50 | 8100 3195 8100 2835
51 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 1 0 2
52 | 1 1 2.00 90.00 120.00
53 | 10350 5760 10350 7560
54 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 1 0 2
55 | 1 1 2.00 90.00 120.00
56 | 8100 7560 8100 7110
57 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 1 1 2
58 | 1 1 2.00 90.00 120.00
59 | 1 1 2.00 90.00 120.00
60 | 2250 3510 2250 8910
61 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 1 0 2
62 | 1 1 2.00 90.00 120.00
63 | 8100 8910 8100 8235
64 | 2 1 0 1 0 -1 100 0 -1 4.000 0 0 -1 1 0 2
65 | 1 1 2.00 90.00 120.00
66 | 10350 8235 10350 8910
67 | 2 2 1 1 0 -1 100 0 -1 4.000 0 0 -1 0 0 5
68 | 6435 1575 12285 1575 12285 6120 6435 6120 6435 1575
69 | 2 1 1 1 0 -1 100 0 -1 4.000 0 0 -1 0 0 6
70 | 5220 6120 6165 6120 6165 1575 1350 1575 1350 6120 2880 6120
71 | 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5
72 | 1845 2160 1845 2115 3645 2115 3645 3465 3600 3465
73 | 2 2 0 1 0 20 100 0 13 0.000 0 0 -1 0 0 5
74 | 1800 2160 3600 2160 3600 3510 1800 3510 1800 2160
75 | 2 2 0 1 0 20 100 0 13 0.000 0 0 -1 0 0 5
76 | 4050 2160 5850 2160 5850 3510 4050 3510 4050 2160
77 | 2 2 0 1 0 4 100 0 16 0.000 0 0 -1 0 0 5
78 | 6750 2160 11250 2160 11250 2835 6750 2835 6750 2160
79 | 2 2 0 1 0 4 100 0 16 0.000 0 0 -1 0 0 5
80 | 6750 3285 11250 3285 11250 4410 6750 4410 6750 3285
81 | 2 2 0 1 0 4 100 0 16 0.000 0 0 -1 0 0 5
82 | 6750 5085 11250 5085 11250 5760 6750 5760 6750 5085
83 | 2 2 0 1 0 11 100 0 20 0.000 0 0 -1 0 0 5
84 | 1800 405 11250 405 11250 1125 1800 1125 1800 405
85 | 2 2 0 1 0 11 100 0 20 0.000 0 0 -1 0 0 5
86 | 6750 6390 9450 6390 9450 7110 6750 7110 6750 6390
87 | 2 2 0 1 0 11 100 0 20 0.000 0 0 -1 0 0 5
88 | 6750 7560 11250 7560 11250 8235 6750 8235 6750 7560
89 | 2 2 0 1 0 11 100 0 20 0.000 0 0 -1 0 0 5
90 | 1800 8910 11250 8910 11250 9585 1800 9585 1800 8910
91 | 2 1 0 1 0 -1 100 0 -1 0.000 0 0 -1 1 1 3
92 | 1 1 2.00 90.00 120.00
93 | 1 1 2.00 90.00 120.00
94 | 2835 3510 2835 5400 6750 5400
95 | 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 1 3
96 | 1 1 2.00 90.00 120.00
97 | 1 1 2.00 90.00 120.00
98 | 6750 5220 4950 5220 4950 3510
99 | 2 1 0 1 0 26 100 0 -1 0.000 0 0 -1 0 0 5
100 | 2925 5805 2925 5760 5175 5760 5175 7740 5130 7740
101 | 2 1 0 1 0 26 100 0 -1 0.000 0 0 -1 0 0 5
102 | 2970 5760 2970 5715 5220 5715 5220 7695 5175 7695
103 | 2 2 0 1 0 26 100 0 20 0.000 0 0 -1 0 0 5
104 | 2880 5805 5130 5805 5130 7785 2880 7785 2880 5805
105 | 4 0 0 100 0 4 18 0.0000 0 270 4680 4005 855 Association Distribution (Upper Layer)\001
106 | 4 0 0 100 0 4 18 0.0000 0 210 930 2115 3030 Control\001
107 | 4 0 0 100 0 4 18 0.0000 0 210 765 2205 2745 SCTP\001
108 | 4 0 0 100 0 4 18 0.0000 0 210 2325 6930 6885 Assoc. Distribution\001
109 | 4 0 0 100 0 4 18 0.0000 0 210 1680 8280 3780 Flow Control/\001
110 | 4 0 0 100 0 4 18 0.0000 0 270 1575 4140 3105 Management\001
111 | 4 0 0 100 0 4 18 0.0000 0 210 720 4590 2790 Path-\001
112 | 4 0 0 100 0 4 18 0.0000 0 210 1275 10395 1890 Data-Path\001
113 | 4 0 0 100 0 4 18 0.0000 0 210 1650 3015 3825 Control-Path\001
114 | 4 0 0 100 0 4 18 0.0000 0 210 2055 8100 4095 Reliable Transfer\001
115 | 4 0 0 100 0 4 18 0.0000 0 270 1875 8145 2610 Stream-Engine\001
116 | 4 0 0 100 0 4 18 0.0000 0 270 1785 8190 5535 (De-)Bundling\001
117 | 4 0 0 100 0 4 18 0.0000 0 270 2655 7875 8010 Message - Validation\001
118 | 4 0 0 100 0 4 18 0.0000 0 210 1140 3375 6720 Variables\001
119 | 4 0 0 100 0 4 18 0.0000 0 210 1425 3375 7380 Association\001
120 | 4 0 0 100 0 4 18 0.0000 0 210 870 3510 6390 Global \001
121 | 4 0 0 100 0 4 18 0.0000 0 210 405 3780 7020 per\001
122 | 4 0 0 100 0 4 18 0.0000 0 270 6990 3015 9405 Operating System Adaptation Layer (Timer, Network I/O)\001
123 |
--------------------------------------------------------------------------------
/sctplib/docs/sctplib/sctp-modules.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dreibh/sctplib/3d4c61b58f5a5f799b6cad5f8304b7af590841b8/sctplib/docs/sctplib/sctp-modules.png
--------------------------------------------------------------------------------
/sctplib/manual/Makefile.am:
--------------------------------------------------------------------------------
1 | EXTRA_DIST = fixunder.sty functions.sty sctp-api.pdf \
2 | sctp-api.ps sctp-api.tex commands.doc \
3 | commands.html commands.pdf
4 |
5 | all:
6 |
7 | clean:
8 | rm -f *.toc *.log *.idx *.ind *.aux *~
9 |
10 | distclean:
11 | rm -f *.toc *.log *.idx *.ind *.aux *~ *.dvi
12 |
13 | really-clean: clean
14 | rm -f *.dvi *.ps *.pdf
15 |
16 | sctp-api.ps: sctp-api.pdf
17 | pdf2ps sctp-api.pdf sctp-api.ps
18 |
19 | sctp-api.pdf: sctp-api.tex
20 | pdflatex sctp-api.tex
21 | pdflatex sctp-api.tex
22 |
23 | dis: sctp-api.pdf
24 | acroread sctp-api.pdf
25 |
26 | pdf: sctp-api.pdf
27 |
28 | ps: sctp-api.ps
29 |
--------------------------------------------------------------------------------
/sctplib/manual/commands.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dreibh/sctplib/3d4c61b58f5a5f799b6cad5f8304b7af590841b8/sctplib/manual/commands.doc
--------------------------------------------------------------------------------
/sctplib/manual/commands.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dreibh/sctplib/3d4c61b58f5a5f799b6cad5f8304b7af590841b8/sctplib/manual/commands.html
--------------------------------------------------------------------------------
/sctplib/manual/commands.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dreibh/sctplib/3d4c61b58f5a5f799b6cad5f8304b7af590841b8/sctplib/manual/commands.pdf
--------------------------------------------------------------------------------
/sctplib/manual/fixunder.sty:
--------------------------------------------------------------------------------
1 | % fixunder.sty, 31 May 1990, John T. Kohl
2 | %
3 | % The contents of this file are in the public domain.
4 | %
5 | %
6 | % play games with _ to make it active and to provide a reasonable _
7 | % character (from \tt in most cases), and a discretionary word-break point.
8 |
9 | %
10 | % Some \makeunder... macros for convenience in setting catcodes.
11 | %
12 | \def\makeunderactive{\catcode`\_=\active\relax}
13 | \def\makeunderother{\catcode`\_=12\relax}
14 | \def\makeunderletter{\catcode`\_=11\relax}
15 | \def\makeundernormal{\catcode`\_=8\relax}
16 | \makeunderother
17 | \def\cctwlunder{_}
18 |
19 | %
20 | % The hair here is to allow things like \index to work reasonably with
21 | % the new definition of underscore when the argument to index is part of
22 | % a macro replacement and as such gets tokenized before \index is
23 | % evaluated.
24 | % [in the normal case at top-level, \index{foo_bar} works since \index
25 | % does some hair to make _ into a reasonable character code, and \index
26 | % does NOT use a macro expansion. If you have something like
27 | % \def\foo#1#2{\index{#1} bar #2}
28 | % then \foo{baz_quux}{frobnitz} will result in baz_quux getting
29 | % tokenized BEFORE \foo is expanded, so that the catcode hair in \index
30 | % is to no avail.]
31 | %
32 | % \underrealfalse declares that you want to replace with the \tt _;
33 | % \underrealtrue declares that you want to replace with \char95 (ASCII _).
34 | %
35 | % for things like \index which write things out to files, set
36 | % \underrealfalse before evaluating the \index macro, and what actually
37 | % gets written to the file is an _, rather than something like
38 | % {\leavemode \kern... } (the typical definition of \_).
39 | %
40 | % the above example would then be
41 | % \def\foo#1#2{\underrealfalse\index{#1}\underrealtrue bar #2}
42 | %
43 |
44 | \newif\ifunderreal
45 | \underrealfalse
46 | \makeunderactive
47 | \def_{\ifunderreal\cctwlunder\else\leavevmode {\tt \cctwlunder}\discretionary{}{}{}\fi}
48 | \let\_=_
49 |
--------------------------------------------------------------------------------
/sctplib/manual/functions.sty:
--------------------------------------------------------------------------------
1 | %
2 | % definitions related to function declarations/displays
3 | %
4 | \ifx\undefined\@psfonts
5 | \def\argfont{\tt}
6 | \else
7 | \font\argfont = pcrb
8 | \hyphenchar\argfont = -1
9 | \fi
10 | \let\funcfont=\bf
11 | \newcount\argc@ount
12 | %\setlength{\marginparsep}{0.05in}
13 | %\setlength{\marginparwidth}{1.45in}
14 | %
15 | % This function fixes up the function name to be displayed in the
16 | % margin so that the krb5_, if any, is stripped.
17 | %
18 | % Note: this is a hack; what's really happening is that name beginning with
19 | % krb5 will have its first five characters stripped from it.
20 | % This means that 'Krb5abc' will get rewritten to be 'bc'.
21 | % Unfortunately, we can't do better because of the underscore
22 | % hacks that are going on elsewhere.
23 | %
24 | % WARNING: This is ugly; don't look at it too soon after lunch!
25 | % [tytso:19900920.2231EDT]
26 | \newif\if@krbfunc
27 | \def\endkrb{}
28 | \def\fix@parname#1{\expandafter\parse@krb#1\endkrb%
29 | \endkrb\endkrb\endkrb\endkrb}% In case the argument is less
30 | % than five letters, we don't want to
31 | % lose on the argument parsing.
32 | \def\parse@krb#1#2#3#4#5#6\endkrb{\@krbfuncfalse%
33 | \if#1k\if#2r\if#3b\if#45\@krbfunctrue\fi\fi\fi\fi%
34 | \if@krbfunc#6\else#1#2#3#4#5#6\fi}
35 | %
36 | % funcdecl is used as \begin{funcdecl}{funcname}{return type}{firstline}
37 | %
38 | % see fixunder.sty for comments on why the \underrealtrue & \underrealfalse
39 | % stuff is here.
40 | \newenvironment{funcdecl}[3]{\underrealtrue\index{#1}\underrealfalse%
41 | \medbreak
42 | \gdef\funcn@me{#1}
43 | \argc@ount=0\noindent%
44 | %the \mbox{} is to prevent the line/paragraph breaking from eating the
45 | %fill space.
46 | \marginpar[{{\sloppy \hfil\fix@parname{\funcn@me}\hfill\mbox{}}}]%
47 | {{\sloppy \hfill\fix@parname{\funcn@me}\hfil\mbox{}}}%
48 | \vbox\bgroup\begin{minipage}[t]{\textwidth}\begin{tabbing}
49 | #2 \\
50 | {\bf #1}(\= \+ #3%
51 | }{)
52 | \end{tabbing}\vfil\end{minipage}\egroup\par\nopagebreak
53 | }
54 | \newcommand{\docomm@}{\ifnum\argc@ount >0, \\\fi}
55 | \newcommand{\funcvoid}{\argc@ount=0}
56 | \newcommand{\funcin}{\docomm@\argc@ount=0{\sl /* IN */}\\}
57 | \newcommand{\funcinout}{\docomm@\argc@ount=0{\sl /* IN/OUT */}\\}
58 | \newcommand{\funcout}{\docomm@\argc@ount=0{\sl /* OUT */}\\}
59 | \newcommand{\funcarg}[2]{\docomm@#1 {\argfont #2}\advance\argc@ount by1}
60 | \newcommand{\funcparam}[1]{{\argfont #1}}
61 | \newcommand{\funcfuncarg}[2]{\docomm@#1 {\argfont #2}(\= \+ \argc@ount=0}
62 | \newcommand{\funcendfuncarg}{), \- \\ \argc@ount=0}
63 | \newcommand{\libname}[1]{{\argfont #1}}
64 | \newcommand{\globalname}[1]{{\argfont #1}}
65 | \newcommand{\ptsto}{->\discretionary{}{}{}}
66 | \newcommand{\datatype}[1]{{\bf #1}}
67 | \newcommand{\filename}[1]{{\sl #1\/}}
68 |
69 | \newcommand{\funcname}[1]{\underrealtrue\index{#1}\underrealfalse{\funcfont #1}()}
70 | \newcommand{\funcnamenoparens}[1]{\underrealtrue\index{#1}\underrealfalse{\funcfont #1}}
71 |
--------------------------------------------------------------------------------
/sctplib/manual/sctp-api.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/dreibh/sctplib/3d4c61b58f5a5f799b6cad5f8304b7af590841b8/sctplib/manual/sctp-api.pdf
--------------------------------------------------------------------------------
/sctplib/programs/Makefile.am:
--------------------------------------------------------------------------------
1 | EXTRA_DIST = combined_server.c daytime_server.c discard_server.c echo_server.c echo_tool.c \
2 | terminal.c parser.c script1 script2 sctptest.h test_tool.c testengine.c main.c mini-ulp.c mini-ulp.h \
3 | sctp_wrapper.h sctp_wrapper.c monitor.c chat.c echo_monitor.c localcom.c chargen_server.c Makefile.nmake
4 |
5 | AM_CPPFLAGS = -I$(srcdir)/../sctp
6 |
7 | noinst_PROGRAMS = combined_server daytime_server discard_server echo_server echo_tool terminal test_tool localcom chargen_server testsctp
8 |
9 | combined_server_SOURCES = combined_server.c sctp_wrapper.c
10 | combined_server_LDADD = ../sctp/libsctplib.la
11 |
12 | daytime_server_SOURCES = daytime_server.c sctp_wrapper.c
13 | daytime_server_LDADD = ../sctp/libsctplib.la
14 |
15 | discard_server_SOURCES = discard_server.c sctp_wrapper.c
16 | discard_server_LDADD = ../sctp/libsctplib.la
17 |
18 | chargen_server_SOURCES = chargen_server.c sctp_wrapper.c
19 | chargen_server_LDADD = ../sctp/libsctplib.la
20 |
21 | echo_server_SOURCES = echo_server.c sctp_wrapper.c
22 | echo_server_LDADD = ../sctp/libsctplib.la
23 |
24 | echo_tool_SOURCES = echo_tool.c sctp_wrapper.c
25 | echo_tool_LDADD = ../sctp/libsctplib.la
26 |
27 | terminal_SOURCES = terminal.c sctp_wrapper.c
28 | terminal_LDADD = ../sctp/libsctplib.la
29 |
30 | test_tool_SOURCES = parser.c test_tool.c testengine.c sctp_wrapper.c
31 | test_tool_LDADD = ../sctp/libsctplib.la
32 |
33 | testsctp_SOURCES = testsctp.c sctp_wrapper.c
34 | testsctp_LDADD = ../sctp/libsctplib.la
35 |
36 | localcom_SOURCES = localcom.c sctp_wrapper.c
37 | localcom_LDADD = ../sctp/libsctplib.la
38 |
--------------------------------------------------------------------------------
/sctplib/programs/Makefile.nmake:
--------------------------------------------------------------------------------
1 | ## Makefile for building sctp.lib and some servers with Microsoft C and nmake
2 | ## Use: nmake -f makefile.nmake
3 | ## nmake all -f makefile.nmake
4 | #
5 |
6 | include ..\..\config.nmake
7 |
8 | CFLAGS=/Od /I..\sctp /w /W0
9 |
10 | CVARSDLL=-DWIN32 -DMBCS
11 |
12 | LINKFLAGS=sctp_wrapper.obj /NOLOGO /NODEFAULTLIB:"LIBCMTD.lib" /DEBUG /FIXED:No \
13 | /LIBPATH:..\sctp /LIBPATH:$(WIN32_LIBS)\glib\lib /LIBPATH:$(ICONV_DIR) ws2_32.lib sctp.lib glib-2.0.lib gmodule-2.0.lib gthread-2.0.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
14 |
15 | .c.obj::
16 | $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
17 |
18 |
19 | all : \
20 | sctp_wrapper \
21 | combined_server \
22 | echo_tool \
23 | daytime_server \
24 | discard_server \
25 | echo_server \
26 | chargen_server \
27 | terminal
28 |
29 | sctp_wrapper:
30 | $(CC) $(CFLAGS) -DWIN32 -c -Zi sctp_wrapper.c
31 |
32 | combined_server:
33 | $(CC) $(CFLAGS) -DWIN32 -c -Zi combined_server.c
34 | link -out:combined_server.exe combined_server.obj $(LINKFLAGS)
35 |
36 | echo_tool:
37 | $(CC) $(CFLAGS) -Od -DWIN32 -c -Zi echo_tool.c
38 | link -out:echo_tool.exe echo_tool.obj $(LINKFLAGS)
39 |
40 | daytime_server:
41 | $(CC) $(CFLAGS) -Od -DWIN32 -c -Zi daytime_server.c
42 | link -out:daytime_server.exe daytime_server.obj $(LINKFLAGS)
43 |
44 | discard_server:
45 | $(CC) $(CFLAGS) -Od -DWIN32 -c -Zi discard_server.c
46 | link -out:discard_server.exe discard_server.obj $(LINKFLAGS)
47 |
48 | echo_server:
49 | $(CC) $(CFLAGS) -Od -DWIN32 -c -Zi echo_server.c
50 | link -out:echo_server.exe echo_server.obj $(LINKFLAGS)
51 |
52 | chargen_server:
53 | $(CC) $(CFLAGS) -Od -DWIN32 -c -Zi chargen_server.c
54 | link -out:chargen_server.exe chargen_server.obj $(LINKFLAGS)
55 |
56 | terminal:
57 | $(CC) $(CFLAGS) -Od -DWIN32 -c -Zi terminal.c
58 | link -out:terminal.exe terminal.obj $(LINKFLAGS)
59 |
60 | clean:
61 | rm -f sctp.lib
62 |
63 |
--------------------------------------------------------------------------------
/sctplib/programs/mini-ulp.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * SCTP implementation according to RFC 4960.
4 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
5 | *
6 | * Realized in co-operation between Siemens AG
7 | * and University of Essen, Institute of Computer Networking Technology.
8 | *
9 | * This library is free software: you can redistribute it and/or modify it
10 | * under the terms of the GNU Lesser General Public License as published by
11 | * the Free Software Foundation, either version 2.1 of the License, or
12 | * (at your option) any later version.
13 | *
14 | * This library is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | * GNU General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU Lesser General Public License
20 | * along with this program. If not, see .
21 | *
22 | * Contact: discussion@sctp.de
23 | * tuexen@fh-muenster.de
24 | * ajung@iem.uni-due.de
25 | *
26 | * Purpose: Implements a few simple callback-functions for an "ULP"
27 | */
28 |
29 | #ifndef MINI_ULP_H
30 | #define MINI_ULP_H
31 |
32 | #ifdef HAVE_CONFIG_H
33 | #include
34 | #endif
35 | #include
36 | #include "sctp.h"
37 |
38 | #ifdef SOLARIS
39 | #define timersub(tvp, uvp, vvp) \
40 | do { \
41 | (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
42 | (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
43 | if ((vvp)->tv_usec < 0) { \
44 | (vvp)->tv_sec--; \
45 | (vvp)->tv_usec += 1000000; \
46 | } \
47 | } while (0)
48 | #endif
49 |
50 |
51 |
52 | void ulp_getEndEvents(unsigned int shutdownAfter, unsigned int abortAfter);
53 | void mulp_dosend(void);
54 | void mulp_heartbeat(unsigned int interval);
55 | void ulp_setChunkLength(int chunkLength);
56 | void mulp_streamRoundRobin(void);
57 |
58 | /* function to handle typed user commands */
59 | /* FOR THE BAKEOFF */
60 | void
61 | ulp_stdin_cb(int fd, short int revents, short int* gotEvents, void * dummy);
62 |
63 | void
64 | ulp_socket_error(gint sin_fd,
65 | unsigned char *buffer,
66 | int bufferLength, unsigned char fromAddress[], unsigned short pn);
67 |
68 |
69 | /* indicates new data have arrived from peer (chapter 10.2.A).
70 | params: 1. associationID
71 | 2. streamID
72 | */
73 | void ulp_dataArriveNotif(unsigned int assoc_id, unsigned short stream_id, unsigned int len,
74 | unsigned short streamSN,unsigned int TSN, unsigned int protoID,
75 | unsigned int unordered, void* dummy);
76 |
77 | /* indicates a change of network status (chapter 10.2.C).
78 | params: 1. associationID
79 | 2. destinationAddresses
80 | 3. newState
81 | */
82 | void ulp_networkStatusChangeNotif(unsigned int assoc_id, short dest_add, unsigned short new_state, void* dummy);
83 |
84 | /* indicates a sned failure (chapter 10.2.B).
85 | params: 1. associationID
86 | 2. pointer to data not sent
87 | 3. dataLength
88 | 4. context from sendChunk
89 | */
90 | void ulp_sendFailureNotif(unsigned int assoc_id,
91 | unsigned char *unsent_data, unsigned int data_len, unsigned int *context, void* dummy);
92 |
93 |
94 | /* indicates that communication was lost to peer (chapter 10.2.E).
95 | params: 1. associationID
96 | 2. status, type of event
97 | */
98 | void ulp_communicationLostNotif(unsigned int assoc_id, unsigned short status, void* dummy);
99 |
100 | /* indicates that a association is established (chapter 10.2.D).
101 | params: 1. associationID
102 | 2. status, type of event
103 | */
104 | void* ulp_communicationUpNotif(unsigned int assoc_id, int status,
105 | unsigned int noOfDestinations,
106 | unsigned short noOfInStreams, unsigned short noOfOutStreams,
107 | int associationSupportsPRSCTP, void* dummy);
108 |
109 | /* indicates that association has been gracefully shutdown (chapter 10.2.H).
110 | params: 1. associationID
111 | */
112 | void ulp_ShutdownCompleteNotif(unsigned int assoc_id, void* dummy);
113 |
114 |
115 | #endif
116 |
--------------------------------------------------------------------------------
/sctplib/programs/script1:
--------------------------------------------------------------------------------
1 |
2 | initialize: ip=192.168.0.1, port=10001, instreams=1, outstreams=1;
3 |
4 | set_payload_header: type=1234, mbu=56, mch=78, jc1=9A, jc2=BC;
5 | set_payload_body: length=20, contents="abc\64\65\66";
6 |
7 | wait_for_assoc;
8 |
9 | LOOP: times = 3;
10 | send_chunks: num=2000, stream=0, delay=0;
11 | pause: time=5000;
12 | ENDLOOP;
13 |
14 | shutdown;
15 |
16 |
17 |
--------------------------------------------------------------------------------
/sctplib/programs/script2:
--------------------------------------------------------------------------------
1 | initialize: ip=192.168.0.2, port=20001, instreams=1, outstreams=1;
2 |
3 | set_ack_delay: delay=10;
4 |
5 | associate: ip=192.168.0.1, port=10001, outstreams=1;
6 |
7 |
--------------------------------------------------------------------------------
/sctplib/programs/sctp_wrapper.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | #include "../sctp/sctp.h"
45 |
46 | #ifdef __cplusplus
47 | extern "C" {
48 | #endif
49 |
50 |
51 | int
52 | SCTP_getLibraryParameters(SCTP_LibraryParameters *params);
53 |
54 | int
55 | SCTP_setLibraryParameters(SCTP_LibraryParameters *params);
56 |
57 | int
58 | SCTP_initLibrary(void);
59 |
60 | int
61 | SCTP_registerInstance(unsigned short port,
62 | unsigned short noOfInStreams,
63 | unsigned short noOfOutStreams,
64 | unsigned int noOfLocalAddresses,
65 | unsigned char localAddressList[][SCTP_MAX_IP_LEN],
66 | SCTP_ulpCallbacks ULPcallbackFunctions);
67 |
68 | int
69 | SCTP_unregisterInstance(unsigned short instance_name);
70 |
71 | int
72 | SCTP_deleteAssociation(unsigned int associationID);
73 |
74 | int
75 | SCTP_send(unsigned int associationID, unsigned short streamID,
76 | unsigned char *buffer, unsigned int length, unsigned int protocolId, short path_id,
77 | void* context,
78 | unsigned int lifetime,
79 | int unorderedDelivery,
80 | int dontBundle);
81 | int
82 | SCTP_receive(unsigned int associationID, unsigned short streamID, unsigned char *buffer,
83 | unsigned int *length, unsigned short* streamSN, unsigned int * tsn, unsigned int flags);
84 |
85 | int
86 | SCTP_shutdown(unsigned int associationID);
87 |
88 | int
89 | SCTP_abort(unsigned int associationID);
90 |
91 | short
92 | SCTP_setPrimary(unsigned int associationID, short path_id);
93 |
94 | short
95 | SCTP_getPrimary(unsigned int associationID);
96 |
97 | int
98 | SCTP_receiveUnacked(unsigned int associationID, unsigned char *buffer, unsigned int *length, unsigned int* tsn,
99 | unsigned short *streamID, unsigned short *streamSN,unsigned int* protocolId);
100 | int
101 | SCTP_receiveUnsent(unsigned int associationID, unsigned char *buffer, unsigned int *length,unsigned int* tsn,
102 | unsigned short *streamID, unsigned short *streamSN,unsigned int* protocolId);
103 |
104 | int
105 | SCTP_eventLoop(void);
106 |
107 | int
108 | SCTP_getPathStatus(unsigned int associationID, short path_id, SCTP_PathStatus* status);
109 |
110 | int
111 | SCTP_getAssocStatus(unsigned int associationID, SCTP_AssociationStatus* status);
112 |
113 | unsigned int
114 | SCTP_associate(unsigned short SCTP_InstanceName,
115 | unsigned short noOfOutStreams,
116 | unsigned char destinationAddress[],
117 | unsigned short destinationPort,
118 | void* ulp_data);
119 |
120 |
121 | int
122 | SCTP_registerStdinCallback(sctp_StdinCallback sdf, char* buffer, int length);
123 |
124 | int SCTP_unregisterStdinCallback();
125 |
126 | int SCTP_changeHeartBeat(unsigned int associationID,
127 | short path_id, int heartbeatON, unsigned int timeIntervall);
128 |
129 | #ifndef WIN32
130 | int
131 | SCTP_registerUserCallback(int fd, sctp_userCallback sdf, void* userData);
132 | #endif
133 |
134 | int
135 | SCTP_getAssocDefaults(unsigned short SCTP_InstanceName, SCTP_InstanceParameters* params);
136 |
137 | int
138 | SCTP_setAssocDefaults(unsigned short SCTP_InstanceName, SCTP_InstanceParameters* params);
139 |
140 | unsigned int
141 | SCTP_startTimer(unsigned int milliseconds, sctp_timerCallback timer_cb,
142 | void *param1, void *param2);
143 |
144 |
145 | #ifdef __cplusplus
146 | }
147 | #endif
148 |
149 |
--------------------------------------------------------------------------------
/sctplib/programs/sctptest.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2001 by Andreas Lang
13 | *
14 | * This library is free software: you can redistribute it and/or modify it
15 | * under the terms of the GNU Lesser General Public License as published by
16 | * the Free Software Foundation, either version 2.1 of the License, or
17 | * (at your option) any later version.
18 | *
19 | * This library is distributed in the hope that it will be useful,
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 | * GNU General Public License for more details.
23 | *
24 | * You should have received a copy of the GNU Lesser General Public License
25 | * along with this program. If not, see .
26 | *
27 | * Contact: anla@gmx.net
28 | */
29 |
30 | /* payload lengths */
31 | #define MIN_PAYLOAD_LENGTH 20
32 | #define MAX_PAYLOAD_LENGTH 494
33 | #define HEADER_LENGTH 6
34 |
35 | /* constants used by processScriptCommand() */
36 | #define CHECK_SCRIPT 0
37 | #define RUN_SCRIPT 1
38 |
39 | /* receive mode constants */
40 | #define RECEIVE_DISCARD 0
41 | #define RECEIVE_MIRROR 1
42 |
43 | /* constants used by getIntParam() and getStrParam() */
44 | #define OPTIONAL 1
45 | #define MANDATORY 0
46 | #define DECIMAL 10
47 | #define HEXADECIMAL 16
48 |
49 | /* results returned by getScriptCommand() */
50 | #define PARSE_OK 0
51 | #define END_OF_FILE 1
52 | #define PARSE_ERROR -1
53 |
54 | /* constants for sctptest_scriptCommand */
55 | #define MAX_NUM_OF_PARAMS 10
56 | #define MAX_WORD_LENGTH 1000 /* (this includes the terminating '\0' character) */
57 |
58 |
59 |
60 | /**
61 | * This structure is used to hold the data that is extracted from a script command by the parser.
62 | * The variables in this structure are set by the function getScriptCommand()
63 | */
64 | struct sctptest_scriptCommand
65 | {
66 | /* the number of parameters that are passed along with this command */
67 | unsigned int numOfParams;
68 |
69 | /* the command string */
70 | char command[MAX_WORD_LENGTH];
71 |
72 | /* an array of structs containing the parameters; */
73 | /* each parameter consists of a key and a value */
74 | struct {
75 | char key[MAX_WORD_LENGTH];
76 | char value[MAX_WORD_LENGTH];
77 | } param[MAX_NUM_OF_PARAMS];
78 | };
79 |
80 |
81 |
82 | /* FUNCTION DECLARATIONS */
83 |
84 | int sctptest_start(char *, int);
85 |
86 | int getScriptCommand(FILE *, struct sctptest_scriptCommand *, unsigned int *, unsigned int *, int mode);
87 |
88 | /* only for testing... */
89 | void printCommand(struct sctptest_scriptCommand *, unsigned int);
90 |
91 | int processScriptCommand(struct sctptest_scriptCommand *, unsigned int, int);
92 |
93 | char *getStrParam(struct sctptest_scriptCommand *, const char *, unsigned int *, int, unsigned int);
94 |
95 | unsigned long getIntParam(struct sctptest_scriptCommand *, const char *, unsigned long,
96 | unsigned long, int, unsigned int *, int, unsigned int);
97 |
98 | void doReceive(unsigned int);
99 |
100 | char *getTimeString();
101 |
102 |
103 |
104 | /* ULP CALLBACK FUNCTIONS */
105 |
106 | void timerCallback(unsigned int, void *, void *);
107 |
108 | void dataArriveNotif(unsigned int assocID, unsigned short streamID, unsigned int length,
109 | unsigned short streamSN,unsigned int TSN, unsigned int protoID,
110 | unsigned int unordered, void *ulpData);
111 |
112 | void sendFailureNotif(unsigned int assocID, unsigned char *unsentData, unsigned int dataLength,
113 | unsigned int *context, void *ulpData);
114 |
115 | void networkStatusChangeNotif(unsigned int assocID, short destinAddr,
116 | unsigned short newState, void *ulpData);
117 |
118 | void* communicationUpNotif(unsigned int assocID, int status, unsigned int noOfDestinAddrs,
119 | unsigned short instreams, unsigned short outstreams,
120 | int associationSupportsPRSCTP, void *ulpData);
121 |
122 | void communicationLostNotif(unsigned int assocID, unsigned short status, void *ulpData);
123 |
124 | void communicationErrorNotif(unsigned int assocID, unsigned short status, void *ulpData);
125 |
126 | void restartNotif(unsigned int assocID, void *ulpData);
127 |
128 | void shutdownCompleteNotif(unsigned int assocID, void *ulpData);
129 |
130 |
--------------------------------------------------------------------------------
/sctplib/programs/test_tool.c:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2001 by Andreas Lang
13 | *
14 | * This library is free software: you can redistribute it and/or modify it
15 | * under the terms of the GNU Lesser General Public License as published by
16 | * the Free Software Foundation, either version 2.1 of the License, or
17 | * (at your option) any later version.
18 | *
19 | * This library is distributed in the hope that it will be useful,
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 | * GNU General Public License for more details.
23 | *
24 | * You should have received a copy of the GNU Lesser General Public License
25 | * along with this program. If not, see .
26 | *
27 | * Contact: anla@gmx.net
28 | */
29 |
30 | #ifdef HAVE_CONFIG_H
31 | #include
32 | #endif
33 |
34 | #include
35 | #include
36 | #include
37 |
38 | #include "sctp_wrapper.h"
39 | #include "sctptest.h"
40 | #include "sctp.h"
41 |
42 | #define POLLIN 0x001
43 | #define POLLPRI 0x002
44 | #define POLLOUT 0x004
45 | #define POLLERR 0x008
46 |
47 | /**
48 | * Callback function used to terminate the programm. It is invoked when
49 | * the user hits the "return" key after the end of the script file was reached.
50 | */
51 | void exitCallback(int fd, short int revents, short int* gotEvents, void * dummy)
52 | {
53 | /* clear stdin buffer */
54 | while(getchar() != 10);
55 |
56 | exit(0);
57 | }
58 |
59 |
60 | /**
61 | * Main function
62 | * Reads the script file name from the command line, checks if there are any errors
63 | * in the script, and if there are none, the script is started. After the script has
64 | * been completely executed, the program stays in the event loop (thus listens for
65 | * arriving chunks etc.) until the user hits the "return" key.
66 | */
67 | int main(int argc, char *argv[])
68 | {
69 | SCTP_LibraryParameters params;
70 | unsigned int numOfErrors = 0;
71 | int i;
72 |
73 | /* check if there is exactly one command line parameter */
74 | if (argc < 2) {
75 | fprintf(stderr, "SCTPTest by Andreas Lang\n");
76 | fprintf(stderr, "Usage: sctptest \n");
77 | fprintf(stderr, "options:\n");
78 | fprintf(stderr, "-i ignore OOTB packets\n");
79 | exit(1);
80 | }
81 |
82 | sctp_initLibrary();
83 | SCTP_getLibraryParameters(¶ms);
84 | for(i = 2; i < argc; i++) {
85 | if(strcmp(argv[i], "-i") == 0) {
86 | params.sendOotbAborts = 0;
87 | }
88 | }
89 | SCTP_setLibraryParameters(¶ms);
90 |
91 | /* check script for errors */
92 | if ((numOfErrors = sctptest_start(argv[1], CHECK_SCRIPT)) != 0) {
93 | fprintf(stderr, "\n%u error(s) in script file!\n", numOfErrors);
94 | exit(1);
95 | }
96 |
97 | /* run script */
98 | sctptest_start(argv[1], RUN_SCRIPT);
99 |
100 | fprintf(stderr, "\nReached end of script file. Press RETURN to exit.\n");
101 | sctp_registerUserCallback(fileno(stdin), &exitCallback, NULL, POLLPRI|POLLIN);
102 |
103 | while (sctp_eventLoop() >= 0);
104 |
105 | /* this will never be reached */
106 | return 0;
107 | }
108 |
--------------------------------------------------------------------------------
/sctplib/programs/testsctp-batch:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | if [ $# -lt 2 ] ; then
4 | echo "Usage: testsctp-batch [Target] [Duration (Seconds)] {Options} ..."
5 | exit
6 | fi
7 |
8 | TARGET=$1
9 | DURATION=$2
10 | shift ; shift
11 |
12 |
13 | echo "Starting testsctp batch:"
14 | echo "Target = $TARGET"
15 | echo "Duration = $DURATION [s]"
16 | echo ""
17 |
18 | SIZES="1 10 100 1000 10000"
19 | for SIZE in $SIZES ; do
20 | ./testsctp -i -T $DURATION -l $SIZE $@ $TARGET
21 | echo ""
22 | done
23 |
--------------------------------------------------------------------------------
/sctplib/sctp/Makefile.am:
--------------------------------------------------------------------------------
1 | EXTRA_DIST = Makefile.nmake
2 |
3 | lib_LTLIBRARIES = libsctplib.la
4 | libsctplib_la_SOURCES = adaptation.c adaptation.h \
5 | auxiliary.c auxiliary.h \
6 | bundling.h \
7 | chunkHandler.c chunkHandler.h \
8 | distribution.c distribution.h \
9 | errorhandler.c errorhandler.h \
10 | flowcontrol.c flowcontrol.h \
11 | globals.c globals.h \
12 | md5.c md5.h \
13 | messages.h \
14 | pathmanagement.c pathmanagement.h \
15 | rbundling.c \
16 | recvctrl.c recvctrl.h \
17 | reltransfer.c reltransfer.h \
18 | sbundling.c \
19 | streamengine.c streamengine.h \
20 | timer_list.c timer_list.h \
21 | SCTP-control.c SCTP-control.h
22 |
23 | include_HEADERS = sctp.h
24 | libsctplib_la_LIBADD = @glib_LIBS@
25 | libsctplib_la_LDFLAGS = \
26 | -version-info $(SCTPLIB_CURRENT):$(SCTPLIB_REVISION):$(SCTPLIB_AGE)
27 |
--------------------------------------------------------------------------------
/sctplib/sctp/Makefile.nmake:
--------------------------------------------------------------------------------
1 | ## Makefile for building sctp.lib and some servers with Microsoft C and nmake
2 | ## Use: nmake -f makefile.nmake
3 | ## nmake all -f makefile.nmake
4 | #
5 |
6 | include ..\..\config.nmake
7 |
8 | CFLAGS=/Od /I$(GLIB_DIR) /I$(GLIB_DIR2) /w /W0
9 |
10 | CVARSDLL=-DWIN32 -DMBCS
11 |
12 |
13 | .c.obj::
14 | $(CC) $(CVARSDLL) $(CFLAGS) -Fd.\ -c $<
15 |
16 | SCTP_SRC = \
17 | adaptation.c \
18 | auxiliary.c \
19 | chunkHandler.c \
20 | distribution.c \
21 | errorhandler.c \
22 | flowcontrol.c \
23 | globals.c \
24 | md5.c \
25 | pathmanagement.c \
26 | rbundling.c \
27 | recvctrl.c \
28 | reltransfer.c \
29 | sbundling.c \
30 | SCTP-control.c \
31 | streamengine.c \
32 | timer_list.c
33 |
34 |
35 | SCTP_HEADERS = \
36 | adaptation.h \
37 | auxiliary.h \
38 | bundling.h \
39 | chunkHandler.h \
40 | distribution.h \
41 | errorhandler.h \
42 | flowcontrol.h \
43 | globals.h \
44 | md5.h \
45 | messages.h \
46 | pathmanagement.h \
47 | recvctrl.h \
48 | reltransfer.h \
49 | SCTP-control.h \
50 | streamengine.h \
51 | timer_list.h
52 |
53 | SCTP_OBJECTS = $(SCTP_SRC:.c=.obj)
54 |
55 |
56 | sctp.lib : $(SCTP_OBJECTS) $(SCTP_HEADERS)
57 | lib /out:sctp.lib $(SCTP_OBJECTS)
58 |
59 |
60 |
61 | clean:
62 | rm -f $(SCTP_OBJECTS)
63 |
64 |
--------------------------------------------------------------------------------
/sctplib/sctp/adaptation.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | /* ############################################################################## */
45 | /* INCLUDES */
46 | /* ############################################################################## */
47 |
48 | #ifndef ADAPTATION_H
49 | #define ADAPTATION_H
50 |
51 | #ifdef HAVE_CONFIG_H
52 | #include
53 | #endif
54 |
55 | #include "sctp.h"
56 | #include "globals.h"
57 | #include "distribution.h"
58 |
59 |
60 | unsigned int adl_random(void);
61 |
62 | boolean adl_equal_address(union sockunion *one, union sockunion *two);
63 |
64 |
65 | /**
66 | * converts address-string (hex for ipv6, dotted decimal for ipv4
67 | * to a sockunion structure
68 | * @return 0 for success, else -1.
69 | */
70 | int adl_str2sockunion(guchar * str, union sockunion *su);
71 |
72 | int adl_sockunion2str(union sockunion *su, guchar * buf, size_t len);
73 |
74 |
75 |
76 |
77 | /*------------------------------------------------------------------------------------------------------------------*/
78 | /*------------------------------------------------------------------------------------------------------------------*/
79 |
80 | /**
81 | * This function binds a local socket for incoming requests
82 | * @return socket file descriptor for the newly opened and bound socket
83 | * @param address (local) port to bind to
84 | */
85 | gint adl_open_sctp_socket(int af, int* myRwnd);
86 |
87 | int adl_setReceiveBufferSize(int sfd, int new_size);
88 |
89 | gint adl_get_sctpv4_socket(void);
90 | #ifdef HAVE_IPV6
91 | gint adl_get_sctpv6_socket(void);
92 | #endif
93 |
94 |
95 | /**
96 | * function to be called when we get a message from a peer sctp instance in the poll loop
97 | * @param sfd the socket file descriptor where data can be read...
98 | * @param buf pointer to a buffer, where we data is stored
99 | * @param len number of bytes to be sent, including the ip header !
100 | * @param address, where data goes from
101 | * @param dest_len size of the address
102 | * @return returns number of bytes actually sent, or error
103 | */
104 | int adl_send_message(int sfd, void *buf, int len, union sockunion *dest, unsigned char tos);
105 |
106 |
107 | /**
108 | * this function initializes the data of this module. It opens raw sockets for
109 | * capturing SCTP packets, and also opens ICMP sockets, so we can get ICMP events,
110 | * e.g. for Path-MTU discovery !
111 | */
112 | int adl_init_adaptation_layer(int * myRwnd);
113 |
114 |
115 |
116 | /**
117 | * function add a sfd to the list of sfds we want to wait for with the poll()
118 | * @param sfd the socket file descriptor of the socket to react upon
119 | * @param scf function pointer holding the callback funtion for normal events.
120 | * @return the current number of sockets that are polled.
121 | */
122 | int adl_register_socket_cb(gint sfd, sctp_socketCallback scf);
123 |
124 |
125 | /**
126 | * function to close a bound socket from our list of socket descriptors
127 | * @param sfd socket file descriptor to be closed
128 | * @return 0 on success, -1 for error, 1 if socket was not bound
129 | * @author ajung
130 | */
131 | int adl_remove_cb(gint sfd);
132 |
133 | /**
134 | * remove a sfd from the poll_list, and shift that list to the left
135 | * @return number of sfd's removed...
136 | */
137 | int adl_remove_poll_fd(gint sfd);
138 |
139 |
140 | /**
141 | * function is to return difference in msecs between time a and b (i.e. a-b)
142 | * @param a later time (e.g. current time)
143 | * @param b earlier time
144 | * @return -1 if a is earlier than b, else msecs that passed from b to a
145 | */
146 | int adl_timediff_to_msecs(struct timeval *a, struct timeval *b);
147 |
148 |
149 | void adl_add_msecs_totime(struct timeval *t, unsigned int msecs);
150 |
151 | int adl_gettime(struct timeval *tv);
152 |
153 | int adl_extendedGetEvents(void (*lock)(void* data), void (*unlock)(void* data), void* data);
154 |
155 | int adl_registerUdpCallback(unsigned char me[],
156 | unsigned short my_port,
157 | sctp_socketCallback scf);
158 |
159 | int adl_unregisterUdpCallback(int udp_sfd);
160 |
161 | int adl_sendUdpData(int sfd, unsigned char* buf, int length,
162 | unsigned char destination[], unsigned short dest_port);
163 |
164 |
165 | int adl_registerStdinCallback(sctp_StdinCallback sdf, char* buffer, int length);
166 | int adl_unregisterStdinCallback();
167 |
168 | int adl_registerUserCallback(int fd, sctp_userCallback sdf, void* userData, short int eventMask);
169 |
170 | int adl_unregisterUserCallback(int fd);
171 |
172 | unsigned int adl_startMicroTimer(unsigned int seconds, unsigned int microseconds,
173 | sctp_timerCallback timer_cb, int ttype, void *param1, void *param2);
174 |
175 | unsigned int adl_startTimer(unsigned int milliseconds, sctp_timerCallback timer_cb,
176 | int ttype, void *param1, void *param2);
177 |
178 | int adl_stopTimer(unsigned int tid);
179 |
180 | unsigned int adl_restartTimer(unsigned int timer_id, unsigned int milliseconds);
181 |
182 | unsigned int adl_restartMicroTimer(unsigned int timer_id, unsigned int seconds, unsigned int microseconds);
183 |
184 | int adl_getEvents(void);
185 |
186 | int adl_eventLoop();
187 |
188 | int adl_extendedEventLoop(void (*lock)(void* data), void (*unlock)(void* data), void* data);
189 |
190 | gboolean adl_filterInetAddress(union sockunion* newAddress, AddressScopingFlags flags);
191 |
192 | /*
193 | * this is an ugly part to code, so it was taken an adapted from the
194 | * SCTP reference implementation by Randy Stewart
195 | * see http://www.sctp.org
196 | * maybe I should rewrite it to use the Linux Netlink socket also
197 | * returns TRUE is successful, else FALSE
198 | */
199 | gboolean adl_gatherLocalAddresses(union sockunion **localAddresses,
200 | int *numberOfNets,
201 | int sctp_fd,
202 | gboolean with_ipv6,
203 | int *max_mtu,
204 | const AddressScopingFlags flags);
205 |
206 |
207 | #endif
208 |
--------------------------------------------------------------------------------
/sctplib/sctp/auxiliary.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | #ifndef AUXILIARY_H
45 | #define AUXILIARY_H
46 |
47 |
48 | unsigned char* key_operation(int operation_code);
49 |
50 |
51 | /**
52 | * This function performs all necessary checks, that are possible at this
53 | * layer. Calls subsequent check-functions for each part that may be checked.
54 | * @param buffer pointer to the start of the received datagram (SCTP PDU)
55 | * @param length size of the buffer
56 | * @return 0 if validation failed, 1 if successful, -1 if any error ocurred
57 | */
58 | int validate_datagram(unsigned char *buffer, int length);
59 |
60 | int aux_insert_checksum(unsigned char *buffer, int length);
61 |
62 | int set_checksum_algorithm(int algorithm);
63 |
64 | #endif
65 |
66 |
--------------------------------------------------------------------------------
/sctplib/sctp/bundling.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | #ifndef BUNDLING_H
45 | #define BUNDLING_H
46 |
47 |
48 | #include "globals.h" /* for chunk struct definition */
49 | #include "SCTP-control.h"
50 | #include "pathmanagement.h"
51 |
52 | void bu_init_bundling(void);
53 | gint bu_put_Ctrl_Chunk(SCTP_simple_chunk * chunk,unsigned int * dest_index);
54 | gint bu_put_Data_Chunk(SCTP_simple_chunk * chunk,unsigned int * dest_index);
55 |
56 |
57 | /*
58 | * bu_new: Creates a new bundling instance and returns a pointer to its data.
59 | */
60 | gpointer bu_new(void);
61 |
62 | /*
63 | * bu_delete: Deletes a bundling instance
64 | *
65 | * Params: Pointer/handle which was returned by bu_new()
66 | */
67 | void bu_delete(gpointer instancePtr);
68 |
69 | /**
70 | * returns a value indicating which chunks are in the packet.
71 | */
72 | unsigned int rbu_scanPDU(guchar * pdu, guint len);
73 |
74 | /*
75 | * rbu_datagramContains: looks for chunk_type in a newly received datagram
76 | * Should be called after rbu_scanPDU().
77 | * The chunkArray parameter is inspected. This only really checks for chunks
78 | * with an ID <= 30. For all other chunks, it just guesses...
79 | * @return true is chunk_type exists in chunkArray, false if it is not in there
80 | */
81 | gboolean rbu_datagramContains(gushort chunk_type, unsigned int chunkArray);
82 |
83 | guchar* rbu_scanInitChunkForParameter(guchar * chunk, gushort paramType);
84 |
85 | /*
86 | * rbu_findChunk: looks for chunk_type in a newly received datagram
87 | *
88 | * All chunks within the datagram are looked at, until one is found
89 | * that equals the parameter chunk_type.
90 | * @return pointer to first chunk of chunk_type in SCTP datagram, else NULL
91 | */
92 | guchar* rbu_findChunk(guchar * datagram, guint len, gushort chunk_type);
93 |
94 | /*
95 | * rbu_scanDatagramForError : looks for Error chunk_type in a newly received datagram
96 | * that contains a special error cause code
97 | *
98 | * All chunks within the datagram are lookes at, until one is found
99 | * that equals the parameter chunk_type.
100 | * @return true is chunk_type exists in SCTP datagram, false if it is not in there
101 | */
102 | gboolean rbu_scanDatagramForError(guchar * datagram, guint len, gushort error_cause);
103 |
104 | /*
105 | * rbu_findAddress: looks for address type parameters in INIT or INIT-ACKs
106 | * All parameters within the chunk are looked at, and the n-th supported address is
107 | * copied into the provided buffer pointed to by the foundAddress parameter.
108 | * If there are less than n addresses, an appropriate error is
109 | * returned. n should be at least 1, of course.
110 | * @param chunk pointer to an INIT or INIT ACK chunk
111 | * @param n get the n-th address
112 | * @param foundAddress pointer to a buffer where an address, if found, will be copied
113 | * @return -1 for parameter problem, 0 for success (i.e. address found), 1 if there are not
114 | * that many addresses in the chunk.
115 | */
116 | gint rbu_findAddress(guchar * chunk, guint n, union sockunion* foundAddress, int supportedAddressTypes);
117 |
118 | /*
119 | * rbu_rcvDatagram: Hands a lower layer datagram over to bundling (for de-bundling)
120 | *
121 | * All chunks within the datagram are dispatched and sent to the appropriate
122 | * module, i.e.: control chunks are sent to sctp_control/pathmanagement,
123 | * SACK chunks to reliable_transfer, and data_chunks to RX_control.
124 | * Those modules must get a pointer to the start of a chunk and
125 | * information about its size (without padding).
126 | */
127 | gint rbu_rcvDatagram(guint address_index, guchar * datagram, guint len);
128 |
129 |
130 | void bu_lock_sender(void);
131 | void bu_unlock_sender(guint* ad_idx);
132 | gboolean bu_userDataOutbound(void);
133 |
134 | /**
135 | * bu_put_SACK_Chunk: Called by recvcontrol, when a SACK must be piggy-backed
136 | *
137 | * @param chunk pointer to chunk, that is to be put in the bundling buffer
138 | * @return error value, 0 on success, -1 on error
139 | */
140 | gint bu_put_SACK_Chunk(SCTP_sack_chunk * chunk, unsigned int* dest_index);
141 |
142 |
143 | /*
144 | * bu_sendAllChunks: Trigger to send all chunks previously entered with putChunk.
145 | *
146 | * Return value: error value
147 | * Chunks sent are deleted afterwards.
148 | */
149 | gint bu_sendAllChunks(guint * ad_idx);
150 |
151 | void bu_request_sack(void);
152 |
153 | #endif
154 |
--------------------------------------------------------------------------------
/sctplib/sctp/errorhandler.c:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | #include "globals.h" /* for chunk struct definition */
45 | #include "chunkHandler.h"
46 | #include "bundling.h"
47 | #include "SCTP-control.h"
48 |
49 |
50 | void eh_init_errorhandler(void)
51 | {
52 | }
53 |
54 | /*
55 | * eh_new: Create a new instance and returns a pointer to its data.
56 | */
57 | void *eh_new(void)
58 | {
59 | return NULL;
60 | }
61 |
62 | /*
63 | * eh_delete: Deletes a bundling instance
64 | *
65 | * Params: Pointer/handle which was returned by eh_new()
66 | */
67 | void eh_delete(void *instancePtr)
68 | {
69 |
70 | }
71 |
72 | /*
73 | * eh_recv_chunk gets a pointer to an error chunk and decodes it
74 | * accordingly....
75 | * @return error code, 0 for success, less than one for error
76 | */
77 | int eh_recv_chunk(SCTP_simple_chunk * errchunk)
78 | {
79 | SCTP_error_chunk *chunk;
80 | SCTP_vlparam_header *header;
81 | SCTP_error_cause *cause;
82 | unsigned char* data;
83 |
84 | unsigned short err_cause;
85 | unsigned short cause_len;
86 | int result = (-1);
87 |
88 | chunk = (SCTP_error_chunk *) errchunk;
89 | cause = (SCTP_error_cause *) chunk->data;
90 | data = cause->cause_information;
91 |
92 | err_cause = ntohs(cause->cause_code);
93 | cause_len = ntohs(cause->cause_length);
94 | switch (err_cause) {
95 | case ECC_INVALID_STREAM_ID:
96 | event_logi(EXTERNAL_EVENT, "Invalid Stream Id Error with Len %u ", cause_len);
97 | break;
98 | case ECC_MISSING_MANDATORY_PARAM:
99 | event_logi(EXTERNAL_EVENT, "Missing Mandatory Parameter Error, Len %u ", cause_len);
100 | break;
101 | case ECC_STALE_COOKIE_ERROR:
102 | event_logi(EXTERNAL_EVENT, "Stale Cookie Error, Len %u ", cause_len);
103 | sctlr_staleCookie((SCTP_simple_chunk *) errchunk);
104 | result = 0;
105 | break;
106 | case ECC_OUT_OF_RESOURCE_ERROR:
107 | event_logi(EXTERNAL_EVENT, "Out Of Resource Error with Len %u ", cause_len);
108 | break;
109 | case ECC_UNRESOLVABLE_ADDRESS:
110 | event_logi(EXTERNAL_EVENT, "Unresovable Address Error with Len %u ", cause_len);
111 | break;
112 | case ECC_UNRECOGNIZED_CHUNKTYPE:
113 | event_logi(EXTERNAL_EVENT, "Unrecognized Chunktype Len %u ", cause_len);
114 | break;
115 | case ECC_INVALID_MANDATORY_PARAM:
116 | event_logi(EXTERNAL_EVENT, "Invalid Mandatory Parameter : Len %u ", cause_len);
117 | break;
118 | case ECC_UNRECOGNIZED_PARAMS:
119 | event_logi(EXTERNAL_EVENT, "Unrecognized Params Error with Len %u ", cause_len);
120 | header = (SCTP_vlparam_header*)data;
121 | if (ntohs(header->param_type) == VLPARAM_PRSCTP) {
122 | /* set peer does not understand PRSCTP - do not use it in this ASSOC ! */
123 | event_log(EXTERNAL_EVENT, "Unrecognized Parameter: PR_SCTP ");
124 | }
125 | break;
126 | case ECC_NO_USER_DATA:
127 | event_logi(EXTERNAL_EVENT, "No User Data Error with Len %u ", cause_len);
128 | break;
129 | case ECC_COOKIE_RECEIVED_DURING_SHUTDWN:
130 | event_logi(EXTERNAL_EVENT, "Error : Cookie Received During Shutdown, Len: %u ", cause_len);
131 | break;
132 | default:
133 | error_logii(ERROR_MINOR, "Unrecognized Error Cause %u with Len %u ", err_cause, cause_len);
134 | }
135 | return result;
136 | }
137 |
138 | /**
139 | * function to trigger sending of error chunk, after receiving an invalid stream id
140 | * @return error value, 0 on success, -1 on error
141 | */
142 | int eh_make_invalid_streamid_error(unsigned short streamid)
143 | {
144 | ChunkID errorCID;
145 | SCTP_InvalidStreamIdError error_info;
146 |
147 | /* build chunk */
148 | errorCID = ch_makeErrorChunk();
149 |
150 | error_info.stream_id = htons(streamid);
151 | error_info.reserved = htons(0);
152 |
153 | /* add parameters */
154 | ch_enterErrorCauseData(errorCID, ECC_INVALID_STREAM_ID, 4, (unsigned char*)&error_info);
155 |
156 | bu_put_Ctrl_Chunk(ch_chunkString(errorCID),NULL);
157 | ch_deleteChunk(errorCID);
158 |
159 | return 0;
160 | }
161 |
162 |
163 | /**
164 | * function to put an error_chunk with type UNKNOWN PARAMETER
165 | * @return error value, 0 on success, -1 on error
166 | */
167 | int eh_send_unrecognized_chunktype(unsigned char* faulty_chunk, unsigned short length)
168 | {
169 | ChunkID errorCID;
170 |
171 | /* build chunk */
172 | errorCID = ch_makeErrorChunk();
173 | /* add parameters */
174 | ch_enterErrorCauseData(errorCID, ECC_UNRECOGNIZED_CHUNKTYPE, length, (unsigned char*)faulty_chunk);
175 |
176 | bu_put_Ctrl_Chunk(ch_chunkString(errorCID),NULL);
177 | ch_deleteChunk(errorCID);
178 |
179 | return bu_sendAllChunks(NULL);
180 | }
181 |
182 | /**
183 | * function to trigger sending of error chunk, after mandatory parameter(s) was(were) missing
184 | * @return error value, 0 on success, -1 on error
185 | */
186 | int eh_make_missing_mandatory_param(unsigned int number, unsigned short *param_types)
187 | {
188 | return -1;
189 | }
190 |
191 | /**
192 | * function to trigger sending of error chunk, after receiving an invalid stream id
193 | * @param number number of pointers passed as second argument
194 | * @param addresses pointers (or array of pointers) to unrecognized addresses
195 | * @return error value, 0 on success, -1 on error
196 | */
197 | int eh_send_unresolvable_address(unsigned int number, unsigned char *addresses)
198 | {
199 | return -1;
200 | }
201 |
202 |
203 | /**
204 | * function to add an error chunk, after empty data chunk was received
205 | * @return error value, 0 on success, -1 on error
206 | */
207 | int eh_make_empty_data_chunk_error(unsigned int tsn)
208 | {
209 | ChunkID errorCID;
210 |
211 | /* build chunk */
212 | errorCID = ch_makeErrorChunk();
213 |
214 | /* add parameters */
215 | ch_enterErrorCauseData(errorCID, ECC_NO_USER_DATA, sizeof(unsigned int), (unsigned char*)&tsn);
216 |
217 | bu_put_Ctrl_Chunk(ch_chunkString(errorCID),NULL);
218 | ch_deleteChunk(errorCID);
219 |
220 | return 0;
221 | }
222 |
223 |
224 |
--------------------------------------------------------------------------------
/sctplib/sctp/errorhandler.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | #ifndef ERRORHANDLER_H
45 | #define ERRORHANDLER_H
46 |
47 | #include "globals.h" /* for chunk struct definition */
48 |
49 | void eh_init_errorhandler(void);
50 |
51 | /*
52 | * eh_new: Create a new instance and returns a pointer to its data.
53 | */
54 | void *eh_new(void);
55 |
56 | /*
57 | * eh_delete: Deletes a bundling instance
58 | *
59 | * Params: Pointer/handle which was returned by eh_new()
60 | */
61 | void eh_delete(void *instancePtr);
62 |
63 | /*
64 | * eh_recv_chunk gets a pointer to an error chunk and decodes it
65 | * accordingly....
66 | * @return error code, 0 for success, less than one for error
67 | */
68 | int eh_recv_chunk(SCTP_simple_chunk * errchunk);
69 |
70 | /**
71 | * function to trigger sending of error chunk, after receiving an invalid stream id
72 | * @return error value, 0 on success, -1 on error
73 | */
74 | int eh_make_invalid_streamid_error(unsigned short streamid);
75 |
76 |
77 | /**
78 | * function sends the unknown chunk back
79 | */
80 | int eh_send_unrecognized_chunktype(unsigned char* faulty_chunk, unsigned short length);
81 |
82 | /**
83 | * function to trigger sending of error chunk, after mandatory parameter(s) was(were) missing
84 | * @return error value, 0 on success, -1 on error
85 | */
86 | int eh_make_missing_mandatory_param(unsigned int number, unsigned short *param_types);
87 |
88 | /**
89 | * function to trigger sending of error chunk, after receiving an invalid stream id
90 | * @param number number of pointers passed as second argument
91 | * @param addresses pointers (or array of pointers) to unrecognized addresses
92 | * @return error value, 0 on success, -1 on error
93 | */
94 | int eh_send_unresolvable_address(unsigned int number, unsigned char *addresses);
95 |
96 |
97 |
98 | /**
99 | * function to add an error chunk, after empty data chunk was received
100 | * @return error value, 0 on success, -1 on error
101 | */
102 | int eh_make_empty_data_chunk_error(unsigned int tsn);
103 |
104 |
105 |
106 | #endif
107 |
--------------------------------------------------------------------------------
/sctplib/sctp/flowcontrol.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | #ifndef FLOWCONTROL_H
45 | #define FLOWCONTROL_H
46 |
47 | #ifdef HAVE_CONFIG_H
48 | #include
49 | #endif
50 |
51 | #include "globals.h"
52 | #include "reltransfer.h"
53 |
54 | /**
55 | * Creates new instance of flowcontrol module and returns pointer to it
56 | * TODO : should parameter be unsigned short ?
57 | */
58 | void *fc_new_flowcontrol(unsigned int peer_rwnd,
59 | unsigned int my_iTSN,
60 | unsigned int number_of_destination_addresses,
61 | unsigned int maxQueueLen);
62 |
63 | /**
64 | * Deletes data occupied by a flow_control data structure
65 | * @param fc_instance pointer to the flow_control data structure
66 | */
67 | void fc_delete_flowcontrol(void *fc_instance);
68 |
69 |
70 |
71 | /**
72 | * this function should be called to signal to flowcontrol, that our ULP
73 | * has initiated a shutdown procedure. We must only send unacked data from
74 | * now on ! The association is about to terminate !
75 | */
76 | void fc_shutdown(void);
77 |
78 | /**
79 | * this function stops all currently running timers, and may be called when
80 | * the shutdown is imminent
81 | */
82 | void fc_stop_timers(void);
83 |
84 | /**
85 | * this function stops all currently running timers, and may be called when
86 | * the shutdown is imminent
87 | */
88 | void fc_restart(guint32 new_rwnd, unsigned int iTSN, unsigned int maxQueueLen);
89 |
90 |
91 |
92 | /**
93 | * Function called by stream engine to enqueue data chunks in the flowcontrol
94 | * module. After function returns, we should be able to delete the pointer
95 | * to the data (i.e. some lower module must have copied the data...e.g. the
96 | * Flowcontrol, ReliableTransfer, or Bundling
97 | * @param chunk pointer to the data chunk to be sent
98 | * @param destAddressIndex index to address to send data structure to...
99 | * @return -1 on error, 0 on success, (1 if problems occurred ?)
100 | */
101 | int fc_send_data_chunk(chunk_data * chunk, short destAddressIndex, /* negative -> primary p., else path index */
102 | unsigned int lifetime, /* 0xFFFFFFFF -> infinite */
103 | gboolean dontBundle,
104 | gpointer context); /* FALSE==0==bundle, TRUE==1==don't bundle */
105 |
106 |
107 | /**
108 | * function called by Reliable Transfer, when it requests retransmission
109 | * in SDL diagram this signal is called (Req_RTX, RetransChunks)
110 | * @param all_data_acked indicates whether or not all data chunks have been acked
111 | * @param new_data_acked indicates whether or not new data has been acked
112 | * @param num_acked number of bytes that have been newly acked, else 0
113 | * @param number_of_addresses so many addresses may have outstanding bytes
114 | * actually that value may also be retrieved from the association struct (?)
115 | * @param num_acked_per_address array of integers, that hold number of bytes acked for each address
116 | * @param number_of_rtx_chunks number indicatin, how many chunks are to be retransmitted in on datagram
117 | * @param chunks array of pointers to data_chunk structures. These are to be retransmitted
118 | * @return -1 on error, 0 on success, (1 if problems occurred ?)
119 | */
120 | int fc_fast_retransmission(unsigned int address_index, unsigned int arwnd,unsigned int ctsna,
121 | unsigned int rtx_bytes, boolean all_data_acked,
122 | boolean new_data_acked, unsigned int num_acked,
123 | unsigned int number_of_addresses,
124 | int number_of_rtx_chunks, chunk_data ** chunks);
125 |
126 | /**
127 | * function called by Reliable Transfer, after it has got a SACK chunk
128 | * in SDL diagram this signal is called SACK_Info
129 | * @param all_data_acked indicates whether or not all data chunks have been acked
130 | * @param new_data_acked indicates whether or not new data has been acked
131 | * @param num_acked number of bytes that have been newly acked, else 0
132 | * @param number_of_addresses so many addresses may have outstanding bytes
133 | * actually that value may also be retrieved from the association struct (?)
134 | * @param num_acked_per_address array of integers, that hold number of bytes acked for each address
135 | */
136 | void fc_sack_info(unsigned int address_index, unsigned int arwnd, unsigned int ctsna,
137 | boolean all_data_acked,
138 | boolean new_data_acked,
139 | unsigned int num_acked,
140 | unsigned int number_of_addresses);
141 |
142 | int fc_dequeueUnackedChunk(unsigned int tsn);
143 |
144 | int fc_dequeue_acked_chunks(unsigned int ctsna);
145 |
146 | int fc_dequeueOldestUnsentChunk(unsigned char *buf, unsigned int *len, unsigned int *tsn,
147 | unsigned short *sID, unsigned short *sSN,unsigned int* pID,
148 | unsigned char* flags, gpointer* ctx);
149 |
150 | int fc_readNumberOfUnsentChunks(void);
151 | /**
152 | * function returns number of chunks, that have been submitted from the upper layer,
153 | * but not yet been sent ! These are waiting in the transmission queue, not the
154 | * retransmission queue
155 | */
156 | unsigned int fc_readNumberOfQueuedChunks(void);
157 |
158 |
159 |
160 | /**
161 | * Function returns cwnd value of a certain path.
162 | * @param path_id path index of which we want to know the cwnd
163 | * @return current cwnd value, else -1
164 | */
165 | int fc_readCWND(short path_id);
166 |
167 |
168 | /**
169 | * Function returns cwnd value of a certain path.
170 | * @param path_id path index of which we want to know the cwnd
171 | * @return current cwnd2 value, else -1
172 | */
173 | int fc_readCWND2(short path_id);
174 |
175 |
176 | /**
177 | * Function returns ssthresh value of a certain path.
178 | * @param path_id path index of which we want to know the cwnd
179 | * @return current ssthresh value, else -1
180 | */
181 | int fc_readSsthresh(short path_id);
182 |
183 |
184 |
185 | /**
186 | * Function returns mtu value of a certain path.
187 | * @param path_id path index of which we want to know the mtu
188 | * @return current MTU value, else -1
189 | */
190 | unsigned int fc_readMTU(short path_id);
191 |
192 |
193 | /**
194 | * Function returns the partial bytes acked value of a certain path.
195 | * @param path_id path index of which we want to know the PBA
196 | * @return current PBA value, else -1
197 | */
198 | int fc_readPBA(short path_id);
199 |
200 |
201 | /**
202 | * Function returns the outstanding byte count value of this association.
203 | * @return current outstanding_bytes value, else -1
204 | */
205 | int fc_readOutstandingBytes(void);
206 |
207 |
208 | int fc_get_maxSendQueue(unsigned int * queueLen);
209 |
210 | int fc_set_maxSendQueue(unsigned int maxQueueLen);
211 |
212 | #endif
213 |
--------------------------------------------------------------------------------
/sctplib/sctp/md5.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * MD5 hash calculation
4 | * Copyright (C) 1991-1992 RSA Data Security, Inc.
5 | *
6 | * This library is free software: you can redistribute it and/or modify it
7 | * under the terms of the GNU Lesser General Public License as published by
8 | * the Free Software Foundation, either version 2.1 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This library is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public License
17 | * along with this program. If not, see .
18 | */
19 |
20 | /******************************************************************
21 | License to copy and use this software is granted provided that it
22 | is identified as the "RSA Data Security, Inc. MD5 Message-Digest
23 | Algorithm" in all material mentioning or referencing this software
24 | or this function.
25 |
26 | License is also granted to make and use derivative works provided
27 | that such works are identified as "derived from the RSA Data
28 | Security, Inc. MD5 Message-Digest Algorithm" in all material
29 | mentioning or referencing the derived work.
30 |
31 | RSA Data Security, Inc. makes no representations concerning either
32 | the merchantability of this software or the suitability of this
33 | software for any particular purpose. It is provided "as is"
34 | without express or implied warranty of any kind.
35 |
36 | These notices must be retained in any copies of any part of this
37 | documentation and/or software.
38 | *******************************************************************/
39 |
40 | /* PROTOTYPES should be set to one if and only if the compiler supports
41 | function argument prototyping.
42 | The following makes PROTOTYPES default to 0 if it has not already
43 | been defined with C compiler flags.
44 | */
45 |
46 | #include
47 | #include
48 |
49 | /* POINTER defines a generic pointer type */
50 | typedef unsigned char *POINTER;
51 |
52 | /* UINT2 defines a two byte word */
53 | typedef guint16 UINT2;
54 |
55 | /* UINT4 defines a four byte word */
56 | typedef guint32 UINT4;
57 |
58 | /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
59 | If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
60 | returns an empty list.
61 | */
62 |
63 | /* MD5 context. */
64 | typedef struct
65 | {
66 | UINT4 state[4]; /* state (ABCD) */
67 | UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
68 | unsigned char buffer[64]; /* input buffer */
69 | } MD5_CTX;
70 |
71 | void MD5Init (MD5_CTX *);
72 | void MD5Update (MD5_CTX *, unsigned char *, unsigned int);
73 | void MD5Final (unsigned char[16], MD5_CTX *);
74 |
75 |
76 | #define MD5_memcpy(output,input,len) memcpy(output,input,len)
77 | #define MD5_memset(output,input,len) memset(output,input,len)
78 |
--------------------------------------------------------------------------------
/sctplib/sctp/pathmanagement.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | #ifndef PATHMANAGEMENT_H
45 | #define PATHMANAGEMENT_H
46 |
47 | #ifdef HAVE_CONFIG_H
48 | #include
49 | #endif
50 |
51 |
52 | /* The states of pathmanagement, also used for network status change */
53 | #define PM_ACTIVE 0
54 | #define PM_INACTIVE 1
55 | #define PM_ADDED 2
56 | #define PM_REMOVED 3
57 |
58 | #define PM_PATH_UNCONFIRMED 5
59 |
60 |
61 | #define PM_INITIAL_HB_INTERVAL 30000
62 |
63 |
64 | /******************** Functions to answer peer HB requests ****************************************/
65 | /**
66 | * Function is called to perform a on demand HB on a certain path
67 | */
68 | int pm_doHB(gshort pathID);
69 |
70 |
71 | /* pm_heartbeat is called when a heartbeat was received from the peer.
72 | params: heartbeatChunk: the heartbeat chunk
73 | */
74 | void pm_heartbeat(SCTP_heartbeat * heartbeatChunk, unsigned int source_address);
75 |
76 |
77 | /******************** Signals *********************************************************************/
78 |
79 | /*------------------- Signals from the Unix-Interface --------------------------------------------*/
80 |
81 | /* pm_heartbeatTimer is called by the adaption-layer when the heartbeat timer expires.
82 | params: timerID: ID of timer
83 | associationIDvoid: pointer to the association-ID
84 | pathIDvoid: pointer to the path-ID
85 | */
86 | void pm_heartbeatTimer(TimerID timerID, void *associationIDvoid, void *pathIDvoid);
87 |
88 |
89 |
90 | /* pm_heartbeatAck is called when a heartbeat acknowledgement was received from the peer.
91 | params: heartbeatChunk: the heartbeat chunk
92 | */
93 | void pm_heartbeatAck(SCTP_heartbeat * heartbeatChunk);
94 |
95 | /*------------------- Signals from SCTP internal modules -----------------------------------------*/
96 |
97 | /* pm_chunksAcked is called by reliable transfer whenever chunks have been acknowledged.
98 | Params: pathID: path-ID
99 | newRTO: the newly determined RTO in milliseconds
100 | newRTO = 0 ==> no RTO measurements done
101 | */
102 | void pm_chunksAcked(short pathID, unsigned int newRTO);
103 |
104 | /**
105 | * function to be called every time we send data to a path
106 | * to keep it from becoming "idle"
107 | */
108 | void pm_chunksSentOn(short pathID);
109 |
110 |
111 | /* pm_chunksRetransmitted is called by reliable transfer whenever chunks have been
112 | retransmitted.
113 | Params: pathID: path-ID
114 | */
115 | gboolean pm_chunksRetransmitted(short pathID);
116 |
117 |
118 |
119 | /* pm_rto_backoff is called by reliable transfer when the T3 retransmission timer expires.
120 | Each call of this function doubles the RTO (timer back off).
121 | Params: pathID: path-ID
122 | */
123 | void pm_rto_backoff(short pathID);
124 |
125 | /*------------------- Helper Function ----------------------------------------------------------*/
126 |
127 | unsigned int pm_getTime(void);
128 |
129 |
130 | /*------------------- Functions called by the ULP ------------------------------------------------*/
131 |
132 |
133 | /* pm_enableHB is called when ULP wants to enable heartbeat.
134 | */
135 | int pm_enableHB(short pathID, unsigned int hearbeatIntervall);
136 |
137 |
138 |
139 | /* pm_disableAllHB is called when on shutdown to disable all heartbeats.
140 | */
141 | void pm_disableAllHB(void);
142 |
143 |
144 |
145 | /* pm_disableHB is called when ULP wants to disable heartbeat.
146 | */
147 | int pm_disableHB(short pathID);
148 |
149 |
150 |
151 |
152 | /* pm_setPrimaryPath sets the primary path.
153 | Params: primaryPathID: path-ID
154 | */
155 | short pm_setPrimaryPath(short pathID);
156 |
157 | int pm_getMaxPathRetransmisions(void);
158 |
159 | int pm_setRtoInitial(int new_rto_initial);
160 |
161 | int pm_getRtoInitial(void);
162 |
163 |
164 | int pm_setRtoMin(int new_rto_min);
165 |
166 | int pm_getRtoMin(void);
167 |
168 | int pm_setRtoMax(int new_rto_max);
169 |
170 | int pm_getRtoMax(void);
171 |
172 | int pm_setHBInterval(unsigned int new_interval);
173 |
174 | int pm_getHBInterval(short pathID, unsigned int* current_interval);
175 |
176 |
177 | int pm_setMaxPathRetransmisions(int new_max);
178 |
179 | /*------------------- Functions called by ULP to read pathmanagement state info ------------------*/
180 |
181 |
182 | /**
183 | * pm_readRTO returns the currently set RTO value in msecs for a certain path.
184 | * @param pathID index of the address/path
185 | * @return path's current RTO in msecs
186 | */
187 | unsigned int pm_readRTO(short pathID);
188 |
189 |
190 |
191 | /* pm_readSRTT is called by reliable transfer and sctp-control to adjust T3-timeout and
192 | init-timeout, respectively.
193 | Params: pathID: path-ID
194 | returns: current smoothed round trip time or 0xffffffff on error
195 | */
196 | unsigned int pm_readSRTT(short pathID);
197 |
198 |
199 | unsigned int pm_readRttVar(short pathID);
200 |
201 |
202 | /**
203 | * pm_readState returns the current state of the path.
204 | * @params pathID index of the path that is checked for its state
205 | * @return state value for this path (PM_ACTIVE, PM_INACTIVE, PM_PATH_UNCONFIRMED)
206 | */
207 | short pm_readState(short pathID);
208 |
209 |
210 |
211 | /* pm_readPrimaryPath returns the primary path.
212 | Params: returns primary path, or 0xFFFF as error
213 | */
214 | unsigned short pm_readPrimaryPath(void);
215 |
216 |
217 |
218 | /*------------------- Functions called to create, init and delete pathman-instances --------------*/
219 |
220 | /* pm_setPaths modufies number of paths and sets the primary path.
221 | This is required for association setup, where the local ULP provides
222 | only one path and the peer may provide additional paths.
223 | This function also initializes the path structures and starts the heartbeat timer for each
224 | path. For this reason it is recommended to call this function when communication up is called.
225 | Params: primaryPathID: path-ID
226 | noOfPaths number of paths
227 | */
228 | short pm_setPaths(short noOfPaths, short primaryPathID);
229 |
230 |
231 |
232 | /* pm_newPathman creates a new instance of pathmanagement. There is one pathmanagement instance
233 | par association.
234 | params: numberOfPaths: # of paths of the association.
235 | primaryPath: initial primary path.
236 | */
237 | void *pm_newPathman(short numberOfPaths, short primaryPath, void* sctpInstance);
238 |
239 |
240 |
241 | /* Deletes the instance pointed to by pathmanPtr.
242 | */
243 | void pm_deletePathman(void *pathmanPtr);
244 |
245 |
246 |
247 | #endif
248 |
--------------------------------------------------------------------------------
/sctplib/sctp/recvctrl.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | #ifndef RECVCTRL_H
45 | #define RECVCTRL_H
46 |
47 | #ifdef HAVE_CONFIG_H
48 | #include
49 | #endif
50 |
51 | #include "globals.h"
52 |
53 |
54 |
55 | #define MAX_SACK_SIZE 1200
56 | #define MAX_SACK_ARRAY_SIZE 1000
57 |
58 | void *rxc_new_recvctrl(unsigned int remote_initial_TSN,
59 | unsigned int number_of_destination_addresses,
60 | void* sctpInstance);
61 |
62 | void rxc_delete_recvctrl(void *rxc_instance);
63 |
64 | /**
65 | * For now this function treats only one incoming data chunk
66 | * recvcontrol eventually passes chunk on to stream_engine !
67 | */
68 | int rxc_data_chunk_rx(SCTP_data_chunk * se_chk, unsigned int ad_idx);
69 |
70 | /**
71 | * Function triggered by flowcontrol, tells recvcontrol to create a SACK struct
72 | * and send it to bundling using bu_put_SACK_Chunk() function.
73 | * @param destination_address pointer to address to send sack to (or null for default)
74 | * @param send_at_once, set by timer to send it at once....
75 | * @return boolean to indicate, whether a SACK was generated, and should be sent !
76 | */
77 | boolean rxc_create_sack(unsigned int *destination_address, boolean force_sack);
78 |
79 | /**
80 | * Function triggered by bundling (methinks), in order to signal to
81 | * rx control that all data chunks coming from an address have been processed,
82 | * and a new SACK may be generated
83 | */
84 | void rxc_all_chunks_processed(boolean new_data_received);
85 |
86 | /**
87 | * Function returns the current cumulative TSN, that this association has RECEIVED
88 | */
89 | unsigned int rxc_read_cummulativeTSNacked(void);
90 |
91 | /**
92 | * function to send SACK after ULP has read some data
93 | * this is to send ARWND updates...
94 | */
95 | int rxc_start_sack_timer(unsigned int oldQueueLen);
96 |
97 | /**
98 | * function called by bundling when a SACK is actually sent, to stop
99 | * a possibly running timer
100 | */
101 | void rxc_stop_sack_timer(void);
102 |
103 | boolean rxc_sack_timer_is_running(void);
104 |
105 | void rxc_send_sack_everytime(void);
106 | void rxc_send_sack_every_second_time(void);
107 |
108 |
109 | /**
110 | * returns my actual buffer size (for now a constant)
111 | */
112 | unsigned int rxc_get_local_receiver_window(void);
113 |
114 | int rxc_get_sack_delay(void);
115 | int rxc_set_sack_delay(unsigned int new_delay);
116 |
117 |
118 | /**
119 | * sets my actual buffer size
120 | */
121 | int rxc_set_local_receiver_window(unsigned int new_window);
122 |
123 | void rxc_restart_receivecontrol(unsigned int my_rwnd, unsigned int new_remote_TSN);
124 |
125 | int rxc_process_forward_tsn(void* chunk);
126 |
127 |
128 | #endif
129 |
--------------------------------------------------------------------------------
/sctplib/sctp/reltransfer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | #ifndef RELTRANSFER_H
45 | #define RELTRANSFER_H
46 |
47 | #ifdef HAVE_CONFIG_H
48 | #include
49 | #endif
50 |
51 | #include "globals.h"
52 |
53 |
54 |
55 | void *rtx_new_reltransfer(unsigned int number_of_destination_addresses, unsigned int iTSN);
56 |
57 | void rtx_delete_reltransfer(void *rtx_instance);
58 |
59 |
60 | /**
61 | * this is called by bundling, when a SACK needs to be processed
62 | */
63 | int rtx_process_sack(unsigned int adr_index, void *sack_chunk, unsigned int totalLen);
64 |
65 | /**
66 | * TODO : does nothing right now
67 | * a callback function for initiating retransmission after T3 has elapsed
68 | */
69 | int rtx_timer_cb(TimerID tid, void *data1, void *data2);
70 |
71 | /**
72 | * a function called by WinFlowCtrl, when chunks have been given to the bundling
73 | * instance, but need to be kept in the buffer until acknowledged
74 | * In SDL digram signal is called (RetransChunks)
75 | *
76 | * TODO : - add possibility for more than one data_chunk ????
77 | *
78 | */
79 | int rtx_save_retrans_chunks(void *data_chunk);
80 |
81 | /**
82 | * a function called by FlowCtrl, when chunk has been given to the bundling
83 | * instance, but is already contained in the reliable transfer list.
84 | * some data in that chunks must be updated.
85 | */
86 | int rtx_update_retrans_chunks(void *data_chunk, unsigned int dest);
87 |
88 | /**
89 | * called from flow-control to trigger retransmission of chunks that have previously
90 | * been sent to the address that timed out
91 | */
92 | int rtx_t3_timeout(void *rtx_instance, unsigned int address,
93 | unsigned int mtu, chunk_data ** rtx_chunks);
94 |
95 |
96 |
97 | void chunk_list_debug(short event_log_level, GList * chunk_list);
98 |
99 | /**
100 | * function to return the last a_rwnd value we got from our peer
101 | */
102 | unsigned int rtx_read_remote_receiver_window(void);
103 |
104 | /**
105 | * Function returns the number of chunks that are waiting in the queue to be acked
106 | */
107 | unsigned int rtx_readNumberOfUnackedChunks(void);
108 |
109 | /**
110 | * function to set the a_rwnd value we got from our peer (from INIT/INIT ACK)
111 | */
112 | int rtx_set_remote_receiver_window(unsigned int new_arwnd);
113 |
114 |
115 | /**
116 | * this function returns what we have got as ctsna from the peer
117 | */
118 | unsigned int rtx_readLocalTSNacked(void);
119 |
120 | gboolean rtx_is_lowest_tsn(unsigned int atsn);
121 |
122 | int rtx_enter_fast_recovery(void);
123 |
124 | gboolean rtx_is_in_fast_recovery(void);
125 |
126 | /**
127 | * returns the current number of outstanding bytes queued in the retransmission
128 | * queue
129 | */
130 | int rtx_get_obpa(unsigned int adIndex, unsigned int *totalInFlight);
131 |
132 | /**
133 | * is called, in case we receive a Cookie in the ESTABLISHED state,
134 | * that indicates the peers restart -> we need to restart too
135 | */
136 | void* rtx_restart_reliable_transfer(void* rtx_instance, unsigned int numOfPaths, unsigned int iTSN);
137 |
138 | /**
139 | * function that is called by SCTP-Control, when ULP requests
140 | * shutdown in an established association
141 | */
142 | int rtx_shutdown(void);
143 |
144 |
145 | /**
146 | * function that is called by SCTP-Control, when peer indicates
147 | * shutdown and sends us his last ctsna...this function dequeues
148 | * all chunks, and returns the number of chunks left in the queue
149 | */
150 | unsigned int rtx_rcv_shutdown_ctsna(unsigned int ctsna);
151 |
152 | int rtx_dequeueOldestUnackedChunk(unsigned char *buf, unsigned int *len, unsigned int *tsn,
153 | unsigned short *sID, unsigned short *sSN,unsigned int* pID,
154 | unsigned char* flags, gpointer* ctx);
155 |
156 |
157 |
158 |
159 | #endif
160 |
--------------------------------------------------------------------------------
/sctplib/sctp/streamengine.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | #ifndef STREAMENGINE_H
45 | #define STREAMENGINE_H
46 |
47 |
48 | #include "globals.h" /* boolean, etc */
49 | #include "messages.h"
50 |
51 |
52 |
53 | /**
54 | * return values for se_ulpreceivefrom
55 | */
56 | #define RECEIVE_DATA 0 /* received data ok in streamengine */
57 | #define STREAM_ID_OVERFLOW 1 /* wrong stream Id from ulp */
58 | #define NO_DATA_AVAILABLE 2 /* no datagram in streamengine receive list */
59 |
60 |
61 |
62 | /******************** Function Definitions *****************************************/
63 |
64 |
65 | /* This function is called to instanciate one Stream Engine for an association.
66 | It is called by Message Distribution.
67 | called from MessageDisribution
68 | returns: the pointer to the Stream Engine
69 | */
70 | void* se_new_stream_engine (unsigned int numberReceiveStreams, /* max of streams to receive */
71 | unsigned int numberSendStreams, /* max of streams to send */
72 | gboolean assocSupportsPRSCTP);
73 |
74 | /*
75 | * se_delete_stream_engine: Deletes a stream engine instance
76 | *
77 | * Params: Pointer/handle which was returned by se_new()
78 | * Return value: error value
79 | */
80 | void se_delete_stream_engine(void *instancePtr);
81 |
82 |
83 |
84 | /* returns the number of in- and out-streams */
85 | int se_readNumberOfStreams(unsigned short *inStreams, unsigned short *outStreams);
86 |
87 |
88 |
89 | /**
90 | * This function is called to send a chunk.
91 | * called from MessageDistribution
92 | * @return 0 for success, -1 for error (e.g. data sent in shutdown state etc.)
93 | */
94 | int se_ulpsend(unsigned short streamId,
95 | unsigned char *buffer,
96 | unsigned int byteCount, unsigned int protocolId,
97 | short destAddressIndex, void* context, unsigned int lifetime,
98 | gboolean unorderedDelivery, /* optional (=FALSE if none) */
99 | gboolean dontBundle); /* optional (=null if none) */
100 |
101 |
102 |
103 |
104 |
105 |
106 | /* after all chunks in a SCTP pdu have been given to the
107 | Stream Engine module, we start reassembly and notifications */
108 | int se_doNotifications(void);
109 |
110 |
111 | /* This function is called from ULP to receive a chunk.
112 | */
113 | short se_ulpreceivefrom(unsigned char *buffer, unsigned int *byteCount,
114 | unsigned short streamId, unsigned short* streamSN,
115 | unsigned int * tsn, unsigned int* addressIndex, unsigned int flags);
116 |
117 |
118 | /*
119 | * This function is called from RX_Control to receive a chunk.
120 | */
121 | int se_recvDataChunk(SCTP_data_chunk * dataChunk, unsigned int byteCount, unsigned int address_index);
122 |
123 |
124 | /**
125 | * function to return the number of chunks that can be retrieved
126 | * by the ULP - this function may need to be refined !!!!!!
127 | */
128 | guint32 se_numOfQueuedChunks(void);
129 |
130 | /**
131 | * function to return the number of streams that we may
132 | * send on
133 | */
134 | guint16 se_numOfSendStreams(void);
135 |
136 | /**
137 | * function to return the number of streams that we are allowed to
138 | * receive data on
139 | */
140 | guint16 se_numOfRecvStreams(void);
141 |
142 |
143 | int se_deliver_unreliably(unsigned int up_to_tsn, SCTP_forward_tsn_chunk* chk);
144 |
145 |
146 | int se_getQueuedBytes(void);
147 |
148 |
149 | #endif /* STREAMENGINE_H */
150 |
--------------------------------------------------------------------------------
/sctplib/sctp/timer_list.h:
--------------------------------------------------------------------------------
1 | /*
2 | * --------------------------------------------------------------------------
3 | *
4 | * //===== //===== ===//=== //===// // // //===//
5 | * // // // // // // // // //
6 | * //====// // // //===// // // //===<<
7 | * // // // // // // // //
8 | * ======// //===== // // //===== // //===//
9 | *
10 | * -------------- An SCTP implementation according to RFC 4960 --------------
11 | *
12 | * Copyright (C) 2000 by Siemens AG, Munich, Germany.
13 | * Copyright (C) 2001-2004 Andreas Jungmaier
14 | * Copyright (C) 2004-2019 Thomas Dreibholz
15 | *
16 | * Acknowledgements:
17 | * Realized in co-operation between Siemens AG and the University of
18 | * Duisburg-Essen, Institute for Experimental Mathematics, Computer
19 | * Networking Technology group.
20 | * This work was partially funded by the Bundesministerium fuer Bildung und
21 | * Forschung (BMBF) of the Federal Republic of Germany
22 | * (Förderkennzeichen 01AK045).
23 | * The authors alone are responsible for the contents.
24 | *
25 | * This library is free software: you can redistribute it and/or modify it
26 | * under the terms of the GNU Lesser General Public License as published by
27 | * the Free Software Foundation, either version 2.1 of the License, or
28 | * (at your option) any later version.
29 | *
30 | * This library is distributed in the hope that it will be useful,
31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 | * GNU General Public License for more details.
34 | *
35 | * You should have received a copy of the GNU Lesser General Public License
36 | * along with this program. If not, see .
37 | *
38 | * Contact: sctp-discussion@sctp.de
39 | * thomas.dreibholz@gmail.com
40 | * tuexen@fh-muenster.de
41 | * andreas.jungmaier@web.de
42 | */
43 |
44 | #ifndef TIMER_LIST_H
45 | #define TIMER_LIST_H
46 |
47 | #ifdef HAVE_CONFIG_H
48 | #include
49 | #endif
50 |
51 | #ifdef STDC_HEADERS
52 | #ifdef HAVE_SYS_TIME_H
53 | #include
54 | #ifdef TIME_WITH_SYS_TIME
55 | #include
56 | #endif
57 | #endif
58 |
59 | #ifdef HAVE_UNISTD_H
60 | #include
61 | #endif
62 | #endif
63 |
64 | #ifdef WIN32
65 | #include
66 | #endif
67 |
68 | #if (defined (SOLARIS) || defined (WIN32))
69 | #define timeradd(a, b, result) \
70 | do { \
71 | (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \
72 | (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
73 | if ((result)->tv_usec >= 1000000) \
74 | { \
75 | ++(result)->tv_sec; \
76 | (result)->tv_usec -= 1000000; \
77 | } \
78 | } while (0)
79 |
80 | #define timersub(a, b, result) \
81 | do { \
82 | (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
83 | (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
84 | if ((result)->tv_usec < 0) { \
85 | --(result)->tv_sec; \
86 | (result)->tv_usec += 1000000; \
87 | } \
88 | } while (0)
89 |
90 | #endif
91 |
92 | #include "globals.h"
93 |
94 | /**
95 | * A singly linked list for timer events
96 | */
97 |
98 |
99 |
100 | typedef struct alarm_timer
101 | {
102 | unsigned int timer_id;
103 | int timer_type;
104 | /* the time when it is to go off */
105 | struct timeval action_time;
106 | /* pointer to possible arguments */
107 | void *arg1;
108 | void *arg2;
109 | /* the callback function */
110 | void (*action) (TimerID, void *, void *);
111 | /* arranged in a sorted, linked list */
112 | }
113 | AlarmTimer;
114 | /**
115 | * function to initialize a list. Creates a timer_list structure
116 | * @param new_list pointer to newly alloc'ed list structure
117 | * @return 0 success, -1 for out of memory.
118 | */
119 | void init_timer_list(void);
120 |
121 | /**
122 | * function to delete a list. Walks through the list and deallocates
123 | * all timer_item structs. Finally destroys the timer_list struct
124 | * @param del_list pointer to the timer_list struct to be deleted
125 | * @return 0 on success, -1 if pointer was NULL or other error
126 | */
127 | void del_timer_list(void);
128 |
129 |
130 | /**
131 | * this function inserts a timer_item into the list. Keeps it ordered,
132 | * and updates length, and possibly one timeval entry. Checks whether
133 | * we insert at beginning/end first. timer_item must have been alloc'ed
134 | * first by the application, this is not done by this function !
135 | * @param tlist pointer to the timer_list instance
136 | * @param item pointer to the event item that is to be added
137 | * @return timer id on success, 0 if a pointer was NULL or other error
138 | */
139 | unsigned int insert_item(AlarmTimer * item);
140 |
141 | /**
142 | * a function to remove a certain action item, first checks current_item,
143 | * then traverses the list from the start, updates length etc.
144 | * @param tlist pointer to the timer_list instance
145 | * @param timer_id id of the timer to be removed
146 | * @param item pointer to where deleted data is to be copied !
147 | * @return 0 on success, -1 if a pointer was NULL or other error, 1 if not found
148 | */
149 | int remove_item(unsigned int id);
150 |
151 | /**
152 | * same function, but remove timer by its pointer to the AlarmTimer
153 | * data structure. This is easier on the list
154 | */
155 | int remove_timer(AlarmTimer* item);
156 |
157 | /**
158 | * function to be called, when a timer is reset. Basically calls get_item(),
159 | * saves the function pointer, updates the execution time (msecs milliseconds
160 | * from now) and removes the item from the list. Then calls insert_item
161 | * with the updated timer_item struct.
162 | * @param tlist pointer to the timer_list instance
163 | * @param timer_id id of the timer to be updated
164 | * @param msecs action to be executed msecs ms from _now_
165 | * @return timer id
166 | */
167 | unsigned int update_item(unsigned int id, unsigned int msecs);
168 | unsigned int micro_update_item(unsigned int id, unsigned int seconds, unsigned int microseconds);
169 |
170 | /*
171 | * function prototype from function in adaptation.h/.c
172 | * @return milliseconds up to the expiry of the next timer
173 | */
174 | int get_msecs_to_nexttimer(void);
175 |
176 |
177 | void adl_add_msecs_totime(struct timeval *t, unsigned int msecs);
178 |
179 | void print_debug_list(short event_log_level);
180 |
181 | /**
182 | * @return 1 (true) if list empty, 0 if list not empty
183 | */
184 | int timer_list_empty(void);
185 |
186 | /**
187 | * copies first event to where the pointer dest points to
188 | */
189 | int get_next_event(AlarmTimer ** dest);
190 |
191 | #endif
192 |
--------------------------------------------------------------------------------
/website.config:
--------------------------------------------------------------------------------
1 | WEBSITE_DIRECTORY=~/public_html/sctplib
2 | WEBSITE_PAGE=index.html
3 |
--------------------------------------------------------------------------------
/win32-setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Win32 sctplib script
4 | # Copyright (C) 2003-2008 by Michael Tuexen
5 | #
6 | # This program is free software: you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation, either version 3 of the License, or
9 | # (at your option) any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | # GNU General Public License for more details.
15 | #
16 | # You should have received a copy of the GNU General Public License
17 | # along with this program. If not, see .
18 | #
19 | # Contact: discussion@sctp.de
20 | # thomas.dreibholz@gmail.com
21 | # tuexen@fh-muenster.de
22 |
23 | DOWNLOAD_PREFIX="http://anonsvn.wireshark.org/wireshark-win32-libs/tags/2007-11-20/packages"
24 |
25 | err_exit () {
26 | echo "ERROR: $1"
27 | echo ""
28 | exit 1
29 | }
30 |
31 | usage () {
32 | echo "Usage:"
33 | echo " $0 --appverify [] ..."
34 | echo " $0 --download "
35 | echo ""
36 | exit 1
37 | }
38 |
39 |
40 | case "$1" in
41 | --appverify)
42 | shift
43 | if [ -z "$*" ] ; then
44 | usage
45 | fi
46 | echo "Checking for required applications:"
47 | for APP in $* ; do
48 | APP_PATH=`cygpath --unix $APP`
49 | if [ -x "$APP_PATH" -a ! -d "$APP_PATH" ] ; then
50 | APP_LOC="$APP_PATH"
51 | else
52 | APP_LOC=`which $APP_PATH 2> /dev/null`
53 | fi
54 | if [ "$APP_LOC" = "" ] ; then
55 | err_exit "Can't find $APP"
56 | fi
57 | echo " $APP: $APP_LOC $res"
58 | done
59 | ;;
60 | --download)
61 | if [ -z "$2" -o -z "$3" -o -z "$4" ] ; then
62 | usage
63 | fi
64 | DEST_PATH=`cygpath --unix "$2"`
65 | DEST_SUBDIR=$3
66 | PACKAGE_PATH=$4
67 | PACKAGE=`basename "$PACKAGE_PATH"`
68 | if [ -z "$http_proxy" -a -z "$HTTP_PROXY" ] ; then
69 | echo "No HTTP proxy specified (http_proxy and HTTP_PROXY are empty)."
70 | use_proxy="-Y off"
71 | else
72 | use_proxy="-Y on"
73 | if [ -z "$http_proxy" ] ; then
74 | echo "HTTP proxy ($HTTP_PROXY) has been specified and will be used."
75 | else
76 | echo "HTTP proxy ($http_proxy) has been specified and will be used."
77 | fi
78 | fi
79 | echo "Downloading $4 into $DEST_PATH, installing into $3"
80 | if [ ! -d "$DEST_PATH/$DEST_SUBDIR" ] ; then
81 | mkdir -p "$DEST_PATH/$DEST_SUBDIR" || \
82 | err_exit "Can't create $DEST_PATH/$DEST_SUBDIR"
83 | fi
84 | cd "$DEST_PATH" || err_exit "Can't find $DEST_PATH"
85 | wget $use_proxy -nc "$DOWNLOAD_PREFIX/$PACKAGE_PATH" || \
86 | err_exit "Can't download $DOWNLOAD_PREFIX/$PACKAGE_PATH"
87 | cd $DEST_SUBDIR
88 | echo "Extracting $DEST_PATH/$PACKAGE into $DEST_PATH/$DEST_SUBDIR"
89 | unzip -nq "$DEST_PATH/$PACKAGE" ||
90 | err_exit "Couldn't unpack $DEST_PATH/$PACKAGE"
91 | echo "Verifying that the DLLs in $DEST_PATH/$DEST_SUBDIR are executable."
92 | for i in `find $DEST_PATH/$DEST_SUBDIR -name \*\.dll` ; do
93 | if [ ! -x "$i" ] ; then
94 | echo "Changing file permissions (add executable bit) to:"
95 | echo "$i"
96 | chmod a+x "$i"
97 | fi
98 | done
99 | ;;
100 | *)
101 | usage
102 | ;;
103 | esac
104 |
105 | exit 0
106 |
--------------------------------------------------------------------------------