diff options
author | Anton Vorontsov <cbouatmailru@gmail.com> | 2008-07-29 18:05:23 -0400 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2008-07-29 18:05:23 -0400 |
commit | 9fec6060d9e48ed7db0dac0e16d0f0f0e615b7f6 (patch) | |
tree | 74b41f31a08f6500ff3dfcf64ba21e2d9a8e87e5 /include/net/sctp | |
parent | fece418418f51e92dd7e67e17c5e3fe5a28d3279 (diff) | |
parent | 6e86841d05f371b5b9b86ce76c02aaee83352298 (diff) |
Merge branch 'master' of /home/cbou/linux-2.6
Conflicts:
drivers/power/Kconfig
drivers/power/Makefile
Diffstat (limited to 'include/net/sctp')
-rw-r--r-- | include/net/sctp/checksum.h | 23 | ||||
-rw-r--r-- | include/net/sctp/sctp.h | 4 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 26 | ||||
-rw-r--r-- | include/net/sctp/user.h | 34 |
4 files changed, 62 insertions, 25 deletions
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h index ba75c67cb992..b799fb21519a 100644 --- a/include/net/sctp/checksum.h +++ b/include/net/sctp/checksum.h | |||
@@ -46,9 +46,14 @@ | |||
46 | #include <net/sctp/sctp.h> | 46 | #include <net/sctp/sctp.h> |
47 | #include <linux/crc32c.h> | 47 | #include <linux/crc32c.h> |
48 | 48 | ||
49 | static inline __u32 sctp_start_cksum(__u8 *buffer, __u16 length) | 49 | static inline __be32 sctp_crc32c(__be32 crc, u8 *buffer, u16 length) |
50 | { | 50 | { |
51 | __u32 crc = ~(__u32) 0; | 51 | return (__force __be32)crc32c((__force u32)crc, buffer, length); |
52 | } | ||
53 | |||
54 | static inline __be32 sctp_start_cksum(__u8 *buffer, __u16 length) | ||
55 | { | ||
56 | __be32 crc = ~cpu_to_be32(0); | ||
52 | __u8 zero[sizeof(__u32)] = {0}; | 57 | __u8 zero[sizeof(__u32)] = {0}; |
53 | 58 | ||
54 | /* Optimize this routine to be SCTP specific, knowing how | 59 | /* Optimize this routine to be SCTP specific, knowing how |
@@ -56,23 +61,23 @@ static inline __u32 sctp_start_cksum(__u8 *buffer, __u16 length) | |||
56 | */ | 61 | */ |
57 | 62 | ||
58 | /* Calculate CRC up to the checksum. */ | 63 | /* Calculate CRC up to the checksum. */ |
59 | crc = crc32c(crc, buffer, sizeof(struct sctphdr) - sizeof(__u32)); | 64 | crc = sctp_crc32c(crc, buffer, sizeof(struct sctphdr) - sizeof(__u32)); |
60 | 65 | ||
61 | /* Skip checksum field of the header. */ | 66 | /* Skip checksum field of the header. */ |
62 | crc = crc32c(crc, zero, sizeof(__u32)); | 67 | crc = sctp_crc32c(crc, zero, sizeof(__u32)); |
63 | 68 | ||
64 | /* Calculate the rest of the CRC. */ | 69 | /* Calculate the rest of the CRC. */ |
65 | crc = crc32c(crc, &buffer[sizeof(struct sctphdr)], | 70 | crc = sctp_crc32c(crc, &buffer[sizeof(struct sctphdr)], |
66 | length - sizeof(struct sctphdr)); | 71 | length - sizeof(struct sctphdr)); |
67 | return crc; | 72 | return crc; |
68 | } | 73 | } |
69 | 74 | ||
70 | static inline __u32 sctp_update_cksum(__u8 *buffer, __u16 length, __u32 crc32) | 75 | static inline __be32 sctp_update_cksum(__u8 *buffer, __u16 length, __be32 crc32) |
71 | { | 76 | { |
72 | return crc32c(crc32, buffer, length); | 77 | return sctp_crc32c(crc32, buffer, length); |
73 | } | 78 | } |
74 | 79 | ||
75 | static inline __u32 sctp_end_cksum(__u32 crc32) | 80 | static inline __be32 sctp_end_cksum(__be32 crc32) |
76 | { | 81 | { |
77 | return ntohl(~crc32); | 82 | return ~crc32; |
78 | } | 83 | } |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 90b1e8d23b16..17b932b8a55a 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -179,6 +179,8 @@ int sctp_eps_proc_init(void); | |||
179 | void sctp_eps_proc_exit(void); | 179 | void sctp_eps_proc_exit(void); |
180 | int sctp_assocs_proc_init(void); | 180 | int sctp_assocs_proc_init(void); |
181 | void sctp_assocs_proc_exit(void); | 181 | void sctp_assocs_proc_exit(void); |
182 | int sctp_remaddr_proc_init(void); | ||
183 | void sctp_remaddr_proc_exit(void); | ||
182 | 184 | ||
183 | 185 | ||
184 | /* | 186 | /* |
@@ -218,8 +220,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly; | |||
218 | #define sctp_release_sock(sk) release_sock(sk) | 220 | #define sctp_release_sock(sk) release_sock(sk) |
219 | #define sctp_bh_lock_sock(sk) bh_lock_sock(sk) | 221 | #define sctp_bh_lock_sock(sk) bh_lock_sock(sk) |
220 | #define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk) | 222 | #define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk) |
221 | #define SCTP_SOCK_SLEEP_PRE(sk) SOCK_SLEEP_PRE(sk) | ||
222 | #define SCTP_SOCK_SLEEP_POST(sk) SOCK_SLEEP_POST(sk) | ||
223 | 223 | ||
224 | /* SCTP SNMP MIB stats handlers */ | 224 | /* SCTP SNMP MIB stats handlers */ |
225 | DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics); | 225 | DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 0ce0443c5b79..535a18f57a13 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -300,6 +300,7 @@ struct sctp_sock { | |||
300 | 300 | ||
301 | /* The default SACK delay timeout for new associations. */ | 301 | /* The default SACK delay timeout for new associations. */ |
302 | __u32 sackdelay; | 302 | __u32 sackdelay; |
303 | __u32 sackfreq; | ||
303 | 304 | ||
304 | /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ | 305 | /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ |
305 | __u32 param_flags; | 306 | __u32 param_flags; |
@@ -548,7 +549,8 @@ struct sctp_af { | |||
548 | struct dst_entry *(*get_dst) (struct sctp_association *asoc, | 549 | struct dst_entry *(*get_dst) (struct sctp_association *asoc, |
549 | union sctp_addr *daddr, | 550 | union sctp_addr *daddr, |
550 | union sctp_addr *saddr); | 551 | union sctp_addr *saddr); |
551 | void (*get_saddr) (struct sctp_association *asoc, | 552 | void (*get_saddr) (struct sctp_sock *sk, |
553 | struct sctp_association *asoc, | ||
552 | struct dst_entry *dst, | 554 | struct dst_entry *dst, |
553 | union sctp_addr *daddr, | 555 | union sctp_addr *daddr, |
554 | union sctp_addr *saddr); | 556 | union sctp_addr *saddr); |
@@ -587,6 +589,7 @@ struct sctp_af { | |||
587 | int (*is_ce) (const struct sk_buff *sk); | 589 | int (*is_ce) (const struct sk_buff *sk); |
588 | void (*seq_dump_addr)(struct seq_file *seq, | 590 | void (*seq_dump_addr)(struct seq_file *seq, |
589 | union sctp_addr *addr); | 591 | union sctp_addr *addr); |
592 | void (*ecn_capable)(struct sock *sk); | ||
590 | __u16 net_header_len; | 593 | __u16 net_header_len; |
591 | int sockaddr_len; | 594 | int sockaddr_len; |
592 | sa_family_t sa_family; | 595 | sa_family_t sa_family; |
@@ -824,7 +827,7 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *, | |||
824 | __u16 sport, __u16 dport); | 827 | __u16 sport, __u16 dport); |
825 | struct sctp_packet *sctp_packet_config(struct sctp_packet *, __u32 vtag, int); | 828 | struct sctp_packet *sctp_packet_config(struct sctp_packet *, __u32 vtag, int); |
826 | sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *, | 829 | sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *, |
827 | struct sctp_chunk *); | 830 | struct sctp_chunk *, int); |
828 | sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *, | 831 | sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *, |
829 | struct sctp_chunk *); | 832 | struct sctp_chunk *); |
830 | int sctp_packet_transmit(struct sctp_packet *); | 833 | int sctp_packet_transmit(struct sctp_packet *); |
@@ -901,7 +904,10 @@ struct sctp_transport { | |||
901 | * calculation completes (i.e. the DATA chunk | 904 | * calculation completes (i.e. the DATA chunk |
902 | * is SACK'd) clear this flag. | 905 | * is SACK'd) clear this flag. |
903 | */ | 906 | */ |
904 | int rto_pending; | 907 | __u8 rto_pending; |
908 | |||
909 | /* Flag to track the current fast recovery state */ | ||
910 | __u8 fast_recovery; | ||
905 | 911 | ||
906 | /* | 912 | /* |
907 | * These are the congestion stats. | 913 | * These are the congestion stats. |
@@ -920,6 +926,9 @@ struct sctp_transport { | |||
920 | /* Data that has been sent, but not acknowledged. */ | 926 | /* Data that has been sent, but not acknowledged. */ |
921 | __u32 flight_size; | 927 | __u32 flight_size; |
922 | 928 | ||
929 | /* TSN marking the fast recovery exit point */ | ||
930 | __u32 fast_recovery_exit; | ||
931 | |||
923 | /* Destination */ | 932 | /* Destination */ |
924 | struct dst_entry *dst; | 933 | struct dst_entry *dst; |
925 | /* Source address. */ | 934 | /* Source address. */ |
@@ -938,6 +947,7 @@ struct sctp_transport { | |||
938 | 947 | ||
939 | /* SACK delay timeout */ | 948 | /* SACK delay timeout */ |
940 | unsigned long sackdelay; | 949 | unsigned long sackdelay; |
950 | __u32 sackfreq; | ||
941 | 951 | ||
942 | /* When was the last time (in jiffies) that we heard from this | 952 | /* When was the last time (in jiffies) that we heard from this |
943 | * transport? We use this to pick new active and retran paths. | 953 | * transport? We use this to pick new active and retran paths. |
@@ -1044,7 +1054,7 @@ void sctp_transport_route(struct sctp_transport *, union sctp_addr *, | |||
1044 | struct sctp_sock *); | 1054 | struct sctp_sock *); |
1045 | void sctp_transport_pmtu(struct sctp_transport *); | 1055 | void sctp_transport_pmtu(struct sctp_transport *); |
1046 | void sctp_transport_free(struct sctp_transport *); | 1056 | void sctp_transport_free(struct sctp_transport *); |
1047 | void sctp_transport_reset_timers(struct sctp_transport *); | 1057 | void sctp_transport_reset_timers(struct sctp_transport *, int); |
1048 | void sctp_transport_hold(struct sctp_transport *); | 1058 | void sctp_transport_hold(struct sctp_transport *); |
1049 | void sctp_transport_put(struct sctp_transport *); | 1059 | void sctp_transport_put(struct sctp_transport *); |
1050 | void sctp_transport_update_rto(struct sctp_transport *, __u32); | 1060 | void sctp_transport_update_rto(struct sctp_transport *, __u32); |
@@ -1134,6 +1144,9 @@ struct sctp_outq { | |||
1134 | /* How many unackd bytes do we have in-flight? */ | 1144 | /* How many unackd bytes do we have in-flight? */ |
1135 | __u32 outstanding_bytes; | 1145 | __u32 outstanding_bytes; |
1136 | 1146 | ||
1147 | /* Are we doing fast-rtx on this queue */ | ||
1148 | char fast_rtx; | ||
1149 | |||
1137 | /* Corked? */ | 1150 | /* Corked? */ |
1138 | char cork; | 1151 | char cork; |
1139 | 1152 | ||
@@ -1148,7 +1161,6 @@ void sctp_outq_init(struct sctp_association *, struct sctp_outq *); | |||
1148 | void sctp_outq_teardown(struct sctp_outq *); | 1161 | void sctp_outq_teardown(struct sctp_outq *); |
1149 | void sctp_outq_free(struct sctp_outq*); | 1162 | void sctp_outq_free(struct sctp_outq*); |
1150 | int sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk); | 1163 | int sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk); |
1151 | int sctp_outq_flush(struct sctp_outq *, int); | ||
1152 | int sctp_outq_sack(struct sctp_outq *, struct sctp_sackhdr *); | 1164 | int sctp_outq_sack(struct sctp_outq *, struct sctp_sackhdr *); |
1153 | int sctp_outq_is_empty(const struct sctp_outq *); | 1165 | int sctp_outq_is_empty(const struct sctp_outq *); |
1154 | void sctp_outq_restart(struct sctp_outq *); | 1166 | void sctp_outq_restart(struct sctp_outq *); |
@@ -1198,6 +1210,8 @@ int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, | |||
1198 | int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); | 1210 | int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); |
1199 | int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, | 1211 | int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, |
1200 | struct sctp_sock *); | 1212 | struct sctp_sock *); |
1213 | int sctp_bind_addr_conflict(struct sctp_bind_addr *, const union sctp_addr *, | ||
1214 | struct sctp_sock *, struct sctp_sock *); | ||
1201 | int sctp_bind_addr_state(const struct sctp_bind_addr *bp, | 1215 | int sctp_bind_addr_state(const struct sctp_bind_addr *bp, |
1202 | const union sctp_addr *addr); | 1216 | const union sctp_addr *addr); |
1203 | union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, | 1217 | union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, |
@@ -1542,6 +1556,7 @@ struct sctp_association { | |||
1542 | * : SACK's are not delayed (see Section 6). | 1556 | * : SACK's are not delayed (see Section 6). |
1543 | */ | 1557 | */ |
1544 | __u8 sack_needed; /* Do we need to sack the peer? */ | 1558 | __u8 sack_needed; /* Do we need to sack the peer? */ |
1559 | __u32 sack_cnt; | ||
1545 | 1560 | ||
1546 | /* These are capabilities which our peer advertised. */ | 1561 | /* These are capabilities which our peer advertised. */ |
1547 | __u8 ecn_capable; /* Can peer do ECN? */ | 1562 | __u8 ecn_capable; /* Can peer do ECN? */ |
@@ -1651,6 +1666,7 @@ struct sctp_association { | |||
1651 | 1666 | ||
1652 | /* SACK delay timeout */ | 1667 | /* SACK delay timeout */ |
1653 | unsigned long sackdelay; | 1668 | unsigned long sackdelay; |
1669 | __u32 sackfreq; | ||
1654 | 1670 | ||
1655 | 1671 | ||
1656 | unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; | 1672 | unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 9619b9d35c9e..f205b10f0ab9 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
@@ -93,8 +93,9 @@ enum sctp_optname { | |||
93 | #define SCTP_STATUS SCTP_STATUS | 93 | #define SCTP_STATUS SCTP_STATUS |
94 | SCTP_GET_PEER_ADDR_INFO, | 94 | SCTP_GET_PEER_ADDR_INFO, |
95 | #define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO | 95 | #define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO |
96 | SCTP_DELAYED_ACK_TIME, | 96 | SCTP_DELAYED_ACK, |
97 | #define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK_TIME | 97 | #define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK |
98 | #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK | ||
98 | SCTP_CONTEXT, /* Receive Context */ | 99 | SCTP_CONTEXT, /* Receive Context */ |
99 | #define SCTP_CONTEXT SCTP_CONTEXT | 100 | #define SCTP_CONTEXT SCTP_CONTEXT |
100 | SCTP_FRAGMENT_INTERLEAVE, | 101 | SCTP_FRAGMENT_INTERLEAVE, |
@@ -136,12 +137,14 @@ enum sctp_optname { | |||
136 | #define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD | 137 | #define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD |
137 | SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */ | 138 | SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */ |
138 | #define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD | 139 | #define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD |
139 | SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */ | 140 | SCTP_SOCKOPT_CONNECTX_OLD, /* CONNECTX old requests. */ |
140 | #define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX | 141 | #define SCTP_SOCKOPT_CONNECTX_OLD SCTP_SOCKOPT_CONNECTX_OLD |
141 | SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */ | 142 | SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */ |
142 | #define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS | 143 | #define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS |
143 | SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */ | 144 | SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */ |
144 | #define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS | 145 | #define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS |
146 | SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */ | ||
147 | #define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX | ||
145 | }; | 148 | }; |
146 | 149 | ||
147 | /* | 150 | /* |
@@ -618,13 +621,26 @@ struct sctp_authkeyid { | |||
618 | }; | 621 | }; |
619 | 622 | ||
620 | 623 | ||
621 | /* 7.1.23. Delayed Ack Timer (SCTP_DELAYED_ACK_TIME) | 624 | /* |
625 | * 7.1.23. Get or set delayed ack timer (SCTP_DELAYED_SACK) | ||
622 | * | 626 | * |
623 | * This options will get or set the delayed ack timer. The time is set | 627 | * This option will effect the way delayed acks are performed. This |
624 | * in milliseconds. If the assoc_id is 0, then this sets or gets the | 628 | * option allows you to get or set the delayed ack time, in |
625 | * endpoints default delayed ack timer value. If the assoc_id field is | 629 | * milliseconds. It also allows changing the delayed ack frequency. |
626 | * non-zero, then the set or get effects the specified association. | 630 | * Changing the frequency to 1 disables the delayed sack algorithm. If |
631 | * the assoc_id is 0, then this sets or gets the endpoints default | ||
632 | * values. If the assoc_id field is non-zero, then the set or get | ||
633 | * effects the specified association for the one to many model (the | ||
634 | * assoc_id field is ignored by the one to one model). Note that if | ||
635 | * sack_delay or sack_freq are 0 when setting this option, then the | ||
636 | * current values will remain unchanged. | ||
627 | */ | 637 | */ |
638 | struct sctp_sack_info { | ||
639 | sctp_assoc_t sack_assoc_id; | ||
640 | uint32_t sack_delay; | ||
641 | uint32_t sack_freq; | ||
642 | }; | ||
643 | |||
628 | struct sctp_assoc_value { | 644 | struct sctp_assoc_value { |
629 | sctp_assoc_t assoc_id; | 645 | sctp_assoc_t assoc_id; |
630 | uint32_t assoc_value; | 646 | uint32_t assoc_value; |