]>
Commit | Line | Data |
---|---|---|
39236c6e | 1 | /* |
5ba3f43e | 2 | * Copyright (c) 2012-2017 Apple Inc. All rights reserved. |
39236c6e A |
3 | * |
4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ | |
0a7de745 | 5 | * |
39236c6e A |
6 | * This file contains Original Code and/or Modifications of Original Code |
7 | * as defined in and that are subject to the Apple Public Source License | |
8 | * Version 2.0 (the 'License'). You may not use this file except in | |
9 | * compliance with the License. The rights granted to you under the License | |
10 | * may not be used to create, or enable the creation or redistribution of, | |
11 | * unlawful or unlicensed copies of an Apple operating system, or to | |
12 | * circumvent, violate, or enable the circumvention or violation of, any | |
13 | * terms of an Apple operating system software license agreement. | |
0a7de745 | 14 | * |
39236c6e A |
15 | * Please obtain a copy of the License at |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file. | |
0a7de745 | 17 | * |
39236c6e A |
18 | * The Original Code and all software distributed under the License are |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. | |
23 | * Please see the License for the specific language governing rights and | |
24 | * limitations under the License. | |
0a7de745 | 25 | * |
39236c6e A |
26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ |
27 | */ | |
28 | ||
29 | #ifndef __FLOW_DIVERT_PROTO_H__ | |
30 | #define __FLOW_DIVERT_PROTO_H__ | |
31 | ||
0a7de745 | 32 | #define FLOW_DIVERT_CONTROL_NAME "com.apple.flow-divert" |
39236c6e | 33 | |
0a7de745 | 34 | #define FLOW_DIVERT_TLV_LENGTH_UINT32 1 |
3e170ce0 | 35 | |
0a7de745 A |
36 | #define FLOW_DIVERT_PKT_CONNECT 1 |
37 | #define FLOW_DIVERT_PKT_CONNECT_RESULT 2 | |
38 | #define FLOW_DIVERT_PKT_DATA 3 | |
39 | #define FLOW_DIVERT_PKT_CLOSE 4 | |
40 | #define FLOW_DIVERT_PKT_READ_NOTIFY 5 | |
41 | #define FLOW_DIVERT_PKT_GROUP_INIT 6 | |
42 | #define FLOW_DIVERT_PKT_PROPERTIES_UPDATE 7 | |
43 | #define FLOW_DIVERT_PKT_APP_MAP_CREATE 9 | |
39236c6e | 44 | |
0a7de745 A |
45 | #define FLOW_DIVERT_TLV_NIL 0 |
46 | #define FLOW_DIVERT_TLV_ERROR_CODE 5 | |
47 | #define FLOW_DIVERT_TLV_HOW 7 | |
48 | #define FLOW_DIVERT_TLV_READ_COUNT 8 | |
49 | #define FLOW_DIVERT_TLV_SPACE_AVAILABLE 9 | |
50 | #define FLOW_DIVERT_TLV_CTL_UNIT 10 | |
51 | #define FLOW_DIVERT_TLV_LOCAL_ADDR 11 | |
52 | #define FLOW_DIVERT_TLV_REMOTE_ADDR 12 | |
53 | #define FLOW_DIVERT_TLV_OUT_IF_INDEX 13 | |
54 | #define FLOW_DIVERT_TLV_TRAFFIC_CLASS 14 | |
55 | #define FLOW_DIVERT_TLV_NO_CELLULAR 15 | |
56 | #define FLOW_DIVERT_TLV_FLOW_ID 16 | |
57 | #define FLOW_DIVERT_TLV_TOKEN_KEY 17 | |
58 | #define FLOW_DIVERT_TLV_HMAC 18 | |
59 | #define FLOW_DIVERT_TLV_KEY_UNIT 19 | |
60 | #define FLOW_DIVERT_TLV_LOG_LEVEL 20 | |
61 | #define FLOW_DIVERT_TLV_TARGET_HOSTNAME 21 | |
62 | #define FLOW_DIVERT_TLV_TARGET_ADDRESS 22 | |
63 | #define FLOW_DIVERT_TLV_TARGET_PORT 23 | |
64 | #define FLOW_DIVERT_TLV_CDHASH 24 | |
65 | #define FLOW_DIVERT_TLV_SIGNING_ID 25 | |
66 | #define FLOW_DIVERT_TLV_PID 26 | |
67 | #define FLOW_DIVERT_TLV_UUID 27 | |
68 | #define FLOW_DIVERT_TLV_PREFIX_COUNT 28 | |
69 | #define FLOW_DIVERT_TLV_FLAGS 29 | |
3e170ce0 | 70 | #define FLOW_DIVERT_TLV_FLOW_TYPE 30 |
0a7de745 | 71 | #define FLOW_DIVERT_TLV_APP_DATA 31 |
cb323159 | 72 | #define FLOW_DIVERT_TLV_APP_AUDIT_TOKEN 32 |
3e170ce0 A |
73 | |
74 | #define FLOW_DIVERT_FLOW_TYPE_TCP 1 | |
75 | #define FLOW_DIVERT_FLOW_TYPE_UDP 3 | |
39236c6e | 76 | |
0a7de745 | 77 | #define FLOW_DIVERT_CHUNK_SIZE 4096 |
39236c6e | 78 | |
0a7de745 | 79 | #define FLOW_DIVERT_TOKEN_GETOPT_MAX_SIZE 128 |
39236c6e | 80 | |
0a7de745 A |
81 | #define FLOW_DIVERT_TOKEN_FLAG_VALIDATED 0x0000001 |
82 | #define FLOW_DIVERT_TOKEN_FLAG_TFO 0x0000002 | |
83 | #define FLOW_DIVERT_TOKEN_FLAG_MPTCP 0x0000004 | |
fe8ab488 | 84 | |
0a7de745 | 85 | #define FLOW_DIVERT_GROUP_FLAG_NO_APP_MAP 0x0000001 |
5ba3f43e | 86 | |
39236c6e | 87 | struct flow_divert_packet_header { |
0a7de745 A |
88 | uint8_t packet_type; |
89 | uint32_t conn_id; | |
39236c6e A |
90 | }; |
91 | ||
92 | #endif /* __FLOW_DIVERT_PROTO_H__ */ |