Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b50db919 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'sctp-remove-typedefs-from-structures-part-6'



Xin Long says:

====================
sctp: remove typedefs from structures part 6

As we know, typedef is suggested not to use in kernel, even checkpatch.pl
also gives warnings about it. Now sctp is using it for many structures.

All this kind of typedef's using should be removed. This patchset is the
part 6 to remove all typedefs in include/net/sctp/structs.h, command.h
and sm.h.

Just as the part 1-5, No any code's logic would be changed in these patches,
only cleaning up.

Note that this is the last part for this typedef cleaning up. after this
patchset, no more inappropriate typedefs in sctp. It's also to tidy some
codes when removing them, like fixing many indents, reodering some local
params, especially in the last 2 patches.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3b2b69ef 327c0dab
Loading
Loading
Loading
Loading
+29 −29
Original line number Original line Diff line number Diff line
@@ -40,7 +40,7 @@
#include <net/sctp/structs.h>
#include <net/sctp/structs.h>




typedef enum {
enum sctp_verb {
	SCTP_CMD_NOP = 0,	/* Do nothing. */
	SCTP_CMD_NOP = 0,	/* Do nothing. */
	SCTP_CMD_NEW_ASOC,	/* Register a new association.  */
	SCTP_CMD_NEW_ASOC,	/* Register a new association.  */
	SCTP_CMD_DELETE_TCB,	/* Delete the current association. */
	SCTP_CMD_DELETE_TCB,	/* Delete the current association. */
@@ -108,16 +108,16 @@ typedef enum {
	SCTP_CMD_PURGE_ASCONF_QUEUE, /* Purge all asconf queues.*/
	SCTP_CMD_PURGE_ASCONF_QUEUE, /* Purge all asconf queues.*/
	SCTP_CMD_SET_ASOC,	 /* Restore association context */
	SCTP_CMD_SET_ASOC,	 /* Restore association context */
	SCTP_CMD_LAST
	SCTP_CMD_LAST
} sctp_verb_t;
};


/* How many commands can you put in an sctp_cmd_seq_t?
/* How many commands can you put in an struct sctp_cmd_seq?
 * This is a rather arbitrary number, ideally derived from a careful
 * This is a rather arbitrary number, ideally derived from a careful
 * analysis of the state functions, but in reality just taken from
 * analysis of the state functions, but in reality just taken from
 * thin air in the hopes othat we don't trigger a kernel panic.
 * thin air in the hopes othat we don't trigger a kernel panic.
 */
 */
#define SCTP_MAX_NUM_COMMANDS 20
#define SCTP_MAX_NUM_COMMANDS 20


typedef union {
union sctp_arg {
	void *zero_all;	/* Set to NULL to clear the entire union */
	void *zero_all;	/* Set to NULL to clear the entire union */
	__s32 i32;
	__s32 i32;
	__u32 u32;
	__u32 u32;
@@ -137,24 +137,24 @@ typedef union {
	struct sctp_packet *packet;
	struct sctp_packet *packet;
	struct sctp_sackhdr *sackh;
	struct sctp_sackhdr *sackh;
	struct sctp_datamsg *msg;
	struct sctp_datamsg *msg;
} sctp_arg_t;
};


/* We are simulating ML type constructors here.
/* We are simulating ML type constructors here.
 *
 *
 * SCTP_ARG_CONSTRUCTOR(NAME, TYPE, ELT) builds a function called
 * SCTP_ARG_CONSTRUCTOR(NAME, TYPE, ELT) builds a function called
 * SCTP_NAME() which takes an argument of type TYPE and returns an
 * SCTP_NAME() which takes an argument of type TYPE and returns an
 * sctp_arg_t.  It does this by inserting the sole argument into the
 * union sctp_arg.  It does this by inserting the sole argument into
 * ELT union element of a local sctp_arg_t.
 * the ELT union element of a local union sctp_arg.
 *
 *
 * E.g., SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) builds SCTP_I32(arg),
 * E.g., SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) builds SCTP_I32(arg),
 * which takes an __s32 and returns a sctp_arg_t containing the
 * which takes an __s32 and returns a union sctp_arg containing the
 * __s32.  So, after foo = SCTP_I32(arg), foo.i32 == arg.
 * __s32.  So, after foo = SCTP_I32(arg), foo.i32 == arg.
 */
 */


#define SCTP_ARG_CONSTRUCTOR(name, type, elt) \
#define SCTP_ARG_CONSTRUCTOR(name, type, elt) \
static inline sctp_arg_t	\
static inline union sctp_arg	\
SCTP_## name (type arg)		\
SCTP_## name (type arg)		\
{ sctp_arg_t retval;\
{ union sctp_arg retval;\
  retval.zero_all = NULL;\
  retval.zero_all = NULL;\
  retval.elt = arg;\
  retval.elt = arg;\
  return retval;\
  return retval;\
@@ -179,39 +179,39 @@ SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet)
SCTP_ARG_CONSTRUCTOR(SACKH,	struct sctp_sackhdr *, sackh)
SCTP_ARG_CONSTRUCTOR(SACKH,	struct sctp_sackhdr *, sackh)
SCTP_ARG_CONSTRUCTOR(DATAMSG,	struct sctp_datamsg *, msg)
SCTP_ARG_CONSTRUCTOR(DATAMSG,	struct sctp_datamsg *, msg)


static inline sctp_arg_t SCTP_FORCE(void)
static inline union sctp_arg SCTP_FORCE(void)
{
{
	return SCTP_I32(1);
	return SCTP_I32(1);
}
}


static inline sctp_arg_t SCTP_NOFORCE(void)
static inline union sctp_arg SCTP_NOFORCE(void)
{
{
	return SCTP_I32(0);
	return SCTP_I32(0);
}
}


static inline sctp_arg_t SCTP_NULL(void)
static inline union sctp_arg SCTP_NULL(void)
{
{
	sctp_arg_t retval;
	union sctp_arg retval;
	retval.zero_all = NULL;
	retval.zero_all = NULL;
	return retval;
	return retval;
}
}


typedef struct {
struct sctp_cmd {
	sctp_arg_t obj;
	union sctp_arg obj;
	sctp_verb_t verb;
	enum sctp_verb verb;
} sctp_cmd_t;
};


typedef struct {
struct sctp_cmd_seq {
	sctp_cmd_t cmds[SCTP_MAX_NUM_COMMANDS];
	struct sctp_cmd cmds[SCTP_MAX_NUM_COMMANDS];
	sctp_cmd_t *last_used_slot;
	struct sctp_cmd *last_used_slot;
	sctp_cmd_t *next_cmd;
	struct sctp_cmd *next_cmd;
} sctp_cmd_seq_t;
};




/* Initialize a block of memory as a command sequence.
/* Initialize a block of memory as a command sequence.
 * Return 0 if the initialization fails.
 * Return 0 if the initialization fails.
 */
 */
static inline int sctp_init_cmd_seq(sctp_cmd_seq_t *seq)
static inline int sctp_init_cmd_seq(struct sctp_cmd_seq *seq)
{
{
	/* cmds[] is filled backwards to simplify the overflow BUG() check */
	/* cmds[] is filled backwards to simplify the overflow BUG() check */
	seq->last_used_slot = seq->cmds + SCTP_MAX_NUM_COMMANDS;
	seq->last_used_slot = seq->cmds + SCTP_MAX_NUM_COMMANDS;
@@ -220,15 +220,15 @@ static inline int sctp_init_cmd_seq(sctp_cmd_seq_t *seq)
}
}




/* Add a command to an sctp_cmd_seq_t.
/* Add a command to an struct sctp_cmd_seq.
 *
 *
 * Use the SCTP_* constructors defined by SCTP_ARG_CONSTRUCTOR() above
 * Use the SCTP_* constructors defined by SCTP_ARG_CONSTRUCTOR() above
 * to wrap data which goes in the obj argument.
 * to wrap data which goes in the obj argument.
 */
 */
static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb,
static inline void sctp_add_cmd_sf(struct sctp_cmd_seq *seq,
				   sctp_arg_t obj)
				   enum sctp_verb verb, union sctp_arg obj)
{
{
	sctp_cmd_t *cmd = seq->last_used_slot - 1;
	struct sctp_cmd *cmd = seq->last_used_slot - 1;


	BUG_ON(cmd < seq->cmds);
	BUG_ON(cmd < seq->cmds);


@@ -240,7 +240,7 @@ static inline void sctp_add_cmd_sf(sctp_cmd_seq_t *seq, sctp_verb_t verb,
/* Return the next command structure in an sctp_cmd_seq.
/* Return the next command structure in an sctp_cmd_seq.
 * Return NULL at the end of the sequence.
 * Return NULL at the end of the sequence.
 */
 */
static inline sctp_cmd_t *sctp_next_cmd(sctp_cmd_seq_t *seq)
static inline struct sctp_cmd *sctp_next_cmd(struct sctp_cmd_seq *seq)
{
{
	if (seq->next_cmd <= seq->last_used_slot)
	if (seq->next_cmd <= seq->last_used_slot)
		return NULL;
		return NULL;
+2 −1
Original line number Original line Diff line number Diff line
@@ -550,7 +550,8 @@ static inline int sctp_ep_hashfn(struct net *net, __u16 lport)


/* Is a socket of this style? */
/* Is a socket of this style? */
#define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style))
#define sctp_style(sk, style) __sctp_style((sk), (SCTP_SOCKET_##style))
static inline int __sctp_style(const struct sock *sk, sctp_socket_type_t style)
static inline int __sctp_style(const struct sock *sk,
			       enum sctp_socket_type style)
{
{
	return sctp_sk(sk)->type == style;
	return sctp_sk(sk)->type == style;
}
}
+92 −96
Original line number Original line Diff line number Diff line
@@ -53,7 +53,7 @@
/*
/*
 * Possible values for the disposition are:
 * Possible values for the disposition are:
 */
 */
typedef enum {
enum sctp_disposition {
	SCTP_DISPOSITION_DISCARD,	 /* No further processing.  */
	SCTP_DISPOSITION_DISCARD,	 /* No further processing.  */
	SCTP_DISPOSITION_CONSUME,	 /* Process return values normally.  */
	SCTP_DISPOSITION_CONSUME,	 /* Process return values normally.  */
	SCTP_DISPOSITION_NOMEM,		 /* We ran out of memory--recover.  */
	SCTP_DISPOSITION_NOMEM,		 /* We ran out of memory--recover.  */
@@ -63,24 +63,20 @@ typedef enum {
	SCTP_DISPOSITION_NOT_IMPL,	 /* This entry is not implemented.  */
	SCTP_DISPOSITION_NOT_IMPL,	 /* This entry is not implemented.  */
	SCTP_DISPOSITION_ERROR,		 /* This is plain old user error.  */
	SCTP_DISPOSITION_ERROR,		 /* This is plain old user error.  */
	SCTP_DISPOSITION_BUG,		 /* This is a bug.  */
	SCTP_DISPOSITION_BUG,		 /* This is a bug.  */
} sctp_disposition_t;
};


typedef struct {
typedef enum sctp_disposition (sctp_state_fn_t) (
	int name;
					struct net *net,
	int action;
					const struct sctp_endpoint *ep,
} sctp_sm_command_t;
					const struct sctp_association *asoc,

typedef sctp_disposition_t (sctp_state_fn_t) (struct net *,
					      const struct sctp_endpoint *,
					      const struct sctp_association *,
					const union sctp_subtype type,
					const union sctp_subtype type,
					void *arg,
					void *arg,
					      sctp_cmd_seq_t *);
					struct sctp_cmd_seq *commands);
typedef void (sctp_timer_event_t) (unsigned long);
typedef void (sctp_timer_event_t) (unsigned long);
typedef struct {
struct sctp_sm_table_entry {
	sctp_state_fn_t *fn;
	sctp_state_fn_t *fn;
	const char *name;
	const char *name;
} sctp_sm_table_entry_t;
};


/* A naming convention of "sctp_sf_xxx" applies to all the state functions
/* A naming convention of "sctp_sf_xxx" applies to all the state functions
 * currently in use.
 * currently in use.
@@ -175,7 +171,7 @@ sctp_state_fn_t sctp_sf_autoclose_timer_expire;


/* Prototypes for utility support functions.  */
/* Prototypes for utility support functions.  */
__u8 sctp_get_chunk_type(struct sctp_chunk *chunk);
__u8 sctp_get_chunk_type(struct sctp_chunk *chunk);
const sctp_sm_table_entry_t *sctp_sm_lookup_event(
const struct sctp_sm_table_entry *sctp_sm_lookup_event(
					struct net *net,
					struct net *net,
					enum sctp_event event_type,
					enum sctp_event event_type,
					enum sctp_state state,
					enum sctp_state state,
@@ -188,68 +184,69 @@ __u32 sctp_generate_verification_tag(void);
void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag);
void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag);


/* Prototypes for chunk-building functions.  */
/* Prototypes for chunk-building functions.  */
struct sctp_chunk *sctp_make_init(const struct sctp_association *,
struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
			     const struct sctp_bind_addr *,
				  const struct sctp_bind_addr *bp,
				  gfp_t gfp, int vparam_len);
				  gfp_t gfp, int vparam_len);
struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *,
struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
				 const struct sctp_chunk *,
				      const struct sctp_chunk *chunk,
				 const gfp_t gfp,
				      const gfp_t gfp, const int unkparam_len);
				 const int unkparam_len);
struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *asoc,
struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *,
					 const struct sctp_chunk *chunk);
				    const struct sctp_chunk *);
struct sctp_chunk *sctp_make_cookie_ack(const struct sctp_association *asoc,
struct sctp_chunk *sctp_make_cookie_ack(const struct sctp_association *,
					const struct sctp_chunk *chunk);
				   const struct sctp_chunk *);
struct sctp_chunk *sctp_make_cwr(const struct sctp_association *asoc,
struct sctp_chunk *sctp_make_cwr(const struct sctp_association *,
				 const __u32 lowest_tsn,
				 const __u32 lowest_tsn,
				 const struct sctp_chunk *);
				 const struct sctp_chunk *chunk);
struct sctp_chunk * sctp_make_datafrag_empty(struct sctp_association *,
struct sctp_chunk *sctp_make_datafrag_empty(struct sctp_association *asoc,
					    const struct sctp_sndrcvinfo *sinfo,
					    const struct sctp_sndrcvinfo *sinfo,
					    int len, const __u8 flags,
					    int len, const __u8 flags,
					    __u16 ssn, gfp_t gfp);
					    __u16 ssn, gfp_t gfp);
struct sctp_chunk *sctp_make_ecne(const struct sctp_association *,
struct sctp_chunk *sctp_make_ecne(const struct sctp_association *asoc,
				  const __u32);
				  const __u32 lowest_tsn);
struct sctp_chunk *sctp_make_sack(const struct sctp_association *);
struct sctp_chunk *sctp_make_sack(const struct sctp_association *asoc);
struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc,
struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc,
				      const struct sctp_chunk *chunk);
				      const struct sctp_chunk *chunk);
struct sctp_chunk *sctp_make_shutdown_ack(const struct sctp_association *asoc,
struct sctp_chunk *sctp_make_shutdown_ack(const struct sctp_association *asoc,
					  const struct sctp_chunk *);
					  const struct sctp_chunk *chunk);
struct sctp_chunk *sctp_make_shutdown_complete(const struct sctp_association *,
struct sctp_chunk *sctp_make_shutdown_complete(
					  const struct sctp_chunk *);
					const struct sctp_association *asoc,
void sctp_init_cause(struct sctp_chunk *, __be16 cause, size_t);
					const struct sctp_chunk *chunk);
struct sctp_chunk *sctp_make_abort(const struct sctp_association *,
void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause, size_t paylen);
			      const struct sctp_chunk *,
struct sctp_chunk *sctp_make_abort(const struct sctp_association *asoc,
				   const struct sctp_chunk *chunk,
				   const size_t hint);
				   const size_t hint);
