2
0

sctp_options.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2008 iptelorg GmbH
  5. *
  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.
  9. *
  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.
  17. */
  18. /*
  19. * sctp options
  20. */
  21. /*
  22. * History:
  23. * --------
  24. * 2008-08-07 initial version (andrei)
  25. * 2009-05-26 runtime cfg support (andrei)
  26. */
  27. #ifndef _sctp_options_h
  28. #define _sctp_options_h
  29. #ifndef NO_SCTP_CONN_REUSE
  30. /* SCTP connection reuse by default */
  31. #define SCTP_CONN_REUSE
  32. #endif
  33. #define DEFAULT_SCTP_AUTOCLOSE 180 /* seconds */
  34. #define DEFAULT_SCTP_SEND_TTL 32000 /* in ms (32s) */
  35. #define DEFAULT_SCTP_SEND_RETRIES 0
  36. #define MAX_SCTP_SEND_RETRIES 9
  37. struct cfg_group_sctp{
  38. int so_rcvbuf;
  39. int so_sndbuf;
  40. unsigned int autoclose; /* in seconds */
  41. unsigned int send_ttl; /* in milliseconds */
  42. unsigned int send_retries;
  43. int assoc_tracking; /* track associations */
  44. int assoc_reuse; /* reuse the request connection for sending the reply,
  45. depends on assoc_tracking */
  46. int max_assocs; /* maximum associations, -1 means disabled */
  47. unsigned int srto_initial; /** initial retr. timeout */
  48. unsigned int srto_max; /** max retr. timeout */
  49. unsigned int srto_min; /** min retr. timeout */
  50. unsigned int asocmaxrxt; /** max. retr. attempts per association */
  51. unsigned int init_max_attempts; /** max., INIT retr. attempts */
  52. unsigned int init_max_timeo; /** rto max for INIT */
  53. unsigned int hbinterval; /** heartbeat interval in msecs */
  54. unsigned int pathmaxrxt; /** max. retr. attempts per path */
  55. unsigned int sack_delay; /** msecs after which a delayed SACK is sent */
  56. unsigned int sack_freq; /** no. of packets after which a SACK is sent */
  57. unsigned int max_burst; /** maximum burst of packets per assoc. */
  58. };
  59. extern struct cfg_group_sctp sctp_default_cfg;
  60. /* sctp config handle */
  61. extern void* sctp_cfg;
  62. void init_sctp_options(void);
  63. void sctp_options_check(void);
  64. int sctp_register_cfg(void);
  65. void sctp_options_get(struct cfg_group_sctp *s);
  66. int sctp_get_os_defaults(struct cfg_group_sctp *s);
  67. int sctp_get_cfg_from_sock(int s, struct cfg_group_sctp* cfg);
  68. #endif /* _sctp_options_h */