Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany
Accepted Solution

Network traffic

How do i read the network traffic of the system?

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Network traffic

All network traffic? I don't believe that it will be ever possible.

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Network traffic

i would tend to agree, as i did not find an API for it, but as it happens there is an application in bb world that does it:
https://appworld.blackberry.com/webstore/content/25739873/

I don't need it personally, otherwise i would just give my fellow developer his well-earned 89 cents, but i was asked to put something basic similar to that into an app...
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Network traffic

I believe Berkeley Packet Filter can be used for this. QNX supports this interface, at least partially:

http://www.qnx.com/developers/docs/6.4.1/io-pkt_en/user_guide/filtering.html

 

There was also Libpcap port for QNX (libpcap provides interface to bpf), but the links are now dead and I don't know if QNX support was merged into the main branch or not.


Andrey Fidrya, @zmeyc on twitter
Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Network traffic

Libpcap seems to be in the core networking of QNX according to http://support7.qnx.com/download/download/23598/core_networking.pdf page 10

I have to admit that i have no clue how to use it though
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Network traffic

I highly doubt that we have any access to libcap as it would allow anybody to sniff  packets going in and out an interface.

On the other hand I noticed that netstat utility can give you some statistics.

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Network traffic

did you get anything useful about traffic from netstat? i see the established connections when i log in with ssh, but rec/send is 0 everywhere.

I contacted the developer of DataMonitor, but did not get any reply yet. Maybe it is his seekrit how to do it Smiley Sad
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: Network traffic

netstat -p tcp gives many interesting data. Though many areas of netstat are 'permission denied' -(((

Don't have time to play now but it's very interesting topic and I'll do some after work.

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Network traffic

you are right, the xxx bytes transmitted seem to be the value i am after.
is there a possibility to execute the unix commands from a program though?
reading the value from ssh is nice, but won't help for writing a software.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Network traffic