bump product version to 5.0.4.1
[LibreOffice.git] / sal / qa / osl / socket / osl_Socket_Const_orig.h
blobc59e8a2da9edbcb032f4148ccc34de749359e837
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef _OSL_SOCKET_CONST_H_
21 #define _OSL_SOCKET_CONST_H_
23 #include <sal/types.h>
24 #include <rtl/textenc.h>
25 #include <rtl/ustring.hxx>
26 #include <rtl/ustring.h>
27 #include <osl/socket.hxx>
28 #include <osl/socket.h>
29 #include <osl/thread.hxx>
30 #include <osl/file.hxx>
31 #include <osl/mutex.hxx>
32 #include <osl/time.h>
34 const char * pTestString1 = "test socket";
35 const char * pTestString2 = " Passed#OK";
37 #ifdef __cplusplus
38 extern "C"
40 #endif
42 # include <stdio.h>
44 // OS dependent declaration and includes
46 #if ( defined UNX ) //Unix
47 # include <unistd.h>
48 # include <limits.h>
49 # include <string.h>
50 # include <math.h>
51 # include <errno.h>
52 # include <fcntl.h>
53 # include <sys/stat.h>
54 # include <sys/statfs.h>
55 # include <sys/statvfs.h>
56 # include <sys/types.h>
57 # include <sys/socket.h>
58 # include <netdb.h>
59 # include <netinet/in.h>
60 # include <arpa/inet.h>
61 #endif
62 #if ( defined WNT ) // Windows
63 # include <winsock.h>
64 # include <string.h>
65 #endif
67 // macro definition for the ASCII array/OUString declarations,
68 // we use p### for the ASCII array,
69 // a### for the OUString,
70 // n###Len for its length
72 #define OSLTEST_DECLARE( str_name, str_value ) \
73 static const sal_Char p##str_name[] = str_value; \
74 static const sal_Int32 n##str_name##Len = sizeof( p##str_name ) -1; \
75 ::rtl::OUString a##str_name = rtl::OUString::createFromAscii( p##str_name )
77 // Ip version definition
79 #define IP_VER 4 /// currently only IPv4 is considered.
81 // Ip port definition
83 #define IP_PORT_ZERO 0
84 #define IP_PORT_FTP 21
85 #define IP_PORT_TELNET 23
86 #define IP_PORT_HTTP1 80
87 #define IP_PORT_POP3 110
88 #define IP_PORT_NETBIOS_DGM 138
89 #define IP_PORT_NETBIOS 139
90 #define IP_PORT_HTTP2 8080
91 /**reference: http://www.iana.org/assignments/port-numbers */
92 #define IP_PORT_MYPORT 8881 //8888
93 #define IP_PORT_MYPORT1 8882 //8889
94 #define IP_PORT_MYPORT2 8883 //8890
95 #define IP_PORT_MYPORT3 8884 //8891
96 #define IP_PORT_MYPORT4 8885 //8892
97 #define IP_PORT_MYPORT5 8886 //8893
98 #define IP_PORT_MYPORT6 8887 //8894
99 #define IP_PORT_MYPORT7 8895
100 #define IP_PORT_MYPORT8 8896
101 #define IP_PORT_MYPORT9 8897
102 #define IP_PORT_MYPORT10 8898
104 #define IP_PORT_INVAL 99999
106 // service definitions.
108 OSLTEST_DECLARE( ServiceFTP, "ftp" );
109 OSLTEST_DECLARE( ServiceTELNET, "telnet" );
110 OSLTEST_DECLARE( ServiceIMAP, "imap" );
111 OSLTEST_DECLARE( ServiceHTTPS, "https" );
112 OSLTEST_DECLARE( ServiceNETBIOS, "netbios-dgm" );
114 // protocol definitions.
116 OSLTEST_DECLARE( ProtocolTCP, "tcp" );
117 OSLTEST_DECLARE( ProtocolUDP, "udp" );
119 // Hostnames.
121 OSLTEST_DECLARE( HostName1, "localhost" );
122 OSLTEST_DECLARE( HostIp1, "127.0.0.1" );
123 OSLTEST_DECLARE( HostName2, "longshot.prc.sun.com" );
124 OSLTEST_DECLARE( HostIp2, "129.158.217.202" );
125 OSLTEST_DECLARE( HostName3, "deuce.prc.sun.com" );
126 OSLTEST_DECLARE( HostIp3, "129.158.217.199" );
127 OSLTEST_DECLARE( HostName4, "sceri.PRC.Sun.COM" ); //Beijing server for test
128 OSLTEST_DECLARE( HostIp4, "129.158.217.107" );
129 OSLTEST_DECLARE( HostName5, "koori.SFBay.Sun.COM" ); //"grande.Germany.Sun.COM" ); //Germany server for test
130 OSLTEST_DECLARE( HostIp5, "10.5.32.20" );
131 OSLTEST_DECLARE( HostName6, "crumple.SFBay.Sun.COM" ); //sfbay
132 OSLTEST_DECLARE( HostIp6, "10.6.103.83" );
133 OSLTEST_DECLARE( HostIpInval, "123.45.67.89" ); //this is valid ip number,but can not arrive --mindy
134 OSLTEST_DECLARE( HostIpInval1, "123.345.67.89" ); //this is real invalid ip number --mindy
135 OSLTEST_DECLARE( HostNameInval, "www.the_hostname_that_can_not_resolvable_to_an_IP_Address.com" );
136 OSLTEST_DECLARE( HostIpZero, "0.0.0.0" );
138 // OS independent file definition
140 OSLTEST_DECLARE( NullURL, "" );
142 #ifdef __cplusplus
144 #endif
146 #endif /* _OSL_SOCKET_CONST_H_ */
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */