mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2025-12-07 21:38:53 +00:00
75 lines
1.4 KiB
Bash
75 lines
1.4 KiB
Bash
#! /bin/bash
|
|
# This is not an autconf generated configure
|
|
#
|
|
INCLUDE=${1:-"/usr/include"}
|
|
|
|
echo "# Generated config based on" $INCLUDE >Config
|
|
|
|
echo "TC"
|
|
PKT_SCHED=$INCLUDE/linux/pkt_sched.h
|
|
if [ ! -r $PKT_SCHED ];
|
|
then
|
|
echo " can't find file" $PKT_SCHED
|
|
exit 1
|
|
fi
|
|
|
|
echo -n " netem scheduler... "
|
|
cat >/tmp/netemtest.c <<EOF
|
|
#include <asm/types.h>
|
|
#include <linux/pkt_sched.h>
|
|
int main(int argc, char **argv) {
|
|
static struct tc_netem_qopt qopt;
|
|
exit(qopt.latency | qopt.limit | qopt.loss | qopt.gap | qopt.duplicate | qopt.jitter);
|
|
}
|
|
EOF
|
|
gcc -I$INCLUDE -c /tmp/netemtest.c >/dev/null 2>&1
|
|
if [ $? -eq 0 ]
|
|
then
|
|
echo "TC_CONFIG_NETEM:=y" >>Config
|
|
echo y
|
|
else
|
|
echo n
|
|
fi
|
|
rm -f /tmp/netemtest.c /tmp/netemtest.o
|
|
|
|
echo -n " ATM... "
|
|
cat >/tmp/atmtest.c <<EOF
|
|
#include <atm.h>
|
|
int main(int argc, char **argv) {
|
|
struct atm_qos qos;
|
|
(void) text2qos("aal5,ubr:sdu=9180,rx:none",&qos,0);
|
|
return 0;
|
|
}
|
|
EOF
|
|
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
|
|
else
|
|
echo n
|
|
fi
|
|
rm -f /tmp/atmtest.c /tmp/atmtest
|
|
|
|
# See if we know about TCP Vegas
|
|
echo "SS"
|
|
echo -n " TCP Vegas... "
|
|
if grep -q TCPDIAG_VEGASINFO $INCLUDE/linux/tcp_diag.h
|
|
then
|
|
echo "SS_CONFIG_VEGAS:=y" >>Config
|
|
echo y
|
|
else
|
|
echo n
|
|
fi
|
|
|
|
echo -n " TCP DRS... "
|
|
if grep -q tcpi_rcv_space $INCLUDE/linux/tcp.h
|
|
then
|
|
echo "SS_CONFIG_DRS:=y" >>Config
|
|
echo y
|
|
else
|
|
echo n
|
|
fi
|
|
|
|
|