Post

Replies

Boosts

Views

Activity

Facing compilation errors if I call variable argument C++ API from swift lang
I have an API with variable arguments in C++ library. I am trying to call this API from swift language. But I am facing with compilation errors as below. If I tried by removing variable arguments from the API then it is compiling. Please help to fix the error with variable arguments. API is void netops_log(enum log_level loglevel, const char *format, ...); Compilation errors: FilterDataProvider.swift:73:9: error: 'netops_log' is unavailable: Variadic function is unavailable     netops_log(LOGLEVEL_DEBUG, "Starting the filter... from NE")     ^~~~~~~~~~~~ __ObjC.netops_log:2:13: note: 'netops_log' has been explicitly marked unavailable here public func netops_log(_ loglevel: log_level, _ format: UnsafePointer<Int8>!, _ varargs: Any...)       ^
2
0
1.5k
Oct ’23
Failed to run the app using openApplicationAtURL()
Hi, I am new to objective-c. I tried to run an app as part of my launchd application using openApplicationAtURL() API but I failed. I did R &amp;D also but I haven't found any example I have an app NetopsFilter.app and If I run this app with '--uninstallFilter' argument then it will deactivate the network extension. I tried from terminal and it is successfully deactivating the extension after entering the credentials in the popup. App path: /Applications/NetopsFilter.app argument: --uninstallFilter I tried as below but failed. Please help me to fix this. How can I pass arguments, necessary configuration settings to the API.   NSWorkspace *workspace = [NSWorkspace sharedWorkspace];   NSURL *url = [NSURL fileURLWithPath:[workspace fullPathForApplication:@"/Applications/NetopsFilter.app/Contents/MacOS/NetopsFilter"]];  NSArray *arguments = [NSArray arrayWithObjects:@"--uninstallFilter", nil];    [workspace openApplicationAtURL:url configuration:(NSWorkspaceOpenConfiguration *)arguments nil]; Thanks
6
0
1.8k
Nov ’21
provide some samples using content filters in objective c or c++ to register network extensions, to catch all non-browser network operations
HI, I am new to network extensions and content filters. In my MacBook Pro, I have one "c&amp;#92;&amp;#43;&amp;#92;&amp;#43; application in user space, one kernel module and IOKit interface between them to exchange messages. I have some hook functions for network operations APIs like socket(), connect(). If any network operation performs, I catch them in hook functions and I will perform policy evaluations on them in kernel and will perform my own actions. Now I want to remove hook functions in kernel and I want to catch network operations using content filters in my c++ application at userspace. Once I catch network operations using content filter, I want to evaluate my own polices on them and will perform my own actions based on the result. I have done some R&amp;D about this but not found samples on content filters in objective-c or c++ except simplefirewall example in swift language. Anyone pls provide some samples in objective c or c&amp;#92;&amp;#43;&amp;#92;&amp;#43; to register network extensions, to catch all non-browser network operations, to extract local &amp; remote address (port &amp; ip) details. So that I can refer the samples to get network operation details at user space in my c++ application, I will send those details to kernel using IOKit to evaluate my own rules and perform my own actions. Thanks.
8
0
1.6k
Apr ’21