Skip to content

Commit

Permalink
Manual: Update usrsctp_init() documentation
Browse files Browse the repository at this point in the history
The documentation for usrsctp_init() is not up to date anymore. It
mentions the UDP-Encapsulation port as the only parameter. By now there
are three parameters.

Commit b724b61 ("Add support for registering a printf() callback for
debug output. This is required by Firefox.") was the last to extend the
API. It seems a simulatenous update to the documentation had been
forgotten.

Introduce the new API to the documentation.

Signed-off-by: Philipp Stanner <[email protected]>
  • Loading branch information
dasteihn committed Aug 3, 2024
1 parent 1330843 commit 4c9e66e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ All system calls start with the prefix `usrsctp_` to distinguish them from the k
Every application has to start with `usrsctp_init()`. This function calls `sctp_init()` and reserves the memory necessary to administer the data transfer. The function prototype is

```c
void usrsctp_init(uint16_t udp_port)
void usrsctp_init(uint16_t udp_port,
int (*conn_output)(void *addr, void *buffer,
size_t length, uint8_t tos, uint8_t set_df),
void (*debug_printf)(const char *format, ...))
```
As it is not always possible to send data directly over SCTP because not all NAT boxes can process SCTP packets, the data can be sent over UDP. To encapsulate SCTP into UDP a UDP port has to be specified, to which the datagrams can be sent. This local UDP port is set with the parameter `udp_port`. The default value is 9899, the standard UDP encapsulation port. If UDP encapsulation is not necessary, the UDP port has to be set to 0.
Expand Down
5 changes: 4 additions & 1 deletion Manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,10 @@ \subsubsection{usrsctp\_init()}
The function prototype is
\begin{verbatim}
void
usrsctp_init(uint16_t udp_port)
usrsctp_init(uint16_t udp_port,
int (*conn_output)(void *addr, void *buffer,
size_t length, uint8_t tos, uint8_t set_df),
void (*debug_printf)(const char *format, ...))
\end{verbatim}
As it is not always possible to send data directly over SCTP because not all NAT boxes can
process SCTP packets, the data can be sent over UDP. To encapsulate SCTP into UDP
Expand Down

0 comments on commit 4c9e66e

Please sign in to comment.