]> git.saurik.com Git - apple/xnu.git/blame - bsd/netinet/flow_divert_proto.h
xnu-3248.30.4.tar.gz
[apple/xnu.git] / bsd / netinet / flow_divert_proto.h
CommitLineData
39236c6e 1/*
3e170ce0 2 * Copyright (c) 2012-2015 Apple Inc. All rights reserved.
39236c6e
A
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
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.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
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.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29#ifndef __FLOW_DIVERT_PROTO_H__
30#define __FLOW_DIVERT_PROTO_H__
31
32#define FLOW_DIVERT_CONTROL_NAME "com.apple.flow-divert"
33
3e170ce0
A
34#define FLOW_DIVERT_TLV_LENGTH_UINT32 1
35
39236c6e
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_UPDATE 8
44#define FLOW_DIVERT_PKT_APP_MAP_CREATE 9
45
46#define FLOW_DIVERT_TLV_NIL 0
47#define FLOW_DIVERT_TLV_ERROR_CODE 5
48#define FLOW_DIVERT_TLV_HOW 7
49#define FLOW_DIVERT_TLV_READ_COUNT 8
50#define FLOW_DIVERT_TLV_SPACE_AVAILABLE 9
51#define FLOW_DIVERT_TLV_CTL_UNIT 10
52#define FLOW_DIVERT_TLV_LOCAL_ADDR 11
53#define FLOW_DIVERT_TLV_REMOTE_ADDR 12
54#define FLOW_DIVERT_TLV_OUT_IF_INDEX 13
55#define FLOW_DIVERT_TLV_TRAFFIC_CLASS 14
56#define FLOW_DIVERT_TLV_NO_CELLULAR 15
57#define FLOW_DIVERT_TLV_FLOW_ID 16
58#define FLOW_DIVERT_TLV_TOKEN_KEY 17
59#define FLOW_DIVERT_TLV_HMAC 18
60#define FLOW_DIVERT_TLV_KEY_UNIT 19
61#define FLOW_DIVERT_TLV_LOG_LEVEL 20
62#define FLOW_DIVERT_TLV_TARGET_HOSTNAME 21
63#define FLOW_DIVERT_TLV_TARGET_ADDRESS 22
64#define FLOW_DIVERT_TLV_TARGET_PORT 23
65#define FLOW_DIVERT_TLV_CDHASH 24
66#define FLOW_DIVERT_TLV_SIGNING_ID 25
67#define FLOW_DIVERT_TLV_PID 26
68#define FLOW_DIVERT_TLV_UUID 27
69#define FLOW_DIVERT_TLV_PREFIX_COUNT 28
fe8ab488 70#define FLOW_DIVERT_TLV_FLAGS 29
3e170ce0
A
71#define FLOW_DIVERT_TLV_FLOW_TYPE 30
72
73#define FLOW_DIVERT_FLOW_TYPE_TCP 1
74#define FLOW_DIVERT_FLOW_TYPE_UDP 3
39236c6e
A
75
76#define FLOW_DIVERT_CHUNK_SIZE 4096
77
78#define FLOW_DIVERT_TOKEN_GETOPT_MAX_SIZE 128
79
80#define FLOW_DIVERT_DNS_SERVICE_SIGNING_ID "com.apple.mDNSResponder"
81
fe8ab488
A
82#define FLOW_DIVERT_TOKEN_FLAG_VALIDATED 0x0000001
83
39236c6e
A
84struct flow_divert_packet_header {
85 uint8_t packet_type;
86 uint32_t conn_id;
87};
88
89#endif /* __FLOW_DIVERT_PROTO_H__ */