#include <limits.h>
#include <netdb.h>
#include <string.h>
+#include <libcitadel.h>
#include "citadel.h"
#include "server.h"
-#include "serv_extensions.h"
#include "locate_host.h"
#include "sysdep_decls.h"
#include "config.h"
-#include "tools.h"
#include "domain.h"
#ifdef HAVE_RESOLV_H
#endif
+/* Hacks to work around nameser.h declarations missing on OpenBSD
+ * see also: http://search.cpan.org/src/MIKER/Net-DNS-ToolKit-0.30/ToolKit.h
+ */
+
+#ifndef NS_INT16SZ
+# ifdef INT16SZ
+# define NS_INT16SZ INT16SZ
+# endif
+#endif
+
+#ifndef NS_INT32SZ
+# ifdef INT32SZ
+# define NS_INT32SZ INT32SZ
+# endif
+#endif
+
+#ifndef NS_GET16
+# ifdef GETSHORT
+# define NS_GET16 GETSHORT
+# endif
+#endif
+
+
+/***************************************************************************/
+
+
void locate_host(char *tbuf, size_t n,
char *abuf, size_t na,
const struct in_addr *addr)
struct sockaddr_in sin;
int len; /* should be socklen_t but doesn't work on Macintosh */
+ len = 0;
+ memset (&sin, 0, sizeof (struct sockaddr_in));
if (!getpeername(CC->client_socket, (struct sockaddr *) &sin, (socklen_t *)&len)) {
return(rbl_check_addr(&sin.sin_addr, message_to_spammer));
}