^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef __NETNS_SCTP_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define __NETNS_SCTP_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) struct sock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) struct proc_dir_entry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) struct sctp_mib;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) struct ctl_table_header;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) struct netns_sctp {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) DEFINE_SNMP_STAT(struct sctp_mib, sctp_statistics);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #ifdef CONFIG_PROC_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) struct proc_dir_entry *proc_net_sctp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #ifdef CONFIG_SYSCTL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct ctl_table_header *sysctl_header;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) /* This is the global socket data structure used for responding to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * the Out-of-the-blue (OOTB) packets. A control sock will be created
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * for this socket at the initialization time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct sock *ctl_sock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) /* This is the global local address list.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * We actively maintain this complete list of addresses on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * the system by catching address add/delete events.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * It is a list of sctp_sockaddr_entry.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct list_head local_addr_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct list_head addr_waitq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct timer_list addr_wq_timer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct list_head auto_asconf_splist;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) /* Lock that protects both addr_waitq and auto_asconf_splist */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) spinlock_t addr_wq_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) /* Lock that protects the local_addr_list writers */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) spinlock_t local_addr_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) /* RFC2960 Section 14. Suggested SCTP Protocol Parameter Values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * The following protocol parameters are RECOMMENDED:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * RTO.Initial - 3 seconds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * RTO.Min - 1 second
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) * RTO.Max - 60 seconds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * RTO.Alpha - 1/8 (3 when converted to right shifts.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * RTO.Beta - 1/4 (2 when converted to right shifts.)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) unsigned int rto_initial;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) unsigned int rto_min;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) unsigned int rto_max;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) /* Note: rto_alpha and rto_beta are really defined as inverse
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * powers of two to facilitate integer operations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) int rto_alpha;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) int rto_beta;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) /* Max.Burst - 4 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) int max_burst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) /* Whether Cookie Preservative is enabled(1) or not(0) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) int cookie_preserve_enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) /* The namespace default hmac alg */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) char *sctp_hmac_alg;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) /* Valid.Cookie.Life - 60 seconds */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) unsigned int valid_cookie_life;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) /* Delayed SACK timeout 200ms default*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) unsigned int sack_timeout;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) /* HB.interval - 30 seconds */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) unsigned int hb_interval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) /* Association.Max.Retrans - 10 attempts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) * Path.Max.Retrans - 5 attempts (per destination address)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) * Max.Init.Retransmits - 8 attempts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) int max_retrans_association;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) int max_retrans_path;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) int max_retrans_init;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) /* Potentially-Failed.Max.Retrans sysctl value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) * taken from:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) * http://tools.ietf.org/html/draft-nishida-tsvwg-sctp-failover-05
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) int pf_retrans;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) /* Primary.Switchover.Max.Retrans sysctl value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) * taken from:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) * https://tools.ietf.org/html/rfc7829
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) int ps_retrans;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) * Disable Potentially-Failed feature, the feature is enabled by default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) * pf_enable - 0 : disable pf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) * - >0 : enable pf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) int pf_enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) * Disable Potentially-Failed state exposure, ignored by default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) * pf_expose - 0 : compatible with old applications (by default)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) * - 1 : disable pf state exposure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) * - 2 : enable pf state exposure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) int pf_expose;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) * Policy for preforming sctp/socket accounting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) * 0 - do socket level accounting, all assocs share sk_sndbuf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) * 1 - do sctp accounting, each asoc may use sk_sndbuf bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) int sndbuf_policy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) * Policy for preforming sctp/socket accounting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) * 0 - do socket level accounting, all assocs share sk_rcvbuf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) * 1 - do sctp accounting, each asoc may use sk_rcvbuf bytes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) int rcvbuf_policy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) int default_auto_asconf;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) /* Flag to indicate if addip is enabled. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) int addip_enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) int addip_noauth;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) /* Flag to indicate if PR-SCTP is enabled. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) int prsctp_enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) /* Flag to indicate if PR-CONFIG is enabled. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) int reconf_enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) /* Flag to indicate if SCTP-AUTH is enabled */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) int auth_enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) /* Flag to indicate if stream interleave is enabled */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) int intl_enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) /* Flag to indicate if ecn is enabled */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) int ecn_enable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) * Policy to control SCTP IPv4 address scoping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) * 0 - Disable IPv4 address scoping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) * 1 - Enable IPv4 address scoping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) * 2 - Selectively allow only IPv4 private addresses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) * 3 - Selectively allow only IPv4 link local address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) int scope_policy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) /* Threshold for rwnd update SACKS. Receive buffer shifted this many
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) * bits is an indicator of when to send and window update SACK.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) int rwnd_upd_shift;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) /* Threshold for autoclose timeout, in seconds. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) unsigned long max_autoclose;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) #endif /* __NETNS_SCTP_H__ */