Package apple.networkextension
Class NEPacketTunnelProvider
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.networkextension.NEProvider
-
- apple.networkextension.NETunnelProvider
-
- apple.networkextension.NEPacketTunnelProvider
-
- All Implemented Interfaces:
NSObject
public class NEPacketTunnelProvider extends NETunnelProvider
[@interface] NEPacketTunnelProvider The NEPacketTunnelProvider class declares the programmatic interface of an object that implements the client side of a custom IP packet tunneling protocol. NEPacketTunnelProvider is part of NetworkExtension.framework.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceNEPacketTunnelProvider.Block_startTunnelWithOptionsCompletionHandlerstatic interfaceNEPacketTunnelProvider.Block_stopTunnelWithReasonCompletionHandler-
Nested classes/interfaces inherited from class apple.networkextension.NETunnelProvider
NETunnelProvider.Block_handleAppMessageCompletionHandler, NETunnelProvider.Block_setTunnelNetworkSettingsCompletionHandler
-
Nested classes/interfaces inherited from class apple.networkextension.NEProvider
NEProvider.Block_displayMessageCompletionHandler, NEProvider.Block_sleepWithCompletionHandler
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNEPacketTunnelProvider(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static NEPacketTunnelProvideralloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)voidcancelTunnelWithError(NSError error)cancelTunnelWithError: This function is called by tunnel provider implementations to initiate tunnel destruction when a network error is encountered that renders the tunnel no longer viable.static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()NWTCPConnectioncreateTCPConnectionThroughTunnelToEndpointEnableTLSTLSParametersDelegate(NWEndpoint remoteEndpoint, boolean enableTLS, NWTLSParameters TLSParameters, java.lang.Object delegate)createTCPConnectionThroughTunnelToEndpoint:enableTLS:TLSParameters:delegate: This function can be called by subclass implementations to create a TCP connection to a given network endpoint, through the tunnel established by the provider.NWUDPSessioncreateUDPSessionThroughTunnelToEndpointFromEndpoint(NWEndpoint remoteEndpoint, NWHostEndpoint localEndpoint)createUDPSessionThroughTunnelToEndpoint:fromEndpoint: This function can be called by subclass implementations to create a UDP session between a local network endpoint and a remote network endpoint, through the tunnel established by the provider.static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()static longhash_static()NEPacketTunnelProviderinit()static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)static java.lang.Objectnew_objc()NEPacketTunnelFlowpacketFlow()[@property] packetFlow An NEPacketFlow object that the tunnel provider implementation should use to receive packets from the network stack and inject packets into the network stack.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)static voidsetVersion_static(long aVersion)voidstartTunnelWithOptionsCompletionHandler(NSDictionary<java.lang.String,? extends NSObject> options, NEPacketTunnelProvider.Block_startTunnelWithOptionsCompletionHandler completionHandler)startTunnelWithOptions:completionHandler: This function is called by the framework when a new tunnel is being created.voidstopTunnelWithReasonCompletionHandler(long reason, NEPacketTunnelProvider.Block_stopTunnelWithReasonCompletionHandler completionHandler)stopTunnelWithReason:completionHandler: This function is called by the framework when the tunnel is being destroyed.static org.moe.natj.objc.Classsuperclass_static()static longversion_static()-
Methods inherited from class apple.networkextension.NETunnelProvider
appRules, handleAppMessageCompletionHandler, protocolConfiguration, reasserting, routingMethod, setReasserting, setTunnelNetworkSettingsCompletionHandler
-
Methods inherited from class apple.networkextension.NEProvider
createTCPConnectionToEndpointEnableTLSTLSParametersDelegate, createUDPSessionToEndpointFromEndpoint, defaultPath, displayMessageCompletionHandler, sleepWithCompletionHandler, wake
-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static NEPacketTunnelProvider alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
cancelTunnelWithError
public void cancelTunnelWithError(NSError error)
cancelTunnelWithError: This function is called by tunnel provider implementations to initiate tunnel destruction when a network error is encountered that renders the tunnel no longer viable. Subclasses should not override this method.- Parameters:
error- An NSError object containing details about the error that the tunnel provider implementation encountered.
-
createTCPConnectionThroughTunnelToEndpointEnableTLSTLSParametersDelegate
public NWTCPConnection createTCPConnectionThroughTunnelToEndpointEnableTLSTLSParametersDelegate(NWEndpoint remoteEndpoint, boolean enableTLS, NWTLSParameters TLSParameters, java.lang.Object delegate)
createTCPConnectionThroughTunnelToEndpoint:enableTLS:TLSParameters:delegate: This function can be called by subclass implementations to create a TCP connection to a given network endpoint, through the tunnel established by the provider. This function should not be overridden by subclasses.- Parameters:
remoteEndpoint- An NWEndpoint object that specifies the remote network endpoint to connect to.enableTLS- A flag indicating if a TLS session should be negotiated on the connection.TLSParameters- A set of optional TLS parameters. Only valid if enableTLS is YES. If TLSParameters is nil, the default system parameters will be used for TLS negotiation.delegate- An object to use as the connection delegate. This object should conform to the NWTCPConnectionAuthenticationDelegate protocol.- Returns:
- An NWTCPConnection object.
-
createUDPSessionThroughTunnelToEndpointFromEndpoint
public NWUDPSession createUDPSessionThroughTunnelToEndpointFromEndpoint(NWEndpoint remoteEndpoint, NWHostEndpoint localEndpoint)
createUDPSessionThroughTunnelToEndpoint:fromEndpoint: This function can be called by subclass implementations to create a UDP session between a local network endpoint and a remote network endpoint, through the tunnel established by the provider. This function should not be overridden by subclasses.- Parameters:
remoteEndpoint- An NWEndpoint object that specifies the remote endpoint to which UDP datagrams will be sent by the UDP session.localEndpoint- An NWHostEndpoint object that specifies the local IP address endpoint to use as the source endpoint of the UDP session.- Returns:
- An NWUDPSession object.
-
init
public NEPacketTunnelProvider init()
- Overrides:
initin classNETunnelProvider
-
packetFlow
public NEPacketTunnelFlow packetFlow()
[@property] packetFlow An NEPacketFlow object that the tunnel provider implementation should use to receive packets from the network stack and inject packets into the network stack. Every time the tunnel is started the packet flow object is in an initialized state and must be explicitly opened before any packets can be received or injected.
-
startTunnelWithOptionsCompletionHandler
public void startTunnelWithOptionsCompletionHandler(NSDictionary<java.lang.String,? extends NSObject> options, NEPacketTunnelProvider.Block_startTunnelWithOptionsCompletionHandler completionHandler)
startTunnelWithOptions:completionHandler: This function is called by the framework when a new tunnel is being created. Subclasses must override this method to perform whatever steps are necessary to establish the tunnel.- Parameters:
options- A dictionary containing keys and values passed by the provider's containing app. If the containing app did not start the tunnel then this parameter will be nil.completionHandler- A block that must be called when the process of startingt the tunnel is complete. If the tunnel cannot be established then the subclass' implementation of this method must pass a non-nil NSError object to this block. A value of nil passed to the completion handler indicates that the tunnel was successfully established.
-
stopTunnelWithReasonCompletionHandler
public void stopTunnelWithReasonCompletionHandler(long reason, NEPacketTunnelProvider.Block_stopTunnelWithReasonCompletionHandler completionHandler)stopTunnelWithReason:completionHandler: This function is called by the framework when the tunnel is being destroyed. Subclasses must override this method to perform whatever steps are necessary to tear down the tunnel.- Parameters:
reason- An NEProviderStopReason indicating why the tunnel is being stopped.completionHandler- A block that must be called when the tunnel is completely torn down.
-
-