Skip to content

NetworkExtension iOS xcode9 beta2

Vincent Dondain edited this page Jun 21, 2017 · 1 revision

#NetworkExtension.framework

diff -ruN /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterControlProvider.h /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterControlProvider.h
--- /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterControlProvider.h	2017-05-20 01:44:24.000000000 -0400
+++ /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterControlProvider.h	2017-06-11 02:26:15.000000000 -0400
@@ -75,12 +75,11 @@
 - (void)notifyRulesChanged NS_AVAILABLE(NA, 9_0);
 
 /*!
- * @method handleReportForFlow:action:
- * @discussion This function is called by the framework when the data provider extension calls -[NEFilterDataProvider reportFlow:action:]. Subclass implementations may override this method to handle the flow report.
- * @param flow The flow being reported
- * @param action The action taken by the data provider on the flow
+ * @method handleReport:
+ * @discussion This function is called by the framework when the data provider extension returns a verdict with the report property set to True. Subclass implementations may override this method to handle the flow report.
+ * @param report The report being delivered
  */
-- (void)handleReportForFlow:(NEFilterFlow *)flow action:(NEFilterAction)action API_AVAILABLE(ios(11.0));
+- (void)handleReport:(NEFilterReport *)report NS_AVAILABLE(NA, 11_0);
 @end
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterDataProvider.h /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterDataProvider.h
--- /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterDataProvider.h	2017-05-20 02:25:01.000000000 -0400
+++ /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterDataProvider.h	2017-06-11 02:20:25.000000000 -0400
@@ -85,21 +85,12 @@
  */
 - (NEFilterRemediationVerdict *)handleRemediationForFlow:(NEFilterFlow *)flow NS_AVAILABLE(NA, 9_0);
 
-
 /*!
  * @method handleRulesChanged
  * @discussion This function is called by the framework when -[NEFilterControlProvider notifyRulesChanged] is called. Subclasses should override this method to reload new rules from disk.
  */
 - (void)handleRulesChanged NS_AVAILABLE(NA, 9_0);
 
-/*!
- * @method reportFlow:action:
- * @discussion This function causes the given flow and action to be passed to the control provider extension via the control provider's -[NEFilterControlProvider handleReportForFlow:action:] method. Since the data provider does not need to wait for a response from the control provider before continuing to process the flow, this method is a more efficient way to report a flow to the control provider than returning a "need rules" verdict.
- * @param flow The flow to report
- * @param action The action that the data provider is taking for the flow
- */
-- (void)reportFlow:(NEFilterFlow *)flow action:(NEFilterAction)action NS_AVAILABLE(NA, 11_0);
-
 @end
 
 /*!
diff -ruN /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterFlow.h /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterFlow.h
--- /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterFlow.h	2017-05-20 01:44:24.000000000 -0400
+++ /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterFlow.h	2017-06-11 02:20:25.000000000 -0400
@@ -39,13 +39,13 @@
 
 /*!
  * @property sourceAppUniqueIdentifier
- * @discussion A blob of bytes that uniquely identifies the source app binary of the flow. This value is unique across multiple versions of the same app.
+ * @discussion A byte string that uniquely identifies the binary for each build of the source application of the flow.
  */
 @property (readonly, nullable) NSData *sourceAppUniqueIdentifier NS_AVAILABLE(NA, 11_0);
 
 /*!
  * @property sourceAppIdentifier
- * @discussion A string containing the signing identifier of the source app of the flow.
+ * @discussion A string containing the identifier of the source application of the flow. This identifier stays the same for all versions and builds of the application. This identifier is unique among all applications.
  */
 @property (readonly, nullable) NSString *sourceAppIdentifier NS_AVAILABLE(NA, 11_0);
 
diff -ruN /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterProvider.h /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterProvider.h
--- /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterProvider.h	2017-05-19 18:39:22.000000000 -0400
+++ /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFilterProvider.h	2017-06-12 22:57:30.000000000 -0400
@@ -8,6 +8,7 @@
 #endif
 
 #import <NetworkExtension/NEProvider.h>
+#import <NetworkExtension/NEFilterFlow.h>
 
 @class NEFilterProviderConfiguration;
 
@@ -37,25 +38,14 @@
 
 /*!
  * @file NEFilterProvider.h
- * @discussion This file declares the NEFilterProvider API. The NEFilterProvider API is used to implement custom content filtering solutions.
+ * @discussion This file declares the NEFilterProvider API. The NEFilterProvider API is used to implement custom content
+ * filtering solutions.
  */
 
- 
-/*!
- * @discussion The keys below are the types of actions made by a data provider extension that can be reported to the control provider extension.
- * @const NEFilterActionAllow Allowing the flow
- * @const NEFilterActionDrop  Dropping the flow
- * @const NEFilterActionRemeidate Remediating the flow
- */
-typedef enum {
-	NEFilterActionAllow = 1,
-	NEFilterActionDrop = 2,
-	NEFilterActionRemediate = 3
-} NEFilterAction API_AVAILABLE(ios(11.0));
-
 /*!
  * @interface NEFilterProvider
- * @discussion The NEFilterProvider class is an abstract base class that declares the programmatic interface of an object that implements a socket filter.
+ * @discussion The NEFilterProvider class is an abstract base class that declares the programmatic interface of an
+ * object that implements a socket filter.
  *
  * NEFilterProvider is part of NetworkExtension.framework
  */
@@ -64,22 +54,29 @@
 
 /*!
  * @method startFilterWithCompletionHandler:
- * @discussion This function is called by the framework when the content filter is being started. Subclasses must override this method and perform whatever steps are necessary to start the filter.
- * @param completionHandler A block that must be called when the process of starting the filter is complete. If the filter was started successfully, subclass implementations must pass the nil value to this block. If an error occurred while starting the filter, sublcass implementations must pass a non-nil NSError containing more details about the error.
+ * @discussion This function is called by the framework when the content filter is being started. Subclasses must
+ * override this method and perform whatever steps are necessary to start the filter.
+ * @param completionHandler A block that must be called when the process of starting the filter is complete. If the
+ * filter was started successfully, subclass implementations must pass the nil value to this block. If an error occurred
+ * while starting the filter, sublcass implementations must pass a non-nil NSError containing more details about the error.
  */
 - (void)startFilterWithCompletionHandler:(void (^)(NSError * __nullable error))completionHandler NS_AVAILABLE(NA, 9_0);
 
 /*!
  * @method stopFilterWithReason:completionHandler:
- * @discussion This function is called by the framework when the content filter is being stopped. Subclasses must override this method and perform whatever steps are necessary to stop the filter.
+ * @discussion This function is called by the framework when the content filter is being stopped. Subclasses must
+ * override this method and perform whatever steps are necessary to stop the filter.
  * @param reason An NEProviderStopReason indicating why the filter is being stopped.
  * @param completionHandler A block that must be called when the process of stopping the filter is complete.
  */
-- (void)stopFilterWithReason:(NEProviderStopReason)reason completionHandler:(void (^)(void))completionHandler NS_AVAILABLE(NA, 9_0);
+- (void)stopFilterWithReason:(NEProviderStopReason)reason
+		   completionHandler:(void (^)(void))completionHandler NS_AVAILABLE(NA, 9_0);
 
 /*!
  * @property filterConfiguration
- * @discussion An NEContentFilterConfiguration object containing the current filter configuration. The value of this property can change during the lifetime of a filter. Filter implementations can use KVO to be notified when the configuration changes.
+ * @discussion An NEContentFilterConfiguration object containing the current filter configuration. The value of this
+ * property can change during the lifetime of a filter. Filter implementations can use KVO to be notified when the
+ * configuration changes.
  */
 @property (readonly) NEFilterProviderConfiguration *filterConfiguration NS_AVAILABLE(NA, 9_0);
 
@@ -87,17 +84,31 @@
 
 /*!
  * @interface NEFilterVerdict
- * @discussion The NEFilterVerdict class declares the programmatic interface for an object that is the verdict for a flow of network data.
+ * @discussion The NEFilterVerdict class declares the programmatic interface for an object that is the verdict for a
+ * flow of network data.
  *
  * NEFilterVerdict is part of NetworkExtension.framework
  */
 NS_CLASS_AVAILABLE(NA, 9_0)
 @interface NEFilterVerdict : NSObject <NSSecureCoding,NSCopying>
+
+/*!
+ * @property shouldReport
+ * @discussion Whether or not to send a report to the control provider's -[NEFilterControlProvider handleReport:]
+ * method when processing this verdict. Since the data provider does not need to wait for a response from the control
+ * provider before continuing to process the flow, this is a more efficient way to report a flow to the control provider
+ * than returning a "need rules" verdict. If the verdict originates in the control provider, this property has no
+ * effect. This property applies when the action taken upon a flow is allow, deny, remediate, or filterData (filterData
+ * for new flows only).
+ */
+@property BOOL shouldReport NS_AVAILABLE(NA, 11_0);
+
 @end
 
 /*!
  * @interface NEFilterNewFlowVerdict
- * @discussion The NEFilterNewFlowVerdict declares the programmatic interface of an object that is the verdict for a new flow of network data before any of the flow's data has been seen by the filter.
+ * @discussion The NEFilterNewFlowVerdict declares the programmatic interface of an object that is the verdict for a
+ * new flow of network data before any of the flow's data has been seen by the filter.
  *
  * NEFilterNewFlowVerdict is part of NetworkExtension.framework
  */
@@ -106,7 +117,9 @@
 
 /*!
  * @method needRulesVerdict
- * @discussion This class method returns a verdict indicating that control provider needs to be asked how to handle the new flow. The control provider can either drop or allow the flow, or update the rules and ask the data provider to decide on the new flow again.
+ * @discussion This class method returns a verdict indicating that control provider needs to be asked how to handle
+ * the new flow. The control provider can either drop or allow the flow, or update the rules and ask the data provider
+ * to decide on the new flow again.
  * @return The NEFilterNewFlowVerdict object.
  */
 + (NEFilterNewFlowVerdict *) needRulesVerdict NS_AVAILABLE(NA, 9_0);
@@ -126,11 +139,13 @@
 + (NEFilterNewFlowVerdict *) dropVerdict NS_AVAILABLE(NA, 9_0);
 /*!
  * @method remediateVerdictWithRemediationURLMapKey:remediationButtonTextMapKey:
- * @discussion This class method returns a verdict indicating that a "content blocked" page should be displayed to the user. The block page should contain a link to the given URL.
+ * @discussion This class method returns a verdict indicating that a "content blocked" page should be displayed to
+ * the user. The block page should contain a link to the given URL.
  * @param remediationURLMapKey Remediation map key used by data plugin to get remediation url
  * @return The NEFilterNewFlowVerdict object.
  */
-+ (NEFilterNewFlowVerdict *)remediateVerdictWithRemediationURLMapKey:(NSString *)remediationURLMapKey remediationButtonTextMapKey:(NSString *)remediationButtonTextMapKey NS_AVAILABLE(NA, 9_0);
++ (NEFilterNewFlowVerdict *)remediateVerdictWithRemediationURLMapKey:(NSString *)remediationURLMapKey
+										 remediationButtonTextMapKey:(NSString *)remediationButtonTextMapKey NS_AVAILABLE(NA, 9_0);
 
 /*!
  * @method URLAppendStringVerdictWithMapKey
@@ -142,20 +157,27 @@
 
 /*!
  * @method filterDataVerdictWithFilterInbound:peekInboundBytes:filterOutbound:peekOutboundBytes:
- * @discussion This class method returns a new flow verdict indicating that the filter needs to make a decision about a new flow after seeing a portion of the flow's data.
+ * @discussion This class method returns a new flow verdict indicating that the filter needs to make a decision about
+ * a new flow after seeing a portion of the flow's data.
  * @param filterInbound A boolean indicating if the filter needs to see inbound data
- * @param peekInboundBytes The number of inbound bytes that the filter needs to see in the subsequent call to -[NEFilterDataProvider handleInboundDataFromFlow:readBytesStartOffset:readBytes:].
+ * @param peekInboundBytes The number of inbound bytes that the filter needs to see in the subsequent call to
+ * -[NEFilterDataProvider handleInboundDataFromFlow:readBytesStartOffset:readBytes:].
  * @param filterOutbound  boolean indicating if the filter needs to see outbound data
- * @param peekOutboundBytes The number of outbound bytes that the filter needs to see in the subsequent call to -[NEFilterDataProvider handleOutboundDataFromFlow:readBytesStartOffset:readBytes:].
+ * @param peekOutboundBytes The number of outbound bytes that the filter needs to see in the subsequent call to
+ * -[NEFilterDataProvider handleOutboundDataFromFlow:readBytesStartOffset:readBytes:].
  * @return The new flow verdict.
  */
-+ (NEFilterNewFlowVerdict *)filterDataVerdictWithFilterInbound:(BOOL)filterInbound peekInboundBytes:(NSUInteger)peekInboundBytes filterOutbound:(BOOL)filterOutbound peekOutboundBytes:(NSUInteger)peekOutboundBytes NS_AVAILABLE(NA, 9_0);
++ (NEFilterNewFlowVerdict *)filterDataVerdictWithFilterInbound:(BOOL)filterInbound
+											  peekInboundBytes:(NSUInteger)peekInboundBytes
+												filterOutbound:(BOOL)filterOutbound
+											 peekOutboundBytes:(NSUInteger)peekOutboundBytes NS_AVAILABLE(NA, 9_0);
 
 @end
 
 /*!
  * @interface NEFilterControlVerdict
- * @discussion The NEFilterControlVerdict declares the programmatic interface of an object that is the verdict for a new flow of network data by the control provider.
+ * @discussion The NEFilterControlVerdict declares the programmatic interface of an object that is the verdict for a
+ * new flow of network data by the control provider.
  *
  * NEFilterControlVerdict is part of NetworkExtension.framework
  */
