FreeCalypso > hg > fc-magnetite
comparison src/g23m-fad/tcpip/rnet/rnet_rt/rnet_rt_i.h @ 174:90eb61ecd093
src/g23m-fad: initial import from TCS3.2/LoCosto
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 12 Oct 2016 05:40:46 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
173:bf64d785238a | 174:90eb61ecd093 |
---|---|
1 /** | |
2 * @file rnet_rt_i.h | |
3 * | |
4 * Internal definitions for RNET_RT. | |
5 * | |
6 * @author Jose Yp-Tcha (j-yp-tcha@ti.com) | |
7 * @version 0.1 | |
8 */ | |
9 | |
10 /* | |
11 * $Id: rnet_rt_i.h,v 1.6 2002/10/30 15:23:34 rf Exp $ | |
12 * $Name: ti_20021030 $ | |
13 * | |
14 * History: | |
15 * | |
16 * Date Author Modification | |
17 * ------------------------------------------------------------------- | |
18 * 3/19/2002 Jose Yp-Tcha (j-yp-tcha@ti.com) Create. | |
19 * 3/29/2002 Regis Feneon NexGenIP definitions | |
20 * 10/28/2002 Regis Feneon added RNET_RT_ETH_SUPPORT | |
21 * | |
22 * (C) Copyright 2002 by TI, All Rights Reserved | |
23 */ | |
24 | |
25 #include "rnet_cfg.h" | |
26 | |
27 #ifdef RNET_CFG_REAL_TRANSPORT | |
28 | |
29 #ifndef __RNET_RT_I_H_ | |
30 #define __RNET_RT_I_H_ | |
31 | |
32 #define NG_NO_BSDSOCK_DECLS | |
33 | |
34 #include "rv_general.h" | |
35 #include "rvf_api.h" | |
36 #include "rvm_gen.h" | |
37 #include "rvm_use_id_list.h" | |
38 #include "rvm_ext_priorities.h" | |
39 | |
40 #include "rnet_rt_cfg.h" | |
41 #include "rnet_rt_api.h" | |
42 #include "rnet_rt_message.h" | |
43 | |
44 /** NexGenOS/NexGenIP definitions */ | |
45 #include "ngos.h" | |
46 #include "ngip.h" | |
47 #include "ngudp.h" | |
48 #include "ngtcp.h" | |
49 #include "ngsockio.h" | |
50 #include "ngresolv.h" | |
51 | |
52 #ifdef _WINDOWS | |
53 #include "ngeth.h" | |
54 #endif | |
55 #ifdef RNET_RT_ATP_SUPPORT | |
56 #include "rnet_rt_atp_i.h" | |
57 #endif | |
58 #ifdef RNET_RT_DTI_SUPPORT | |
59 #include "rnet_rt_dti_i.h" | |
60 #endif | |
61 | |
62 /** size of debug output buffer */ | |
63 #define RNET_RT_NGIP_DEBUG_MAX 128 | |
64 | |
65 /** size of host info data buffer */ | |
66 #define RNET_RT_NGIP_GETHOSTINFO_BUFMAX 192 | |
67 | |
68 /* debug informations */ | |
69 /* #define RNET_RT_NGIP_DEBUG_ENABLE (is defined in the Makefile) */ | |
70 | |
71 /** RNET socket control block */ | |
72 typedef struct { | |
73 /** NexGenIP control block */ | |
74 NGsock sock; | |
75 /** return path */ | |
76 T_RV_RETURN_PATH return_path; | |
77 /** flags */ | |
78 int flags; | |
79 #define RNET_RT_SOCKF_NOTIFY_RECV 0x0001 | |
80 #define RNET_RT_SOCKF_NOTIFY_SEND 0x0002 | |
81 #define RNET_RT_SOCKF_NOTIFY_CONNECT 0x0004 | |
82 #define RNET_RT_SOCKF_NOTIFY_CLOSED 0x0008 | |
83 /** user (application) data */ | |
84 void *user_data; | |
85 } T_RNET_RT_SOCK; | |
86 | |
87 /** | |
88 * The Control Block buffer of RNET_RT, which gathers all 'Global variables' | |
89 * used by RNET_RT instance. | |
90 */ | |
91 typedef struct { | |
92 T_RVM_RETURN (*error_ft)( T_RVM_NAME swe_name, | |
93 T_RVM_RETURN error_cause, | |
94 T_RVM_ERROR_TYPE error_type, | |
95 T_RVM_STRING error_msg); | |
96 T_RVF_MB_ID mb_id; | |
97 /** SWE address */ | |
98 T_RVF_ADDR_ID addr_id; | |
99 /** global mutex for access to SWE */ | |
100 T_RVF_MUTEX mutex; | |
101 /** pointer to pool of network buffers */ | |
102 T_RVF_BUFFER *buf_net; | |
103 /** table of socket control blocks */ | |
104 T_RNET_RT_SOCK socktable[RNET_RT_SOCK_MAX]; | |
105 /** table of TCP control blocks */ | |
106 NGtcpcb tcbtable[RNET_RT_SOCK_MAX]; | |
107 /** resolver queries */ | |
108 NGslvpquer resolvquery[RNET_RT_RESOLV_QUERY_MAX]; | |
109 /** resolver cache entries */ | |
110 NGslvcaent resolvcache[RNET_RT_RESOLV_CACHE_MAX]; | |
111 #ifdef RNET_RT_LOOPBACK_SUPPORT | |
112 /** loopback interface */ | |
113 NGifnet ifnet_lo; | |
114 #endif | |
115 #ifdef RNET_RT_ETH_SUPPORT | |
116 /** ARP table */ | |
117 NGarpent arptable[RNET_RT_ARP_MAX]; | |
118 /** ethernet interface */ | |
119 NGethifnet ifnet_eth; | |
120 #endif | |
121 #ifdef RNET_RT_ATP_SUPPORT | |
122 /** ATP point-to-point interface */ | |
123 T_RNET_RT_ATP_IFNET ifnet_atp; | |
124 #endif | |
125 #ifdef RNET_RT_DTI_SUPPORT | |
126 /** DTI point-to-point interface */ | |
127 T_RNET_RT_DTI_IFNET ifnet_dti; | |
128 #endif | |
129 /** buffer for debug output */ | |
130 #ifdef RNET_RT_NGIP_DEBUG_ENABLE | |
131 char buf_debug[RNET_RT_NGIP_DEBUG_MAX]; | |
132 #endif | |
133 /** system clock emulation */ | |
134 unsigned long clock; | |
135 } T_RNET_RT_ENV_CTRL_BLK; | |
136 | |
137 /** External ref "global variables" structure. */ | |
138 extern T_RNET_RT_ENV_CTRL_BLK *rnet_rt_env_ctrl_blk_p; | |
139 | |
140 /** get_host_info data */ | |
141 typedef struct { | |
142 T_RV_RETURN_PATH return_path; | |
143 void *user_data; | |
144 NGubyte tmpbuf[RNET_RT_NGIP_GETHOSTINFO_BUFMAX]; | |
145 NGhostent hostent; | |
146 } T_RNET_RT_GETHOSTINFO; | |
147 | |
148 /** RNET interface driver message handling */ | |
149 #define NG_RNETIFO_HANDLE_MSG 0x0210 | |
150 | |
151 /** Macro used for tracing RNET messages. */ | |
152 #define RNET_RT_SEND_TRACE(string, trace_level) \ | |
153 rvf_send_trace (string, (sizeof(string) - 1), NULL_PARAM, trace_level, RNET_RT_USE_ID) | |
154 | |
155 /** | |
156 * Interface functions between NexGenIP and Riviera | |
157 */ | |
158 /*@{*/ | |
159 int rnet_rt_ngip_init( void *bufpool_ptr, int bufpool_size, int buf_hdr_size, | |
160 int buf_data_size, T_RNET_RT_SOCK *socktable, int sockmax, const NGcfgent *cfg); | |
161 void rnet_rt_ngip_input( NGbuf *bufp); | |
162 void rnet_rt_ngip_timer( void); | |
163 int rnet_rt_ngip_start( void); | |
164 void rnet_rt_ngip_stop( void); | |
165 T_RNET_RET rnet_rt_ngip_error( int err); | |
166 /*@}*/ | |
167 | |
168 #endif /* __RNET_RT_I_H_ */ | |
169 | |
170 #endif /* ifdef RNET_CFG_REAL_TRANSPORT */ | |
171 |