src/jdk.jdwp.agent/windows/native/libdt_socket/socket_md.c
author michaelm
Wed, 29 Nov 2017 16:59:38 +0000
branchhttp-client-branch
changeset 55912 dfa9489d1cb1
parent 47216 71c04702a3d5
child 48767 0c6ce8fdb50a
permissions -rw-r--r--
http-client-branch: fixed Http2TestServerConnection problem
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 15274
diff changeset
     2
 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1247
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
#include <windows.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
#include <winsock2.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#include "sysSocket.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "socketTransport.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
typedef jboolean bool_t;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * Table of Windows Sockets errors, the specific exception we
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * throw for the error, and the error text.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * Note that this table excludes OS dependent errors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
static struct {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
    int errCode;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
    const char *errString;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
} const winsock_errors[] = {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    { WSAEPROVIDERFAILEDINIT,   "Provider initialization failed (check %SystemRoot%)" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    { WSAEACCES,                "Permission denied" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    { WSAEADDRINUSE,            "Address already in use" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    { WSAEADDRNOTAVAIL,         "Cannot assign requested address" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    { WSAEAFNOSUPPORT,          "Address family not supported by protocol family" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    { WSAEALREADY,              "Operation already in progress" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    { WSAECONNABORTED,          "Software caused connection abort" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    { WSAECONNREFUSED,          "Connection refused" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    { WSAECONNRESET,            "Connection reset by peer" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    { WSAEDESTADDRREQ,          "Destination address required" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    { WSAEFAULT,                "Bad address" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    { WSAEHOSTDOWN,             "Host is down" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    { WSAEHOSTUNREACH,          "No route to host" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    { WSAEINPROGRESS,           "Operation now in progress" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    { WSAEINTR,                 "Interrupted function call" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    { WSAEINVAL,                "Invalid argument" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    { WSAEISCONN,               "Socket is already connected" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    { WSAEMFILE,                "Too many open files" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    { WSAEMSGSIZE,              "The message is larger than the maximum supported by the underlying transport" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    { WSAENETDOWN,              "Network is down" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    { WSAENETRESET,             "Network dropped connection on reset" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    { WSAENETUNREACH,           "Network is unreachable" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    { WSAENOBUFS,               "No buffer space available (maximum connections reached?)" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    { WSAENOPROTOOPT,           "Bad protocol option" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    { WSAENOTCONN,              "Socket is not connected" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    { WSAENOTSOCK,              "Socket operation on nonsocket" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    { WSAEOPNOTSUPP,            "Operation not supported" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    { WSAEPFNOSUPPORT,          "Protocol family not supported" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    { WSAEPROCLIM,              "Too many processes" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    { WSAEPROTONOSUPPORT,       "Protocol not supported" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    { WSAEPROTOTYPE,            "Protocol wrong type for socket" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    { WSAESHUTDOWN,             "Cannot send after socket shutdown" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    { WSAESOCKTNOSUPPORT,       "Socket type not supported" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    { WSAETIMEDOUT,             "Connection timed out" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    { WSATYPE_NOT_FOUND,        "Class type not found" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    { WSAEWOULDBLOCK,           "Resource temporarily unavailable" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    { WSAHOST_NOT_FOUND,        "Host not found" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    { WSA_NOT_ENOUGH_MEMORY,    "Insufficient memory available" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    { WSANOTINITIALISED,        "Successful WSAStartup not yet performed" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    { WSANO_DATA,               "Valid name, no data record of requested type" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    { WSANO_RECOVERY,           "This is a nonrecoverable error" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    { WSASYSNOTREADY,           "Network subsystem is unavailable" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    { WSATRY_AGAIN,             "Nonauthoritative host not found" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    { WSAVERNOTSUPPORTED,       "Winsock.dll version out of range" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    { WSAEDISCON,               "Graceful shutdown in progress" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    { WSA_OPERATION_ABORTED,    "Overlapped operation aborted" },
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
};
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * Initialize Windows Sockets API support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
BOOL WINAPI
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    WSADATA wsadata;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    switch (reason) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        case DLL_PROCESS_ATTACH:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
            if (WSAStartup(MAKEWORD(2,2), &wsadata) != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
                return FALSE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        case DLL_PROCESS_DETACH:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
            WSACleanup();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    return TRUE;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 * If we get a nonnull function pointer it might still be the case
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 * that some other thread is in the process of initializing the socket
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 * function pointer table, but our pointer should still be good.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
int
896
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   123
dbgsysListen(int fd, int backlog) {
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   124
    return listen(fd, backlog);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
int
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   128
dbgsysConnect(int fd, struct sockaddr *name, socklen_t namelen) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    int rv = connect(fd, name, namelen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    if (rv == SOCKET_ERROR) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        if (WSAGetLastError() == WSAEINPROGRESS || WSAGetLastError() == WSAEWOULDBLOCK) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            return DBG_EINPROGRESS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    return rv;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   138
int dbgsysFinishConnect(int fd, int timeout) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    int rv;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    struct timeval t;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    fd_set wr, ex;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    t.tv_sec = timeout / 1000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    t.tv_usec = (timeout % 1000) * 1000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    FD_ZERO(&wr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    FD_ZERO(&ex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    FD_SET((unsigned int)fd, &wr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    FD_SET((unsigned int)fd, &ex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    rv = select(fd+1, 0, &wr, &ex, &t);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    if (rv == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        return SYS_ERR;     /* timeout */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * Check if there was an error - this is preferable to check if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * the socket is writable because some versions of Windows don't
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * report a connected socket as being writable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    if (!FD_ISSET(fd, &ex)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        return SYS_OK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * Unable to establish connection - to get the reason we must
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * call getsockopt.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    return SYS_ERR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
int
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   174
dbgsysAccept(int fd, struct sockaddr *name, socklen_t *namelen) {
896
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   175
    return (int)accept(fd, name, namelen);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
int
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   179
dbgsysRecvFrom(int fd, char *buf, size_t nBytes,
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   180
                  int flags, struct sockaddr *from, socklen_t *fromlen) {
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   181
    return recvfrom(fd, buf, (int)nBytes, flags, from, fromlen);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
int
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   185
dbgsysSendTo(int fd, char *buf, size_t len,
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   186
                int flags, struct sockaddr *to, socklen_t tolen) {
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   187
    return sendto(fd, buf, (int)len, flags, to, tolen);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
int
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   191
dbgsysRecv(int fd, char *buf, size_t nBytes, int flags) {
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   192
    return recv(fd, buf, (int) nBytes, flags);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
int
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   196
dbgsysSend(int fd, char *buf, size_t nBytes, int flags) {
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   197
    return send(fd, buf, (int)nBytes, flags);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
struct hostent *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
dbgsysGetHostByName(char *hostname) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    return gethostbyname(hostname);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
unsigned short
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
dbgsysHostToNetworkShort(unsigned short hostshort) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    return htons(hostshort);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
dbgsysSocket(int domain, int type, int protocol) {
896
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   212
  int fd = (int)socket(domain, type, protocol);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
  if (fd != SOCKET_ERROR) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
      SetHandleInformation((HANDLE)(UINT_PTR)fd, HANDLE_FLAG_INHERIT, FALSE);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
  return fd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
dbgsysSocketClose(int fd) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    struct linger l;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    int len = sizeof(l);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    if (getsockopt(fd, SOL_SOCKET, SO_LINGER, (char *)&l, &len) == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        if (l.l_onoff == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
            WSASendDisconnect(fd, NULL);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    return closesocket(fd);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
/* Additions to original follow */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
int
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   235
dbgsysBind(int fd, struct sockaddr *name, socklen_t namelen) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    return bind(fd, name, namelen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
896
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   240
uint32_t
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
dbgsysInetAddr(const char* cp) {
896
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   242
    return (uint32_t)inet_addr(cp);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
896
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   245
uint32_t
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   246
dbgsysHostToNetworkLong(uint32_t hostlong) {
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   247
    return (uint32_t)htonl((u_long)hostlong);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
unsigned short
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
dbgsysNetworkToHostShort(unsigned short netshort) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    return ntohs(netshort);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
int
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   256
dbgsysGetSocketName(int fd, struct sockaddr *name, socklen_t *namelen) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    return getsockname(fd, name, namelen);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
896
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   260
uint32_t
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   261
dbgsysNetworkToHostLong(uint32_t netlong) {
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
   262
    return (uint32_t)ntohl((u_long)netlong);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
 * Below Adapted from PlainSocketImpl.c, win32 version 1.18. Changed exception
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
 * throws to returns of SYS_ERR; we should improve the error codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
 * eventually. Changed java objects to values the debugger back end can
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
 * more easily deal with.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
dbgsysSetSocketOption(int fd, jint cmd, jboolean on, jvalue value)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    if (cmd == TCP_NODELAY) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        struct protoent *proto = getprotobyname("TCP");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
        int tcp_level = (proto == 0 ? IPPROTO_TCP: proto->p_proto);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        long onl = (long)on;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
        if (setsockopt(fd, tcp_level, TCP_NODELAY,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
                       (char *)&onl, sizeof(long)) < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
                return SYS_ERR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
    } else if (cmd == SO_LINGER) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
        struct linger arg;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        arg.l_onoff = on;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
        if(on) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
            arg.l_linger = (unsigned short)value.i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
            if(setsockopt(fd, SOL_SOCKET, SO_LINGER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
                          (char*)&arg, sizeof(arg)) < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
                return SYS_ERR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
            if (setsockopt(fd, SOL_SOCKET, SO_LINGER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
                           (char*)&arg, sizeof(arg)) < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
                return SYS_ERR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    } else if (cmd == SO_SNDBUF) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        jint buflen = value.i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
        if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
                       (char *)&buflen, sizeof(buflen)) < 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
            return SYS_ERR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    } else if (cmd == SO_REUSEADDR) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
         * On Windows the SO_REUSEADDR socket option doesn't implement
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
         * BSD semantics. Specifically, the socket option allows multiple
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
         * processes to bind to the same address/port rather than allowing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
         * a process to bind with a previous connection in the TIME_WAIT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
         * state. Hence on Windows we never enable this option for TCP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
         * option.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
        int sotype, arglen=sizeof(sotype);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        if (getsockopt(fd, SOL_SOCKET, SO_TYPE, (void *)&sotype, &arglen) == SOCKET_ERROR) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
            return SYS_ERR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
        if (sotype != SOCK_STREAM) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
            int oni = (int)on;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
            if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
                       (char *)&oni, sizeof(oni)) == SOCKET_ERROR) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
                return SYS_ERR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
        return SYS_ERR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
    return SYS_OK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
int dbgsysConfigureBlocking(int fd, jboolean blocking) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
    u_long argp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
    int result = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    if (blocking == JNI_FALSE) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
        argp = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
        argp = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
    result = ioctlsocket(fd, FIONBIO, &argp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
    if (result == SOCKET_ERROR) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
        return SYS_ERR;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
        return SYS_OK;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
dbgsysPoll(int fd, jboolean rd, jboolean wr, long timeout) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
    int rv;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
    struct timeval t;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
    fd_set rd_tbl, wr_tbl;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
    t.tv_sec = timeout / 1000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
    t.tv_usec = (timeout % 1000) * 1000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
    FD_ZERO(&rd_tbl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
    if (rd) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
        FD_SET((unsigned int)fd, &rd_tbl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
    FD_ZERO(&wr_tbl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
    if (wr) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
        FD_SET((unsigned int)fd, &wr_tbl);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    rv = select(fd+1, &rd_tbl, &wr_tbl, 0, &t);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    if (rv >= 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
        rv = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        if (FD_ISSET(fd, &rd_tbl)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
            rv |= DBG_POLLIN;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
        if (FD_ISSET(fd, &wr_tbl)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
            rv |= DBG_POLLOUT;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
    return rv;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
dbgsysGetLastIOError(char *buf, jint size) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    int table_size = sizeof(winsock_errors) /
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
                     sizeof(winsock_errors[0]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
    int i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    int error = WSAGetLastError();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     * Check table for known winsock errors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
    i=0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    while (i < table_size) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
        if (error == winsock_errors[i].errCode) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
        i++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
    if (i < table_size) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
        strcpy(buf, winsock_errors[i].errString);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
        sprintf(buf, "winsock error %d", error);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    return 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
int
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
dbgsysTlsAlloc() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
    return TlsAlloc();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
void
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
dbgsysTlsFree(int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
    TlsFree(index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
void
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
dbgsysTlsPut(int index, void *value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    TlsSetValue(index, value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
void *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
dbgsysTlsGet(int index) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
    return TlsGetValue(index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
#define FT2INT64(ft) \
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
   429
        ((INT64)(ft).dwHighDateTime << 32 | (INT64)(ft).dwLowDateTime)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
long
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
dbgsysCurrentTimeMillis() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    static long fileTime_1_1_70 = 0;    /* midnight 1/1/70 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
    SYSTEMTIME st0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    FILETIME   ft0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
    /* initialize on first usage */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    if (fileTime_1_1_70 == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
        memset(&st0, 0, sizeof(st0));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
        st0.wYear  = 1970;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
        st0.wMonth = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
        st0.wDay   = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
        SystemTimeToFileTime(&st0, &ft0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
        fileTime_1_1_70 = FT2INT64(ft0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
    GetSystemTime(&st0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
    SystemTimeToFileTime(&st0, &ft0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
    return (FT2INT64(ft0) - fileTime_1_1_70) / 10000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
}