meillo@0: /* MasqMail meillo@0: Copyright (C) 1999-2001 Oliver Kurth meillo@0: meillo@0: This program is free software; you can redistribute it and/or modify meillo@0: it under the terms of the GNU General Public License as published by meillo@0: the Free Software Foundation; either version 2 of the License, or meillo@0: (at your option) any later version. meillo@0: meillo@0: This program is distributed in the hope that it will be useful, meillo@0: but WITHOUT ANY WARRANTY; without even the implied warranty of meillo@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the meillo@0: GNU General Public License for more details. meillo@0: meillo@0: You should have received a copy of the GNU General Public License meillo@0: along with this program; if not, write to the Free Software meillo@0: Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. meillo@0: */ meillo@0: meillo@0: /* meillo@0: #include "masqmail.h" meillo@0: #include "readsock.h" meillo@0: #include "mserver.h" meillo@0: */ meillo@0: meillo@0: #include "config.h" meillo@0: meillo@0: /* ugly hack */ meillo@0: #ifndef ENABLE_MSERVER meillo@0: #define ENABLE_MSERVER 1 meillo@0: #include "mserver.c" meillo@0: #else meillo@0: #include "masqmail.h" meillo@0: #include "readsock.h" meillo@0: #include "mserver.h" meillo@10: #endif /* ENABLE_MSERVER */ meillo@0: meillo@10: void meillo@10: logwrite(int pri, const char *fmt, ...) meillo@0: { meillo@10: va_list args; meillo@10: va_start(args, fmt); meillo@0: meillo@10: vfprintf(stdout, fmt, args); meillo@0: meillo@10: va_end(args); meillo@0: } meillo@0: meillo@10: void meillo@10: debugf(const char *fmt, ...) meillo@0: { meillo@10: va_list args; meillo@10: va_start(args, fmt); meillo@0: meillo@10: vfprintf(stdout, fmt, args); meillo@0: meillo@10: va_end(args); meillo@0: } meillo@0: meillo@10: int meillo@10: main(int argc, char *argv[]) meillo@0: { meillo@10: if (argc == 3) { meillo@10: interface iface; meillo@10: gchar *name; meillo@0: meillo@10: iface.address = g_strdup(argv[1]); meillo@10: iface.port = atoi(argv[2]); meillo@0: meillo@10: name = mserver_detect_online(&iface); meillo@0: meillo@10: printf("%s\n", name); meillo@0: meillo@10: exit(EXIT_SUCCESS); meillo@10: } else { meillo@10: fprintf(stderr, "usage %s \n", argv[0]); meillo@10: exit(EXIT_FAILURE); meillo@10: } meillo@0: }