Thursday, July 9, 2009

Where can i get C code for implementation of " ping" command ?

Please give me the C code for implementation of ping command,


and if possible let the code be small and easy to understatnd.





Thank u in advance

Where can i get C code for implementation of " ping" command ?
/* main.c */


#include %26lt;stdio.h%26gt;


#include %26lt;ping.h%26gt;





int


main( int argc, char *argv[1] )


{


if( pinghost( argv[1] ) %26gt; 0 )


printf( "%s is alive\n", argv[1] );


else


printf( "%s is unreachable\n", argv[1] );





exit( 0 );





}


No comments:

Post a Comment