fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / net / sctp / constants.h
index c611176..5ddb855 100644 (file)
 #ifndef __sctp_constants_h__
 #define __sctp_constants_h__
 
-#include <linux/tcp.h>  /* For TCP states used in sctp_sock_state_t */
 #include <linux/sctp.h>
 #include <linux/ipv6.h> /* For ipv6hdr. */
 #include <net/sctp/user.h>
+#include <net/tcp_states.h>  /* For TCP states used in sctp_sock_state_t */
 
 /* Value used for stream negotiation. */
 enum { SCTP_MAX_STREAM = 0xffff };
@@ -105,9 +105,10 @@ typedef enum {
 
 typedef enum {
        SCTP_EVENT_NO_PENDING_TSN = 0,
+       SCTP_EVENT_ICMP_PROTO_UNREACH,
 } sctp_event_other_t;
 
-#define SCTP_EVENT_OTHER_MAX           SCTP_EVENT_NO_PENDING_TSN
+#define SCTP_EVENT_OTHER_MAX           SCTP_EVENT_ICMP_PROTO_UNREACH
 #define SCTP_NUM_OTHER_TYPES           (SCTP_EVENT_OTHER_MAX + 1)
 
 /* These are primitive requests from the ULP.  */
@@ -155,10 +156,6 @@ SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE,        sctp_event_primitive_t, primitive)
                                - (unsigned long)(c->chunk_hdr)\
                                - sizeof(sctp_data_chunk_t)))
 
-/* This is a table of printable names of sctp_param_t's.  */
-extern const char *sctp_param_tbl[];
-
-
 #define SCTP_MAX_ERROR_CAUSE  SCTP_ERROR_NONEXIST_IP
 #define SCTP_NUM_ERROR_CAUSE  10
 
@@ -175,6 +172,11 @@ typedef enum {
        SCTP_IERROR_BAD_TAG,
        SCTP_IERROR_BIG_GAP,
        SCTP_IERROR_DUP_TSN,
+       SCTP_IERROR_HIGH_TSN,
+       SCTP_IERROR_IGNORE_TSN,
+       SCTP_IERROR_NO_DATA,
+       SCTP_IERROR_BAD_STREAM,
+       SCTP_IERROR_BAD_PORTS,
 
 } sctp_ierror_t;
 
@@ -261,30 +263,11 @@ enum { SCTP_MIN_PMTU = 576 };
 enum { SCTP_MAX_DUP_TSNS = 16 };
 enum { SCTP_MAX_GABS = 16 };
 
-typedef enum {
-       SCTP_COUNTER_INIT_ERROR,
-} sctp_counter_t;
-
-/* How many counters does an association need? */
-#define SCTP_NUMBER_COUNTERS   5
-
-/* Here we define the default timers.  */
-
-/* cookie timer def = ? seconds */
-#define SCTP_DEFAULT_TIMEOUT_T1_COOKIE (3 * HZ)
-
-/* init timer def = 3 seconds  */
-#define SCTP_DEFAULT_TIMEOUT_T1_INIT   (3 * HZ)
-
-/* shutdown timer def = 300 ms */
-#define SCTP_DEFAULT_TIMEOUT_T2_SHUTDOWN ((300 * HZ) / 1000)
-
-/* 0 seconds + RTO */
-#define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (10 * HZ)
+/* Heartbeat interval - 30 secs */
+#define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (30*1000)
 
-/* recv timer def = 200ms (in usec) */
-#define SCTP_DEFAULT_TIMEOUT_SACK      ((200 * HZ) / 1000)
-#define SCTP_DEFAULT_TIMEOUT_SACK_MAX  ((500 * HZ) / 1000) /* 500 ms */
+/* Delayed sack timer - 200ms */
+#define SCTP_DEFAULT_TIMEOUT_SACK      (200)
 
 /* RTO.Initial              - 3  seconds
  * RTO.Min                  - 1  second
@@ -292,9 +275,9 @@ typedef enum {
  * RTO.Alpha                - 1/8
  * RTO.Beta                 - 1/4
  */
-#define SCTP_RTO_INITIAL       (3 * HZ)
-#define SCTP_RTO_MIN           (1 * HZ)
-#define SCTP_RTO_MAX           (60 * HZ)
+#define SCTP_RTO_INITIAL       (3 * 1000)
+#define SCTP_RTO_MIN           (1 * 1000)
+#define SCTP_RTO_MAX           (60 * 1000)
 
 #define SCTP_RTO_ALPHA          3   /* 1/8 when converted to right shifts. */
 #define SCTP_RTO_BETA           2   /* 1/4 when converted to right shifts. */
@@ -307,8 +290,7 @@ typedef enum {
 #define SCTP_DEF_MAX_INIT 6
 #define SCTP_DEF_MAX_SEND 10
 
-#define SCTP_DEFAULT_COOKIE_LIFE_SEC   60 /* seconds */
-#define SCTP_DEFAULT_COOKIE_LIFE_USEC  0  /* microseconds */
+#define SCTP_DEFAULT_COOKIE_LIFE       (60 * 1000) /* 60 seconds */
 
 #define SCTP_DEFAULT_MINWINDOW 1500    /* default minimum rwnd size */
 #define SCTP_DEFAULT_MAXWINDOW 65535   /* default rwnd size */
@@ -329,9 +311,9 @@ typedef enum {
                                 */
 
 #if defined (CONFIG_SCTP_HMAC_MD5)
-#define SCTP_COOKIE_HMAC_ALG "md5"
+#define SCTP_COOKIE_HMAC_ALG "hmac(md5)"
 #elif defined (CONFIG_SCTP_HMAC_SHA1)
-#define SCTP_COOKIE_HMAC_ALG "sha1"
+#define SCTP_COOKIE_HMAC_ALG "hmac(sha1)"
 #else
 #define SCTP_COOKIE_HMAC_ALG NULL
 #endif
@@ -374,7 +356,7 @@ typedef enum {
  * addresses.
  */
 #define IS_IPV4_UNUSABLE_ADDRESS(a) \
-       ((INADDR_BROADCAST == *a) || \
+       ((htonl(INADDR_BROADCAST) == *a) || \
        (MULTICAST(*a)) || \
        (((unsigned char *)(a))[0] == 0) || \
        ((((unsigned char *)(a))[0] == 198) && \