Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dccp.h
Go to the documentation of this file.
1 #ifndef _UAPI_LINUX_DCCP_H
2 #define _UAPI_LINUX_DCCP_H
3 
4 #include <linux/types.h>
5 #include <asm/byteorder.h>
6 
20 struct dccp_hdr {
24 #if defined(__LITTLE_ENDIAN_BITFIELD)
25  __u8 dccph_cscov:4,
26  dccph_ccval:4;
27 #elif defined(__BIG_ENDIAN_BITFIELD)
28  __u8 dccph_ccval:4,
29  dccph_cscov:4;
30 #else
31 #error "Adjust your <asm/byteorder.h> defines"
32 #endif
34 #if defined(__LITTLE_ENDIAN_BITFIELD)
35  __u8 dccph_x:1,
36  dccph_type:4,
37  dccph_reserved:3;
38 #elif defined(__BIG_ENDIAN_BITFIELD)
39  __u8 dccph_reserved:3,
40  dccph_type:4,
41  dccph_x:1;
42 #else
43 #error "Adjust your <asm/byteorder.h> defines"
44 #endif
47 };
48 
54 struct dccp_hdr_ext {
56 };
57 
65 };
76 };
86 };
87 
99 };
100 
113 };
114 
115 #define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID
116 
117 static inline unsigned int dccp_packet_hdr_len(const __u8 type)
118 {
119  if (type == DCCP_PKT_DATA)
120  return 0;
121  if (type == DCCP_PKT_DATAACK ||
122  type == DCCP_PKT_ACK ||
123  type == DCCP_PKT_SYNC ||
124  type == DCCP_PKT_SYNCACK ||
125  type == DCCP_PKT_CLOSE ||
126  type == DCCP_PKT_CLOSEREQ)
127  return sizeof(struct dccp_hdr_ack_bits);
128  if (type == DCCP_PKT_REQUEST)
129  return sizeof(struct dccp_hdr_request);
130  if (type == DCCP_PKT_RESPONSE)
131  return sizeof(struct dccp_hdr_response);
132  return sizeof(struct dccp_hdr_reset);
133 }
147 
148  DCCP_MAX_RESET_CODES /* Leave at the end! */
149 };
150 
151 /* DCCP options */
152 enum {
167  DCCPO_MAX = 45,
168  DCCPO_MIN_RX_CCID_SPECIFIC = 128, /* from sender to receiver */
170  DCCPO_MIN_TX_CCID_SPECIFIC = 192, /* from receiver to sender */
172 };
173 /* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */
174 #define DCCP_SINGLE_OPT_MAXLEN 253
175 
176 /* DCCP CCIDS */
177 enum {
180 };
181 
182 /* DCCP features (RFC 4340 section 6.4) */
194  /* 10-127 reserved */
196  DCCPF_SEND_LEV_RATE = 192, /* RFC 4342, sec. 8.4 */
198 };
199 
200 /* DCCP socket control message types for cmsg */
204  /* ^-- Up to here reserved exclusively for qpolicy parameters */
206 };
207 
208 /* DCCP priorities for outgoing/queued packets */
213 };
214 
215 /* DCCP socket options */
216 #define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */
217 #define DCCP_SOCKOPT_SERVICE 2
218 #define DCCP_SOCKOPT_CHANGE_L 3
219 #define DCCP_SOCKOPT_CHANGE_R 4
220 #define DCCP_SOCKOPT_GET_CUR_MPS 5
221 #define DCCP_SOCKOPT_SERVER_TIMEWAIT 6
222 #define DCCP_SOCKOPT_SEND_CSCOV 10
223 #define DCCP_SOCKOPT_RECV_CSCOV 11
224 #define DCCP_SOCKOPT_AVAILABLE_CCIDS 12
225 #define DCCP_SOCKOPT_CCID 13
226 #define DCCP_SOCKOPT_TX_CCID 14
227 #define DCCP_SOCKOPT_RX_CCID 15
228 #define DCCP_SOCKOPT_QPOLICY_ID 16
229 #define DCCP_SOCKOPT_QPOLICY_TXQLEN 17
230 #define DCCP_SOCKOPT_CCID_RX_INFO 128
231 #define DCCP_SOCKOPT_CCID_TX_INFO 192
232 
233 /* maximum number of services provided on the same listening port */
234 #define DCCP_SERVICE_LIST_MAX_LEN 32
235 
236 
237 #endif /* _UAPI_LINUX_DCCP_H */