From b9cb1c9a4bcfb3308721b53e85ff2867622ef43f Mon Sep 17 00:00:00 2001 From: "osdl.net!shemminger" Date: Fri, 30 Jul 2004 22:27:50 +0000 Subject: [PATCH] XFRM is now a config optio. (Logical change 1.60) --- configure | 66 +++++++++++++++++++++++++++++++++++++++-------------- ip/Makefile | 12 ++++++++-- 2 files changed, 59 insertions(+), 19 deletions(-) diff --git a/configure b/configure index 84a87c97..406ba954 100644 --- a/configure +++ b/configure @@ -5,7 +5,17 @@ INCLUDE=${1:-"/usr/include"} echo "# Generated config based on" $INCLUDE >Config -echo "TC" +echo -n "TC xfrm " +XFRM=$INCLUDE/linux/xfrm.h +if [ ! -r $XFRM ]; +then + echo no +else + echo "IP_CONFIG_XFRM:=y" >>Config + echo yes +fi + +echo "TC schedulers" PKT_SCHED=$INCLUDE/linux/pkt_sched.h if [ ! -r $PKT_SCHED ]; then @@ -13,7 +23,7 @@ then exit 1 fi -echo -n " netem scheduler... " +echo -n " netem " cat >/tmp/netemtest.c < #include @@ -26,13 +36,13 @@ gcc -I$INCLUDE -c /tmp/netemtest.c >/dev/null 2>&1 if [ $? -eq 0 ] then echo "TC_CONFIG_NETEM:=y" >>Config - echo y + echo yes else - echo n + echo no fi rm -f /tmp/netemtest.c /tmp/netemtest.o -echo -n " ATM... " +echo -n " ATM " cat >/tmp/atmtest.c < int main(int argc, char **argv) { @@ -45,13 +55,13 @@ gcc -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1 if [ $? -eq 0 ] then echo "TC_CONFIG_ATM:=y" >>Config - echo y + echo yes else - echo n + echo no fi rm -f /tmp/atmtest.c /tmp/atmtest -echo -n " HTB... " +echo -n " HTB " DEF_HTB=`grep '^#define HTB_TC_VER' tc/q_htb.c` cat >/tmp/htbtest.c < @@ -66,34 +76,56 @@ int main(int argc, char **argv) { return 0; } EOF -gcc -I$INCLUDE -o /tmp/htbtest /tmp/htbtest.c +gcc -I$INCLUDE -o /tmp/htbtest /tmp/htbtest.c >/dev/null 2>&1 if [ $? -eq 0 -a /tmp/htbtest ] then echo "TC_CONFIG_HTB:=y" >>Config - echo y + echo yes else - echo n + echo no fi rm -f /tmp/htbtest /tmp/htbtest.c +echo -n " HFSC " +cat >/tmp/hfsctest.c < +#include +int main(int argc, char **argv) { + static struct tc_hfsc_qopt qopt; + + exit(qopt.defcls); +} +EOF +gcc -I$INCLUDE -c /tmp/hfsctest.c >/dev/null 2>&1 +if [ $? -eq 0 ] +then + echo "TC_CONFIG_HFSC:=y" >>Config + echo yes +else + echo no +fi +rm -f /tmp/hfsctest.c /tmp/hfsctest.o + + + # See if we know about TCP Vegas echo "SS" -echo -n " TCP Vegas... " +echo -n " TCP Vegas " if grep -q TCPDIAG_VEGASINFO $INCLUDE/linux/tcp_diag.h >/dev/null 2>&1 then echo "SS_CONFIG_VEGAS:=y" >>Config - echo y + echo yes else - echo n + echo no fi -echo -n " TCP DRS... " +echo -n " TCP DRS " if grep -q tcpi_rcv_space $INCLUDE/linux/tcp.h then echo "SS_CONFIG_DRS:=y" >>Config - echo y + echo yes else - echo n + echo no fi diff --git a/ip/Makefile b/ip/Makefile index df4fbda1..b73371de 100644 --- a/ip/Makefile +++ b/ip/Makefile @@ -1,6 +1,14 @@ IPOBJ=ip.o ipaddress.o iproute.o iprule.o \ - rtm_map.o iptunnel.o ipneigh.o iplink.o ipmaddr.o \ - ipmonitor.o ipmroute.o ipxfrm.o xfrm_state.o xfrm_policy.o + rtm_map.o iptunnel.o ipneigh.o iplink.o \ + ipmaddr.o ipmonitor.o ipmroute.o + +include ../Config + +ifeq ($(IP_CONFIG_XFRM),y) + IPOBJ += ipxfrm.o xfrm_state.o xfrm_policy.o +else + IPOBJ += xfrm_stub.o +endif RTMONOBJ=rtmon.o -- 2.39.2