⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dsr-uu.sh

📁 DSR-UU is a DSR implementation that runs in Linux and in the ns-2 network simulator. DSR-UU imple
💻 SH
字号:
#!/bin/bashcommand=$1IFNAME=eth1DSRUUPATH=/lib/modules/`uname -r`/dsr/MODPREFIX=kokillproc() {    pidlist=$(/sbin/pidof $1)    for pid in $pidlist; do	kill $pid &>/dev/null    done    return 0}if [ -z "$1" ]; then    echo "Must specify \"start\" or \"stop\""    exitfiif [ -n "$2" ]; then    IFNAME=$2fiecho "Slave interface is $IFNAME"if [ "$command" = "start" ]; then        # Start DSR-UU    IP=`/sbin/ifconfig $IFNAME | grep inet`    IP=${IP%%" Bcast:"*}    IP=${IP##*"inet addr:"}    echo $IP > .$IFNAME.ip    host_nr=`echo $IP | awk 'BEGIN{FS="."} { print $4 }'`    if [ -f $DSRUUPATH/linkcache.$MODPREFIX ] && [ -f $DSRUUPATH/dsr.$MODPREFIX ]; then	# Reconfigure the default interface	insmod $DSRUUPATH/linkcache.$MODPREFIX	insmod $DSRUUPATH/dsr.$MODPREFIX ifname=$IFNAME	#/sbin/ifconfig $IFNAME 192.168.45.$host_nr up	/sbin/ifconfig dsr0 192.168.45.$host_nr up	# Disable debug output	echo "PrintDebug=0" > /proc/net/dsr_config	echo "DSR-UU started with virtual host IP $IP"	# Enable IP-forwarding...	#echo 1 > /proc/sys/net/ipv4/ip_forward	#echo 0 > /proc/sys/net/ipv4/conf/$IFNAME/rp_filter    else	echo "DSR-UU not installed"	exit    fielif [ "$command" = "stop" ]; then     IP=`cat .$IFNAME.ip`    /sbin/ifconfig dsr0 down    rmmod dsr linkcache#    /sbin/ifconfig $IFNAME $IP up    rm -f .dsr.ipfi

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -