1 /* XQF - Quake server browser and launcher 2 * Copyright (C) 1998-2000 Roman Pozlevich <roma@botik.ru> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 17 */ 18 19 #ifndef __DNS_H__ 20 #define __DNS_H__ 21 22 23 #define DNS_MSG_PREFIX "DNS:" 24 #define DNS_MSG_NOTFOUND "NOTFOUND" 25 #define DNS_MSG_TIMEOUT "TIMEOUT" 26 #define DNS_MSG_ERROR "ERROR" 27 28 #define DNS_CMD_RESET "/RESET" 29 30 enum dns_status { 31 DNS_STATUS_OK = 0, 32 DNS_STATUS_TIMEOUT, 33 DNS_STATUS_NOTFOUND, 34 DNS_STATUS_ERROR 35 }; 36 37 extern int str_is_ip_address (char *str); 38 39 extern int dns_spawn_helper (void); 40 extern void dns_gtk_init (void); 41 extern void dns_helper_shutdown (void); 42 extern void dns_cancel_requests (void); 43 extern void dns_lookup (const char *str); 44 extern void dns_set_callback (void (*cb) (char *item, struct host *h, enum dns_status status, void *data), void *data); 45 extern char *dns_lookup_by_addr (char *ip); 46 extern char *dns_lookup_by_name (char *name); 47 48 49 #endif /* __DNS_H__ */ 50