#4 problems with AIX port

open
ports (3)
5
2000-06-03
2000-03-10
Ben Woodard
No

From: Bernie Ledwick <bl@man.fraser-williams.com>
To: "'ben@valinux.com'" <ben@valinux.com>
Subject: npadmin on AIX
Date: Wed, 8 Mar 2000 19:03:07 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.1960.3)
Content-Type: multipart/mixed;
boundary="---- =_NextPart_000_01BF8930.F0A49760"

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------ =_NextPart_000_01BF8930.F0A49760
Content-Type: text/plain

Hi Ben,

I am attempting to compile npadmin v8.4 on AIX 4.3.2. Unfortunatle, I am
getting compile errors. Could you possibly a have a look and let me know
if there is anything I can do to get round these problems. (I have also
tried v7.2 and get similar results.)

If there is any more info you require please let me know.

Regards,

Bernie.

I am using:

AIX:
> oslevel
4.3.0.0

gcc -v
Reading specs from
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/specs
gcc version 2.95.2 19991024 (release)

c++ -v
Reading specs from
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/specs
gcc version 2.95.2 19991024 (release)

<<npout.txt>>

------ =_NextPart_000_01BF8930.F0A49760
Content-Type: text/plain;
name="npout.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="npout.txt"

c++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c npadmin.C=0A=
npadmin.C:30: warning: `MAXTHREADS' redefined=0A=
/usr/include/sys/thread.h:70: warning: this is the location of the =
previous definition=0A=
In file included from npadmin.C:7:=0A=
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/include/string.h:92=
: warning: declaration of `void * memcpy(void *, void *, long unsigned =
int)'=0A=
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/include/string.h:92=
: warning: conflicts with built-in declaration `void * memcpy(void *, =
const void *, long unsigned int)'=0A=
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/include/string.h:95=
: warning: declaration of `size_t strlen(char *)'=0A=
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/include/string.h:95=
: warning: conflicts with built-in declaration `long unsigned int =
strlen(const char *)'=0A=
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/include/string.h:12=
4: warning: declaration of `char * strcpy(char *, char *)'=0A=
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/include/string.h:12=
4: warning: conflicts with built-in declaration `char * strcpy(char *, =
const char *)'=0A=
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/include/string.h:12=
8: warning: declaration of `int memcmp(void *, void *, long unsigned =
int)'=0A=
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/include/string.h:12=
8: warning: conflicts with built-in declaration `int memcmp(const void =
*, const void *, long unsigned int)'=0A=
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/include/string.h:12=
9: warning: declaration of `int strcmp(char *, char *)'=0A=
/usr/local/lib/gcc-lib/powerpc-ibm-aix4.3.1.0/2.95.2/include/string.h:12=
9: warning: conflicts with built-in declaration `int strcmp(const char =
*, const char *)'=0A=
c++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c npahelpers.C=0A=
npahelpers.C: In function `void do_hppriv_get(SNMP_session &, long =
unsigned int *, long unsigned int &)':=0A=
npahelpers.C:123: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:126: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C: In function `void do_hppriv_set(SNMP_session &, long =
unsigned int *, long unsigned int &, char **)':=0A=
npahelpers.C:157: passing `const char *' as argument 1 of =
`OidSeq::append(char *, Tags, long int)' discards qualifiers=0A=
npahelpers.C:161: passing `const char *' as argument 1 of =
`OidSeq::append(char *, Tags, long int)' discards qualifiers=0A=
npahelpers.C:162: passing `const char *' as argument 1 of =
`OidSeq::append(char *, Tags, void *, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:162: passing `const char *' as argument 3 of =
`OidSeq::append(char *, Tags, void *, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:180: passing `const char *' as argument 1 of =
`OidSeq::append(char *, Tags, void *, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:182: passing `const char *' as argument 1 of =
`OidSeq::append(char *, Tags, void *, unsigned int)' discards =
qualifiers=0A=
npahelpers.C: In function `void do_general_get(SNMP_session &, long =
unsigned int *, long unsigned int &, char **)':=0A=
npahelpers.C:197: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:200: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:202: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:207: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:208: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:209: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:232: passing `const char *' as argument 1 of =
`SNMP_error_oid::operator =3D=3D(char *)' discards qualifiers=0A=
npahelpers.C:233: passing `const char *' as argument 1 of =
`SNMP_structFiller::remove(char *)' discards qualifiers=0A=
npahelpers.C:235: passing `const char *' as argument 1 of =
`SNMP_error_oid::operator =3D=3D(char *)' discards qualifiers=0A=
npahelpers.C:243: passing `const char *' as argument 1 of =
`SNMP_error_oid::operator =3D=3D(char *)' discards qualifiers=0A=
npahelpers.C:243: passing `const char *' as argument 1 of =
`SNMP_error_oid::operator =3D=3D(char *)' discards qualifiers=0A=
npahelpers.C:244: passing `const char *' as argument 1 of =
`SNMP_structFiller::remove(char *)' discards qualifiers=0A=
npahelpers.C:245: passing `const char *' as argument 1 of =
`SNMP_structFiller::remove(char *)' discards qualifiers=0A=
npahelpers.C:250: passing `const char *' as argument 1 of =
`SNMP_error_oid::operator =3D=3D(char *)' discards qualifiers=0A=
npahelpers.C:268: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:269: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:347: passing `const char *' as argument 1 of =
`OidSeq::value(char *)' discards qualifiers=0A=
npahelpers.C:489: passing `const char *' as argument 1 of =
`OidSeq::remove(char *)' discards qualifiers=0A=
npahelpers.C:490: passing `const char *' as argument 1 of =
`OidSeq::append(char *)' discards qualifiers=0A=
npahelpers.C:500: passing `const char *' as argument 1 of =
`OidSeq::value(char *)' discards qualifiers=0A=
npahelpers.C:513: passing `const char *' as argument 1 of =
`OidSeq::value(char *)' discards qualifiers=0A=
npahelpers.C: In function `void do_hostmib_get(SNMP_session &, long =
unsigned int *, long unsigned int &)':=0A=
npahelpers.C:713: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:716: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:727: passing `const char *' as argument 1 of =
`SNMP_error_oid::operator =3D=3D(char *)' discards qualifiers=0A=
npahelpers.C:730: passing `const char *' as argument 1 of =
`SNMP_structFiller::remove(char *)' discards qualifiers=0A=
npahelpers.C:732: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:734: passing `const char *' as argument 1 of =
`SNMP_error_oid::operator =3D=3D(char *)' discards qualifiers=0A=
npahelpers.C:735: passing `const char *' as argument 1 of =
`SNMP_structFiller::remove(char *)' discards qualifiers=0A=
npahelpers.C:764: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:766: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:768: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:770: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
npahelpers.C:772: passing `const char *' as argument 1 of =
`SNMP_structFiller::append(char *, Tags, unsigned int)' discards =
qualifiers=0A=
make: The error code from the last command is 1.=0A=
=0A=
=0A=
Stop.=0A=

------ =_NextPart_000_01BF8930.F0A49760--

Discussion

  • Ben Woodard

    Ben Woodard - 2000-06-03
    • assigned_to: nobody --> ben
     
  • Ben Woodard

    Ben Woodard - 2000-06-05

    Sent Bernie this message:

    A few months ago you emailed me telling me that you were having
    trouble getting npadmin to build on solaris and AIX. I spent a bit of
    time working with the solaris port and I believe that it should be
    working now.

    If you are still interested. Could you try building it on AIX and let
    me know what happens.

    -ben

     
  • Ben Woodard

    Ben Woodard - 2000-06-12

    From: Ewan Leith <ejl@man.fwltech.com>
    To: "'ben@valinux.com'" <ben@valinux.com>
    Subject: npadmin 0.8.7 and AIX
    Date: Wed, 7 Jun 2000 12:46:22 +0100
    MIME-Version: 1.0
    X-Mailer: Internet Mail Service (5.5.2650.21)
    Content-Type: text/plain;
    charset="iso-8859-1"
    Status: O
    Content-Length: 1274

    Hi,

    A while ago (a few months), you spoke to a colleague of mine (Bernie
    Ledwick) about npadmin on AIX. The original problem he had has been fixed
    but weve come up with a new one to entertain you.

    When compiling 0.8.7 on aix, it compiles the first several files perfectly,
    but then suddenly stops on snmpsock.C. Turning on the -Wall compiler setting
    shows the error message i've pasted at the end of this mail.

    Do you have any ideads what could be wrong? I'm able to understand parts of
    the code, but i dont see anything blatantly wrong in the section the make
    seems to fail on.

    Thanks,

    Ewan Leith

    FWL Technologies Ltd
    Tel: 0161 872 8428 Fax: 0161 872 4516
    http://www.fwltech.com/logistics
    Mailto:ejl@man.fwltech.com

    snmpsock.C: In function `void * receiver(void *)':
    snmpsock.C:78: implicit declaration of function `int bzero(...)'
    snmpsock.C:90: passing `unsigned int *' as argument 6 of `recvfrom(int, void
    *, long unsigned int, int, sockaddr *, socklen_t *)'
    snmpsock.C:67: warning: `int readcnt' might be used uninitialized in this
    function
    snmpsock.C: In method `unsigned char * SNMP_socket::call(int, int, char *,
    char *, int &)':
    snmpsock.C:162: warning: comparison between signed and unsigned
    make: The error code from the last command is 1.

    Stop.

     
  • Ben Woodard

    Ben Woodard - 2000-06-12

    > snmpsock.C: In function `void * receiver(void *)':
    > snmpsock.C:78: implicit declaration of function `int bzero(...)'

    I have to say I believe that this is a bug in your version of
    unistd.h. The macro FD_ZERO() is expanding to include bzero() but it
    has not included the hearder file needed to declare bzero(). I would
    grep /usr/include/*.h for bzero() and then include whatever header
    file bzero exists in. If that fixes it, tell me which one it is in and
    I will try to incorporate it in a platform independant way.

    > snmpsock.C:90: passing `unsigned int *' as argument 6 of `recvfrom(int, void
    > *, long unsigned int, int, sockaddr *, socklen_t *)'

    My bug. I wasn't following the latest version of the standard. Fixed.

    > snmpsock.C:67: warning: `int readcnt' might be used uninitialized in this
    > function

    Picky picky picky. ;-) I think that if I squint just right I think I
    can an sort of see why the compiler picks this up. It will never
    happen though. I reordered the code a bit to see if I can get rid of
    the warning.

    > snmpsock.C: In method `unsigned char * SNMP_socket::call(int, int, char *,
    > char *, int &)':
    > snmpsock.C:162: warning: comparison between signed and unsigned

    My bug again. Fixed.

    > make: The error code from the last command is 1.
    >
    >
    > Stop.
    >

    Let me know if this patch fixes a few of the problems (I threw in a
    couple of formatting changes just to confuse you ;-) ):

    Index: snmpsock.C

    RCS file: /cvsroot/npadmin/npadmin/snmpsock.C,v
    retrieving revision 1.9
    diff -u -r1.9 snmpsock.C
    --- snmpsock.C 2000/03/10 06:40:59 1.9
    +++ snmpsock.C 2000/06/12 16:41:50
    @@ -13,7 +13,7 @@

    #define MAXPACKSIZE 10240

    -unsigned int maxaddrlen=sizeof(sockaddr);
    +socklen_t maxaddrlen=sizeof(sockaddr);

    struct request_t{
    // int magic1;
    @@ -63,11 +63,11 @@
    // }

    void *receiver(void *sockp){
    - int sock=*(int*)sockp;
    - int readcnt;
    - unsigned int fromlen;
    for(;;){
    + int sock=*(int*)sockp;
    + socklen_t fromlen;
    sockaddr_in from;
    +
    memset(&from,0,sizeof(from));
    fromlen=sizeof(sockaddr_in);
    unsigned char *buf=new unsigned char[MAXPACKSIZE];
    @@ -87,10 +87,10 @@
    continue;

    // actually got some data
    - readcnt=recvfrom(sock,buf,MAXPACKSIZE,0,(sockaddr*)&from,&fromlen);
    + int readcnt=recvfrom(sock,buf,MAXPACKSIZE,0,(sockaddr*)&from,&fromlen);
    if(readcnt==-1){
    if(errno==ECONNREFUSED)
    - continue; // just ignore those pesky icmp unreachable errors
    + continue; // just ignore those icmp unreachable errors
    perror("bad read in reciever thread");
    exit(5);
    }
    @@ -103,11 +103,13 @@
    if(!memcmp(&from.sin_addr,cur->addr,cur->len))
    break;
    }
    - // now cur equals either null i.e. not found or the correct element
    + // now cur equals either null(not found) or correct element
    if(cur==NULL){
    fprintf(stderr,"Warning: stray packet recieved from %u.%u.%u.%u\n",
    - ((char*)&from.sin_addr)[0]&0xff,((char*)&from.sin_addr)[1]&0xff,
    - ((char*)&from.sin_addr)[2]&0xff,((char*)&from.sin_addr)[3]&0xff);
    + ((char*)&from.sin_addr)[0]&0xff,
    + ((char*)&from.sin_addr)[1]&0xff,
    + ((char*)&from.sin_addr)[2]&0xff,
    + ((char*)&from.sin_addr)[3]&0xff);

    pthread_mutex_unlock(&pending_m);
    continue;
    @@ -156,8 +158,8 @@
    close(sock);
    }

    -unsigned char *SNMP_socket::call(int len,int type,char *addr,char *data,
    - int &buflen){
    +unsigned char *SNMP_socket::call(socklen_t len,int type,char *addr,
    + char *data, int &buflen){
    request_t curreq(len,addr);
    if(len>maxaddrlen)
    maxaddrlen=len;
    Index: snmpsock.h
    ===================================================================
    RCS file: /cvsroot/npadmin/npadmin/snmpsock.h,v
    retrieving revision 1.2
    diff -u -r1.2 snmpsock.h
    --- snmpsock.h 1998/12/31 03:04:42 1.2
    +++ snmpsock.h 2000/06/12 16:41:50
    @@ -2,6 +2,7 @@
    #define __SNMPSOCK_H_

    #include <pthread.h>
    +#include <sys/socket.h>

    class SNMP_socket {
    int sock;
    @@ -12,7 +13,8 @@
    public:
    SNMP_socket(int timeout, int retries, int port=0);
    ~SNMP_socket();
    - unsigned char *call(int len,int type,char *addr,char *data,int &buflen);
    + unsigned char *call(socklen_t len,int type,char *addr,char *data,
    + int &buflen);
    };

    #endif

     
  • Ben Woodard

    Ben Woodard - 2000-06-14

    From: Ewan Leith <ejl@man.fwltech.com>
    To: "'ben@valinux.com'" <ben@valinux.com>
    Subject: npadmin and aix now works
    Date: Fri, 9 Jun 2000 14:45:43 +0100
    MIME-Version: 1.0
    X-Mailer: Internet Mail Service (5.5.2650.21)
    Content-Type: text/plain;
    charset="iso-8859-1"
    Status: O
    Content-Length: 495

    After playing around with npadmin 0.8.7 on aix this afternoon ive now got it
    successfully compiling.

    AIX requires that the file "strings.h" is included by snmpsock.C as that's
    where bzero is defined in AIX (FD_ZERO is aparantly a macro for bzero).

    Other than that, compiles fine on AIX 4.3 using the gnu compiler tools.
    Now to try webnpadmin i suppose :)

    Ewan Leith

    FWL Technologies Ltd
    Tel: 0161 872 8428 Fax: 0161 872 4516
    http://www.fwltech.com/logistics
    Mailto:ejl@man.fwltech.com

     

Log in to post a comment.