diff options
| author | Linus Torvalds <torvalds@home.osdl.org> | 2004-01-19 07:39:54 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2004-01-19 07:39:54 -0800 |
| commit | 3940ed85276e69985e25ad687cc7dcb952e5d8a5 (patch) | |
| tree | 8273ec807ddcdde1811a820c1e1d405489197117 /include | |
| parent | 4d53a003f12e93c181dff573ea866a912e758b7c (diff) | |
| parent | 4705cae7950a8eec85a9370ef42a1037212e9069 (diff) | |
Merge bk://kernel.bkbits.net/davem/net-2.6
into home.osdl.org:/home/torvalds/v2.5/linux
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/sctp.h | 3 | ||||
| -rw-r--r-- | include/linux/sysctl.h | 3 | ||||
| -rw-r--r-- | include/net/neighbour.h | 2 | ||||
| -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 |
7 files changed, 42 insertions, 14 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..0d5b121f54a0 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 */ @@ -737,6 +738,8 @@ extern int proc_dointvec_minmax(ctl_table *, int, struct file *, void __user *, size_t *); extern int proc_dointvec_jiffies(ctl_table *, int, struct file *, void __user *, size_t *); +extern int proc_dointvec_userhz_jiffies(ctl_table *, int, struct file *, + void __user *, size_t *); extern int proc_doulongvec_minmax(ctl_table *, int, struct file *, void __user *, size_t *); extern int proc_doulongvec_ms_jiffies_minmax(ctl_table *table, int, diff --git a/include/net/neighbour.h b/include/net/neighbour.h index e016389694a8..857f03acaffd 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h @@ -47,9 +47,7 @@ #include <linux/skbuff.h> #include <linux/err.h> -#ifdef CONFIG_SYSCTL #include <linux/sysctl.h> -#endif #define NUD_IN_TIMER (NUD_INCOMPLETE|NUD_DELAY|NUD_PROBE) #define NUD_VALID (NUD_PERMANENT|NUD_NOARP|NUD_REACHABLE|NUD_PROBE|NUD_STALE|NUD_DELAY) 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); |
