initialize struct network, return value 0 and -1