From 1cd5c5dd060ed74ed2778ad4f459ed32f0ad4a8a Mon Sep 17 00:00:00 2001 From: rrs Date: Tue, 12 Jun 2007 11:21:00 +0000 Subject: - Restructure so bindx functions are not done inline to socket option but are a seperate call that can be re-used if needed. - 64 bit issues o re-arrange cookie so it is better 64 bit aligned o For wire level things we need the packed attribute. --- sys/netinet/sctp.h | 103 +++++++++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 47 deletions(-) (limited to 'sys/netinet/sctp.h') diff --git a/sys/netinet/sctp.h b/sys/netinet/sctp.h index f0d08cf..c11fa34 100644 --- a/sys/netinet/sctp.h +++ b/sys/netinet/sctp.h @@ -47,25 +47,27 @@ struct sctphdr { uint32_t v_tag; /* verification tag of packet */ uint32_t checksum; /* Adler32 C-Sum */ /* chunks follow... */ -}; +} + +__attribute__((packed)); /* * SCTP Chunks */ -struct sctp_chunkhdr { - uint8_t chunk_type; /* chunk type */ - uint8_t chunk_flags; /* chunk flags */ - uint16_t chunk_length; /* chunk length */ - /* optional params follow */ -}; + struct sctp_chunkhdr { + uint8_t chunk_type; /* chunk type */ + uint8_t chunk_flags; /* chunk flags */ + uint16_t chunk_length; /* chunk length */ + /* optional params follow */ + } __attribute__((packed)); /* * SCTP chunk parameters */ -struct sctp_paramhdr { - uint16_t param_type; /* parameter type */ - uint16_t param_length; /* parameter length */ -}; + struct sctp_paramhdr { + uint16_t param_type; /* parameter type */ + uint16_t param_length; /* parameter length */ + } __attribute__((packed)); /* * user socket options: socket API defined @@ -290,42 +292,49 @@ struct sctp_paramhdr { /* * error cause parameters (user visisble) */ -struct sctp_error_cause { - uint16_t code; - uint16_t length; - /* optional cause-specific info may follow */ -}; - -struct sctp_error_invalid_stream { - struct sctp_error_cause cause; /* code=SCTP_ERROR_INVALID_STREAM */ - uint16_t stream_id; /* stream id of the DATA in error */ - uint16_t reserved; -}; - -struct sctp_error_missing_param { - struct sctp_error_cause cause; /* code=SCTP_ERROR_MISSING_PARAM */ - uint32_t num_missing_params; /* number of missing parameters */ - /* uint16_t param_type's follow */ -}; - -struct sctp_error_stale_cookie { - struct sctp_error_cause cause; /* code=SCTP_ERROR_STALE_COOKIE */ - uint32_t stale_time; /* time in usec of staleness */ -}; - -struct sctp_error_out_of_resource { - struct sctp_error_cause cause; /* code=SCTP_ERROR_OUT_OF_RESOURCES */ -}; - -struct sctp_error_unresolv_addr { - struct sctp_error_cause cause; /* code=SCTP_ERROR_UNRESOLVABLE_ADDR */ - -}; - -struct sctp_error_unrecognized_chunk { - struct sctp_error_cause cause; /* code=SCTP_ERROR_UNRECOG_CHUNK */ - struct sctp_chunkhdr ch;/* header from chunk in error */ -}; + struct sctp_error_cause { + uint16_t code; + uint16_t length; + /* optional cause-specific info may follow */ + } __attribute__((packed)); + + struct sctp_error_invalid_stream { + struct sctp_error_cause cause; /* code=SCTP_ERROR_INVALID_STRE + * AM */ + uint16_t stream_id; /* stream id of the DATA in error */ + uint16_t reserved; + } __attribute__((packed)); + + struct sctp_error_missing_param { + struct sctp_error_cause cause; /* code=SCTP_ERROR_MISSING_PARA + * M */ + uint32_t num_missing_params; /* number of missing + * parameters */ + /* uint16_t param_type's follow */ + } __attribute__((packed)); + + struct sctp_error_stale_cookie { + struct sctp_error_cause cause; /* code=SCTP_ERROR_STALE_COOKIE + * */ + uint32_t stale_time; /* time in usec of staleness */ + } __attribute__((packed)); + + struct sctp_error_out_of_resource { + struct sctp_error_cause cause; /* code=SCTP_ERROR_OUT_OF_RESOU + * RCES */ + } __attribute__((packed)); + + struct sctp_error_unresolv_addr { + struct sctp_error_cause cause; /* code=SCTP_ERROR_UNRESOLVABLE + * _ADDR */ + + } __attribute__((packed)); + + struct sctp_error_unrecognized_chunk { + struct sctp_error_cause cause; /* code=SCTP_ERROR_UNRECOG_CHUN + * K */ + struct sctp_chunkhdr ch; /* header from chunk in error */ + } __attribute__((packed)); #define HAVE_SCTP 1 #define HAVE_KERNEL_SCTP 1 -- cgit v1.1