";
232 | };
233 | /* End PBXVariantGroup section */
234 |
235 | /* Begin XCBuildConfiguration section */
236 | F8FF4C071F7655850038C912 /* Debug */ = {
237 | isa = XCBuildConfiguration;
238 | buildSettings = {
239 | ALWAYS_SEARCH_USER_PATHS = NO;
240 | CLANG_ANALYZER_NONNULL = YES;
241 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
242 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
243 | CLANG_CXX_LIBRARY = "libc++";
244 | CLANG_ENABLE_MODULES = YES;
245 | CLANG_ENABLE_OBJC_ARC = YES;
246 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
247 | CLANG_WARN_BOOL_CONVERSION = YES;
248 | CLANG_WARN_COMMA = YES;
249 | CLANG_WARN_CONSTANT_CONVERSION = YES;
250 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
251 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
252 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
253 | CLANG_WARN_EMPTY_BODY = YES;
254 | CLANG_WARN_ENUM_CONVERSION = YES;
255 | CLANG_WARN_INFINITE_RECURSION = YES;
256 | CLANG_WARN_INT_CONVERSION = YES;
257 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
258 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
259 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
260 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
261 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
262 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
263 | CLANG_WARN_STRICT_PROTOTYPES = YES;
264 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
265 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
266 | CLANG_WARN_UNREACHABLE_CODE = YES;
267 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
268 | CODE_SIGN_IDENTITY = "iPhone Developer";
269 | COPY_PHASE_STRIP = NO;
270 | DEBUG_INFORMATION_FORMAT = dwarf;
271 | ENABLE_STRICT_OBJC_MSGSEND = YES;
272 | ENABLE_TESTABILITY = YES;
273 | GCC_C_LANGUAGE_STANDARD = gnu11;
274 | GCC_DYNAMIC_NO_PIC = NO;
275 | GCC_NO_COMMON_BLOCKS = YES;
276 | GCC_OPTIMIZATION_LEVEL = 0;
277 | GCC_PREPROCESSOR_DEFINITIONS = (
278 | "DEBUG=1",
279 | "$(inherited)",
280 | );
281 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
282 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
283 | GCC_WARN_UNDECLARED_SELECTOR = YES;
284 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
285 | GCC_WARN_UNUSED_FUNCTION = YES;
286 | GCC_WARN_UNUSED_VARIABLE = YES;
287 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
288 | MTL_ENABLE_DEBUG_INFO = YES;
289 | ONLY_ACTIVE_ARCH = YES;
290 | SDKROOT = iphoneos;
291 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
292 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
293 | };
294 | name = Debug;
295 | };
296 | F8FF4C081F7655850038C912 /* Release */ = {
297 | isa = XCBuildConfiguration;
298 | buildSettings = {
299 | ALWAYS_SEARCH_USER_PATHS = NO;
300 | CLANG_ANALYZER_NONNULL = YES;
301 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
302 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
303 | CLANG_CXX_LIBRARY = "libc++";
304 | CLANG_ENABLE_MODULES = YES;
305 | CLANG_ENABLE_OBJC_ARC = YES;
306 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
307 | CLANG_WARN_BOOL_CONVERSION = YES;
308 | CLANG_WARN_COMMA = YES;
309 | CLANG_WARN_CONSTANT_CONVERSION = YES;
310 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
311 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
312 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
313 | CLANG_WARN_EMPTY_BODY = YES;
314 | CLANG_WARN_ENUM_CONVERSION = YES;
315 | CLANG_WARN_INFINITE_RECURSION = YES;
316 | CLANG_WARN_INT_CONVERSION = YES;
317 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
318 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
319 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
320 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
321 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
322 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
323 | CLANG_WARN_STRICT_PROTOTYPES = YES;
324 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
325 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
326 | CLANG_WARN_UNREACHABLE_CODE = YES;
327 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
328 | CODE_SIGN_IDENTITY = "iPhone Developer";
329 | COPY_PHASE_STRIP = NO;
330 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
331 | ENABLE_NS_ASSERTIONS = NO;
332 | ENABLE_STRICT_OBJC_MSGSEND = YES;
333 | GCC_C_LANGUAGE_STANDARD = gnu11;
334 | GCC_NO_COMMON_BLOCKS = YES;
335 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
336 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
337 | GCC_WARN_UNDECLARED_SELECTOR = YES;
338 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
339 | GCC_WARN_UNUSED_FUNCTION = YES;
340 | GCC_WARN_UNUSED_VARIABLE = YES;
341 | IPHONEOS_DEPLOYMENT_TARGET = 12.0;
342 | MTL_ENABLE_DEBUG_INFO = NO;
343 | SDKROOT = iphoneos;
344 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
345 | VALIDATE_PRODUCT = YES;
346 | };
347 | name = Release;
348 | };
349 | F8FF4C0A1F7655850038C912 /* Debug */ = {
350 | isa = XCBuildConfiguration;
351 | baseConfigurationReference = FAA392D3D0AFC21A3A449AD5 /* Pods-App.debug.xcconfig */;
352 | buildSettings = {
353 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
354 | CODE_SIGN_STYLE = Automatic;
355 | DEVELOPMENT_TEAM = 7EQ9KX3BR9;
356 | INFOPLIST_FILE = App/Info.plist;
357 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
358 | PRODUCT_BUNDLE_IDENTIFIER = com.vandenoord.App;
359 | PRODUCT_NAME = "$(TARGET_NAME)";
360 | SWIFT_VERSION = 5.0;
361 | TARGETED_DEVICE_FAMILY = "1,2";
362 | };
363 | name = Debug;
364 | };
365 | F8FF4C0B1F7655850038C912 /* Release */ = {
366 | isa = XCBuildConfiguration;
367 | baseConfigurationReference = 91C959B08BB6B6B9AECECD52 /* Pods-App.release.xcconfig */;
368 | buildSettings = {
369 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
370 | CODE_SIGN_STYLE = Automatic;
371 | DEVELOPMENT_TEAM = 7EQ9KX3BR9;
372 | INFOPLIST_FILE = App/Info.plist;
373 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
374 | PRODUCT_BUNDLE_IDENTIFIER = com.vandenoord.App;
375 | PRODUCT_NAME = "$(TARGET_NAME)";
376 | SWIFT_VERSION = 5.0;
377 | TARGETED_DEVICE_FAMILY = "1,2";
378 | };
379 | name = Release;
380 | };
381 | /* End XCBuildConfiguration section */
382 |
383 | /* Begin XCConfigurationList section */
384 | F8FF4BF21F7655840038C912 /* Build configuration list for PBXProject "App" */ = {
385 | isa = XCConfigurationList;
386 | buildConfigurations = (
387 | F8FF4C071F7655850038C912 /* Debug */,
388 | F8FF4C081F7655850038C912 /* Release */,
389 | );
390 | defaultConfigurationIsVisible = 0;
391 | defaultConfigurationName = Release;
392 | };
393 | F8FF4C091F7655850038C912 /* Build configuration list for PBXNativeTarget "App" */ = {
394 | isa = XCConfigurationList;
395 | buildConfigurations = (
396 | F8FF4C0A1F7655850038C912 /* Debug */,
397 | F8FF4C0B1F7655850038C912 /* Release */,
398 | );
399 | defaultConfigurationIsVisible = 0;
400 | defaultConfigurationName = Release;
401 | };
402 | /* End XCConfigurationList section */
403 | };
404 | rootObject = F8FF4BEF1F7655840038C912 /* Project object */;
405 | }
406 |
--------------------------------------------------------------------------------
/Tests/Swift5/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Tests/Swift5/App/App.xcodeproj/xcshareddata/xcschemes/App.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/Tests/Swift5/App/App/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | // Copyright © 2017 Stefan van den Oord. All rights reserved.
2 |
3 | import UIKit
4 |
5 | @UIApplicationMain
6 | class AppDelegate: UIResponder, UIApplicationDelegate {
7 |
8 | var window: UIWindow?
9 |
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/Tests/Swift5/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | }
88 | ],
89 | "info" : {
90 | "version" : 1,
91 | "author" : "xcode"
92 | }
93 | }
--------------------------------------------------------------------------------
/Tests/Swift5/App/App/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Tests/Swift5/App/App/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Tests/Swift5/App/App/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Tests/Swift5/App/App/ViewController.swift:
--------------------------------------------------------------------------------
1 | // Copyright © 2017 Stefan van den Oord. All rights reserved.
2 |
3 | import UIKit
4 | import NetUtils
5 |
6 | class ViewController: UIViewController {
7 |
8 | override func viewDidLoad() {
9 | super.viewDidLoad()
10 | print("\(Interface.allInterfaces())")
11 | }
12 |
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/Tests/Swift5/App/Podfile:
--------------------------------------------------------------------------------
1 | target 'App' do
2 | use_frameworks!
3 | pod 'NetUtils', :git => 'https://github.com/svdo/swift-NetUtils', :branch => 'master'
4 | end
5 |
--------------------------------------------------------------------------------
/Tests/Swift5/runTest.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -o pipefail
4 |
5 | scriptdir=$(cd $(dirname $0) && pwd)
6 | echo "Running Pod test for $(basename ${scriptdir})."
7 |
8 | xcodeVersion=$(xcrun xcodebuild -version)
9 | if ( ! ( echo ${xcodeVersion} | grep "Xcode 13" > /dev/null 2>&1 ) ); then
10 | echo "Expected Xcode 13.x, got "$(xcrun xcodebuild -version|grep "Xcode ")
11 | exit 1
12 | fi
13 |
14 | (
15 | cd $(dirname $0)/App
16 | pod install
17 | xcrun xcodebuild -workspace App.xcworkspace -scheme App -sdk iphonesimulator | xcpretty
18 | )
19 |
--------------------------------------------------------------------------------
/docs/Classes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Classes Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
29 |
30 |
31 | NetUtils Reference
32 |
33 | Classes Reference
34 |
35 |
36 |
37 |
60 |
61 |
62 |
63 | Classes
64 | The following classes are available globally.
65 |
66 |
67 |
68 |
69 |
70 |
71 |
78 |
79 |
80 |
81 |
82 |
83 |
This class represents a network interface in your system. For example, en0
with a certain IP address.
84 | It is a wrapper around the getifaddrs
system call.
85 |
86 |
Typical use of this class is to first call Interface.allInterfaces()
and then use the properties of the interface(s) that you need.
87 |
88 |
See
89 |
/usr/include/ifaddrs.h
90 |
91 |
92 |
93 |
See more
94 |
95 |
96 |
Declaration
97 |
98 |
Swift
99 |
open class Interface : CustomStringConvertible , CustomDebugStringConvertible
100 |
101 |
102 |
103 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/docs/Classes/Interface/Family.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Family Enumeration Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
29 |
30 |
31 | NetUtils Reference
32 |
33 | Family Enumeration Reference
34 |
35 |
36 |
37 |
60 |
61 |
62 |
63 | Family
64 |
65 |
66 |
67 |
public enum Family : Int
68 |
69 |
70 |
71 | The network interface family (IPv4 or IPv6).
72 |
73 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | ipv4
86 |
87 |
88 |
89 |
90 |
91 |
92 |
96 |
97 |
Declaration
98 |
99 |
Swift
100 |
case ipv4
101 |
102 |
103 |
104 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | ipv6
116 |
117 |
118 |
119 |
120 |
121 |
122 |
126 |
127 |
Declaration
128 |
129 |
Swift
130 |
case ipv6
131 |
132 |
133 |
134 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 | other
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
Used in case of errors.
154 |
155 |
156 |
157 |
Declaration
158 |
159 |
Swift
160 |
case other
161 |
162 |
163 |
164 |
167 |
168 |
169 |
170 |
171 |
178 |
179 |
180 |
181 |
182 |
183 |
String representation of the address family.
184 |
185 |
186 |
187 |
Declaration
188 |
189 |
Swift
190 |
public func toString () -> String
191 |
192 |
193 |
194 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
208 |
209 |
210 |
211 |
212 |
--------------------------------------------------------------------------------
/docs/Extensions.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Extensions Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
29 |
30 |
31 | NetUtils Reference
32 |
33 | Extensions Reference
34 |
35 |
36 |
37 |
60 |
61 |
62 |
63 | Extensions
64 | The following extensions are available globally.
65 |
66 |
67 |
91 |
92 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/docs/badge.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | documentation
17 |
18 |
19 | documentation
20 |
21 |
22 | 95%
23 |
24 |
25 | 95%
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docs/css/highlight.css:
--------------------------------------------------------------------------------
1 | /*! Jazzy - https://github.com/realm/jazzy
2 | * Copyright Realm Inc.
3 | * SPDX-License-Identifier: MIT
4 | */
5 | /* Credit to https://gist.github.com/wataru420/2048287 */
6 | .highlight .c {
7 | color: #999988;
8 | font-style: italic; }
9 |
10 | .highlight .err {
11 | color: #a61717;
12 | background-color: #e3d2d2; }
13 |
14 | .highlight .k {
15 | color: #000000;
16 | font-weight: bold; }
17 |
18 | .highlight .o {
19 | color: #000000;
20 | font-weight: bold; }
21 |
22 | .highlight .cm {
23 | color: #999988;
24 | font-style: italic; }
25 |
26 | .highlight .cp {
27 | color: #999999;
28 | font-weight: bold; }
29 |
30 | .highlight .c1 {
31 | color: #999988;
32 | font-style: italic; }
33 |
34 | .highlight .cs {
35 | color: #999999;
36 | font-weight: bold;
37 | font-style: italic; }
38 |
39 | .highlight .gd {
40 | color: #000000;
41 | background-color: #ffdddd; }
42 |
43 | .highlight .gd .x {
44 | color: #000000;
45 | background-color: #ffaaaa; }
46 |
47 | .highlight .ge {
48 | color: #000000;
49 | font-style: italic; }
50 |
51 | .highlight .gr {
52 | color: #aa0000; }
53 |
54 | .highlight .gh {
55 | color: #999999; }
56 |
57 | .highlight .gi {
58 | color: #000000;
59 | background-color: #ddffdd; }
60 |
61 | .highlight .gi .x {
62 | color: #000000;
63 | background-color: #aaffaa; }
64 |
65 | .highlight .go {
66 | color: #888888; }
67 |
68 | .highlight .gp {
69 | color: #555555; }
70 |
71 | .highlight .gs {
72 | font-weight: bold; }
73 |
74 | .highlight .gu {
75 | color: #aaaaaa; }
76 |
77 | .highlight .gt {
78 | color: #aa0000; }
79 |
80 | .highlight .kc {
81 | color: #000000;
82 | font-weight: bold; }
83 |
84 | .highlight .kd {
85 | color: #000000;
86 | font-weight: bold; }
87 |
88 | .highlight .kp {
89 | color: #000000;
90 | font-weight: bold; }
91 |
92 | .highlight .kr {
93 | color: #000000;
94 | font-weight: bold; }
95 |
96 | .highlight .kt {
97 | color: #445588; }
98 |
99 | .highlight .m {
100 | color: #009999; }
101 |
102 | .highlight .s {
103 | color: #d14; }
104 |
105 | .highlight .na {
106 | color: #008080; }
107 |
108 | .highlight .nb {
109 | color: #0086B3; }
110 |
111 | .highlight .nc {
112 | color: #445588;
113 | font-weight: bold; }
114 |
115 | .highlight .no {
116 | color: #008080; }
117 |
118 | .highlight .ni {
119 | color: #800080; }
120 |
121 | .highlight .ne {
122 | color: #990000;
123 | font-weight: bold; }
124 |
125 | .highlight .nf {
126 | color: #990000; }
127 |
128 | .highlight .nn {
129 | color: #555555; }
130 |
131 | .highlight .nt {
132 | color: #000080; }
133 |
134 | .highlight .nv {
135 | color: #008080; }
136 |
137 | .highlight .ow {
138 | color: #000000;
139 | font-weight: bold; }
140 |
141 | .highlight .w {
142 | color: #bbbbbb; }
143 |
144 | .highlight .mf {
145 | color: #009999; }
146 |
147 | .highlight .mh {
148 | color: #009999; }
149 |
150 | .highlight .mi {
151 | color: #009999; }
152 |
153 | .highlight .mo {
154 | color: #009999; }
155 |
156 | .highlight .sb {
157 | color: #d14; }
158 |
159 | .highlight .sc {
160 | color: #d14; }
161 |
162 | .highlight .sd {
163 | color: #d14; }
164 |
165 | .highlight .s2 {
166 | color: #d14; }
167 |
168 | .highlight .se {
169 | color: #d14; }
170 |
171 | .highlight .sh {
172 | color: #d14; }
173 |
174 | .highlight .si {
175 | color: #d14; }
176 |
177 | .highlight .sx {
178 | color: #d14; }
179 |
180 | .highlight .sr {
181 | color: #009926; }
182 |
183 | .highlight .s1 {
184 | color: #d14; }
185 |
186 | .highlight .ss {
187 | color: #990073; }
188 |
189 | .highlight .bp {
190 | color: #999999; }
191 |
192 | .highlight .vc {
193 | color: #008080; }
194 |
195 | .highlight .vg {
196 | color: #008080; }
197 |
198 | .highlight .vi {
199 | color: #008080; }
200 |
201 | .highlight .il {
202 | color: #009999; }
203 |
--------------------------------------------------------------------------------
/docs/css/jazzy.css:
--------------------------------------------------------------------------------
1 | /*! Jazzy - https://github.com/realm/jazzy
2 | * Copyright Realm Inc.
3 | * SPDX-License-Identifier: MIT
4 | */
5 | html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
6 | background: transparent;
7 | border: 0;
8 | margin: 0;
9 | outline: 0;
10 | padding: 0;
11 | vertical-align: baseline; }
12 |
13 | body {
14 | background-color: #f2f2f2;
15 | font-family: Helvetica, freesans, Arial, sans-serif;
16 | font-size: 14px;
17 | -webkit-font-smoothing: subpixel-antialiased;
18 | word-wrap: break-word; }
19 |
20 | h1, h2, h3 {
21 | margin-top: 0.8em;
22 | margin-bottom: 0.3em;
23 | font-weight: 100;
24 | color: black; }
25 |
26 | h1 {
27 | font-size: 2.5em; }
28 |
29 | h2 {
30 | font-size: 2em;
31 | border-bottom: 1px solid #e2e2e2; }
32 |
33 | h4 {
34 | font-size: 13px;
35 | line-height: 1.5;
36 | margin-top: 21px; }
37 |
38 | h5 {
39 | font-size: 1.1em; }
40 |
41 | h6 {
42 | font-size: 1.1em;
43 | color: #777; }
44 |
45 | .section-name {
46 | color: gray;
47 | display: block;
48 | font-family: Helvetica;
49 | font-size: 22px;
50 | font-weight: 100;
51 | margin-bottom: 15px; }
52 |
53 | pre, code {
54 | font: 0.95em Menlo, monospace;
55 | color: #777;
56 | word-wrap: normal; }
57 |
58 | p code, li code {
59 | background-color: #eee;
60 | padding: 2px 4px;
61 | border-radius: 4px; }
62 |
63 | pre > code {
64 | padding: 0; }
65 |
66 | a {
67 | color: #0088cc;
68 | text-decoration: none; }
69 | a code {
70 | color: inherit; }
71 |
72 | ul {
73 | padding-left: 15px; }
74 |
75 | li {
76 | line-height: 1.8em; }
77 |
78 | img {
79 | max-width: 100%; }
80 |
81 | blockquote {
82 | margin-left: 0;
83 | padding: 0 10px;
84 | border-left: 4px solid #ccc; }
85 |
86 | hr {
87 | height: 1px;
88 | border: none;
89 | background-color: #e2e2e2; }
90 |
91 | .footnote-ref {
92 | display: inline-block;
93 | scroll-margin-top: 70px; }
94 |
95 | .footnote-def {
96 | scroll-margin-top: 70px; }
97 |
98 | .content-wrapper {
99 | margin: 0 auto;
100 | width: 980px; }
101 |
102 | header {
103 | font-size: 0.85em;
104 | line-height: 32px;
105 | background-color: #414141;
106 | position: fixed;
107 | width: 100%;
108 | z-index: 3; }
109 | header img {
110 | padding-right: 6px;
111 | vertical-align: -3px;
112 | height: 16px; }
113 | header a {
114 | color: #fff; }
115 | header p {
116 | float: left;
117 | color: #999; }
118 | header .header-right {
119 | float: right;
120 | margin-left: 16px; }
121 |
122 | #breadcrumbs {
123 | background-color: #f2f2f2;
124 | height: 21px;
125 | padding-top: 17px;
126 | position: fixed;
127 | width: 100%;
128 | z-index: 2;
129 | margin-top: 32px; }
130 | #breadcrumbs #carat {
131 | height: 10px;
132 | margin: 0 5px; }
133 |
134 | .sidebar {
135 | background-color: #f9f9f9;
136 | border: 1px solid #e2e2e2;
137 | overflow-y: auto;
138 | overflow-x: hidden;
139 | position: fixed;
140 | top: 70px;
141 | bottom: 0;
142 | width: 230px;
143 | word-wrap: normal; }
144 |
145 | .nav-groups {
146 | list-style-type: none;
147 | background: #fff;
148 | padding-left: 0; }
149 |
150 | .nav-group-name {
151 | border-bottom: 1px solid #e2e2e2;
152 | font-size: 1.1em;
153 | font-weight: 100;
154 | padding: 15px 0 15px 20px; }
155 | .nav-group-name > a {
156 | color: #333; }
157 |
158 | .nav-group-tasks {
159 | margin-top: 5px; }
160 |
161 | .nav-group-task {
162 | font-size: 0.9em;
163 | list-style-type: none;
164 | white-space: nowrap; }
165 | .nav-group-task a {
166 | color: #888; }
167 |
168 | .main-content {
169 | background-color: #fff;
170 | border: 1px solid #e2e2e2;
171 | margin-left: 246px;
172 | position: absolute;
173 | overflow: hidden;
174 | padding-bottom: 20px;
175 | top: 70px;
176 | width: 734px; }
177 | .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
178 | margin-bottom: 1em; }
179 | .main-content p {
180 | line-height: 1.8em; }
181 | .main-content section .section:first-child {
182 | margin-top: 0;
183 | padding-top: 0; }
184 | .main-content section .task-group-section .task-group:first-of-type {
185 | padding-top: 10px; }
186 | .main-content section .task-group-section .task-group:first-of-type .section-name {
187 | padding-top: 15px; }
188 | .main-content section .heading:before {
189 | content: "";
190 | display: block;
191 | padding-top: 70px;
192 | margin: -70px 0 0; }
193 | .main-content .section-name p {
194 | margin-bottom: inherit;
195 | line-height: inherit; }
196 | .main-content .section-name code {
197 | background-color: inherit;
198 | padding: inherit;
199 | color: inherit; }
200 |
201 | .section {
202 | padding: 0 25px; }
203 |
204 | .highlight {
205 | background-color: #eee;
206 | padding: 10px 12px;
207 | border: 1px solid #e2e2e2;
208 | border-radius: 4px;
209 | overflow-x: auto; }
210 |
211 | .declaration .highlight {
212 | overflow-x: initial;
213 | padding: 0 40px 40px 0;
214 | margin-bottom: -25px;
215 | background-color: transparent;
216 | border: none; }
217 |
218 | .section-name {
219 | margin: 0;
220 | margin-left: 18px; }
221 |
222 | .task-group-section {
223 | margin-top: 10px;
224 | padding-left: 6px;
225 | border-top: 1px solid #e2e2e2; }
226 |
227 | .task-group {
228 | padding-top: 0px; }
229 |
230 | .task-name-container a[name]:before {
231 | content: "";
232 | display: block;
233 | padding-top: 70px;
234 | margin: -70px 0 0; }
235 |
236 | .section-name-container {
237 | position: relative;
238 | display: inline-block; }
239 | .section-name-container .section-name-link {
240 | position: absolute;
241 | top: 0;
242 | left: 0;
243 | bottom: 0;
244 | right: 0;
245 | margin-bottom: 0; }
246 | .section-name-container .section-name {
247 | position: relative;
248 | pointer-events: none;
249 | z-index: 1; }
250 | .section-name-container .section-name a {
251 | pointer-events: auto; }
252 |
253 | .item {
254 | padding-top: 8px;
255 | width: 100%;
256 | list-style-type: none; }
257 | .item a[name]:before {
258 | content: "";
259 | display: block;
260 | padding-top: 70px;
261 | margin: -70px 0 0; }
262 | .item code {
263 | background-color: transparent;
264 | padding: 0; }
265 | .item .token, .item .direct-link {
266 | display: inline-block;
267 | text-indent: -20px;
268 | padding-left: 3px;
269 | margin-left: 35px;
270 | font-size: 11.9px;
271 | transition: all 300ms; }
272 | .item .token-open {
273 | margin-left: 20px; }
274 | .item .discouraged {
275 | text-decoration: line-through; }
276 | .item .declaration-note {
277 | font-size: .85em;
278 | color: gray;
279 | font-style: italic; }
280 |
281 | .pointer-container {
282 | border-bottom: 1px solid #e2e2e2;
283 | left: -23px;
284 | padding-bottom: 13px;
285 | position: relative;
286 | width: 110%; }
287 |
288 | .pointer {
289 | background: #f9f9f9;
290 | border-left: 1px solid #e2e2e2;
291 | border-top: 1px solid #e2e2e2;
292 | height: 12px;
293 | left: 21px;
294 | top: -7px;
295 | -webkit-transform: rotate(45deg);
296 | -moz-transform: rotate(45deg);
297 | -o-transform: rotate(45deg);
298 | transform: rotate(45deg);
299 | position: absolute;
300 | width: 12px; }
301 |
302 | .height-container {
303 | display: none;
304 | left: -25px;
305 | padding: 0 25px;
306 | position: relative;
307 | width: 100%;
308 | overflow: hidden; }
309 | .height-container .section {
310 | background: #f9f9f9;
311 | border-bottom: 1px solid #e2e2e2;
312 | left: -25px;
313 | position: relative;
314 | width: 100%;
315 | padding-top: 10px;
316 | padding-bottom: 5px; }
317 |
318 | .aside, .language {
319 | padding: 6px 12px;
320 | margin: 12px 0;
321 | border-left: 5px solid #dddddd;
322 | overflow-y: hidden; }
323 | .aside .aside-title, .language .aside-title {
324 | font-size: 9px;
325 | letter-spacing: 2px;
326 | text-transform: uppercase;
327 | padding-bottom: 0;
328 | margin: 0;
329 | color: #aaa;
330 | -webkit-user-select: none; }
331 | .aside p:last-child, .language p:last-child {
332 | margin-bottom: 0; }
333 |
334 | .language {
335 | border-left: 5px solid #cde9f4; }
336 | .language .aside-title {
337 | color: #4b8afb; }
338 |
339 | .aside-warning, .aside-deprecated, .aside-unavailable {
340 | border-left: 5px solid #ff6666; }
341 | .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title {
342 | color: #ff0000; }
343 |
344 | .graybox {
345 | border-collapse: collapse;
346 | width: 100%; }
347 | .graybox p {
348 | margin: 0;
349 | word-break: break-word;
350 | min-width: 50px; }
351 | .graybox td {
352 | border: 1px solid #e2e2e2;
353 | padding: 5px 25px 5px 10px;
354 | vertical-align: middle; }
355 | .graybox tr td:first-of-type {
356 | text-align: right;
357 | padding: 7px;
358 | vertical-align: top;
359 | word-break: normal;
360 | width: 40px; }
361 |
362 | .slightly-smaller {
363 | font-size: 0.9em; }
364 |
365 | #footer {
366 | position: relative;
367 | top: 10px;
368 | bottom: 0px;
369 | margin-left: 25px; }
370 | #footer p {
371 | margin: 0;
372 | color: #aaa;
373 | font-size: 0.8em; }
374 |
375 | html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
376 | display: none; }
377 |
378 | html.dash .main-content {
379 | width: 980px;
380 | margin-left: 0;
381 | border: none;
382 | width: 100%;
383 | top: 0;
384 | padding-bottom: 0; }
385 |
386 | html.dash .height-container {
387 | display: block; }
388 |
389 | html.dash .item .token {
390 | margin-left: 0; }
391 |
392 | html.dash .content-wrapper {
393 | width: auto; }
394 |
395 | html.dash #footer {
396 | position: static; }
397 |
398 | form[role=search] {
399 | float: right; }
400 | form[role=search] input {
401 | font: Helvetica, freesans, Arial, sans-serif;
402 | margin-top: 6px;
403 | font-size: 13px;
404 | line-height: 20px;
405 | padding: 0px 10px;
406 | border: none;
407 | border-radius: 1em; }
408 | .loading form[role=search] input {
409 | background: white url(../img/spinner.gif) center right 4px no-repeat; }
410 | form[role=search] .tt-menu {
411 | margin: 0;
412 | min-width: 300px;
413 | background: #fff;
414 | color: #333;
415 | border: 1px solid #e2e2e2;
416 | z-index: 4; }
417 | form[role=search] .tt-highlight {
418 | font-weight: bold; }
419 | form[role=search] .tt-suggestion {
420 | font: Helvetica, freesans, Arial, sans-serif;
421 | font-size: 14px;
422 | padding: 0 8px; }
423 | form[role=search] .tt-suggestion span {
424 | display: table-cell;
425 | white-space: nowrap; }
426 | form[role=search] .tt-suggestion .doc-parent-name {
427 | width: 100%;
428 | text-align: right;
429 | font-weight: normal;
430 | font-size: 0.9em;
431 | padding-left: 16px; }
432 | form[role=search] .tt-suggestion:hover,
433 | form[role=search] .tt-suggestion.tt-cursor {
434 | cursor: pointer;
435 | background-color: #4183c4;
436 | color: #fff; }
437 | form[role=search] .tt-suggestion:hover .doc-parent-name,
438 | form[role=search] .tt-suggestion.tt-cursor .doc-parent-name {
439 | color: #fff; }
440 |
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleIdentifier
6 | com.jazzy.netutils
7 | CFBundleName
8 | NetUtils
9 | DocSetPlatformFamily
10 | netutils
11 | isDashDocset
12 |
13 | dashIndexFilePath
14 | index.html
15 | isJavaScriptEnabled
16 |
17 | DashDocSetFamily
18 | dashtoc
19 |
20 |
21 |
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/Classes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Classes Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
29 |
30 |
31 | NetUtils Reference
32 |
33 | Classes Reference
34 |
35 |
36 |
37 |
60 |
61 |
62 |
63 | Classes
64 | The following classes are available globally.
65 |
66 |
67 |
68 |
69 |
70 |
71 |
78 |
79 |
80 |
81 |
82 |
83 |
This class represents a network interface in your system. For example, en0
with a certain IP address.
84 | It is a wrapper around the getifaddrs
system call.
85 |
86 |
Typical use of this class is to first call Interface.allInterfaces()
and then use the properties of the interface(s) that you need.
87 |
88 |
See
89 |
/usr/include/ifaddrs.h
90 |
91 |
92 |
93 |
See more
94 |
95 |
96 |
Declaration
97 |
98 |
Swift
99 |
open class Interface : CustomStringConvertible , CustomDebugStringConvertible
100 |
101 |
102 |
103 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/Classes/Interface/Family.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Family Enumeration Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
29 |
30 |
31 | NetUtils Reference
32 |
33 | Family Enumeration Reference
34 |
35 |
36 |
37 |
60 |
61 |
62 |
63 | Family
64 |
65 |
66 |
67 |
public enum Family : Int
68 |
69 |
70 |
71 | The network interface family (IPv4 or IPv6).
72 |
73 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 | ipv4
86 |
87 |
88 |
89 |
90 |
91 |
92 |
96 |
97 |
Declaration
98 |
99 |
Swift
100 |
case ipv4
101 |
102 |
103 |
104 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | ipv6
116 |
117 |
118 |
119 |
120 |
121 |
122 |
126 |
127 |
Declaration
128 |
129 |
Swift
130 |
case ipv6
131 |
132 |
133 |
134 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 | other
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
Used in case of errors.
154 |
155 |
156 |
157 |
Declaration
158 |
159 |
Swift
160 |
case other
161 |
162 |
163 |
164 |
167 |
168 |
169 |
170 |
171 |
178 |
179 |
180 |
181 |
182 |
183 |
String representation of the address family.
184 |
185 |
186 |
187 |
Declaration
188 |
189 |
Swift
190 |
public func toString () -> String
191 |
192 |
193 |
194 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
208 |
209 |
210 |
211 |
212 |
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/Extensions.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Extensions Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
29 |
30 |
31 | NetUtils Reference
32 |
33 | Extensions Reference
34 |
35 |
36 |
37 |
60 |
61 |
62 |
63 | Extensions
64 | The following extensions are available globally.
65 |
66 |
67 |
91 |
92 |
96 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/css/highlight.css:
--------------------------------------------------------------------------------
1 | /*! Jazzy - https://github.com/realm/jazzy
2 | * Copyright Realm Inc.
3 | * SPDX-License-Identifier: MIT
4 | */
5 | /* Credit to https://gist.github.com/wataru420/2048287 */
6 | .highlight .c {
7 | color: #999988;
8 | font-style: italic; }
9 |
10 | .highlight .err {
11 | color: #a61717;
12 | background-color: #e3d2d2; }
13 |
14 | .highlight .k {
15 | color: #000000;
16 | font-weight: bold; }
17 |
18 | .highlight .o {
19 | color: #000000;
20 | font-weight: bold; }
21 |
22 | .highlight .cm {
23 | color: #999988;
24 | font-style: italic; }
25 |
26 | .highlight .cp {
27 | color: #999999;
28 | font-weight: bold; }
29 |
30 | .highlight .c1 {
31 | color: #999988;
32 | font-style: italic; }
33 |
34 | .highlight .cs {
35 | color: #999999;
36 | font-weight: bold;
37 | font-style: italic; }
38 |
39 | .highlight .gd {
40 | color: #000000;
41 | background-color: #ffdddd; }
42 |
43 | .highlight .gd .x {
44 | color: #000000;
45 | background-color: #ffaaaa; }
46 |
47 | .highlight .ge {
48 | color: #000000;
49 | font-style: italic; }
50 |
51 | .highlight .gr {
52 | color: #aa0000; }
53 |
54 | .highlight .gh {
55 | color: #999999; }
56 |
57 | .highlight .gi {
58 | color: #000000;
59 | background-color: #ddffdd; }
60 |
61 | .highlight .gi .x {
62 | color: #000000;
63 | background-color: #aaffaa; }
64 |
65 | .highlight .go {
66 | color: #888888; }
67 |
68 | .highlight .gp {
69 | color: #555555; }
70 |
71 | .highlight .gs {
72 | font-weight: bold; }
73 |
74 | .highlight .gu {
75 | color: #aaaaaa; }
76 |
77 | .highlight .gt {
78 | color: #aa0000; }
79 |
80 | .highlight .kc {
81 | color: #000000;
82 | font-weight: bold; }
83 |
84 | .highlight .kd {
85 | color: #000000;
86 | font-weight: bold; }
87 |
88 | .highlight .kp {
89 | color: #000000;
90 | font-weight: bold; }
91 |
92 | .highlight .kr {
93 | color: #000000;
94 | font-weight: bold; }
95 |
96 | .highlight .kt {
97 | color: #445588; }
98 |
99 | .highlight .m {
100 | color: #009999; }
101 |
102 | .highlight .s {
103 | color: #d14; }
104 |
105 | .highlight .na {
106 | color: #008080; }
107 |
108 | .highlight .nb {
109 | color: #0086B3; }
110 |
111 | .highlight .nc {
112 | color: #445588;
113 | font-weight: bold; }
114 |
115 | .highlight .no {
116 | color: #008080; }
117 |
118 | .highlight .ni {
119 | color: #800080; }
120 |
121 | .highlight .ne {
122 | color: #990000;
123 | font-weight: bold; }
124 |
125 | .highlight .nf {
126 | color: #990000; }
127 |
128 | .highlight .nn {
129 | color: #555555; }
130 |
131 | .highlight .nt {
132 | color: #000080; }
133 |
134 | .highlight .nv {
135 | color: #008080; }
136 |
137 | .highlight .ow {
138 | color: #000000;
139 | font-weight: bold; }
140 |
141 | .highlight .w {
142 | color: #bbbbbb; }
143 |
144 | .highlight .mf {
145 | color: #009999; }
146 |
147 | .highlight .mh {
148 | color: #009999; }
149 |
150 | .highlight .mi {
151 | color: #009999; }
152 |
153 | .highlight .mo {
154 | color: #009999; }
155 |
156 | .highlight .sb {
157 | color: #d14; }
158 |
159 | .highlight .sc {
160 | color: #d14; }
161 |
162 | .highlight .sd {
163 | color: #d14; }
164 |
165 | .highlight .s2 {
166 | color: #d14; }
167 |
168 | .highlight .se {
169 | color: #d14; }
170 |
171 | .highlight .sh {
172 | color: #d14; }
173 |
174 | .highlight .si {
175 | color: #d14; }
176 |
177 | .highlight .sx {
178 | color: #d14; }
179 |
180 | .highlight .sr {
181 | color: #009926; }
182 |
183 | .highlight .s1 {
184 | color: #d14; }
185 |
186 | .highlight .ss {
187 | color: #990073; }
188 |
189 | .highlight .bp {
190 | color: #999999; }
191 |
192 | .highlight .vc {
193 | color: #008080; }
194 |
195 | .highlight .vg {
196 | color: #008080; }
197 |
198 | .highlight .vi {
199 | color: #008080; }
200 |
201 | .highlight .il {
202 | color: #009999; }
203 |
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/css/jazzy.css:
--------------------------------------------------------------------------------
1 | /*! Jazzy - https://github.com/realm/jazzy
2 | * Copyright Realm Inc.
3 | * SPDX-License-Identifier: MIT
4 | */
5 | html, body, div, span, h1, h3, h4, p, a, code, em, img, ul, li, table, tbody, tr, td {
6 | background: transparent;
7 | border: 0;
8 | margin: 0;
9 | outline: 0;
10 | padding: 0;
11 | vertical-align: baseline; }
12 |
13 | body {
14 | background-color: #f2f2f2;
15 | font-family: Helvetica, freesans, Arial, sans-serif;
16 | font-size: 14px;
17 | -webkit-font-smoothing: subpixel-antialiased;
18 | word-wrap: break-word; }
19 |
20 | h1, h2, h3 {
21 | margin-top: 0.8em;
22 | margin-bottom: 0.3em;
23 | font-weight: 100;
24 | color: black; }
25 |
26 | h1 {
27 | font-size: 2.5em; }
28 |
29 | h2 {
30 | font-size: 2em;
31 | border-bottom: 1px solid #e2e2e2; }
32 |
33 | h4 {
34 | font-size: 13px;
35 | line-height: 1.5;
36 | margin-top: 21px; }
37 |
38 | h5 {
39 | font-size: 1.1em; }
40 |
41 | h6 {
42 | font-size: 1.1em;
43 | color: #777; }
44 |
45 | .section-name {
46 | color: gray;
47 | display: block;
48 | font-family: Helvetica;
49 | font-size: 22px;
50 | font-weight: 100;
51 | margin-bottom: 15px; }
52 |
53 | pre, code {
54 | font: 0.95em Menlo, monospace;
55 | color: #777;
56 | word-wrap: normal; }
57 |
58 | p code, li code {
59 | background-color: #eee;
60 | padding: 2px 4px;
61 | border-radius: 4px; }
62 |
63 | pre > code {
64 | padding: 0; }
65 |
66 | a {
67 | color: #0088cc;
68 | text-decoration: none; }
69 | a code {
70 | color: inherit; }
71 |
72 | ul {
73 | padding-left: 15px; }
74 |
75 | li {
76 | line-height: 1.8em; }
77 |
78 | img {
79 | max-width: 100%; }
80 |
81 | blockquote {
82 | margin-left: 0;
83 | padding: 0 10px;
84 | border-left: 4px solid #ccc; }
85 |
86 | hr {
87 | height: 1px;
88 | border: none;
89 | background-color: #e2e2e2; }
90 |
91 | .footnote-ref {
92 | display: inline-block;
93 | scroll-margin-top: 70px; }
94 |
95 | .footnote-def {
96 | scroll-margin-top: 70px; }
97 |
98 | .content-wrapper {
99 | margin: 0 auto;
100 | width: 980px; }
101 |
102 | header {
103 | font-size: 0.85em;
104 | line-height: 32px;
105 | background-color: #414141;
106 | position: fixed;
107 | width: 100%;
108 | z-index: 3; }
109 | header img {
110 | padding-right: 6px;
111 | vertical-align: -3px;
112 | height: 16px; }
113 | header a {
114 | color: #fff; }
115 | header p {
116 | float: left;
117 | color: #999; }
118 | header .header-right {
119 | float: right;
120 | margin-left: 16px; }
121 |
122 | #breadcrumbs {
123 | background-color: #f2f2f2;
124 | height: 21px;
125 | padding-top: 17px;
126 | position: fixed;
127 | width: 100%;
128 | z-index: 2;
129 | margin-top: 32px; }
130 | #breadcrumbs #carat {
131 | height: 10px;
132 | margin: 0 5px; }
133 |
134 | .sidebar {
135 | background-color: #f9f9f9;
136 | border: 1px solid #e2e2e2;
137 | overflow-y: auto;
138 | overflow-x: hidden;
139 | position: fixed;
140 | top: 70px;
141 | bottom: 0;
142 | width: 230px;
143 | word-wrap: normal; }
144 |
145 | .nav-groups {
146 | list-style-type: none;
147 | background: #fff;
148 | padding-left: 0; }
149 |
150 | .nav-group-name {
151 | border-bottom: 1px solid #e2e2e2;
152 | font-size: 1.1em;
153 | font-weight: 100;
154 | padding: 15px 0 15px 20px; }
155 | .nav-group-name > a {
156 | color: #333; }
157 |
158 | .nav-group-tasks {
159 | margin-top: 5px; }
160 |
161 | .nav-group-task {
162 | font-size: 0.9em;
163 | list-style-type: none;
164 | white-space: nowrap; }
165 | .nav-group-task a {
166 | color: #888; }
167 |
168 | .main-content {
169 | background-color: #fff;
170 | border: 1px solid #e2e2e2;
171 | margin-left: 246px;
172 | position: absolute;
173 | overflow: hidden;
174 | padding-bottom: 20px;
175 | top: 70px;
176 | width: 734px; }
177 | .main-content p, .main-content a, .main-content code, .main-content em, .main-content ul, .main-content table, .main-content blockquote {
178 | margin-bottom: 1em; }
179 | .main-content p {
180 | line-height: 1.8em; }
181 | .main-content section .section:first-child {
182 | margin-top: 0;
183 | padding-top: 0; }
184 | .main-content section .task-group-section .task-group:first-of-type {
185 | padding-top: 10px; }
186 | .main-content section .task-group-section .task-group:first-of-type .section-name {
187 | padding-top: 15px; }
188 | .main-content section .heading:before {
189 | content: "";
190 | display: block;
191 | padding-top: 70px;
192 | margin: -70px 0 0; }
193 | .main-content .section-name p {
194 | margin-bottom: inherit;
195 | line-height: inherit; }
196 | .main-content .section-name code {
197 | background-color: inherit;
198 | padding: inherit;
199 | color: inherit; }
200 |
201 | .section {
202 | padding: 0 25px; }
203 |
204 | .highlight {
205 | background-color: #eee;
206 | padding: 10px 12px;
207 | border: 1px solid #e2e2e2;
208 | border-radius: 4px;
209 | overflow-x: auto; }
210 |
211 | .declaration .highlight {
212 | overflow-x: initial;
213 | padding: 0 40px 40px 0;
214 | margin-bottom: -25px;
215 | background-color: transparent;
216 | border: none; }
217 |
218 | .section-name {
219 | margin: 0;
220 | margin-left: 18px; }
221 |
222 | .task-group-section {
223 | margin-top: 10px;
224 | padding-left: 6px;
225 | border-top: 1px solid #e2e2e2; }
226 |
227 | .task-group {
228 | padding-top: 0px; }
229 |
230 | .task-name-container a[name]:before {
231 | content: "";
232 | display: block;
233 | padding-top: 70px;
234 | margin: -70px 0 0; }
235 |
236 | .section-name-container {
237 | position: relative;
238 | display: inline-block; }
239 | .section-name-container .section-name-link {
240 | position: absolute;
241 | top: 0;
242 | left: 0;
243 | bottom: 0;
244 | right: 0;
245 | margin-bottom: 0; }
246 | .section-name-container .section-name {
247 | position: relative;
248 | pointer-events: none;
249 | z-index: 1; }
250 | .section-name-container .section-name a {
251 | pointer-events: auto; }
252 |
253 | .item {
254 | padding-top: 8px;
255 | width: 100%;
256 | list-style-type: none; }
257 | .item a[name]:before {
258 | content: "";
259 | display: block;
260 | padding-top: 70px;
261 | margin: -70px 0 0; }
262 | .item code {
263 | background-color: transparent;
264 | padding: 0; }
265 | .item .token, .item .direct-link {
266 | display: inline-block;
267 | text-indent: -20px;
268 | padding-left: 3px;
269 | margin-left: 35px;
270 | font-size: 11.9px;
271 | transition: all 300ms; }
272 | .item .token-open {
273 | margin-left: 20px; }
274 | .item .discouraged {
275 | text-decoration: line-through; }
276 | .item .declaration-note {
277 | font-size: .85em;
278 | color: gray;
279 | font-style: italic; }
280 |
281 | .pointer-container {
282 | border-bottom: 1px solid #e2e2e2;
283 | left: -23px;
284 | padding-bottom: 13px;
285 | position: relative;
286 | width: 110%; }
287 |
288 | .pointer {
289 | background: #f9f9f9;
290 | border-left: 1px solid #e2e2e2;
291 | border-top: 1px solid #e2e2e2;
292 | height: 12px;
293 | left: 21px;
294 | top: -7px;
295 | -webkit-transform: rotate(45deg);
296 | -moz-transform: rotate(45deg);
297 | -o-transform: rotate(45deg);
298 | transform: rotate(45deg);
299 | position: absolute;
300 | width: 12px; }
301 |
302 | .height-container {
303 | display: none;
304 | left: -25px;
305 | padding: 0 25px;
306 | position: relative;
307 | width: 100%;
308 | overflow: hidden; }
309 | .height-container .section {
310 | background: #f9f9f9;
311 | border-bottom: 1px solid #e2e2e2;
312 | left: -25px;
313 | position: relative;
314 | width: 100%;
315 | padding-top: 10px;
316 | padding-bottom: 5px; }
317 |
318 | .aside, .language {
319 | padding: 6px 12px;
320 | margin: 12px 0;
321 | border-left: 5px solid #dddddd;
322 | overflow-y: hidden; }
323 | .aside .aside-title, .language .aside-title {
324 | font-size: 9px;
325 | letter-spacing: 2px;
326 | text-transform: uppercase;
327 | padding-bottom: 0;
328 | margin: 0;
329 | color: #aaa;
330 | -webkit-user-select: none; }
331 | .aside p:last-child, .language p:last-child {
332 | margin-bottom: 0; }
333 |
334 | .language {
335 | border-left: 5px solid #cde9f4; }
336 | .language .aside-title {
337 | color: #4b8afb; }
338 |
339 | .aside-warning, .aside-deprecated, .aside-unavailable {
340 | border-left: 5px solid #ff6666; }
341 | .aside-warning .aside-title, .aside-deprecated .aside-title, .aside-unavailable .aside-title {
342 | color: #ff0000; }
343 |
344 | .graybox {
345 | border-collapse: collapse;
346 | width: 100%; }
347 | .graybox p {
348 | margin: 0;
349 | word-break: break-word;
350 | min-width: 50px; }
351 | .graybox td {
352 | border: 1px solid #e2e2e2;
353 | padding: 5px 25px 5px 10px;
354 | vertical-align: middle; }
355 | .graybox tr td:first-of-type {
356 | text-align: right;
357 | padding: 7px;
358 | vertical-align: top;
359 | word-break: normal;
360 | width: 40px; }
361 |
362 | .slightly-smaller {
363 | font-size: 0.9em; }
364 |
365 | #footer {
366 | position: relative;
367 | top: 10px;
368 | bottom: 0px;
369 | margin-left: 25px; }
370 | #footer p {
371 | margin: 0;
372 | color: #aaa;
373 | font-size: 0.8em; }
374 |
375 | html.dash header, html.dash #breadcrumbs, html.dash .sidebar {
376 | display: none; }
377 |
378 | html.dash .main-content {
379 | width: 980px;
380 | margin-left: 0;
381 | border: none;
382 | width: 100%;
383 | top: 0;
384 | padding-bottom: 0; }
385 |
386 | html.dash .height-container {
387 | display: block; }
388 |
389 | html.dash .item .token {
390 | margin-left: 0; }
391 |
392 | html.dash .content-wrapper {
393 | width: auto; }
394 |
395 | html.dash #footer {
396 | position: static; }
397 |
398 | form[role=search] {
399 | float: right; }
400 | form[role=search] input {
401 | font: Helvetica, freesans, Arial, sans-serif;
402 | margin-top: 6px;
403 | font-size: 13px;
404 | line-height: 20px;
405 | padding: 0px 10px;
406 | border: none;
407 | border-radius: 1em; }
408 | .loading form[role=search] input {
409 | background: white url(../img/spinner.gif) center right 4px no-repeat; }
410 | form[role=search] .tt-menu {
411 | margin: 0;
412 | min-width: 300px;
413 | background: #fff;
414 | color: #333;
415 | border: 1px solid #e2e2e2;
416 | z-index: 4; }
417 | form[role=search] .tt-highlight {
418 | font-weight: bold; }
419 | form[role=search] .tt-suggestion {
420 | font: Helvetica, freesans, Arial, sans-serif;
421 | font-size: 14px;
422 | padding: 0 8px; }
423 | form[role=search] .tt-suggestion span {
424 | display: table-cell;
425 | white-space: nowrap; }
426 | form[role=search] .tt-suggestion .doc-parent-name {
427 | width: 100%;
428 | text-align: right;
429 | font-weight: normal;
430 | font-size: 0.9em;
431 | padding-left: 16px; }
432 | form[role=search] .tt-suggestion:hover,
433 | form[role=search] .tt-suggestion.tt-cursor {
434 | cursor: pointer;
435 | background-color: #4183c4;
436 | color: #fff; }
437 | form[role=search] .tt-suggestion:hover .doc-parent-name,
438 | form[role=search] .tt-suggestion.tt-cursor .doc-parent-name {
439 | color: #fff; }
440 |
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/img/carat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svdo/swift-netutils/57aad60905759cc542886874e39addced4584271/docs/docsets/NetUtils.docset/Contents/Resources/Documents/img/carat.png
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/img/dash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svdo/swift-netutils/57aad60905759cc542886874e39addced4584271/docs/docsets/NetUtils.docset/Contents/Resources/Documents/img/dash.png
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/img/gh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svdo/swift-netutils/57aad60905759cc542886874e39addced4584271/docs/docsets/NetUtils.docset/Contents/Resources/Documents/img/gh.png
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/img/spinner.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svdo/swift-netutils/57aad60905759cc542886874e39addced4584271/docs/docsets/NetUtils.docset/Contents/Resources/Documents/img/spinner.gif
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | NetUtils Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
28 |
29 |
30 | NetUtils Reference
31 |
32 | NetUtils Reference
33 |
34 |
35 |
36 |
59 |
60 |
61 |
62 |
63 | NetUtils for Swift
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | Swift library that simplifies getting information about your network interfaces
76 | and their properties, both for iOS, macOS and Linux. This library is a wrapper
77 | around the BSD APIs like getifaddrs
, to make it easy to use them from Swift.
78 |
79 | Recommended way of integrating this library on macOS or iOS is using CocoaPods:
80 | https://cocoapods.org/pods/NetUtils . On Linux I recommend using the Swift
81 | Package Manager.
82 |
83 | This library works with both Swift 5 and Swift 5.
84 | Background Info
85 |
86 | Some system APIs you can simply use from Swift, but others you cannot. The
87 | difference is that some are made available as a module, and some are not. The
88 | APIs around network interfaces are not exposed as a module, which means that you
89 | cannot use them from Swift without defining a module for them yourself. I
90 | documented this problem extensively in a blog post .
91 | Installation
92 |
93 | This library can be installed via CocoaPods, Carthage and Swift Package Manager.
94 | Usage
95 |
96 | This module contains only one class: Interface
. This class represents a
97 | network interface. It has a static method to list all interfaces, somewhat
98 | surprisingly called allInterfaces()
. This will return an array of Interface
99 | objects, which contain properties like their IP address, family, whether they
100 | are up and running, etc.
101 |
102 | Please note that both IPv4 and IPv6 interfaces are supported.
103 | License
104 |
105 | This project is released under the MIT license .
106 |
107 |
108 |
109 |
113 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/js/jazzy.js:
--------------------------------------------------------------------------------
1 | // Jazzy - https://github.com/realm/jazzy
2 | // Copyright Realm Inc.
3 | // SPDX-License-Identifier: MIT
4 |
5 | window.jazzy = {'docset': false}
6 | if (typeof window.dash != 'undefined') {
7 | document.documentElement.className += ' dash'
8 | window.jazzy.docset = true
9 | }
10 | if (navigator.userAgent.match(/xcode/i)) {
11 | document.documentElement.className += ' xcode'
12 | window.jazzy.docset = true
13 | }
14 |
15 | function toggleItem($link, $content) {
16 | var animationDuration = 300;
17 | $link.toggleClass('token-open');
18 | $content.slideToggle(animationDuration);
19 | }
20 |
21 | function itemLinkToContent($link) {
22 | return $link.parent().parent().next();
23 | }
24 |
25 | // On doc load + hash-change, open any targetted item
26 | function openCurrentItemIfClosed() {
27 | if (window.jazzy.docset) {
28 | return;
29 | }
30 | var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token');
31 | $content = itemLinkToContent($link);
32 | if ($content.is(':hidden')) {
33 | toggleItem($link, $content);
34 | }
35 | }
36 |
37 | $(openCurrentItemIfClosed);
38 | $(window).on('hashchange', openCurrentItemIfClosed);
39 |
40 | // On item link ('token') click, toggle its discussion
41 | $('.token').on('click', function(event) {
42 | if (window.jazzy.docset) {
43 | return;
44 | }
45 | var $link = $(this);
46 | toggleItem($link, itemLinkToContent($link));
47 |
48 | // Keeps the document from jumping to the hash.
49 | var href = $link.attr('href');
50 | if (history.pushState) {
51 | history.pushState({}, '', href);
52 | } else {
53 | location.hash = href;
54 | }
55 | event.preventDefault();
56 | });
57 |
58 | // Clicks on links to the current, closed, item need to open the item
59 | $("a:not('.token')").on('click', function() {
60 | if (location == this.href) {
61 | openCurrentItemIfClosed();
62 | }
63 | });
64 |
65 | // KaTeX rendering
66 | if ("katex" in window) {
67 | $($('.math').each( (_, element) => {
68 | katex.render(element.textContent, element, {
69 | displayMode: $(element).hasClass('m-block'),
70 | throwOnError: false,
71 | trust: true
72 | });
73 | }))
74 | }
75 |
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/js/jazzy.search.js:
--------------------------------------------------------------------------------
1 | // Jazzy - https://github.com/realm/jazzy
2 | // Copyright Realm Inc.
3 | // SPDX-License-Identifier: MIT
4 |
5 | $(function(){
6 | var $typeahead = $('[data-typeahead]');
7 | var $form = $typeahead.parents('form');
8 | var searchURL = $form.attr('action');
9 |
10 | function displayTemplate(result) {
11 | return result.name;
12 | }
13 |
14 | function suggestionTemplate(result) {
15 | var t = '';
16 | t += '' + result.name + ' ';
17 | if (result.parent_name) {
18 | t += '' + result.parent_name + ' ';
19 | }
20 | t += '
';
21 | return t;
22 | }
23 |
24 | $typeahead.one('focus', function() {
25 | $form.addClass('loading');
26 |
27 | $.getJSON(searchURL).then(function(searchData) {
28 | const searchIndex = lunr(function() {
29 | this.ref('url');
30 | this.field('name');
31 | this.field('abstract');
32 | for (const [url, doc] of Object.entries(searchData)) {
33 | this.add({url: url, name: doc.name, abstract: doc.abstract});
34 | }
35 | });
36 |
37 | $typeahead.typeahead(
38 | {
39 | highlight: true,
40 | minLength: 3,
41 | autoselect: true
42 | },
43 | {
44 | limit: 10,
45 | display: displayTemplate,
46 | templates: { suggestion: suggestionTemplate },
47 | source: function(query, sync) {
48 | const lcSearch = query.toLowerCase();
49 | const results = searchIndex.query(function(q) {
50 | q.term(lcSearch, { boost: 100 });
51 | q.term(lcSearch, {
52 | boost: 10,
53 | wildcard: lunr.Query.wildcard.TRAILING
54 | });
55 | }).map(function(result) {
56 | var doc = searchData[result.ref];
57 | doc.url = result.ref;
58 | return doc;
59 | });
60 | sync(results);
61 | }
62 | }
63 | );
64 | $form.removeClass('loading');
65 | $typeahead.trigger('focus');
66 | });
67 | });
68 |
69 | var baseURL = searchURL.slice(0, -"search.json".length);
70 |
71 | $typeahead.on('typeahead:select', function(e, result) {
72 | window.location = baseURL + result.url;
73 | });
74 | });
75 |
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/Documents/search.json:
--------------------------------------------------------------------------------
1 | {"Extensions.html#/Interface":{"name":"Interface"},"Classes/Interface/Family.html#/s:8NetUtils9InterfaceC6FamilyO4ipv4yA2EmF":{"name":"ipv4","abstract":"IPv4.
","parent_name":"Family"},"Classes/Interface/Family.html#/s:8NetUtils9InterfaceC6FamilyO4ipv6yA2EmF":{"name":"ipv6","abstract":"IPv6.
","parent_name":"Family"},"Classes/Interface/Family.html#/s:8NetUtils9InterfaceC6FamilyO5otheryA2EmF":{"name":"other","abstract":"Used in case of errors.
","parent_name":"Family"},"Classes/Interface/Family.html#/s:8NetUtils9InterfaceC6FamilyO8toStringSSyF":{"name":"toString()","abstract":"String representation of the address family.
","parent_name":"Family"},"Classes/Interface.html#/s:8NetUtils9InterfaceC2id10Foundation4UUIDVvp":{"name":"id","abstract":"Undocumented
","parent_name":"Interface"},"Classes/Interface/Family.html":{"name":"Family","abstract":"The network interface family (IPv4 or IPv6).
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC13allInterfacesSayACGyFZ":{"name":"allInterfaces()","abstract":"Returns all network interfaces in your system. If you have an interface name (e.g. en0
) that has","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC15createTestDummy_6family7address18multicastSupported16broadcastAddressACSS_AC6FamilyOSSSbSSSgtFZ":{"name":"createTestDummy(_:family:address:multicastSupported:broadcastAddress:)","abstract":"
Returns a new Interface instance that does not represent a real network interface, but can be used for (unit) testing.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC4name6family7address7netmask7running2up8loopback18multicastSupported16broadcastAddressACSS_AC6FamilyOSSSgAOS4bAOtcfc":{"name":"init(name:family:address:netmask:running:up:loopback:multicastSupported:broadcastAddress:)","abstract":"Initialize a new Interface with the given properties.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC12addressBytesSays5UInt8VGSgvp":{"name":"addressBytes","abstract":"Creates the network format representation of the interface’s IP address. Wraps inet_pton
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC9isRunningSbvp":{"name":"isRunning","abstract":"IFF_RUNNING
flag of ifaddrs->ifa_flags
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC4isUpSbvp":{"name":"isUp","abstract":"IFF_UP
flag of ifaddrs->ifa_flags
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC10isLoopbackSbvp":{"name":"isLoopback","abstract":"IFF_LOOPBACK
flag of ifaddrs->ifa_flags
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC17supportsMulticastSbvp":{"name":"supportsMulticast","abstract":"IFF_MULTICAST
flag of ifaddrs->ifa_flags
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC4nameSSvp":{"name":"name","abstract":"Field ifaddrs->ifa_name
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC6familyAC6FamilyOvp":{"name":"family","abstract":"Field ifaddrs->ifa_addr->sa_family
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC7addressSSSgvp":{"name":"address","abstract":"Extracted from ifaddrs->ifa_addr
, supports both IPv4 and IPv6.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC7netmaskSSSgvp":{"name":"netmask","abstract":"Extracted from ifaddrs->ifa_netmask
, supports both IPv4 and IPv6.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC16broadcastAddressSSSgvp":{"name":"broadcastAddress","abstract":"Extracted from ifaddrs->ifa_dstaddr
. Not applicable for IPv6.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC11descriptionSSvp":{"name":"description","abstract":"Returns the interface name.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC16debugDescriptionSSvp":{"name":"debugDescription","abstract":"Returns a string containing a few properties of the Interface.
","parent_name":"Interface"},"Classes/Interface.html":{"name":"Interface","abstract":"This class represents a network interface in your system. For example, en0
with a certain IP address."},"Classes.html":{"name":"Classes","abstract":"
The following classes are available globally.
"},"Extensions.html":{"name":"Extensions","abstract":"The following extensions are available globally.
"}}
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.docset/Contents/Resources/docSet.dsidx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svdo/swift-netutils/57aad60905759cc542886874e39addced4584271/docs/docsets/NetUtils.docset/Contents/Resources/docSet.dsidx
--------------------------------------------------------------------------------
/docs/docsets/NetUtils.tgz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svdo/swift-netutils/57aad60905759cc542886874e39addced4584271/docs/docsets/NetUtils.tgz
--------------------------------------------------------------------------------
/docs/img/carat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svdo/swift-netutils/57aad60905759cc542886874e39addced4584271/docs/img/carat.png
--------------------------------------------------------------------------------
/docs/img/dash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svdo/swift-netutils/57aad60905759cc542886874e39addced4584271/docs/img/dash.png
--------------------------------------------------------------------------------
/docs/img/gh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svdo/swift-netutils/57aad60905759cc542886874e39addced4584271/docs/img/gh.png
--------------------------------------------------------------------------------
/docs/img/spinner.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/svdo/swift-netutils/57aad60905759cc542886874e39addced4584271/docs/img/spinner.gif
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | NetUtils Reference
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
28 |
29 |
30 | NetUtils Reference
31 |
32 | NetUtils Reference
33 |
34 |
35 |
36 |
59 |
60 |
61 |
62 |
63 | NetUtils for Swift
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | Swift library that simplifies getting information about your network interfaces
76 | and their properties, both for iOS, macOS and Linux. This library is a wrapper
77 | around the BSD APIs like getifaddrs
, to make it easy to use them from Swift.
78 |
79 | Recommended way of integrating this library on macOS or iOS is using CocoaPods:
80 | https://cocoapods.org/pods/NetUtils . On Linux I recommend using the Swift
81 | Package Manager.
82 |
83 | This library works with both Swift 5 and Swift 5.
84 | Background Info
85 |
86 | Some system APIs you can simply use from Swift, but others you cannot. The
87 | difference is that some are made available as a module, and some are not. The
88 | APIs around network interfaces are not exposed as a module, which means that you
89 | cannot use them from Swift without defining a module for them yourself. I
90 | documented this problem extensively in a blog post .
91 | Installation
92 |
93 | This library can be installed via CocoaPods, Carthage and Swift Package Manager.
94 | Usage
95 |
96 | This module contains only one class: Interface
. This class represents a
97 | network interface. It has a static method to list all interfaces, somewhat
98 | surprisingly called allInterfaces()
. This will return an array of Interface
99 | objects, which contain properties like their IP address, family, whether they
100 | are up and running, etc.
101 |
102 | Please note that both IPv4 and IPv6 interfaces are supported.
103 | License
104 |
105 | This project is released under the MIT license .
106 |
107 |
108 |
109 |
113 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/docs/js/jazzy.js:
--------------------------------------------------------------------------------
1 | // Jazzy - https://github.com/realm/jazzy
2 | // Copyright Realm Inc.
3 | // SPDX-License-Identifier: MIT
4 |
5 | window.jazzy = {'docset': false}
6 | if (typeof window.dash != 'undefined') {
7 | document.documentElement.className += ' dash'
8 | window.jazzy.docset = true
9 | }
10 | if (navigator.userAgent.match(/xcode/i)) {
11 | document.documentElement.className += ' xcode'
12 | window.jazzy.docset = true
13 | }
14 |
15 | function toggleItem($link, $content) {
16 | var animationDuration = 300;
17 | $link.toggleClass('token-open');
18 | $content.slideToggle(animationDuration);
19 | }
20 |
21 | function itemLinkToContent($link) {
22 | return $link.parent().parent().next();
23 | }
24 |
25 | // On doc load + hash-change, open any targetted item
26 | function openCurrentItemIfClosed() {
27 | if (window.jazzy.docset) {
28 | return;
29 | }
30 | var $link = $(`a[name="${location.hash.substring(1)}"]`).nextAll('.token');
31 | $content = itemLinkToContent($link);
32 | if ($content.is(':hidden')) {
33 | toggleItem($link, $content);
34 | }
35 | }
36 |
37 | $(openCurrentItemIfClosed);
38 | $(window).on('hashchange', openCurrentItemIfClosed);
39 |
40 | // On item link ('token') click, toggle its discussion
41 | $('.token').on('click', function(event) {
42 | if (window.jazzy.docset) {
43 | return;
44 | }
45 | var $link = $(this);
46 | toggleItem($link, itemLinkToContent($link));
47 |
48 | // Keeps the document from jumping to the hash.
49 | var href = $link.attr('href');
50 | if (history.pushState) {
51 | history.pushState({}, '', href);
52 | } else {
53 | location.hash = href;
54 | }
55 | event.preventDefault();
56 | });
57 |
58 | // Clicks on links to the current, closed, item need to open the item
59 | $("a:not('.token')").on('click', function() {
60 | if (location == this.href) {
61 | openCurrentItemIfClosed();
62 | }
63 | });
64 |
65 | // KaTeX rendering
66 | if ("katex" in window) {
67 | $($('.math').each( (_, element) => {
68 | katex.render(element.textContent, element, {
69 | displayMode: $(element).hasClass('m-block'),
70 | throwOnError: false,
71 | trust: true
72 | });
73 | }))
74 | }
75 |
--------------------------------------------------------------------------------
/docs/js/jazzy.search.js:
--------------------------------------------------------------------------------
1 | // Jazzy - https://github.com/realm/jazzy
2 | // Copyright Realm Inc.
3 | // SPDX-License-Identifier: MIT
4 |
5 | $(function(){
6 | var $typeahead = $('[data-typeahead]');
7 | var $form = $typeahead.parents('form');
8 | var searchURL = $form.attr('action');
9 |
10 | function displayTemplate(result) {
11 | return result.name;
12 | }
13 |
14 | function suggestionTemplate(result) {
15 | var t = '';
16 | t += '' + result.name + ' ';
17 | if (result.parent_name) {
18 | t += '' + result.parent_name + ' ';
19 | }
20 | t += '
';
21 | return t;
22 | }
23 |
24 | $typeahead.one('focus', function() {
25 | $form.addClass('loading');
26 |
27 | $.getJSON(searchURL).then(function(searchData) {
28 | const searchIndex = lunr(function() {
29 | this.ref('url');
30 | this.field('name');
31 | this.field('abstract');
32 | for (const [url, doc] of Object.entries(searchData)) {
33 | this.add({url: url, name: doc.name, abstract: doc.abstract});
34 | }
35 | });
36 |
37 | $typeahead.typeahead(
38 | {
39 | highlight: true,
40 | minLength: 3,
41 | autoselect: true
42 | },
43 | {
44 | limit: 10,
45 | display: displayTemplate,
46 | templates: { suggestion: suggestionTemplate },
47 | source: function(query, sync) {
48 | const lcSearch = query.toLowerCase();
49 | const results = searchIndex.query(function(q) {
50 | q.term(lcSearch, { boost: 100 });
51 | q.term(lcSearch, {
52 | boost: 10,
53 | wildcard: lunr.Query.wildcard.TRAILING
54 | });
55 | }).map(function(result) {
56 | var doc = searchData[result.ref];
57 | doc.url = result.ref;
58 | return doc;
59 | });
60 | sync(results);
61 | }
62 | }
63 | );
64 | $form.removeClass('loading');
65 | $typeahead.trigger('focus');
66 | });
67 | });
68 |
69 | var baseURL = searchURL.slice(0, -"search.json".length);
70 |
71 | $typeahead.on('typeahead:select', function(e, result) {
72 | window.location = baseURL + result.url;
73 | });
74 | });
75 |
--------------------------------------------------------------------------------
/docs/search.json:
--------------------------------------------------------------------------------
1 | {"Extensions.html#/Interface":{"name":"Interface"},"Classes/Interface/Family.html#/s:8NetUtils9InterfaceC6FamilyO4ipv4yA2EmF":{"name":"ipv4","abstract":"IPv4.
","parent_name":"Family"},"Classes/Interface/Family.html#/s:8NetUtils9InterfaceC6FamilyO4ipv6yA2EmF":{"name":"ipv6","abstract":"IPv6.
","parent_name":"Family"},"Classes/Interface/Family.html#/s:8NetUtils9InterfaceC6FamilyO5otheryA2EmF":{"name":"other","abstract":"Used in case of errors.
","parent_name":"Family"},"Classes/Interface/Family.html#/s:8NetUtils9InterfaceC6FamilyO8toStringSSyF":{"name":"toString()","abstract":"String representation of the address family.
","parent_name":"Family"},"Classes/Interface.html#/s:8NetUtils9InterfaceC2id10Foundation4UUIDVvp":{"name":"id","abstract":"Undocumented
","parent_name":"Interface"},"Classes/Interface/Family.html":{"name":"Family","abstract":"The network interface family (IPv4 or IPv6).
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC13allInterfacesSayACGyFZ":{"name":"allInterfaces()","abstract":"Returns all network interfaces in your system. If you have an interface name (e.g. en0
) that has","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC15createTestDummy_6family7address18multicastSupported16broadcastAddressACSS_AC6FamilyOSSSbSSSgtFZ":{"name":"createTestDummy(_:family:address:multicastSupported:broadcastAddress:)","abstract":"
Returns a new Interface instance that does not represent a real network interface, but can be used for (unit) testing.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC4name6family7address7netmask7running2up8loopback18multicastSupported16broadcastAddressACSS_AC6FamilyOSSSgAOS4bAOtcfc":{"name":"init(name:family:address:netmask:running:up:loopback:multicastSupported:broadcastAddress:)","abstract":"Initialize a new Interface with the given properties.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC12addressBytesSays5UInt8VGSgvp":{"name":"addressBytes","abstract":"Creates the network format representation of the interface’s IP address. Wraps inet_pton
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC9isRunningSbvp":{"name":"isRunning","abstract":"IFF_RUNNING
flag of ifaddrs->ifa_flags
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC4isUpSbvp":{"name":"isUp","abstract":"IFF_UP
flag of ifaddrs->ifa_flags
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC10isLoopbackSbvp":{"name":"isLoopback","abstract":"IFF_LOOPBACK
flag of ifaddrs->ifa_flags
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC17supportsMulticastSbvp":{"name":"supportsMulticast","abstract":"IFF_MULTICAST
flag of ifaddrs->ifa_flags
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC4nameSSvp":{"name":"name","abstract":"Field ifaddrs->ifa_name
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC6familyAC6FamilyOvp":{"name":"family","abstract":"Field ifaddrs->ifa_addr->sa_family
.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC7addressSSSgvp":{"name":"address","abstract":"Extracted from ifaddrs->ifa_addr
, supports both IPv4 and IPv6.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC7netmaskSSSgvp":{"name":"netmask","abstract":"Extracted from ifaddrs->ifa_netmask
, supports both IPv4 and IPv6.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC16broadcastAddressSSSgvp":{"name":"broadcastAddress","abstract":"Extracted from ifaddrs->ifa_dstaddr
. Not applicable for IPv6.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC11descriptionSSvp":{"name":"description","abstract":"Returns the interface name.
","parent_name":"Interface"},"Classes/Interface.html#/s:8NetUtils9InterfaceC16debugDescriptionSSvp":{"name":"debugDescription","abstract":"Returns a string containing a few properties of the Interface.
","parent_name":"Interface"},"Classes/Interface.html":{"name":"Interface","abstract":"This class represents a network interface in your system. For example, en0
with a certain IP address."},"Classes.html":{"name":"Classes","abstract":"
The following classes are available globally.
"},"Extensions.html":{"name":"Extensions","abstract":"The following extensions are available globally.
"}}
--------------------------------------------------------------------------------
/docs/undocumented.json:
--------------------------------------------------------------------------------
1 | {
2 | "warnings": [
3 | {
4 | "file": "/Users/stefan/Documents/Projects/iPhoneProjects/swift-netutils/NetUtils/Interface.swift",
5 | "line": 35,
6 | "symbol": "Interface.id",
7 | "symbol_kind": "source.lang.swift.decl.var.instance",
8 | "warning": "undocumented"
9 | }
10 | ],
11 | "source_directory": "/Users/stefan/Documents/Projects/iPhoneProjects/swift-netutils"
12 | }
--------------------------------------------------------------------------------
/ifaddrs/injectXcodePath.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -x
4 |
5 | defaultXcodePath="/Applications/Xcode.app/Contents/Developer"
6 | realXcodePath="`xcode-select -p`"
7 |
8 | fatal() {
9 | echo "[fatal] $1" 1>&2
10 | exit 1
11 | }
12 |
13 | absPath() {
14 | case "$1" in
15 | /*)
16 | printf "%s\n" "$1"
17 | ;;
18 | *)
19 | printf "%s\n" "$PWD/$1"
20 | ;;
21 | esac;
22 | }
23 |
24 | scriptDir="`dirname $0`"
25 | scriptName="`basename $0`"
26 | absScriptDir="`cd $scriptDir; pwd`"
27 |
28 | main() {
29 | xcodeMajor=$(xcrun xcodebuild -version|grep -E "Xcode \d+\.\d+(\.\d+)?"|cut -d ' ' -f 2|cut -d '.' -f 1)
30 | set -i xcodeMajor
31 | if [ ${xcodeMajor} -lt 9 ]; then
32 | echo "Xcode prior to 9: ifaddrs module maps needed."
33 | for f in `find ${absScriptDir} -name module.modulemap`; do
34 | cat ${f} | sed "s,${defaultXcodePath},${realXcodePath},g" > ${f}.new || fatal "Failed to update modulemap ${f}"
35 | mv ${f}.new ${f} || fatal "Failed to replace modulemap ${f}"
36 | done
37 | else
38 | echo "Xcode 9 and above: ifaddrs module maps not needed."
39 | cd $(dirname $0)
40 | rm -f */module.modulemap
41 | fi
42 |
43 | }
44 |
45 | main $*
46 |
--------------------------------------------------------------------------------