On 16 Dec 2013, at 21:09, "AL13N" <al...@rmail.be> wrote:

>> I'm investigating to see if it is possible to create a network monitor for
>> SailfishOs. Something like
>> https://play.google.com/store/apps/details?id=com.mobidia.android.mdm&feature=search_result
>> 
>> I can read simple received/sent statistics from /proc/net/dev , but it
>> would be more interesting to see the amount of data used per application.
>> This is possible with libpcap and maybe with iptables, but both require
>> root privileges (or at least the CAP_NET_RAW capability).
>> 
>> So hopefully someone can answer the following questions:
>> - Is there any possibility for a Harbour app to acquire extra
>> priviliges/capabilities ?
>> 
>> - If not can you think of any other way to report per-application network
>> statistics ?
> 
> libpcap can't detect application level data transfer, and neither can
> iptables
> 
Have a look at the source of for example Nethogs. Libpcap is used to detect 
packet transfer and then some clever things are done to deduct the application 
that initiated the transfer.
So it's definitely possible.

> plus you don't want to set your interface promiscuous, nor make a
> complicated iptables thing...
> 
> afaik, there is no way in linux to filter out per application, because,
> you'd need to track which application bound what "source" port and track
> data that way...
> 
> 
> 
> iow, give it up... :-) plus, when you get to the point of dozens of
> openvpn networks and bridging and vlans and voip QoS in a different vlan
> and such, things are gonna get complicated enough...

Probably that will be the end conclusion, but Android is also Linux, so how do 
the Android network monitor apps get their information? Does the android 
stack/Dalvik give extra hooks for network inspection ?

thanks anyway for your information,

Winfried
_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to