🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.linux
Article #58967

Unable to compile 'fping'

#58967
From: Brian Miller
Date: Thu, 28 Mar 1996 00:00
94 lines
4074 bytes
In a word... HELP.

I have been trying to compile both the C stuff in SATAN, and the
associated utility called 'fping' on my Linux box.

I am running "Slackware Linux 3.0.0 (ELF)" which is kernel 1.2.13
and the gcc compiler 2.7.0.

When I go to compile 'fping' with just a 'make', I get the following
error messages:

> make
cc  -c -DDEFAULT_INTERVAL=25 -DDEFAULT_TIMEOUT=2500 -DDEFAULT_RETRY=3 fping.c
fping.c: In function `send_ping':
fping.c:529: dereferencing pointer to incomplete type
fping.c:530: dereferencing pointer to incomplete type
fping.c:531: dereferencing pointer to incomplete type
fping.c:532: dereferencing pointer to incomplete type
fping.c:533: dereferencing pointer to incomplete type
fping.c:544: dereferencing pointer to incomplete type
fping.c: In function `wait_for_reply':
fping.c:591: dereferencing pointer to incomplete type
fping.c:592: `ICMP_MINLEN' undeclared (first use this function)
fping.c:592: (Each undeclared identifier is reported only once
fping.c:592: for each function it appears in.)
fping.c:597: dereferencing pointer to incomplete type
fping.c:598: dereferencing pointer to incomplete type
fping.c:605: dereferencing pointer to incomplete type
fping.c:606: dereferencing pointer to incomplete type
fping.c:615: dereferencing pointer to incomplete type
fping.c:619: dereferencing pointer to incomplete type
fping.c:620: dereferencing pointer to incomplete type
fping.c: In function `get_host_by_address':
fping.c:755: warning: return discards `const' from pointer target type
make: *** [fping.o] Error 1

The part of the code that is causing this is:

#ifdef _NO_PROTO
void send_ping(s,h)
int s; HOST_ENTRY *h;
#else
void send_ping(int s,HOST_ENTRY *h)
#endif
{
  static char buffer[32];
  struct icmp *icp = (struct icmp *) buffer;
  int n,len;

  gettimeofday(&h->last_time,&tz);

  icp->icmp_type = ICMP_ECHO;         <---- line 529
  icp->icmp_code = 0;
  icp->icmp_cksum = 0;
  icp->icmp_seq = h->i;
  icp->icmp_id = ident;ip_icmp.h


For the life of me, I just can't find where the #include file is/should
be for the structure type "icmp".

Is it something to do with the _NO_PROTO, and being POSIX or something?

I get as far as looking in /usr/include/netinet/ip_icmp.h which points
me off to "#include <linux/icmp.h>".  This has a number of #define's,
and two struct's defined in it, but no 'struct icmp'.  :-(

When trying to compile SATAN I get simular errors complaining about
a 'struct ip' type.

On my Sun here at work, I can see in /usr/include/netinet/*.h these
two structures.

I also noticed that in the SATAN code, there were constants called:
ICMP_UNREACH_HOST, but in /usr/local/include/linux/icmp.h it is:
ICMP_HOST_UNREACH.

So where am I going wrong?  I have gone as far as searching ALL *.c & 
*.h files under /usr, but to no avail.

Sorry for the extra long winded post, but I thoudgt too much detail
is better than not enough.

Thanks,

Brian
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- Brian Miller - Melbourne, Australia - brian@netboss.dn.itg.telecom.com.au -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
There's a law for the rich, and a law for the poor, and another for singers.
It's die young and live much longer, spend all your money and sit and wonder.
                                         Nobody Came - Deep Purple (Fireball)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Technical Details
Message-ID: <3159D72A.167EB0E7@netboss.dn.itg.telecom.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 102983,c613dbcc5faf5f1d,start
X-Google-Attributes: gid102983,public
From: Brian Miller <brian@netboss.dn.itg.telecom.com.au>
Subject: Unable to compile 'fping'
Date: 1996/03/28
Message-ID: <3159D72A.167EB0E7@netboss.dn.itg.telecom.com.au>
X-Deja-AN: 144564126
content-type: text/plain; charset=us-ascii
organization: Telstra (Telecom Australia)
mime-version: 1.0
newsgroups: aus.computers.linux
x-mailer: Mozilla 2.0 (X11; I; SunOS 4.1.4 sun4c)