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