struct sctp_chunk *sctp_make_abort_no_data(const struct sctp_association *,
struct sctp_chunk *sctp_make_abort_no_data(const struct sctp_association *asoc,
				      const struct sctp_chunk *,
					   const struct sctp_chunk *chunk,
					   __u32 tsn);
					   __u32 tsn);
struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *,
struct sctp_chunk *sctp_make_abort_user(const struct sctp_association *asoc,
					struct msghdr *, size_t msg_len);
					struct msghdr *msg, size_t msg_len);
struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *,
struct sctp_chunk *sctp_make_abort_violation(
				   const struct sctp_chunk *,
					const struct sctp_association *asoc,
				   const __u8 *,
					const struct sctp_chunk *chunk,
				   const size_t );
					const __u8 *payload,
struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *,
				   const struct sctp_chunk *,
				   struct sctp_paramhdr *);
struct sctp_chunk *sctp_make_violation_max_retrans(const struct sctp_association *,
						   const struct sctp_chunk *);
struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *,
				  const struct sctp_transport *);
struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *,
				      const struct sctp_chunk *,
				      const void *payload,
					const size_t paylen);
					const size_t paylen);
struct sctp_chunk *sctp_make_op_error(const struct sctp_association *,
struct sctp_chunk *sctp_make_violation_paramlen(
					const struct sctp_association *asoc,
					const struct sctp_chunk *chunk,
					struct sctp_paramhdr *param);
struct sctp_chunk *sctp_make_violation_max_retrans(
					const struct sctp_association *asoc,
					const struct sctp_chunk *chunk);
struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *asoc,
				       const struct sctp_transport *transport);
struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *asoc,
					   const struct sctp_chunk *chunk,
					   const struct sctp_chunk *chunk,
				 __be16 cause_code,
					   const void *payload,
					   const void *payload,
				 size_t paylen,
					   const size_t paylen);
				 size_t reserve_tail);
struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc,
				      const struct sctp_chunk *chunk,
				      __be16 cause_code, const void *payload,
				      size_t paylen, size_t reserve_tail);


struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *,
struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
					      union sctp_addr *,
					      union sctp_addr *laddr,
					      struct sockaddr *,
					      struct sockaddr *addrs,
					      int, __be16);
					      int addrcnt, __be16 flags);
struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc,
struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc,
					     union sctp_addr *addr);
					     union sctp_addr *addr);
bool sctp_verify_asconf(const struct sctp_association *asoc,
bool sctp_verify_asconf(const struct sctp_association *asoc,
@@ -263,8 +260,7 @@ struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc,
				    __u32 new_cum_tsn, size_t nstreams,
				    __u32 new_cum_tsn, size_t nstreams,
				    struct sctp_fwdtsn_skip *skiplist);
				    struct sctp_fwdtsn_skip *skiplist);
struct sctp_chunk *sctp_make_auth(const struct sctp_association *asoc);
struct sctp_chunk *sctp_make_auth(const struct sctp_association *asoc);
struct sctp_chunk *sctp_make_strreset_req(
struct sctp_chunk *sctp_make_strreset_req(const struct sctp_association *asoc,
				const struct sctp_association *asoc,
					  __u16 stream_num, __u16 *stream_list,
					  __u16 stream_num, __u16 *stream_list,
					  bool out, bool in);
					  bool out, bool in);
