diff options
| author | David S. Miller <davem@nuts.ninka.net> | 2002-10-18 03:53:53 -0700 |
|---|---|---|
| committer | David S. Miller <davem@nuts.ninka.net> | 2002-10-18 03:53:53 -0700 |
| commit | b18b05fbae76387953b2ef19dc7b66e77f503d4e (patch) | |
| tree | ced2f17c6fa8e35e81cbc9c4d7ac9572a36d7deb /include/net | |
| parent | 7e8a48526505354a8d7dccf15f25911859b9c2d0 (diff) | |
| parent | 63592fe58d005fbf377aa197320963fec51b5dc2 (diff) | |
Merge http://linux-lksctp.bkbits.net/lksctp-2.5
into nuts.ninka.net:/home/davem/src/BK/sctp-2.5
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/sctp/sm.h | 37 | ||||
| -rw-r--r-- | include/net/sctp/structs.h | 8 |
2 files changed, 42 insertions, 3 deletions
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 9459322a411b..36ed5af39824 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -139,6 +139,7 @@ sctp_state_fn_t sctp_sf_do_5_2_1_siminit; sctp_state_fn_t sctp_sf_do_5_2_2_dupinit; sctp_state_fn_t sctp_sf_do_5_2_4_dupcook; sctp_state_fn_t sctp_sf_unk_chunk; +sctp_state_fn_t sctp_sf_do_8_5_1_E_sa; /* Prototypes for primitive event state functions. */ sctp_state_fn_t sctp_sf_do_prm_asoc; @@ -329,10 +330,10 @@ __u32 sctp_generate_tag(const sctp_endpoint_t *); __u32 sctp_generate_tsn(const sctp_endpoint_t *); /* 4th level prototypes */ -void sctp_param2sockaddr(sockaddr_storage_t *addr, const sctpParam_t param, +void sctp_param2sockaddr(sockaddr_storage_t *addr, sctp_addr_param_t *, __u16 port); int sctp_addr2sockaddr(const sctpParam_t, sockaddr_storage_t *); -int sockaddr2sctp_addr(const sockaddr_storage_t *, sctpParam_t); +int sockaddr2sctp_addr(const sockaddr_storage_t *, sctp_addr_param_t *); /* Extern declarations for major data structures. */ sctp_sm_table_entry_t *sctp_chunk_event_lookup(sctp_cid_t, sctp_state_t); @@ -432,4 +433,36 @@ static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb, sctp_a BUG(); } +/* Check VTAG of the packet matches the sender's own tag OR its peer's + * tag and the T bit is set in the Chunk Flags. + */ +static inline int +sctp_vtag_verify_either(const sctp_chunk_t *chunk, + const sctp_association_t *asoc) +{ + /* RFC 2960 Section 8.5.1, sctpimpguide-06 Section 2.13.2 + * + * B) The receiver of a ABORT shall accept the packet if the + * Verification Tag field of the packet matches its own tag OR it + * is set to its peer's tag and the T bit is set in the Chunk + * Flags. Otherwise, the receiver MUST silently discard the packet + * and take no further action. + * + * (C) The receiver of a SHUTDOWN COMPLETE shall accept the + * packet if the Verification Tag field of the packet + * matches its own tag OR it is set to its peer's tag and + * the T bit is set in the Chunk Flags. Otherwise, the + * receiver MUST silently discard the packet and take no + * further action.... + * + */ + if ((ntohl(chunk->sctp_hdr->vtag) == asoc->c.my_vtag) || + (sctp_test_T_bit(chunk) && (ntohl(chunk->sctp_hdr->vtag) + == asoc->c.peer_vtag))) { + return 1; + } + + return 0; +} + #endif /* __sctp_sm_h__ */ diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index d1748a73e6b0..5a8b75d2da26 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -378,7 +378,7 @@ typedef union { typedef union { sctp_ipv4addr_param_t v4; sctp_ipv6addr_param_t v6; -} sctpIpAddress_t; +} sctp_addr_param_t; /* RFC 2960. Section 3.3.5 Heartbeat. * Heartbeat Information: variable length @@ -1044,6 +1044,9 @@ sctp_association_t *sctp_endpoint_lookup_assoc(const sctp_endpoint_t *ep, sctp_endpoint_t *sctp_endpoint_is_match(sctp_endpoint_t *, const sockaddr_storage_t *); +int sctp_has_association(const sockaddr_storage_t *laddr, + const sockaddr_storage_t *paddr); + int sctp_verify_init(const sctp_association_t *asoc, sctp_cid_t cid, sctp_init_chunk_t *peer_init, @@ -1312,6 +1315,9 @@ struct SCTP_association { __u32 ctsn_ack_point; + /* Highest TSN that is acknowledged by incoming SACKs. */ + __u32 highest_sacked; + /* The number of unacknowledged data chunks. Reported through * the SCTP_STATUS sockopt. */ |
