summaryrefslogblamecommitdiffstats
path: root/host_test.c
blob: b30ca22f0d1b7b7878c3c13bebdeb4e8065a88ea (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                                   




                                                                                        

                         



                                                                             

                 
#include "host.c"
int main (int argc, char ** argv) {
	if (argc != 3) {
		uint32_t v = 0;
		unsigned long long int i = 0;
		while ((v = ri(v, 4)))
			fprintf(stderr, "(debug) %llu\t%u\n", i++, v);
		fprintf(stderr, "%s network hostnumber\t\t(debug: %llu)\n", argv[0], i);
		return 1;
	}
	struct in_net h = host(str2net(argv[1]), strtoll(argv[2], NULL, 10));
	char b[16];
	strcpy(b, inet_ntoa(h.addr));
	printf("addr: %s mask %s\n", b, inet_ntoa(h.mask));
	return 0;
}