hello,
Actually here i am trying to develop network security program. I used program such like
1. Udpguard.c 2.tcpguard.c 3. tcpg_funcs.c and 4. tcpguard.h.
But in tcpg_func.c getting these are error..........
t
Code:
cpg_funcs.c:35: error: ‘struct tcphdr’ has no member named ‘th_dport’
tcpg_funcs.c:36: error: ‘struct tcphdr’ has no member named ‘th_flags’
tcpg_funcs.c: In function ‘tcpg_oob’:
tcpg_funcs.c:45: error: ‘struct tcphdr’ has no member named ‘th_flags’
tcpg_funcs.c: In function ‘tcpg_portd’:
tcpg_funcs.c:53: error: ‘struct tcphdr’ has no member named ‘th_dport’
tcpg_funcs.c: In function ‘tcpg_queso’:
tcpg_funcs.c:59: error: ‘struct tcphdr’ has no member named ‘th_win’
tcpg_funcs.c: In function ‘tcpg_synflood’:
tcpg_funcs.c:67: error: ‘struct tcphdr’ has no member named ‘th_flags’
tcpg_funcs.c:67: error: ‘struct tcphdr’ has no member named ‘th_flags’
tcpg_funcs.c:68: error: ‘struct tcphdr’ has no member named ‘th_seq’
tcpg_funcs.c:68: error: ‘struct tcphdr’ has no member named ‘th_seq’
tcpg_funcs.c: In function ‘tcpg_syn’:
tcpg_funcs.c:77: error: ‘struct tcphdr’ has no member named ‘th_flags’
tcpg_funcs.c:77: error: ‘struct tcphdr’ has no member named ‘th_flags’
tcpg_funcs.c:78: error: ‘struct tcphdr’ has no member named ‘th_sport’
tcpg_funcs.c:78: error: ‘struct tcphdr’ has no member named ‘th_dport’
tcpg_funcs.c: In function ‘tcpg_land’:
tcpg_funcs.c:84: error: ‘struct tcphdr’ has no member named ‘th_sport’
tcpg_funcs.c:84: error: ‘struct tcphdr’ has no member named ‘th_dport’
tcpg_funcs.c: In function ‘tcpg_kill’:
tcpg_funcs.c:94: error: ‘struct tcphdr’ has no member named ‘th_dport’
tcpg_funcs.c:95: error: ‘struct tcphdr’ has no member named ‘th_sport’
tcpg_funcs.c:96: error: ‘struct tcphdr’ has no member named ‘th_dport’
tcpg_funcs.c:99: error: ‘struct tcphdr’ has no member named ‘th_seq
’
This is my all header file..............
tcpguad.c.......
Code:
/* If you want TCPguard to announce all connection attemps... */
#define TCPG_SYN
/* Log QUESO probes. */
#define TCPG_QUESO
/* SYN flooding detection. */
#define TCPG_SYNFLOOD
/* WinNuke detection. */
#define TCPG_OOB
/* Log LAND attacks. */
#define TCPG_LAND
/* Log HPing probes and port 0 connection packets. */
#define TCPG_HPING
/* Shell daemon default port probe detection. */
#define TCPG_PORTD
/* Kill connections to TCP port TCPG_KILL. */
#define TCPG_KILL 110
/* DON'T CHANGE ANYTHING BELOW THIS LINE !!!!!!!!!!!!!! */
/* DON'T CHANGE ANYTHING BELOW THIS LINE !!!!!!!!!!!!!! */
/* DON'T CHANGE ANYTHING BELOW THIS LINE !!!!!!!!!!!!!! */
/* Biggest list of includes you've ever seen, eh?! =;-) */
#include <libnet.h>
#include <syslog.h>
/* Why not make all variables global ?! */
struct ippkt {
struct iphdr ip;
struct tcphdr tcp;
char buffer[5000];
} pkt;
int s, lns;
int IP_H, TCP_H;
char VERSION;
struct in_addr src_addr;
u_char *buff;
u_int sport, dport;
void tcpg_syn();
void tcpg_hping();
void tcpg_synflood();
void tcpg_portd();
void tcpg_queso();
void tcpg_land();
void tcpg_oob();
void tcpg_die();
void tcpg_init();
void tcpg_kill(u_short);
tcpguard.c..........
Code:
#include "tcpguard.h"
udpguard.c
Code:
#include <stdlib.h>
#include <syslog.h>
#include <stdio.h>
#include <unistd.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <netinet/in.h>
#include <netinet/udp.h>
#define __FAVOR_BSD
#include <netinet/tcp.h>
#include <string.h
tcpg_funcs.c............
Code:
#include "tcpguard.h"
Actually i got those error in tcpg_funcs.c. what i did mistake here.