Does the compile fail with the latest development version?
You seem to have missed the point in my reply - YOU are going to have to do
the work. I'll help with ideas, finding things, etc. but the work of
figuring out what's wrong and fixing it is in your lap.
Thought -- look at /usr/include/sys/proc.h at lines 203 and 212 and see
what's on the line BEFORE them. That could be what's missing...
As to dear old gethostbyaddr_r...
In Linux, it's defined
extern int gethostbyaddr_r (__const void *__restrict __addr, __socklen_t
__len,
int __type,
struct hostent *__restrict __result_buf,
char *__restrict __buf, size_t __buflen,
struct hostent **__restrict __result,
int *__restrict __h_errnop) __THROW;
vs AIX 4's:
int gethostbyadd_r(Addr, Len, Type, Htent, Ht_data)
const char *Addr, size_t Len, int Type, struct hostent *Htent, struct
hostent_data *Ht_data;
So I'm guessing you'll have to create an AIX-unique call. This isn't the
first time, see what's in address.c:
#ifdef HAVE_GETIPNODEBYADDR
hp = getipnodebyaddr((const void*)&theAddr,
sizeof(struct in_addr), AF_INET,
&error_num);
#else /* default */
#if defined(HAVE_GETHOSTBYADDR_R) && !defined(linux)
/* Linux seems to ha some problems with gethostbyaddr_r */
#ifdef __sun
hp = gethostbyaddr_r((const char*)&theAddr, sizeof(struct in_addr),
AF_INET, &_hp, buffer,
sizeof(buffer), &h_errnop);
#else
hp = gethostbyaddr_r((const char*)&theAddr, sizeof(struct in_addr),
AF_INET,
&_hp, buffer, sizeof(buffer), &__hp, &h_errnop);
#endif
#else
hp = (struct hostent*)gethostbyaddr((char*)&theAddr, sizeof(struct
in_addr), AF_INET);
#endif
#endif
We should also discuss this in ntop-dev (i.e. I do read it, you don't need
to copy me privately), especially because others might have good ideas along
the way.
Let's just use some kind of flag in the subject, e.g. AIX4. And let's try
to keep one problem per message - so we have
AIX4 - gethostbyaddr_r
and
AIX4 - compile error in proc.h
running...
What do you think?
-----Burton
-----Original Message-----
From: Jim Lane [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 02, 2003 12:15 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [Ntop-dev] error compiling NTOP 2.1.3 on AIX 4.3.3
Burton: please find attached a copy of the man page for the AIX
version of gethostbyaddr_r. as far as the first error is concerned
the 2 types "crid_t" and "class_id_t" are #defined in
/usr/include/sys/types.h.
Jim Lane
Sr. Technical Consultant
Network Services
Toronto Hydro
office: (416)-542-2820
cell: (416)-896-8576
>>> [EMAIL PROTECTED] 02-Jan-03 12:25:16 PM >>>
Using AIX ... that's what's wrong.
Although there is some coding for AIX 4, I'm not aware of anyone using
ntop
on it, post v1.3. I've asked and nobody has ever come back saying they
were
trying to use AIX 4. Means that what's there is probably broken...
There
are, IIRC one or two AIX 5 people.
If you're willing to do the work, I'll help you get fixes in, with
some
caveats...
1. I Don't have access to an AIX box, so it's going to be you fixing
things,
sending me patches to include. I'll make suggestions, etc. but you're
going
to have to do the research and legwork.
2. Understand that it ultimately may never work or have issues (e.g.
HPUX
10.20 runs ntop, but not multi-threaded).
3. It will have to be in the development versions, that is 2.1.54...
I'm
not going to backport or maintain 2.1.3...
As a guess:
/usr/include/sys/proc.h:203: parse error before `crid_t'
/usr/include/sys/proc.h:203: warning: no semicolon at end of struct or
union
/usr/include/sys/proc.h:212: parse error before `p_class'
/usr/include/sys/proc.h:212: warning: data definition has no type or
storage class
/usr/include/sys/proc.h:355: parse error before `}'
Sounds like some kind of issue in the AIX library... it's often is
missing
(OS unique) include that has the definitions for the key structures.
Grep
in the library for crid_t and p_class, to fing out where they're
defined and
add the #include
address.c: In function `resolveAddress':
address.c:215: warning: passing arg 1 of `gethostbyaddr_r' discards
qualifiers from pointer target type
address.c:215: warning: passing arg 5 of `gethostbyaddr_r' from
incompatible pointer type
address.c:215: too many arguments to function `gethostbyaddr_r'
address.c:215: warning: assignment makes pointer from integer without
a
cast
Sounds like AIX's gethostbyaddr_r is different than others - need to
compare
man pages and fixup a wrapper or something.
-----Burton
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf
Of Jim Lane
Sent: Thursday, January 02, 2003 10:16 AM
To: [EMAIL PROTECTED]
Subject: [Ntop-dev] error compiling NTOP 2.1.3 on AIX 4.3.3
Hi, All
i'm having a problem trying to compile ntop 2.1.3 on AIX 4.3.3. when i
run a make i get errors as follows:
make all-recursive
Making all in .
source='address.c' object='address.lo' libtool=yes
depfile='.deps/address.Plo' tmpdepfile='.deps/address.TPlo'
depmode=gcc
/bin/sh ./depcomp /bin/sh ./libtool --mode=compile gcc
-DHAVE_CONFIG_H
-I. -I. -I. -I. -I/usr/local/include
-I/home/lanej/ntop-2.1.3/gdchart0.94c -g -O2 -pipe -c -o address.lo
`test -f 'address.c' || echo './'`address.c
gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -I/usr/local/include
-I/home/lanej/ntop-2.1.3/gdchart0.94c -g -O2 -pipe -c address.c
-Wp,-MD,.deps/address.TPlo -DPIC -o address.lo
In file included from ntop.h:376,
from address.c:21:
/usr/include/pthread.h:35: warning: `_THREAD_SAFE' redefined
ntop.h:175: warning: this is the location of the previous definition
In file included from /usr/include/sys/pri.h:29,
from /usr/include/sys/sched.h:38,
from /usr/include/sched.h:52,
from ntop.h:359,
from address.c:21:
/usr/include/sys/proc.h:203: parse error before `crid_t'
/usr/include/sys/proc.h:203: warning: no semicolon at end of struct or
union
/usr/include/sys/proc.h:212: parse error before `p_class'
/usr/include/sys/proc.h:212: warning: data definition has no type or
storage class
/usr/include/sys/proc.h:355: parse error before `}'
address.c: In function `resolveAddress':
address.c:215: warning: passing arg 1 of `gethostbyaddr_r' discards
qualifiers from pointer target type
address.c:215: warning: passing arg 5 of `gethostbyaddr_r' from
incompatible pointer type
address.c:215: too many arguments to function `gethostbyaddr_r'
address.c:215: warning: assignment makes pointer from integer without
a
cast
make: 1254-004 The error code from the last command is 1.
Stop.
make: 1254-004 The error code from the last command is 1.
Stop.
make: 1254-004 The error code from the last command is 2.
Stop.
can anybody suggest what i may be doing wrong here.
TIA
Jim Lane
Sr. Technical Consultant
Network Services
Toronto Hydro
office: (416)-542-2820
cell: (416)-896-8576
_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev
_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev
_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop-dev