/********************************************************************************************************************************/ /* Created: 3-Nov-2009 13:11:42 by OpenVMS SDL EV2-3 */ /* Source: 03-NOV-2009 13:11:18 DISK$SYSMAN:[LAISHEV.WORK.SCTP]SCTPDEF.SDL;13 */ /********************************************************************************************************************************/ /*** MODULE SCTPDEF IDENT SCTPDEF-1-X ***/ #ifndef __SCTPDEF_LOADED #define __SCTPDEF_LOADED 1 #pragma __nostandard /* This file uses non-ANSI-Standard features */ #pragma __member_alignment __save #pragma __nomember_alignment #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __save /* Save the previously-defined required ptr size */ #pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */ #endif #ifdef __cplusplus extern "C" { #define __unknown_params ... #define __optional_params ... #else #define __unknown_params #define __optional_params ... #endif #ifndef __struct #if !defined(__VAXC) #define __struct struct #else #define __struct variant_struct #endif #endif #ifndef __union #if !defined(__VAXC) #define __union union #else #define __union variant_union #endif #endif /*++ */ /* */ /* Facility: Stream Control Transmission Protocol (SCTP) */ /* */ /* */ /* Abstract: Request for Comments: 2960 */ /* */ /* Author: Ruslan R. Laishev */ /* */ /* Creation Date: 03-NOV-2009 */ /* */ /* Modification History: */ /* */ /*-- */ #ifdef __NEW_STARLET typedef struct _sctp_tlv { unsigned short int sctp$w_tag; unsigned short int sctp$w_len; __union { unsigned char sctp$b_val [1]; unsigned short int sctp$w_val [1]; unsigned int sctp$l_val [1]; } sctp$r_val; } SCTP_TLV; #if !defined(__VAXC) #define sctp$b_val sctp$r_val.sctp$b_val #define sctp$w_val sctp$r_val.sctp$w_val #define sctp$l_val sctp$r_val.sctp$l_val #endif /* #if !defined(__VAXC) */ #else /* __OLD_STARLET */ struct sctp_tlv { unsigned short int sctp$w_tag; unsigned short int sctp$w_len; __union { unsigned char sctp$b_val [1]; unsigned short int sctp$w_val [1]; unsigned int sctp$l_val [1]; } sctp$r_val; } ; #if !defined(__VAXC) #define sctp$b_val sctp$r_val.sctp$b_val #define sctp$w_val sctp$r_val.sctp$w_val #define sctp$l_val sctp$r_val.sctp$l_val #endif /* #if !defined(__VAXC) */ #endif /* #ifdef __NEW_STARLET */ /* */ /* SCTP connection states */ /* */ #define SCTP$STATE_CLOSED 1 #define SCTP$STATE_CWAIT 1 #define SCTP$STATE_CECHOED 1 #define SCTP$STATE_ESTAB 1 #define SCTP$STATE_SHUTPND 1 #define SCTP$STATE_SHUTRCVD 1 #define SCTP$STATE_SHUTSENT 1 #define SCTP$STATE_SHUTACKED 1 /* */ /* SCTP chunk types */ /* */ #define SCTP$TYPE_DATA 0 #define SCTP$TYPE_INIT 1 #define SCTP$TYPE_INITACK 2 #define SCTP$TYPE_SACK 3 #define SCTP$TYPE_HBEAT 4 #define SCTP$TYPE_HBEATACK 5 #define SCTP$TYPE_ABORT 6 #define SCTP$TYPE_SHUT 7 #define SCTP$TYPE_SHUTACK 8 #define SCTP$TYPE_ERROR 9 #define SCTP$TYPE_CECHO 10 #define SCTP$TYPE_CACK 11 #define SCTP$TYPE_ECNE 12 #define SCTP$TYPE_CWR 13 #define SCTP$TYPE_SHUTED 14 #define SCTP$K_SZ 4 #ifdef __NEW_STARLET typedef struct _sctp_hdr { unsigned char sctp$b_type; /* See SCTP$TYPE* constant */ unsigned char sctp$b_flags; unsigned short int sctp$w_len; unsigned char sctp$b_data [1]; } SCTP_HDR; #else /* __OLD_STARLET */ struct sctp_hdr { unsigned char sctp$b_type; /* See SCTP$TYPE* constant */ unsigned char sctp$b_flags; unsigned short int sctp$w_len; unsigned char sctp$b_data [1]; } ; #endif /* #ifdef __NEW_STARLET */ /* */ /* SCTP Packet structure */ /* */ #define SCTP$K_SZ 12 #ifdef __NEW_STARLET typedef struct _sctp_pkt { unsigned short int sctp$w_spn; unsigned short int sctp$w_dpn; unsigned int sctp$l_vtag; unsigned int sctp$l_csum; SCTP_HDR sctp$r_data [1]; } SCTP_PKT; #else /* __OLD_STARLET */ struct sctp_pkt { unsigned short int sctp$w_spn; unsigned short int sctp$w_dpn; unsigned int sctp$l_vtag; unsigned int sctp$l_csum; struct sctp_hdr sctp$r_data [1]; } ; #endif /* #ifdef __NEW_STARLET */ /* */ /* Payload Data (DATA) (0) */ /* */ #define DATA$FATA_MIDDLE 0 /* Middle piece of a fragmented user message */ #define DATA$FATA_LAST 1 /* Last piece of a fragmented user message */ #define DATA$FATA_FIRST 2 /* First piece of a fragmented user message */ #define DATA$FATA_UNFRAG 3 /* Unfragmented Message */ #define CHUNK$K_SZ 12 #ifdef __NEW_STARLET typedef struct _sctp_data { unsigned int chunk$l_tsn; unsigned short int chunk$w_stream; /* Stream Identifier S */ unsigned short int chunk$w_seq; /* Stream Sequence Number n */ unsigned int chunk$l_proto; /* Payload Protocol Identifier */ unsigned char chunk$b_data [1]; /* User Data (seq n of Stream S) */ } SCTP_DATA; #else /* __OLD_STARLET */ struct sctp_data { unsigned int chunk$l_tsn; unsigned short int chunk$w_stream; /* Stream Identifier S */ unsigned short int chunk$w_seq; /* Stream Sequence Number n */ unsigned int chunk$l_proto; /* Payload Protocol Identifier */ unsigned char chunk$b_data [1]; /* User Data (seq n of Stream S) */ } ; #endif /* #ifdef __NEW_STARLET */ /* */ /* Initiation (INIT) (1) */ /* Initiation Acknowledgement (INIT ACK) (2) */ /* */ #ifdef __NEW_STARLET typedef struct _sctp_init { unsigned int chunk$l_initag; unsigned int chunk$l_a_rwnd; unsigned short int chunk$w_os; unsigned short int chunk$w_mis; unsigned int chunk$l_itsn; SCTP_TLV chunk$r_opts; } SCTP_INIT; #else /* __OLD_STARLET */ struct sctp_init { unsigned int chunk$l_initag; unsigned int chunk$l_a_rwnd; unsigned short int chunk$w_os; unsigned short int chunk$w_mis; unsigned int chunk$l_itsn; struct sctp_tlv chunk$r_opts; } ; #endif /* #ifdef __NEW_STARLET */ /* */ /* Selective Acknowledgement (SACK) (3) */ /* */ #ifdef __NEW_STARLET typedef struct _sctp_gap { unsigned short int chunk$w_bstart; unsigned short int chunk$w_bend; } SCTP_GAP; #else /* __OLD_STARLET */ struct sctp_gap { unsigned short int chunk$w_bstart; unsigned short int chunk$w_bend; } ; #endif /* #ifdef __NEW_STARLET */ #ifdef __NEW_STARLET typedef struct _sctp_sack { unsigned int chunk$l_tsn; unsigned int chunk$l_a_rwnd; unsigned short int chunk$w_nack; unsigned short int chunk$w_ndup; SCTP_GAP chunk$r_gap [1]; } SCTP_SACK; #else /* __OLD_STARLET */ struct sctp_sack { unsigned int chunk$l_tsn; unsigned int chunk$l_a_rwnd; unsigned short int chunk$w_nack; unsigned short int chunk$w_ndup; struct sctp_gap chunk$r_gap [1]; } ; #endif /* #ifdef __NEW_STARLET */ /* */ /* Heartbeat Request (HEARTBEAT) (4) */ /* Heartbeat Acknowledgement (HEARTBEAT ACK) (5) */ /* */ #ifdef __NEW_STARLET typedef struct _sctp_heartbeat { SCTP_TLV chunk$r_opts; } SCTP_HEARTBEAT; #else /* __OLD_STARLET */ struct sctp_heartbeat { struct sctp_tlv chunk$r_opts; } ; #endif /* #ifdef __NEW_STARLET */ /* */ /* Abort Association (ABORT) (6) */ /* */ #ifdef __NEW_STARLET typedef struct _sctp_abort { SCTP_TLV chunk$r_errs; } SCTP_ABORT; #else /* __OLD_STARLET */ struct sctp_abort { struct sctp_tlv chunk$r_errs; } ; #endif /* #ifdef __NEW_STARLET */ /* */ /* Shutdown Association (SHUTDOWN) (7) */ /* Shutdown Acknowledgement (SHUTDOWN ACK) (8) - no TSN */ /* Shutdown Complete (SHUTDOWN COMPLETE) (14) - no TSN */ /* */ #ifdef __NEW_STARLET typedef struct _sctp_shut { unsigned int chunk$l_tsn; } SCTP_SHUT; #else /* __OLD_STARLET */ struct sctp_shut { unsigned int chunk$l_tsn; } ; #endif /* #ifdef __NEW_STARLET */ /* */ /* Operation Error (ERROR) (9) */ /* */ #ifdef __NEW_STARLET typedef struct _sctp_err { SCTP_TLV chunk$r_errs; } SCTP_ERR; #else /* __OLD_STARLET */ struct sctp_err { struct sctp_tlv chunk$r_errs; } ; #endif /* #ifdef __NEW_STARLET */ /* */ /* Cookie Echo (COOKIE ECHO) (10) */ /* Cookie Acknowledgement (COOKIE ACK) (11) - no Cookie */ /* */ #ifdef __NEW_STARLET typedef struct _sctp_echo { SCTP_TLV chunk$r_cookie; } SCTP_ECHO; #else /* __OLD_STARLET */ struct sctp_echo { struct sctp_tlv chunk$r_cookie; } ; #endif /* #ifdef __NEW_STARLET */ #pragma __member_alignment __restore #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */ #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __SCTPDEF_LOADED */