As we know to get all tcp connections we can use sysctl with "net.inet.tcp.pcblist" as MIB variable .But its output is binary data and must be convert to human readable context which describes IP addresses and active ports and conection states. Netstat program do this job but I couldn't realize that. Anyone can offer a simple code that acts like netsat but in objective C? Thanks in advance!
Asked
Active
Viewed 446 times
0
-
1Have you looked in the source code for `netstat`? – 一二三 Dec 23 '12 at 08:50
-
yes , but i can't realize that . what procedure in netstat interpret raw binary data which obtains from sysctl? – James C Dec 24 '12 at 06:21
-
Search the code for the MIB name... – 一二三 Dec 24 '12 at 12:04