peachsim 0.1.1667 → 0.1.1674
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cli/bridge-flow-runner.ts +4 -1
- package/cli/commands/coverage-swift.ts +291 -0
- package/cli/commands/coverage.ts +168 -24
- package/cli/commands/diagnose.ts +1 -19
- package/cli/commands/inspect/settling.ts +37 -4
- package/cli/commands/react.ts +3 -18
- package/cli/commands/screenshot.ts +1 -1
- package/cli/commands/screenshots-capture.ts +1 -1
- package/cli/drivers/playwright-provisioning.ts +1 -4
- package/cli/drivers/playwright.ts +15 -1
- package/cli/scene-video.ts +1 -1
- package/cli/ui.ts +20 -0
- package/cli/ws-bridge.ts +7 -36
- package/detox/frame-identity.cjs +21 -0
- package/detox/frame-identity.d.cts +6 -0
- package/detox/index.ts +39 -33
- package/detox/jest-environment.cjs +4 -1
- package/detox/jest-setup-after-env.cjs +0 -4
- package/detox/navigation-lifecycle.ts +2 -2
- package/detox/proof-observer.ts +126 -0
- package/dist-lib/agent-daemon-client.cjs +29 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +10 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +557 -158
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +5098 -7344
- package/dist-lib/detox/jest-environment.cjs +4 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +602 -152
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +688 -194
- package/dist-lib/host/fetch-proxy-handler.cjs +6 -3
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +247 -11
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +10 -1
- package/dist-lib/metro-production-bundle.mjs +12 -1
- package/dist-lib/metro.cjs +155 -5
- package/dist-lib/native-app-identity-project.cjs +43 -5
- package/dist-lib/native-app-identity-project.mjs +43 -5
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +21 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +73 -27
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +563 -183
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +964 -0
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +38 -5
- package/dist-lib/sdk.mjs +38 -5
- package/dist-lib/skills.cjs +1031 -530
- package/dist-lib/swift-compile.cjs +298 -86
- package/dist-lib/swift-compile.mjs +298 -86
- package/dist-lib/swift-package.cjs +53 -4
- package/dist-lib/swift-package.mjs +52 -4
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +25 -44
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +603 -114
- package/dist-lib/vite.cjs +65 -3
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +7 -0
- package/dist-types/packages/peach-engine/src/engine/glass-material.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/engine/inspect-outline.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +4 -1
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +7 -0
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime-kind.d.ts +24 -0
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +4 -2
- package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/settings/devices.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +18 -0
- package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +10 -1
- package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
- package/dist-types/packages/peach-globals/src/nodeContract.d.ts +1 -0
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +54 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +23 -4
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStore.h +439 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreCopySpecific.h +216 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreKey.h +267 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetwork.h +204 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkConfiguration.h +1393 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkConnection.h +568 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCNetworkReachability.h +369 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferences.h +473 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferencesPath.h +179 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCPreferencesSetSpecific.h +95 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCSchemaDefinitions.h +2395 -0
- package/sdk/ios/System/Library/Frameworks/SystemConfiguration.framework/Headers/SystemConfiguration.h +184 -0
- package/sdk/ios/usr/include/_ctype.h +388 -0
- package/sdk/ios/usr/include/_inttypes.h +296 -0
- package/sdk/ios/usr/include/_locale.h +83 -0
- package/sdk/ios/usr/include/_locale_posix2008.h +65 -0
- package/sdk/ios/usr/include/_time.h +207 -0
- package/sdk/ios/usr/include/ctype.h +70 -0
- package/sdk/ios/usr/include/dispatch/dispatch.h +69 -6
- package/sdk/ios/usr/include/inttypes.h +35 -0
- package/sdk/ios/usr/include/libkern/OSByteOrder.h +315 -0
- package/sdk/ios/usr/include/libkern/machine/OSByteOrder.h +147 -0
- package/sdk/ios/usr/include/locale.h +59 -0
- package/sdk/ios/usr/include/runetype.h +118 -0
- package/sdk/ios/usr/include/setjmp.h +99 -0
- package/sdk/ios/usr/include/sys/_types/_clock_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_ct_rune_t.h +33 -0
- package/sdk/ios/usr/include/sys/_types/_rune_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_time_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_wint_t.h +33 -0
- package/sdk/ios/usr/include/sys/cdefs.h +2 -0
- package/sdk/ios/usr/include/time.h +67 -2
- package/src/bridge-contract.ts +42 -0
- package/src/chromium-admission.ts +196 -0
- package/src/host/bridge-host.ts +6 -43
- package/src/host/rolldown-bundle-forward.ts +4 -1
- package/src/launch-deadline.ts +74 -0
- package/src/nitro-adapter.lock.json +3 -3
- package/src/profiles.ts +21 -0
- package/src/react-native-coverage/capability-reference-resolution.ts +402 -0
- package/src/react-native-coverage/capability-source-references.ts +1296 -0
- package/src/react-native-coverage/native-typescript-parser.ts +74 -0
- package/src/react-native-coverage/project-aliases.ts +207 -0
- package/src/react-native-coverage/verified-reach.ts +47 -0
- package/src/reap-browser.ts +1019 -0
- package/src/skills/builtin/a11y-review.ts +1 -1
- package/src/skills/builtin/perf-profile.ts +1 -1
- package/src/skills/builtin/screenshot-all.ts +1 -1
- package/src/skills/builtin/visual-diff.ts +1 -1
- package/src/swift-compile.ts +109 -57
- package/src/swift-coverage/indexdump.ts +80 -0
- package/src/swift-coverage/indexing.ts +147 -0
- package/src/swift-coverage/package.ts +230 -0
- package/src/swift-coverage/provenance.ts +47 -0
- package/src/swift-coverage/reader.ts +81 -0
- package/src/swift-coverage/source.ts +252 -0
- package/src/swift-coverage/types.ts +58 -0
- package/src/swift-coverage/xcode-assets.ts +175 -0
- package/src/swift-coverage/xcode-bridging.ts +160 -0
- package/src/swift-coverage/xcode-packages.ts +251 -0
- package/src/swift-coverage/xcode-strings.ts +78 -0
- package/src/swift-coverage/xcode.ts +656 -0
- package/src/swift-distribution.lock.json +8 -8
- package/src/swift-host.ts +21 -1
- package/src/swift-objc-compile.ts +7 -3
- package/src/swift-objc-import.ts +191 -27
- package/src/swift-objc-metadata.ts +2 -2
- package/src/swift-objc-standin.ts +9 -2
- package/src/swift-package-manifest.ts +134 -13
- package/src/swift-package.ts +69 -4
- package/src/swift-standins.ts +4 -1
- package/src/swift-submit.ts +2 -1
- package/src/swift-toolchain.ts +36 -61
- package/src/worker-system-chunks.ts +3 -10
- package/src/xcode-project.ts +5 -5
- package/detox/attempt-events.cjs +0 -914
- package/detox/attempt-events.d.cts +0 -113
- package/detox/motion-change.cjs +0 -524
- package/detox/motion-change.d.cts +0 -140
- package/detox/motion-leg-starts.cjs +0 -20
- package/detox/motion-leg-starts.d.cts +0 -8
- package/detox/proof-frame.cjs +0 -190
- package/detox/record-block-execution.cjs +0 -78
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2006, 2008-2010, 2015, 2017, 2018, 2021 Apple Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* @APPLE_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. Please obtain a copy of the License at
|
|
10
|
+
* http://www.opensource.apple.com/apsl/ and read it before using this
|
|
11
|
+
* file.
|
|
12
|
+
*
|
|
13
|
+
* The Original Code and all software distributed under the License are
|
|
14
|
+
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
|
15
|
+
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
|
16
|
+
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
|
|
18
|
+
* Please see the License for the specific language governing rights and
|
|
19
|
+
* limitations under the License.
|
|
20
|
+
*
|
|
21
|
+
* @APPLE_LICENSE_HEADER_END@
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
#ifndef _SCNETWORKCONNECTION_H
|
|
25
|
+
#define _SCNETWORKCONNECTION_H
|
|
26
|
+
|
|
27
|
+
#include <os/availability.h>
|
|
28
|
+
#include <TargetConditionals.h>
|
|
29
|
+
#include <sys/cdefs.h>
|
|
30
|
+
#include <dispatch/dispatch.h>
|
|
31
|
+
#include <sys/types.h>
|
|
32
|
+
#include <sys/socket.h>
|
|
33
|
+
#include <CoreFoundation/CoreFoundation.h>
|
|
34
|
+
#include <SystemConfiguration/SystemConfiguration.h>
|
|
35
|
+
|
|
36
|
+
CF_IMPLICIT_BRIDGING_ENABLED
|
|
37
|
+
CF_ASSUME_NONNULL_BEGIN
|
|
38
|
+
|
|
39
|
+
/*!
|
|
40
|
+
@header SCNetworkConnection
|
|
41
|
+
@discussion The SCNetworkConnection API contains functions that allow
|
|
42
|
+
an application to control connection-oriented services defined
|
|
43
|
+
in the system and get connection-status information.
|
|
44
|
+
|
|
45
|
+
The functions in the SCNetworkConnection API allow you to
|
|
46
|
+
control and get information about existing services only.
|
|
47
|
+
If you need to create, change, or remove services, you
|
|
48
|
+
should use the SCNetworkConfiguration API instead.
|
|
49
|
+
|
|
50
|
+
Note: Currently, only PPP services can be controlled.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/*!
|
|
55
|
+
@typedef SCNetworkConnectionRef
|
|
56
|
+
@discussion This is the handle to manage a connection-oriented service.
|
|
57
|
+
*/
|
|
58
|
+
typedef const struct CF_BRIDGED_TYPE(id) __SCNetworkConnection * SCNetworkConnectionRef;
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/*!
|
|
62
|
+
@typedef SCNetworkConnectionContext
|
|
63
|
+
@discussion Structure containing user-specified data and callbacks
|
|
64
|
+
for a SCNetworkConnection.
|
|
65
|
+
@field version The version number of the structure type being passed
|
|
66
|
+
in as a parameter to the SCNetworkConnectionCreateWithServiceID
|
|
67
|
+
function. This structure is version 0.
|
|
68
|
+
@field info A C pointer to a user-specified block of data.
|
|
69
|
+
@field retain The callback used to add a retain for the info field.
|
|
70
|
+
If this parameter is not a pointer to a function of the correct
|
|
71
|
+
prototype, the behavior is undefined. The value may be NULL.
|
|
72
|
+
@field release The calllback used to remove a retain previously added
|
|
73
|
+
for the info field. If this parameter is not a pointer to a
|
|
74
|
+
function of the correct prototype, the behavior is undefined.
|
|
75
|
+
The value may be NULL.
|
|
76
|
+
@field copyDescription The callback used to provide a description of
|
|
77
|
+
the info field.
|
|
78
|
+
*/
|
|
79
|
+
typedef struct {
|
|
80
|
+
CFIndex version;
|
|
81
|
+
void * __nullable info;
|
|
82
|
+
const void * __nonnull (* __nullable retain)(const void *info);
|
|
83
|
+
void (* __nullable release)(const void *info);
|
|
84
|
+
CFStringRef __nonnull (* __nullable copyDescription)(const void *info);
|
|
85
|
+
} SCNetworkConnectionContext;
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/*!
|
|
90
|
+
@enum SCNetworkConnectionStatus
|
|
91
|
+
@discussion Status of the network connection.
|
|
92
|
+
This status is intended to be generic and high level.
|
|
93
|
+
An extended status, specific to the type of network
|
|
94
|
+
connection is also available for applications that
|
|
95
|
+
need additonal information.
|
|
96
|
+
@constant kSCNetworkConnectionInvalid
|
|
97
|
+
The network connection refers to an invalid service.
|
|
98
|
+
@constant kSCNetworkConnectionDisconnected
|
|
99
|
+
The network connection is disconnected.
|
|
100
|
+
@constant kSCNetworkConnectionConnecting
|
|
101
|
+
The network connection is connecting.
|
|
102
|
+
@constant kSCNetworkConnectionConnected
|
|
103
|
+
The network connection is connected.
|
|
104
|
+
@constant kSCNetworkConnectionDisconnecting
|
|
105
|
+
The network connection is disconnecting.
|
|
106
|
+
*/
|
|
107
|
+
typedef CF_ENUM(int32_t, SCNetworkConnectionStatus) {
|
|
108
|
+
kSCNetworkConnectionInvalid = -1,
|
|
109
|
+
kSCNetworkConnectionDisconnected = 0,
|
|
110
|
+
kSCNetworkConnectionConnecting = 1,
|
|
111
|
+
kSCNetworkConnectionConnected = 2,
|
|
112
|
+
kSCNetworkConnectionDisconnecting = 3
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
/*!
|
|
117
|
+
@enum SCNetworkConnectionPPPStatus
|
|
118
|
+
@discussion PPP-specific status of the network connection.
|
|
119
|
+
This status is returned as part of the extended information
|
|
120
|
+
for a PPP service.
|
|
121
|
+
Note: additional status might be returned in the future.
|
|
122
|
+
Your application should be prepared to receive an unknown value.
|
|
123
|
+
@constant kSCNetworkConnectionPPPDisconnected
|
|
124
|
+
PPP is disconnected.
|
|
125
|
+
@constant kSCNetworkConnectionPPPInitializing
|
|
126
|
+
PPP is initializing.
|
|
127
|
+
@constant kSCNetworkConnectionPPPConnectingLink
|
|
128
|
+
PPP is connecting the lower connection layer (for example,
|
|
129
|
+
the modem is dialing out).
|
|
130
|
+
@constant kSCNetworkConnectionPPPDialOnTraffic
|
|
131
|
+
PPP is waiting for networking traffic to automatically
|
|
132
|
+
establish the connection.
|
|
133
|
+
@constant kSCNetworkConnectionPPPNegotiatingLink
|
|
134
|
+
The PPP lower layer is connected and PPP is negotiating the
|
|
135
|
+
link layer (LCP protocol).
|
|
136
|
+
@constant kSCNetworkConnectionPPPAuthenticating
|
|
137
|
+
PPP is authenticating to the server (PAP, CHAP, MS-CHAP or
|
|
138
|
+
EAP protocols).
|
|
139
|
+
@constant kSCNetworkConnectionPPPWaitingForCallBack
|
|
140
|
+
PPP is waiting for the server to call back.
|
|
141
|
+
@constant kSCNetworkConnectionPPPNegotiatingNetwork
|
|
142
|
+
PPP is now authenticated and negotiating the networking
|
|
143
|
+
layer (IPCP or IPv6CP protocols)
|
|
144
|
+
@constant kSCNetworkConnectionPPPConnected
|
|
145
|
+
PPP is now fully connected for at least one networking layer.
|
|
146
|
+
Additional networking protocol might still be negotiating.
|
|
147
|
+
@constant kSCNetworkConnectionPPPTerminating
|
|
148
|
+
PPP networking and link protocols are terminating.
|
|
149
|
+
@constant kSCNetworkConnectionPPPDisconnectingLink
|
|
150
|
+
PPP is disconnecting the lower level (for example, the modem
|
|
151
|
+
is hanging up).
|
|
152
|
+
@constant kSCNetworkConnectionPPPHoldingLinkOff
|
|
153
|
+
PPP is disconnected and maintaining the link temporarily off.
|
|
154
|
+
@constant kSCNetworkConnectionPPPSuspended
|
|
155
|
+
PPP is suspended as a result of the suspend command (for
|
|
156
|
+
example, when a V.92 Modem is On Hold).
|
|
157
|
+
@constant kSCNetworkConnectionPPPWaitingForRedial
|
|
158
|
+
PPP has found a busy server and is waiting for redial.
|
|
159
|
+
*/
|
|
160
|
+
typedef CF_ENUM(int32_t, SCNetworkConnectionPPPStatus) {
|
|
161
|
+
kSCNetworkConnectionPPPDisconnected = 0,
|
|
162
|
+
kSCNetworkConnectionPPPInitializing = 1,
|
|
163
|
+
kSCNetworkConnectionPPPConnectingLink = 2,
|
|
164
|
+
kSCNetworkConnectionPPPDialOnTraffic = 3,
|
|
165
|
+
kSCNetworkConnectionPPPNegotiatingLink = 4,
|
|
166
|
+
kSCNetworkConnectionPPPAuthenticating = 5,
|
|
167
|
+
kSCNetworkConnectionPPPWaitingForCallBack = 6,
|
|
168
|
+
kSCNetworkConnectionPPPNegotiatingNetwork = 7,
|
|
169
|
+
kSCNetworkConnectionPPPConnected = 8,
|
|
170
|
+
kSCNetworkConnectionPPPTerminating = 9,
|
|
171
|
+
kSCNetworkConnectionPPPDisconnectingLink = 10,
|
|
172
|
+
kSCNetworkConnectionPPPHoldingLinkOff = 11,
|
|
173
|
+
kSCNetworkConnectionPPPSuspended = 12,
|
|
174
|
+
kSCNetworkConnectionPPPWaitingForRedial = 13
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
/*!
|
|
178
|
+
@typedef SCNetworkConnectionCallBack
|
|
179
|
+
@discussion Type of the callback function used when a
|
|
180
|
+
status event is delivered.
|
|
181
|
+
@param status The connection status.
|
|
182
|
+
@param connection The connection reference.
|
|
183
|
+
@param info Application-specific information.
|
|
184
|
+
*/
|
|
185
|
+
typedef void (*SCNetworkConnectionCallBack) (
|
|
186
|
+
SCNetworkConnectionRef connection,
|
|
187
|
+
SCNetworkConnectionStatus status,
|
|
188
|
+
void * __nullable info
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
/*
|
|
194
|
+
Keys for the statistics dictionary
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
#define kSCNetworkConnectionBytesIn CFSTR("BytesIn") /* CFNumber */
|
|
198
|
+
#define kSCNetworkConnectionBytesOut CFSTR("BytesOut") /* CFNumber */
|
|
199
|
+
#define kSCNetworkConnectionPacketsIn CFSTR("PacketsIn") /* CFNumber */
|
|
200
|
+
#define kSCNetworkConnectionPacketsOut CFSTR("PacketsOut") /* CFNumber */
|
|
201
|
+
#define kSCNetworkConnectionErrorsIn CFSTR("ErrorsIn") /* CFNumber */
|
|
202
|
+
#define kSCNetworkConnectionErrorsOut CFSTR("ErrorsOut") /* CFNumber */
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
/*
|
|
206
|
+
Keys for the SCNetworkConnectionCopyUserPreferences() "selectionOptions"
|
|
207
|
+
dictionary
|
|
208
|
+
*/
|
|
209
|
+
|
|
210
|
+
/*!
|
|
211
|
+
@define kSCNetworkConnectionSelectionOptionOnDemandHostName
|
|
212
|
+
@discussion A host name that will be used to select the
|
|
213
|
+
"best" SCNetworkConnection.
|
|
214
|
+
*/
|
|
215
|
+
#define kSCNetworkConnectionSelectionOptionOnDemandHostName CFSTR("OnDemandHostName") // CFString
|
|
216
|
+
// API_AVAILABLE(macos(10.4))
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
/*!
|
|
220
|
+
@define kSCNetworkConnectionSelectionOptionOnDemandRetry
|
|
221
|
+
@discussion A boolean value used to indicate whether a DNS query has
|
|
222
|
+
already been issued for the specified OnDemand host name.
|
|
223
|
+
*/
|
|
224
|
+
#define kSCNetworkConnectionSelectionOptionOnDemandRetry CFSTR("OnDemandRetry") // CFBoolean
|
|
225
|
+
// API_AVAILABLE(macos(10.4))
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
__BEGIN_DECLS
|
|
229
|
+
|
|
230
|
+
/*!
|
|
231
|
+
@function SCNetworkConnectionGetTypeID
|
|
232
|
+
@discussion Returns the type identifier of all SCNetworkConnection
|
|
233
|
+
instances.
|
|
234
|
+
*/
|
|
235
|
+
CFTypeID
|
|
236
|
+
SCNetworkConnectionGetTypeID (void) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
/*!
|
|
240
|
+
@function SCNetworkConnectionCopyUserPreferences
|
|
241
|
+
@discussion Provides the default service ID and a dictionary of user
|
|
242
|
+
options for the connection. Applications can use the
|
|
243
|
+
returned serviceID and userOptions values to open a
|
|
244
|
+
connection on the fly.
|
|
245
|
+
@param selectionOptions Currently unimplemented. Pass NULL for this
|
|
246
|
+
version.
|
|
247
|
+
@param serviceID Reference to the default serviceID for starting
|
|
248
|
+
connections, this value will be returned by the function.
|
|
249
|
+
@param userOptions Reference to default userOptions for starting
|
|
250
|
+
connections, this will be returned by the function.
|
|
251
|
+
@result Returns TRUE if there is a valid service to dial;
|
|
252
|
+
FALSE if the function was unable to retrieve a service to dial.
|
|
253
|
+
*/
|
|
254
|
+
Boolean
|
|
255
|
+
SCNetworkConnectionCopyUserPreferences (
|
|
256
|
+
CFDictionaryRef __nullable selectionOptions,
|
|
257
|
+
CFStringRef __nullable * __nonnull serviceID,
|
|
258
|
+
CFDictionaryRef __nullable * __nonnull userOptions
|
|
259
|
+
) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
/*!
|
|
263
|
+
@function SCNetworkConnectionCreateWithServiceID
|
|
264
|
+
@discussion Creates a new connection reference to use for getting
|
|
265
|
+
the status or for connecting or disconnecting the associated
|
|
266
|
+
service.
|
|
267
|
+
@param allocator The CFAllocator that should be used to allocate
|
|
268
|
+
memory for the connection structure. This parameter may be
|
|
269
|
+
NULL in which case the current default CFAllocator is used.
|
|
270
|
+
If this reference is not a valid CFAllocator, the behavior
|
|
271
|
+
is undefined.
|
|
272
|
+
@param serviceID A string that defines the service identifier
|
|
273
|
+
of the connection. Service identifiers uniquely identify
|
|
274
|
+
services in the system configuration database.
|
|
275
|
+
@param callout The function to be called when the status
|
|
276
|
+
of the connection changes. If this parameter is NULL, the
|
|
277
|
+
application will not receive notifications of status change
|
|
278
|
+
and will need to poll for updates.
|
|
279
|
+
@param context The SCNetworkConnectionContext associated with the
|
|
280
|
+
callout.
|
|
281
|
+
@result Returns a reference to the new SCNetworkConnection.
|
|
282
|
+
*/
|
|
283
|
+
SCNetworkConnectionRef __nullable
|
|
284
|
+
SCNetworkConnectionCreateWithServiceID (
|
|
285
|
+
CFAllocatorRef __nullable allocator,
|
|
286
|
+
CFStringRef serviceID,
|
|
287
|
+
SCNetworkConnectionCallBack __nullable callout,
|
|
288
|
+
SCNetworkConnectionContext * __nullable context
|
|
289
|
+
) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
/*!
|
|
293
|
+
@function SCNetworkConnectionCopyServiceID
|
|
294
|
+
@discussion Returns the service ID associated with the SCNetworkConnection.
|
|
295
|
+
@param connection The SCNetworkConnection to obtain status from.
|
|
296
|
+
@result Returns the service ID associated with the SCNetworkConnection.
|
|
297
|
+
*/
|
|
298
|
+
CFStringRef __nullable
|
|
299
|
+
SCNetworkConnectionCopyServiceID (
|
|
300
|
+
SCNetworkConnectionRef connection
|
|
301
|
+
) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
/*!
|
|
305
|
+
@function SCNetworkConnectionGetStatus
|
|
306
|
+
@discussion Returns the status of the SCNetworkConnection.
|
|
307
|
+
A status is one of the following values:
|
|
308
|
+
<pre>
|
|
309
|
+
@textblock
|
|
310
|
+
 
|
|
311
|
+
kSCNetworkConnectionInvalid
|
|
312
|
+
kSCNetworkConnectionDisconnected
|
|
313
|
+
kSCNetworkConnectionConnecting
|
|
314
|
+
kSCNetworkConnectionDisconnecting
|
|
315
|
+
kSCNetworkConnectionConnected
|
|
316
|
+
@/textblock
|
|
317
|
+
</pre>
|
|
318
|
+
@param connection The SCNetworkConnection to obtain status from.
|
|
319
|
+
@result Returns the status value.
|
|
320
|
+
*/
|
|
321
|
+
SCNetworkConnectionStatus
|
|
322
|
+
SCNetworkConnectionGetStatus (
|
|
323
|
+
SCNetworkConnectionRef connection
|
|
324
|
+
) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
/*!
|
|
328
|
+
@function SCNetworkConnectionCopyExtendedStatus
|
|
329
|
+
@discussion Returns the extended status of the connection.
|
|
330
|
+
An extended status dictionary contains specific dictionaries
|
|
331
|
+
describing the status for each subcomponent of the service.
|
|
332
|
+
|
|
333
|
+
For example, a status dictionary will contain the following
|
|
334
|
+
sub-dictionaries, keys, and values:
|
|
335
|
+
<pre>
|
|
336
|
+
@textblock
|
|
337
|
+
 
|
|
338
|
+
IPv4 : Addresses : the assigned IP address.
|
|
339
|
+
 
|
|
340
|
+
PPP : Status : the PPP-specific status of type
|
|
341
|
+
SCNetworkConnectionPPPStatus.
|
|
342
|
+
 
|
|
343
|
+
LastCause : Available when the status is "Disconnected"
|
|
344
|
+
and contains the last error associated with
|
|
345
|
+
connecting or disconnecting.
|
|
346
|
+
 
|
|
347
|
+
ConnectTime : the time when the connection was
|
|
348
|
+
established.
|
|
349
|
+
 
|
|
350
|
+
Modem : ConnectSpeed : the speed of the modem connection
|
|
351
|
+
in bits/second.
|
|
352
|
+
 
|
|
353
|
+
IPSec : Status : the IPSec-specific status of type
|
|
354
|
+
SCNetworkConnectionIPSecStatus
|
|
355
|
+
 
|
|
356
|
+
ConnectTime : the time when the connection was
|
|
357
|
+
established.
|
|
358
|
+
|
|
359
|
+
@/textblock
|
|
360
|
+
</pre>
|
|
361
|
+
Other dictionaries could be present for PPPoE, PPTP, and L2TP.
|
|
362
|
+
|
|
363
|
+
The status dictionary may be extended in the future to contain
|
|
364
|
+
additional information.
|
|
365
|
+
@param connection The SCNetworkConnection to obtain status from.
|
|
366
|
+
@result Returns the status dictionary.
|
|
367
|
+
If NULL is returned, the error can be retrieved using the SCError function.
|
|
368
|
+
*/
|
|
369
|
+
CFDictionaryRef __nullable
|
|
370
|
+
SCNetworkConnectionCopyExtendedStatus (
|
|
371
|
+
SCNetworkConnectionRef connection
|
|
372
|
+
) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
/*!
|
|
376
|
+
@function SCNetworkConnectionCopyStatistics
|
|
377
|
+
@discussion Returns the statistics of the SCNetworkConnection.
|
|
378
|
+
A statistic dictionary contains specific dictionaries
|
|
379
|
+
with statistics for each subcomponent of the service.
|
|
380
|
+
|
|
381
|
+
For example, a statistics dictionary will contain the following
|
|
382
|
+
sub-dictionaries, keys, and values:
|
|
383
|
+
<pre>
|
|
384
|
+
@textblock
|
|
385
|
+
 
|
|
386
|
+
PPP : BytesIn :
|
|
387
|
+
PPP : BytesOut : Contains the number of bytes going up into
|
|
388
|
+
(or coming out of) the network stack for
|
|
389
|
+
any networking protocol without the PPP
|
|
390
|
+
headers and trailers.
|
|
391
|
+
 
|
|
392
|
+
PPP : PacketsIn :
|
|
393
|
+
PPP : PacketsOut : Contains the number of packets going up into
|
|
394
|
+
(or coming out of) the network stack for
|
|
395
|
+
any networking protocol without the PPP
|
|
396
|
+
headers and trailers.
|
|
397
|
+
 
|
|
398
|
+
PPP : ErrorsIn :
|
|
399
|
+
PPP : ErrorsOut : Contains the number of errors going up into
|
|
400
|
+
(or coming out of) the network stack for
|
|
401
|
+
any networking protocol without the PPP
|
|
402
|
+
headers and trailers.
|
|
403
|
+
@/textblock
|
|
404
|
+
</pre>
|
|
405
|
+
The statistics dictionary may be extended in the future to
|
|
406
|
+
contain additional information.
|
|
407
|
+
@param connection The SCNetworkConnection to obtained statistics from.
|
|
408
|
+
@result Returns the statistics dictionary.
|
|
409
|
+
If NULL is returned, the error can be retrieved using the SCError function.
|
|
410
|
+
*/
|
|
411
|
+
CFDictionaryRef __nullable
|
|
412
|
+
SCNetworkConnectionCopyStatistics (
|
|
413
|
+
SCNetworkConnectionRef connection
|
|
414
|
+
) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
/*!
|
|
418
|
+
@function SCNetworkConnectionStart
|
|
419
|
+
@discussion Starts the connection for the SCNetworkConnection.
|
|
420
|
+
The connection process is asynchronous and the function will
|
|
421
|
+
return immediately. The connection status can be obtained
|
|
422
|
+
by polling or by callback. The connection is made with the
|
|
423
|
+
default settings from the administrator. Some of the settings
|
|
424
|
+
can be overridden for the duration of the connection. These
|
|
425
|
+
are specified in an options dictionary. The options dictionary
|
|
426
|
+
uses the same format as a network service defined in the system
|
|
427
|
+
configuration preferences schema.
|
|
428
|
+
|
|
429
|
+
Note: Starting and stopping of connections is implicitly
|
|
430
|
+
arbitrated. Calling SCNetworkConnectionStart on a connection
|
|
431
|
+
already started will indicate that the application has
|
|
432
|
+
interest in the connection and it shouldn't be stopped by
|
|
433
|
+
anyone else.
|
|
434
|
+
@param connection The SCNetworkConnection to start.
|
|
435
|
+
@param userOptions The options dictionary to start the connection with.
|
|
436
|
+
If userOptions is NULL, the default settings will be used.
|
|
437
|
+
If userOptions are specified, they must be in the same format
|
|
438
|
+
as network services stored in the system configuration
|
|
439
|
+
preferences schema. The options will override the default
|
|
440
|
+
settings defined for the service.
|
|
441
|
+
|
|
442
|
+
For security reasons, not all options can be overridden; the
|
|
443
|
+
appropriate merging of all settings will be done before the
|
|
444
|
+
connection is established, and inappropriate options will be
|
|
445
|
+
ignored.
|
|
446
|
+
@param linger This parameter indicates whether or not the connection
|
|
447
|
+
can stay around when the application no longer has interest
|
|
448
|
+
in it. A typical application should pass FALSE, and the
|
|
449
|
+
connection will be automatically stopped when the reference
|
|
450
|
+
is released or if the application quits. If the application
|
|
451
|
+
passes TRUE, the application can release the reference or
|
|
452
|
+
exit and the connection will be maintained until a timeout
|
|
453
|
+
event, until a specific stop request occurs, or until an
|
|
454
|
+
error is encountered.
|
|
455
|
+
@result Returns TRUE if the connection was correctly started (the
|
|
456
|
+
actual connection is not established yet, and the connection
|
|
457
|
+
status needs to be periodically checked); FALSE if the
|
|
458
|
+
connection request was not started. The error must be
|
|
459
|
+
retrieved from the SCError function.
|
|
460
|
+
*/
|
|
461
|
+
Boolean
|
|
462
|
+
SCNetworkConnectionStart (
|
|
463
|
+
SCNetworkConnectionRef connection,
|
|
464
|
+
CFDictionaryRef __nullable userOptions,
|
|
465
|
+
Boolean linger
|
|
466
|
+
) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
/*!
|
|
470
|
+
@function SCNetworkConnectionStop
|
|
471
|
+
@discussion Stops the connection for the SCNetworkConnection.
|
|
472
|
+
The disconnection process is asynchronous and the function
|
|
473
|
+
will return immediately. The connection status can be
|
|
474
|
+
obtained by polling or by callback. This function performs
|
|
475
|
+
an arbitrated stop of the connection. If several applications
|
|
476
|
+
have marked their interest in the connection, by calling
|
|
477
|
+
SCNetworkConnectionStart, the call will succeed but the
|
|
478
|
+
actual connection will be maintained until the last interested
|
|
479
|
+
application calls SCNetworkConnectionStop.
|
|
480
|
+
|
|
481
|
+
In certain cases, you might want to stop the connection anyway.
|
|
482
|
+
In these cases, you set the forceDisconnect argument to TRUE.
|
|
483
|
+
@param connection The SCNetworkConnection to stop.
|
|
484
|
+
@result Returns TRUE if the disconnection request succeeded;
|
|
485
|
+
FALSE if the disconnection request failed.
|
|
486
|
+
The error must be retrieved from the SCError function.
|
|
487
|
+
*/
|
|
488
|
+
Boolean
|
|
489
|
+
SCNetworkConnectionStop (
|
|
490
|
+
SCNetworkConnectionRef connection,
|
|
491
|
+
Boolean forceDisconnect
|
|
492
|
+
) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
/*!
|
|
496
|
+
@function SCNetworkConnectionCopyUserOptions
|
|
497
|
+
@discussion Copies the user options used to start the connection.
|
|
498
|
+
This is a mechanism a client can use to retrieve the user options
|
|
499
|
+
previously passed to the SCNetworkConnectionStart function.
|
|
500
|
+
@param connection The SCNetworkConnection to obtain options from.
|
|
501
|
+
@result Returns the service dictionary containing the connection options.
|
|
502
|
+
The dictionary can be empty if no user options were used.
|
|
503
|
+
If NULL is returned, the error can be retrieved using the SCError function.
|
|
504
|
+
*/
|
|
505
|
+
CFDictionaryRef __nullable
|
|
506
|
+
SCNetworkConnectionCopyUserOptions (
|
|
507
|
+
SCNetworkConnectionRef connection
|
|
508
|
+
) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
/*!
|
|
512
|
+
@function SCNetworkConnectionScheduleWithRunLoop
|
|
513
|
+
@discussion Schedules a connection with the run loop.
|
|
514
|
+
@param connection The SCNetworkConnection to schedule.
|
|
515
|
+
@param runLoop The run loop to schedule with.
|
|
516
|
+
@param runLoopMode The run loop mode.
|
|
517
|
+
@result Returns TRUE if the connection is scheduled successfully;
|
|
518
|
+
FALSE if the scheduling failed.
|
|
519
|
+
The error can be retrieved using the SCError function.
|
|
520
|
+
*/
|
|
521
|
+
Boolean
|
|
522
|
+
SCNetworkConnectionScheduleWithRunLoop (
|
|
523
|
+
SCNetworkConnectionRef connection,
|
|
524
|
+
CFRunLoopRef runLoop,
|
|
525
|
+
CFStringRef runLoopMode
|
|
526
|
+
) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
/*!
|
|
530
|
+
@function SCNetworkConnectionUnscheduleFromRunLoop
|
|
531
|
+
@discussion Unschedules a connection from the run loop.
|
|
532
|
+
@param connection The SCNetworkConnection to unschedule.
|
|
533
|
+
@param runLoop The run loop to unschedule from.
|
|
534
|
+
@param runLoopMode The run loop mode.
|
|
535
|
+
@result Returns TRUE if the connection is unscheduled successfully;
|
|
536
|
+
FALSE if the unscheduling failed.
|
|
537
|
+
The error can be retrieved using the SCError function.
|
|
538
|
+
*/
|
|
539
|
+
Boolean
|
|
540
|
+
SCNetworkConnectionUnscheduleFromRunLoop (
|
|
541
|
+
SCNetworkConnectionRef connection,
|
|
542
|
+
CFRunLoopRef runLoop,
|
|
543
|
+
CFStringRef runLoopMode
|
|
544
|
+
) API_AVAILABLE(macos(10.3)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
/*!
|
|
548
|
+
@function SCNetworkConnectionSetDispatchQueue
|
|
549
|
+
@discussion Caller provides a dispatch queue on which the callback contained in connection will run.
|
|
550
|
+
@param connection The SCNetworkConnection to notify.
|
|
551
|
+
@param queue The libdispatch queue to run the callback on.
|
|
552
|
+
Pass NULL to disable notifications, and release queue.
|
|
553
|
+
@result Returns TRUE if the notifications have been enabled/disabled as desired;
|
|
554
|
+
FALSE if not.
|
|
555
|
+
The error can be retrieved using the SCError function.
|
|
556
|
+
*/
|
|
557
|
+
Boolean
|
|
558
|
+
SCNetworkConnectionSetDispatchQueue (
|
|
559
|
+
SCNetworkConnectionRef connection,
|
|
560
|
+
dispatch_queue_t __nullable queue
|
|
561
|
+
) API_AVAILABLE(macos(10.6)) API_UNAVAILABLE(ios, tvos, watchos);
|
|
562
|
+
|
|
563
|
+
__END_DECLS
|
|
564
|
+
|
|
565
|
+
CF_ASSUME_NONNULL_END
|
|
566
|
+
CF_IMPLICIT_BRIDGING_DISABLED
|
|
567
|
+
|
|
568
|
+
#endif /* _SCNETWORKCONNECTION_H */
|