Main Page Data Structures File List Data Fields Globals Related Pages

# clib/TCPIP.C File Reference

`#include <DOS.H>`
`#include <STDLIB.H>`
`#include "CLIB/TCPIPAPI.H"`
`#include "CLIB/TCPIP.H"`

Go to the source code of this file.

## Functions
int | tcp_connect (char *DestIPStr, unsigned int ClientPort, unsigned int HostPort, int *error)
int | accept (int sd, struct sockaddr *addressPtr, int *error)
void | api_sleep (unsigned int howlong)
int | bind (int sd, struct sockaddr *addressPtr, int *error)
int | connect (int sd, struct sockaddr *addressPtr, int *error)
int | closesocket (int sd, int *error)
int | GetWaitingBytes (int sd, int *error)
unsigned int | htons (unsigned int value)
int | listen (int sd, int backlog, int *error)
int | inet_addr (char *IPAddressStringPtr, unsigned long *IPAddress)
int | InetToAscii (unsigned long *IPAddress, char *IPAddressStringPtr)
int | recvfrom (int sd, char *bufptr, int bufLen, int flags, unsigned long timeout, struct sockaddr *fromPtr, int *error)
int | recv (int sd, char *bufptr, int bufLen, int flags, unsigned long timeout, int *error)
int | ResetConnection (int sd, int *error)
int | sendto (int sd, char *bufptr, int bufLen, int flags, const struct sockaddr *toPtr, int *error)
int | send (int sd, char *bufptr, int bufLen, int flags, int *error)
int | setlinger (int sd, int seconds, int *error)
int | setreuse (int sd, int *error)
unsigned char | Get_TCP_Socket_State (unsigned int localPort, unsigned long *remoteIP, unsigned int *remotePort)
int | get_socketerror (int sd)
int | Set_IP_Type_Of_Service (int sd, unsigned char TOS, int *error)
int | setsockopt (int sd, SetSocketOption *sockoptptr, int *error)
int | getsockopt (int sd, GetSocketOption *sockoptptr, int *error)
int | Set_Blocking_Mode (int sd, unsigned char mode, int *error)
int | opensocket (unsigned char type, int *error)
int | RegisterCallbackFunction (int sd, void *funcptr, int eventflagmask,int *error)
int | PPP_Client_Installed (void)
int | PPP_Client_Open (PPPClient_Init *ptr, int *error)
int | PPP_Client_Close (int *error)
int | PPP_Client_GetStatus (int *error)
int | PPP_Client_SetOptions (PPP_Option *ptr)
int | PPP_Client_Get_DNSIP (unsigned long *IPaddress, int primary_sec, int *error)
int | PPP_Server_Installed (void)
int | PPP_Server_Suspend (int timeoutsecs, int *error)
int | PPP_Server_Activate (int timeoutsecs, int *error)
int | PPP_Server_Get_Cfg (PPP_IPCfg_Data *ptr, int *error)
int | PPP_Server_GetStatus (void)
int | PPP_Server_SetOptions (PPP_Option *ptr)
int | Get_SNMP_Data (unsigned char which, void **snmp_mib_ptr)
int | Get_FTP_Login_Counters (unsigned long **FTP_Login_Count, unsigned long **FTP_Login_failCount)
int | Get_Telnet_Login_Counters (unsigned long **Telnet_Login_Count, unsigned long **Telnet_Login_failCount)
int | Set_FTPServer_Idle_Timeout (unsigned timeout)
int | Set_TelnetServer_Idle_Timeout (unsigned timeout)
unsigned | Get_FTPServer_Idle_Timeout (void)
unsigned | Get_TelnetServer_Idle_Timeout (void)
int | Get_Telnet_State (int *error)
void | Get_Installed_Servers (unsigned int *AX, unsigned int *DX)
int | Reconfigure_ethernet (void)
int | DHCP_use (unsigned char dhcp_use)
void | Get_DHCP_Status (unsigned int *dhcp_use, unsigned int *dhcp_stat)
void | Get_DHCP_Status_Ext (unsigned int *dhcp_use, unsigned int *dhcp_stat, UserEthDhcp_Entry **dhcpptr)
void | Get_IPConfig (char *IP, char *Mask, char *Gateway)
void | Set_IPConfig (char *IP, char *Mask, char *Gateway)
void | Get_TCPIP_Statistics (Packet_Count **Packet_Count_Pointer)
int | Ping_Open (Ping *pingptr, int *errorcode)
int | Ping_Close (int sd)
int | Ping_Statistics (Ping *pingptr)
void | Get_TCPIP_Memory_Status (unsigned long *total, unsigned long *used)
int | AddDefaultGateway (int interface, unsigned long *Gateway, int *errorcode)
int | DelDefaultGateway (unsigned long *Gateway, int *errorcode)
int | GetDefaultGateway (unsigned long *Gateway, int *errorcode)
int | AddStaticRoute (int interface, Route_Entry *route, int *errorcode)
int | DelStaticRoute (int interface, Route_Entry *route, int *errorcode)
int | Add_IGMP_Membership (unsigned long *MulticastIP, unsigned char *MacAddress, int *errorcode)
int | Drop_IGMP_Membership (unsigned long *MulticastIP, int *errorcode)
int | IPMulticast_to_MacAddr (unsigned long *MulticastIP, unsigned char *MacAddress, int *errorcode)

