XBinder  Version 2.9.x
rtxNetUtil.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2022 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, OSRTNetHttps, 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  OSRTNetProtocol protocol;
51  int port;
52  OSBOOL bIsConnect;
53 } OSRTNETURL;
54 
55 typedef struct OSRTNETCONN {
56  OSCTXT* pctxt;
57  OSRTSOCKET socket;
58  OSRTNETURL url;
59  OSRTNETURL proxy;
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 
101 EXTERNRT int rtxNetConnect (OSRTNETCONN* pNetConn);
102 
113 EXTERNRT int rtxNetInitConn
114 (OSCTXT* pctxt, OSRTNETCONN* pNetConn, const char* url);
115 
125 EXTERNRT int rtxNetParseURL (OSRTNETCONN* pNetConn, const char* url);
126 
127 EXTERNRT int rtxNetParseURL2
128 (OSRTNETCONN* pNetConn, OSRTNETURL* pNetURL, const char* url);
129 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif /* _OS_NOSOCKET */
135 
136 #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:198
EXTERNRT int rtxNetInitConn(OSCTXT *pctxt, OSRTNETCONN *pNetConn, const char *url)
This function initializes a network connection structure.