| /************************************************************* |
| * |
| * This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc. |
| * |
| * Any unauthorized use inconsistent with the terms of such license is strictly prohibited. |
| * |
| * Copyright (c) 2002-2010 VIA Telecom, Inc. All rights reserved. |
| * |
| *************************************************************/ |
| /************************************************************************* |
| * |
| * File Name: 7074api.h |
| * Project: NSPE stack |
| * |
| * Original Author: Steve Pye |
| * Creation Date: July 10, 1998 |
| * |
| * Description: Header file for 7074api.c |
| * Restrictions: |
| * Dependencies: |
| * |
| ************************************************************************* |
| * |
| * This Software is the property of ISOTEL Research Ltd. |
| * Unauthorized use is prohibited. |
| * |
| * ISOTEL Research Ltd. |
| * Suite 340, 525 - 28th Street S.E. |
| * Calgary, Alberta, Canada T2A 6W9 |
| * Tel: (403)275-0041 Fax: (403)274-3598 |
| * |
| * |
| ************************************************************************/ |
| |
| #ifndef _7074API_H_ |
| #define _7074API_H_ 1 |
| |
| #include "USER_API.H" |
| #include "kal_public_defs.h" |
| #include "kal_public_api.h" |
| |
| /* Connect Status/Disconnect Reasons */ |
| #define IS707_CONNECT_SUCCESS 0 |
| #define IS707_CONNECT_FAIL_TCP 1 |
| #define IS707_CONNECT_FAIL_PPP 2 |
| #define IS707_CONNECT_FAIL_RLP 3 |
| #define IS707_CONNECT_FAIL_UART 4 |
| #define IS707_DISCONNECT_NORMAL 5 |
| #define IS707_CONNECTING_MIP 20 |
| #define IS707_DISCONNECTING_MIP 21 |
| |
| #ifdef __cplusplus |
| extern "C" { |
| #endif |
| |
| typedef enum |
| { |
| CONN_FAIL_UNUSED = 0, |
| CONN_FAIL_PPP_AUTH_FAIL = 6, |
| CONN_FAIL_MIP_PPP_LCP_TMO, |
| CONN_FAIL_MIP_PPP_NCP_TMO, |
| CONN_FAIL_SIP_PPP_LCP_TMO, |
| CONN_FAIL_SIP_PPP_NCP_TMO, |
| CONN_FAIL_MIP_PPP_OPT_MISMATCH, |
| CONN_FAIL_SIP_PPP_OPT_MISMATCH, |
| CONN_FAIL_MIP_SOL_TMO, |
| CONN_FAIL_MIP_RRQ_TMO, |
| CONN_FAIL_MIP_RRP_ERR, |
| CONN_FAIL_MIP_LCP_FAIL, |
| CONN_FAIL_SIP_LCP_FAIL, |
| CONN_FAIL_MIP_NCP_FAIL, |
| CONN_FAIL_SIP_NCP_FAIL, |
| CONN_FAIL_PPP_A12_AUTH_FAIL, |
| CONN_FAIL_PPP_EAP_AKA_AUTH_FAIL, |
| CONN_FAIL_MIP_ADMIN_PROHIB_FAIL, |
| CONN_FAIL_MULTI_TCH_FAIL, |
| CONN_FAIL_PPP_A12_LCP_TMO, |
| |
| /*the code from 64 to 144 have been token as MIP Error codes*/ |
| /*GTR-DATA-SPEC*/ |
| CONN_FAIL_MIP_UNSPECIFIED = 64, |
| CONN_FAIL_MIP_ADMIN_PROHIBITED = 65, |
| CONN_FAIL_MIP_INSUFF_RESOURCES_1 = 66, |
| CONN_FAIL_MIP_MN_FAILED_AUTH = 67, |
| CONN_FAIL_MIP_HA_FAILED_AUTH = 68, |
| CONN_FAIL_MIP_LIFETIME_TOO_LONG = 69, |
| CONN_FAIL_MIP_POORLY_FORMED_REQ = 70, |
| CONN_FAIL_MIP_POORLY_FORMED_REPLY = 71, |
| CONN_FAIL_MIP_ENCAP_UNAVAIL = 72, |
| CONN_FAIL_MIP_RESERVED_UNAVAIL = 73, |
| CONN_FAIL_MIP_REV_TUN_UNAVAIL = 74, |
| CONN_FAIL_MIP_RT_N_T_NOT_SET = 75, |
| CONN_FAIL_MIP_MN_TOO_DISTANT = 76, |
| CONN_FAIL_MIP_INVALID_CARE_OF_ADDR = 77, |
| CONN_FAIL_MIP_REG_TIMEOUT = 78, |
| CONN_FAIL_MIP_DS_NOT_SUPPORT = 79, |
| CONN_FAIL_MIP_HN_UNREACHABLE = 80, |
| CONN_FAIL_MIP_HA_HOST_UNREACHABLE = 81, |
| CONN_FAIL_MIP_HA_PORT_UNREACHABLE = 82, |
| CONN_FAIL_MIP_HA_UNREACHABLE = 88, |
| CONN_FAIL_MIP_VENDOR_SPECIFIC = 89, |
| CONN_FAIL_MIP_NONZERO_HA_ADDR = 90, |
| CONN_FAIL_MIP_NONZERO_HOME_ADDR = 96, |
| CONN_FAIL_MIP_MISSING_NAI = 97, |
| CONN_FAIL_MIP_MISSING_HA = 98, |
| CONN_FAIL_MIP_MISSING_HOME_ADDR = 99, |
| CONN_FAIL_MIP_UNKNOWN_CHALL = 104, |
| CONN_FAIL_MIP_MISSING_CHALL = 105, |
| CONN_FAIL_MIP_STALE_CHALL = 106, |
| CONN_FAIL_MIP_MISSING_MN_FA = 107, |
| CONN_FAIL_MIP_REASON_UNSPEC = 128, |
| CONN_FAIL_MIP_ADMIN_PROHIB = 129, |
| CONN_FAIL_MIP_INSUFF_RESOURCES_2 = 130, |
| CONN_FAIL_MIP_MN_FAILED_AUTH_2 = 131, |
| CONN_FAIL_MIP_FA_FAILED_AUTH = 132, |
| CONN_FAIL_MIP_IDENT_MISMATCH = 133, |
| CONN_FAIL_MIP_POORLY_FORMED_REQ_2 = 134, |
| CONN_FAIL_MIP_TOO_MANY_BINDINGS = 135, |
| CONN_FAIL_MIP_UNKNOWN_HA_ADDR = 136, |
| CONN_FAIL_MIP_REV_TUNNEL_UNAVAIL = 137, |
| CONN_FAIL_MIP_RT_N_T_NOT_SET_2 = 138, |
| CONN_FAIL_MIP_ENCAPSULATION_UNAVAIL = 139, |
| CONN_FAIL_MIP_REG_WITH_REDIRECTED = 143, |
| CONN_FAIL_MIP_ERR_CODE_FROM_HOME = 144 |
| }ConnFailReasonT; |
| |
| /* Async App -> Browser Control/Bottom of PPP functions for Browser Mode */ |
| void is7074HDLCPacketRxd( kal_uint8 *data, kal_uint16 size ); |
| void is7074AppIntEndConnection( kal_bool graceful ); |
| void is7074AppIntTxReq( kal_uint8 *data, kal_uint16 size, kal_bool push, kal_uint8 sap ); |
| void is7074AppIntRxRsp( kal_uint8 sap ); |
| void is7074BrowserSendDatagram( kal_uint8 sap, SendToRequest *s ); |
| void is7074BrowserRxRsp(kal_uint8 sap); |
| |
| /* RLP -> Bottom of PPP functions in all modes */ |
| void is7074RlpTxComplete( kal_bool rlp_channel ); |
| void is7074RlpHDLCPacketRxd( kal_uint8 app, kal_uint8 *data, kal_uint16 size ); |
| |
| /* UART -> Bottom of PPP via the UART during Packet mode */ |
| void is7074UartHDLCPacketRxd( kal_uint8 *data, kal_uint16 size ); |
| |
| /* 'IP or CLNP' -> Top of PPP (and then UART) functions for Packet Mode */ |
| void is7074RmPppConnect( kal_uint32 local_ip, kal_uint32 remote_ip ); |
| void is7074RmConnectStatus(kal_uint8 status); |
| |
| #ifdef PPP_RECONNECT |
| void is7074RmPppReConnect( void ); |
| void is7074UmPppReConnect( kal_uint16 port); |
| #endif |
| |
| /* TCP browser -> top of TCP/IP/PPP stack */ |
| void is7074TcpbEndConnection( kal_bool graceful ); |
| void is7074TcpbSendDataReq( kal_uint8 *data, kal_uint16 size, kal_bool push, kal_uint8 sap ); |
| void is7074TcpbRecvDataRsp( kal_uint8 sapRsp ); |
| |
| kal_int16 is7074SocketCreate(kal_bool TcpType, kal_uint8 *sap); |
| kal_int16 is7074SocketClose(kal_uint8 sap, kal_bool graceful); |
| kal_int16 is7074SocketBind(kal_uint8 sap, kal_uint32 ipAddr, kal_uint16 port, kal_bool FromApp); |
| void is7074SocketConnect(kal_uint8 sap, kal_bool passive, kal_uint32 ipAddr, kal_uint16 port); |
| kal_int16 is7074SocketListen(kal_uint8 sap, kal_uint8 listenSap); |
| kal_int16 is7074SocketOptionSet(kal_uint8 sap, kal_uint8 opt_type, kal_uint16 size); |
| kal_int16 is7074SocketShutDown(kal_uint8 sap, kal_uint8 shutdown); |
| kal_int16 is7074SocketSetLinger(kal_uint8 sap, kal_bool lingerOnoff, kal_uint32 lingerTime); |
| |
| /* Mobile IP */ |
| void is7074MipRrpRsp( kal_uint8 MipState, kal_bool deRegPassed ); |
| void is7074MipAgentAdvRsp( void ); |
| kal_bool is7074MipRrq(kal_uint32 srcIp, kal_uint32 dstIp, kal_uint16 srcPort, kal_uint16 dstPort, kal_uint16 len, kal_uint8* data); |
| void is7074MipAgentSol(kal_uint32 srcIp, kal_uint32 dstIp, kal_uint16 len, kal_uint8* data ); |
| void is7074MipIpAddr(kal_uint32 LocalIp, kal_uint32 RemoteIp); |
| void is7074MipIpInitAddr(kal_uint32 LocalIp, kal_uint32 RemoteIp); |
| void is7074MipUmPppStatus( kal_uint8 status,kal_uint32 local_ip, kal_uint32 remote_ip ); |
| void is7074Md5(kal_uint8 *data, kal_uint16 dataLen, kal_uint8 *key, kal_uint16 keyLen, kal_uint8 *digest); |
| void is7074Md5MIPCHAP(kal_uint8 *data, kal_uint16 dataLen, kal_uint8 *key, kal_uint16 keyLen, kal_uint8 *chal, kal_uint16 chalLen, kal_uint8 *digest); |
| void is7074Md5SIPCHAP(kal_uint8 *id, kal_uint16 idLen, kal_uint8 *key, kal_uint16 keyLen, kal_uint8 *chal, kal_uint16 chalLen, kal_uint8 *digest); |
| void is7074MipDMUVersionSet(kal_uint8 nDMUV); |
| kal_uint8 is7074MipDMUVersionGet(void); |
| void is7074MipPreferModeSet(kal_uint8 nMipPreferMode); |
| kal_uint8 is7074MipPreferModeGet(void); |
| void is7074MipConnFail (void); |
| kal_bool HlpCheckAgpsData(kal_uint8 *IpData,kal_bool bMip); |
| kal_uint8 HlpGetInternetPdnId(void); |
| kal_bool is7074AppSendUdpPkt(kal_uint32 srcIp, kal_uint32 dstIp, |
| kal_uint16 srcPort, kal_uint16 dstPort, |
| kal_uint16 len, kal_uint8* data,kal_uint8 UdpSap); |
| #ifdef CBP7_EHRPD |
| kal_int16 is7074AppSendUdp4PppPkt(kal_uint32 srcIp, kal_uint32 dstIp, |
| kal_uint16 srcPort, kal_uint16 dstPort, |
| kal_uint16 len, kal_uint8* data,kal_uint8 UdpSap, kal_uint8 PdnId); |
| #endif |
| |
| void is707_connect_lcp( kal_uint8 app ); |
| void is707_set_ppp_addr( kal_uint8 app, kal_uint32 local_ip, kal_uint32 remote_ip ); |
| |
| #ifdef __cplusplus |
| } |
| #endif |
| |
| #endif /* _7074API_H_ */ |