Commit 76cb7f3a authored by Jon Grimm's avatar Jon Grimm

[SCTP] More typedef removals.

sctp_cookie_t -> sctp_cookie, sctp_signed_cookie_t ->sctp_signed_cookie_t.
parent bb520e84
...@@ -349,7 +349,7 @@ struct sctp_opt { ...@@ -349,7 +349,7 @@ struct sctp_opt {
* *
*/ */
typedef struct sctp_cookie { struct sctp_cookie {
/* My : Tag expected in every inbound packet and sent /* My : Tag expected in every inbound packet and sent
* Verification: in the INIT or INIT ACK chunk. * Verification: in the INIT or INIT ACK chunk.
...@@ -395,23 +395,23 @@ typedef struct sctp_cookie { ...@@ -395,23 +395,23 @@ typedef struct sctp_cookie {
* the association TCB is re-constructed from the cookie. * the association TCB is re-constructed from the cookie.
*/ */
__u32 raw_addr_list_len; __u32 raw_addr_list_len;
sctp_init_chunk_t peer_init[0]; struct sctp_init_chunk peer_init[0];
} sctp_cookie_t; };
/* The format of our cookie that we send to our peer. */ /* The format of our cookie that we send to our peer. */
typedef struct sctp_signed_cookie { struct sctp_signed_cookie {
__u8 signature[SCTP_SECRET_SIZE]; __u8 signature[SCTP_SECRET_SIZE];
sctp_cookie_t c; struct sctp_cookie c;
} sctp_signed_cookie_t; };
/* This is another convenience type to allocate memory for address /* This is another convenience type to allocate memory for address
* params for the maximum size and pass such structures around * params for the maximum size and pass such structures around
* internally. * internally.
*/ */
typedef union { typedef union {
sctp_ipv4addr_param_t v4; struct sctp_ipv4addr_param v4;
sctp_ipv6addr_param_t v6; struct sctp_ipv6addr_param v6;
} sctp_addr_param_t; } sctp_addr_param_t;
/* A convenience type to allow walking through the various /* A convenience type to allow walking through the various
...@@ -419,14 +419,14 @@ typedef union { ...@@ -419,14 +419,14 @@ typedef union {
*/ */
union sctp_params { union sctp_params {
void *v; void *v;
sctp_paramhdr_t *p; struct sctp_paramhdr *p;
sctp_cookie_preserve_param_t *life; struct sctp_cookie_preserve_param *life;
sctp_hostname_param_t *dns; struct sctp_hostname_param *dns;
sctp_cookie_param_t *cookie; struct sctp_cookie_param *cookie;
sctp_supported_addrs_param_t *sat; struct sctp_supported_addrs_param *sat;
sctp_ipv4addr_param_t *v4; struct sctp_ipv4addr_param *v4;
sctp_ipv6addr_param_t *v6; struct sctp_ipv6addr_param *v6;
sctp_addr_param_t *addr; struct sctp_addr_param *addr;
}; };
/* RFC 2960. Section 3.3.5 Heartbeat. /* RFC 2960. Section 3.3.5 Heartbeat.
...@@ -437,7 +437,7 @@ union sctp_params { ...@@ -437,7 +437,7 @@ union sctp_params {
* HEARTBEAT is sent (see Section 8.3). * HEARTBEAT is sent (see Section 8.3).
*/ */
typedef struct sctp_sender_hb_info { typedef struct sctp_sender_hb_info {
sctp_paramhdr_t param_hdr; struct sctp_paramhdr param_hdr;
union sctp_addr daddr; union sctp_addr daddr;
unsigned long sent_at; unsigned long sent_at;
} sctp_sender_hb_info_t __attribute__((packed)); } sctp_sender_hb_info_t __attribute__((packed));
...@@ -557,23 +557,22 @@ struct sctp_chunk { ...@@ -557,23 +557,22 @@ struct sctp_chunk {
union sctp_params param_hdr; union sctp_params param_hdr;
union { union {
__u8 *v; __u8 *v;
sctp_datahdr_t *data_hdr; struct sctp_datahdr *data_hdr;
sctp_inithdr_t *init_hdr; struct sctp_inithdr *init_hdr;
sctp_sackhdr_t *sack_hdr; struct sctp_sackhdr *sack_hdr;
sctp_heartbeathdr_t *hb_hdr; struct sctp_heartbeathdr *hb_hdr;
sctp_sender_hb_info_t *hbs_hdr; struct sctp_sender_hb_info *hbs_hdr;
sctp_shutdownhdr_t *shutdown_hdr; struct sctp_shutdownhdr *shutdown_hdr;
sctp_signed_cookie_t *cookie_hdr; struct sctp_signed_cookie *cookie_hdr;
sctp_ecnehdr_t *ecne_hdr; struct sctp_ecnehdr *ecne_hdr;
sctp_cwrhdr_t *ecn_cwr_hdr; struct sctp_cwrhdr *ecn_cwr_hdr;
sctp_errhdr_t *err_hdr; struct sctp_errhdr *err_hdr;
} subh; } subh;
__u8 *chunk_end; __u8 *chunk_end;
sctp_chunkhdr_t *chunk_hdr; struct sctp_chunkhdr *chunk_hdr;
struct sctphdr *sctp_hdr;
sctp_sctphdr_t *sctp_hdr;
/* This needs to be recoverable for SCTP_SEND_FAILED events. */ /* This needs to be recoverable for SCTP_SEND_FAILED events. */
struct sctp_sndrcvinfo sinfo; struct sctp_sndrcvinfo sinfo;
...@@ -1022,7 +1021,7 @@ void sctp_outq_teardown(struct sctp_outq *); ...@@ -1022,7 +1021,7 @@ void sctp_outq_teardown(struct sctp_outq *);
void sctp_outq_free(struct sctp_outq*); void sctp_outq_free(struct sctp_outq*);
int sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk); int sctp_outq_tail(struct sctp_outq *, struct sctp_chunk *chunk);
int sctp_outq_flush(struct sctp_outq *, int); int sctp_outq_flush(struct sctp_outq *, int);
int sctp_outq_sack(struct sctp_outq *, sctp_sackhdr_t *); int sctp_outq_sack(struct sctp_outq *, struct sctp_sackhdr *);
int sctp_outq_is_empty(const struct sctp_outq *); int sctp_outq_is_empty(const struct sctp_outq *);
int sctp_outq_set_output_handlers(struct sctp_outq *, int sctp_outq_set_output_handlers(struct sctp_outq *,
sctp_outq_ohandler_init_t init, sctp_outq_ohandler_init_t init,
...@@ -1273,7 +1272,7 @@ struct sctp_association { ...@@ -1273,7 +1272,7 @@ struct sctp_association {
struct sctp_endpoint *ep; struct sctp_endpoint *ep;
/* These are those association elements needed in the cookie. */ /* These are those association elements needed in the cookie. */
sctp_cookie_t c; struct sctp_cookie c;
/* This is all information about our peer. */ /* This is all information about our peer. */
struct { struct {
...@@ -1378,7 +1377,7 @@ struct sctp_association { ...@@ -1378,7 +1377,7 @@ struct sctp_association {
__u8 ipv4_address; /* Peer understands IPv4 addresses? */ __u8 ipv4_address; /* Peer understands IPv4 addresses? */
__u8 ipv6_address; /* Peer understands IPv6 addresses? */ __u8 ipv6_address; /* Peer understands IPv6 addresses? */
__u8 hostname_address;/* Peer understands DNS addresses? */ __u8 hostname_address;/* Peer understands DNS addresses? */
sctp_inithdr_t i; struct sctp_inithdr i;
int cookie_len; int cookie_len;
void *cookie; void *cookie;
...@@ -1712,7 +1711,7 @@ void sctp_assoc_set_primary(struct sctp_association *, ...@@ -1712,7 +1711,7 @@ void sctp_assoc_set_primary(struct sctp_association *,
struct sctp_transport *); struct sctp_transport *);
int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, int); int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, int);
int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *,
sctp_cookie_t *, int gfp); struct sctp_cookie*, int gfp);
int sctp_cmp_addr_exact(const union sctp_addr *ss1, int sctp_cmp_addr_exact(const union sctp_addr *ss1,
const union sctp_addr *ss2); const union sctp_addr *ss2);
......
...@@ -1147,11 +1147,11 @@ int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc, int gfp) ...@@ -1147,11 +1147,11 @@ int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *asoc, int gfp)
/* Build the association's bind address list from the cookie. */ /* Build the association's bind address list from the cookie. */
int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *asoc, int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *asoc,
sctp_cookie_t *cookie, int gfp) struct sctp_cookie *cookie, int gfp)
{ {
int var_size2 = ntohs(cookie->peer_init->chunk_hdr.length); int var_size2 = ntohs(cookie->peer_init->chunk_hdr.length);
int var_size3 = cookie->raw_addr_list_len; int var_size3 = cookie->raw_addr_list_len;
__u8 *raw = (__u8 *)cookie + sizeof(sctp_cookie_t) + var_size2; __u8 *raw = (__u8 *)cookie + sizeof(struct sctp_cookie) + var_size2;
return sctp_raw_to_bind_addrs(&asoc->base.bind_addr, raw, var_size3, return sctp_raw_to_bind_addrs(&asoc->base.bind_addr, raw, var_size3,
asoc->ep->base.bind_addr.port, gfp); asoc->ep->base.bind_addr.port, gfp);
......
...@@ -1275,14 +1275,14 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, ...@@ -1275,14 +1275,14 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
const __u8 *raw_addrs, int addrs_len) const __u8 *raw_addrs, int addrs_len)
{ {
sctp_cookie_param_t *retval; sctp_cookie_param_t *retval;
sctp_signed_cookie_t *cookie; struct sctp_signed_cookie *cookie;
struct scatterlist sg; struct scatterlist sg;
int headersize, bodysize; int headersize, bodysize;
unsigned int keylen; unsigned int keylen;
char *key; char *key;
headersize = sizeof(sctp_paramhdr_t) + SCTP_SECRET_SIZE; headersize = sizeof(sctp_paramhdr_t) + SCTP_SECRET_SIZE;
bodysize = sizeof(sctp_cookie_t) bodysize = sizeof(struct sctp_cookie)
+ ntohs(init_chunk->chunk_hdr->length) + addrs_len; + ntohs(init_chunk->chunk_hdr->length) + addrs_len;
/* Pad out the cookie to a multiple to make the signature /* Pad out the cookie to a multiple to make the signature
...@@ -1304,7 +1304,7 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep, ...@@ -1304,7 +1304,7 @@ sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
* out on the network. * out on the network.
*/ */
memset(retval, 0x00, *cookie_len); memset(retval, 0x00, *cookie_len);
cookie = (sctp_signed_cookie_t *) retval->body; cookie = (struct sctp_signed_cookie *) retval->body;
/* Set up the parameter header. */ /* Set up the parameter header. */
retval->p.type = SCTP_PARAM_STATE_COOKIE; retval->p.type = SCTP_PARAM_STATE_COOKIE;
...@@ -1351,8 +1351,8 @@ struct sctp_association *sctp_unpack_cookie( ...@@ -1351,8 +1351,8 @@ struct sctp_association *sctp_unpack_cookie(
int *error, struct sctp_chunk **errp) int *error, struct sctp_chunk **errp)
{ {
struct sctp_association *retval = NULL; struct sctp_association *retval = NULL;
sctp_signed_cookie_t *cookie; struct sctp_signed_cookie *cookie;
sctp_cookie_t *bear_cookie; struct sctp_cookie *bear_cookie;
int headersize, bodysize, fixed_size; int headersize, bodysize, fixed_size;
__u8 digest[SCTP_SIGNATURE_SIZE]; __u8 digest[SCTP_SIGNATURE_SIZE];
struct scatterlist sg; struct scatterlist sg;
...@@ -1363,7 +1363,7 @@ struct sctp_association *sctp_unpack_cookie( ...@@ -1363,7 +1363,7 @@ struct sctp_association *sctp_unpack_cookie(
headersize = sizeof(sctp_chunkhdr_t) + SCTP_SECRET_SIZE; headersize = sizeof(sctp_chunkhdr_t) + SCTP_SECRET_SIZE;
bodysize = ntohs(chunk->chunk_hdr->length) - headersize; bodysize = ntohs(chunk->chunk_hdr->length) - headersize;
fixed_size = headersize + sizeof(sctp_cookie_t); fixed_size = headersize + sizeof(struct sctp_cookie);
/* Verify that the chunk looks like it even has a cookie. /* Verify that the chunk looks like it even has a cookie.
* There must be enough room for our cookie and our peer's * There must be enough room for our cookie and our peer's
......
...@@ -538,7 +538,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep, ...@@ -538,7 +538,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
* are in good shape. * are in good shape.
*/ */
chunk->subh.cookie_hdr = chunk->subh.cookie_hdr =
(sctp_signed_cookie_t *)chunk->skb->data; (struct sctp_signed_cookie *)chunk->skb->data;
skb_pull(chunk->skb, skb_pull(chunk->skb,
ntohs(chunk->chunk_hdr->length) - sizeof(sctp_chunkhdr_t)); ntohs(chunk->chunk_hdr->length) - sizeof(sctp_chunkhdr_t));
...@@ -1619,7 +1619,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep, ...@@ -1619,7 +1619,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep,
/* "Decode" the chunk. We have no optional parameters so we /* "Decode" the chunk. We have no optional parameters so we
* are in good shape. * are in good shape.
*/ */
chunk->subh.cookie_hdr = (sctp_signed_cookie_t *)chunk->skb->data; chunk->subh.cookie_hdr = (struct sctp_signed_cookie *)chunk->skb->data;
skb_pull(chunk->skb, ntohs(chunk->chunk_hdr->length) - skb_pull(chunk->skb, ntohs(chunk->chunk_hdr->length) -
sizeof(sctp_chunkhdr_t)); sizeof(sctp_chunkhdr_t));
...@@ -4568,7 +4568,7 @@ void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep, ...@@ -4568,7 +4568,7 @@ void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
if (err_chunk) { if (err_chunk) {
packet = sctp_ootb_pkt_new(asoc, chunk); packet = sctp_ootb_pkt_new(asoc, chunk);
if (packet) { if (packet) {
sctp_signed_cookie_t *cookie; struct sctp_signed_cookie *cookie;
/* Override the OOTB vtag from the cookie. */ /* Override the OOTB vtag from the cookie. */
cookie = chunk->subh.cookie_hdr; cookie = chunk->subh.cookie_hdr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment