/* * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
/** * This function will fill a SOCKETADDRESS structure from an InetAddress * object. * * The parameter 'sa' must point to valid storage of size * 'sizeof(SOCKETADDRESS)'. * * The parameter 'len' is a pointer to an int and is used for returning * the actual sockaddr length, e.g. 'sizeof(struct sockaddr_in)' or * 'sizeof(struct sockaddr_in6)'. * * If the type of the InetAddress object is IPv6, the function will fill a * sockaddr_in6 structure. IPv6 must be available in that case, otherwise an * exception is thrown. * In the case of an IPv4 InetAddress, when IPv6 is available and * v4MappedAddress is TRUE, this method will fill a sockaddr_in6 structure * containing an IPv4 mapped IPv6 address. Otherwise a sockaddr_in * structure will be filled.
*/
JNIEXPORT int JNICALL
NET_InetAddressToSockaddr(JNIEnv *env, jobject iaObj, int port,
SOCKETADDRESS *sa, int *len,
jboolean v4MappedAddress);
JNIEXPORT jobject JNICALL
NET_SockaddrToInetAddress(JNIEnv *env, SOCKETADDRESS *sa, int *port);
/* Socket operations * * These work just like the system calls, except that they may do some * platform-specific pre/post processing of the arguments and/or results.
*/
JNIEXPORT int JNICALL
NET_SocketAvailable(int fd, int *pbytes);
JNIEXPORT int JNICALL
NET_GetSockOpt(int fd, int level, int opt, void *result, int *len);
JNIEXPORT int JNICALL
NET_SetSockOpt(int fd, int level, int opt, constvoid *arg, int len);
JNIEXPORT int JNICALL
NET_Bind(int fd, SOCKETADDRESS *sa, int len);
JNIEXPORT int JNICALL
NET_MapSocketOption(jint cmd, int *level, int *optname);
JNIEXPORT int JNICALL
NET_MapSocketOptionV6(jint cmd, int *level, int *optname);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.