]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/net/sctp/constants.h
r8169: remove private net_device_stats structure
[linux-2.6-omap-h63xx.git] / include / net / sctp / constants.h
index 57166bfdf8eb031b0f43a24d44413420ecd433e8..da8354e8e33c5269fa92ab4a1dd4a8f4d4971ad8 100644 (file)
@@ -64,12 +64,18 @@ enum { SCTP_DEFAULT_INSTREAMS = SCTP_MAX_STREAM };
 #define SCTP_CID_MAX                   SCTP_CID_ASCONF_ACK
 
 #define SCTP_NUM_BASE_CHUNK_TYPES      (SCTP_CID_BASE_MAX + 1)
-#define SCTP_NUM_CHUNK_TYPES           (SCTP_NUM_BASE_CHUNKTYPES + 2)
 
 #define SCTP_NUM_ADDIP_CHUNK_TYPES     2
 
 #define SCTP_NUM_PRSCTP_CHUNK_TYPES    1
 
+#define SCTP_NUM_AUTH_CHUNK_TYPES      1
+
+#define SCTP_NUM_CHUNK_TYPES           (SCTP_NUM_BASE_CHUNK_TYPES + \
+                                        SCTP_NUM_ADDIP_CHUNK_TYPES +\
+                                        SCTP_NUM_PRSCTP_CHUNK_TYPES +\
+                                        SCTP_NUM_AUTH_CHUNK_TYPES)
+
 /* These are the different flavours of event.  */
 typedef enum {
 
@@ -177,7 +183,9 @@ typedef enum {
        SCTP_IERROR_NO_DATA,
        SCTP_IERROR_BAD_STREAM,
        SCTP_IERROR_BAD_PORTS,
-
+       SCTP_IERROR_AUTH_BAD_HMAC,
+       SCTP_IERROR_AUTH_BAD_KEYID,
+       SCTP_IERROR_PROTO_VIOLATION,
 } sctp_ierror_t;
 
 
@@ -264,10 +272,10 @@ enum { SCTP_MAX_DUP_TSNS = 16 };
 enum { SCTP_MAX_GABS = 16 };
 
 /* Heartbeat interval - 30 secs */
-#define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (30 * HZ)
+#define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (30*1000)
 
 /* Delayed sack timer - 200ms */
-#define SCTP_DEFAULT_TIMEOUT_SACK      ((200 * HZ) / 1000)
+#define SCTP_DEFAULT_TIMEOUT_SACK      (200)
 
 /* RTO.Initial              - 3  seconds
  * RTO.Min                  - 1  second
@@ -275,23 +283,22 @@ enum { SCTP_MAX_GABS = 16 };
  * 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. */
 
 /* Maximum number of new data packets that can be sent in a burst.  */
-#define SCTP_MAX_BURST         4
+#define SCTP_DEFAULT_MAX_BURST         4
 
 #define SCTP_CLOCK_GRANULARITY 1       /* 1 jiffy */
 
 #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 */
@@ -357,7 +364,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) && \
@@ -410,4 +417,45 @@ typedef enum {
        SCTP_LOWER_CWND_INACTIVE,
 } sctp_lower_cwnd_t;
 
+
+/* SCTP-AUTH Necessary constants */
+
+/* SCTP-AUTH, Section 3.3
+ *
+ *  The following Table 2 shows the currently defined values for HMAC
+ *  identifiers.
+ *
+ *  +-----------------+--------------------------+
+ *  | HMAC Identifier | Message Digest Algorithm |
+ *  +-----------------+--------------------------+
+ *  | 0               | Reserved                 |
+ *  | 1               | SHA-1 defined in [8]     |
+ *  | 2               | Reserved                 |
+ *  | 3               | SHA-256 defined in [8]   |
+ *  +-----------------+--------------------------+
+ */
+enum {
+       SCTP_AUTH_HMAC_ID_RESERVED_0,
+       SCTP_AUTH_HMAC_ID_SHA1,
+       SCTP_AUTH_HMAC_ID_RESERVED_2,
+       SCTP_AUTH_HMAC_ID_SHA256
+};
+
+#define SCTP_AUTH_HMAC_ID_MAX  SCTP_AUTH_HMAC_ID_SHA256
+#define SCTP_AUTH_NUM_HMACS (SCTP_AUTH_HMAC_ID_SHA256 + 1)
+#define SCTP_SHA1_SIG_SIZE 20
+#define SCTP_SHA256_SIG_SIZE 32
+
+/*  SCTP-AUTH, Section 3.2
+ *     The chunk types for INIT, INIT-ACK, SHUTDOWN-COMPLETE and AUTH chunks
+ *     MUST NOT be listed in the CHUNKS parameter
+ */
+#define SCTP_NUM_NOAUTH_CHUNKS 4
+#define SCTP_AUTH_MAX_CHUNKS   (SCTP_NUM_CHUNK_TYPES - SCTP_NUM_NOAUTH_CHUNKS)
+
+/* SCTP-AUTH Section 6.1
+ * The RANDOM parameter MUST contain a 32 byte random number.
+ */
+#define SCTP_AUTH_RANDOM_LENGTH 32
+
 #endif /* __sctp_constants_h__ */