I have to capture all traffic for only a particualar remote IP (e.g. 30.40.50.60) . i have tried to set NEFilterRule for NEFilterDataProvider as follow :
somehow I am still getting all the traffic in handleNewFlow . i wan it only for the particular IP address .
not sure what is wrong here . any pointer on this will help .
Code Block host= [NWHostEndpoint endpointWithHostname:@"30.40.50.60" port:@"0"] Rule= [[NENetworkRule alloc] initWithDestinationNetwork:host prefix:0 protocol:NENetworkRuleProtocolAny]; FilterRule = [[NEFilterRule alloc] initWithNetworkRule:Rule action:NEFilterActionFilterData]; FilterRuleArray = [NSArray arrayWithObjects:FilterRule, nil]; FilterSettings = [[NEFilterSettings alloc] initWithRules:FilterRuleArray defaultAction:NEFilterActionAllow]; [self applySettings:FilterSettings completionHandler:^(NSError *error){}];
somehow I am still getting all the traffic in handleNewFlow . i wan it only for the particular IP address .
not sure what is wrong here . any pointer on this will help .