Folks,

I wrote the author of tcptraceroute.  Since that dialog is relevant
to the discussion I'm adding it this thread.  It appears he'll have
a beta version correcting the current problems in the near future.

--Joel

---start of forwarded message---

From: Michael C. Toren <[EMAIL PROTECTED]>
Date: Tue, 25 Mar 2003 17:31:24 -0500
To: "Joel L. Breazeale" <[EMAIL PROTECTED]>
Subject: Re: tcptraceroute

> I've been unofficially (only a personal project) trying to get a version
> of tcptraceroute under Fink (see http://fink.sourceforge.net) to compile
> on MacOS X.  I've been pretty successful, but I think it boils down to this,
> that tcptraceroute was written against an older version of libnet and it 
> needs some updating.

Yes, you are correct.  When tcptraceroute was written libnet-1.0 was the
current version, however since that time libnet-1.1 was released, which
broke the old API.  I have received patches from other developers to correct
the problem, but have not yet had time to review and apply them.  I hope to
do so in the next few weeks.  If you'd like to subscribe to the low-volume
tcptraceroute-dev mailing list, you'll receive a copy of the announcement I
make when a new beta is available for testing.

Thanks,
-mct

---end of forwarded message---


> I decided to remove the suppression of warnings.  Here is the result:
> 
>    # make
>    gcc -O2 -Wall `libnet-config --defines` \
>            -o tcptraceroute tcptraceroute.c \
>            -I/sw/include -L/sw/lib \
>            `libnet-config --libs` -lpcap
>    tcptraceroute.c: In function `iptohost':
>    tcptraceroute.c:387: warning: implicit declaration of function 
> `libnet_host_lookup'
>    tcptraceroute.c:387: warning: return makes pointer from integer without a cast
>    tcptraceroute.c: In function `defaults':
>    tcptraceroute.c:658: warning: implicit declaration of function 
> `libnet_name_resolve'
>    tcptraceroute.c:742: warning: implicit declaration of function 
> `libnet_open_raw_sock'
>    tcptraceroute.c: In function `probe':
>    tcptraceroute.c:855: warning: passing arg 1 of `libnet_write_raw_ipv4' makes 
> pointer from integer without a cast
>    ld: Undefined symbols:
>    _libnet_host_lookup
>    _libnet_name_resolve
>    _libnet_open_raw_sock
>    make: *** [tcptraceroute] Error 1
>    # 
> 
> Proceeding from here could be a bit challenging.  If anyone has suggestions I would 
> be
> glad to hear them.  Here are the changes I made in diff -e format:
> 
> # diff -e tcptraceroute.c.20030323  tcptraceroute.c 
> 1128a
>         char ebuf[FILENAME_MAX];
> 
>         l=libnet_init(LIBNET_RAW4, NULL, ebuf);
> .
> 836c
>         libnet_do_checksum(l, buf, IPPROTO_TCP, LIBNET_TCP_H + o_pktlen);
> .
> 834c
>                 l,
>                 0);
> .
> 831a
>                 0,
> .
> 830a
>                 0,
> .
> 822c
>                 l,
>                 0);
> .
> 817a
>                 0,
> .
> 762,763c
>                 "(tcp and src host %s and src port %d and dst host %s and dst port 
> %d) or ((icmp[0] == 11 or icmp[0] == 3) and dst host %s)",
> .
> 730c
>         libnet_seed_prand(l);
> .
> 220,223c
>     fatal("Usage: %s [-nFE] [-i <interface>] [-f <first ttl>] [-l <packet length>] 
> [-q <number of queries>] [-t <tos>] [-m <max ttl>] [-[pP] <source port>] [-s <source 
> address>] [-w <wait time>] <host> [destination port] [packet length]\n\n", name);
> .
> 167a
> libnet_t *l;
> 
> .
> 118a
> #define LIBNET_IP_H LIBNET_IPV4_H
> #define LIBNET_ICMP_H LIBNET_ICMPV4_H
> #define PRu16 LIBNET_PRu16
> #define PRu32 LIBNET_PRu32
> #define libnet_build_ip libnet_build_ipv4
> #define libnet_write_ip libnet_write_raw_ipv4
> #define libnet_icmp_hdr libnet_icmpv4_hdr
> #define libnet_ip_hdr   libnet_ipv4_hdr
> 
> .
> 116a
> #include <libnet/libnet-headers.h>
> #include <libnet/libnet-functions.h>
> .
> # 
> 
> --Joel
> 
> 
> > The warnings at lines 231 affected the line numbers listed for the errors.
> > I also came up with #defines to resolve the rest.  I'm down to this:
> > 
> >    # make       
> >    gcc -O2 -Wall `libnet-config --defines` \
> >            -o tcptraceroute tcptraceroute.c \
> >            -I/sw/include -L/sw/lib \
> >            `libnet-config --libs` -lpcap -w
> >    ld: Undefined symbols:
> >    _libnet_host_lookup
> >    _libnet_name_resolve
> >    _libnet_open_raw_sock
> >    make: *** [tcptraceroute] Error 1
> >    # 
> > 
> > It's time to quit for the evening.  If anyone would like details on what
> > I did I'll send out diff -e output (or whatever folks suggest) against the
> > original source.
> > 
> > --Joel
> > 
> > 
> > > Here's a followup on my earlier message...
> > > 
> > > I have gotten rid of the compilation errors and now turn to what remains.
> > > [I must stress I made some guesses and it isn't clear that even if I can
> > > get past the remaining issues that the result will be working code.] 
> > > 
> > > Here's what I'm seeing in terms of errors (at least this is what gcc is
> > > saying after suppressing warnings):
> > > 
> > >    # make
> > >    gcc -O2 -Wall `libnet-config --defines` \
> > >            -o tcptraceroute tcptraceroute.c \
> > >            -I /sw/include -L /sw/lib \
> > >            `libnet-config --libs` -lpcap -w
> > >    tcptraceroute.c:231: warning: ANSI C forbids newline in string constant
> > >    tcptraceroute.c:773: warning: ANSI C forbids newline in string constant
> > >    tcptraceroute.c: In function `capture':
> > >    tcptraceroute.c:972: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:983: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:984: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:986: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:1009: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:1016: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:1029: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:1033: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:1075: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:1080: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:1082: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:1090: dereferencing pointer to incomplete type
> > >    tcptraceroute.c:1110: dereferencing pointer to incomplete type
> > >    make: *** [tcptraceroute] Error 1
> > >    # 
> > > 
> > > I've hit a roadblock with the "dereferencing pointer to incomplete type" errors 
> > > above
> > > The rub is if I look at line 972 I don't see anything clearly applicable to the 
> > > error.
> > > For example, the error at line 1082 is a blank line.  The warnings for line 231 
> > > and 773
> > > are contextually correct -- see what the warning is citing.
> > > 
> > > I'm using the December 2002 Developer Tools should anyone wish to know.  The gcc 
> > > version
> > > is "gcc (GCC) 3.1 20020420 (prerelease)".
> > > 
> > > Anyone able to help me either make the error line number be correct for the 
> > > errors or
> > > able to give me a workaround to determine the line number?
> > > 
> > > --Joel
> > > 
> > > 
> > > > I'm an interested fink user who would like to see tcptraceroute compile 
> > > > successfully.  I also
> > > > happen to be a software developer professionally.  I've taken a look at the 
> > > > archived thread on
> > > > this subject to date and have a suggestion to fix the PRu16 error.  Add the 
> > > > #define PRu16 and
> > > > PRU32 lines below after the other two suggested #defines:
> > > > 
> > > >    #define LIBNET_IP_H LIBNET_IPV4_H
> > > >    #define LIBNET_ICMP_H LIBNET_ICMPV4_H
> > > >    #define PRu16 LIBNET_PRu16
> > > >    #define PRu32 LIBNET_PRu32
> > > > 
> > > > I also added this line after the #include for libnet.h:
> > > > 
> > > >    #include <libnet/libnet-headers.h> 
> > > > 
> > > > The following are the errors I'm seeing:
> > > > 
> > > >    [src/tcptraceroute-1.2-3/tcptraceroute-1.2] # make
> > > >    gcc -O2 -Wall `libnet-config --defines` \
> > > >            -o tcptraceroute tcptraceroute.c \
> > > >            -I /sw/include \
> > > >            `libnet-config --libs` -lpcap
> > > >    tcptraceroute.c:226: warning: ANSI C forbids newline in string constant
> > > >    tcptraceroute.c:768: warning: ANSI C forbids newline in string constant
> > > >    tcptraceroute.c:229:1: warning: multi-line string literals are deprecated
> > > >    tcptraceroute.c: In function `iptohost':
> > > >    tcptraceroute.c:386: warning: implicit declaration of function 
> > > > `libnet_host_lookup'
> > > >    tcptraceroute.c:386: warning: return makes pointer from integer without a 
> > > > cast
> > > >    tcptraceroute.c: In function `defaults':
> > > >    tcptraceroute.c:657: warning: implicit declaration of function 
> > > > `libnet_name_resolve'
> > > >    tcptraceroute.c:739: too few arguments to function `libnet_seed_prand'
> > > >    tcptraceroute.c:741: warning: implicit declaration of function 
> > > > `libnet_open_raw_sock'
> > > >    tcptraceroute.c:772:1: warning: multi-line string literals are deprecated
> > > >    tcptraceroute.c: In function `probe':
> > > >    tcptraceroute.c:821: warning: implicit declaration of function 
> > > > `libnet_build_ip'
> > > >    tcptraceroute.c:844: warning: passing arg 8 of `libnet_build_tcp' makes 
> > > > integer from pointer without a cast
> > > >    tcptraceroute.c:844: too few arguments to function `libnet_build_tcp'
> > > >    tcptraceroute.c:846: warning: passing arg 1 of `libnet_do_checksum' from 
> > > > incompatible pointer type
> > > >    tcptraceroute.c:846: warning: passing arg 2 of `libnet_do_checksum' makes 
> > > > pointer from integer without a cast
> > > >    tcptraceroute.c:846: too few arguments to function `libnet_do_checksum'
> > > >    tcptraceroute.c:851: warning: implicit declaration of function 
> > > > `libnet_write_ip'
> > > >    tcptraceroute.c: In function `capture':
> > > >    tcptraceroute.c:962: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:973: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:974: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:976: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:999: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:1006: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:1019: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:1023: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:1065: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:1070: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:1072: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:1080: dereferencing pointer to incomplete type
> > > >    tcptraceroute.c:1100: dereferencing pointer to incomplete type
> > > >    make: *** [tcptraceroute] Error 1
> > > >    [src/tcptraceroute-1.2-3/tcptraceroute-1.2] # 
> > > > 
> > > > My largest concern at this point are the "too few arguments" errors.  I'll 
> > > > look into them and see what I
> > > > can suggest.
> > > > 
> > > > --Joel
> > > > 
> > > > On Tuesday, January 28, 2003, at 04:36 PM, Jeremy Higgs wrote:
> > > > >  Hmmm... OK. Now I've added the include line for libnet/libnet-headers.h  
> > > > > and the defines lines you
> > > > > mentioned, but I get this (notice the define  errors have gone):
> > > > >  
> > > > >  patch -p1 </sw/fink/dists/local/main/finkinfo/tcptraceroute-1.4-1.patch
> > > > >  patching file tcptraceroute.c
> > > > >  echo "No configure script."
> > > > >  No configure script.
> > > > >  # (cc -Wall -I/sw/include `libnet-config --defines` -o tcptraceroute  
> > > > > tcptraceroute.c `libnet-config
> > > > > --libs` -L/sw/lib -lpcap)
> > > > >   make tcptraceroute CFLAGS=-I/sw/include
> > > > >  gcc -I/sw/include `libnet-config --defines` \
> > > > >          -o tcptraceroute tcptraceroute.c \
> > > > >          `libnet-config --libs` -lpcap
> > > > >  tcptraceroute.c:397: warning: ANSI C forbids newline in string constant
> > > > >  tcptraceroute.c:1188: warning: ANSI C forbids newline in string constant
> > > > >  tcptraceroute.c:400:1: warning: multi-line string literals are  deprecated
> > > > >  tcptraceroute.c: In function `iptohost':
> > > > >  tcptraceroute.c:602: warning: return makes pointer from integer without  a 
> > > > > cast
> > > > >  tcptraceroute.c: In function `allocateid':
> > > > >  tcptraceroute.c:891: `PRu16' undeclared (first use in this function)
> > > > >  tcptraceroute.c:891: (Each undeclared identifier is reported only once
> > > > >  tcptraceroute.c:891: for each function it appears in.)
> > > > >  tcptraceroute.c: In function `defaults':
> > > > >  tcptraceroute.c:1151: too few arguments to function `libnet_seed_prand'
> > > > >  tcptraceroute.c:1193:1: warning: multi-line string literals are  deprecated
> > > > >  tcptraceroute.c: In function `probe':
> > > > >  tcptraceroute.c:1306: warning: passing arg 8 of `libnet_build_tcp'  makes 
> > > > > integer from pointer without a
> > > > > cast
> > > > >  tcptraceroute.c:1306: too few arguments to function `libnet_build_tcp'
> > > > >  tcptraceroute.c:1308: warning: passing arg 1 of `libnet_do_checksum'  from 
> > > > > incompatible pointer type
> > > > >  tcptraceroute.c:1308: warning: passing arg 2 of `libnet_do_checksum'  makes 
> > > > > pointer from integer without
> > > > > a cast
> > > > >  tcptraceroute.c:1308: too few arguments to function `libnet_do_checksum'
> > > > >  tcptraceroute.c: In function `capture':
> > > > >  tcptraceroute.c:1429: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1435: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1441: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1444: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1454: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1492: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1498: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1504: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1507: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1511: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1514: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1519: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1526: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1540: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1544: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1585: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1589: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1594: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1597: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1602: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1603: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1606: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1614: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1618: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1621: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1634: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1635: dereferencing pointer to incomplete type
> > > > >  tcptraceroute.c:1678: dereferencing pointer to incomplete type
> > > > >  make: *** [tcptraceroute] Error 1
> > > > >  ### execution of  failed, exit code 2
> > > > >  Failed: compiling tcptraceroute-1.4-1 failed
> > > > >  
> > > > >  But it's still essentially the same error.
> > > > >  
> > > > >  Any ideas?
> > > > >  
> > > > >  Thanks a lot!
> > > > >  
> > > > > On Tuesday, January 28, 2003, at 05:51 PM, Carsten Klapp wrote:
> > > > > > 
> > > > > > 
> > > > > >Hi Jeremy,
> > > > > > Nevermind my previous answer... I just noticed  
> > > > > > /sw/include/libnet/libnet-headers.h declares specifically
> > > > > >LIBNET_IPV4_H and LIBNET_ICMPV4_H instead of LIBNET_IP_H and  LIBNET_ICMP_H.
> > > > > > 
> > > > > > Try patching in this at some point in the code after the "#include  
> > > > > > <libnet/libnet-headers.h>" line:
> > > > > > #define LIBNET_IP_H LIBNET_IPV4_H
> > > > > > #define LIBNET_ICMP_H LIBNET_ICMPV4_H
> > > > > > 
> > > > > > The other errors should probably go away then too. As for the "PRu16"  
> > > > > > error I have no clue, sorry.
> > > > > > Carsten
> > > > 
> > > > 
> > > > -------------------------------------------------------
> > > > This SF.net email is sponsored by:Crypto Challenge is now open! 
> > > > Get cracking and register here for some mind boggling fun and 
> > > > the chance of winning an Apple iPod:
> > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
> > > > _______________________________________________
> > > > Fink-devel mailing list
> > > > [EMAIL PROTECTED]
> > > > https://lists.sourceforge.net/lists/listinfo/fink-devel
> > > > 
> > > 
> > > 
> > > 
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by:Crypto Challenge is now open! 
> > > Get cracking and register here for some mind boggling fun and 
> > > the chance of winning an Apple iPod:
> > > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
> > > _______________________________________________
> > > Fink-devel mailing list
> > > [EMAIL PROTECTED]
> > > https://lists.sourceforge.net/lists/listinfo/fink-devel
> > > 
> > 
> > 
> > 
> > -------------------------------------------------------
> > This SF.net email is sponsored by:Crypto Challenge is now open! 
> > Get cracking and register here for some mind boggling fun and 
> > the chance of winning an Apple iPod:
> > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
> > _______________________________________________
> > Fink-devel mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/fink-devel
> > 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Fink-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/fink-devel
> 



-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Fink-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to