jabberd2  2.2.16
util/util_compat.h
Go to the documentation of this file.
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 #ifdef HAVE_CONFIG_H
00022 # include <config.h>
00023 #endif
00024 
00025 #ifndef INCL_UTIL_COMPAT_H
00026 #define INCL_UTIL_COMPAT_H
00027 
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031 
00037 #ifndef PF_INET6
00038 # define PF_INET6    10     
00039 #endif
00040 
00041 #ifndef AF_INET6
00042 # define AF_INET6    PF_INET6   
00043 #endif
00044 
00045 #ifndef INET6_ADDRSTRLEN
00046 # define INET6_ADDRSTRLEN 46    
00048 #endif
00049 
00050 
00051 #ifndef IN6_IS_ADDR_V4MAPPED
00052 
00053 #define IN6_IS_ADDR_V4MAPPED(a) \
00054     ((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \
00055     (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \
00056     (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
00057 #endif
00058 
00059 #ifndef HAVE_SA_FAMILY_T
00060 typedef unsigned short  sa_family_t;
00061 #endif
00062 
00063 #ifndef HAVE_STRUCT_IN6_ADDR
00064 
00068 struct in6_addr {
00069     uint8_t        s6_addr[16];    
00070 };
00071 #endif /* NO_IN6_ADDR */
00072 
00073 #ifndef HAVE_STRUCT_SOCKADDR_IN6
00074 
00078 struct sockaddr_in6 {
00079 #ifdef SIN6_LEN
00080     uint8_t        sin6_len;    
00081 #endif /* SIN6_LEN */
00082     sa_family_t        sin6_family;    
00083     in_port_t        sin6_port;    
00084     uint32_t        sin6_flowinfo;    
00085     struct in6_addr    sin6_addr;    
00086     uint32_t        sin6_scope_id;    
00087 };
00088 #endif /* NO_SOCKADDR_IN6 */
00089 
00090 #ifndef HAVE_STRUCT_SOCKADDR_STORAGE
00091 
00096 #define _SS_PADSIZE (128-sizeof(sa_family_t))
00097 struct sockaddr_storage {
00098     sa_family_t        ss_family;    
00099     char        __ss_pad[_SS_PADSIZE]; 
00100 };
00101 #endif /* NO_SOCKADDR_STORAGE */
00102 
00103 #ifndef SSL_OP_NO_TICKET 
00104 #define SSL_OP_NO_TICKET        0x00004000L
00105 #endif
00106 
00107 #ifdef __cplusplus
00108 }
00109 #endif
00110 
00111 #endif    /* INCL_UTIL_H */