1 #include <stdio.h>
2 #include <string.h>
3 #include "firedns.h"
4 
main(int argc,char ** argv)5 int main(int argc, char **argv) {
6 	struct firedns_mxlist *iter;
7 
8 	if (argc != 2) {
9 		fprintf(stderr,"usage: %s <hostname>\n",argv[0]);
10 		return 2;
11 	}
12 
13 	iter = firedns_resolvemxlist(argv[1]);
14 
15 	if (iter == NULL)
16 		return 1;
17 
18 	while (iter != NULL) {
19 		printf("%7s (%05d) %s:%d\n",firedns_mx_name[iter->protocol],iter->priority,iter->name,firedns_mx_port[iter->protocol]);
20 		iter = iter->next;
21 	}
22 
23 	return 0;
24 }
25