diff options
| author | David S. Miller <davem@nuts.ninka.net> | 2004-01-19 05:05:07 -0800 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2004-01-19 05:05:07 -0800 |
| commit | bd23ad706ee39fc5e8a530380c4ccc2b1a4aba4c (patch) | |
| tree | 036fed42956901b46f094783050f807cdcfdd23d /include | |
| parent | d8baa0e00589d7e03585a8ecad8100f0e8531d25 (diff) | |
| parent | 3ac3019bbcb2ee28490be1513e7db100199edc6e (diff) | |
Merge http://linux-lksctp.bkbits.net/lksctp-2.5.work
into nuts.ninka.net:/disk1/davem/BK/net-2.6
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/sctp.h | 3 | ||||
| -rw-r--r-- | include/linux/sysctl.h | 1 | ||||
| -rw-r--r-- | include/net/sctp/constants.h | 4 | ||||
| -rw-r--r-- | include/net/sctp/sctp.h | 6 | ||||
| -rw-r--r-- | include/net/sctp/sm.h | 27 | ||||
| -rw-r--r-- | include/net/sctp/structs.h | 11 |
6 files changed, 40 insertions, 12 deletions
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index a022f9f629f6..9ddc3bd5cd81 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -439,12 +439,13 @@ typedef enum { * 0x0101 Operation Refused Due to Resource Shortage. * 0x0102 Request to Delete Source IP Address. * 0x0103 Association Aborted due to illegal ASCONF-ACK + * 0x0104 Request refused - no authorization. */ SCTP_ERROR_DEL_LAST_IP = __constant_htons(0x0100), SCTP_ERROR_RSRC_LOW = __constant_htons(0x0101), SCTP_ERROR_DEL_SRC_IP = __constant_htons(0x0102), SCTP_ERROR_ASCONF_ACK = __constant_htons(0x0103), - + SCTP_ERROR_REQ_REFUSED = __constant_htons(0x0104) } sctp_error_t; diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index b8be51acff95..d271fcada7dd 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -580,6 +580,7 @@ enum { NET_SCTP_HB_INTERVAL = 10, NET_SCTP_PRESERVE_ENABLE = 11, NET_SCTP_MAX_BURST = 12, + NET_SCTP_ADDIP_ENABLE = 13, }; /* /proc/sys/net/bridge */ diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 5e17983fffdc..f031313bb3ef 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h @@ -1,8 +1,8 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2003 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 Intel Corp. - * Copyright (c) 2001-2002 International Business Machines Corp. * * This file is part of the SCTP kernel reference Implementation * @@ -75,8 +75,6 @@ enum { SCTP_DEFAULT_INSTREAMS = SCTP_MAX_STREAM }; #define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1) #define SCTP_NUM_CHUNK_TYPES (SCTP_NUM_BASE_CHUNKTYPES + 2) -#define SCTP_CID_ADDIP_MIN SCTP_CID_ASCONF -#define SCTP_CID_ADDIP_MAX SCTP_CID_ASCONF_ACK #define SCTP_NUM_ADDIP_CHUNK_TYPES 2 /* These are the different flavours of event. */ diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 7edb15d6561a..3fa80e611ba1 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h @@ -115,8 +115,10 @@ #define SCTP_STATIC static #endif -#define MSECS_TO_JIFFIES(msec) (msec * HZ / 1000) -#define JIFFIES_TO_MSECS(jiff) (jiff * 1000 / HZ) +#define MSECS_TO_JIFFIES(msec) \ + (((msec / 1000) * HZ) + ((msec % 1000) * HZ) / 1000) +#define JIFFIES_TO_MSECS(jiff) \ + (((jiff / HZ) * 1000) + ((jiff % HZ) * 1000) / HZ) /* * Function declarations. diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 2b62b1afef2a..60dea46dec21 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -268,15 +268,15 @@ struct sctp_chunk *sctp_make_asconf(struct sctp_association *asoc, struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, union sctp_addr *, struct sockaddr *, - int, int); + int, __u16); 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_make_asconf_ack(const struct sctp_association *asoc, + __u32 serial, int vparam_len); struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, - struct sctp_chunk *asconf, - int vparam_len); + struct sctp_chunk *asconf); +int sctp_process_asconf_ack(struct sctp_association *asoc, + struct sctp_chunk *asconf_ack); void sctp_chunk_assign_tsn(struct sctp_chunk *); void sctp_chunk_assign_ssn(struct sctp_chunk *); @@ -431,6 +431,21 @@ static inline int SSN_lte(__u16 s, __u16 t) return (((s) == (t)) || (((s) - (t)) & SSN_SIGN_BIT)); } +/* + * ADDIP 3.1.1 + * The valid range of Serial Number is from 0 to 4294967295 (2**32 - 1). Serial + * Numbers wrap back to 0 after reaching 4294967295. + */ +enum { + ADDIP_SERIAL_SIGN_BIT = (1<<31) +}; + +static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t) +{ + return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT)); +} + + /* Run sctp_add_cmd() generating a BUG() if there is a failure. */ static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_arg_t obj) { diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index bf2745654d7a..92394f3de76a 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -190,6 +190,9 @@ extern struct sctp_globals { */ struct list_head local_addr_list; spinlock_t local_addr_lock; + + /* Flag to indicate if addip is enabled. */ + int addip_enable; } sctp_globals; #define sctp_rto_initial (sctp_globals.rto_initial) @@ -217,6 +220,7 @@ extern struct sctp_globals { #define sctp_port_hashtable (sctp_globals.port_hashtable) #define sctp_local_addr_list (sctp_globals.local_addr_list) #define sctp_local_addr_lock (sctp_globals.local_addr_lock) +#define sctp_addip_enable (sctp_globals.addip_enable) /* SCTP Socket type: UDP or TCP style. */ typedef enum { @@ -1397,6 +1401,11 @@ struct sctp_association { /* Does peer support ADDIP? */ __u8 asconf_capable; + /* This mask is used to disable sending the ASCONF chunk + * with specified parameter to peer. + */ + __u16 addip_disabled_mask; + struct sctp_inithdr i; int cookie_len; void *cookie; @@ -1708,6 +1717,8 @@ int sctp_assoc_lookup_laddr(struct sctp_association *asoc, struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *, const union sctp_addr *address, const int gfp); +void sctp_assoc_del_peer(struct sctp_association *asoc, + const union sctp_addr *addr); void sctp_assoc_control_transport(struct sctp_association *, struct sctp_transport *, sctp_transport_cmd_t, sctp_sn_error_t); |
