hello,
this is my define declaration
PHP Code:
#define CLEANUP_INTERVAL 1000
and this is my function body. here getting warning like this
PHP Code:
warning: comparison is always false due to limited range of data type
how can i over come this problem.
Code:
void
descry(u_char *u, struct pcap_pkthdr *phdr, u_char *packet)
{
struct libnet_ipv4_hdr *ip;
struct libnet_tcp_hdr *tcp;
struct descry_pack *gp;
struct tcp_connection *c;
struct tcp_connection *rc;
static u_char cleanup = 0;
struct timeval ts;
rc = NULL;
c = NULL;
gp = (struct descry_pack *)u;
/*
* In order to keep the trie from growing boundlessly, we need to
* periodically expire half open connections.
*/
PHP Code:
if (cleanup++ > CLEANUP_INTERVAL)
{
ts.tv_usec = phdr->ts.tv_usec;
ts.tv_sec = phdr->ts.tv_sec;
/* expire old connections */
pt_expire(gp, &ts);
cleanup = 0;
}
basically using this program i want to scan TCP ip protocal.
I need your feedback.
regards
Nasim