comparison src/aci2/aci/cmh_pps.c @ 3:93999a60b835

src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Sep 2016 00:29:36 +0000
parents
children
comparison
equal deleted inserted replaced
2:c41a534f33c6 3:93999a60b835
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : CMH_PPPS
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 provides the set functions related to the
18 | protocol stack adapter for the PPP module.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifdef DTI
23
24 #if defined(FF_WAP) || defined(FF_TCP_IP) || defined(FF_GPF_TCPIP) || defined(FF_SAT_E)
25
26 #ifndef CMH_PPPS_C
27 #define CMH_PPPS_C
28 #endif
29
30 #include "aci_all.h"
31 /*==== INCLUDES ===================================================*/
32 #include "aci_cmh.h"
33 #include "ati_cmd.h"
34 #include "aci_cmd.h"
35
36 #ifdef FAX_AND_DATA
37 #include "aci_fd.h"
38 #endif
39
40 #include "ksd.h"
41
42 #include "dti.h" /* functionality of the dti library */
43 #include "dti_conn_mng.h"
44
45 #include "psa.h"
46 #include "psa_sim.h"
47 #include "psa_sms.h"
48 #include "wap_aci.h"
49 #include "psa_ppp_w.h"
50
51 #include "phb.h"
52 #include "cmh.h"
53 #include "cmh_phb.h"
54 #include "cmh_sms.h"
55
56
57 /*==== CONSTANTS ==================================================*/
58
59 /*==== TYPES ======================================================*/
60
61 /*==== EXPORT =====================================================*/
62
63 /*==== VARIABLES ==================================================*/
64
65 /*==== FUNCTIONS ==================================================*/
66
67 /*
68 +-------------------------------------------------------------------+
69 | PROJECT : GSM-PS (6147) MODULE : CMH_PPPS |
70 | STATE : code ROUTINE : sAT_PercentPPP |
71 +-------------------------------------------------------------------+
72
73 PURPOSE : This command will be called from MMI to set the
74 authentification protocol, the login name, and the password
75 for the PPP entity.
76
77
78 */
79 GLOBAL T_ACI_RETURN sAT_PercentPPP ( T_ACI_CMD_SRC srcId,
80 T_ACI_PPP_PROT protocol,
81 CHAR *login,
82 CHAR *pwd,
83 T_ACI_PPP_CON con_type )
84 {
85
86 switch (protocol)
87 {
88 case(A_NO_AUTH):
89 pppShrdPrm.auth_prot = PPP_AP_NO;
90 break;
91
92 case(A_PAP):
93 pppShrdPrm.auth_prot = PPP_AP_PAP;
94 break;
95
96 case(A_CHAP):
97 pppShrdPrm.auth_prot = PPP_AP_CHAP;
98 break;
99
100 case(A_AUTO_AUTH):
101 pppShrdPrm.auth_prot = PPP_AP_AUTO;
102 break;
103
104 default:
105 TRACE_EVENT("Wrong value for authentification protocol");
106 return AT_FAIL;
107 }
108
109 #ifdef FF_TCP_IP
110 switch (con_type)
111 {
112 case(USE_NO_PPP_FOR_AAA):
113 pppShrdPrm.is_PPP_CALL = FALSE;
114 break;
115
116 case(USE_PPP_FOR_AAA):
117 pppShrdPrm.is_PPP_CALL = TRUE;
118 break;
119
120 default:
121 TRACE_EVENT("Wrong value for connection type");
122 return AT_FAIL;
123 }
124 #endif
125
126 if((login NEQ NULL) AND (pwd NEQ NULL))
127 {
128 memcpy(pppShrdPrm.ppp_login,login, sizeof(pppShrdPrm.ppp_login));
129 memcpy(pppShrdPrm.ppp_password,pwd, sizeof(pppShrdPrm.ppp_password));
130 }
131 else
132 return AT_FAIL;
133
134 return AT_CMPL;
135 }
136
137
138 #ifdef DTI
139 /** Functional interface to the AT%PPP? command. The IP addresses are in host
140 * byte order.
141 *
142 * @param srcId ID of command source (unused).
143 * @param ipaddr_p Pointer to IP address variable of caller.
144 * @param dns1_p Pointer to dns1 variable of caller.
145 * @param dns2_p Pointer to dns2 variable of caller.
146 * @return AT_CMPL
147 */
148 GLOBAL T_ACI_RETURN qAT_PercentPPP(UBYTE srcId, ULONG *ipaddr_p,
149 ULONG *dns1_p, ULONG *dns2_p)
150 {
151 if (ipaddr_p NEQ NULL)
152 {
153 *ipaddr_p = pppShrdPrm.ipaddr ;
154 }
155 if (dns1_p NEQ NULL)
156 {
157 *dns1_p = pppShrdPrm.dns1 ;
158 }
159 if (dns2_p NEQ NULL)
160 {
161 *dns2_p = pppShrdPrm.dns2 ;
162 }
163
164 return AT_CMPL ;
165 }
166 #endif /* DTI */
167
168
169
170 /*
171 +-------------------------------------------------------------------+
172 | PROJECT : GSM-PS (6147) MODULE : CMH_PPPS |
173 | STATE : code ROUTINE : cmhPPP_Terminate |
174 +-------------------------------------------------------------------+
175
176 PURPOSE :
177
178
179 */
180 GLOBAL T_ACI_RETURN cmhPPP_Terminate ( T_ACI_PPP_LOWER_LAYER ppp_lower_layer )
181 {
182 TRACE_FUNCTION("cmhPPP_Terminate()");
183
184 psaPPP_Terminate(ppp_lower_layer);
185
186 return (AT_CMPL);
187 }
188
189 #endif /* defined(WAP) || defined(FF_TCP_IP) || defined(FF_GPF_TCPIP) || defined (FF_SAT_E) */
190 #endif /* DTI */