SCNetworkConnection.pas 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. {
  2. * Copyright (c) 2002-2003 Apple Computer, 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. { Pascal Translation: Peter N Lewis, <[email protected]>, 2004 }
  24. {
  25. Modified for use with Free Pascal
  26. Version 200
  27. Please report any bugs to <[email protected]>
  28. }
  29. {$mode macpas}
  30. {$packenum 1}
  31. {$macro on}
  32. {$inline on}
  33. {$CALLING MWPASCAL}
  34. unit SCNetworkConnection;
  35. interface
  36. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  37. {$setc GAP_INTERFACES_VERSION := $0200}
  38. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  39. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  40. {$endc}
  41. {$ifc defined CPUPOWERPC and defined CPUI386}
  42. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  43. {$endc}
  44. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  45. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  46. {$endc}
  47. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  48. {$setc __ppc__ := 1}
  49. {$elsec}
  50. {$setc __ppc__ := 0}
  51. {$endc}
  52. {$ifc not defined __i386__ and defined CPUI386}
  53. {$setc __i386__ := 1}
  54. {$elsec}
  55. {$setc __i386__ := 0}
  56. {$endc}
  57. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  58. {$error Conflicting definitions for __ppc__ and __i386__}
  59. {$endc}
  60. {$ifc defined __ppc__ and __ppc__}
  61. {$setc TARGET_CPU_PPC := TRUE}
  62. {$setc TARGET_CPU_X86 := FALSE}
  63. {$elifc defined __i386__ and __i386__}
  64. {$setc TARGET_CPU_PPC := FALSE}
  65. {$setc TARGET_CPU_X86 := TRUE}
  66. {$elsec}
  67. {$error Neither __ppc__ nor __i386__ is defined.}
  68. {$endc}
  69. {$setc TARGET_CPU_PPC_64 := FALSE}
  70. {$ifc defined FPC_BIG_ENDIAN}
  71. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  72. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  73. {$elifc defined FPC_LITTLE_ENDIAN}
  74. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  75. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  76. {$elsec}
  77. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  78. {$endc}
  79. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  80. {$setc CALL_NOT_IN_CARBON := FALSE}
  81. {$setc OLDROUTINENAMES := FALSE}
  82. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  83. {$setc OPAQUE_UPP_TYPES := TRUE}
  84. {$setc OTCARBONAPPLICATION := TRUE}
  85. {$setc OTKERNEL := FALSE}
  86. {$setc PM_USE_SESSION_APIS := TRUE}
  87. {$setc TARGET_API_MAC_CARBON := TRUE}
  88. {$setc TARGET_API_MAC_OS8 := FALSE}
  89. {$setc TARGET_API_MAC_OSX := TRUE}
  90. {$setc TARGET_CARBON := TRUE}
  91. {$setc TARGET_CPU_68K := FALSE}
  92. {$setc TARGET_CPU_MIPS := FALSE}
  93. {$setc TARGET_CPU_SPARC := FALSE}
  94. {$setc TARGET_OS_MAC := TRUE}
  95. {$setc TARGET_OS_UNIX := FALSE}
  96. {$setc TARGET_OS_WIN32 := FALSE}
  97. {$setc TARGET_RT_MAC_68881 := FALSE}
  98. {$setc TARGET_RT_MAC_CFM := FALSE}
  99. {$setc TARGET_RT_MAC_MACHO := TRUE}
  100. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  101. {$setc TYPE_BOOL := FALSE}
  102. {$setc TYPE_EXTENDED := FALSE}
  103. {$setc TYPE_LONGLONG := TRUE}
  104. uses MacTypes,CFBase,CFDictionary,CFRunLoop;
  105. {$ALIGN MAC68K}
  106. {!
  107. @header SCNetworkConnection
  108. The SCNetworkConnectionXXX() APIs allow an application to
  109. control connection oriented services defined in the system.
  110. This is a set of control APIs only. Using these APIs, an
  111. application will be able to control existing services.
  112. To create, change, or remove services, SCPreferences APIs
  113. must be used.
  114. Note: Currently only PPP services can be controlled.
  115. }
  116. {!
  117. @typedef SCNetworkConnectionRef
  118. @discussion This is the handle to manage a connection oriented service.
  119. }
  120. type
  121. SCNetworkConnectionRef = ^SInt32;
  122. {!
  123. @typedef SCNetworkConnectionContext
  124. }
  125. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  126. type SCNetworkConnectionContext = record
  127. version: CFIndex;
  128. info: Ptr;
  129. retain: function( info: Ptr ): Ptr;
  130. release: procedure( info: Ptr );
  131. copyDescription: function( info: Ptr ): CFStringRef;
  132. end;
  133. SCNetworkConnectionContextPtr = ^SCNetworkConnectionContext;
  134. {!
  135. @enum SCNetworkConnectionStatus
  136. @discussion Status of the network connection.
  137. This status is intended to be generic and high level.
  138. An extended status, specific to the type of network
  139. connection is also available for applications that
  140. need additonal information.
  141. @constant kSCNetworkConnectionInvalid
  142. The network connection refers to an invalid service.
  143. @constant kSCNetworkConnectionDisconnected
  144. The network connection is disconnected.
  145. @constant kSCNetworkConnectionConnecting
  146. The network connection is connecting.
  147. @constant kSCNetworkConnectionConnected
  148. The network connection is connected.
  149. @constant kSCNetworkConnectionDisconnecting
  150. The network connection is disconnecting.
  151. }
  152. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  153. type
  154. SCNetworkConnectionStatus = SInt32;
  155. const
  156. kSCNetworkConnectionInvalid = -1;
  157. kSCNetworkConnectionDisconnected = 0;
  158. kSCNetworkConnectionConnecting = 1;
  159. kSCNetworkConnectionConnected = 2;
  160. kSCNetworkConnectionDisconnecting = 3;
  161. {!
  162. @enum SCNetworkConnectionPPPStatus
  163. @discussion PPP specific status of the network connection.
  164. This status is PPP specific and returned as part of the extended information
  165. for a PPP service.
  166. Note: additional status might be returned in the future, and the application should
  167. be prepared to receive an unknown value.
  168. @constant kSCNetworkConnectionPPPDisconnected
  169. PPP is disconnected.
  170. @constant kSCNetworkConnectionPPPInitializing
  171. PPP is initializing.
  172. @constant kSCNetworkConnectionPPPConnectingLink
  173. PPP is connecting the lower connection layer (for example, the modem is dialing out).
  174. @constant kSCNetworkConnectionPPPDialOnTraffic
  175. PPP is waiting for networking traffic to automatically establish the connection.
  176. @constant kSCNetworkConnectionPPPNegotiatingLink
  177. PPP lower layer is connected and PPP is negotiating the link layer (LCP protocol).
  178. @constant kSCNetworkConnectionPPPAuthenticating
  179. PPP is authenticating to the server (PAP, CHAP, MS-CHAP or EAP protocols).
  180. @constant kSCNetworkConnectionPPPWaitingForCallBack
  181. PPP is waiting for server to call back.
  182. @constant kSCNetworkConnectionPPPNegotiatingNetwork
  183. PPP is now authenticated and negotiating the networking layer (IPCP or IPv6CP protocols)
  184. @constant kSCNetworkConnectionPPPConnected
  185. PPP is now fully connected for at least one of the networking layer.
  186. Additional networking protocol might still be negotiating.
  187. @constant kSCNetworkConnectionPPPTerminating
  188. PPP networking and link protocols are terminating.
  189. @constant kSCNetworkConnectionPPPDisconnectingLink
  190. PPP is disconnecting the lower level (for example, the modem is hanging up).
  191. @constant kSCNetworkConnectionPPPHoldingLinkOff
  192. PPP is disconnected and maintaining the link temporarily off.
  193. @constant kSCNetworkConnectionPPPSuspended
  194. PPP is suspended as a result of the suspend command (for example, when a V92 Modem is On Hold).
  195. @constant kSCNetworkConnectionPPPWaitingForRedial
  196. PPP has found a busy server and is waiting for redial.
  197. }
  198. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  199. type
  200. SCNetworkConnectionPPPStatus = SInt32;
  201. const
  202. kSCNetworkConnectionPPPDisconnected = 0;
  203. kSCNetworkConnectionPPPInitializing = 1;
  204. kSCNetworkConnectionPPPConnectingLink = 2;
  205. kSCNetworkConnectionPPPDialOnTraffic = 3;
  206. kSCNetworkConnectionPPPNegotiatingLink = 4;
  207. kSCNetworkConnectionPPPAuthenticating = 5;
  208. kSCNetworkConnectionPPPWaitingForCallBack = 6;
  209. kSCNetworkConnectionPPPNegotiatingNetwork = 7;
  210. kSCNetworkConnectionPPPConnected = 8;
  211. kSCNetworkConnectionPPPTerminating = 9;
  212. kSCNetworkConnectionPPPDisconnectingLink = 10;
  213. kSCNetworkConnectionPPPHoldingLinkOff = 11;
  214. kSCNetworkConnectionPPPSuspended = 12;
  215. kSCNetworkConnectionPPPWaitingForRedial = 13;
  216. {!
  217. @typedef SCNetworkConnectionCallBack
  218. @discussion Type of the callback function used when a
  219. status event is delivered.
  220. @param status The connection status.
  221. @param connection The connection reference.
  222. @param info ....
  223. }
  224. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  225. type SCNetworkConnectionCallBack = procedure( connection: SCNetworkConnectionRef; status: SCNetworkConnectionStatus; info: Ptr );
  226. {
  227. Keys for the statistics dictionary
  228. }
  229. {$ifc USE_CFSTR_CONSTANT_MACROS}
  230. {$definec kSCNetworkConnectionBytesIn CFSTRP('BytesIn')}
  231. {$endc} { CFNumber }
  232. {$ifc USE_CFSTR_CONSTANT_MACROS}
  233. {$definec kSCNetworkConnectionBytesOut CFSTRP('BytesOut')}
  234. {$endc} { CFNumber }
  235. {$ifc USE_CFSTR_CONSTANT_MACROS}
  236. {$definec kSCNetworkConnectionPacketsIn CFSTRP('PacketsIn')}
  237. {$endc} { CFNumber }
  238. {$ifc USE_CFSTR_CONSTANT_MACROS}
  239. {$definec kSCNetworkConnectionPacketsOut CFSTRP('PacketsOut')}
  240. {$endc} { CFNumber }
  241. {$ifc USE_CFSTR_CONSTANT_MACROS}
  242. {$definec kSCNetworkConnectionErrorsIn CFSTRP('ErrorsIn')}
  243. {$endc} { CFNumber }
  244. {$ifc USE_CFSTR_CONSTANT_MACROS}
  245. {$definec kSCNetworkConnectionErrorsOut CFSTRP('ErrorsOut')}
  246. {$endc} { CFNumber }
  247. {!
  248. @function SCDynamicStoreGetTypeID
  249. Returns the type identifier of all SCNetworkConnection instances.
  250. }
  251. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  252. function SCNetworkConnectionGetTypeID: CFTypeID; external name '_SCNetworkConnectionGetTypeID';
  253. {!
  254. @function SCNetworkConnectionCopyUserPreferences
  255. @discussion Provides the default serviceID and a userOptions dictionary for the connection.
  256. Applications can use the serviceID and userOptions returned to open a connection on the fly.
  257. @param selectionOptions Currently unimplemented. Pass NULL for this version.
  258. @param serviceID Reference to the default serviceID for starting connections,
  259. this value will be returned by the function.
  260. @param userOptions Reference to default userOptions for starting connections,
  261. this will be returned by the function.
  262. @result TRUE if there is a valid service to dial.
  263. FALSE if function was unable to retrieve a service to dial.
  264. }
  265. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  266. function SCNetworkConnectionCopyUserPreferences( selectionOptions: CFDictionaryRef; var serviceID: CFStringRef; var userOptions: CFDictionaryRef ): Boolean; external name '_SCNetworkConnectionCopyUserPreferences';
  267. {!
  268. @function SCNetworkConnectionCreateWithServiceID
  269. @discussion Creates a new connection reference to use for getting the status,
  270. for connecting or for disconnecting the associated service.
  271. @param allocator The CFAllocator which should be used to allocate
  272. memory for the connection structure.
  273. This parameter may be NULL in which case the current
  274. default CFAllocator is used. If this reference is not
  275. a valid CFAllocator, the behavior is undefined.
  276. @param serviceID A string that defines the service identifier
  277. of the connection. Service identifiers uniquely identify
  278. services in the system configuration database.
  279. @param callout The function to be called when the status
  280. of the connection changes.
  281. If this parameter is NULL, the application will not receive
  282. change of status notifications and will need to poll for updates.
  283. @param context The SCNetworkConnectionContext associated with the callout.
  284. @result A reference to the new SCNetworkConnection.
  285. }
  286. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  287. function SCNetworkConnectionCreateWithServiceID( allocator: CFAllocatorRef; serviceID: CFStringRef; callout: SCNetworkConnectionCallBack; var context: SCNetworkConnectionContext ): SCNetworkConnectionRef; external name '_SCNetworkConnectionCreateWithServiceID';
  288. {!
  289. @function SCNetworkConnectionCopyService
  290. @discussion Returns the service ID associated with the SCNetworkConnection.
  291. @param connection The SCNetworkConnection to obtained status from.
  292. Returns the service ID associated with the SCNetworkConnection.
  293. }
  294. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  295. function SCNetworkConnectionCopyServiceID( connection: SCNetworkConnectionRef ): CFStringRef; external name '_SCNetworkConnectionCopyServiceID';
  296. {!
  297. @function SCNetworkConnectionGetStatus
  298. @discussion Returns the status of the SCNetworkConnection.
  299. A status is one of the following values :
  300. kSCNetworkConnectionInvalid
  301. kSCNetworkConnectionDisconnected
  302. kSCNetworkConnectionConnecting
  303. kSCNetworkConnectionDisconnecting
  304. kSCNetworkConnectionConnected
  305. @param connection The SCNetworkConnection to obtain status from.
  306. @result The status value.
  307. }
  308. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  309. function SCNetworkConnectionGetStatus( connection: SCNetworkConnectionRef ): SCNetworkConnectionStatus; external name '_SCNetworkConnectionGetStatus';
  310. {!
  311. @function SCNetworkConnectionCopyExtendedStatus
  312. @discussion Returns the extended status of the connection.
  313. An extended status dictionary contains specific dictionaries
  314. describing the status for each subcomponent of the service.
  315. For example, a status dictionary will contain the following dictionaries:
  316. IPv4:
  317. IPaddress: IP address used.
  318. PPP:
  319. Status: PPP specific status of type SCNetworkConnectionPPPStatus.
  320. LastCause: Available when status is Disconnected.
  321. Contains the last error of disconnection.
  322. ConnectTime: time when the connection happened
  323. MaxTime: maximum time for this connection
  324. Modem:
  325. ConnectionSpeed: Speed of the modem connection in bits/s
  326. Other dictionaries could be present for PPPoE, PPTP and L2TP.
  327. The status dictionary can be extended as needed in the future
  328. to contain additional information.
  329. @param connection The SCNetworkConnection to obtain status from.
  330. @result The status dictionary.
  331. If NULL is returned, the error can be retrieved with SCError().
  332. }
  333. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  334. function SCNetworkConnectionCopyExtendedStatus( connection: SCNetworkConnectionRef ): CFDictionaryRef; external name '_SCNetworkConnectionCopyExtendedStatus';
  335. {!
  336. @function SCNetworkConnectionCopyStatistics
  337. @discussion Returns the statistics of the SCNetworkConnection.
  338. A statistic dictionary contains specific dictionaries
  339. with statistics for each subcomponents of the service.
  340. For example, a statistic dictionary will contain the following dictionaries:
  341. PPP: (Bytes,Packets,Errors()In,Out):
  342. Statistics at the Network level.
  343. Contains the number of bytes, packets, and errors on the PPP interface.
  344. For example, BytesIn contains the number of bytes going up
  345. into the network stack, for any networking protocol,
  346. without the PPP headers and trailers.
  347. The statistic dictionary can be extended as needed in the future
  348. to contain additional information.
  349. @param connection The SCNetworkConnection to obtained statistics from.
  350. @result The statistics dictionary.
  351. If NULL is returned, the error can be retrieved with SCError().
  352. }
  353. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  354. function SCNetworkConnectionCopyStatistics( connection: SCNetworkConnectionRef ): CFDictionaryRef; external name '_SCNetworkConnectionCopyStatistics';
  355. {!
  356. @function SCNetworkConnectionStart
  357. @discussion Start the connection for the SCNetworkConnection.
  358. The connection process is asynchronous and the function will
  359. return immediately. The connection status can be obtain by polling or
  360. by callback.
  361. The connection is done with the default settings from the administrator.
  362. Some of the settings can be overridden for the duration of
  363. the connection. They are given in an option dictionary.
  364. The options dictionary is in the format of a Network Service
  365. as described in SystemConfiguration.
  366. Note: Starting and stopping of connections is implicitely arbitrated.
  367. Calling Start on a connection already started will indicate
  368. that the application has interest in the connection and it shouldn't
  369. be stopped by anyone else.
  370. @param connection The SCNetworkConnection to start.
  371. @param userOptions The options dictionary to start the connection with.
  372. If userOptions is NULL, the default settings will be used.
  373. If userOptions are specified, they must be in the SystemConfiguration format.
  374. The options will override the default settings defined for the service.
  375. For security reasons, not all the options can be overridden, the appropriate merging
  376. of all the settings will be done before the connection is established,
  377. and inappropriate options will be ignored.
  378. @param linger This parameter indicates whether or not the connection can stay around
  379. when the application no longer has interest in it.
  380. Typical application should pass FALSE, and the Stop function will
  381. automatically be called when the reference is released or if the application quits.
  382. If the application passes TRUE, the application can release the reference
  383. or exit and the Stop function will not be called.
  384. @result TRUE if the connection was correctly started. The actual connection is not established yet,
  385. and the connection status needs to be periodically checked.
  386. FALSE if the connection request didn't start. Error must be taken
  387. from SCError().
  388. }
  389. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  390. function SCNetworkConnectionStart( connection: SCNetworkConnectionRef; userOptions: CFDictionaryRef; linger: Boolean ): Boolean; external name '_SCNetworkConnectionStart';
  391. {!
  392. @function SCNetworkConnectionStop
  393. @discussion Stop the connection for the SCNetworkConnection.
  394. The disconnection process is asynchronous and the function will
  395. return immediately. The connection status can be obtain by polling or
  396. by callback.
  397. This function performs an arbitrated stop of the connection.
  398. If several applications have marked their interest in the connection,
  399. by calling SCNetworkConnectionStart, the call will succeed but the the actual
  400. connection will be maintained until the last interested application calls stop.
  401. In certain cases, you might want to stop the connection anyway, and
  402. SCNetworkConnectionStop with forceDisconnect argument can be used.
  403. @param connection The SCNetworkConnection to stop.
  404. @result TRUE if the disconnection request succeeded.
  405. FALSE if the disconnection request failed. Error must be taken from SCError().
  406. }
  407. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  408. function SCNetworkConnectionStop( connection: SCNetworkConnectionRef; forceDisconnect: Boolean ): Boolean; external name '_SCNetworkConnectionStop';
  409. {!
  410. @function SCNetworkConnectionCopyCurrentOptions
  411. @discussion Copy the user options used to start the connection.
  412. This is a mechanism for a client to retrieve the user options
  413. previously passed to the SCNetworkConnectionStart function.
  414. @param connection The SCNetworkConnection to obtain options from.
  415. @result The service dictionary containing the connection options.
  416. The dictionary can be empty if no user options were used.
  417. If NULL is returned, the error can be retrieved with SCError().
  418. }
  419. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  420. function SCNetworkConnectionCopyUserOptions( connection: SCNetworkConnectionRef ): CFDictionaryRef; external name '_SCNetworkConnectionCopyUserOptions';
  421. {!
  422. @function SCNetworkConnectionScheduleWithRunLoop
  423. @discussion Schedule a connection with the Run Loop.
  424. @param connection The SCNetworkConnection to schedule.
  425. @param runLoop The runloop to schedule with.
  426. @param runLoopMode The runloop mode.
  427. @result TRUE if success.
  428. FALSE if failed. The error can be retrieved with SCError().
  429. }
  430. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  431. function SCNetworkConnectionScheduleWithRunLoop( connection: SCNetworkConnectionRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ): Boolean; external name '_SCNetworkConnectionScheduleWithRunLoop';
  432. {!
  433. @function SCNetworkConnectionUnscheduleFromRunLoop
  434. @discussion Unschedule a connection from the Run Loop.
  435. @param connection The SCNetworkConnection to unschedule.
  436. @param runLoop The runloop to unschedule from.
  437. @param runLoopMode The runloop mode.
  438. @result TRUE if success.
  439. FALSE if failed. The error can be retrieved with SCError().
  440. }
  441. // AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
  442. function SCNetworkConnectionUnscheduleFromRunLoop( connection: SCNetworkConnectionRef; runLoop: CFRunLoopRef; runLoopMode: CFStringRef ): Boolean; external name '_SCNetworkConnectionUnscheduleFromRunLoop';
  443. end.