/[tcldrop]/tcldrop/modules/core.tcl
ViewVC logotype

Diff of /tcldrop/modules/core.tcl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.30 by fireegl, Tue Dec 2 06:54:32 2003 UTC revision 1.31 by fireegl, Tue Dec 2 09:27:14 2003 UTC
# Line 492  proc ::tcldrop::traffic {{type {*}} {dir Line 492  proc ::tcldrop::traffic {{type {*}} {dir
492                          array set info [list total-in 0 total-out 0 daily-in 0 daily-out 0 restart [unixtime]]                          array set info [list total-in 0 total-out 0 daily-in 0 daily-out 0 restart [unixtime]]
493                  }                  }
494                  # Increase the counters:                  # Increase the counters:
495                  if {($bytes) && ($direction == {in} || $direction == {out})} {                  if {$bytes} {
496                          incr info(total-$direction) $bytes                          incr info(total-$direction) $bytes
497                          incr info(daily-$direction) $bytes                          incr info(daily-$direction) $bytes
498                  }                  }
# Line 502  proc ::tcldrop::traffic {{type {*}} {dir Line 502  proc ::tcldrop::traffic {{type {*}} {dir
502                  }                  }
503                  # Write the new counts back to the Traffic variable:                  # Write the new counts back to the Traffic variable:
504                  set Traffic($type) [array get info]                  set Traffic($type) [array get info]
505                  if {$direction == {in} || $direction == {out}} {                  if {$direction != {}} {
506                          # Return either in or out for $type:                          # Return either in or out for $type:
507                          list $info(daily-$direction) $info(total-$direction)                          list $info(daily-$direction) $info(total-$direction)
508                  } else {                  } else {
# Line 520  proc ::tcldrop::traffic {{type {*}} {dir Line 520  proc ::tcldrop::traffic {{type {*}} {dir
520                          incr total(daily-out) $info(daily-out)                          incr total(daily-out) $info(daily-out)
521                          incr total(daily-in) $info(daily-in)                          incr total(daily-in) $info(daily-in)
522                  }                  }
523                  lappend out [list Total $total(daily-in) $total(total-in) $total(daily-out) $total(total-out)]                  list Total $total(daily-in) $total(total-in) $total(daily-out) $total(total-out)
                 return $out  
524          }          }
525  }  }
526    

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26