merge the formfield patch from ooo-build
[ooovba.git] / sal / qa / osl / socket / osl_Socket_Const.h
blobbc02de4daf5ec2eae7a5f0039b46cca593a84932
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.h,v $
10 * $Revision: 1.8 $
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_TELNET 23
125 // #define IP_PORT_SMTP 25
126 // #define IP_PORT_GOPHER 70
127 // #define IP_PORT_POP3 110
128 // #define IP_PORT_NETBIOS_DGM 138
129 // #define IP_PORT_NETBIOS 139
130 // #define IP_PORT_IMAP 143
131 // #define IP_PORT_HTTPS 443
132 // /**reference: http://www.iana.org/assignments/port-numbers */
133 // #define IP_PORT_MYPORT 8881 //8888
134 // #define IP_PORT_MYPORT1 8882 //8889
135 // #define IP_PORT_MYPORT3 8884 //8891
136 // #define IP_PORT_MYPORT4 8885 //8892
137 // #define IP_PORT_MYPORT5 8886 //8893
138 // #define IP_PORT_MYPORT6 8887 //8894
139 // #define IP_PORT_MYPORT7 8895
140 // #define IP_PORT_MYPORT8 8896
141 // #define IP_PORT_MYPORT9 8897
142 // #define IP_PORT_MYPORT10 8898
144 // #define IP_PORT_TMP 9999
145 // #define IP_PORT_INVAL 99999
147 //------------------------------------------------------------------------
148 // service definitions.
149 //------------------------------------------------------------------------
150 // OSLTEST_DECLARE( ServiceFTP, "ftp" );
151 // OSLTEST_DECLARE( ServiceTELNET, "telnet" );
152 // OSLTEST_DECLARE( ServiceGOPHER, "gopher" );
153 // OSLTEST_DECLARE( ServiceIMAP, "imap" );
154 // OSLTEST_DECLARE( ServiceHTTPS, "https" );
155 // OSLTEST_DECLARE( ServiceNETBIOS, "netbios-dgm" );
157 //------------------------------------------------------------------------
158 // protocol definitions.
159 //------------------------------------------------------------------------
160 // OSLTEST_DECLARE( ProtocolTCP, "tcp" );
161 // OSLTEST_DECLARE( ProtocolUDP, "udp" );
163 //------------------------------------------------------------------------
164 // Hostnames.
165 //------------------------------------------------------------------------
166 // OSLTEST_DECLARE( HostName1, "localhost" );
167 // OSLTEST_DECLARE( HostIp1, "127.0.0.1" );
168 OSLTEST_DECLARE( HostName2, "longshot.prc.sun.com" );
169 OSLTEST_DECLARE( HostIp2, "129.158.217.202" );
170 OSLTEST_DECLARE( HostName3, "deuce.prc.sun.com" );
171 OSLTEST_DECLARE( HostIp3, "129.158.217.199" );
172 OSLTEST_DECLARE( HostName4, "sceri.PRC.Sun.COM" ); //Beijing server for test
173 OSLTEST_DECLARE( HostIp4, "129.158.217.107" );
174 OSLTEST_DECLARE( HostName5, "koori.SFBay.Sun.COM" ); //"grande.Germany.Sun.COM" ); //Germany server for test
175 OSLTEST_DECLARE( HostIp5, "10.5.32.20" );
176 OSLTEST_DECLARE( HostName6, "crumple.SFBay.Sun.COM" ); //sfbay
177 OSLTEST_DECLARE( HostIp6, "10.6.103.83" );
178 OSLTEST_DECLARE( HostIpInval, "123.45.67.89" ); //this is valid ip number,but can not arrive --mindy
179 // OSLTEST_DECLARE( HostIpInval1, "123.345.67.89" ); //this is real invalid ip number --mindy
180 OSLTEST_DECLARE( HostNameInval, "www.the_hostname_that_can_not_resolvable_to_an_IP_Address.com" );
181 OSLTEST_DECLARE( HostIpZero, "0.0.0.0" );
183 //------------------------------------------------------------------------
184 // OS independent file definition
185 //------------------------------------------------------------------------
186 OSLTEST_DECLARE( NullURL, "" );
188 //------------------------------------------------------------------------
189 //------------------------------------------------------------------------
191 #ifdef __cplusplus
193 #endif
195 //------------------------------------------------------------------------
196 //------------------------------------------------------------------------
199 #endif /* _OSL_SOCKET_CONST_H_ */