4
* Copyright (C) 2008 iptelorg GmbH
6
* Permission to use, copy, modify, and distribute this software for any
7
* purpose with or without fee is hereby granted, provided that the above
8
* copyright notice and this permission notice appear in all copies.
10
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24
* 2008-08-07 initial version (andrei)
25
* 2009-05-26 runtime cfg support (andrei)
28
#ifndef _sctp_options_h
29
#define _sctp_options_h
31
#ifndef NO_SCTP_CONN_REUSE
32
/* SCTP connection reuse by default */
33
#define SCTP_CONN_REUSE
36
#define DEFAULT_SCTP_AUTOCLOSE 180 /* seconds */
37
#define DEFAULT_SCTP_SEND_TTL 32000 /* in ms (32s) */
38
#define DEFAULT_SCTP_SEND_RETRIES 0
39
#define MAX_SCTP_SEND_RETRIES 9
42
struct cfg_group_sctp{
45
unsigned int autoclose; /* in seconds */
46
unsigned int send_ttl; /* in milliseconds */
47
unsigned int send_retries;
48
int assoc_tracking; /* track associations */
49
int assoc_reuse; /* reuse the request connection for sending the reply,
50
depends on assoc_tracking */
51
int max_assocs; /* maximum associations, -1 means disabled */
52
unsigned int srto_initial; /** initial retr. timeout */
53
unsigned int srto_max; /** max retr. timeout */
54
unsigned int srto_min; /** min retr. timeout */
55
unsigned int asocmaxrxt; /** max. retr. attempts per association */
56
unsigned int init_max_attempts; /** max., INIT retr. attempts */
57
unsigned int init_max_timeo; /** rto max for INIT */
58
unsigned int hbinterval; /** heartbeat interval in msecs */
59
unsigned int pathmaxrxt; /** max. retr. attempts per path */
60
unsigned int sack_delay; /** msecs after which a delayed SACK is sent */
61
unsigned int sack_freq; /** no. of packets after which a SACK is sent */
62
unsigned int max_burst; /** maximum burst of packets per assoc. */
65
extern struct cfg_group_sctp sctp_default_cfg;
67
/* sctp config handle */
68
extern void* sctp_cfg;
70
void init_sctp_options(void);
71
void sctp_options_check(void);
72
int sctp_register_cfg(void);
73
void sctp_options_get(struct cfg_group_sctp *s);
74
int sctp_get_os_defaults(struct cfg_group_sctp *s);
75
int sctp_get_cfg_from_sock(int s, struct cfg_group_sctp* cfg);
77
#endif /* _sctp_options_h */