1
/* $Id: util.h,v 1.8 2003/08/05 03:35:12 mederchik Exp $ */
3
** Copyright (C) 2001, 2002 Meder Kydyraliev
5
** Copyright (C) 2001 Fyodor Yarochkin <fygrave@tigerteam.net>,
6
** Ofir Arkin <ofir@sys-security.com>
8
** This program is free software; you can redistribute it and/or modify
9
** it under the terms of the GNU General Public License as published by
10
** the Free Software Foundation; either version 2 of the License, or
11
** (at your option) any later version.
14
** This program is distributed in the hope that it will be useful,
15
** but WITHOUT ANY WARRANTY; without even the implied warranty of
16
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
** GNU General Public License for more details.
19
** You should have received a copy of the GNU General Public License
20
** along with this program; if not, write to the Free Software
21
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29
#define DNSREPLYSIZE sizeof(struct ip) + sizeof(struct udphdr)+sizeof(struct DNSHEADER)
30
#define TCPPACKETSIZE sizeof(struct ip) + sizeof (struct tcphdr)
31
#define SA struct sockaddr
33
#define U_SHORTMAX 65535
34
#define U_INTMAX 0xffffffffU
35
#define U_DOUBLEMAX 4294967296
42
#define TCPPACKETFLAGS TH_SYN
44
#define DNSREPLYSTRING "\003www\015securityfocus\003com"
45
#define DNSMASQUERADE "www.securityfocus.com"
46
#define DNSREPLYLEN sizeof(DNSREPLYSTRING)
49
unsigned id :16; /* query identification number */
50
#if BYTE_ORDER == BIG_ENDIAN
51
/* fields in third byte */
52
unsigned qr: 1; /* response flag */
53
unsigned opcode: 4; /* purpose of message */
54
unsigned aa: 1; /* authoritive answer */
55
unsigned tc: 1; /* truncated message */
56
unsigned rd: 1; /* recursion desired */
57
/* fields in fourth byte */
58
unsigned ra: 1; /* recursion available */
59
unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
60
unsigned ad: 1; /* authentic data from named */
61
unsigned cd: 1; /* checking disabled by resolver */
62
unsigned rcode :4; /* response code */
64
#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
65
/* fields in third byte */
66
unsigned rd :1; /* recursion desired */
67
unsigned tc :1; /* truncated message */
68
unsigned aa :1; /* authoritive answer */
69
unsigned opcode :4; /* purpose of message */
70
unsigned qr :1; /* response flag */
71
/* fields in fourth byte */
72
unsigned rcode :4; /* response code */
73
unsigned cd: 1; /* checking disabled by resolver */
74
unsigned ad: 1; /* authentic data from named */
75
unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
76
unsigned ra :1; /* recursion available */
79
unsigned qdcount :16; /* number of question entries */
80
unsigned ancount :16; /* number of answer entries */
81
unsigned nscount :16; /* number of authority entries */
82
unsigned arcount :16; /* number of resource entries */
83
u_char domainname[DNSREPLYLEN-1]; /* string www.hotmail.com */
86
u_char replyname[DNSREPLYLEN-1]; /* string www.hotmail.com */
91
struct in_addr replydata;
95
#define ICMP_UNREACH 3 /* dest unreachable, codes: */
96
#define ICMP_UNREACH_HOST 1 /* bad host */
97
#define ICMP_UNREACH_PROTOCOL 2 /* bad protocol */
98
#define ICMP_UNREACH_PORT 3 /* bad port */
99
#define ICMP_TIMXCEED 11 /* time exceeded, code: */
100
#define ICMP_TIMXCEED_INTRANS 0 /* ttl==0 in transit */
101
#define ICMP_TIMXCEED_REASS 1 /* ttl==0 in reass */
103
struct IcmpUnreachHdr {
110
#endif /* TTL_PRECALC */