⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 etr_ppp.h

📁 通过GPRS的PPP拔号程序,本程序在x86下通过测试
💻 H
字号:
#if !defined( _ETR_TCP_H )
#define _ETR_TCP_H
/*////////////////////////////////////////////////
	  NetBox TCP/IP over Ethernet
////////////////////////////////////////////////*/
#define NE_PARAM	-10         /* user parameter error */
#define EHOSTUNREACH	-11         /* host not reachable */
#define ETIMEDOUT	-12         /* timeout */
#define NE_HWERR	-13         /* hardware error */
#define ECONNABORTED	-14         /* protocol error */
#define ENOBUFS		-15         /* no buffer space */
#define EBADF		-16         /* connection block invalid */
#define EFAULT		-17         /* invalid pointer argument */
#define	EWOULDBLOCK	-18         /* operation would block */
#define	EMSGSIZE	-19         /* message too long */
#define	ENOPROTOOPT	-20         /* Protocol not available */

#define		BLOCKOPEN	0
#define		NONBLOCKOPEN	0x80

int InitPPPNet( int PortNum=0, char* IPString=NULL );
int TermPPPNet( );
int ConnOpen( char* to, char* protoc, int lp, int rp, int flags );
//int ConnClose( int conno );
int ConnClose( int conno, int flags=0 );
// return =  0: the connection conno is closed
//        != 0: the connection conno is not closed yet!
int ConnCloseCheck( int conno );
int ConnRead( int conno, char* buff, int len );
int ConnWrite( int conno, char* buff, int len, int PushFlg=0 );
int ConnIsEstablished( int conno );
int ConnCanSend( int conno, int len );
int ConnHasData( int conno );
int ConnIsFinished( int conno );
int MyPort( );

// input: char IPCode[4]
int  GetIP( int conno, unsigned char* IPCode );
int  GetOWNIP( unsigned char* IPCode );

int  FTP_getput(char *host, char *file, int mode, char *FTPdir,
		char *FTPusername, char *FTPpassword );
int  FTP_server( void* pTsk, unsigned long timeout=300000l );
int  NetPackagePro( );
int  SetReloadWDTInNet( void (*Reload)() );

// input: IPStr = remote IP addr with form of "192.168.201.22"
//        Seconds = wait time for reply, typical value: 100 - 3000 milliseconds
// return = 0: remote IP can been reached, otherwise, no way!
int Ping( char* IPStr, unsigned long Milliseconds );

// for PPP client, start PPP linkup
//int SetupPPPLink( );
// timeout unit is sencond
int SetupPPPLink( unsigned long timeout=300l );

// return = -1:  PPP is down
//        =  0:  PPP is working to open/close
//        =  1:  PPP is up
int GetPPPState( );

int SetPPPUsername( char* NewName );
int SetPPPPassword( char* NewWord );

int ForcePPPLinkDown( );

int SendATCmdString( char* ATCmdString, int ch=0 );
int GetATCmdEcho( );
int SetSerMuxUp( );

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -