[Xorp-users] Build difficulties

Weaver John-JWEAVER1 John.Weaver@motorola.com
Fri, 29 Jul 2005 10:08:55 -0500


It looks like the functionality of the SIOCGIFCONF has not been done on PPC
for Linux or not that I could find.  From what I have been able to Google I
found that it is implemented for decnet, sparc, and alpha.  Is this
something that would adversely affect functionality?  Should we implement
it.  We are only using TAP devices for the interfaces that will be running
PIM/IGMP.  The patch did work but I ran into another error that maybe you
can help me on or point me in the right direction.  I am definitely not a
shell script person nor AWK.

Thanks,
John

mkdir .libs
rm -fr .libs/libstaticroutes.la .libs/libstaticroutes.*
.libs/libstaticroutes.*
ar cru .libs/libstaticroutes.a  static_routes_node.o static_routes_varrw.o
xrl_static_routes_node.o 
powerpc-unknown-linux-gnuspe-ranlib .libs/libstaticroutes.a
creating libstaticroutes.la
(cd .libs && rm -f libstaticroutes.la && ln -s ../libstaticroutes.la
libstaticroutes.la)
source='xorp_static_routes.cc' object='xorp_static_routes.o' libtool=no \
depfile='.deps/xorp_static_routes.Po'
tmpdepfile='.deps/xorp_static_routes.TPo' \
depmode=gcc3 /bin/bash ../config/depcomp \
powerpc-unknown-linux-gnuspe-g++ -DHAVE_CONFIG_H -I. -I. -I.. -I..
-B/vobs/vendor/os/linux/tools/solaris2.8/ppc-mot/powerpc-unknown-linux-gnusp
e -I/home/imounce1/openssl/include  -g -W -Wall -Wwrite-strings -Wcast-qual
-Werror -Wpointer-arith -Wcast-align -Wstrict-prototypes
-Woverloaded-virtual -ftemplate-depth-22 -pipe -c -o xorp_static_routes.o
`test -f xorp_static_routes.cc || echo './'`xorp_static_routes.cc
/bin/bash ../libtool --mode=link powerpc-unknown-linux-gnuspe-g++  -g -W
-Wall -Wwrite-strings -Wcast-qual -Werror -Wpointer-arith -Wcast-align
-Wstrict-prototypes -Woverloaded-virtual -ftemplate-depth-22 -pipe   -o
xorp_static_routes  xorp_static_routes.o libstaticroutes.la
../xrl/targets/libstaticroutesbase.la ../policy/backend/libpolicybackend.la
../libfeaclient/libfeaclient.la
../xrl/interfaces/libfindereventnotifierxif.la
../xrl/interfaces/libfeaifmgrmirrorxif.la
../xrl/interfaces/libfeaifmgrreplicatorxif.la ../xrl/interfaces/libribxif.la
../xrl/targets/libfeaifmgrmirrorbase.la ../libxipc/libxipc.la
../libcomm/libcomm.la ../libxorp/libxorp.la -lcrypto
-L/home/imounce1/openssl
powerpc-unknown-linux-gnuspe-g++ -g -W -Wall -Wwrite-strings -Wcast-qual
-Werror -Wpointer-arith -Wcast-align -Wstrict-prototypes
-Woverloaded-virtual -ftemplate-depth-22 -pipe -o xorp_static_routes
xorp_static_routes.o  ./.libs/libstaticroutes.a -L/home/imounce1/openssl
../xrl/targets/.libs/libstaticroutesbase.a
../policy/backend/.libs/libpolicybackend.a
../libfeaclient/.libs/libfeaclient.a
../xrl/interfaces/.libs/libfindereventnotifierxif.a
../xrl/interfaces/.libs/libfeaifmgrmirrorxif.a
../xrl/interfaces/.libs/libfeaifmgrreplicatorxif.a
../xrl/interfaces/.libs/libribxif.a
../xrl/targets/.libs/libfeaifmgrmirrorbase.a ../libxipc/.libs/libxipc.a
../libcomm/.libs/libcomm.a ../libxorp/.libs/libxorp.a -lcrypto
../utils/xrl_wrappers_generator.sh ../xrl/targets/static_routes.xrls >
../static_routes/xrl_static_routes_shell_funcs.sh
awk: syntax error near line 1
awk: bailing out near line 1
make[2]: *** [../static_routes/xrl_static_routes_shell_funcs.sh] Error 2
make[2]: Leaving directory
`/vobs/ubs_phy_sw/ctrl/sproc/protocols/xorp/1.1/static_routes'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/vobs/ubs_phy_sw/ctrl/sproc/protocols/xorp/1.1'
make: *** [all] Error 2

-----Original Message-----
From: Pavlin Radoslavov [mailto:pavlin@icir.org] 
Sent: Tuesday, July 26, 2005 2:36 PM
To: Weaver John-JWEAVER1
Cc: Pavlin Radoslavov; xorp-users@xorp.org
Subject: Re: [Xorp-users] Build difficulties 

> It is not defined but it is not undefined either. I am pretty much 
> building the code as it is from the packaged download.

I just committed a fix to xorp/fea/ifconfig_set_ioctl.cc (rev. 1.37) so
please get the lastest XORP code from CVS and try to compile it.
I don't have a box like yours to test it, but hopefully it will take care of
the problem.

The usual disclamer applies that you may have to wait up to one hour until
the anon. CVS repository is updated.

Alternatively, you can apply the following patch:
http://xorpc.icir.org/cgi-bin/cvsweb.cgi/xorp/fea/ifconfig_set_ioctl.cc.diff
?r1=1.36&r2=1.37

This patch should apply cleanly for XORP-1.1.

Though, if you are running Linux I am wondering why HAVE_IOCTL_SIOCGIFCONF
wasn't defined. I would expect that all Linux distributions would support
ioctl(SIOCGIFCONF).

Could you compile and run the small program at the end of this email. If
ioctl(SIOCGIFCONF) is available, the program should compile cleanly and
should return (0).
FYI, this is the same program used by configure (see
config/acifconf.m4) to determine whether the system supports
ioctl(SIOCGIFCONF).

Thanks,
Pavlin

/****** BEGIN ******/

#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <net/if.h>
main()
{
    int sock, lastlen;
    struct ifconf ifconf;
    int ifnum = 1024;

    ifconf.ifc_buf = NULL;
    lastlen = 0;

    if ( (sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
	return (1);

    /* Loop until SIOCGIFCONF success. */
    for ( ; ; ) {
        ifconf.ifc_len = ifnum*sizeof(struct ifreq);
        ifconf.ifc_buf = (caddr_t)realloc(ifconf.ifc_buf, ifconf.ifc_len);
        if (ioctl(sock, SIOCGIFCONF, &ifconf) < 0) {
            /* Check UNPv1, 2e, pp 435 for an explanation why we need this
*/
            if ((errno != EINVAL) || (lastlen != 0))
		return (1);
        } else {
            if (ifconf.ifc_len == lastlen)
                break;          /* success, len has not changed */
            lastlen = ifconf.ifc_len;
        }
        ifnum += 10;
    }

    return (0);
}

/****** END ******/