Removed
Link Here
|
1 |
--- /home/krion/packetize.c Thu Apr 15 09:32:58 2004 |
2 |
+++ packetize.c Fri Mar 26 03:29:20 2004 |
3 |
@@ -1,6 +1,7 @@ |
4 |
/* packetize.c |
5 |
- * Copyright 2002-2003 Kirby Kuehl (vacuum@users.sourceforge.net) |
6 |
- * This file is part of pixilate http://winfingerprint.sourceforge.net/pixilate.php |
7 |
+ * Copyright 2002-2004 Kirby Kuehl (vacuum@users.sourceforge.net) |
8 |
+ * This file is part of pixilate |
9 |
+ * http://winfingerprint.sourceforge.net/pixilate.php |
10 |
* |
11 |
* pixilate is free software; you can redistribute it and/or modify |
12 |
* it under the terms of the GNU General Public License as published by |
13 |
@@ -66,24 +67,15 @@ |
14 |
|
15 |
icmp_header_len = LIBNET_ICMPV4_ECHO_H; |
16 |
break; |
17 |
- case 3: // icmp type 3 literal unreachable |
18 |
+ case 3: /* icmp type 3 literal unreachable */ |
19 |
icmp = libnet_build_icmpv4_unreach( |
20 |
- ICMP_UNREACH, //type |
21 |
- ICMP_UNREACH_PORT, // code |
22 |
- 0, // 0 libnet calculate checksum |
23 |
- LIBNET_IPV4_H + LIBNET_UDP_H, // original ip header id |
24 |
- IPTOS_LOWDELAY | IPTOS_THROUGHPUT, // original ip header frag info |
25 |
- pacl->id, // o IP ID |
26 |
- 0, // o frag |
27 |
- 64, // o TTL |
28 |
- IPPROTO_UDP, // o protocol |
29 |
- 0x7012, // o checksum |
30 |
- pacl->source_addr, // o source IP |
31 |
- pacl->destination_addr, // o destination IP |
32 |
- pacl->payload, // payload |
33 |
- pacl->payload_s, // payload size |
34 |
- l, // libnet handle |
35 |
- 0); //create new ptag |
36 |
+ ICMP_UNREACH, /* type */ |
37 |
+ ICMP_UNREACH_PORT, /* code */ |
38 |
+ 0, /* 0 libnet calculate checksum */ |
39 |
+ pacl->payload, /* payload */ |
40 |
+ pacl->payload_s, /* payload size */ |
41 |
+ l, /* libnet handle */ |
42 |
+ 0); /* 0 create new ptag */ |
43 |
if(icmp == -1) |
44 |
fprintf(stderr,"Unable to build icmp unreach packet :%s\n", |
45 |
libnet_geterror(l)); |
46 |
@@ -92,25 +84,16 @@ |
47 |
|
48 |
icmp_header_len = LIBNET_ICMPV4_UNREACH_H; |
49 |
break; |
50 |
- case 5: // icmp type 5 literal redirect |
51 |
+ case 5: /* icmp type 5 literal redirect */ |
52 |
icmp = libnet_build_icmpv4_redirect( |
53 |
- ICMP_REDIRECT, //type |
54 |
- ICMP_UNREACH_HOST, //code |
55 |
- 0, //0 lets libnet calculate checksum |
56 |
- pacl->gateway_addr, // gateway |
57 |
- LIBNET_TCP_H, // orig_len |
58 |
- IPTOS_LOWDELAY | IPTOS_THROUGHPUT, //original TOS |
59 |
- 111, // orig_id |
60 |
- 0, // orig_frag |
61 |
- 64, // orig_ttl |
62 |
- IPPROTO_TCP, // original protocol |
63 |
- 0, // orig_checksum shouldnt be 0 |
64 |
- pacl->source_addr, // orig_src |
65 |
- pacl->destination_addr, // orig_dst |
66 |
- pacl->payload, // payload |
67 |
- pacl->payload_s, // payload size |
68 |
- l, // libnet handle |
69 |
- 0); // create new ptag |
70 |
+ ICMP_REDIRECT, /* type */ |
71 |
+ ICMP_UNREACH_HOST, /* code */ |
72 |
+ 0, /*0 lets libnet calculate checksum */ |
73 |
+ pacl->gateway_addr, /* gateway */ |
74 |
+ pacl->payload, /* payload */ |
75 |
+ pacl->payload_s, /* payload size */ |
76 |
+ l, /* libnet handle */ |
77 |
+ 0); /* 0 create new ptag */ |
78 |
icmp_header_len = LIBNET_ICMPV4_REDIRECT_H; |
79 |
break; |
80 |
case 8: // icmp type 8 literal echo |
81 |
@@ -132,24 +115,15 @@ |
82 |
|
83 |
icmp_header_len = LIBNET_ICMPV4_ECHO_H; |
84 |
break; |
85 |
- case 11: // icmp type 11 literal time-exceeded |
86 |
+ case 11: /* icmp type 11 literal time-exceeded */ |
87 |
icmp = libnet_build_icmpv4_timeexceed( |
88 |
- ICMP_TIMXCEED, //type |
89 |
- ICMP_TIMXCEED_INTRANS, //code |
90 |
- 0, // 0 lets libnet calculate checksum |
91 |
- LIBNET_TCP_H, // original length |
92 |
- IPTOS_LOWDELAY | IPTOS_THROUGHPUT, //original TOS |
93 |
- 111, // original header id |
94 |
- 0, // original header fragmentation |
95 |
- 64, // original TTL |
96 |
- IPPROTO_TCP, // original protocol |
97 |
- 0, // original checksum (shouldnt be 0) |
98 |
- pacl->source_addr, // original source address |
99 |
- pacl->destination_addr, // original destination address |
100 |
- pacl->payload, // payload |
101 |
- pacl->payload_s, // payload size |
102 |
- l, // libnet handle |
103 |
- 0); // create new ptag |
104 |
+ ICMP_TIMXCEED, /* type */ |
105 |
+ ICMP_TIMXCEED_INTRANS, /* code */ |
106 |
+ 0, /* 0 lets libnet calculate checksum */ |
107 |
+ pacl->payload, /* payload */ |
108 |
+ pacl->payload_s, /* payload size */ |
109 |
+ l, /* libnet handle */ |
110 |
+ 0); /* create new ptag */ |
111 |
icmp_header_len = LIBNET_ICMPV4_TIMXCEED_H; |
112 |
break; |
113 |
case 13: // icmp type 13 literal timestamp-reply |
114 |
@@ -433,7 +407,8 @@ |
115 |
0 // packet id |
116 |
); |
117 |
|
118 |
- break; */ |
119 |
+ break; |
120 |
+*/ |
121 |
default: // try our best to generate "other" protocols automatically |
122 |
if(pacl->protocol == 41) |
123 |
{ |