[Iftop-users] Porting iftop 1.0 to FreeBSD

Chris Anderson cva at pobox.com
Mon, 6 Dec 2010 01:37:55 -0800


--0016364d27978dae550496baa4b1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

sorry, forgot to mention this was FreeBSD 8.1-RELEASE.

2010/12/6 Chris Anderson <cva@pobox.com>

> I just applied the patch and now it fails to build here:
>
> if gcc -DHAVE_CONFIG_H -I. -I. -I.      -g -O2 -MT counter_hash.o -MD -MP
> -MF ".deps/counter_hash.Tpo" -c -o counter_hash.o counter_hash.c;  then m=
v
> -f ".deps/counter_hash.Tpo" ".deps/counter_hash.Po"; else rm -f
> ".deps/counter_hash.Tpo"; exit 1; fi
> counter_hash.c:6:26: error: counter_hash.h: No such file or directory
> *** Error code 1
>
>
> 2010/12/6 Fr=E9d=E9ric Perrin <frederic.perrin@resel.fr>
>
> Hello,
>>
>> Today I compiled iftop-1.0pre1 if a FreeBSD system. I had to make the
>> following changes:
>>
>> - config/int_ghba_r.c uses AF_INET, which is defined in <sys/socket.h>,
>>  without #include'ing it ;
>>
>> - add =AB #define define s6_addr32 __u6_addr.__u6_addr32 =BB in config.h
>>  (this is used in addr_hash and ns_hash.c). FreeBSD has a note in
>>  <netinet6/in6.h> saying it is not standard ;
>>
>> - in resolver.c, only the getnameinfo() method tries to resolve ip6
>>  addresses. I ported the AF guessing to the gethostbyaddr{,_r} methods,
>>  as I am not familiar with the libresolv or the ares librairies. This
>>  enables reverse ip6 resolution.
>>
>> The patch is attached. Could you please review it, and apply it if it
>> DTRT ?
>>
>> --
>> Fred
>>
>>
>

--0016364d27978dae550496baa4b1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

sorry, forgot to mention this was=A0FreeBSD 8.1-RELEASE.<br><br><div class=
=3D"gmail_quote">2010/12/6 Chris Anderson <span dir=3D"ltr">&lt;<a href=3D"=
mailto:cva@pobox.com">cva@pobox.com</a>&gt;</span><br><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex;">
I just applied the patch and now it fails to build here:<div><br></div><div=
><div>if gcc -DHAVE_CONFIG_H -I. -I. -I. =A0 =A0 =A0-g -O2 -MT counter_hash=
.o -MD -MP -MF &quot;.deps/counter_hash.Tpo&quot; -c -o counter_hash.o coun=
ter_hash.c; =A0then mv -f &quot;.deps/counter_hash.Tpo&quot; &quot;.deps/co=
unter_hash.Po&quot;; else rm -f &quot;.deps/counter_hash.Tpo&quot;; exit 1;=
 fi</div>

<div>counter_hash.c:6:26: error: counter_hash.h: No such file or directory<=
/div><div>*** Error code 1</div><div><br></div><br><div class=3D"gmail_quot=
e">2010/12/6 Fr=E9d=E9ric Perrin <span dir=3D"ltr">&lt;<a href=3D"mailto:fr=
ederic.perrin@resel.fr" target=3D"_blank">frederic.perrin@resel.fr</a>&gt;<=
/span><div>
<div></div><div class=3D"h5"><br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">Hello,<br>
<br>
Today I compiled iftop-1.0pre1 if a FreeBSD system. I had to make the<br>
following changes:<br>
<br>
- config/int_ghba_r.c uses AF_INET, which is defined in &lt;sys/socket.h&gt=
;,<br>
 =A0without #include&#39;ing it ;<br>
<br>
- add =AB #define define s6_addr32 __u6_addr.__u6_addr32 =BB in config.h<br=
>
 =A0(this is used in addr_hash and ns_hash.c). FreeBSD has a note in<br>
 =A0&lt;netinet6/in6.h&gt; saying it is not standard ;<br>
<br>
- in resolver.c, only the getnameinfo() method tries to resolve ip6<br>
 =A0addresses. I ported the AF guessing to the gethostbyaddr{,_r} methods,<=
br>
 =A0as I am not familiar with the libresolv or the ares librairies. This<br=
>
 =A0enables reverse ip6 resolution.<br>
<br>
The patch is attached. Could you please review it, and apply it if it<br>
DTRT ?<br>
<font color=3D"#888888"><br>
--<br>
Fred<br>
<br>
</font></blockquote></div></div></div><br></div>
</blockquote></div><br>

--0016364d27978dae550496baa4b1--