00001 00031 //-------------------------------------------------------------------------------------------------- 00039 #ifndef LEGATO_PA_MDC_INCLUDE_GUARD 00040 #define LEGATO_PA_MDC_INCLUDE_GUARD 00041 00042 #include "legato.h" 00043 #include "le_mdm_defs.h" 00044 00045 00046 00047 //-------------------------------------------------------------------------------------------------- 00051 //-------------------------------------------------------------------------------------------------- 00052 #define PA_MDC_MAX_PROFILE 5 00053 00054 00055 //-------------------------------------------------------------------------------------------------- 00059 //-------------------------------------------------------------------------------------------------- 00060 00061 //-------------------------------------------------------------------------------------------------- 00067 //-------------------------------------------------------------------------------------------------- 00068 #define PA_MDC_APN_MAX_LEN 100 00069 00070 //-------------------------------------------------------------------------------------------------- 00074 //-------------------------------------------------------------------------------------------------- 00075 #define PA_MDC_APN_MAX_BYTES (PA_MDC_APN_MAX_LEN+1) 00076 00077 //-------------------------------------------------------------------------------------------------- 00083 //-------------------------------------------------------------------------------------------------- 00084 #define PA_MDC_USERNAME_MAX_LEN 64 00085 00086 //-------------------------------------------------------------------------------------------------- 00090 //-------------------------------------------------------------------------------------------------- 00091 #define PA_MDC_USERNAME_MAX_BYTES (PA_MDC_USERNAME_MAX_LEN+1) 00092 00093 //-------------------------------------------------------------------------------------------------- 00099 //-------------------------------------------------------------------------------------------------- 00100 #define PA_MDC_PWD_MAX_LEN 100 00101 00102 //-------------------------------------------------------------------------------------------------- 00106 //-------------------------------------------------------------------------------------------------- 00107 #define PA_MDC_PWD_MAX_BYTES (PA_MDC_PWD_MAX_LEN+1) 00108 00109 //-------------------------------------------------------------------------------------------------- 00113 //-------------------------------------------------------------------------------------------------- 00114 typedef enum 00115 { 00116 PA_MDC_AUTH_NONE, 00117 PA_MDC_AUTH_PAP, 00118 PA_MDC_AUTH_CHAP, 00119 } 00120 pa_mdc_AuthType_t; 00121 00122 //-------------------------------------------------------------------------------------------------- 00126 //-------------------------------------------------------------------------------------------------- 00127 typedef struct { 00128 pa_mdc_AuthType_t type; 00129 char userName[PA_MDC_USERNAME_MAX_BYTES]; 00130 char password[PA_MDC_APN_MAX_BYTES]; 00131 } 00132 pa_mdc_Authentication_t; 00133 00134 //-------------------------------------------------------------------------------------------------- 00138 //-------------------------------------------------------------------------------------------------- 00139 typedef enum { 00140 PA_MDC_SESSION_IPV4=0, 00141 PA_MDC_SESSION_IPV6 00142 } 00143 pa_mdc_SessionType_t; 00144 00145 //-------------------------------------------------------------------------------------------------- 00149 //-------------------------------------------------------------------------------------------------- 00150 typedef enum { 00151 PA_MDC_PDP_UNKNOWN = 0, 00152 PA_MDC_PDP_IPV4, 00153 PA_MDC_PDP_IPV6, 00154 PA_MDC_PDP_IPV4V6 00155 } 00156 pa_mdc_PdpType_t; 00157 00158 //-------------------------------------------------------------------------------------------------- 00162 //-------------------------------------------------------------------------------------------------- 00163 typedef struct { 00164 char apn[PA_MDC_APN_MAX_BYTES]; 00165 pa_mdc_Authentication_t authentication; 00166 pa_mdc_PdpType_t pdp; 00167 } 00168 pa_mdc_ProfileData_t; 00169 00170 00171 //-------------------------------------------------------------------------------------------------- 00175 //-------------------------------------------------------------------------------------------------- 00176 typedef enum 00177 { 00178 PA_MDC_CONNECTED, 00179 PA_MDC_DISCONNECTED, 00180 } 00181 pa_mdc_SessionState_t; 00182 00183 00184 //-------------------------------------------------------------------------------------------------- 00188 //-------------------------------------------------------------------------------------------------- 00189 typedef struct { 00190 uint32_t profileIndex; 00191 pa_mdc_SessionState_t newState; 00192 } 00193 pa_mdc_SessionStateData_t; 00194 00195 //-------------------------------------------------------------------------------------------------- 00199 //-------------------------------------------------------------------------------------------------- 00200 typedef struct { 00201 uint64_t transmittedBytesCount; 00202 uint64_t receivedBytesCount; 00203 } 00204 pa_mdc_PktStatistics_t; 00205 00206 //-------------------------------------------------------------------------------------------------- 00215 //-------------------------------------------------------------------------------------------------- 00216 typedef void (*pa_mdc_SessionStateHandler_t) 00217 ( 00218 pa_mdc_SessionStateData_t* sessionStatePtr 00219 ); 00220 00221 //-------------------------------------------------------------------------------------------------- 00229 //-------------------------------------------------------------------------------------------------- 00230 le_result_t pa_mdc_ReadProfile 00231 ( 00232 uint32_t profileIndex, 00233 pa_mdc_ProfileData_t* profileDataPtr 00234 ); 00235 00236 00237 //-------------------------------------------------------------------------------------------------- 00245 //-------------------------------------------------------------------------------------------------- 00246 le_result_t pa_mdc_WriteProfile 00247 ( 00248 uint32_t profileIndex, 00249 pa_mdc_ProfileData_t* profileDataPtr 00250 ); 00251 00252 00253 //-------------------------------------------------------------------------------------------------- 00262 //-------------------------------------------------------------------------------------------------- 00263 le_result_t pa_mdc_StartSessionIPV4 00264 ( 00265 uint32_t profileIndex, 00266 uint32_t* callRefPtr 00267 ); 00268 00269 //-------------------------------------------------------------------------------------------------- 00278 //-------------------------------------------------------------------------------------------------- 00279 le_result_t pa_mdc_StartSessionIPV6 00280 ( 00281 uint32_t profileIndex, 00282 uint32_t* callRefPtr 00283 ); 00284 00285 //-------------------------------------------------------------------------------------------------- 00294 //-------------------------------------------------------------------------------------------------- 00295 le_result_t pa_mdc_StartSessionIPV4V6 00296 ( 00297 uint32_t profileIndex, 00298 uint32_t* callRefPtr 00299 ); 00300 00301 00302 //-------------------------------------------------------------------------------------------------- 00310 //-------------------------------------------------------------------------------------------------- 00311 le_result_t pa_mdc_GetSessionType 00312 ( 00313 uint32_t profileIndex, 00314 pa_mdc_SessionType_t* sessionIpPtr 00315 ); 00316 00317 //-------------------------------------------------------------------------------------------------- 00326 //-------------------------------------------------------------------------------------------------- 00327 le_result_t pa_mdc_StopSession 00328 ( 00329 uint32_t callRef 00330 ); 00331 00332 00333 //-------------------------------------------------------------------------------------------------- 00341 //-------------------------------------------------------------------------------------------------- 00342 le_result_t pa_mdc_GetSessionState 00343 ( 00344 uint32_t profileIndex, 00345 pa_mdc_SessionState_t* sessionStatePtr 00346 ); 00347 00348 00349 //-------------------------------------------------------------------------------------------------- 00358 //-------------------------------------------------------------------------------------------------- 00359 void pa_mdc_SetSessionStateHandler 00360 ( 00361 pa_mdc_SessionStateHandler_t handlerRef 00362 ); 00363 00364 00365 //-------------------------------------------------------------------------------------------------- 00374 //-------------------------------------------------------------------------------------------------- 00375 le_result_t pa_mdc_GetInterfaceName 00376 ( 00377 uint32_t profileIndex, 00378 char* interfaceNameStr, 00379 size_t interfaceNameStrSize 00380 ); 00381 00382 00383 //-------------------------------------------------------------------------------------------------- 00392 //-------------------------------------------------------------------------------------------------- 00393 le_result_t pa_mdc_GetIPAddress 00394 ( 00395 uint32_t profileIndex, 00396 char* ipAddrStr, 00397 size_t ipAddrStrSize 00398 ); 00399 00400 00401 //-------------------------------------------------------------------------------------------------- 00410 //-------------------------------------------------------------------------------------------------- 00411 le_result_t pa_mdc_GetGatewayAddress 00412 ( 00413 uint32_t profileIndex, 00414 char* gatewayAddrStr, 00415 size_t gatewayAddrStrSize 00416 ); 00417 00418 00419 //-------------------------------------------------------------------------------------------------- 00432 //-------------------------------------------------------------------------------------------------- 00433 le_result_t pa_mdc_GetDNSAddresses 00434 ( 00435 uint32_t profileIndex, 00436 char* dns1AddrStr, 00437 size_t dns1AddrStrSize, 00438 char* dns2AddrStr, 00439 size_t dns2AddrStrSize 00440 ); 00441 00442 //-------------------------------------------------------------------------------------------------- 00451 //-------------------------------------------------------------------------------------------------- 00452 le_result_t pa_mdc_GetAccessPointName 00453 ( 00454 uint32_t profileIndex, 00455 char* apnNameStr, 00456 size_t apnNameStrSize 00457 ); 00458 00459 //-------------------------------------------------------------------------------------------------- 00467 //-------------------------------------------------------------------------------------------------- 00468 le_result_t pa_mdc_GetDataBearerTechnology 00469 ( 00470 uint32_t profileIndex, 00471 le_mdc_dataBearerTechnology_t* dataBearerTechnologyPtr 00472 ); 00473 00474 //-------------------------------------------------------------------------------------------------- 00483 //-------------------------------------------------------------------------------------------------- 00484 le_result_t pa_mdc_GetDataFlowStatistics 00485 ( 00486 pa_mdc_PktStatistics_t *dataStatisticsPtr 00487 ); 00488 00489 //-------------------------------------------------------------------------------------------------- 00498 //-------------------------------------------------------------------------------------------------- 00499 le_result_t pa_mdc_ResetDataFlowStatistics 00500 ( 00501 void 00502 ); 00503 00504 #endif // LEGATO_PA_MDC_INCLUDE_GUARD 00505