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

📄 tkagent_mn

📁 mobile ip 在linux下的一种实现
💻
字号:
#!/usr/bin/wish# $Id: tkagent_mn,v 1.4 2000/04/06 07:26:53 jm Exp $# Mobile Node Tool GUI# Dynamic hierarchial IP tunnel# Copyright (C) 1998-2000, Dynamics group# This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License version 2 as# published by the Free Software Foundation. See README and COPYING for# more details.if { $argc != 1 } {    puts "Usage: $argv0 <dynmnd>"    exit}set tool [lindex $argv 0]wm title . "Dynamics Mobile Node Configuration Tool ($tool)"frame .top -border 5pack .top -side top -fill x# buttonsframe .left -border 10pack .left -side left -fill ybutton .left.statusbutton -text Status -command Statusbutton .left.listbutton -text "List FAs" -command Listbutton .left.showbutton -text "Show FA" -command Showbutton .left.forcebutton -text "Force FA" -command Forcebutton .left.noforcebutton -text "No force" -command Noforcebutton .left.connectbutton -text Connect -command Connectbutton .left.disconnectbutton -text Disconnect -command Disconnectbutton .left.confirmbutton -text Confirm -command Confirmbutton .left.updatebutton -text "Loc.upd." -command Updatebutton .left.policybutton -text Policy -command Policybutton .left.quitbutton -text Quit -command exitpack .left.statusbutton -side top -fill xpack .left.listbutton -side top -fill xpack .left.showbutton -side top -fill xpack .left.forcebutton -side top -fill xpack .left.noforcebutton -side top -fill xpack .left.connectbutton -side top -fill xpack .left.disconnectbutton -side top -fill xpack .left.confirmbutton -side top -fill xpack .left.updatebutton -side top -fill xpack .left.policybutton -side top -fill xpack .left.quitbutton -side bottom -fill x# resultsframe .resframepack .resframe -side left -fill both -expand yset idlist [listbox .resframe.idlist -width 15]pack $idlist -side left -fill y set restext [text .resframe.restext -width 55 -height 20]pack .resframe.restext -side left -fill both -expand yproc List {} {    global idlist tool    ShowText [exec $tool list]    $idlist delete 0 end    set l [split [exec $tool list] \n]    foreach id $l {	if { $id != {} && $id != "List of heard FAs:" } {	    $idlist insert end $id	}    }}proc ShowText { text } {    global restext    $restext config -state normal    $restext delete 1.0 end    $restext insert end $text    $restext config -state disabled }proc Status {} {    global tool    ShowText [exec $tool status]}proc Show {} {    global idlist restext tool    set id [$idlist get active]    if { $id != {} } {	ShowText [exec $tool show $id]    }}proc Connect {} {    global tool    ShowText [exec $tool connect]}proc Disconnect {} {    global tool    ShowText [exec $tool disconnect]}proc Confirm {} {    global tool    ShowText [exec $tool confirm]}proc Update {} {    global tool    ShowText [exec $tool update]}proc Force {} {    global idlist restext tool    set id [$idlist get active]    if { $id != {} } {	ShowText [exec $tool force $id]    }}proc Noforce {} {    global tool    ShowText [exec $tool force]}proc setPolicy w {    global policyVars tool    foreach val [array names policyVars] {	set setting "off"	if { $policyVars($val) == 1 } {	    set setting "on"	}	exec $tool policy $val $setting    }    destroy $w    ShowText [exec $tool policy]}proc Policy {} {    global tool policyVars    set w .check    catch {destroy $w}    toplevel $w    wm title $w "Policy"    wm iconname $w "policy"    wm geometry $w +300+300    label $w.msg -wraplength 4i -justify left -text "Policies"    pack $w.msg -side top    frame $w.buttons    pack $w.buttons -side bottom -fill x -pady 2m    button $w.buttons.ok -text OK -command "setPolicy $w"    button $w.buttons.dismiss -text Cancel -command "destroy $w"    pack $w.buttons.ok $w.buttons.dismiss -side left -expand 1    set l [split [exec $tool policy] \n]    foreach id $l {	if { $id != {} } {	    set val [split $id " \t"]	    set name [lindex $val 0]	    set pos 1	    while { [lindex $val $pos] == {} } {		incr pos	    }	    set setting [lindex $val $pos]	    checkbutton $w.$$name -text $name -variable policyVars($name) -relief flat	    if { $setting == "ON" } {		set policyVars($name) 1	    }	    pack $w.$$name -side top -pady 2 -anchor w	}    }}

⌨️ 快捷键说明

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