network query utilities coded in C