xref: /aoo42x/main/sal/osl/w32/sockimpl.h (revision 9eab2a37)
1*9eab2a37SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9eab2a37SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9eab2a37SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9eab2a37SAndrew Rist  * distributed with this work for additional information
6*9eab2a37SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9eab2a37SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9eab2a37SAndrew Rist  * "License"); you may not use this file except in compliance
9*9eab2a37SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9eab2a37SAndrew Rist  *
11*9eab2a37SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9eab2a37SAndrew Rist  *
13*9eab2a37SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9eab2a37SAndrew Rist  * software distributed under the License is distributed on an
15*9eab2a37SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9eab2a37SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9eab2a37SAndrew Rist  * specific language governing permissions and limitations
18*9eab2a37SAndrew Rist  * under the License.
19*9eab2a37SAndrew Rist  *
20*9eab2a37SAndrew Rist  *************************************************************/
21*9eab2a37SAndrew Rist 
22*9eab2a37SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _OSL_SOCKETIMPL_H_
25cdf0e10cSrcweir #define _OSL_SOCKETIMPL_H_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <osl/socket.h>
28cdf0e10cSrcweir #include <osl/interlck.h>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #ifdef __cplusplus
31cdf0e10cSrcweir extern "C" {
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir 
34cdf0e10cSrcweir /*****************************************************************************/
35cdf0e10cSrcweir /* oslSocketImpl */
36cdf0e10cSrcweir /*****************************************************************************/
37cdf0e10cSrcweir #define OSL_SOCKET_FLAGS_NONBLOCKING	0x0001
38cdf0e10cSrcweir 
39cdf0e10cSrcweir typedef void* (SAL_CALL * oslCloseCallback) (void*);
40cdf0e10cSrcweir 
41cdf0e10cSrcweir struct oslSocketImpl {
42cdf0e10cSrcweir 	oslInterlockedCount m_nRefCount;
43cdf0e10cSrcweir 	SOCKET				m_Socket;
44cdf0e10cSrcweir 	int					m_Flags;
45cdf0e10cSrcweir 	oslCloseCallback	m_CloseCallback;
46cdf0e10cSrcweir 	void*				m_CallbackArg;
47cdf0e10cSrcweir };
48cdf0e10cSrcweir 
49cdf0e10cSrcweir struct oslSocketAddrImpl
50cdf0e10cSrcweir {
51cdf0e10cSrcweir 	struct sockaddr m_sockaddr;
52cdf0e10cSrcweir 	oslInterlockedCount m_nRefCount;
53cdf0e10cSrcweir };
54cdf0e10cSrcweir 
55cdf0e10cSrcweir oslSocket __osl_createSocketImpl(SOCKET Socket);
56cdf0e10cSrcweir void __osl_destroySocketImpl(oslSocket pImpl);
57cdf0e10cSrcweir 
58cdf0e10cSrcweir /*****************************************************************************/
59cdf0e10cSrcweir /* oslSocketDialupImpl */
60cdf0e10cSrcweir /*****************************************************************************/
61cdf0e10cSrcweir #define INTERNET_MODULE_NAME "wininet.dll"
62cdf0e10cSrcweir 
63cdf0e10cSrcweir #define INTERNET_CONNECTION_MODEM  0x00000001L
64cdf0e10cSrcweir #define INTERNET_CONNECTION_LAN    0x00000002L
65cdf0e10cSrcweir #define INTERNET_CONNECTION_HANGUP 0x80000000L
66cdf0e10cSrcweir 
67cdf0e10cSrcweir typedef DWORD (WINAPI *INTERNETATTEMPTCONNECT) (
68cdf0e10cSrcweir 	DWORD dwReserved);
69cdf0e10cSrcweir typedef BOOL (WINAPI *INTERNETAUTODIAL) (
70cdf0e10cSrcweir 	DWORD dwFlags, DWORD dwReserved);
71cdf0e10cSrcweir typedef BOOL (WINAPI *INTERNETAUTODIALHANGUP) (
72cdf0e10cSrcweir 	DWORD dwReserved);
73cdf0e10cSrcweir typedef BOOL (WINAPI *INTERNETGETCONNECTEDSTATE) (
74cdf0e10cSrcweir 	LPDWORD lpdwFlags, DWORD dwReserved);
75cdf0e10cSrcweir 
76cdf0e10cSrcweir typedef struct osl_socket_dialup_impl_st
77cdf0e10cSrcweir {
78cdf0e10cSrcweir 	CRITICAL_SECTION          m_hMutex;
79cdf0e10cSrcweir 	HINSTANCE                 m_hModule;
80cdf0e10cSrcweir 	INTERNETATTEMPTCONNECT    m_pfnAttemptConnect;
81cdf0e10cSrcweir 	INTERNETAUTODIAL          m_pfnAutodial;
82cdf0e10cSrcweir 	INTERNETAUTODIALHANGUP    m_pfnAutodialHangup;
83cdf0e10cSrcweir 	INTERNETGETCONNECTEDSTATE m_pfnGetConnectedState;
84cdf0e10cSrcweir 	DWORD                     m_dwFlags;
85cdf0e10cSrcweir } oslSocketDialupImpl;
86cdf0e10cSrcweir 
87cdf0e10cSrcweir static oslSocketDialupImpl* __osl_createSocketDialupImpl (void);
88cdf0e10cSrcweir static void __osl_initSocketDialupImpl (oslSocketDialupImpl *pImpl);
89cdf0e10cSrcweir static void __osl_destroySocketDialupImpl (oslSocketDialupImpl *pImpl);
90cdf0e10cSrcweir 
91cdf0e10cSrcweir static sal_Bool __osl_querySocketDialupImpl (void);
92cdf0e10cSrcweir static sal_Bool __osl_attemptSocketDialupImpl (void);
93cdf0e10cSrcweir 
94cdf0e10cSrcweir /*****************************************************************************/
95cdf0e10cSrcweir /* The End */
96cdf0e10cSrcweir /*****************************************************************************/
97cdf0e10cSrcweir 
98cdf0e10cSrcweir #ifdef __cplusplus
99cdf0e10cSrcweir }
100cdf0e10cSrcweir #endif
101cdf0e10cSrcweir 
102cdf0e10cSrcweir #endif
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 
105