#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
// #include <tcp.h>
#include <dos.h>
#include "rtos.h"
#include "net.h"
char isPingSucc(DWORD dwServerIp)
{
longword timer, new_rcvd;
longword sent = 0L;
int Status;
//dwServerIp = 0xc0a80001;
outp(0xfe20,0x2101);
delay(100);
Status = inp(0xfe24);
Status = Status & 0x0024;
if(Status == 0x0)
return 0;
sent = 0x55;
if (_ping(dwServerIp ,sent,250,0,NULL))
return 0;
delay(100);
tcp_tick(NULL);
new_rcvd = 0x0;
if ((timer = _chk_ping( dwServerIp , &new_rcvd)) != 0xffffffffL)
{
if(new_rcvd == sent)
{
return 1;
}
}
return 0;
}