Including the functionality of a tool within another program?

Posted by darren on Stack Overflow See other posts from Stack Overflow or by darren
Published on 2010-05-30T21:03:19Z Indexed on 2010/05/30 21:12 UTC
Read the original article Hit count: 253

Filed under:
|
|

Hi there

I would like to write an application, for my own interest, that graphically visualizes some network concepts. Basically I would like to show the output from tools like ping, traceroute and nmap.

The most obvious approach seems to be to use pipes to call out to these tools from my C program, and process the information they return. However, I would like to avoid this heavy-handed approach if possible. My question is, is it possible to somehow link against these tools, or are there APIs that can be used to gain programatic access instead? If so, is this behavior available on a tool-by-tool basis only?

One reason for wanting to do this is to keep everything in a single process / address space and to avoid dependance on these external tools. For example, if I wrote an iphone application, I would not be able to spawn processes to call out to the external tools themselves.

Thanks for any advice or suggestions.

© Stack Overflow or respective owner

Related posts about api

Related posts about linking