aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2009-11-23 15:53:59 -0500
committerVlad Yasevich <vladislav.yasevich@hp.com>2009-11-23 15:53:59 -0500
commita5b03ad2143c5bc9ae76533e8321fe66258b4f35 (patch)
tree3c726dd6fd3d6d3bb711711018ea4808eb791e51 /include
parent245cba7e55929dc2b10b7d915bfba0168eeeed17 (diff)
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>
Diffstat (limited to 'include')
-rw-r--r--include/net/sctp/user.h125
1 files changed, 43 insertions, 82 deletions
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index fceab4d2413e..2b2769c5ca9f 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -60,88 +60,49 @@ typedef __s32 sctp_assoc_t;
60/* The following symbols come from the Sockets API Extensions for 60/* The following symbols come from the Sockets API Extensions for
61 * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>. 61 * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>.
62 */ 62 */
63enum sctp_optname { 63#define SCTP_RTOINFO 0
64 SCTP_RTOINFO, 64#define SCTP_ASSOCINFO 1
65#define SCTP_RTOINFO SCTP_RTOINFO 65#define SCTP_INITMSG 2
66 SCTP_ASSOCINFO, 66#define SCTP_NODELAY 3 /* Get/set nodelay option. */
67#define SCTP_ASSOCINFO SCTP_ASSOCINFO 67#define SCTP_AUTOCLOSE 4
68 SCTP_INITMSG, 68#define SCTP_SET_PEER_PRIMARY_ADDR 5
69#define SCTP_INITMSG SCTP_INITMSG 69#define SCTP_PRIMARY_ADDR 6
70 SCTP_NODELAY, /* Get/set nodelay option. */ 70#define SCTP_ADAPTATION_LAYER 7
71#define SCTP_NODELAY SCTP_NODELAY 71#define SCTP_DISABLE_FRAGMENTS 8
72 SCTP_AUTOCLOSE, 72#define SCTP_PEER_ADDR_PARAMS 9
73#define SCTP_AUTOCLOSE SCTP_AUTOCLOSE 73#define SCTP_DEFAULT_SEND_PARAM 10
74 SCTP_SET_PEER_PRIMARY_ADDR, 74#define SCTP_EVENTS 11
75#define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR 75#define SCTP_I_WANT_MAPPED_V4_ADDR 12 /* Turn on/off mapped v4 addresses */
76 SCTP_PRIMARY_ADDR, 76#define SCTP_MAXSEG 13 /* Get/set maximum fragment. */
77#define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR 77#define SCTP_STATUS 14
78 SCTP_ADAPTATION_LAYER, 78#define SCTP_GET_PEER_ADDR_INFO 15
79#define SCTP_ADAPTATION_LAYER SCTP_ADAPTATION_LAYER 79#define SCTP_DELAYED_ACK_TIME 16
80 SCTP_DISABLE_FRAGMENTS, 80#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME
81#define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS 81#define SCTP_CONTEXT 17
82 SCTP_PEER_ADDR_PARAMS, 82#define SCTP_FRAGMENT_INTERLEAVE 18
83#define SCTP_PEER_ADDR_PARAMS SCTP_PEER_ADDR_PARAMS 83#define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */
84 SCTP_DEFAULT_SEND_PARAM, 84#define SCTP_MAX_BURST 20 /* Set/Get max burst */
85#define SCTP_DEFAULT_SEND_PARAM SCTP_DEFAULT_SEND_PARAM 85#define SCTP_AUTH_CHUNK 21 /* Set only: add a chunk type to authenticate */
86 SCTP_EVENTS, 86#define SCTP_HMAC_IDENT 22
87#define SCTP_EVENTS SCTP_EVENTS 87#define SCTP_AUTH_KEY 23
88 SCTP_I_WANT_MAPPED_V4_ADDR, /* Turn on/off mapped v4 addresses */ 88#define SCTP_AUTH_ACTIVE_KEY 24
89#define SCTP_I_WANT_MAPPED_V4_ADDR SCTP_I_WANT_MAPPED_V4_ADDR 89#define SCTP_AUTH_DELETE_KEY 25
90 SCTP_MAXSEG, /* Get/set maximum fragment. */ 90#define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */
91#define SCTP_MAXSEG SCTP_MAXSEG 91#define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */
92 SCTP_STATUS, 92#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
93#define SCTP_STATUS SCTP_STATUS 93
94 SCTP_GET_PEER_ADDR_INFO, 94/* Internal Socket Options. Some of the sctp library functions are
95#define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO 95 * implemented using these socket options.
96 SCTP_DELAYED_ACK, 96 */
97#define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK 97#define SCTP_SOCKOPT_BINDX_ADD 100 /* BINDX requests for adding addrs */
98#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK 98#define SCTP_SOCKOPT_BINDX_REM 101 /* BINDX requests for removing addrs. */
99 SCTP_CONTEXT, /* Receive Context */ 99#define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */
100#define SCTP_CONTEXT SCTP_CONTEXT 100/* Options 104-106 are deprecated and removed. Do not use this space */
101 SCTP_FRAGMENT_INTERLEAVE, 101#define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */
102#define SCTP_FRAGMENT_INTERLEAVE SCTP_FRAGMENT_INTERLEAVE 102#define SCTP_GET_PEER_ADDRS 108 /* Get all peer addresss. */
103 SCTP_PARTIAL_DELIVERY_POINT, /* Set/Get partial delivery point */ 103#define SCTP_GET_LOCAL_ADDRS 109 /* Get all local addresss. */
104#define SCTP_PARTIAL_DELIVERY_POINT SCTP_PARTIAL_DELIVERY_POINT 104#define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
105 SCTP_MAX_BURST, /* Set/Get max burst */ 105#define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
106#define SCTP_MAX_BURST SCTP_MAX_BURST
107 SCTP_AUTH_CHUNK, /* Set only: add a chunk type to authenticat */
108#define SCTP_AUTH_CHUNK SCTP_AUTH_CHUNK
109 SCTP_HMAC_IDENT,
110#define SCTP_HMAC_IDENT SCTP_HMAC_IDENT
111 SCTP_AUTH_KEY,
112#define SCTP_AUTH_KEY SCTP_AUTH_KEY
113 SCTP_AUTH_ACTIVE_KEY,
114#define SCTP_AUTH_ACTIVE_KEY SCTP_AUTH_ACTIVE_KEY
115 SCTP_AUTH_DELETE_KEY,
116#define SCTP_AUTH_DELETE_KEY SCTP_AUTH_DELETE_KEY
117 SCTP_PEER_AUTH_CHUNKS, /* Read only */
118#define SCTP_PEER_AUTH_CHUNKS SCTP_PEER_AUTH_CHUNKS
119 SCTP_LOCAL_AUTH_CHUNKS, /* Read only */
120#define SCTP_LOCAL_AUTH_CHUNKS SCTP_LOCAL_AUTH_CHUNKS
121 SCTP_GET_ASSOC_NUMBER, /* Read only */
122#define SCTP_GET_ASSOC_NUMBER SCTP_GET_ASSOC_NUMBER
123
124
125 /* Internal Socket Options. Some of the sctp library functions are
126 * implemented using these socket options.
127 */
128 SCTP_SOCKOPT_BINDX_ADD = 100,/* BINDX requests for adding addresses. */
129#define SCTP_SOCKOPT_BINDX_ADD SCTP_SOCKOPT_BINDX_ADD
130 SCTP_SOCKOPT_BINDX_REM, /* BINDX requests for removing addresses. */
131#define SCTP_SOCKOPT_BINDX_REM SCTP_SOCKOPT_BINDX_REM
132 SCTP_SOCKOPT_PEELOFF, /* peel off association. */
133#define SCTP_SOCKOPT_PEELOFF SCTP_SOCKOPT_PEELOFF
134 SCTP_SOCKOPT_CONNECTX_OLD, /* CONNECTX old requests. */
135#define SCTP_SOCKOPT_CONNECTX_OLD SCTP_SOCKOPT_CONNECTX_OLD
136 SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */
137#define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS
138 SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */
139#define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS
140 SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */
141#define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX
142 SCTP_SOCKOPT_CONNECTX3, /* CONNECTX requests. (new implementation) */
143#define SCTP_SOCKOPT_CONNECTX3 SCTP_SOCKOPT_CONNECTX3
144};
145 106
146/* 107/*
147 * 5.2.1 SCTP Initiation Structure (SCTP_INIT) 108 * 5.2.1 SCTP Initiation Structure (SCTP_INIT)