#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
#include <netinet/ip_icmp.h>
#define SYNSCAN 10 /* tcp stealth (syn) scanning */
#define FINSCAN 20 /* tcp fin scanning */
#define NULSCAN 30 /* tcp null scanning */
#define XMASSCAN 40 /* tcp xmas scanning */
#define SUBSCAN 50 /* tcp subscanning */
#define CONSCAN 60 /* connect scan - vanilla scan or whatever */
#define WAIT_SEC 5 /* seconds to wait for an answer */
#define WAIT_USEC 0 /* useconds nto wait for an answer */
#define OPEN 2 /* returnvalue for a open port */
#define CLOSE 3 /* returnvalue for a closed one */
struct pseudohdr { /* for creating the checksums */
unsigned long saddr;
unsigned long daddr;
char useless;
unsigned char protocol;
unsigned short length;
};
struct iptcphdr { /* read the answers header */
struct iphdr ip;
struct tcphdr tcp;
};
struct ipicmphdr { /* same here */
struct iphdr ip;
struct icmphdr icmp;
};
/*get source ip address*/
unsigned int get_sourceip(void);
/*tcp scan*/
int scantcp(u_int saddr, u_int daddr, unsigned short source,
int scanmode, int Destination, unsigned char flags, int verbose);
/*udp scan*/
int scanudp(u_int saddr, u_int daddr, unsigned short source, int Destination, int verbose);
/*connect scan*/
int conscan(u_int dest, int Destination);
/*ping host*/
int pinghost(char *ipaddr);
/*sub scan*/
void subscanscan(char *destnet, u_int saddr, unsigned short source);
#endif _LIBPORTSCAN_H