FreeCalypso > hg > fc-magnetite
comparison src/g23m-aci/aci/cmh_pps.c @ 162:53929b40109c
src/g23m-aci: initial import from TCS3.2/LoCosto
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 11 Oct 2016 02:02:43 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
161:4557e2a9c18e | 162:53929b40109c |
---|---|
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_PPP) || 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 = (T_ACI_PPP_PROT)PPP_AP_NO; | |
90 break; | |
91 | |
92 case(A_PAP): | |
93 pppShrdPrm.auth_prot = (T_ACI_PPP_PROT)PPP_AP_PAP; | |
94 break; | |
95 | |
96 case(A_CHAP): | |
97 pppShrdPrm.auth_prot = (T_ACI_PPP_PROT)PPP_AP_CHAP; | |
98 break; | |
99 | |
100 case(A_AUTO_AUTH): | |
101 pppShrdPrm.auth_prot = (T_ACI_PPP_PROT)PPP_AP_AUTO; | |
102 break; | |
103 | |
104 default: | |
105 TRACE_EVENT("Wrong value for authentification protocol"); | |
106 return AT_FAIL; | |
107 } | |
108 #ifdef FF_PPP | |
109 switch (con_type) | |
110 { | |
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 /* FF_PPP */ | |
125 | |
126 | |
127 if((login NEQ NULL) AND (pwd NEQ NULL)) | |
128 { | |
129 memcpy(pppShrdPrm.ppp_login,login, sizeof(pppShrdPrm.ppp_login)); | |
130 memcpy(pppShrdPrm.ppp_password,pwd, sizeof(pppShrdPrm.ppp_password)); | |
131 } | |
132 else | |
133 return AT_FAIL; | |
134 | |
135 return AT_CMPL; | |
136 } | |
137 | |
138 | |
139 #ifdef DTI | |
140 /** Functional interface to the AT%PPP? command. The IP addresses are in host | |
141 * byte order. | |
142 * | |
143 * @param srcId ID of command source (unused). | |
144 * @param ipaddr_p Pointer to IP address variable of caller. | |
145 * @param dns1_p Pointer to dns1 variable of caller. | |
146 * @param dns2_p Pointer to dns2 variable of caller. | |
147 * @return AT_CMPL | |
148 */ | |
149 GLOBAL T_ACI_RETURN qAT_PercentPPP(UBYTE srcId, ULONG *ipaddr_p, | |
150 ULONG *dns1_p, ULONG *dns2_p) | |
151 { | |
152 if (ipaddr_p NEQ NULL) | |
153 { | |
154 *ipaddr_p = pppShrdPrm.ipaddr ; | |
155 } | |
156 if (dns1_p NEQ NULL) | |
157 { | |
158 *dns1_p = pppShrdPrm.dns1 ; | |
159 } | |
160 if (dns2_p NEQ NULL) | |
161 { | |
162 *dns2_p = pppShrdPrm.dns2 ; | |
163 } | |
164 | |
165 return AT_CMPL ; | |
166 } | |
167 #endif /* DTI */ | |
168 | |
169 | |
170 | |
171 /* | |
172 +-------------------------------------------------------------------+ | |
173 | PROJECT : GSM-PS (6147) MODULE : CMH_PPPS | | |
174 | STATE : code ROUTINE : cmhPPP_Terminate | | |
175 +-------------------------------------------------------------------+ | |
176 | |
177 PURPOSE : | |
178 | |
179 | |
180 */ | |
181 GLOBAL T_ACI_RETURN cmhPPP_Terminate ( T_ACI_PPP_LOWER_LAYER ppp_lower_layer ) | |
182 { | |
183 TRACE_FUNCTION("cmhPPP_Terminate()"); | |
184 | |
185 psaPPP_Terminate(ppp_lower_layer); | |
186 | |
187 return (AT_CMPL); | |
188 } | |
189 | |
190 #endif /* defined(WAP) || defined(FF_PPP) || defined(FF_GPF_TCPIP) || defined (FF_SAT_E) */ | |
191 #endif /* DTI */ |