tools/dtnd-control
changeset 29 00dfdf113d87
parent 0 2b3e5ec03512
equal deleted inserted replaced
28:406d4f7eb00d 29:00dfdf113d87
     3 set port 5050
     3 set port 5050
     4 
     4 
     5 proc usage {} {
     5 proc usage {} {
     6     puts stderr "dtnd-control \[-port port\] stop|check|logrotate|bundle_stats|daemon_stats"
     6     puts stderr "dtnd-control \[-port port\] stop|check|logrotate|bundle_stats|daemon_stats"
     7     puts "|reset_stats|route_dump|link_dump|bundle_list|registration_list|gettimeofday"
     7     puts "|reset_stats|route_dump|link_dump|bundle_list|registration_list|gettimeofday"
       
     8     puts "|\[-name name]\ link_open"
       
     9     puts "|\[-name name]\ link_close"
     8     puts "|\[-id id]\ bundle_info"
    10     puts "|\[-id id]\ bundle_info"
     9     puts "|\[-id id]\ bundle_del"
    11     puts "|\[-id id]\ bundle_del"
    10     puts "|\[-id id]\ bundle_dump"
    12     puts "|\[-id id]\ bundle_dump"
    11     puts "|\[-id id]\ bundle_expire"
    13     puts "|\[-id id]\ bundle_expire"
    12     exit 1
    14     exit 1
    28     if {[string index $arg 0] != "-"} {
    30     if {[string index $arg 0] != "-"} {
    29 	break
    31 	break
    30     }
    32     }
    31 	
    33 	
    32     switch -- $arg {
    34     switch -- $arg {
    33 	-port   { set port [shift argv] } -id { set id [shift argv] }
    35 	-port   { set port [shift argv] } -id { set id [shift argv] } -name { set name [shift argv] }
    34 	default {
    36 	default {
    35 	    puts stderr "unknown argument $arg"
    37 	    puts stderr "unknown argument $arg"
    36 	    usage
    38 	    usage
    37 	}
    39 	}
    38     }
    40     }
    40 }
    42 }
    41 
    43 
    42 set operation [shift argv]
    44 set operation [shift argv]
    43 
    45 
    44 switch -- $operation {
    46 switch -- $operation {
    45     stop - check - status - logrotate - daemon_stats - reset_stats - route_dump - link_dump - bundle_stats - bundle_list - bundle_info - bundle_del - bundle_expire - bundle_dump - registration_list - gettimeofday {}
    47     stop - check - status - logrotate - daemon_stats - reset_stats - route_dump - link_dump - link_open - link_close - bundle_stats - bundle_list - bundle_info - bundle_del - bundle_expire - bundle_dump - registration_list - gettimeofday {}
    46     default {
    48     default {
    47 	puts "unknown operation $operation"
    49 	puts "unknown operation $operation"
    48 	usage
    50 	usage
    49     }
    51     }
    50 }
    52 }
    86 } elseif {$operation == "route_dump"} {
    88 } elseif {$operation == "route_dump"} {
    87     set cmd "route dump"
    89     set cmd "route dump"
    88 
    90 
    89 } elseif {$operation == "link_dump"} {
    91 } elseif {$operation == "link_dump"} {
    90     set cmd "link dump"
    92     set cmd "link dump"
       
    93 
       
    94 } elseif {$operation == "link_open"} {
       
    95     set cmd "link open $name"
       
    96 
       
    97 } elseif {$operation == "link_close"} {
       
    98     set cmd "link close $name"
    91 
    99 
    92 } elseif {$operation == "bundle_list"} {
   100 } elseif {$operation == "bundle_list"} {
    93     set cmd "bundle list"
   101     set cmd "bundle list"
    94 
   102 
    95 } elseif {$operation == "bundle_info"} {
   103 } elseif {$operation == "bundle_info"} {