00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 #ifndef __TCPIP_H__
00092 #define __TCPIP_H__
00093
00094 #include "CLIB/TCPIPAPI.H"
00095
00096
00097 #define TCPIPVECT 0xAC
00098
00099 #ifdef _MSC_VER
00100 #ifdef FP_SEG
00101 #undef FP_SEG
00102 #endif
00103 #define FP_SEG(ptr) ((unsigned int)(((unsigned long)ptr)>>16))
00104
00105 #ifdef FP_OFF
00106 #undef FP_OFF
00107 #endif
00108 #define FP_OFF(ptr) ((unsigned int)(((unsigned long)ptr)&0xFFFF))
00109 #endif
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128 int tcp_connect(char *DestIPStr, unsigned int ClientPort, unsigned int HostPort, int *error);
00129
00130
00131 int accept(int sd, struct sockaddr * addressPtr, int *error);
00132
00133 void api_sleep(unsigned int howlong);
00134
00135 int bind(int sd, struct sockaddr * addressPtr, int *error);
00136
00137 int connect(int sd, struct sockaddr * addressPtr, int *error);
00138
00139 int closesocket(int sd, int *error);
00140
00141 int GetWaitingBytes(int sd, int *error);
00142
00143 unsigned int htons(unsigned int value);
00144
00145 int listen(int sd,int backlog, int *error);
00146
00147 int inet_addr(char * IPAddressStringPtr, unsigned long * IPAddress);
00148
00149 int InetToAscii(unsigned long * IPAddress, char * IPAddressStringPtr);
00150
00151 int recvfrom(int sd, char * bufptr, int bufLen, int flags,
00152 unsigned long timeout,struct sockaddr * fromPtr, int *error);
00153
00154 int recv(int sd, char * bufptr, int bufLen, int flags, unsigned long timeout,
00155 int *error);
00156
00157 int ResetConnection(int sd, int *error);
00158
00159 int sendto(int sd, char * bufptr, int bufLen, int flags,
00160 const struct sockaddr * toPtr, int *error);
00161
00162 int send(int sd, char * bufptr, int bufLen, int flags, int *error);
00163
00164 int setlinger(int sd, int seconds, int *error);
00165
00166 int setreuse(int sd,int *error);
00167
00168 int Set_IP_Type_Of_Service(int sd, unsigned char TOS, int *error);
00169
00170 int opensocket(unsigned char type, int *error);
00171
00172 int setsockopt(int sd, SetSocketOption *sockoptptr, int *error);
00173
00174 int getsockopt(int sd, GetSocketOption *sockoptptr, int *error);
00175
00176 int Set_Blocking_Mode(int sd, unsigned char mode, int *error);
00177
00178 int RegisterCallbackFunction(int sd, void * funcptr, int eventflagmask ,int *error);
00179
00180 int GetRegisterCallbackFunction(int sd, void * funcptr, int eventflagmask ,int *error);
00181
00182 int get_socketerror(int sd);
00183
00184 unsigned char Get_TCP_Socket_State(unsigned int localPort, unsigned long * remoteIP, unsigned int * remotePort);
00185
00186
00187
00188
00189 int PPP_Client_Installed(void);
00190 int PPP_Client_Open(PPPClient_Init * ptr, int *error);
00191 int PPP_Client_Close(int *error);
00192 int PPP_Client_GetStatus(int *error);
00193 int PPP_Client_SetOptions(PPP_Option *ptr);
00194 int PPP_Client_Get_DNSIP(unsigned long * IPaddress, int primary_sec, int *error);
00195
00196
00197
00198
00199 int PPP_Server_Installed(void);
00200 int PPP_Server_Suspend(int timeoutsecs, int *error);
00201 int PPP_Server_Activate(int timeoutsecs,int *error);
00202 int PPP_Server_GetStatus(void);
00203 int PPP_Server_Get_Cfg(PPP_IPCfg_Data *ptr , int *error);
00204 int PPP_Server_SetOptions(PPP_Option *ptr);
00205
00206
00207 int Get_SNMP_Data(unsigned char which , void * * snmp_mib_ptr);
00208
00209
00210 int Get_FTP_Login_Counters(unsigned long * * FTP_Login_Count,unsigned long * * FTP_Login_failCount);
00211 int Get_Telnet_Login_Counters(unsigned long * * Telnet_Login_Count,unsigned long * * Telnet_Login_failCount);
00212
00213
00214 int Get_Telnet_State(int *error);
00215
00216
00217 void Get_Installed_Servers(unsigned int * AX, unsigned int *DX);
00218 int Reconfigure_ethernet(void);
00219 int DHCP_use(unsigned char dhcp_use);
00220 void Get_DHCP_Status(unsigned int * dhcp_use, unsigned int *dhcp_stat);
00221 void Get_DHCP_Status_Ext(unsigned int * dhcp_use, unsigned int *dhcp_stat, UserEthDhcp_Entry * * dhcpptr);
00222
00223 void Get_IPConfig(char *IP, char * Mask, char *Gateway);
00224 void Set_IPConfig(char *IP, char * Mask, char *Gateway);
00225 void Get_TCPIP_Statistics(Packet_Count * * Packet_Count_Pointer);
00226 int Set_FTPServer_Idle_Timeout( unsigned timeout );
00227 int Set_TelnetServer_Idle_Timeout( unsigned timeout );
00228 unsigned Get_FTPServer_Idle_Timeout(void);
00229 unsigned Get_TelnetServer_Idle_Timeout(void);
00230
00231
00232 int Ping_Open(Ping * pingptr, int * errorcode);
00233 int Ping_Close(int sd);
00234 int Ping_Statistics(Ping * pingptr);
00235
00236
00237 void Get_TCPIP_Memory_Status(unsigned long * total, unsigned long * used);
00238
00239
00240 int AddDefaultGateway( int interface , unsigned long * Gateway, int * errorcode);
00241 int DelDefaultGateway(unsigned long * Gateway, int * errorcode);
00242 int GetDefaultGateway(unsigned long * Gateway, int * errorcode);
00243 int AddStaticRoute(int interface, Route_Entry * route, int * errorcode);
00244 int DelStaticRoute(int interface, Route_Entry * route, int * errorcode);
00245
00246
00247 int Add_IGMP_Membership(unsigned long * MulticastIP, unsigned char * MacAddress, int * errorcode);
00248 int Drop_IGMP_Membership(unsigned long * MulticastIP, int * errorcode);
00249 int IPMulticast_to_MacAddr(unsigned long * MulticastIP, unsigned char * MacAddress, int * errorcode);
00250
00251
00252 #endif
00253
00254
00255