Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

rtSocket.h

Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 1997-2004 by Objective Systems, Inc. 00003 * 00004 * This software is furnished under a license and may be used and copied 00005 * only in accordance with the terms of such license and with the 00006 * inclusion of the above copyright notice. This software or any other 00007 * copies thereof may not be provided or otherwise made available to any 00008 * other person. No title to and ownership of the software is hereby 00009 * transferred. 00010 * 00011 * The information in this software is subject to change without notice 00012 * and should not be construed as a commitment by Objective Systems, Inc. 00013 * 00014 * PROPRIETARY NOTICE 00015 * 00016 * This software is an unpublished work subject to a confidentiality agreement 00017 * and is protected by copyright and trade secret law. Unauthorized copying, 00018 * redistribution or other use of this work is prohibited. 00019 * 00020 * The above notice of copyright on this source code product does not indicate 00021 * any actual or intended publication of such source code. 00022 * 00023 *****************************************************************************/ 00029 #ifndef _RTSOCKET_H_ 00030 #define _RTSOCKET_H_ 00031 00032 #ifdef _WIN32_WCE 00033 #include <winsock.h> 00034 #elif defined(_WIN32) || defined(_WIN64) 00035 #include <sys/types.h> 00036 #ifdef INCL_WINSOCK_API_TYPEDEFS 00037 #undef INCL_WINSOCK_API_TYPEDEFS 00038 #endif 00039 #ifdef INCL_WINSOCK_API_PROTOTYPES 00040 #undef INCL_WINSOCK_API_PROTOTYPES 00041 #endif 00042 #define INCL_WINSOCK_API_TYPEDEFS 1 00043 #define INCL_WINSOCK_API_PROTOTYPES 0 00044 #include <winsock2.h> 00045 #else 00046 #include <sys/types.h> 00047 #include <sys/socket.h> 00048 #include <netinet/in.h> 00049 #include <netdb.h> 00050 #include <unistd.h> 00051 #include <arpa/inet.h> 00052 #endif 00053 00054 #include "asn1type.h" 00055 00056 #ifdef __cplusplus 00057 extern "C" { 00058 #endif 00059 00060 #if defined (_WIN32) || defined (_WIN64) 00061 typedef SOCKET OSRTSOCKET; 00062 #else 00063 typedef int OSRTSOCKET; 00064 #endif 00065 00066 #define OSRTSOCKET_INVALID ((OSRTSOCKET)-1) 00067 00074 typedef unsigned long OSIPADDR; 00075 00076 #define OSIPADDR_ANY ((OSIPADDR)0) 00077 #define OSIPADDR_LOCAL ((OSIPADDR)0x7f000001UL) /* 127.0.0.1 */ 00078 #define OSIPADDR_INVALID ((OSIPADDR)0xffffffffUL) 00079 00104 EXTERNRT int rtSocketAccept (OSRTSOCKET socket, OSRTSOCKET *pNewSocket, 00105 OSIPADDR* destAddr, int* destPort); 00106 00117 EXTERNRT int rtSocketAddrToStr (OSIPADDR ipAddr, char* pbuf, int bufsize); 00118 00132 EXTERNRT int rtSocketBind (OSRTSOCKET socket, OSIPADDR addr, int port); 00133 00146 EXTERNRT int rtSocketBlockingRead 00147 (OSRTSOCKET socket, ASN1OCTET* pbuf, size_t readBytes); 00148 00157 EXTERNRT int rtSocketClose (OSRTSOCKET socket); 00158 00174 EXTERNRT int rtSocketConnect (OSRTSOCKET socket, const char* host, int port); 00175 00185 EXTERNRT int rtSocketCreate (OSRTSOCKET* psocket); 00186 00195 EXTERNRT int rtSocketCreateUDP (OSRTSOCKET* psocket); 00196 00204 EXTERNRT int rtSocketsInit (void); 00205 00213 EXTERNRT int rtSocketsCleanup (void); 00214 00230 EXTERNRT int rtSocketListen (OSRTSOCKET socket, int maxConnection); 00231 00244 EXTERNRT int rtSocketRecv (OSRTSOCKET socket, ASN1OCTET* pbuf, 00245 ASN1UINT bufsize); 00246 00265 EXTERNRT int rtSocketRecvFrom (OSRTSOCKET socket, ASN1OCTET* pbuf, 00266 ASN1UINT bufsize, char * remotehost, 00267 int * remoteport); 00268 00281 EXTERNRT int rtSocketSend 00282 (OSRTSOCKET socket, const ASN1OCTET* pdata, ASN1UINT size); 00283 00300 EXTERNRT int rtSocketSendTo(OSRTSOCKET socket, const ASN1OCTET* pdata, 00301 ASN1UINT size, const char* remotehost, 00302 int remoteport); 00303 00322 EXTERNRT int rtSocketSelect(int nfds, fd_set *readfds, fd_set *writefds, 00323 fd_set *exceptfds, struct timeval * timeout); 00324 00337 EXTERNRT int rtSocketStrToAddr (const char* pIPAddrStr, OSIPADDR* pIPAddr); 00338 00349 EXTERNRT int rtSocketGetLocalIPAddress(char * pIPAddrs, int bufSize); 00351 #ifdef __cplusplus 00352 } 00353 #endif 00354 00355 #endif /* _RTSOCKET_H_ */

Copyright © 1997-2004 Objective Systems,Inc.
All Rights Reserved.
This document may be distributed in any form, electronic
or otherwise, provided that it is distributed in its entirety
and that the copyright and this notice are included.

This file was last modified on 1 Oct 2004.
ASN1C C/C++ Common Runtime, ASN1C v5.7x