#include <unistd.h>
#include <arpa/inet.h>
#include <stdlib.h>
+#include <malloc.h>
#include "nbtscanner.h"
#include "mysql_interface.h"
int main(int argc, char *argv[])
{
+ int junk = mtrace();
int fd = open_sockets();
+ int i;
id_list_init();
init_stats();
- /* note that parse_configfile() will call scan_range()! */
server_fd = fd;
- parse_configfile(1);
-
-/* for (i=1;i<argc;i++) {
- struct in_addr ip;
+ parse_configfile();
- ip.s_addr = inet_addr(argv[i]); //interpret_addr2(argv[i]);
- send_nbt_packet(fd, ip);
- recv_nbt_packets(fd);
- } */
+ /* really ugly to have here */
+ if (use_mysql) {
+ init_mysql(mysql_host, mysql_username, mysql_password);
+ }
+ for (i = 0; i < ranges; i++) {
+ scan_range(scanrange[i], scanrangesize[i]);
+ }
+
/*
* receive answers and resend packets until all answers have
* been received, or all packets have been timed out