comparison g23m/condat/ms/src/aci/psa_gppps.c @ 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 :
4 | Modul :
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 : This module defines the signalling functions of the
18 | protocol stack adapter for GPRS Point-to-Point Protocol ( PPP ).
19 +-----------------------------------------------------------------------------
20 */
21
22 #if defined (GPRS) && defined (DTI)
23
24 #ifndef PSA_GPPPS_C
25 #define PSA_GPPPS_C
26 #endif
27
28 #include "aci_all.h"
29 /*==== INCLUDES ===================================================*/
30 #include "dti.h" /* functionality of the dti library */
31 #include "aci_cmh.h"
32 #include "ati_cmd.h"
33 #include "aci_cmd.h"
34 #include "aci.h"
35 #include "psa.h"
36
37 #include "dti_conn_mng.h"
38 #include "dti_cntrl_mng.h"
39
40 #include "psa_gppp.h"
41
42 /*==== CONSTANTS ==================================================*/
43
44 #define TOK_STR " =\t" /* string of token delimiter */
45
46 /*==== TYPES ======================================================*/
47
48
49 /*==== EXPORT =====================================================*/
50
51
52 /*==== VARIABLES ==================================================*/
53
54 /*==== FUNCTIONS ==================================================*/
55
56 /*
57 +-------------------------------------------------------------------+
58 | PROJECT : GPRS (8441) MODULE : PSA_PPPS |
59 | STATE : finished ROUTINE : psaGPPP_Establish |
60 +-------------------------------------------------------------------+
61
62 PURPOSE : request establishment of PPP connection
63
64 */
65 GLOBAL void psaGPPP_Establish ( T_PPP_ESTABLISH_REQ *est_req )
66 {
67
68 TRACE_FUNCTION ("psaGPPP_Establish()");
69
70 /*
71 *-------------------------------------------------------------------
72 * create and send primitive for establich PPP
73 *-------------------------------------------------------------------
74 */
75 {
76 PALLOC (ppp_establish_req, PPP_ESTABLISH_REQ);
77
78 *ppp_establish_req = *est_req;
79
80 PSEND (hCommPPP, ppp_establish_req);
81 }
82 }
83
84 /*
85 +-------------------------------------------------------------------+
86 | PROJECT : GPRS (8441) MODULE : PSA_PPPS |
87 | STATE : finished ROUTINE : psaGPPP_Terminate |
88 +-------------------------------------------------------------------+
89
90 PURPOSE : close the PPP connection
91
92 */
93 GLOBAL void psaGPPP_Terminate ( UBYTE lower_layer )
94 {
95
96 TRACE_FUNCTION ("psaGPPP_Terminate()");
97
98 /*
99 *-------------------------------------------------------------------
100 * create and send primitive for network attach
101 *-------------------------------------------------------------------
102 */
103 {
104 PALLOC (ppp_terminate_req, PPP_TERMINATE_REQ);
105
106 /* fill in primitive parameter: registration mode */
107 ppp_terminate_req -> lower_layer = lower_layer;
108
109 PSEND (hCommPPP, ppp_terminate_req);
110 }
111 }
112
113 /*
114 +-------------------------------------------------------------------+
115 | PROJECT : GPRS (8441) MODULE : PSA_PPPS |
116 | STATE : finished ROUTINE : psaGPPP_PDP_Activate |
117 +-------------------------------------------------------------------+
118
119 PURPOSE : the PDP context is activated (only in server mode)
120
121 */
122 GLOBAL void psaGPPP_PDP_Activate ( UBYTE ppp_hc, UBYTE msid, UBYTE ip[4], UBYTE *pco_buf, UBYTE pco_length )
123 {
124
125 TRACE_FUNCTION ("psaGPPP_PDP_Activate()");
126
127 /*
128 *-------------------------------------------------------------------
129 * create and send primitive for network attach
130 *-------------------------------------------------------------------
131 */
132
133 {
134 PALLOC_SDU (ppp_pdp_activate_res, PPP_PDP_ACTIVATE_RES, (USHORT)(pco_length << 3));
135
136 ppp_pdp_activate_res->ppp_hc = ppp_hc;
137 ppp_pdp_activate_res->msid = msid;
138
139 ppp_pdp_activate_res->ip = ip[0];
140 ppp_pdp_activate_res->ip <<= 8;
141 ppp_pdp_activate_res->ip += ip[1];
142 ppp_pdp_activate_res->ip <<= 8;
143 ppp_pdp_activate_res->ip += ip[2];
144 ppp_pdp_activate_res->ip <<= 8;
145 ppp_pdp_activate_res->ip += ip[3];
146
147 ppp_pdp_activate_res->sdu.l_buf = pco_length << 3;
148 ppp_pdp_activate_res->sdu.o_buf = 0;
149 if ( pco_length )
150 {
151 memcpy(&ppp_pdp_activate_res->sdu.buf, pco_buf, pco_length);
152 }
153
154 PSEND (hCommPPP, ppp_pdp_activate_res);
155 }
156 }
157
158 /*
159 +-------------------------------------------------------------------+
160 | PROJECT : GPRS (8441) MODULE : PSA_PPPS |
161 | STATE : finished ROUTINE : psaGPPP_PDP_Reject |
162 +-------------------------------------------------------------------+
163
164 PURPOSE : the PDP context can't activated (only in server mode)
165
166 */
167 GLOBAL SHORT psaGPPP_PDP_Reject ( void )
168 {
169
170 TRACE_FUNCTION ("psaGPPP_PDP_Reject()");
171
172
173 /*
174 *-------------------------------------------------------------------
175 * check owner id
176 *-------------------------------------------------------------------
177 */
178 if(!psa_IsVldOwnId(gpppShrdPrm.owner))
179
180 return( -1 );
181
182 /*
183 *-------------------------------------------------------------------
184 * create and send primitive for network attach
185 *-------------------------------------------------------------------
186 */
187
188 PSEND (hCommPPP, gpppShrdPrm.setPrm[gpppShrdPrm.owner].pdp_rej);
189
190 return 0;
191 }
192
193 /*
194 +-------------------------------------------------------------------+
195 | PROJECT : GPRS (8441) MODULE : PSA_PPPS |
196 | STATE : finished ROUTINE : psaGPPP_Modification |
197 +-------------------------------------------------------------------+
198
199 PURPOSE : negotiate header compression again (only in server mode)
200
201 */
202 /* NEEDED ???*/
203
204
205 /* LOCAL SHORT psaGPPP_Modification ( void )*/
206 /* {*/
207 /* T_PPP_SET_PRM * pPrmSet; *//* points to used parameter set */
208 /* TRACE_FUNCTION ("psaGPPP_Modification()");*/
209
210 /*
211 *-------------------------------------------------------------------
212 * check owner id
213 *-------------------------------------------------------------------
214 */
215 /* if(!psa_IsVldOwnId(gpppShrdPrm.owner))
216
217 return( -1 );
218
219 pPrmSet = &gpppShrdPrm.setPrm[gpppShrdPrm.owner]; */
220
221 /*
222 *-------------------------------------------------------------------
223 * create and send primitive for network attach
224 *-------------------------------------------------------------------
225 */
226 /* {
227 PALLOC (ppp_modification_req, PPP_MODIFICATION_REQ);*/
228
229 /* fill in primitive parameter: registration mode */
230 /* ppp_modification_req -> ppp_hc = pPrmSet -> ppp_hc;
231 ppp_modification_req -> msid = pPrmSet -> msid;
232
233 PSEND (hCommPPP, ppp_modification_req);
234 }
235
236 return 0;
237 }*/
238
239 #endif /* GPRS */
240 /*==== EOF ========================================================*/
241