Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NetworkExtensions] Update framework to Xcode12 beta 6. #9585

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/NetworkExtension/NEEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,33 @@ public enum NEHotspotHelperResult : long {
TemporaryFailure = 6
}
#endif

[NoWatch, NoTV, NoMac, iOS (14,0)]
[Native]
[ErrorDomain ("NEAppPushErrorDomain")]
public enum NEAppPushManagerError : long {
ConfigurationInvalid = 1,
ConfigurationNotLoaded = 2,
InternalError = 3,
InactiveSession = 4,
}

[NoWatch, NoTV, Mac (11,0), iOS (14,0)]
[Native]
public enum NEDnsProtocol : long {
Cleartext = 1,
Tls = 2,
Https = 3,
}

[NoWatch, NoTV, Mac (11,0), iOS (14,0)]
[Native]
[ErrorDomain ("NEDNSSettingsErrorDomain")]
public enum NEDnsSettingsManagerError : long {
Invalid = 1,
Disabled = 2,
Stale = 3,
CannotBeRemoved = 4,
}

}
174 changes: 172 additions & 2 deletions src/networkextension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ interface NEDnsSettings : NSSecureCoding, NSCopying

[Export ("matchDomainsNoSearch")]
bool MatchDomainsNoSearch { get; set; }

[NoWatch, NoTV, Mac (11, 0), iOS (14, 0)]
[Export ("dnsProtocol")]
NEDnsProtocol DnsProtocol { get; }
}

[iOS (9,0)]
Expand Down Expand Up @@ -791,6 +795,12 @@ interface NEHotspotNetwork {

[Export ("setPassword:")]
void SetPassword (string password);

[Async]
[Watch (7,0), NoTV, NoMac, iOS (14,0)]
[Static]
[Export ("fetchCurrentWithCompletionHandler:")]
void FetchCurrent (Action<NEHotspotNetwork> completionHandler);
}
#endif

Expand Down Expand Up @@ -1069,6 +1079,14 @@ interface NETunnelProviderManager
[Field ("NETunnelProviderErrorDomain")]
NSString ErrorDomain { get; }
#endif

[NoWatch, NoTV, NoiOS, Mac (11, 0)]
[Export ("excludedDomains", ArgumentSemantic.Copy)]
string[] ExcludedDomains { get; set; }

[NoWatch, NoTV, NoiOS, Mac (11, 0)]
[Export ("associatedDomains", ArgumentSemantic.Copy)]
string[] AssociatedDomains { get; set; }
}


Expand Down Expand Up @@ -1218,8 +1236,7 @@ interface NEVpnProtocol : NSCopying, NSSecureCoding {
[NullAllowed, Export ("proxySettings", ArgumentSemantic.Copy)]
NEProxySettings ProxySettings { get; set; }

[NoiOS]
[Mac (10,15)]
[Mac (10,15), iOS (14,0)]
[Export ("includeAllNetworks")]
bool IncludeAllNetworks { get; set; }

Expand Down Expand Up @@ -1330,6 +1347,10 @@ interface NEVpnProtocolIke2 {
[iOS (13,0)]
[Export ("enableFallback")]
bool EnableFallback { get; set; }

[NoWatch, NoTV, Mac (11, 0), iOS (14, 0)]
[Export ("mtu")]
nuint Mtu { get; set; }
}

[iOS (8,0)][Mac (10,10)]
Expand Down Expand Up @@ -1460,6 +1481,10 @@ interface NWPath

[Export ("isEqualToPath:")]
bool IsEqualToPath (NWPath path);

[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0)]
[Export ("constrained")]
bool Constrained { [Bind ("isConstrained")] get; }
}

[iOS (9,0)][Mac (10,11)]
Expand Down Expand Up @@ -1648,6 +1673,11 @@ int SocketProtocol {
[NotImplemented] set;
#endif
}

[NullAllowed]
[NoWatch, NoTV, Mac (11, 0), iOS (14, 0)]
[Export ("remoteHostname")]
string RemoteHostname { get; }
}

[iOS (11,0)]
Expand Down Expand Up @@ -2104,4 +2134,144 @@ interface NETransparentProxyNetworkSettings {
[NullAllowed, Export ("excludedNetworkRules", ArgumentSemantic.Copy)]
NENetworkRule[] ExcludedNetworkRules { get; set; }
}

[NoWatch, NoTV, NoMac, iOS (14,0)]
[BaseType (typeof (NSObject))]
interface NEAppPushManager {
[Export ("matchSSIDs", ArgumentSemantic.Copy)]
string[] MatchSsIds { get; set; }
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved

[Export ("providerConfiguration", ArgumentSemantic.Copy)]
NSDictionary<NSString, NSObject> ProviderConfiguration { get; set; }

[NullAllowed]
[Export ("providerBundleIdentifier")]
string ProviderBundleIdentifier { get; set; }

[Wrap ("WeakDelegate")]
[NullAllowed]
INEAppPushDelegate Delegate { get; set; }

[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
NSObject WeakDelegate { get; set; }

[Async]
[Static]
[Export ("loadAllFromPreferencesWithCompletionHandler:")]
void LoadAllFromPreferences (Action<NEAppPushManager [], NSError> completionHandler);

[Async]
[Export ("loadFromPreferencesWithCompletionHandler:")]
void LoadFromPreferences (Action<NSError> completionHandler);

[Async]
[Export ("removeFromPreferencesWithCompletionHandler:")]
void RemoveFromPreferences (Action<NSError> completionHandler);

[Async]
[Export ("saveToPreferencesWithCompletionHandler:")]
void SaveToPreferences (Action<NSError> completionHandler);

[NullAllowed]
[Export ("localizedDescription")]
string LocalizedDescription { get; set; }

[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; set; }

[Export ("active")]
bool Active { [Bind ("isActive")] get; }
}

[NoWatch, NoTV, NoMac, iOS (14,0)]
[BaseType (typeof (NEProvider))]
[DisableDefaultCtor] // init returns nil
interface NEAppPushProvider {
[NullAllowed]
[Export ("providerConfiguration")]
NSDictionary<NSString, NSObject> ProviderConfiguration { get; }

[Async]
[Export ("startWithCompletionHandler:")]
void Start (Action<NSError> completionHandler);

[Async]
[Export ("stopWithReason:completionHandler:")]
void Stop (NEProviderStopReason reason, Action completionHandler);

[Export ("reportIncomingCallWithUserInfo:")]
void ReportIncomingCall (NSDictionary userInfo);

[Export ("handleTimerEvent")]
void HandleTimerEvent ();
}

[NoWatch, NoTV, Mac (11,0), iOS (14,0)]
[BaseType (typeof (NEDnsSettings), Name = "NEDNSOverHTTPSSettings")]
interface NEDnsOverHttpsSettings {
[NullAllowed]
[Export ("serverURL", ArgumentSemantic.Copy)]
NSUrl ServerUrl { get; set; }

[Notification]
[Field ("NEDNSSettingsConfigurationDidChangeNotification")]
NSString ConfigurationDidChangeNotification { get; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from its name it looks like it should be on NEDnsSettings and not on NEDnsOverHttpsSettings

}

[NoWatch, NoTV, Mac (11,0), iOS (14,0)]
[BaseType (typeof (NEDnsSettings), Name = "NEDNSOverTLSSettings")]
interface NEDnsOverTlsSettings {
[NullAllowed]
[Export ("serverName")]
string ServerName { get; set; }
}

[NoWatch, NoTV, Mac (11,0), iOS (14,0)]
[DisableDefaultCtor]
[BaseType (typeof (NSObject), Name = "NEDNSSettingsManager")]
interface NEDnsSettingsManager {
[Static]
[Export ("sharedManager")]
NEDnsSettingsManager SharedManager { get; }

[Async]
[Export ("loadFromPreferencesWithCompletionHandler:")]
void LoadFromPreferences (Action<NSError> completionHandler);

[Async]
[Export ("removeFromPreferencesWithCompletionHandler:")]
void RemoveFromPreferences (Action<NSError> completionHandler);

[Async]
[Export ("saveToPreferencesWithCompletionHandler:")]
void SaveToPreferences (Action<NSError> completionHandler);

[NullAllowed]
[Export ("localizedDescription")]
string LocalizedDescription { get; set; }

[NullAllowed]
[Export ("dnsSettings", ArgumentSemantic.Strong)]
NEDnsSettings DnsSettings { get; set; }

[NullAllowed]
[Export ("onDemandRules", ArgumentSemantic.Copy)]
NEOnDemandRule[] OnDemandRules { get; set; }

[Export ("enabled")]
bool Enabled { [Bind ("isEnabled")] get; }
}

interface INEAppPushDelegate {}

[NoWatch, NoTV, NoMac, iOS (14,0)]
[Protocol, Model (AutoGeneratedName = true)]
[BaseType (typeof (NSObject))]
interface NEAppPushDelegate
{
[Abstract]
[Export ("appPushManager:didReceiveIncomingCallWithUserInfo:")]
void DidReceiveIncomingCall (NEAppPushManager manager, NSDictionary userInfo);
}

}
2 changes: 2 additions & 0 deletions tests/xtro-sharpie/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public static partial class Helpers {
{ "NEVPNIKEv2DiffieHellmanGroup", "NEVpnIke2DiffieHellman" },
{ "NEVPNIKEv2EncryptionAlgorithm", "NEVpnIke2EncryptionAlgorithm" },
{ "NEVPNIKEv2IntegrityAlgorithm", "NEVpnIke2IntegrityAlgorithm" },
{ "NEDNSProtocol", "NEDnsProtocol"},
{ "NEDNSSettingsManagerError", "NEDnsSettingsManagerError"},
{ "NSAttributedStringEnumerationOptions", "NSAttributedStringEnumeration" },
{ "NSFileProviderErrorCode", "NSFileProviderError" },
{ "NSUbiquitousKeyValueStoreChangeReason", "NSUbiquitousKeyValueStore" },
Expand Down
57 changes: 0 additions & 57 deletions tests/xtro-sharpie/iOS-NetworkExtension.todo

This file was deleted.

31 changes: 0 additions & 31 deletions tests/xtro-sharpie/macOS-NetworkExtension.todo

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ignored due to https://github.com/xamarin/maccore/issues/2313
!missing-enum! NEAppProxyFlowError not bound
!missing-enum! NEHotspotConfigurationError not bound
!missing-field! NEHotspotConfigurationErrorDomain not bound
Expand Down