]>
Commit | Line | Data |
---|---|---|
449bf1f3 SH |
1 | #! /bin/bash |
2 | # This is not an autconf generated configure | |
3 | # | |
4 | INCLUDE=${1:-"/usr/include"} | |
5 | ||
6 | echo "# Generated config based on" $INCLUDE >Config | |
7 | ||
8 | echo "TC" | |
9 | PKT_SCHED=$INCLUDE/linux/pkt_sched.h | |
10 | if [ ! -r $PKT_SCHED ]; | |
11 | then | |
12 | echo " can't find file" $PKT_SCHED | |
13 | exit 1 | |
14 | fi | |
15 | ||
6202b4c1 | 16 | echo -n " netem scheduler... " |
2979d52f SH |
17 | cat >/tmp/netemtest.c <<EOF |
18 | #include <asm/types.h> | |
19 | #include <linux/pkt_sched.h> | |
20 | int main(int argc, char **argv) { | |
21 | static struct tc_netem_qopt qopt; | |
22 | exit(qopt.latency | qopt.limit | qopt.loss | qopt.gap | qopt.duplicate | qopt.jitter); | |
23 | } | |
24 | EOF | |
25 | gcc -I$INCLUDE -c /tmp/netemtest.c >/dev/null 2>&1 | |
26 | if [ $? -eq 0 ] | |
27 | then | |
c830d77b | 28 | echo "TC_CONFIG_NETEM:=y" >>Config |
449bf1f3 SH |
29 | echo y |
30 | else | |
31 | echo n | |
32 | fi | |
2979d52f | 33 | rm -f /tmp/netemtest.c /tmp/netemtest.o |
449bf1f3 SH |
34 | |
35 | echo -n " ATM... " | |
c830d77b SH |
36 | cat >/tmp/atmtest.c <<EOF |
37 | #include <atm.h> | |
38 | int main(int argc, char **argv) { | |
39 | struct atm_qos qos; | |
40 | (void) text2qos("aal5,ubr:sdu=9180,rx:none",&qos,0); | |
41 | return 0; | |
42 | } | |
43 | EOF | |
2979d52f | 44 | gcc -I$INCLUDE -o /tmp/atmtest /tmp/atmtest.c -latm >/dev/null 2>&1 |
c830d77b | 45 | if [ $? -eq 0 ] |
449bf1f3 | 46 | then |
c830d77b | 47 | echo "TC_CONFIG_ATM:=y" >>Config |
449bf1f3 SH |
48 | echo y |
49 | else | |
50 | echo n | |
51 | fi | |
2979d52f | 52 | rm -f /tmp/atmtest.c /tmp/atmtest |
449bf1f3 | 53 | |
3876b3c3 SH |
54 | echo -n " HTB... " |
55 | DEF_HTB=`grep '^#define HTB_TC_VER' tc/q_htb.c` | |
56 | cat >/tmp/htbtest.c <<EOF | |
57 | #include <stdio.h> | |
58 | #include <asm/types.h> | |
59 | #include <linux/pkt_sched.h> | |
60 | $DEF_HTB | |
61 | int main(int argc, char **argv) { | |
62 | if (HTB_TC_VER >>16 != TC_HTB_PROTOVER) { | |
63 | fprintf(stderr, "different kernel and TC HTB versions\n"); | |
64 | return 1; | |
65 | } | |
66 | return 0; | |
67 | } | |
68 | EOF | |
69 | gcc -I$INCLUDE -o /tmp/htbtest /tmp/htbtest.c | |
70 | if [ $? -eq 0 -a /tmp/htbtest ] | |
71 | then | |
72 | echo "TC_CONFIG_HTB:=y" >>Config | |
73 | echo y | |
74 | else | |
75 | echo n | |
76 | fi | |
77 | rm -f /tmp/htbtest /tmp/htbtest.c | |
78 | ||
449bf1f3 SH |
79 | # See if we know about TCP Vegas |
80 | echo "SS" | |
81 | echo -n " TCP Vegas... " | |
3876b3c3 | 82 | if grep -q TCPDIAG_VEGASINFO $INCLUDE/linux/tcp_diag.h >/dev/null 2>&1 |
449bf1f3 | 83 | then |
c830d77b | 84 | echo "SS_CONFIG_VEGAS:=y" >>Config |
449bf1f3 SH |
85 | echo y |
86 | else | |
87 | echo n | |
88 | fi | |
89 | ||
90 | echo -n " TCP DRS... " | |
91 | if grep -q tcpi_rcv_space $INCLUDE/linux/tcp.h | |
92 | then | |
c830d77b | 93 | echo "SS_CONFIG_DRS:=y" >>Config |
449bf1f3 SH |
94 | echo y |
95 | else | |
96 | echo n | |
97 | fi | |
98 | ||
99 |