sctp: Turn the enum socket options into defines

Recent attempt to remove deprecated socket options demonstrated
that removing options from the enum space will have severe
binary compatibility issues.  The reason is that it changes
the subsequent enum space and causes option values to be redefined.
To solve this, and to get rid of the ugly double statements for
every option, we simply convert to the #define scheme.

Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
This commit is contained in:
Vlad Yasevich 2009-11-23 15:53:59 -05:00
Родитель 245cba7e55
Коммит a5b03ad214
1 изменённых файлов: 42 добавлений и 81 удалений

Просмотреть файл

@ -60,88 +60,49 @@ typedef __s32 sctp_assoc_t;
/* The following symbols come from the Sockets API Extensions for /* The following symbols come from the Sockets API Extensions for
* SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>. * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>.
*/ */
enum sctp_optname { #define SCTP_RTOINFO 0
SCTP_RTOINFO, #define SCTP_ASSOCINFO 1
#define SCTP_RTOINFO SCTP_RTOINFO #define SCTP_INITMSG 2
SCTP_ASSOCINFO, #define SCTP_NODELAY 3 /* Get/set nodelay option. */
#define SCTP_ASSOCINFO SCTP_ASSOCINFO #define SCTP_AUTOCLOSE 4
SCTP_INITMSG, #define SCTP_SET_PEER_PRIMARY_ADDR 5
#define SCTP_INITMSG SCTP_INITMSG #define SCTP_PRIMARY_ADDR 6
SCTP_NODELAY, /* Get/set nodelay option. */ #define SCTP_ADAPTATION_LAYER 7
#define SCTP_NODELAY SCTP_NODELAY #define SCTP_DISABLE_FRAGMENTS 8
SCTP_AUTOCLOSE, #define SCTP_PEER_ADDR_PARAMS 9
#define SCTP_AUTOCLOSE SCTP_AUTOCLOSE #define SCTP_DEFAULT_SEND_PARAM 10
SCTP_SET_PEER_PRIMARY_ADDR, #define SCTP_EVENTS 11
#define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR #define SCTP_I_WANT_MAPPED_V4_ADDR 12 /* Turn on/off mapped v4 addresses */
SCTP_PRIMARY_ADDR, #define SCTP_MAXSEG 13 /* Get/set maximum fragment. */
#define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR #define SCTP_STATUS 14
SCTP_ADAPTATION_LAYER, #define SCTP_GET_PEER_ADDR_INFO 15
#define SCTP_ADAPTATION_LAYER SCTP_ADAPTATION_LAYER #define SCTP_DELAYED_ACK_TIME 16
SCTP_DISABLE_FRAGMENTS, #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME
#define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS #define SCTP_CONTEXT 17
SCTP_PEER_ADDR_PARAMS, #define SCTP_FRAGMENT_INTERLEAVE 18
#define SCTP_PEER_ADDR_PARAMS SCTP_PEER_ADDR_PARAMS #define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */
SCTP_DEFAULT_SEND_PARAM, #define SCTP_MAX_BURST 20 /* Set/Get max burst */
#define SCTP_DEFAULT_SEND_PARAM SCTP_DEFAULT_SEND_PARAM #define SCTP_AUTH_CHUNK 21 /* Set only: add a chunk type to authenticate */
SCTP_EVENTS, #define SCTP_HMAC_IDENT 22
#define SCTP_EVENTS SCTP_EVENTS #define SCTP_AUTH_KEY 23
SCTP_I_WANT_MAPPED_V4_ADDR, /* Turn on/off mapped v4 addresses */ #define SCTP_AUTH_ACTIVE_KEY 24
#define SCTP_I_WANT_MAPPED_V4_ADDR SCTP_I_WANT_MAPPED_V4_ADDR #define SCTP_AUTH_DELETE_KEY 25
SCTP_MAXSEG, /* Get/set maximum fragment. */ #define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */
#define SCTP_MAXSEG SCTP_MAXSEG #define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */
SCTP_STATUS, #define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
#define SCTP_STATUS SCTP_STATUS
SCTP_GET_PEER_ADDR_INFO,
#define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO
SCTP_DELAYED_ACK,
#define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK
#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK
SCTP_CONTEXT, /* Receive Context */
#define SCTP_CONTEXT SCTP_CONTEXT
SCTP_FRAGMENT_INTERLEAVE,
#define SCTP_FRAGMENT_INTERLEAVE SCTP_FRAGMENT_INTERLEAVE
SCTP_PARTIAL_DELIVERY_POINT, /* Set/Get partial delivery point */
#define SCTP_PARTIAL_DELIVERY_POINT SCTP_PARTIAL_DELIVERY_POINT
SCTP_MAX_BURST, /* Set/Get max burst */
#define SCTP_MAX_BURST SCTP_MAX_BURST
SCTP_AUTH_CHUNK, /* Set only: add a chunk type to authenticat */
#define SCTP_AUTH_CHUNK SCTP_AUTH_CHUNK
SCTP_HMAC_IDENT,
#define SCTP_HMAC_IDENT SCTP_HMAC_IDENT
SCTP_AUTH_KEY,
#define SCTP_AUTH_KEY SCTP_AUTH_KEY
SCTP_AUTH_ACTIVE_KEY,
#define SCTP_AUTH_ACTIVE_KEY SCTP_AUTH_ACTIVE_KEY
SCTP_AUTH_DELETE_KEY,
#define SCTP_AUTH_DELETE_KEY SCTP_AUTH_DELETE_KEY
SCTP_PEER_AUTH_CHUNKS, /* Read only */
#define SCTP_PEER_AUTH_CHUNKS SCTP_PEER_AUTH_CHUNKS
SCTP_LOCAL_AUTH_CHUNKS, /* Read only */
#define SCTP_LOCAL_AUTH_CHUNKS SCTP_LOCAL_AUTH_CHUNKS
SCTP_GET_ASSOC_NUMBER, /* Read only */
#define SCTP_GET_ASSOC_NUMBER SCTP_GET_ASSOC_NUMBER
/* Internal Socket Options. Some of the sctp library functions are
/* Internal Socket Options. Some of the sctp library functions are * implemented using these socket options.
* implemented using these socket options. */
*/ #define SCTP_SOCKOPT_BINDX_ADD 100 /* BINDX requests for adding addrs */
SCTP_SOCKOPT_BINDX_ADD = 100,/* BINDX requests for adding addresses. */ #define SCTP_SOCKOPT_BINDX_REM 101 /* BINDX requests for removing addrs. */
#define SCTP_SOCKOPT_BINDX_ADD SCTP_SOCKOPT_BINDX_ADD #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */
SCTP_SOCKOPT_BINDX_REM, /* BINDX requests for removing addresses. */ /* Options 104-106 are deprecated and removed. Do not use this space */
#define SCTP_SOCKOPT_BINDX_REM SCTP_SOCKOPT_BINDX_REM #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */
SCTP_SOCKOPT_PEELOFF, /* peel off association. */ #define SCTP_GET_PEER_ADDRS 108 /* Get all peer addresss. */
#define SCTP_SOCKOPT_PEELOFF SCTP_SOCKOPT_PEELOFF #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local addresss. */
SCTP_SOCKOPT_CONNECTX_OLD, /* CONNECTX old requests. */ #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
#define SCTP_SOCKOPT_CONNECTX_OLD SCTP_SOCKOPT_CONNECTX_OLD #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */
#define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS
SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */
#define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS
SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */
#define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX
SCTP_SOCKOPT_CONNECTX3, /* CONNECTX requests. (new implementation) */
#define SCTP_SOCKOPT_CONNECTX3 SCTP_SOCKOPT_CONNECTX3
};
/* /*
* 5.2.1 SCTP Initiation Structure (SCTP_INIT) * 5.2.1 SCTP Initiation Structure (SCTP_INIT)