1 /*
2 * This header was generated from the Linux kernel headers by update_headers.py,
3 * to provide necessary information from kernel to userspace, such as constants,
4 * structures, and macros, and thus, contains no copyrightable information.
5 */
6 #ifndef _UAPI_LINUX_DCCP_H
7 #define _UAPI_LINUX_DCCP_H
8 #include <linux/types.h>
9 #include <asm/byteorder.h>
10 struct dccp_hdr {
11 __be16 dccph_sport,
12 dccph_dport;
13 __u8 dccph_doff;
14 #if defined(__LITTLE_ENDIAN_BITFIELD)
15 __u8 dccph_cscov:4,
16 dccph_ccval:4;
17 #elif defined(__BIG_ENDIAN_BITFIELD)
18 __u8 dccph_ccval:4,
19 dccph_cscov:4;
20 #else
21 #error "Adjust your <asm/byteorder.h> defines"
22 #endif
23 __sum16 dccph_checksum;
24 #if defined(__LITTLE_ENDIAN_BITFIELD)
25 __u8 dccph_x:1,
26 dccph_type:4,
27 dccph_reserved:3;
28 #elif defined(__BIG_ENDIAN_BITFIELD)
29 __u8 dccph_reserved:3,
30 dccph_type:4,
31 dccph_x:1;
32 #else
33 #error "Adjust your <asm/byteorder.h> defines"
34 #endif
35 __u8 dccph_seq2;
36 __be16 dccph_seq;
37 };
38 struct dccp_hdr_ext {
39 __be32 dccph_seq_low;
40 };
41 struct dccp_hdr_request {
42 __be32 dccph_req_service;
43 };
44 struct dccp_hdr_ack_bits {
45 __be16 dccph_reserved1;
46 __be16 dccph_ack_nr_high;
47 __be32 dccph_ack_nr_low;
48 };
49 struct dccp_hdr_response {
50 struct dccp_hdr_ack_bits dccph_resp_ack;
51 __be32 dccph_resp_service;
52 };
53 struct dccp_hdr_reset {
54 struct dccp_hdr_ack_bits dccph_reset_ack;
55 __u8 dccph_reset_code,
56 dccph_reset_data[3];
57 };
58 enum dccp_pkt_type {
59 DCCP_PKT_REQUEST = 0,
60 DCCP_PKT_RESPONSE,
61 DCCP_PKT_DATA,
62 DCCP_PKT_ACK,
63 DCCP_PKT_DATAACK,
64 DCCP_PKT_CLOSEREQ,
65 DCCP_PKT_CLOSE,
66 DCCP_PKT_RESET,
67 DCCP_PKT_SYNC,
68 DCCP_PKT_SYNCACK,
69 DCCP_PKT_INVALID,
70 };
71 #define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID
dccp_packet_hdr_len(const __u8 type)72 static inline unsigned int dccp_packet_hdr_len(const __u8 type)
73 {
74 if (type == DCCP_PKT_DATA)
75 return 0;
76 if (type == DCCP_PKT_DATAACK ||
77 type == DCCP_PKT_ACK ||
78 type == DCCP_PKT_SYNC ||
79 type == DCCP_PKT_SYNCACK ||
80 type == DCCP_PKT_CLOSE ||
81 type == DCCP_PKT_CLOSEREQ)
82 return sizeof(struct dccp_hdr_ack_bits);
83 if (type == DCCP_PKT_REQUEST)
84 return sizeof(struct dccp_hdr_request);
85 if (type == DCCP_PKT_RESPONSE)
86 return sizeof(struct dccp_hdr_response);
87 return sizeof(struct dccp_hdr_reset);
88 }
89 enum dccp_reset_codes {
90 DCCP_RESET_CODE_UNSPECIFIED = 0,
91 DCCP_RESET_CODE_CLOSED,
92 DCCP_RESET_CODE_ABORTED,
93 DCCP_RESET_CODE_NO_CONNECTION,
94 DCCP_RESET_CODE_PACKET_ERROR,
95 DCCP_RESET_CODE_OPTION_ERROR,
96 DCCP_RESET_CODE_MANDATORY_ERROR,
97 DCCP_RESET_CODE_CONNECTION_REFUSED,
98 DCCP_RESET_CODE_BAD_SERVICE_CODE,
99 DCCP_RESET_CODE_TOO_BUSY,
100 DCCP_RESET_CODE_BAD_INIT_COOKIE,
101 DCCP_RESET_CODE_AGGRESSION_PENALTY,
102 DCCP_MAX_RESET_CODES
103 };
104 enum {
105 DCCPO_PADDING = 0,
106 DCCPO_MANDATORY = 1,
107 DCCPO_MIN_RESERVED = 3,
108 DCCPO_MAX_RESERVED = 31,
109 DCCPO_CHANGE_L = 32,
110 DCCPO_CONFIRM_L = 33,
111 DCCPO_CHANGE_R = 34,
112 DCCPO_CONFIRM_R = 35,
113 DCCPO_NDP_COUNT = 37,
114 DCCPO_ACK_VECTOR_0 = 38,
115 DCCPO_ACK_VECTOR_1 = 39,
116 DCCPO_TIMESTAMP = 41,
117 DCCPO_TIMESTAMP_ECHO = 42,
118 DCCPO_ELAPSED_TIME = 43,
119 DCCPO_MAX = 45,
120 DCCPO_MIN_RX_CCID_SPECIFIC = 128,
121 DCCPO_MAX_RX_CCID_SPECIFIC = 191,
122 DCCPO_MIN_TX_CCID_SPECIFIC = 192,
123 DCCPO_MAX_TX_CCID_SPECIFIC = 255,
124 };
125 #define DCCP_SINGLE_OPT_MAXLEN 253
126 enum {
127 DCCPC_CCID2 = 2,
128 DCCPC_CCID3 = 3,
129 };
130 enum dccp_feature_numbers {
131 DCCPF_RESERVED = 0,
132 DCCPF_CCID = 1,
133 DCCPF_SHORT_SEQNOS = 2,
134 DCCPF_SEQUENCE_WINDOW = 3,
135 DCCPF_ECN_INCAPABLE = 4,
136 DCCPF_ACK_RATIO = 5,
137 DCCPF_SEND_ACK_VECTOR = 6,
138 DCCPF_SEND_NDP_COUNT = 7,
139 DCCPF_MIN_CSUM_COVER = 8,
140 DCCPF_DATA_CHECKSUM = 9,
141
142 DCCPF_MIN_CCID_SPECIFIC = 128,
143 DCCPF_SEND_LEV_RATE = 192,
144 DCCPF_MAX_CCID_SPECIFIC = 255,
145 };
146 enum dccp_cmsg_type {
147 DCCP_SCM_PRIORITY = 1,
148 DCCP_SCM_QPOLICY_MAX = 0xFFFF,
149
150 DCCP_SCM_MAX
151 };
152 enum dccp_packet_dequeueing_policy {
153 DCCPQ_POLICY_SIMPLE,
154 DCCPQ_POLICY_PRIO,
155 DCCPQ_POLICY_MAX
156 };
157 #define DCCP_SOCKOPT_PACKET_SIZE 1
158 #define DCCP_SOCKOPT_SERVICE 2
159 #define DCCP_SOCKOPT_CHANGE_L 3
160 #define DCCP_SOCKOPT_CHANGE_R 4
161 #define DCCP_SOCKOPT_GET_CUR_MPS 5
162 #define DCCP_SOCKOPT_SERVER_TIMEWAIT 6
163 #define DCCP_SOCKOPT_SEND_CSCOV 10
164 #define DCCP_SOCKOPT_RECV_CSCOV 11
165 #define DCCP_SOCKOPT_AVAILABLE_CCIDS 12
166 #define DCCP_SOCKOPT_CCID 13
167 #define DCCP_SOCKOPT_TX_CCID 14
168 #define DCCP_SOCKOPT_RX_CCID 15
169 #define DCCP_SOCKOPT_QPOLICY_ID 16
170 #define DCCP_SOCKOPT_QPOLICY_TXQLEN 17
171 #define DCCP_SOCKOPT_CCID_RX_INFO 128
172 #define DCCP_SOCKOPT_CCID_TX_INFO 192
173 #define DCCP_SERVICE_LIST_MAX_LEN 32
174 #endif
175