GNS, list of nodes [C]

I have to write program that binarize image using all computers in the network. I’m using gns and i need to get the number of nodes with gns enabled, so that i can send correct number of pixels to binarize to each node. How can i do that?

I know how to list nodes in terminal but in C im stuck.

I don’t know what kind of network you are using, but how about opendir("/net").