blob: 2a0ed24dcd6cc8f67291d44f2be6e94d7e17725f [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25#ifndef _JAVASOFT_WIN32_SOCKET_MD_H
26
27#include <jni.h>
28#include <sys/types.h>
29#include "sys.h"
30#include "socket_md.h"
31
32#ifdef _LP64
33typedef unsigned int UINT32;
34typedef int INT32;
35#else /* _LP64 */
36typedef unsigned long UINT32;
37typedef long INT32;
38#endif /* _LP64 */
39
40#define DBG_POLLIN 1
41#define DBG_POLLOUT 2
42
43#define DBG_EINPROGRESS -150
44#define DBG_ETIMEOUT -200
45
46int dbgsysSocketClose(int fd);
47INT32 dbgsysSocketAvailable(int fd, INT32 *pbytes);
48int dbgsysConnect(int fd, struct sockaddr *him, int len);
49int dbgsysFinishConnect(int fd, long timeout);
50int dbgsysAccept(int fd, struct sockaddr *him, int *len);
51int dbgsysSendTo(int fd, char *buf, int len, int flags, struct sockaddr *to,
52 int tolen);
53int dbgsysRecvFrom(int fd, char *buf, int nbytes, int flags,
54 struct sockaddr *from, int *fromlen);
55int dbgsysListen(int fd, INT32 count);
56int dbgsysRecv(int fd, char *buf, int nBytes, int flags);
57int dbgsysSend(int fd, char *buf, int nBytes, int flags);
58int dbgsysTimeout(int fd, INT32 timeout);
59struct hostent *dbgsysGetHostByName(char *hostname);
60int dbgsysSocket(int domain, int type, int protocol);
61int dbgsysBind(int fd, struct sockaddr *name, int namelen);
62int dbgsysSetSocketOption(int fd, jint cmd, jboolean on, jvalue value);
63UINT32 dbgsysInetAddr(const char* cp);
64UINT32 dbgsysHostToNetworkLong(UINT32 hostlong);
65unsigned short dbgsysHostToNetworkShort(unsigned short hostshort);
66UINT32 dbgsysNetworkToHostLong(UINT32 netlong);
67unsigned short dbgsysNetworkToHostShort(unsigned short netshort);
68int dbgsysGetSocketName(int fd, struct sockaddr *him, int *len);
69int dbgsysConfigureBlocking(int fd, jboolean blocking);
70int dbgsysPoll(int fd, jboolean rd, jboolean wr, long timeout);
71int dbgsysGetLastIOError(char *buf, jint size);
72long dbgsysCurrentTimeMillis();
73
74/*
75 * TLS support
76 */
77int dbgsysTlsAlloc();
78void dbgsysTlsFree(int index);
79void dbgsysTlsPut(int index, void *value);
80void* dbgsysTlsGet(int index);
81
82#endif