1/* 2 * Copyright (c) 2012-2013 Apple Inc. All rights reserved. 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 34#define FLOW_DIVERT_PKT_CONNECT 1 35#define FLOW_DIVERT_PKT_CONNECT_RESULT 2 36#define FLOW_DIVERT_PKT_DATA 3 37#define FLOW_DIVERT_PKT_CLOSE 4 38#define FLOW_DIVERT_PKT_READ_NOTIFY 5 39#define FLOW_DIVERT_PKT_GROUP_INIT 6 40#define FLOW_DIVERT_PKT_PROPERTIES_UPDATE 7 41#define FLOW_DIVERT_PKT_APP_MAP_UPDATE 8 42#define FLOW_DIVERT_PKT_APP_MAP_CREATE 9 43 44#define FLOW_DIVERT_TLV_NIL 0 45#define FLOW_DIVERT_TLV_ERROR_CODE 5 46#define FLOW_DIVERT_TLV_HOW 7 47#define FLOW_DIVERT_TLV_READ_COUNT 8 48#define FLOW_DIVERT_TLV_SPACE_AVAILABLE 9 49#define FLOW_DIVERT_TLV_CTL_UNIT 10 50#define FLOW_DIVERT_TLV_LOCAL_ADDR 11 51#define FLOW_DIVERT_TLV_REMOTE_ADDR 12 52#define FLOW_DIVERT_TLV_OUT_IF_INDEX 13 53#define FLOW_DIVERT_TLV_TRAFFIC_CLASS 14 54#define FLOW_DIVERT_TLV_NO_CELLULAR 15 55#define FLOW_DIVERT_TLV_FLOW_ID 16 56#define FLOW_DIVERT_TLV_TOKEN_KEY 17 57#define FLOW_DIVERT_TLV_HMAC 18 58#define FLOW_DIVERT_TLV_KEY_UNIT 19 59#define FLOW_DIVERT_TLV_LOG_LEVEL 20 60#define FLOW_DIVERT_TLV_TARGET_HOSTNAME 21 61#define FLOW_DIVERT_TLV_TARGET_ADDRESS 22 62#define FLOW_DIVERT_TLV_TARGET_PORT 23 63#define FLOW_DIVERT_TLV_CDHASH 24 64#define FLOW_DIVERT_TLV_SIGNING_ID 25 65#define FLOW_DIVERT_TLV_PID 26 66#define FLOW_DIVERT_TLV_UUID 27 67#define FLOW_DIVERT_TLV_PREFIX_COUNT 28 68#define FLOW_DIVERT_TLV_FLAGS 29 69 70#define FLOW_DIVERT_CHUNK_SIZE 4096 71 72#define FLOW_DIVERT_TOKEN_GETOPT_MAX_SIZE 128 73 74#define FLOW_DIVERT_DNS_SERVICE_SIGNING_ID "com.apple.mDNSResponder" 75 76#define FLOW_DIVERT_TOKEN_FLAG_VALIDATED 0x0000001 77 78struct flow_divert_packet_header { 79 uint8_t packet_type; 80 uint32_t conn_id; 81}; 82 83#endif /* __FLOW_DIVERT_PROTO_H__ */ 84