1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 //------------------------------------------------------------------------ 29 //------------------------------------------------------------------------ 30 31 #ifndef _OSL_SOCKET_CONST_H_ 32 #define _OSL_SOCKET_CONST_H_ 33 34 //------------------------------------------------------------------------ 35 //------------------------------------------------------------------------ 36 #include <sal/types.h> 37 #include <rtl/textenc.h> 38 #include <rtl/ustring.hxx> 39 #include <rtl/ustring.h> 40 41 #ifndef _OSL_SOCLET_HXX_ 42 #include <osl/socket.hxx> 43 #endif 44 #include <osl/socket.h> 45 46 #ifndef _OSL_THREAD_HXX 47 #include <osl/thread.hxx> 48 #endif 49 50 #ifndef _OSL_FILE_HXX 51 #include <osl/file.hxx> 52 #endif 53 54 #ifndef _OSL_MUTEX_HXX 55 #include <osl/mutex.hxx> 56 #endif 57 #include <osl/time.h> 58 59 const char * pTestString1 = "test socket"; 60 const char * pTestString2 = " Passed#OK"; 61 //define read count 62 //------------------------------------------------------------------------ 63 //------------------------------------------------------------------------ 64 65 #ifdef __cplusplus 66 extern "C" 67 { 68 #endif 69 70 # include <stdio.h> 71 //------------------------------------------------------------------------ 72 // OS dependent declaration and includes 73 //------------------------------------------------------------------------ 74 #if ( defined UNX ) || ( defined OS2 ) //Unix 75 # include <unistd.h> 76 # include <limits.h> 77 # include <string.h> 78 # include <math.h> 79 # include <errno.h> 80 # include <fcntl.h> 81 # include <sys/stat.h> 82 # include <sys/statfs.h> 83 # include <sys/statvfs.h> 84 # include <sys/types.h> 85 # include <sys/socket.h> 86 # include <netdb.h> 87 # include <netinet/in.h> 88 # include <arpa/inet.h> 89 #endif 90 #if ( defined WNT ) // Windows 91 #include <tools/prewin.h> 92 // # include <windows.h> 93 # include <winsock.h> 94 # include <string.h> 95 #include <tools/postwin.h> 96 #endif 97 98 99 //------------------------------------------------------------------------ 100 // macro definition for the ASCII array/OUString declarations, 101 // we use p### for the ASCII array, 102 // a### for the OUString, 103 // n###Len for its length 104 //------------------------------------------------------------------------ 105 106 #define OSLTEST_DECLARE( str_name, str_value ) \ 107 static const sal_Char p##str_name[] = str_value; \ 108 static const sal_Int32 n##str_name##Len = sizeof( p##str_name ) -1; \ 109 ::rtl::OUString a##str_name = rtl::OUString::createFromAscii( p##str_name ) 110 111 112 //------------------------------------------------------------------------ 113 // Ip version definition 114 //------------------------------------------------------------------------ 115 #define IP_VER 4 /// currently only IPv4 is considered. 116 117 //------------------------------------------------------------------------ 118 // Ip port definition 119 //------------------------------------------------------------------------ 120 // #define IP_PORT_ZERO 0 121 // #define IP_PORT_TELNET 23 122 // #define IP_PORT_SMTP 25 123 // #define IP_PORT_GOPHER 70 124 // #define IP_PORT_POP3 110 125 // #define IP_PORT_NETBIOS_DGM 138 126 // #define IP_PORT_NETBIOS 139 127 // #define IP_PORT_IMAP 143 128 // #define IP_PORT_HTTPS 443 129 // /**reference: http://www.iana.org/assignments/port-numbers */ 130 // #define IP_PORT_MYPORT 8881 //8888 131 // #define IP_PORT_MYPORT1 8882 //8889 132 // #define IP_PORT_MYPORT3 8884 //8891 133 // #define IP_PORT_MYPORT4 8885 //8892 134 // #define IP_PORT_MYPORT5 8886 //8893 135 // #define IP_PORT_MYPORT6 8887 //8894 136 // #define IP_PORT_MYPORT7 8895 137 // #define IP_PORT_MYPORT8 8896 138 // #define IP_PORT_MYPORT9 8897 139 // #define IP_PORT_MYPORT10 8898 140 // 141 // #define IP_PORT_TMP 9999 142 // #define IP_PORT_INVAL 99999 143 144 //------------------------------------------------------------------------ 145 // service definitions. 146 //------------------------------------------------------------------------ 147 // OSLTEST_DECLARE( ServiceFTP, "ftp" ); 148 // OSLTEST_DECLARE( ServiceTELNET, "telnet" ); 149 // OSLTEST_DECLARE( ServiceGOPHER, "gopher" ); 150 // OSLTEST_DECLARE( ServiceIMAP, "imap" ); 151 // OSLTEST_DECLARE( ServiceHTTPS, "https" ); 152 // OSLTEST_DECLARE( ServiceNETBIOS, "netbios-dgm" ); 153 154 //------------------------------------------------------------------------ 155 // protocol definitions. 156 //------------------------------------------------------------------------ 157 // OSLTEST_DECLARE( ProtocolTCP, "tcp" ); 158 // OSLTEST_DECLARE( ProtocolUDP, "udp" ); 159 160 //------------------------------------------------------------------------ 161 // Hostnames. 162 //------------------------------------------------------------------------ 163 // OSLTEST_DECLARE( HostName1, "localhost" ); 164 // OSLTEST_DECLARE( HostIp1, "127.0.0.1" ); 165 OSLTEST_DECLARE( HostName2, "longshot.prc.sun.com" ); 166 OSLTEST_DECLARE( HostIp2, "129.158.217.202" ); 167 OSLTEST_DECLARE( HostName3, "deuce.prc.sun.com" ); 168 OSLTEST_DECLARE( HostIp3, "129.158.217.199" ); 169 OSLTEST_DECLARE( HostName4, "sceri.PRC.Sun.COM" ); //Beijing server for test 170 OSLTEST_DECLARE( HostIp4, "129.158.217.107" ); 171 OSLTEST_DECLARE( HostName5, "koori.SFBay.Sun.COM" ); //"grande.Germany.Sun.COM" ); //Germany server for test 172 OSLTEST_DECLARE( HostIp5, "10.5.32.20" ); 173 OSLTEST_DECLARE( HostName6, "crumple.SFBay.Sun.COM" ); //sfbay 174 OSLTEST_DECLARE( HostIp6, "10.6.103.83" ); 175 OSLTEST_DECLARE( HostIpInval, "123.45.67.89" ); //this is valid ip number,but can not arrive --mindy 176 // OSLTEST_DECLARE( HostIpInval1, "123.345.67.89" ); //this is real invalid ip number --mindy 177 OSLTEST_DECLARE( HostNameInval, "www.the_hostname_that_can_not_resolvable_to_an_IP_Address.com" ); 178 OSLTEST_DECLARE( HostIpZero, "0.0.0.0" ); 179 180 //------------------------------------------------------------------------ 181 // OS independent file definition 182 //------------------------------------------------------------------------ 183 OSLTEST_DECLARE( NullURL, "" ); 184 185 //------------------------------------------------------------------------ 186 //------------------------------------------------------------------------ 187 188 #ifdef __cplusplus 189 } 190 #endif 191 192 //------------------------------------------------------------------------ 193 //------------------------------------------------------------------------ 194 195 196 #endif /* _OSL_SOCKET_CONST_H_ */ 197