summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.ninka.net>2003-10-02 12:48:58 -0700
committerDavid S. Miller <davem@nuts.ninka.net>2003-10-02 12:48:58 -0700
commit67e6a91ee3704db49c3c973d67c7cd8ef11ff6d8 (patch)
treeffc126531c0b727f371a556f8c95fcdb340fc3bc /include
parent773bc0e3a00ab16f9e40ef73aa3c641d9ec7f9fc (diff)
parent0b49f36e7c57b37faa042bdf9dc8dd405b5996ba (diff)
Merge http://linux-lksctp.bkbits.net/lksctp-2.5
into nuts.ninka.net:/disk1/davem/BK/net-2.5
Diffstat (limited to 'include')
-rw-r--r--include/linux/sctp.h109
-rw-r--r--include/net/sctp/command.h6
-rw-r--r--include/net/sctp/sctp.h32
-rw-r--r--include/net/sctp/sm.h12
-rw-r--r--include/net/sctp/structs.h8
5 files changed, 37 insertions, 130 deletions
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 6131e3c9aa45..a022f9f629f6 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -524,113 +524,4 @@ typedef struct sctp_addip_chunk {
sctp_addiphdr_t addip_hdr;
} sctp_addip_chunk_t __attribute__((packed));
-/* FIXME: Cleanup needs to continue below this line. */
-
-
-/* ADDIP Section 3.1.1
- *
- * ASCONF-Request Correlation ID: 32 bits (unsigned integer)
- *
- * This is an opaque integer assigned by the sender to identify each
- * request parameter. It is in host byte order and is only meaningful
- * to the sender. The receiver of the ASCONF Chunk will copy this 32
- * bit value into the ASCONF Correlation ID field of the
- * ASCONF-ACK. The sender of the ASCONF can use this same value in the
- * ASCONF-ACK to find which request the response is for.
- *
- * ASCONF Parameter: TLV format
- *
- * Each Address configuration change is represented by a TLV parameter
- * as defined in Section 3.2. One or more requests may be present in
- * an ASCONF Chunk.
- */
-typedef struct {
- __u32 correlation;
- sctp_paramhdr_t p;
- __u8 payload[0];
-} sctpAsconfReq_t;
-
-/* ADDIP
- * 3.1.1 Address/Stream Configuration Change Chunk (ASCONF)
- *
- * This chunk is used to communicate to the remote endpoint one of the
- * configuration change requests that MUST be acknowledged. The
- * information carried in the ASCONF Chunk uses the form of a
- * Tag-Length-Value (TLV), as described in "3.2.1
- * Optional/Variable-length Parameter Format" in [RFC2960], for all
- * variable parameters.
- */
-typedef struct {
- __u32 serial;
- __u8 reserved[3];
- __u8 addr_type;
- __u32 addr[4];
- sctpAsconfReq_t requests[0];
-} sctpAsconf_t;
-
-/* ADDIP
- * 3.1.2 Address/Stream Configuration Acknowledgment Chunk (ASCONF-ACK)
- *
- * ASCONF-Request Correlation ID: 32 bits (unsigned integer)
- *
- * This value is copied from the ASCONF Correlation ID received in the
- * ASCONF Chunk. It is used by the receiver of the ASCONF-ACK to identify
- * which ASCONF parameter this response is associated with.
- *
- * ASCONF Parameter Response : TLV format
- *
- * The ASCONF Parameter Response is used in the ASCONF-ACK to report
- * status of ASCONF processing. By default, if a responding endpoint
- * does not include any Error Cause, a success is indicated. Thus a
- * sender of an ASCONF-ACK MAY indicate complete success of all TLVs in
- * an ASCONF by returning only the Chunk Type, Chunk Flags, Chunk Length
- * (set to 8) and the Serial Number.
- */
-typedef union {
- struct {
- __u32 correlation;
- sctp_paramhdr_t header; /* success report */
- } success;
- struct {
- __u32 correlation;
- sctp_paramhdr_t header; /* error cause indication */
- sctp_paramhdr_t errcause;
- uint8_t request[0]; /* original request from ASCONF */
- } error;
-#define __correlation success.correlation
-#define __header success.header
-#define __cause error.errcause
-#define __request error.request
-} sctpAsconfAckRsp_t;
-
-/* ADDIP
- * 3.1.2 Address/Stream Configuration Acknowledgment Chunk (ASCONF-ACK)
- *
- * This chunk is used by the receiver of an ASCONF Chunk to
- * acknowledge the reception. It carries zero or more results for any
- * ASCONF Parameters that were processed by the receiver.
- */
-typedef struct {
- __u32 serial;
- sctpAsconfAckRsp_t responses[0];
-} sctpAsconfAck_t;
-
-/*********************************************************************
- * Internal structures
- *
- * These are data structures which never go out on the wire.
- *********************************************************************/
-
-/* What is this data structure for? The TLV isn't one--it is just a
- * value. Perhaps this data structure ought to have a type--otherwise
- * it is not unambigiously parseable. --piggy
- */
-typedef struct {
- struct list_head hook;
- int length; /* length of the TLV */
-
- /* the actually TLV to be copied into ASCONF_ACK */
- sctpAsconfAckRsp_t TLV;
-} sctpAsconfAckRspNode_t;
-
#endif /* __LINUX_SCTP_H__ */
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 420f9cf919a6..941f935b012b 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -1,5 +1,6 @@
-/* SCTP kernel reference Implementation Copyright (C) 1999-2001
- * Cisco, Motorola, and IBM
+/* SCTP kernel reference Implementation
+ * (C) Copyright IBM Corp. 2001, 2003
+ * Copyright (C) 1999-2001 Cisco, Motorola
*
* This file is part of the SCTP kernel reference Implementation
*
@@ -88,6 +89,7 @@ typedef enum {
SCTP_CMD_PART_DELIVER, /* Partial data delivery considerations. */
SCTP_CMD_RENEGE, /* Renege data on an association. */
SCTP_CMD_SETUP_T4, /* ADDIP, setup T4 RTO timer parms. */
+ SCTP_CMD_PROCESS_OPERR, /* Process an ERROR chunk. */
SCTP_CMD_LAST
} sctp_verb_t;
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 3f21f1985699..bf33562cd101 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -116,6 +116,9 @@
#define SCTP_STATIC static
#endif
+#define MSECS_TO_JIFFIES(msec) (msec * HZ / 1000)
+#define JIFFIES_TO_MSECS(jiff) (jiff * 1000 / HZ)
+
/*
* Function declarations.
*/
@@ -495,22 +498,19 @@ for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \
#define tv_lt(s, t) \
(s.tv_sec < t.tv_sec || (s.tv_sec == t.tv_sec && s.tv_usec < t.tv_usec))
-/* Stolen from net/profile.h. Using it from there is more grief than
- * it is worth.
- */
-static inline void tv_add(const struct timeval *entered, struct timeval *leaved)
-{
- time_t usecs = leaved->tv_usec + entered->tv_usec;
- time_t secs = leaved->tv_sec + entered->tv_sec;
-
- if (usecs >= 1000000) {
- usecs -= 1000000;
- secs++;
- }
- leaved->tv_sec = secs;
- leaved->tv_usec = usecs;
-}
-
+/* Add tv1 to tv2. */
+#define TIMEVAL_ADD(tv1, tv2) \
+({ \
+ suseconds_t usecs = (tv2).tv_usec + (tv1).tv_usec; \
+ time_t secs = (tv2).tv_sec + (tv1).tv_sec; \
+\
+ if (usecs >= 1000000) { \
+ usecs -= 1000000; \
+ secs++; \
+ } \
+ (tv2).tv_sec = secs; \
+ (tv2).tv_usec = usecs; \
+})
/* External references. */
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 3eb9c18df0c5..2b62b1afef2a 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -265,13 +265,19 @@ struct sctp_chunk *sctp_make_op_error(const struct sctp_association *,
struct sctp_chunk *sctp_make_asconf(struct sctp_association *asoc,
union sctp_addr *addr,
int vparam_len);
+struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *,
+ union sctp_addr *,
+ struct sockaddr *,
+ int, int);
+struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc,
+ union sctp_addr *addr);
+struct sctp_chunk *sctp_make_asconf_ack(struct sctp_association *asoc,
+ int serial, int vparam_len);
+
struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
struct sctp_chunk *asconf,
int vparam_len);
-struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc,
- union sctp_addr *addr);
-
void sctp_chunk_assign_tsn(struct sctp_chunk *);
void sctp_chunk_assign_ssn(struct sctp_chunk *);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 7ba32701be00..bf2745654d7a 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1085,6 +1085,10 @@ int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *);
int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *,
struct sctp_opt *);
+union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
+ const union sctp_addr *addrs,
+ int addrcnt,
+ struct sctp_opt *opt);
union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp,
int *addrs_len, int gfp);
int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len,
@@ -1389,6 +1393,10 @@ struct sctp_association {
__u8 ipv4_address; /* Peer understands IPv4 addresses? */
__u8 ipv6_address; /* Peer understands IPv6 addresses? */
__u8 hostname_address;/* Peer understands DNS addresses? */
+
+ /* Does peer support ADDIP? */
+ __u8 asconf_capable;
+
struct sctp_inithdr i;
int cookie_len;
void *cookie;