Fix so it compiles with new libnet.

This commit is contained in:
angelos 1999-12-17 03:43:18 +00:00
parent 597039e537
commit 4e9abdf7dc
5 changed files with 117 additions and 2 deletions

View File

@ -1,5 +1,5 @@
--- ifaddrlist.c.orig Fri Oct 16 19:50:49 1998
+++ ifaddrlist.c Sat Mar 27 13:00:14 1999
--- ifaddrlist.c.orig Fri Oct 16 13:50:49 1998
+++ ifaddrlist.c Thu Dec 16 22:18:57 1999
@@ -46,7 +46,6 @@
struct rtentry;
#endif
@ -8,3 +8,12 @@
#include <netinet/in.h>
#include <ctype.h>
@@ -223,7 +222,7 @@
{
fprintf(stdout,
"Multiple interfaces found, using %s @ %s.\n",
- host_lookup(sin->sin_addr.s_addr, fp->use_name),
+ libnet_host_lookup(sin->sin_addr.s_addr, fp->use_name),
address_list->device);
}
device = strdup(address_list->device);

View File

@ -0,0 +1,11 @@
--- firewalk.c.orig Thu Dec 16 22:18:13 1999
+++ firewalk.c Thu Dec 16 22:18:22 1999
@@ -87,7 +87,7 @@
* We want to randomize TCP SYN numbers to obfuscate NIDS
* signaturing of firewalk.
*/
- seed_prand();
+ libnet_seed_prand();
case IPPROTO_UDP:
udptcpwalk(fp);
break;

View File

@ -0,0 +1,37 @@
--- main.c.orig Thu Dec 16 22:17:28 1999
+++ main.c Thu Dec 16 22:18:02 1999
@@ -223,12 +223,12 @@
usage(argv[0]);
exit(1);
}
- else if ((fp->gateway = name_resolve(argv[optind], 1)) == -1)
+ else if ((fp->gateway = libnet_name_resolve(argv[optind], 1)) == -1)
{
fprintf(stderr, "Cannot resolve gateway IP address\n");
exit(1);
}
- else if ((fp->destination = name_resolve(argv[optind + 1], 1)) == -1)
+ else if ((fp->destination = libnet_name_resolve(argv[optind + 1], 1)) == -1)
{
fprintf(stderr, "Cannot resolve destination IP address\n");
exit(1);
@@ -242,7 +242,7 @@
/*
* Open the raw IP socket and set IPHDR_INCL.
*/
- fp->sock = open_raw_sock(IPPROTO_RAW);
+ fp->sock = libnet_open_raw_sock(IPPROTO_RAW);
if (fp->sock == -1)
{
perror("No socket");
@@ -272,8 +272,8 @@
{
fprintf(stdout,
"Firewalking through %s (towards %s) with a maximum of %d hops.\n",
- host_lookup(fp->gateway, fp->use_name),
- host_lookup(fp->destination, fp->use_name),
+ libnet_host_lookup(fp->gateway, fp->use_name),
+ libnet_host_lookup(fp->destination, fp->use_name),
MAX_HOP);
}

View File

@ -0,0 +1,12 @@
--- packet.c.orig Thu Dec 16 22:19:17 1999
+++ packet.c Thu Dec 16 22:19:28 1999
@@ -237,7 +237,8 @@
struct ip *ip_hdr;
ip_hdr = (struct ip *)(packet + fp->packet_offset);
- fprintf(stdout, "[%s]", host_lookup(ip_hdr->ip_src.s_addr, fp->use_name));
+ fprintf(stdout, "[%s]",
+ libnet_host_lookup(ip_hdr->ip_src.s_addr, fp->use_name));
}

View File

@ -0,0 +1,46 @@
--- udptcpwalk.c.orig Thu Dec 16 22:19:09 1999
+++ udptcpwalk.c Thu Dec 16 22:20:22 1999
@@ -111,7 +111,7 @@
* differentiate between probes. The TTL is bumped up so we
* can determine how many hops away the gateway is.
*/
- build_ip(t_size,
+ libnet_build_ip(t_size,
0, /* regular service */
++fp->id,
0, /* No fragmentation bits set */
@@ -125,13 +125,13 @@
if (fp->protocol == IPPROTO_UDP)
{
- build_udp(fp->sport, cport, NULL, 0, IP_H + pak_buf);
+ libnet_build_udp(fp->sport, cport, NULL, 0, IP_H + pak_buf);
}
else
{
- build_tcp(fp->sport,
+ libnet_build_tcp(fp->sport,
cport,
- get_prand(PRu32),
+ libnet_get_prand(PRu32),
0L, /* No ACK number */
TH_SYN,
1024,
@@ -140,7 +140,7 @@
0,
pak_buf + IP_H);
}
- do_checksum(pak_buf, fp->protocol, t_size);
+ libnet_do_checksum(pak_buf, fp->protocol, t_size);
for (j = 0, fp->red_flag = 0; j < fp->red_cnt; j++)
{
@@ -148,7 +148,7 @@
* Write the packet to the network.
*/
usleep(fp->write_pause);
- c = write_ip(fp->sock, pak_buf, IP_H + t_size);
+ c = libnet_write_ip(fp->sock, pak_buf, IP_H + t_size);
if (c < IP_H + t_size)
{
fprintf(stderr,