struct sctp_chunk *sctp_make_strreset_tsnreq(
struct sctp_chunk *sctp_make_strreset_tsnreq(
@@ -272,18 +268,17 @@ struct sctp_chunk *sctp_make_strreset_tsnreq(
struct sctp_chunk *sctp_make_strreset_addstrm(
struct sctp_chunk *sctp_make_strreset_addstrm(
					const struct sctp_association *asoc,
					const struct sctp_association *asoc,
					__u16 out, __u16 in);
					__u16 out, __u16 in);
struct sctp_chunk *sctp_make_strreset_resp(
struct sctp_chunk *sctp_make_strreset_resp(const struct sctp_association *asoc,
				const struct sctp_association *asoc,
					   __u32 result, __u32 sn);
					   __u32 result, __u32 sn);
struct sctp_chunk *sctp_make_strreset_tsnresp(
struct sctp_chunk *sctp_make_strreset_tsnresp(struct sctp_association *asoc,
				struct sctp_association *asoc,
					      __u32 result, __u32 sn,
					      __u32 result, __u32 sn,
				__u32 sender_tsn, __u32 receiver_tsn);
					      __u32 sender_tsn,
					      __u32 receiver_tsn);
bool sctp_verify_reconf(const struct sctp_association *asoc,
bool sctp_verify_reconf(const struct sctp_association *asoc,
			struct sctp_chunk *chunk,
			struct sctp_chunk *chunk,
			struct sctp_paramhdr **errp);
			struct sctp_paramhdr **errp);
void sctp_chunk_assign_tsn(struct sctp_chunk *);
void sctp_chunk_assign_tsn(struct sctp_chunk *chunk);
void sctp_chunk_assign_ssn(struct sctp_chunk *);
void sctp_chunk_assign_ssn(struct sctp_chunk *chunk);


/* Prototypes for stream-processing functions.  */
/* Prototypes for stream-processing functions.  */
struct sctp_chunk *sctp_process_strreset_outreq(
struct sctp_chunk *sctp_process_strreset_outreq(
@@ -326,7 +321,8 @@ void sctp_generate_proto_unreach_event(unsigned long peer);


void sctp_ootb_pkt_free(struct sctp_packet *packet);
void sctp_ootb_pkt_free(struct sctp_packet *packet);


struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *ep,
struct sctp_association *sctp_unpack_cookie(
					const struct sctp_endpoint *ep,
					const struct sctp_association *asoc,
					const struct sctp_association *asoc,
					struct sctp_chunk *chunk,
					struct sctp_chunk *chunk,
					gfp_t gfp, int *err,
					gfp_t gfp, int *err,
+12 −14
Original line number Original line Diff line number Diff line
@@ -150,18 +150,18 @@ extern struct sctp_globals {
#define sctp_checksum_disable		(sctp_globals.checksum_disable)
#define sctp_checksum_disable		(sctp_globals.checksum_disable)


/* SCTP Socket type: UDP or TCP style. */
/* SCTP Socket type: UDP or TCP style. */
typedef enum {
enum sctp_socket_type {
	SCTP_SOCKET_UDP = 0,
	SCTP_SOCKET_UDP = 0,
	SCTP_SOCKET_UDP_HIGH_BANDWIDTH,
	SCTP_SOCKET_UDP_HIGH_BANDWIDTH,
	SCTP_SOCKET_TCP
	SCTP_SOCKET_TCP
} sctp_socket_type_t;
};


/* Per socket SCTP information. */
/* Per socket SCTP information. */
struct sctp_sock {
struct sctp_sock {
	/* inet_sock has to be the first member of sctp_sock */
	/* inet_sock has to be the first member of sctp_sock */
	struct inet_sock inet;
	struct inet_sock inet;
	/* What kind of a socket is this? */
	/* What kind of a socket is this? */
	sctp_socket_type_t type;
	enum sctp_socket_type type;


	/* PF_ family specific functions.  */
	/* PF_ family specific functions.  */
	struct sctp_pf *pf;
	struct sctp_pf *pf;
@@ -371,12 +371,12 @@ union sctp_params {
 *    chunk is sent and the destination transport address to which this
 *    chunk is sent and the destination transport address to which this
 *    HEARTBEAT is sent (see Section 8.3).
 *    HEARTBEAT is sent (see Section 8.3).
 */
 */
typedef struct sctp_sender_hb_info {
struct sctp_sender_hb_info {
	struct sctp_paramhdr param_hdr;
	struct sctp_paramhdr param_hdr;
	union sctp_addr daddr;
	union sctp_addr daddr;
	unsigned long sent_at;
	unsigned long sent_at;
	__u64 hb_nonce;
	__u64 hb_nonce;
} sctp_sender_hb_info_t;
};


int sctp_stream_init(struct sctp_stream *stream, __u16 outcnt, __u16 incnt,
int sctp_stream_init(struct sctp_stream *stream, __u16 outcnt, __u16 incnt,
		     gfp_t gfp);
		     gfp_t gfp);
@@ -657,8 +657,6 @@ struct sctp_sockaddr_entry {


#define SCTP_ADDRESS_TICK_DELAY	500
#define SCTP_ADDRESS_TICK_DELAY	500


typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *);

/* This structure holds lists of chunks as we are assembling for
/* This structure holds lists of chunks as we are assembling for
 * transmission.
 * transmission.
 */
 */
@@ -1144,10 +1142,10 @@ int sctp_is_ep_boundall(struct sock *sk);




/* What type of endpoint?  */
/* What type of endpoint?  */
typedef enum {
enum sctp_endpoint_type {
	SCTP_EP_TYPE_SOCKET,
	SCTP_EP_TYPE_SOCKET,
	SCTP_EP_TYPE_ASSOCIATION,
	SCTP_EP_TYPE_ASSOCIATION,
} sctp_endpoint_type_t;
};


/*
/*
 * A common base class to bridge the implmentation view of a
 * A common base class to bridge the implmentation view of a
@@ -1171,7 +1169,7 @@ struct sctp_ep_common {
	int hashent;
	int hashent;


	/* Runtime type information.  What kind of endpoint is this? */
	/* Runtime type information.  What kind of endpoint is this? */
	sctp_endpoint_type_t type;
	enum sctp_endpoint_type type;


	/* Some fields to help us manage this object.
	/* Some fields to help us manage this object.
	 *   refcnt   - Reference count access to this object.
	 *   refcnt   - Reference count access to this object.
@@ -1987,16 +1985,16 @@ int sctp_cmp_addr_exact(const union sctp_addr *ss1,
struct sctp_chunk *sctp_get_ecne_prepend(struct sctp_association *asoc);
struct sctp_chunk *sctp_get_ecne_prepend(struct sctp_association *asoc);


/* A convenience structure to parse out SCTP specific CMSGs. */
/* A convenience structure to parse out SCTP specific CMSGs. */
typedef struct sctp_cmsgs {
struct sctp_cmsgs {
	struct sctp_initmsg *init;
	struct sctp_initmsg *init;
	struct sctp_sndrcvinfo *srinfo;
	struct sctp_sndrcvinfo *srinfo;
	struct sctp_sndinfo *sinfo;
	struct sctp_sndinfo *sinfo;
} sctp_cmsgs_t;
};


/* Structure for tracking memory objects */
/* Structure for tracking memory objects */
typedef struct {
struct sctp_dbg_objcnt_entry {
	char *label;
	char *label;
	atomic_t *counter;
	atomic_t *counter;
} sctp_dbg_objcnt_entry_t;
};


#endif /* __sctp_structs_h__ */
#endif /* __sctp_structs_h__ */
+1 −1
Original line number Original line Diff line number Diff line
@@ -57,7 +57,7 @@ SCTP_DBG_OBJCNT(keys);
/* An array to make it easy to pretty print the debug information
/* An array to make it easy to pretty print the debug information
 * to the proc fs.
 * to the proc fs.
 */
 */
static sctp_dbg_objcnt_entry_t sctp_dbg_objcnt[] = {
static struct sctp_dbg_objcnt_entry sctp_dbg_objcnt[] = {
	SCTP_DBG_OBJCNT_ENTRY(sock),
	SCTP_DBG_OBJCNT_ENTRY(sock),
	SCTP_DBG_OBJCNT_ENTRY(ep),
	SCTP_DBG_OBJCNT_ENTRY(ep),
	SCTP_DBG_OBJCNT_ENTRY(assoc),
	SCTP_DBG_OBJCNT_ENTRY(assoc),
Loading