File: portsentry.h

package info (click to toggle)
portsentry 1.2-12
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 504 kB
  • ctags: 156
  • sloc: ansic: 2,279; makefile: 199; sh: 183; perl: 94; csh: 31
file content (95 lines) | stat: -rw-r--r-- 2,876 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/************************************************************************/
/*                                                                      */
/* PortSentry								*/
/*                                                                      */
/* Created: 10-12-1997                                                  */
/* Modified: 05-23-2003                                                 */
/*                                                                      */
/* Send all changes/modifications/bugfixes to:				*/
/* craigrowland at users dot sourceforge dot net    			*/
/*                                                                      */
/*                                                                      */
/* This software is Copyright(c) 1997-2003 Craig Rowland	        */
/*                                                                      */
/* This software is covered under the Common Public License v1.0	*/
/* See the enclosed LICENSE file for more information.			*/
/* $Id: portsentry.h,v 1.32 2003/05/23 17:50:20 crowland Exp crowland $ */
/************************************************************************/




#define VERSION "1.2"

#include <stdio.h>
#include <syslog.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include <netdb.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
#include <assert.h>
#include <sys/param.h>
#include <sys/types.h>
#ifndef _LINUX_C_LIB_VERSION
#include <sys/socket.h>
#include <sys/stat.h>
#include <netinet/in.h>
#endif
#include <arpa/inet.h>

#include "portsentry_config.h"
#include "portsentry_io.h"
#include "portsentry_util.h"

#ifdef SUPPORT_STEALTH
	#ifdef LINUX
		#include "portsentry_tcpip.h"
		#include <netinet/in_systm.h>
	#endif

#define TCPPACKETLEN 80
#define UDPPACKETLEN 68
#endif /* SUPPORT_STEALTH */

#ifdef NEXT
	#include <ansi.h>
#endif

#define ERROR -1
#define TRUE 1
#define FALSE 0
#define MAXBUF 1024
/* max size of an IP address plus NULL */
#define IPMAXBUF 16
/* max sockets we can open */
#define MAXSOCKS 64

/* Really is about 1025, but we don't need the length for our purposes */
#define DNSMAXBUF 255


/* prototypes */
int PortSentryModeTCP (void);
int PortSentryModeUDP (void);
int DisposeUDP (char *, int);
int DisposeTCP (char *, int);
int CheckStateEngine (char *);
int InitConfig(void);
void Usage (void);
int SmartVerifyTCP(struct sockaddr_in, struct sockaddr_in, int);
int SmartVerifyUDP(struct sockaddr_in, struct sockaddr_in, int);

#ifdef SUPPORT_STEALTH
int PortSentryStealthModeTCP (void);
int PortSentryAdvancedStealthModeTCP (void);
int PortSentryStealthModeUDP (void);
int PortSentryAdvancedStealthModeUDP (void);
char * ReportPacketType(struct tcphdr );
int PacketReadTCP(int, struct iphdr *, struct tcphdr *);
int PacketReadUDP(int, struct iphdr *, struct udphdr *);
#endif