Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 48844 invoked from network); 22 Nov 2008 15:22:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Nov 2008 15:22:11 -0000 Received: (qmail 13860 invoked by uid 500); 22 Nov 2008 15:22:17 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 13741 invoked by uid 500); 22 Nov 2008 15:22:17 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 13639 invoked by uid 99); 22 Nov 2008 15:22:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Nov 2008 07:22:16 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Nov 2008 15:20:59 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 73BF02388961; Sat, 22 Nov 2008 07:21:14 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r719860 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main: java/org/apache/harmony/luni/platform/ native/luni/shared/ native/luni/unix/ native/luni/windows/ Date: Sat, 22 Nov 2008 15:21:11 -0000 To: commits@harmony.apache.org From: tellison@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081122152114.73BF02388961@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tellison Date: Sat Nov 22 07:21:09 2008 New Revision: 719860 URL: http://svn.apache.org/viewvc?rev=719860&view=rev Log: More tidy-up in OSNetworkSystem. Method renaming and consolidation. Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/exports.txt harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java?rev=719860&r1=719859&r2=719860&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java Sat Nov 22 07:21:09 2008 @@ -56,17 +56,17 @@ public native void createSocket(FileDescriptor fd, boolean preferIPv4Stack) throws IOException; - public native void createDatagramSocket(FileDescriptor fd, boolean preferIPv4Stack) - throws SocketException; + public native void createDatagramSocket(FileDescriptor fd, + boolean preferIPv4Stack) throws SocketException; - public native int read(FileDescriptor fd, byte[] data, int offset, int count, - int timeout) throws IOException; + public native int read(FileDescriptor fd, byte[] data, int offset, + int count, int timeout) throws IOException; public native int readDirect(FileDescriptor fd, long address, int count, int timeout) throws IOException; - public native int write(FileDescriptor fd, byte[] data, int offset, int count) - throws IOException; + public native int write(FileDescriptor fd, byte[] data, int offset, + int count) throws IOException; public native int writeDirect(FileDescriptor fd, long address, int count) throws IOException; @@ -74,8 +74,8 @@ public native void setNonBlocking(FileDescriptor fd, boolean block) throws IOException; - public native void connectDatagram(FileDescriptor fd, int port, int trafficClass, - InetAddress inetAddress) throws SocketException; + public native void connectDatagram(FileDescriptor fd, int port, + int trafficClass, InetAddress inetAddress) throws SocketException; public native int connect(FileDescriptor fd, int trafficClass, InetAddress inetAddress, int port) throws IOException; @@ -91,51 +91,84 @@ inetAddress); } - public native void bind(FileDescriptor aFD, int port, InetAddress inetAddress) - throws SocketException; + public native void bind(FileDescriptor aFD, int port, + InetAddress inetAddress) throws SocketException; public boolean bind2(FileDescriptor aFD, int port, boolean bindToDevice, InetAddress inetAddress) throws SocketException { return socketBindImpl2(aFD, port, bindToDevice, inetAddress); } - public void accept(FileDescriptor fdServer, SocketImpl newSocket, - FileDescriptor fdnewSocket, int timeout) throws IOException { - acceptSocketImpl(fdServer, newSocket, fdnewSocket, timeout); - } + public native void accept(FileDescriptor fdServer, SocketImpl newSocket, + FileDescriptor fdnewSocket, int timeout) throws IOException; - public int sendDatagram(FileDescriptor fd, byte[] data, int offset, + /** + * Send the data to the nominated target address + * and port. These values are derived from the DatagramPacket + * to reduce the field calls within JNI. + * + * @param fd + * the socket FileDescriptor + * @param data + * the data buffer of the packet + * @param offset + * the offset in the data buffer + * @param length + * the length of the data buffer in the packet + * @param port + * the target host port + * @param bindToDevice + * if bind to device + * @param trafficClass + * the traffic class to be used when the datagram is sent + * @param inetAddress + * address to connect to. + * @return number of data send + * + * @exception IOException + * upon an read error or timeout + */ + public native int sendDatagram(FileDescriptor fd, byte[] data, int offset, int length, int port, boolean bindToDevice, int trafficClass, - InetAddress inetAddress) throws IOException { - return sendDatagramImpl(fd, data, offset, length, port, bindToDevice, - trafficClass, inetAddress); - } + InetAddress inetAddress) throws IOException; - public int sendDatagramDirect(FileDescriptor fd, long address, int offset, - int length, int port, boolean bindToDevice, int trafficClass, - InetAddress inetAddress) throws IOException { - return sendDatagramDirectImpl(fd, address, offset, length, port, - bindToDevice, trafficClass, inetAddress); - } + public native int sendDatagramDirect(FileDescriptor fd, long address, + int offset, int length, int port, boolean bindToDevice, + int trafficClass, InetAddress inetAddress) throws IOException; - public int sendDatagram2(FileDescriptor fd, byte[] data, int offset, - int length, int port, InetAddress inetAddress) throws IOException { - return sendDatagramImpl2(fd, data, offset, length, port, inetAddress); - } + public native int sendDatagram2(FileDescriptor fd, byte[] data, int offset, + int length, int port, InetAddress inetAddress) throws IOException; - public int receiveDatagram(FileDescriptor aFD, DatagramPacket packet, + /** + * Receive data on the socket into the specified buffer. The packet fields + * data & length are passed in addition to + * packet to eliminate the JNI field access calls. + * + * @param fd + * the socket FileDescriptor + * @param packet + * the DatagramPacket to receive into + * @param data + * the data buffer of the packet + * @param offset + * the offset in the data buffer + * @param length + * the length of the data buffer in the packet + * @param receiveTimeout + * the maximum length of time the socket should block, reading + * @param peek + * indicates to peek at the data + * @return number of data received + * @exception IOException + * upon an read error or timeout + */ + public native int receiveDatagram(FileDescriptor fd, DatagramPacket packet, byte[] data, int offset, int length, int receiveTimeout, - boolean peek) throws IOException { - return receiveDatagramImpl(aFD, packet, data, offset, length, - receiveTimeout, peek); - } + boolean peek) throws IOException; - public int receiveDatagramDirect(FileDescriptor aFD, DatagramPacket packet, + public native int receiveDatagramDirect(FileDescriptor fd, DatagramPacket packet, long address, int offset, int length, int receiveTimeout, - boolean peek) throws IOException { - return receiveDatagramDirectImpl(aFD, packet, address, offset, length, - receiveTimeout, peek); - } + boolean peek) throws IOException; public int recvConnectedDatagram(FileDescriptor aFD, DatagramPacket packet, byte[] data, int offset, int length, int receiveTimeout, @@ -151,10 +184,23 @@ length, receiveTimeout, peek); } - public int peekDatagram(FileDescriptor aFD, InetAddress sender, - int receiveTimeout) throws IOException { - return peekDatagramImpl(aFD, sender, receiveTimeout); - } + /** + * Peek on the socket, update sender address and answer the + * sender port. + * + * @param fd + * the socket FileDescriptor + * @param sender + * an InetAddress, to be updated with the sender's address + * @param receiveTimeout + * the maximum length of time the socket should block, reading + * @return the sender port + * + * @exception IOException + * upon an read error or timeout + */ + public native int peekDatagram(FileDescriptor fd, InetAddress sender, + int receiveTimeout) throws IOException; public int sendConnectedDatagram(FileDescriptor fd, byte[] data, int offset, int length, boolean bindToDevice) throws IOException { @@ -167,9 +213,16 @@ bindToDevice); } - public void disconnectDatagram(FileDescriptor aFD) throws SocketException { - disconnectDatagramImpl(aFD); - } + /** + * Disconnect the socket to a port and address + * + * @param fd + * the FileDescriptor associated with the socket + * + * @exception SocketException + * if the disconnect fails + */ + public native void disconnectDatagram(FileDescriptor fd) throws SocketException; public void createMulticastSocket(FileDescriptor aFD, boolean preferIPv4Stack) throws SocketException { @@ -199,15 +252,13 @@ shutdownOutputImpl(descriptor); } - public boolean supportsUrgentData(FileDescriptor fd) { - return supportsUrgentDataImpl(fd); - } + public native boolean supportsUrgentData(FileDescriptor fd); public void sendUrgentData(FileDescriptor fd, byte value) { sendUrgentDataImpl(fd, value); } - public native int available(FileDescriptor fd) throws SocketException; + public native int availableStream(FileDescriptor fd) throws SocketException; public void acceptStreamSocket(FileDescriptor fdServer, SocketImpl newSocket, FileDescriptor fdnewSocket, int timeout) @@ -244,14 +295,14 @@ * readFDs.length + writeFDs.length laid out as * the result of the select operation on the corresponding file descriptors. * - * @param readChannels - * all channels interested in read and accept - * @param writeChannels - * all channels interested in write and connect + * @param readFDs + * all sockets interested in read and accept + * @param writeFDs + * all sockets interested in write and connect * @param timeout - * timeout in millis - * @returns int array, each element describes the corresponding state of the - * descriptor in the read and write arrays. + * timeout in milliseconds + * @returns each element describes the corresponding state of the descriptor + * in the read and write arrays. * @throws SocketException */ public int[] select(FileDescriptor[] readFDs, FileDescriptor[] writeFDs, @@ -347,9 +398,7 @@ setSocketOptionImpl(aFD, opt, optVal); } - public int getSocketFlags() { - return getSocketFlagsImpl(); - } + public native int getSocketFlags(); /** * Close the socket in the IP stack. @@ -357,22 +406,14 @@ * @param aFD * the socket descriptor */ - public void socketClose(FileDescriptor aFD) throws IOException { - socketCloseImpl(aFD); - } + public native void socketClose(FileDescriptor aFD) throws IOException; - public InetAddress getHostByAddr(byte[] addr) throws UnknownHostException { - return getHostByAddrImpl(addr); - } + public native InetAddress getHostByAddr(byte[] addr) throws UnknownHostException; - public InetAddress getHostByName(String addr, boolean preferIPv6Addresses) - throws UnknownHostException { - return getHostByNameImpl(addr, preferIPv6Addresses); - } + public native InetAddress getHostByName(String addr, boolean preferIPv6Addresses) + throws UnknownHostException; - public void setInetAddress(InetAddress sender, byte[] address) { - setInetAddressImpl(sender, address); - } + public native void setInetAddress(InetAddress sender, byte[] address); static native void connectStreamWithTimeoutSocketImpl(FileDescriptor aFD, int aport, int timeout, int trafficClass, InetAddress inetAddress) @@ -381,12 +422,6 @@ static native void listenStreamSocketImpl(FileDescriptor aFD, int backlog) throws SocketException; - static native void acceptSocketImpl(FileDescriptor fdServer, - SocketImpl newSocket, FileDescriptor fdnewSocket, int timeout) - throws IOException; - - static native boolean supportsUrgentDataImpl(FileDescriptor fd); - static native void sendUrgentDataImpl(FileDescriptor fd, byte value); /** @@ -395,8 +430,8 @@ * @param aFD * the FileDescriptor to associate with the socket @param port * the port to connect to - * @param trafficClass the traffic Class - * to be used then the connection is made + * @param trafficClass + * the traffic Class to be used then the connection is made * @param inetAddress * address to connect to. * @@ -407,18 +442,6 @@ int trafficClass, InetAddress inetAddress) throws SocketException; /** - * Disconnect the socket to a port and address - * - * @param aFD - * the FileDescriptor to associate with the socket - * - * @exception SocketException - * if the disconnect fails - */ - static native void disconnectDatagramImpl(FileDescriptor aFD) - throws SocketException; - - /** * Allocate a datagram socket in the IP stack. The socket is associated with * the aFD. * @@ -444,44 +467,6 @@ throws SocketException; /** - * Peek on the socket, update sender address and answer the - * sender port. - * - * @param aFD - * the socket FileDescriptor @param sender an InetAddress, to be - * updated with the sender's address @param receiveTimeout the - * maximum length of time the socket should block, reading @return - * int the sender port - * - * @exception IOException - * upon an read error or timeout - */ - static native int peekDatagramImpl(FileDescriptor aFD, InetAddress sender, - int receiveTimeout) throws IOException; - - /** - * Recieve data on the socket into the specified buffer. The packet fields - * data & length are passed in addition to - * packet to eliminate the JNI field access calls. - * - * @param aFD - * the socket FileDescriptor @param packet the DatagramPacket to - * receive into @param data the data buffer of the packet @param - * offset the offset in the data buffer @param length the length - * of the data buffer in the packet @param receiveTimeout the - * maximum length of time the socket should block, reading @param - * peek indicates to peek at the data @return number of data - * received @exception IOException upon an read error or timeout - */ - static native int receiveDatagramImpl(FileDescriptor aFD, - DatagramPacket packet, byte[] data, int offset, int length, - int receiveTimeout, boolean peek) throws IOException; - - static native int receiveDatagramDirectImpl(FileDescriptor aFD, - DatagramPacket packet, long address, int offset, int length, - int receiveTimeout, boolean peek) throws IOException; - - /** * Recieve data on the connected socket into the specified buffer. The * packet fields data & length are passed in * addition to packet to eliminate the JNI field access calls. @@ -504,32 +489,6 @@ int receiveTimeout, boolean peek) throws IOException; /** - * Send the data to the nominated target address - * and port. These values are derived from the DatagramPacket - * to reduce the field calls within JNI. - * - * @param fd - * the socket FileDescriptor @param data the data buffer of the - * packet @param offset the offset in the data buffer @param - * length the length of the data buffer in the packet @param port - * the target host port - * @param bindToDevice - * if bind to device @param trafficClass the traffic class to be - * used when the datagram is sent @param inetAddress address to - * connect to. @return number of data send - * - * @exception IOException - * upon an read error or timeout - */ - static native int sendDatagramImpl(FileDescriptor fd, byte[] data, - int offset, int length, int port, boolean bindToDevice, - int trafficClass, InetAddress inetAddress) throws IOException; - - static native int sendDatagramDirectImpl(FileDescriptor fd, long address, - int offset, int length, int port, boolean bindToDevice, - int trafficClass, InetAddress inetAddress) throws IOException; - - /** * Send the data to the address and port to which the was * connnected and port. * @@ -621,10 +580,6 @@ static native void createStreamSocketImpl(FileDescriptor aFD, boolean preferIPv4Stack) throws SocketException; - static native int sendDatagramImpl2(FileDescriptor fd, byte[] data, - int offset, int length, int port, InetAddress inetAddress) - throws IOException; - static native int selectImpl(FileDescriptor[] readfd, FileDescriptor[] writefd, int cread, int cwirte, int[] flags, long timeout); @@ -669,32 +624,10 @@ static native void setSocketOptionImpl(FileDescriptor aFD, int opt, Object optVal) throws SocketException; - static native int getSocketFlagsImpl(); - - /** - * Close the socket in the IP stack. - * - * @param aFD - * the socket descriptor - */ - static native void socketCloseImpl(FileDescriptor aFD); - - static native InetAddress getHostByAddrImpl(byte[] addr) - throws UnknownHostException; - - static native InetAddress getHostByNameImpl(String addr, - boolean preferIPv6Addresses) throws UnknownHostException; - - native void setInetAddressImpl(InetAddress sender, byte[] address); - native int isReachableByICMPImpl(InetAddress addr, InetAddress local, int ttl, int timeout); - native Channel inheritedChannelImpl(); - - public Channel inheritedChannel() { - return inheritedChannelImpl(); - } + public native Channel inheritedChannel(); public void oneTimeInitialization(boolean jcl_supports_ipv6) { if (!isNetworkInited) { Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c?rev=719860&r1=719859&r2=719860&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c Sat Nov 22 07:21:09 2008 @@ -737,12 +737,12 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: acceptSocketImpl + * Method: accept * Signature: (Ljava/io/FileDescriptor;Ljava/net/SocketImpl;Ljava/io/FileDescriptor;I)V */ JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_acceptSocketImpl - (JNIEnv * env, jclass thisClz, jobject fileDescriptorServer, + (JNIEnv * env, jobject thiz, jobject fileDescriptorServer, jobject socketImpl, jobject fileDescriptorSocketImpl, jint timeout) { PORT_ACCESS_FROM_ENV(env); @@ -779,12 +779,12 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: supportsUrgentDataImpl + * Method: supportsUrgentData * Signature: (Ljava/io/FileDescriptor;)Z */ JNIEXPORT jboolean JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_supportsUrgentDataImpl - (JNIEnv * env, jclass thisClz, jobject fileDescriptor) +Java_org_apache_harmony_luni_platform_OSNetworkSystem_supportsUrgentData + (JNIEnv * env, jobject thiz, jobject fileDescriptor) { PORT_ACCESS_FROM_ENV(env); hysocket_t socketP; @@ -879,12 +879,12 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: disconnectDatagramImpl + * Method: disconnectDatagram * Signature: (Ljava/io/FileDescriptor;)V */ JNIEXPORT void JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_disconnectDatagramImpl - (JNIEnv * env, jclass thisClz, jobject fileDescriptor) +Java_org_apache_harmony_luni_platform_OSNetworkSystem_disconnectDatagram + (JNIEnv * env, jobject thiz, jobject fileDescriptor) { PORT_ACCESS_FROM_ENV(env); jbyte nAddrBytes[HYSOCK_INADDR6_LEN]; @@ -899,8 +899,9 @@ return; } - /* the address itself should not matter as the protocol family is AF_UNSPEC. This tells connect to - disconnect the Datagram */ + /* the address itself should not matter as the protocol family is AF_UNSPEC. + * This tells connect to disconnect the Datagram + */ memset(nAddrBytes, 0, HYSOCK_INADDR6_LEN); hysock_sockaddr_init6(&sockaddrP, (U_8 *) nAddrBytes, HYSOCK_INADDR_LEN, HYADDR_FAMILY_UNSPEC, nPort, 0, 0, socketP); @@ -908,7 +909,9 @@ /* there is the possiblity of an exception here */ result = hysock_connect(socketP, &sockaddrP); - /* will likely need to eat the correct exception here. Leave as is until we figure out what that exception will be */ + /* will likely need to eat the correct exception here. Leave as is until we + * figure out what that exception will be + */ if (0 != result) { throwJavaNetSocketException(env, result); return; @@ -970,12 +973,12 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: peekDatagramImpl + * Method: peekDatagram * Signature: (Ljava/io/FileDescriptor;Ljava/net/InetAddress;I)I */ JNIEXPORT jint JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_peekDatagramImpl - (JNIEnv * env, jclass thisClz, jobject fileDescriptor, +Java_org_apache_harmony_luni_platform_OSNetworkSystem_peekDatagram + (JNIEnv * env, jobject thiz, jobject fileDescriptor, jobject senderAddress, jint timeout) { PORT_ACCESS_FROM_ENV(env); @@ -1010,8 +1013,9 @@ } result = hysock_readfrom(hysocketP, (U_8 *) msg, msgLen, flags, &sockaddrP); -/* Note, the msgsize error is acceptable as the read buffer was set to a nominal length. - Updating sockaddrP is the purpose of this call. */ + /* Note, the msgsize error is acceptable as the read buffer was set to a nominal length. + * Updating sockaddrP is the purpose of this call. + */ if (result < 0 && result != HYPORT_ERROR_SOCKET_MSGSIZE) { throwJavaNetSocketException(env, result); return (jint) 0; @@ -1024,12 +1028,12 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: receiveDatagramImpl + * Method: receiveDatagram * Signature: (Ljava/io/FileDescriptor;Ljava/net/DatagramPacket;[BIIIZ)I */ JNIEXPORT jint JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagramImpl - (JNIEnv * env, jclass thisClz, jobject fileDescriptor, +Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagram + (JNIEnv * env, jobject thiz, jobject fileDescriptor, jobject datagramPacket, jbyteArray data, jint offset, jint msgLength, jint timeout, jboolean peek) { @@ -1046,8 +1050,8 @@ } result = - Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagramDirectImpl - (env, thisClz, fileDescriptor, datagramPacket, (jlong)(IDATA)message, offset, + Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagramDirect + (env, thiz, fileDescriptor, datagramPacket, (jlong)(IDATA)message, offset, localCount, timeout, peek); if (result > 0) { @@ -1059,12 +1063,12 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: receiveDatagramDirectImpl + * Method: receiveDatagramDirect * Signature: (Ljava/io/FileDescriptor;Ljava/net/DatagramPacket;JIIIZ)I */ JNIEXPORT jint JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagramDirectImpl - (JNIEnv * env, jclass thisClz, jobject fileDescriptor, +Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagramDirect + (JNIEnv * env, jobject thiz, jobject fileDescriptor, jobject datagramPacket, jlong address, jint offset, jint msgLength, jint timeout, jboolean peek) { @@ -1222,12 +1226,12 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: sendDatagramImpl + * Method: sendDatagram * Signature: (Ljava/io/FileDescriptor;[BIIIZILjava/net/InetAddress;)I */ JNIEXPORT jint JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagramImpl - (JNIEnv * env, jclass thisClz, jobject fileDescriptor, jbyteArray data, +Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagram + (JNIEnv * env, jobject thiz, jobject fileDescriptor, jbyteArray data, jint offset, jint msgLength, jint targetPort, jboolean bindToDevice, jint trafficClass, jobject inetAddress) { @@ -1242,21 +1246,22 @@ } (*env)->GetByteArrayRegion(env, data, offset, msgLength, message); result = - Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagramDirectImpl - (env, thisClz, fileDescriptor, (jlong) (IDATA)message, offset, msgLength, + Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagramDirect + (env, thiz, fileDescriptor, (jlong) (IDATA)message, offset, msgLength, targetPort, bindToDevice, trafficClass, inetAddress); + hymem_free_memory(message); return result; } /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: sendDatagramDirectImpl + * Method: sendDatagramDirect * Signature: (Ljava/io/FileDescriptor;JIIIZILjava/net/InetAddress;)I */ JNIEXPORT jint JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagramDirectImpl - (JNIEnv * env, jclass thisClz, jobject fileDescriptor, jlong address, +Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagramDirect + (JNIEnv * env, jobject thiz, jobject fileDescriptor, jlong address, jint offset, jint msgLength, jint targetPort, jboolean bindToDevice, jint trafficClass, jobject inetAddress) { @@ -1586,9 +1591,10 @@ } } + JNIEXPORT jint JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagramImpl2 - (JNIEnv * env, jclass thisClz, jobject fileDescriptor, jbyteArray data, +Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagram2 + (JNIEnv * env, jclass thiz, jobject fileDescriptor, jbyteArray data, jint offset, jint msgLength, jint targetPort, jobject inetAddress) { PORT_ACCESS_FROM_ENV(env); @@ -2107,8 +2113,8 @@ * Signature: ()I */ JNIEXPORT jint JNICALL - Java_org_apache_harmony_luni_platform_OSNetworkSystem_getSocketFlagsImpl - (JNIEnv * env, jclass thisClz) + Java_org_apache_harmony_luni_platform_OSNetworkSystem_getSocketFlags + (JNIEnv * env, jobject thiz) { /* Return the flags indicating the socket state to save in the class library. */ /* 1 - Multicast interface */ @@ -2121,12 +2127,12 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: socketCloseImpl + * Method: socketClose * Signature: (Ljava/io/FileDescriptor;)V */ JNIEXPORT void JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_socketCloseImpl - (JNIEnv * env, jclass thisClz, jobject fileDescriptor) +Java_org_apache_harmony_luni_platform_OSNetworkSystem_socketClose + (JNIEnv * env, jobject thiz, jobject fileDescriptor) { PORT_ACCESS_FROM_ENV(env); hysocket_t socketP; @@ -2142,8 +2148,8 @@ } JNIEXPORT jobject JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByAddrImpl - (JNIEnv * env, jclass clazz, jbyteArray addr) +Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByAddr + (JNIEnv * env, jobject thiz, jbyteArray addr) { PORT_ACCESS_FROM_ENV(env); I_32 result = 0; @@ -2176,8 +2182,8 @@ } JNIEXPORT jobject JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByNameImpl - (JNIEnv * env, jclass clazz, jstring aName, jboolean preferIPv6Addresses) +Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByName + (JNIEnv * env, jobject thiz, jstring aName, jboolean preferIPv6Addresses) { PORT_ACCESS_FROM_ENV(env); I_32 result; @@ -2247,12 +2253,12 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: setInetAddressImpl + * Method: setInetAddress * Signature: (Ljava/net/InetAddress;[B)V */ JNIEXPORT void JNICALL - Java_org_apache_harmony_luni_platform_OSNetworkSystem_setInetAddressImpl - (JNIEnv * env, jobject thisClz, jobject sender, jbyteArray address) +Java_org_apache_harmony_luni_platform_OSNetworkSystem_setInetAddress + (JNIEnv * env, jobject thiz, jobject sender, jbyteArray address) { I_8 *passAddr = NULL; jbyteArray addr_array = Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h?rev=719860&r1=719859&r2=719860&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.h Sat Nov 22 07:21:09 2008 @@ -175,27 +175,27 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: available + * Method: availableStream * Signature: (Ljava/io/FileDescriptor;)I */ -JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_available +JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_availableStream (JNIEnv *, jobject, jobject); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: acceptSocketImpl + * Method: accept * Signature: (Ljava/io/FileDescriptor;Ljava/net/SocketImpl;Ljava/io/FileDescriptor;I)V */ -JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_acceptSocketImpl - (JNIEnv *, jclass, jobject, jobject, jobject, jint); +JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_accept + (JNIEnv *, jobject, jobject, jobject, jobject, jint); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: supportsUrgentDataImpl + * Method: supportsUrgentData * Signature: (Ljava/io/FileDescriptor;)Z */ -JNIEXPORT jboolean JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_supportsUrgentDataImpl - (JNIEnv *, jclass, jobject); +JNIEXPORT jboolean JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_supportsUrgentData + (JNIEnv *, jobject, jobject); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem @@ -215,11 +215,11 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: disconnectDatagramImpl + * Method: disconnectDatagram * Signature: (Ljava/io/FileDescriptor;)V */ -JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_disconnectDatagramImpl - (JNIEnv *, jclass, jobject); +JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_disconnectDatagram + (JNIEnv *, jobject, jobject); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem @@ -231,27 +231,27 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: peekDatagramImpl + * Method: peekDatagram * Signature: (Ljava/io/FileDescriptor;Ljava/net/InetAddress;I)I */ -JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_peekDatagramImpl - (JNIEnv *, jclass, jobject, jobject, jint); +JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_peekDatagram + (JNIEnv *, jobject, jobject, jobject, jint); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: receiveDatagramImpl + * Method: receiveDatagram * Signature: (Ljava/io/FileDescriptor;Ljava/net/DatagramPacket;[BIIIZ)I */ -JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagramImpl - (JNIEnv *, jclass, jobject, jobject, jbyteArray, jint, jint, jint, jboolean); +JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagram + (JNIEnv *, jobject, jobject, jobject, jbyteArray, jint, jint, jint, jboolean); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: receiveDatagramDirectImpl + * Method: receiveDatagramDirect * Signature: (Ljava/io/FileDescriptor;Ljava/net/DatagramPacket;JIIIZ)I */ -JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagramDirectImpl - (JNIEnv *, jclass, jobject, jobject, jlong, jint, jint, jint, jboolean); +JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagramDirect + (JNIEnv *, jobject, jobject, jobject, jlong, jint, jint, jint, jboolean); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem @@ -272,19 +272,19 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: sendDatagramImpl + * Method: sendDatagram * Signature: (Ljava/io/FileDescriptor;[BIIIZILjava/net/InetAddress;)I */ -JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagramImpl - (JNIEnv *, jclass, jobject, jbyteArray, jint, jint, jint, jboolean, jint, jobject); +JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagram + (JNIEnv *, jobject, jobject, jbyteArray, jint, jint, jint, jboolean, jint, jobject); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: sendDatagramDirectImpl + * Method: sendDatagramDirect * Signature: (Ljava/io/FileDescriptor;JIIIZILjava/net/InetAddress;)I */ -JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagramDirectImpl - (JNIEnv *, jclass, jobject, jlong, jint, jint, jint, jboolean, jint, jobject); +JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagramDirect + (JNIEnv *, jobject, jobject, jlong, jint, jint, jint, jboolean, jint, jobject); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem @@ -368,11 +368,11 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: sendDatagramImpl2 + * Method: sendDatagram2 * Signature: (Ljava/io/FileDescriptor;[BIIILjava/net/InetAddress;)I */ -JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagramImpl2 - (JNIEnv *, jclass, jobject, jbyteArray, jint, jint, jint, jobject); +JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendDatagram2 + (JNIEnv *, jobject, jobject, jbyteArray, jint, jint, jint, jobject); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem @@ -419,27 +419,27 @@ * Method: getSocketFlags * Signature: ()I */ -JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_getSocketFlagsImpl +JNIEXPORT jint JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_getSocketFlags (JNIEnv *, jclass); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: socketCloseImpl + * Method: socketClose * Signature: (Ljava/io/FileDescriptor;)V */ -JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_socketCloseImpl - (JNIEnv *, jclass, jobject); +JNIEXPORT void JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_socketClose + (JNIEnv *, jobject, jobject); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: getHostByAddrImpl + * Method: getHostByAddr * Signature: ([B)Ljava/net/InetAddress; */ -JNIEXPORT jobject JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByAddrImpl - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jobject JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByAddr + (JNIEnv *, jobject, jbyteArray); -JNIEXPORT jobject JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByNameImpl - (JNIEnv *, jclass,jstring,jboolean); +JNIEXPORT jobject JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByName + (JNIEnv *, jobject, jstring,jboolean); /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem @@ -451,12 +451,20 @@ /* * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: inheritedChannelImpl + * Method: inheritedChannel * Signature: ([BII)I */ -JNIEXPORT jobject JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_inheritedChannelImpl +JNIEXPORT jobject JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_inheritedChannel (JNIEnv *, jobject); +/* + * Class: org_apache_harmony_luni_platform_OSNetworkSystem + * Method: setInetAddress + * Signature: (Ljava/net/InetAddress;[B)V + */ +JNIEXPORT void JNICALL +Java_org_apache_harmony_luni_platform_OSNetworkSystem_setInetAddress +(JNIEnv *, jobject, jobject, jbyteArray); #ifdef __cplusplus } Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c?rev=719860&r1=719859&r2=719860&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c Sat Nov 22 07:21:09 2008 @@ -313,8 +313,9 @@ return result; }; -JNIEXPORT jobject JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_inheritedChannelImpl - (JNIEnv * env , jobject clz){ +JNIEXPORT jobject JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_inheritedChannel + (JNIEnv * env , jobject thiz) +{ PORT_ACCESS_FROM_ENV (env); int socket = 0; int opt; @@ -483,11 +484,11 @@ * which is similar to, but different to the call on other platforms. * * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: available + * Method: availableStream * Signature: (Ljava/io/FileDescriptor;)I */ JNIEXPORT jint JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_available +Java_org_apache_harmony_luni_platform_OSNetworkSystem_availableStream (JNIEnv * env, jobject thiz, jobject fileDescriptor) { PORT_ACCESS_FROM_ENV(env); Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/exports.txt URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/exports.txt?rev=719860&r1=719859&r2=719860&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/exports.txt (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/exports.txt Sat Nov 22 07:21:09 2008 @@ -197,14 +197,14 @@ Java_org_apache_harmony_luni_platform_OSNetworkSystem_connectStreamWithTimeoutSocketImpl Java_org_apache_harmony_luni_platform_OSNetworkSystem_bind Java_org_apache_harmony_luni_platform_OSNetworkSystem_listenStreamSocketImpl -Java_org_apache_harmony_luni_platform_OSNetworkSystem_available -Java_org_apache_harmony_luni_platform_OSNetworkSystem_acceptSocketImpl -Java_org_apache_harmony_luni_platform_OSNetworkSystem_supportsUrgentDataImpl +Java_org_apache_harmony_luni_platform_OSNetworkSystem_availableStream +Java_org_apache_harmony_luni_platform_OSNetworkSystem_accept +Java_org_apache_harmony_luni_platform_OSNetworkSystem_supportsUrgentData Java_org_apache_harmony_luni_platform_OSNetworkSystem_sendUrgentDataImpl Java_org_apache_harmony_luni_platform_OSNetworkSystem_connectDatagram -Java_org_apache_harmony_luni_platform_OSNetworkSystem_disconnectDatagramImpl +Java_org_apache_harmony_luni_platform_OSNetworkSystem_disconnectDatagram Java_org_apache_harmony_luni_platform_OSNetworkSystem_socketBindImpl2 -Java_org_apache_harmony_luni_platform_OSNetworkSystem_peekDatagramImpl +Java_org_apache_harmony_luni_platform_OSNetworkSystem_peekDatagram Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagramImpl Java_org_apache_harmony_luni_platform_OSNetworkSystem_receiveDatagramDirectImpl Java_org_apache_harmony_luni_platform_OSNetworkSystem_recvConnectedDatagramImpl @@ -227,13 +227,13 @@ Java_org_apache_harmony_luni_platform_OSNetworkSystem_getSocketLocalPortImpl Java_org_apache_harmony_luni_platform_OSNetworkSystem_getSocketOptionImpl Java_org_apache_harmony_luni_platform_OSNetworkSystem_setSocketOptionImpl -Java_org_apache_harmony_luni_platform_OSNetworkSystem_getSocketFlagsImpl -Java_org_apache_harmony_luni_platform_OSNetworkSystem_socketCloseImpl -Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByAddrImpl -Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByNameImpl -Java_org_apache_harmony_luni_platform_OSNetworkSystem_setInetAddressImpl +Java_org_apache_harmony_luni_platform_OSNetworkSystem_getSocketFlags +Java_org_apache_harmony_luni_platform_OSNetworkSystem_socketClose +Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByAddr +Java_org_apache_harmony_luni_platform_OSNetworkSystem_getHostByName +Java_org_apache_harmony_luni_platform_OSNetworkSystem_setInetAddress Java_org_apache_harmony_luni_platform_OSNetworkSystem_isReachableByICMPImpl -Java_org_apache_harmony_luni_platform_OSNetworkSystem_inheritedChannelImpl +Java_org_apache_harmony_luni_platform_OSNetworkSystem_inheritedChannel Java_org_apache_harmony_luni_platform_OSNetworkSystem_oneTimeInitializationImpl Java_org_apache_harmony_luni_platform_OSResourcesMonitor_isSystemPhysicalMemoryLow Java_org_apache_harmony_luni_platform_Environment_getEnvBytes Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c?rev=719860&r1=719859&r2=719860&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c (original) +++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/windows/OSNetworkSystemWin32.c Sat Nov 22 07:21:09 2008 @@ -328,10 +328,10 @@ icmp_hdr->checksum = ip_checksum((unsigned short *)icmp_hdr, packet_size); } -JNIEXPORT jobject JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_inheritedChannelImpl - (JNIEnv * env , jobject clz) +JNIEXPORT jobject JNICALL Java_org_apache_harmony_luni_platform_OSNetworkSystem_inheritedChannel + (JNIEnv * env , jobject thiz) { - //inheritedChannel is not supported on windows platform. + // inheritedChannel is not supported on windows platform. return NULL; } @@ -340,11 +340,11 @@ * which is similar to, but different to the call on other platforms. * * Class: org_apache_harmony_luni_platform_OSNetworkSystem - * Method: available + * Method: availableStream * Signature: (Ljava/io/FileDescriptor;)I */ JNIEXPORT jint JNICALL -Java_org_apache_harmony_luni_platform_OSNetworkSystem_available +Java_org_apache_harmony_luni_platform_OSNetworkSystem_availableStream (JNIEnv * env, jobject thiz, jobject fileDescriptor) { PORT_ACCESS_FROM_ENV(env);