src/jdk.jdwp.agent/share/native/libdt_socket/sysSocket.h
author phh
Sat, 30 Nov 2019 14:33:05 -0800
changeset 59330 5b96c12f909d
parent 54884 8a6093c186a6
permissions -rw-r--r--
8234541: C1 emits an empty message when it inlines successfully Summary: Use "inline" as the message when successfull Reviewed-by: thartmann, mdoerr Contributed-by: navy.xliu@gmail.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
54884
8a6093c186a6 8184770: JDWP support for IPv6
amenkov
parents: 48767
diff changeset
     2
 * Copyright (c) 1998, 2019, 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
#ifndef _JAVASOFT_WIN32_SOCKET_MD_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
#include <jni.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
#include <sys/types.h>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
#include "sys.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
#include "socket_md.h"
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
#define DBG_POLLIN              1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
#define DBG_POLLOUT             2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
#define DBG_EINPROGRESS         -150
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
#define DBG_ETIMEOUT            -200
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    37
#ifdef WIN32
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    38
typedef int socklen_t;
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    39
#endif
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
int dbgsysSocketClose(int fd);
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    42
int dbgsysConnect(int fd, struct sockaddr *him, socklen_t len);
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    43
int dbgsysFinishConnect(int fd, int timeout);
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    44
int dbgsysAccept(int fd, struct sockaddr *him, socklen_t *len);
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    45
int dbgsysSendTo(int fd, char *buf, size_t len, int flags, struct sockaddr *to, socklen_t tolen);
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    46
int dbgsysRecvFrom(int fd, char *buf, size_t nBytes, int flags, struct sockaddr *from, socklen_t *fromlen);
896
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
    47
int dbgsysListen(int fd, int backlog);
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    48
int dbgsysRecv(int fd, char *buf, size_t nBytes, int flags);
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    49
int dbgsysSend(int fd, char *buf, size_t nBytes, int flags);
54884
8a6093c186a6 8184770: JDWP support for IPv6
amenkov
parents: 48767
diff changeset
    50
int dbgsysGetAddrInfo(const char *hostname, const char *service, const struct addrinfo *hints, struct addrinfo **results);
8a6093c186a6 8184770: JDWP support for IPv6
amenkov
parents: 48767
diff changeset
    51
void dbgsysFreeAddrInfo(struct addrinfo *info);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
int dbgsysSocket(int domain, int type, int protocol);
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    53
int dbgsysBind(int fd, struct sockaddr *name, socklen_t namelen);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
int dbgsysSetSocketOption(int fd, jint cmd, jboolean on, jvalue value);
896
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
    55
uint32_t dbgsysHostToNetworkLong(uint32_t hostlong);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
unsigned short dbgsysHostToNetworkShort(unsigned short hostshort);
896
5c02031316bf 6725543: Compiler warnings in serviceability native code
ohair
parents: 2
diff changeset
    57
uint32_t dbgsysNetworkToHostLong(uint32_t netlong);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
unsigned short dbgsysNetworkToHostShort(unsigned short netshort);
15274
a77cdd5ea6e3 8005120: Compiler warnings in socket transport native code
jzavgren
parents: 5506
diff changeset
    59
int dbgsysGetSocketName(int fd, struct sockaddr *him, socklen_t *len);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
int dbgsysConfigureBlocking(int fd, jboolean blocking);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
int dbgsysPoll(int fd, jboolean rd, jboolean wr, long timeout);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
int dbgsysGetLastIOError(char *buf, jint size);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
long dbgsysCurrentTimeMillis();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * TLS support
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
int dbgsysTlsAlloc();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
void dbgsysTlsFree(int index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
void dbgsysTlsPut(int index, void *value);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
void* dbgsysTlsGet(int index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
#endif