Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
76cb7f3a
Commit
76cb7f3a
authored
Jun 18, 2003
by
Jon Grimm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SCTP] More typedef removals.
sctp_cookie_t -> sctp_cookie, sctp_signed_cookie_t ->sctp_signed_cookie_t.
parent
bb520e84
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
216 additions
and
217 deletions
+216
-217
include/net/sctp/structs.h
include/net/sctp/structs.h
+205
-206
net/sctp/associola.c
net/sctp/associola.c
+2
-2
net/sctp/sm_make_chunk.c
net/sctp/sm_make_chunk.c
+6
-6
net/sctp/sm_statefuns.c
net/sctp/sm_statefuns.c
+3
-3
No files found.
include/net/sctp/structs.h
View file @
76cb7f3a
...
@@ -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
;
s
ctp_init_chunk_t
peer_init
[
0
];
s
truct
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
];
s
ctp_cookie_t
c
;
s
truct
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
{
s
ctp_ipv4addr_param_t
v4
;
s
truct
sctp_ipv4addr_param
v4
;
s
ctp_ipv6addr_param_t
v6
;
s
truct
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
;
s
ctp_paramhdr_t
*
p
;
s
truct
sctp_paramhdr
*
p
;
s
ctp_cookie_preserve_param_t
*
life
;
s
truct
sctp_cookie_preserve_param
*
life
;
s
ctp_hostname_param_t
*
dns
;
s
truct
sctp_hostname_param
*
dns
;
s
ctp_cookie_param_t
*
cookie
;
s
truct
sctp_cookie_param
*
cookie
;
s
ctp_supported_addrs_param_t
*
sat
;
s
truct
sctp_supported_addrs_param
*
sat
;
s
ctp_ipv4addr_param_t
*
v4
;
s
truct
sctp_ipv4addr_param
*
v4
;
s
ctp_ipv6addr_param_t
*
v6
;
s
truct
sctp_ipv6addr_param
*
v6
;
s
ctp_addr_param_t
*
addr
;
s
truct
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
{
s
ctp_paramhdr_t
param_hdr
;
s
truct
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
;
s
ctp_datahdr_t
*
data_hdr
;
s
truct
sctp_datahdr
*
data_hdr
;
s
ctp_inithdr_t
*
init_hdr
;
s
truct
sctp_inithdr
*
init_hdr
;
s
ctp_sackhdr_t
*
sack_hdr
;
s
truct
sctp_sackhdr
*
sack_hdr
;
s
ctp_heartbeathdr_t
*
hb_hdr
;
s
truct
sctp_heartbeathdr
*
hb_hdr
;
s
ctp_sender_hb_info_t
*
hbs_hdr
;
s
truct
sctp_sender_hb_info
*
hbs_hdr
;
s
ctp_shutdownhdr_t
*
shutdown_hdr
;
s
truct
sctp_shutdownhdr
*
shutdown_hdr
;
s
ctp_signed_cookie_t
*
cookie_hdr
;
s
truct
sctp_signed_cookie
*
cookie_hdr
;
s
ctp_ecnehdr_t
*
ecne_hdr
;
s
truct
sctp_ecnehdr
*
ecne_hdr
;
s
ctp_cwrhdr_t
*
ecn_cwr_hdr
;
s
truct
sctp_cwrhdr
*
ecn_cwr_hdr
;
s
ctp_errhdr_t
*
err_hdr
;
s
truct
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
*
,
s
ctp_sackhdr_t
*
);
int
sctp_outq_sack
(
struct
sctp_outq
*
,
s
truct
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. */
s
ctp_cookie_t
c
;
s
truct
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? */
s
ctp_inithdr_t
i
;
s
truct
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
*
,
s
ctp_cookie_t
*
,
int
gfp
);
s
truct
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
);
...
...
net/sctp/associola.c
View file @
76cb7f3a
...
@@ -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
,
s
ctp_cookie_t
*
cookie
,
int
gfp
)
s
truct
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
(
s
ctp_cookie_t
)
+
var_size2
;
__u8
*
raw
=
(
__u8
*
)
cookie
+
sizeof
(
s
truct
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
);
...
...
net/sctp/sm_make_chunk.c
View file @
76cb7f3a
...
@@ -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
;
s
ctp_signed_cookie_t
*
cookie
;
s
truct
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
(
s
ctp_cookie_t
)
bodysize
=
sizeof
(
s
truct
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
=
(
s
ctp_signed_cookie_t
*
)
retval
->
body
;
cookie
=
(
s
truct
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
;
s
ctp_signed_cookie_t
*
cookie
;
s
truct
sctp_signed_cookie
*
cookie
;
s
ctp_cookie_t
*
bear_cookie
;
s
truct
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
(
s
ctp_cookie_t
);
fixed_size
=
headersize
+
sizeof
(
s
truct
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
...
...
net/sctp/sm_statefuns.c
View file @
76cb7f3a
...
@@ -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
=
(
s
ctp_signed_cookie_t
*
)
chunk
->
skb
->
data
;
(
s
truct
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
=
(
s
ctp_signed_cookie_t
*
)
chunk
->
skb
->
data
;
chunk
->
subh
.
cookie_hdr
=
(
s
truct
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
)
{
s
ctp_signed_cookie_t
*
cookie
;
s
truct
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment