jabberd2
2.2.16
|
00001 /* 00002 * jabberd - Jabber Open Source Server 00003 * Copyright (c) 2002 Jeremie Miller, Thomas Muldowney, 00004 * Ryan Eatmon, Robert Norris 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA 00019 */ 00020 00021 #ifndef INCL_INADDR_H 00022 #define INCL_INADDR_H 00023 00024 #ifdef HAVE_CONFIG_H 00025 # include <config.h> 00026 #endif 00027 00028 #include "ac-stdint.h" 00029 00030 #ifdef HAVE_STRING_H 00031 #include <string.h> 00032 #endif 00033 00034 #ifdef HAVE_NETINET_IN_H 00035 #include <netinet/in.h> 00036 #endif 00037 00038 #ifdef HAVE_ARPA_INET_H 00039 #include <arpa/inet.h> 00040 #endif 00041 00042 #ifdef HAVE_SYS_SOCKET_H 00043 #include <sys/socket.h> 00044 #endif 00045 00046 #ifdef USE_LIBSUBST 00047 #include "subst/subst.h" 00048 #endif 00049 00050 /* jabberd2 Windows DLL */ 00051 #ifndef JABBERD2_API 00052 # ifdef _WIN32 00053 # ifdef JABBERD2_EXPORTS 00054 # define JABBERD2_API __declspec(dllexport) 00055 # else /* JABBERD2_EXPORTS */ 00056 # define JABBERD2_API __declspec(dllimport) 00057 # endif /* JABBERD2_EXPORTS */ 00058 # else /* _WIN32 */ 00059 # define JABBERD2_API extern 00060 # endif /* _WIN32 */ 00061 #endif /* JABBERD2_API */ 00062 00063 #ifdef __cplusplus 00064 extern "C" { 00065 #endif 00066 00067 /* 00068 * helpers for ip addresses 00069 */ 00070 00071 #include <util/util_compat.h> 00072 00073 JABBERD2_API int j_inet_pton(char *src, struct sockaddr_storage *dst); 00074 JABBERD2_API const char *j_inet_ntop(struct sockaddr_storage *src, char *dst, size_t size); 00075 JABBERD2_API int j_inet_getport(struct sockaddr_storage *sa); 00076 JABBERD2_API int j_inet_setport(struct sockaddr_storage *sa, in_port_t port); 00077 JABBERD2_API socklen_t j_inet_addrlen(struct sockaddr_storage *sa); 00078 00079 #ifdef __cplusplus 00080 } 00081 #endif 00082 00083 #endif /* INCL_UTIL_H */ 00084 00085