## Function Documentation

int accept | ( | int | sd,
|  | struct sockaddr * | addressPtr,
|  | int * | error
| ) |

| Definition at line 168 of file TCPIP.C. References API_ACCEPT, API_ERROR, and TCPIPVECT.

int Add_IGMP_Membership | ( | unsigned long * | MulticastIP,
|  | unsigned char * | MacAddress,
|  | int * | errorcode
| ) |

| Definition at line 1440 of file TCPIP.C. References ADD_IGMP_MEMBERSHIP, and TCPIPVECT.

int AddDefaultGateway | ( | int | interface,
|  | unsigned long * | Gateway,
|  | int * | errorcode
| ) |

| Definition at line 1344 of file TCPIP.C. References ADD_DEFAULT_GATEWAY, and TCPIPVECT.

int AddStaticRoute | ( | int | interface,
|  | Route_Entry * | route,
|  | int * | errorcode
| ) |

| Definition at line 1400 of file TCPIP.C. References ADD_STATIC_ROUTE, and TCPIPVECT.

void api_sleep | ( | unsigned int | howlong | ) |

| Definition at line 197 of file TCPIP.C. References API_SLEEP, and TCPIPVECT. Referenced by ftp_open(), ftp_recvfile(), and gethostbyname().

int bind | ( | int | sd,
|  | struct sockaddr * | addressPtr,
|  | int * | error
| ) |

| Definition at line 209 of file TCPIP.C. References API_BIND, API_ERROR, and TCPIPVECT. Referenced by ftp_connect(), and tcp_connect().

int closesocket | ( | int | sd,
|  | int * | error
| ) |

| Definition at line 258 of file TCPIP.C. References API_CLOSESOCKET, API_ERROR, and TCPIPVECT. Referenced by ftp_close(), ftp_open(), ftp_recvfile(), ftp_sendfile(), gethostbyname(), http_get(), and tcp_connect().

int connect | ( | int | sd,
|  | struct sockaddr * | addressPtr,
|  | int * | error
| ) |

| Definition at line 231 of file TCPIP.C. References API_CONNECT, API_ERROR, and TCPIPVECT. Referenced by ftp_connect(), and tcp_connect().

int DelDefaultGateway | ( | unsigned long * | Gateway,
|  | int * | errorcode
| ) |

| Definition at line 1363 of file TCPIP.C. References DEL_DEFAULT_GATEWAY, and TCPIPVECT.

int DelStaticRoute | ( | int | interface,
|  | Route_Entry * | route,
|  | int * | errorcode
| ) |

| Definition at line 1420 of file TCPIP.C. References DEL_STATIC_ROUTE, and TCPIPVECT.

int DHCP_use | ( | unsigned char | dhcp_use | ) |

| Definition at line 1166 of file TCPIP.C. References DHCP_USE, and TCPIPVECT.

int Drop_IGMP_Membership | ( | unsigned long * | MulticastIP,
|  | int * | errorcode
| ) |

| Definition at line 1460 of file TCPIP.C. References DROP_IGMP_MEMBERSHIP, and TCPIPVECT.

void Get_DHCP_Status | ( | unsigned int * | dhcp_use,
|  | unsigned int * | dhcp_stat
| ) |

| Definition at line 1179 of file TCPIP.C. References DHCP_STAT, and TCPIPVECT.

void Get_DHCP_Status_Ext | ( | unsigned int * | dhcp_use,
|  | unsigned int * | dhcp_stat,
|  | UserEthDhcp_Entry ** | dhcpptr
| ) |

| Definition at line 1193 of file TCPIP.C. References DHCP_STAT, and TCPIPVECT.

int Get_FTP_Login_Counters | ( | unsigned long ** | FTP_Login_Count,
|  | unsigned long ** | FTP_Login_failCount
| ) |

| Definition at line 1005 of file TCPIP.C. References API_FTP_GET_LOGIN, and TCPIPVECT.

unsigned Get_FTPServer_Idle_Timeout | ( | void |  | ) |

| Definition at line 1086 of file TCPIP.C. References SET_SERVER_IDLE_TIMEOUT, and TCPIPVECT.

void Get_Installed_Servers | ( | unsigned int * | AX,
|  | unsigned int * | DX
| ) |

| Definition at line 1138 of file TCPIP.C. References GET_INSTALLED_SERVERS, and TCPIPVECT.

void Get_IPConfig | ( | char * | IP,
|  | char * | Mask,
|  | char * | Gateway
| ) |

| Definition at line 1210 of file TCPIP.C.

int Get_SNMP_Data | ( | unsigned char | which,
|  | void ** | snmp_mib_ptr
| ) |

| Definition at line 983 of file TCPIP.C. References API_SNMP_GET, and TCPIPVECT.

int get_socketerror | ( | int | sd | ) |

| Definition at line 586 of file TCPIP.C. References API_GET_SOCKETERROR, and TCPIPVECT.

unsigned char Get_TCP_Socket_State | ( | unsigned int | localPort,
|  | unsigned long * | remoteIP,
|  | unsigned int * | remotePort
| ) |

| Definition at line 568 of file TCPIP.C. References API_GET_TCP_STATE, and TCPIPVECT.

void Get_TCPIP_Memory_Status | ( | unsigned long * | total,
|  | unsigned long * | used
| ) |

| Definition at line 1327 of file TCPIP.C. References GET_MEMORY_INFO, and TCPIPVECT.

void Get_TCPIP_Statistics | ( | Packet_Count ** | Packet_Count_Pointer | ) |

| Definition at line 1261 of file TCPIP.C. References TCPIP_STATISTICS, and TCPIPVECT.

int Get_Telnet_Login_Counters | ( | unsigned long ** | Telnet_Login_Count,
|  | unsigned long ** | Telnet_Login_failCount
| ) |

| Definition at line 1028 of file TCPIP.C. References API_TELNET_GET_LOGIN, and TCPIPVECT.

int Get_Telnet_State | ( | int * | error | ) |

| Definition at line 1119 of file TCPIP.C. References API_GET_TELNET_STATE, and TCPIPVECT.

unsigned Get_TelnetServer_Idle_Timeout | ( | void |  | ) |

| Definition at line 1103 of file TCPIP.C. References SET_SERVER_IDLE_TIMEOUT, and TCPIPVECT.

int GetDefaultGateway | ( | unsigned long * | Gateway,
|  | int * | errorcode
| ) |

| Definition at line 1381 of file TCPIP.C. References GET_DEFAULT_GATEWAY, and TCPIPVECT.

int getsockopt | ( | int | sd,
|  | GetSocketOption * | sockoptptr,
|  | int * | error
| ) |

| Definition at line 645 of file TCPIP.C. References API_GETSOCKOPT, and TCPIPVECT.

int GetWaitingBytes | ( | int | sd,
|  | int * | error
| ) |

| Definition at line 280 of file TCPIP.C. References API_ERROR, API_GETRCV_BYTES, and TCPIPVECT. Referenced by ftp_recv_msg().

unsigned int htons | ( | unsigned int | value | ) |

| Definition at line 300 of file TCPIP.C. Referenced by ftp_connect(), gethostbyname(), and tcp_connect().

int inet_addr | ( | char * | IPAddressStringPtr,
|  | unsigned long * | IPAddress
| ) |

| Definition at line 336 of file TCPIP.C. References API_INETADDR, and TCPIPVECT. Referenced by ftp_connect(), ftp_open(), gethostbyname(), http_connect(), http_get(), and tcp_connect().

int InetToAscii | ( | unsigned long * | IPAddress,
|  | char * | IPAddressStringPtr
| ) |

| Definition at line 353 of file TCPIP.C. References API_INETTOASCII, and TCPIPVECT. Referenced by gethostbyname().

int IPMulticast_to_MacAddr | ( | unsigned long * | MulticastIP,
|  | unsigned char * | MacAddress,
|  | int * | errorcode
| ) |

| Definition at line 1479 of file TCPIP.C. References MCASTIP_TO_MACADDR, and TCPIPVECT.

int listen | ( | int | sd,
|  | int | backlog,
|  | int * | error
| ) |

| Definition at line 314 of file TCPIP.C. References API_ERROR, API_LISTEN, and TCPIPVECT.

int opensocket | ( | unsigned char | type,
|  | int * | error
| ) |

| Definition at line 690 of file TCPIP.C. References API_ERROR, API_OPENSOCKET, and TCPIPVECT. Referenced by ftp_connect(), gethostbyname(), and tcp_connect().

int Ping_Close | ( | int | sd | ) |

| Definition at line 1296 of file TCPIP.C. References PING_CLOSE, and TCPIPVECT.

int Ping_Open | ( | Ping * | pingptr,
|  | int * | errorcode
| ) |

| Definition at line 1277 of file TCPIP.C. References PING_OPEN, and TCPIPVECT.

int Ping_Statistics | ( | Ping * | pingptr | ) |

| Definition at line 1309 of file TCPIP.C. References PING_STATISTICS, and TCPIPVECT.

int PPP_Client_Close | ( | int * | error | ) |

| Definition at line 785 of file TCPIP.C. References PPPCLIENT_CLOSE, and TCPIPVECT.

int PPP_Client_Get_DNSIP | ( | unsigned long * | IPaddress,
|  | int | primary_sec,
|  | int * | error
| ) |

| Definition at line 844 of file TCPIP.C. References PPPCLIE_GET_DNSIP, and TCPIPVECT.

int PPP_Client_GetStatus | ( | int * | error | ) |

| Definition at line 805 of file TCPIP.C. References PPPCLIENT_GET_STATUS, and TCPIPVECT.

int PPP_Client_Installed | ( | void |  | ) |

| Definition at line 742 of file TCPIP.C. References PPPCLIENT_INSTALLED, and TCPIPVECT.

int PPP_Client_Open | ( | PPPClient_Init * | ptr,
|  | int * | error
| ) |

| Definition at line 758 of file TCPIP.C. References PPPCLIENT_OPEN, and TCPIPVECT.

int PPP_Client_SetOptions | ( | PPP_Option * | ptr | ) |

| Definition at line 825 of file TCPIP.C. References PPPCLIENT_SET_OPTIONS, and TCPIPVECT.

int PPP_Server_Activate | ( | int | timeoutsecs,
|  | int * | error
| ) |

| Definition at line 906 of file TCPIP.C. References PPPSERVER_ACTIVATE, and TCPIPVECT.

int PPP_Server_Get_Cfg | ( | PPP_IPCfg_Data * | ptr,
|  | int * | error
| ) |

| Definition at line 926 of file TCPIP.C. References PPPSERVER_GET_CFG, and TCPIPVECT.

int PPP_Server_GetStatus | ( | void |  | ) |

| Definition at line 948 of file TCPIP.C. References PPPSERVER_GET_STATUS, and TCPIPVECT.

int PPP_Server_Installed | ( | void |  | ) |

| Definition at line 871 of file TCPIP.C. References PPPSERVER_INSTALLED, and TCPIPVECT.

int PPP_Server_SetOptions | ( | PPP_Option * | ptr | ) |

| Definition at line 964 of file TCPIP.C. References PPPSERVER_SET_OPTIONS, and TCPIPVECT.

int PPP_Server_Suspend | ( | int | timeoutsecs,
|  | int * | error
| ) |

| Definition at line 885 of file TCPIP.C. References PPPSERVER_SUSPEND, and TCPIPVECT.

int Reconfigure_ethernet | ( | void |  | ) |

| Definition at line 1154 of file TCPIP.C. References REINIT_ETHERNET, and TCPIPVECT.

int recv | ( | int | sd,
|  | char * | bufptr,
|  | int | bufLen,
|  | int | flags,
|  | unsigned long | timeout,
|  | int * | error
| ) |

| Definition at line 407 of file TCPIP.C. References API_ERROR, API_RECV, recv_params::bufferLength, recv_params::bufferPtr, recv_params::flags, recv_params::fromlengthPtr, recv_params::fromPtr, TCPIPVECT, and recv_params::timeout. Referenced by ftp_recv(), ftp_recv_msg(), getMetaData(), http_get(), and sockgets().

int recvfrom | ( | int | sd,
|  | char * | bufptr,
|  | int | bufLen,
|  | int | flags,
|  | unsigned long | timeout,
|  | struct sockaddr * | fromPtr,
|  | int * | error
| ) |

| Definition at line 371 of file TCPIP.C. References API_ERROR, API_RECVFROM, recv_params::bufferLength, recv_params::bufferPtr, recv_params::flags, recv_params::fromlengthPtr, recv_params::fromPtr, TCPIPVECT, and recv_params::timeout. Referenced by gethostbyname().

int RegisterCallbackFunction | ( | int | sd,
|  | void * | funcptr,
|  | int | eventflagmask,
|  | int * | error
| ) |

| Definition at line 715 of file TCPIP.C. References API_REGISTERCALLBACK, and TCPIPVECT.

int ResetConnection | ( | int | sd,
|  | int * | error
| ) |

| Definition at line 440 of file TCPIP.C. References API_ERROR, API_RESETCONNECTION, and TCPIPVECT.

int send | ( | int | sd,
|  | char * | bufptr,
|  | int | bufLen,
|  | int | flags,
|  | int * | error
| ) |

| Definition at line 494 of file TCPIP.C. References API_ERROR, API_SEND, send_params::bufferLength, send_params::bufferPtr, send_params::flags, TCPIPVECT, send_params::tolengthPtr, and send_params::toPtr. Referenced by ftp_send(), http_get(), and sockputs().

int sendto | ( | int | sd,
|  | char * | bufptr,
|  | int | bufLen,
|  | int | flags,
|  | const struct sockaddr * | toPtr,
|  | int * | error
| ) |

| Definition at line 459 of file TCPIP.C. References API_ERROR, API_SENDTO, send_params::bufferLength, send_params::bufferPtr, send_params::flags, TCPIPVECT, send_params::tolengthPtr, and send_params::toPtr. Referenced by gethostbyname().

int Set_Blocking_Mode | ( | int | sd,
|  | unsigned char | mode,
|  | int * | error
| ) |

| Definition at line 669 of file TCPIP.C. References API_SETBLOCKINGMODE, and TCPIPVECT.

int Set_FTPServer_Idle_Timeout | ( | unsigned | timeout | ) |

| Definition at line 1052 of file TCPIP.C. References SET_SERVER_IDLE_TIMEOUT, and TCPIPVECT.

int Set_IP_Type_Of_Service | ( | int | sd,
|  | unsigned char | TOS,
|  | int * | error
| ) |

| Definition at line 602 of file TCPIP.C. References API_SETIPTOS, and TCPIPVECT.

void Set_IPConfig | ( | char * | IP,
|  | char * | Mask,
|  | char * | Gateway
| ) |

| Definition at line 1236 of file TCPIP.C.

int Set_TelnetServer_Idle_Timeout | ( | unsigned | timeout | ) |

| Definition at line 1069 of file TCPIP.C. References SET_SERVER_IDLE_TIMEOUT, and TCPIPVECT.

int setlinger | ( | int | sd,
|  | int | seconds,
|  | int * | error
| ) |

| Definition at line 524 of file TCPIP.C. References API_ERROR, API_SETLINGER, and TCPIPVECT.

int setreuse | ( | int | sd,
|  | int * | error
| ) |

| Definition at line 545 of file TCPIP.C. References API_ERROR, API_SETREUSE, and TCPIPVECT.

int setsockopt | ( | int | sd,
|  | SetSocketOption * | sockoptptr,
|  | int * | error
| ) |

| Definition at line 625 of file TCPIP.C. References API_SETSOCKOPT, and TCPIPVECT. Referenced by http_get().

int tcp_connect | ( | char * | DestIPStr,
|  | unsigned int | ClientPort,
|  | unsigned int | HostPort,
|  | int * | error
| ) |

| Definition at line 113 of file TCPIP.C. References bind(), closesocket(), connect(), htons(), inet_addr(), opensocket(), PF_INET, in_addr::s_addr, sockaddr_in::sin_addr, sockaddr_in::sin_family, sockaddr_in::sin_port, and SOCK_STREAM. Referenced by http_connect(), and http_get().