Posts

Post not yet marked as solved
3 Replies
574 Views
Hi, I have installed content filter network extension which is almost same as https://developer.apple.com/documentation/networkextension/filtering_network_traffic. I have another app. As part of this app, I am sending messages from server process to client process by using unix domain sockets which is almost same as https://github.com/devlights/go-unix-domain-socket-example. If network traffic is little bit more then my client is failing to send messages with write: no buffer space available error. If I stop content filter network extension then there is no issue. How can I handle this type of error with network extension? Note: This is happening on both monterey and ventura mac os (both intel and m1).
Posted
by nrednam.
Last updated
.
Post not yet marked as solved
0 Replies
300 Views
Currently I am using below network rule to read all traffic. But I want to skip to read particular port on localhost. What is NetworkRule to exclude reading from particular port on localhost? let networkRule = NENetworkRule(remoteNetwork: nil, remotePrefix: 0, localNetwork: nil, localPrefix: 0, protocol: .any, direction: .any)
Posted
by nrednam.
Last updated
.
Post not yet marked as solved
2 Replies
786 Views
My customer installed two different apps on his Mac machine. These two apps are using ContentFilter extensions. One of the app is mine and another app is different vendor. If my customer enabled both ContentFilter extensions then he fails to connect immediately to its required destination to allow it to run. If one of the ContentFilter extension is disabled then there is no issue. Is it not possible to run two different ContentFilter extensions on same Mac machine? Is there any way to fix these type of issues? Thank You Nagendra R
Posted
by nrednam.
Last updated
.
Post not yet marked as solved
1 Replies
617 Views
Hi, I am using file provide extension to sync the app with remote storage. createItem() fileprovideer extension is calling when I copy a file and I able to sync properly with normal file and symlink files. itemTemplate.symlinkTargetPath helps me to sync symlink file. But, I am facing the with alias file to sync. I tried to get original file name of alias file but I haven't found any option. How to get the original file name of alias file at createItem() of fileprovider extension. Is there any way to sync alias file? My createItem() sample code at extension which sends the call to server through grpc. public func createItem( basedOn itemTemplate: NSFileProviderItem, fields: NSFileProviderItemFields, contents contentsUrl: URL?, options: NSFileProviderCreateItemOptions = [], request: NSFileProviderRequest, progress: Progress ) async throws -> (NSFileProviderItem, NSFileProviderItemFields) { var (templateAttributes, _) = self.load(fields: fields, from: itemTemplate) templateAttributes.ownerAccountID = getuid(); templateAttributes.groupOwnerAccountID = getgid(); let identifier: NSFileProviderItemIdentifier let attributes: FileProviderItemAttributes if itemTemplate.contentType?.conforms(to: .directory) == true { // Handle folder creation ..... ..... } else if itemTemplate.contentType?.conforms(to: .symbolicLink) == true { // Handle symlinks guard let targetPath = itemTemplate.symlinkTargetPath else { fatalError("couldn't get symlinkTargetPath on \(itemTemplate)") } .... .... } else if itemTemplate.contentType?.conforms(to: .aliasFile) == true { // TODO I am not yet handled this case. I need to get original path of alias file. } else { // Handle file creation .... .... } let item = try FileSystemItem.any(filename: itemTemplate.filename, identifier: identifier, parentIdentifier: itemTemplate.parentItemIdentifier, attributes: attributes) return (item, []) }
Posted
by nrednam.
Last updated
.
Post not yet marked as solved
17 Replies
1.8k Views
Hi, I have Content Filter Simple Firewall example from Apple site and modified as per my requirement and I able to compile & run with my developer id account. As part of NE activation request, throwing the Allow/Don't Allow popup after allowing the NE from security preferences. When I went through the code I got to know that this popup is getting from filterManager.saveToPreferences as part of activation request. Attached the screen shot for reference. How to suppress this allow/disallow popup? Please help me.
Posted
by nrednam.
Last updated
.
Post not yet marked as solved
0 Replies
322 Views
I able to create Universal Swift library with CMake+Xcode. But failed to create universal swift library with CMake+ninja. Is there any way create universal swift library using CMake which is suitable for any build manager like Xcode and Ninja?
Posted
by nrednam.
Last updated
.
Post not yet marked as solved
0 Replies
389 Views
HI, I have a swift project and I want to compile it for both "x86_64" and "arm64" architectures on my Mac for both Xcode & Ninja. My swift project was successfully compiled for both "x86_64" and "arm64" with Xcode. But I am facing with multiple values for CMAKE_OSX_ARCHITECTURES not supported with Swift error in CMake while creating the swift project for Ninja. Pls help to fix this fir Ninja.
Posted
by nrednam.
Last updated
.
Post marked as solved
1 Replies
1.6k Views
HI, I have a swift project and I am calling few objective C APIs as part of my swift project. I am using bridge header for this. I am creating swift project using CMake files. I able to create the swift project and compiling successfully for Xcode But I unable to compile successfully for Ninja. I am using XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER to import bridge header file to the swift project in my CMake file like set_target_properties(ADE PROPERTIES  FRAMEWORK TRUE  XCODE_ATTRIBUTE_SWIFT_OBJC_BRIDGING_HEADER ADE-Bridging-Header.h). But I failed to import successfully for Ninja. Is there any way to import Bridge header file through CMake for both Xcode and Ninja?
Posted
by nrednam.
Last updated
.
Post not yet marked as solved
0 Replies
396 Views
HI, I want to know whether my extension is in active state or not as part of my swift application. It would get this on terminal usingsystemextensionsctl list | grep FilterExtension | grep activated command. It can be possible with system() on C++ as system("systemextensionsctl list | grep FilterExtension | grep activated") But how can I achieve this in swift language? Help me. Thanks.
Posted
by nrednam.
Last updated
.
Post not yet marked as solved
6 Replies
564 Views
HI, I am using Content Filter simple firewall Network Extension (NE). I have couple of doubts about NE deactivation. Please clarify. Is it possible to deactivate the NE without user consent? If not possible without user consent, why we need to authorise even for deactivate? Is it restricted by Apple? Please clarify.
Posted
by nrednam.
Last updated
.
Post not yet marked as solved
1 Replies
396 Views
Hi, I want to activate/deactivate network extension on Mac without any user consent (I want allow network extension activation/deactivation on Mac by default) and Mac is under un-managed environment (Not managed by MDM tools). Is there any way to activate/deactivate network extension in unmanaged environment without use. consent. Thanks.
Posted
by nrednam.
Last updated
.
Post marked as solved
6 Replies
3.1k Views
Hi, I am new to Swift language. In my C++ application, I able to convert 'void *' to 'int * 'as below. Here, 'request' type is 'void *' type. int *ret = request; I am trying to do same thing in Swift also. Here 'request' type is 'UnsafeMutableRawPointer' But I am facing with error "Cannot convert value of type 'UnsafeMutableRawPointer' to specified type 'UnsafeMutablePointer<Int32>'" let ret: UnsafeMutablePointer<Int32> = request Any one please help to convert from UnsafeMutableRawPointer type to UnsafeMutablePointer<Int32>.
Posted
by nrednam.
Last updated
.
Post not yet marked as solved
2 Replies
2.2k Views
Hi, I have tried to compile and run SimpleFirewall - https://developer.apple.com/documentation/networkextension/filtering_network_traffic example on MacBook Pro. Where can I get 'os_log' output logs in this example? I have verified in system.log but no use.
Posted
by nrednam.
Last updated
.
Post marked as solved
2 Replies
1.1k Views
Hi, I am new to Swift language. I am trying to convert below C++ function to Swift function as below. C++ function: int test(test_type type, request_info_t *request, size_t request_len) {   size_t size = request_len;   int mib[] = {0,0,0,0,0};       int ret = sysctl(mib, 5, request, &size, NULL, 0)   return ret; } Swift function: func test( type: test_type, request: request_info_t, request_len: size_t) -> Int64 {   let size: Int = request_len   let mib: [Int]= [0, 0, 0, 0, 0]       let val: Int32 = sysctl(mib, 5, request, size, nil, 0)   return val } But I am facing below issues with arguments at sysctl(). Could any one please to convert this. Error due to first argument mib: Cannot convert value of type '[Int]' to expected argument type 'UnsafeMutablePointer<Int32>?' Error due to third argument request: Cannot convert value of type 'Int' to expected argument type 'UnsafeMutablePointer<Int>?' Error due to fourth argument size: Cannot convert value of type 'requestinfot' to expected argument type 'UnsafeMutableRawPointer?'
Posted
by nrednam.
Last updated
.