@@ -164,7 +186,8 @@
 
 /*!
  * @method allowVerdictWithUpdateRules:
- * @discussion This class method returns a verdict indicating that the flow should be allowed to go through, and also tell the data provider whether to update its rules or not.
+ * @discussion This class method returns a verdict indicating that the flow should be allowed to go through, and also
+ * tell the data provider whether to update its rules or not.
  * @param updateRules YES if the control provider has updated the rules and wants to communicate that to the data provider
  * @return The NEFilterControlVerdict object.
  */
@@ -172,7 +195,8 @@
 
 /*!
  * @method dropVerdictWithUpdateRules:
- * @discussion This class method returns a verdict indicating that the flow should be dropped, and also tell the data provider whether to update its rules or not.
+ * @discussion This class method returns a verdict indicating that the flow should be dropped, and also tell the data
+ * provider whether to update its rules or not.
  * @param updateRules YES if the control provider has updated the rules and wants to communicate that to the data provider
  * @return The NEFilterControlVerdict object.
  */
@@ -180,12 +204,57 @@
 
 /*!
  * @method updateRules
- * @discussion This class method returns a verdict indicating that the flow should be handled by the data provider, and the rules needed by the data provider have been set.
+ * @discussion This class method returns a verdict indicating that the flow should be handled by the data provider,
+ * and the rules needed by the data provider have been set.
  * @return The NEFilterControlVerdict object.
  */
 + (NEFilterControlVerdict *)updateRules NS_AVAILABLE(NA, 9_0);
 
 @end
 
+
+/*!
+ * @typedef NEFilterAction
+ * @abstract A NEFilterAction represents the possible actions taken upon a NEFilterFlow that can be reported by the
+ * data provider extension to the control provider extension.
+ */
+typedef NS_ENUM(NSInteger, NEFilterAction){
+	/*! @const NEFilterActionInvalid Invalid action, represents an error */
+	NEFilterActionInvalid = 0,
+	/*! @const NEFilterActionAllow Allowing the flow */
+	NEFilterActionAllow = 1,
+	/*! @const NEFilterActionDrop Dropping the flow */
+	NEFilterActionDrop = 2,
+	/*! @const NEFilterActionRemediate Remediating the flow (a "content blocked" page displayed to the user) */
+	NEFilterActionRemediate = 3,
+	/*! @const NEFilterActionFilterData Filtering data on the flow */
+	NEFilterActionFilterData = 4,
+} NS_AVAILABLE(NA, 11_0);
+
+/*!
+ * @interface NEFilterReport
+ * @discussion The NEFilterReport declares the programmatic interface of an object that is a report of actions taken by
+ * the data provider.
+ *
+ * NEFilterReport is part of NetworkExtension.framework
+ */
+NS_CLASS_AVAILABLE(NA, 11_0)
+@interface NEFilterReport : NSObject <NSSecureCoding,NSCopying>
+
+/*!
+ * @property flow
+ * @discussion The flow on which the described action was taken.
+ */
+@property (readonly, nullable) NEFilterFlow *flow;
+
+/*!
+ * @property action
+ * @discussion The action taken upon the reported flow.
+ */
+@property (readonly) NEFilterAction action;
+
+@end
+
+
 NS_ASSUME_NONNULL_END
 
diff -ruN /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFlowMetaData.h /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFlowMetaData.h
--- /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFlowMetaData.h	2017-05-20 02:25:01.000000000 -0400
+++ /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEFlowMetaData.h	2017-06-11 02:26:15.000000000 -0400
@@ -18,7 +18,7 @@
 
 /*!
  * @property sourceAppUniqueIdentifier
- * @discussion A blob of bytes that uniquely identifies the source app binary of the flow. This value is unique across multiple versions of the same app.
+ * @discussion A byte string that uniquely identifies the binary for each build of the source application of the flow.
  */
 @property (readonly) NSData *sourceAppUniqueIdentifier NS_AVAILABLE(10_11, 9_0);
 
diff -ruN /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEHotspotConfigurationManager.h /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEHotspotConfigurationManager.h
--- /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEHotspotConfigurationManager.h	2017-05-20 02:25:01.000000000 -0400
+++ /Applications/Xcode9-beta2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/NetworkExtension.framework/Headers/NEHotspotConfigurationManager.h	2017-06-11 02:20:25.000000000 -0400
@@ -405,7 +405,7 @@
 API_AVAILABLE(ios(11.0))
 @interface NEHotspotConfigurationManager : NSObject
 
-+ (NEHotspotConfigurationManager *)sharedManager;
+@property (class, readonly, strong) NEHotspotConfigurationManager *sharedManager;
 
 /*!
  * @method applyConfiguration:
Clone this wiki locally