comparison g23m/condat/ms/src/aci/psa_tcpip.h @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : WAPoverGPRS
4 | Modul : PSA_TPCIP
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : TCP/IP-related definitions and declarations for the ACI
18 +-----------------------------------------------------------------------------
19 */
20
21 #ifndef PSA_TCPIP_H
22 #define PSA_TCPIP_H
23
24 #include "wap_aci.h"
25
26 /*==== CONSTANTS ==================================================*/
27
28 /* Option bitflag constants for the activation of TCP/IP components;
29 * this is meant to be sufficient even for times when there is no
30 * longer only IPv4 and UDP. These constants are meant to be ORed to
31 * the actual option value, which is then passed to
32 * psaTCPIP_Activate().
33 */
34 #define TCPIP_ACT_OPTION_V4 0x01 /* Activate IPv4. */
35 #define TCPIP_ACT_OPTION_V6 0x02 /* Activate IPv6. (Not yet implemented) */
36 #define TCPIP_ACT_OPTION_UDP 0x04 /* Activate UDP. */
37 #define TCPIP_ACT_OPTION_TCPIP 0x08 /* Activate TCPIP. */
38 #define TCPIP_ACT_OPTION_FU1 0x10 /* Reserved for future use. */
39 #define TCPIP_ACT_OPTION_FU2 0x20 /* Reserved for future use. */
40 #define TCPIP_ACT_OPTION_FU3 0x40 /* Reserved for future use. */
41 #define TCPIP_ACT_OPTION_FU4 0x80 /* Reserved for future use. */
42
43
44 #define TCPIP_CONNECTION_TYPE_UNKNOWN 0x00
45 #define TCPIP_CONNECTION_TYPE_GPRS_WAP 0x01
46 #define TCPIP_CONNECTION_TYPE_CSD_WAP 0x02
47 #define TCPIP_CONNECTION_TYPE_GPRS_SAT 0x04 /* SAT class c/e */
48 #define TCPIP_CONNECTION_TYPE_CSD_SAT 0x08 /* SAT class c/e */
49
50 #define TCPIP_CONNECTION_BUILDUP_UNKNOWN 0x00
51 #define TCPIP_CONNECTION_BUILDUP_UP 0x01
52 #define TCPIP_CONNECTION_BUILDUP_DOWN 0x02
53
54
55 /*==== TYPES ======================================================*/
56
57 /* Shared Parameters for TCP/IP-related stuff. There should be more in
58 * here, for instance the wap_state, but to make changes as small as
59 * possible at the moment, this is left as it is for now. The handling
60 * of TCP/IP activation state will have to be changed in the future
61 * anyway. [ni 2001-09-28]
62 */
63 typedef struct tcpipShrdPrm
64 {
65 S8 src_id ;
66 UBYTE connection_type; /* distinction of GPRS or CSD connection */
67 UBYTE connection_buildup; /* distinction of connection build up or
68 build down */
69 UBYTE options ; /* Any ORed combination of the
70 * IP_ACT_OPTION_* values above with
71 * obvious semantics. */
72 SHORT wap_call_id ; /* ID of WAP call (if any). */
73 UBYTE ipaddr[16] ; /* Up to 16 bytes if IP address. */
74 UBYTE peer_addr[16] ; /* Address of peer. */
75 UBYTE dns1[16]; /* Primary dns server address */
76 UBYTE dns2[16]; /* Second dns server address */
77 short mtu ; /* Size of maximum transfer unit. */
78 void (*callback_function)(T_ACI_RETURN result) ;
79 /* Function to call after the current
80 * operation is completed. */
81 } T_TCPIP_SHRD_PRM;
82
83 /*==== PROTOTYPES =================================================*/
84 EXTERN char* wap_state_to_string(T_ACI_WAP_STATES wap_state);
85
86 /* Initialize TCP/IP psa variables.
87 */
88 void psaTCPIP_Init(void) ;
89
90 /* Activate TCP/IP-related entities.
91 * Parameters:
92 * src_id
93 * dti_id DTI channel to use.
94 * options Any ORed combination of the IP_ACT_OPTION_* values
95 * above with obvious semantics.
96 * callback_function Function to call after activation is completed;
97 * result can be AT_FAIL or AT_CMPL. May be null.
98 */
99 void psaTCPIP_Activate(UBYTE src_id,
100 UBYTE dti_id,
101 SHORT wap_call_id,
102 UBYTE options,
103 UBYTE connection_type,
104 void (*callback_function)(T_ACI_RETURN result)) ;
105
106 /* Configure TCP/IP-related entities.
107 * Parameters:
108 * ip_address IP address to use when called for a circuit-switched
109 * data (i. e. PPP) connection. A pointer to an
110 * array of bytes containing the IP address in
111 * network order. The address is assumed as being
112 * 4 or 16 bytes long, depending on whether IPv6
113 * is used. The ``pdp_address'' value returned by
114 * SMREG_PDP_ACTIVATE_CNF can be used here
115 * directly. Must be null when called for IP over
116 * GPRS.
117 * pdp_addrp Pointer to PDP address to use when called for IP
118 * over GPRS. Must be null when called for IP
119 * over CSD/PPP.
120 * peer_address IP address of the peer, or a null pointer to indicate
121 * the peer address is unknown. Only valid with IP over PPP.
122 * mtu Size of the maximum transfer unit or zero if unknown.
123 * callback_function Function to call after configuration is completed;
124 * result can be AT_FAIL or AT_CMPL. May be null.
125 */
126 void psaTCPIP_Configure(UBYTE *ip_address,
127 void *pdp_addrp,
128 UBYTE *peer_address,
129 UBYTE *dns1,
130 UBYTE *dns2,
131 short mtu,
132 void (*callback_function)(T_ACI_RETURN result)) ;
133
134 /* Deactivate TCP/IP-related entities.
135 * Parameters:
136 * callback_function Function to call after deactivation is completed;
137 * result can be AT_FAIL or AT_CMPL. May be null.
138 */
139 void psaTCPIP_Deactivate(void (*callback_function)(T_ACI_RETURN result)) ;
140
141
142 /* UDP/IP activation/configuration/deactivation dipatcher function. */
143 void psaUDPIP_config_dispatch(void);
144
145 /* TCP/IP activation/configuration/deactivation dipatcher function.
146 */
147 void psaTCPIP_config_dispatch(void);
148
149
150 /* TCP/IP activation callback for circuit-switched data.
151 */
152 void psaTCPIP_act_csd_callback(T_ACI_RETURN result) ;
153
154
155 /* TCP/IP configuration callback for circuit-switched data.
156 */
157 void psaTCPIP_conf_csd_callback(T_ACI_RETURN result) ;
158
159
160 /* TCP/IP deactivation callback for circuit-switched data.
161 */
162 void psaTCPIP_deact_csd_callback(T_ACI_RETURN result) ;
163
164
165 ULONG psaTCPIP_bytes2ipv4addr(UBYTE *ip_address) ;
166
167 void psaTCPIP_get_own_ipaddr(UBYTE *ipaddr);
168
169 /*==== EXPORT =====================================================*/
170
171 #ifdef PSA_TCPIPF_C
172
173 GLOBAL T_TCPIP_SHRD_PRM tcpipShrdPrm;
174
175 #else
176
177 EXTERN T_TCPIP_SHRD_PRM tcpipShrdPrm;
178
179 #endif /* PSA_TCPIPF_C */
180
181 #endif /* PSA_TCPIP_H */
182
183 /*==== EOF =======================================================*/