XBinder  Version 2.7.x
rtxNetUtil.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2020 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
27 #ifndef _RTXNETUTIL_H_
28 #define _RTXNETUTIL_H_
29 
30 #ifndef _OS_NOSOCKET
31 
32 #include "rtxsrc/rtxContext.h"
33 #include "rtxsrc/rtxSocket.h"
34 
35 typedef enum {
36  OSRTNetNoProto, OSRTNetHttp, OSRTNetFtp, OSRTNetOtherP
37 } OSRTNetProtocol ;
38 
39 typedef enum {
40  OSRTNetNoTrans, OSRTNetTCP, OSRTNetUDP, OSRTNetOtherT
41 } OSRTNetTransport ;
42 
43 typedef struct OSRTNETURL {
44  char* buffer; /* mutable URL buffer */
45  const char* domain;
46  const char* path;
47  const char* username;
48  const char* password;
49  const char* authstring; /* Base 64 authentication string */
50  int port;
51  OSBOOL bIsConnect;
52 } OSRTNETURL;
53 
54 typedef struct OSRTNETCONN {
55  OSCTXT* pctxt;
56  OSRTSOCKET socket;
57  OSRTNETURL url;
58  OSRTNETURL proxy;
59  OSRTNetProtocol protocol;
60  OSRTNetTransport transport;
61  OSBOOL dynamic;
62 } OSRTNETCONN;
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
78 EXTERNRT OSRTNETCONN* rtxNetCreateConn (OSCTXT* pctxt, const char* url);
79 
87 EXTERNRT int rtxNetCloseConn (OSRTNETCONN* pNetConn);
88 
99 EXTERNRT int rtxNetConnect (OSRTNETCONN* pNetConn);
100 
111 EXTERNRT int rtxNetInitConn
112 (OSCTXT* pctxt, OSRTNETCONN* pNetConn, const char* url);
113 
123 EXTERNRT int rtxNetParseURL (OSRTNETCONN* pNetConn, const char* url);
124 
125 EXTERNRT int rtxNetParseURL2
126 (OSRTNETCONN* pNetConn, OSRTNETURL* pNetURL, const char* url);
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif /* _OS_NOSOCKET */
133 
134 #endif
EXTERNRT OSRTNETCONN * rtxNetCreateConn(OSCTXT *pctxt, const char *url)
This function creates a new network connection to the given URL.
EXTERNRT int rtxNetParseURL(OSRTNETCONN *pNetConn, const char *url)
This function parses a Universal Resource Locator (URL) into the components defined in the network co...
int OSRTSOCKET
Socket handle type definition.
Definition: rtxSocket.h:65
Common run-time context definitions.
EXTERNRT int rtxNetCloseConn(OSRTNETCONN *pNetConn)
This function closes a network connection.
EXTERNRT int rtxNetConnect(OSRTNETCONN *pNetConn)
This function creates a network connection.
Run-time context structure.
Definition: rtxContext.h:197
EXTERNRT int rtxNetInitConn(OSCTXT *pctxt, OSRTNETCONN *pNetConn, const char *url)
This function initializes a network connection structure.