#!/bin/sh # This is `snmp2.21' (part 21 of snmp2). # Do not concatenate these parts, unpack them in order with `/bin/sh'. # File `snmp2/man/des.3' is being continued... # touch -am 1231235999 $$.touch >/dev/null 2>&1 if test ! -f 1231235999 && test -f $$.touch; then shar_touch=touch else shar_touch=: echo echo 'WARNING: not restoring timestamps. Consider getting and' echo "installing GNU \`touch', distributed in GNU File Utilities..." echo fi rm -f 1231235999 $$.touch # if test ! -r _sharseq.tmp; then echo 'Please unpack part 1 first!' exit 1 fi shar_sequence=`cat _sharseq.tmp` if test "$shar_sequence" != 21; then echo "Please unpack part $shar_sequence next!" exit 1 fi if test ! -f _sharnew.tmp; then echo 'x - still skipping snmp2/man/des.3' else echo 'x - continuing file snmp2/man/des.3' sed 's/^X//' << 'SHAR_EOF' >> 'snmp2/man/des.3' && X.SH NAME desinit, setkey, endes, dedes, desdone - DES encryption X.SH SYNOPSIS X.PP X.B desinit(mode) X.B int mode; X.PP X.B setkey(key) X.B char *key; X.PP X.B endes(block) X.B char *block; X.PP X.B dedes(block) X.B char *block; X.PP X.B desdone() X.SH DESCRIPTION These routines implement both standard and modified forms of the NBS Data Encryption Standard (DES). The user must first call X.B desinit with one of three operating modes: X.PP 0 - Standard, vanilla DES. X.PP 1 - DES with the initial and final permutations removed. As these permutations do not strengthen the algorithm, they are widely regarded as having no purpose other than to slow down software implementations. Removing them speeds it up but of course the algorithm is no longer standard and it will not be compatible with hardware DES chips. X.PP 2 - DES with the initial and final permutations removed, and with independent 48-bit subkeys for each of the 16 rounds. Needless to say this is even less standard than mode 1, but if properly used (randomize ALL key bytes -- no padding!) it should strengthen the algorithm. X.PP After calling X.B desinit the user next calls X.B setkey. In modes 0 and 1, 8 key bytes are expected, with the low order bit of each key byte ignored (parity is not checked). This gives a 56-bit key. In mode 2, 128 key bytes are expected; the high order 2 bits of each byte are ignored, giving a 768 bit key. In this mode, the first 8 bytes will be used in the first round, the second 8 bytes in the second round, and so on. X.PP Once the key is set, the user may perform in-place encryption and decryption of 8-byte blocks of data with calls to X.B endes and X.B dedes. X.PP To free up memory dynamically allocated by X.B desinit the user may call X.B desdone. If further encryption or decryption is to be done, X.B desinit and X.B setkey must be called again. X.SH AUTHOR Phil Karn, KA9Q, building heavily on the earlier public domain code by Jim Gillogly. X X SHAR_EOF echo 'File snmp2/man/des.3 is complete' && $shar_touch -am 1015123693 'snmp2/man/des.3' && chmod 0644 'snmp2/man/des.3' || echo 'restore of snmp2/man/des.3 failed' shar_count="`wc -c < 'snmp2/man/des.3'`" test 1956 -eq "$shar_count" || echo "snmp2/man/des.3: original size 1956, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/man/README ============== if test -f 'snmp2/man/README' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/man/README (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/man/README (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/man/README' && This documentation has not been updated for version 2 of the release. The command line format has changed significantly. My suggestion is that you read the man pages for the old version to learn of the operation of the program, and then run the program without parameters to get a usage summary to see the new command line arguments. Most commands take a form similar to: X X Usage: snmpwalk -v 1 hostname community [objectID] or: X Usage: snmpwalk [-v 2 ] hostname noAuth [objectID] or: X Usage: snmpwalk [-v 2 ] hostname srcParty dstParty context [objectID] X You will most likely want either: snmpwalk -v 1 hostname public ... or: snmpwalk hostname noAuth ... X SHAR_EOF $shar_touch -am 1015123693 'snmp2/man/README' && chmod 0644 'snmp2/man/README' || echo 'restore of snmp2/man/README failed' shar_count="`wc -c < 'snmp2/man/README'`" test 682 -eq "$shar_count" || echo "snmp2/man/README: original size 682, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/etc/acl.conf ============== if test ! -d 'snmp2/etc'; then echo 'x - creating directory snmp2/etc' mkdir 'snmp2/etc' fi if test -f 'snmp2/etc/acl.conf' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/etc/acl.conf (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/etc/acl.conf (binary)' sed 's/^X//' << 'SHAR_EOF' > _sharuue.tmp && begin 600 snmp2/etc/acl.conf M(R!B:6<@86-L(&9I;&4@=&AA="!W;W)KF5U'0@9FEL97,@;W(@=&AE>2!C86X@8F4@;V)J96-T(&ED96YT:69I97)S"B,* M(R!A;F0@<')I=FEL96=EF5UF5U'0Q(%)5"@HC>F5UF5UF5UF5U _sharnew.tmp echo 'x - extracting snmp2/etc/party.conf (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/etc/party.conf' && # Party Configuration File # # Format: # # FriendlyName PartyID # TDomain IP-address UDP-port # authProtocol privProtocol # lifetime maxmessagesize # clock # authPrivate authPublic-length authPublic # privPrivate privPublic-length privPublic # # where # FriendlyName is ascii name ("noAuth" is reserved - don't use it) # PartyID is object identifier name for this party # TDomain is transport domain, snmpUDPDomain # IP-address is dotted decimal (use 127.0.0.1 for local) # (use 0.0.0.0 for remote) # UDP-port is decimal # authProtocol is "noAuth" or "snmpv2Md5Auth" # privProtocol is "noPriv" or "desPriv" # lifetime is decimal # maxmessagesize is decimal number of octets for largest supported PDU # clock is decimal clock offset value # authPrivate is 32 hex digits # authPublic-length is decimal or "Null" (if Null, no next field) # authPublic is a hex string of 2*authPublic-length digits # privPrivate is 32 hex digits # privPublic-length is decimal or "Null" (if Null, no next field) # privPublic is a hex string of 2*privPublic-length digits # X #zeusAgent .1.3.6.1.6.3.3.1.3.128.2.35.55.1 #snmpUDPDomain 128.2.35.55 161 #noAuth noPriv #300 484 #29F660EA #00000000000000000000000000000000 Null #00000000000000000000000000000000 Null X #zeusMS .1.3.6.1.6.3.3.1.3.128.2.35.55.2 #snmpUDPDomain 0.0.0.0 0 #noAuth noPriv #300 484 #29F660EA #00000000000000000000000000000000 Null #00000000000000000000000000000000 Null X X zeusAgentMD5 .1.3.6.1.6.3.3.1.3.128.2.35.55.3 snmpUDPDomain 128.2.35.55 161 snmpv2Md5Auth noPriv 300 484 29F660EA 74686973746869737468697374686933 Null 00000000000000000000000000000000 Null X zeusMSMD5 .1.3.6.1.6.3.3.1.3.128.2.35.55.4 snmpUDPDomain 0.0.0.0 0 snmpv2Md5Auth noPriv 300 484 29F660EA 74686973746869737468697374686933 Null 00000000000000000000000000000000 Null X X #mtragent .1.3.6.1.6.3.3.1.3.192.103.140.1.1 #snmpUDPDomain 192.103.140.1 161 #noAuth noPriv #300 8192 #34053549 #00000000000000000000000000000000 Null #00000000000000000000000000000000 Null X #mtrms .1.3.6.1.6.3.3.1.3.192.103.140.1.2 #snmpUDPDomain 192.103.140.1 161 #noAuth noPriv #300 8192 #34053549 #00000000000000000000000000000000 Null #00000000000000000000000000000000 Null X X SHAR_EOF $shar_touch -am 1015123693 'snmp2/etc/party.conf' && chmod 0644 'snmp2/etc/party.conf' || echo 'restore of snmp2/etc/party.conf failed' shar_count="`wc -c < 'snmp2/etc/party.conf'`" test 2421 -eq "$shar_count" || echo "snmp2/etc/party.conf: original size 2421, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/etc/view.conf ============== if test -f 'snmp2/etc/view.conf' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/etc/view.conf (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/etc/view.conf (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/etc/view.conf' && # big view file that works for zeus, valkyries, and aragorn # # entries are in the following format: # viewIndex viewSubtree viewStatus viewMask # where viewstatus is either "included" or "excluded", # and mask is either "null" or a hex number 1-16 bytes long. X #i.e.: # 1 .iso.org.dod.internet.mgmt included Null # 2 .iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifentry.ifinoctets.2 excluded FFA0 X 2 .iso.org.dod.internet included Null X #2 .iso.org.dod.internet.mgmt.mib-2 included Null #3 .iso.org.dod.internet.mgmt.mib-2 included Null X 2 .2.6.6 included Null X #2 .2.6.6 included Null X SHAR_EOF $shar_touch -am 1015123693 'snmp2/etc/view.conf' && chmod 0644 'snmp2/etc/view.conf' || echo 'restore of snmp2/etc/view.conf failed' shar_count="`wc -c < 'snmp2/etc/view.conf'`" test 595 -eq "$shar_count" || echo "snmp2/etc/view.conf: original size 595, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/etc/context.conf ============== if test -f 'snmp2/etc/context.conf' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/etc/context.conf (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/etc/context.conf (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/etc/context.conf' && # Context Configuration File # # Format: # # contextName contextIdentity # contextViewIndex contextLocalEntity contextLocalTime # contextDstPartyIndex contextSrcPartyIndex contextProxyContext X # where # contextName is alphanumeric friendly name # contextIdentity is object identifier # contextViewIndex is decimal # contextLocalEntity is string or Null # contextLocalTime is currentTime or restartTime # contextDstPartyIndex is decimal # contextSrcPartyIndex is decimal # contextProxyContext is object identifier # X X #zeusContext1 .1.3.6.1.6.3.3.1.4.128.2.35.55.1 #1 Null currentTime #0 0 .0.0 X zeusContext2 .1.3.6.1.6.3.3.1.4.128.2.35.55.2 2 Null currentTime 0 0 .0.0 X #mtrContext1 .1.3.6.1.6.3.3.1.4.192.103.140.1.1 #1 Null currentTime #0 0 0 X #mtrContext2 .1.3.6.1.6.3.3.1.4.192.103.140.1.2 #2 Null currentTime #0 0 0 X SHAR_EOF $shar_touch -am 1015123693 'snmp2/etc/context.conf' && chmod 0644 'snmp2/etc/context.conf' || echo 'restore of snmp2/etc/context.conf failed' shar_count="`wc -c < 'snmp2/etc/context.conf'`" test 853 -eq "$shar_count" || echo "snmp2/etc/context.conf: original size 853, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/etc/README ============== if test -f 'snmp2/etc/README' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/etc/README (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/etc/README (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/etc/README' && If you want to communicate with secure SNMP packets, you will need to set up SNMP security parameters for your system. If so, copy these files into your /etc directory and edit them according to the instructions at the beginning of each file. Unfortunately, knowledge of SNMP Security is a great help here. This will get better in the future -- automated tools should do this work. SHAR_EOF $shar_touch -am 1015123693 'snmp2/etc/README' && chmod 0644 'snmp2/etc/README' || echo 'restore of snmp2/etc/README failed' shar_count="`wc -c < 'snmp2/etc/README'`" test 385 -eq "$shar_count" || echo "snmp2/etc/README: original size 385, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/tk/button.tcl ============== if test ! -d 'snmp2/tk'; then echo 'x - creating directory snmp2/tk' mkdir 'snmp2/tk' fi if test -f 'snmp2/tk/button.tcl' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/tk/button.tcl (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/tk/button.tcl (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/tk/button.tcl' && # button.tcl -- # # This file contains Tcl procedures used to manage Tk buttons. # # $Header: /user6/ouster/wish/scripts/RCS/button.tcl,v 1.7 92/07/28 15:41:13 ouster Exp $ SPRITE (Berkeley) # # Copyright 1992 Regents of the University of California # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that this copyright # notice appears in all copies. The University of California # makes no representations about the suitability of this # software for any purpose. It is provided "as is" without # express or implied warranty. # X # The procedure below is invoked when the mouse pointer enters a # button widget. It records the button we're in and changes the # state of the button to active unless the button is disabled. X proc tk_butEnter w { X global tk_priv tk_strictMotif X if {[lindex [$w config -state] 4] != "disabled"} { X if {!$tk_strictMotif} { X $w config -state active X } X set tk_priv(window) $w X } } X # The procedure below is invoked when the mouse pointer leaves a # button widget. It changes the state of the button back to # inactive. X proc tk_butLeave w { X global tk_priv tk_strictMotif X if {[lindex [$w config -state] 4] != "disabled"} { X if {!$tk_strictMotif} { X $w config -state normal X } X } X set tk_priv(window) "" } X # The procedure below is invoked when the mouse button is pressed in # a button/radiobutton/checkbutton widget. It records information # (a) to indicate that the mouse is in the button, and # (b) to save the button's relief so it can be restored later. X proc tk_butDown w { X global tk_priv X set tk_priv(relief) [lindex [$w config -relief] 4] X if {[lindex [$w config -state] 4] != "disabled"} { X $w config -relief sunken X } } X # The procedure below is invoked when the mouse button is released # for a button/radiobutton/checkbutton widget. It restores the # button's relief and invokes the command as long as the mouse # hasn't left the button. X proc tk_butUp w { X global tk_priv X $w config -relief $tk_priv(relief) X if {($w == $tk_priv(window)) X && ([lindex [$w config -state] 4] != "disabled")} { X uplevel #0 [list $w invoke] X } } SHAR_EOF $shar_touch -am 1015123693 'snmp2/tk/button.tcl' && chmod 0444 'snmp2/tk/button.tcl' || echo 'restore of snmp2/tk/button.tcl failed' shar_count="`wc -c < 'snmp2/tk/button.tcl'`" test 2232 -eq "$shar_count" || echo "snmp2/tk/button.tcl: original size 2232, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/tk/entry.tcl ============== if test -f 'snmp2/tk/entry.tcl' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/tk/entry.tcl (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/tk/entry.tcl (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/tk/entry.tcl' && # entry.tcl -- # # This file contains Tcl procedures used to manage Tk entries. # # $Header: /user6/ouster/wish/scripts/RCS/entry.tcl,v 1.2 92/05/23 16:40:57 ouster Exp $ SPRITE (Berkeley) # # Copyright 1992 Regents of the University of California # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that this copyright # notice appears in all copies. The University of California # makes no representations about the suitability of this # software for any purpose. It is provided "as is" without # express or implied warranty. # X # The procedure below is invoked to backspace over one character # in an entry widget. The name of the widget is passed as argument. X proc tk_entryBackspace w { X set x [expr {[$w index cursor] - 1}] X if {$x != -1} {$w delete $x} } X # The procedure below is invoked to backspace over one word in an # entry widget. The name of the widget is passed as argument. X proc tk_entryBackword w { X set string [$w get] X set curs [expr [$w index cursor]-1] X if {$curs < 0} return X for {set x $curs} {$x > 0} {incr x -1} { X if {([string first [string index $string $x] " \t"] < 0) X && ([string first [string index $string [expr $x-1]] " \t"] X >= 0)} { X break X } X } X $w delete $x $curs } X # The procedure below is invoked after insertions. If the caret is not # visible in the window then the procedure adjusts the entry's view to # bring the caret back into the window again. X proc tk_entrySeeCaret w { X set c [$w index cursor] X set left [$w index @0] X if {$left > $c} { X $w view $c X return X } X while {[$w index @[expr [winfo width $w]-5]] < $c} { X set left [expr $left+1] X $w view $left X } } SHAR_EOF $shar_touch -am 1015123693 'snmp2/tk/entry.tcl' && chmod 0444 'snmp2/tk/entry.tcl' || echo 'restore of snmp2/tk/entry.tcl failed' shar_count="`wc -c < 'snmp2/tk/entry.tcl'`" test 1762 -eq "$shar_count" || echo "snmp2/tk/entry.tcl: original size 1762, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/tk/listbox.tcl ============== if test -f 'snmp2/tk/listbox.tcl' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/tk/listbox.tcl (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/tk/listbox.tcl (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/tk/listbox.tcl' && # listbox.tcl -- # # This file contains Tcl procedures used to manage Tk listboxes. # # $Header: /user6/ouster/wish/scripts/RCS/listbox.tcl,v 1.2 92/06/03 15:21:28 ouster Exp $ SPRITE (Berkeley) # # Copyright 1992 Regents of the University of California # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that this copyright # notice appears in all copies. The University of California # makes no representations about the suitability of this # software for any purpose. It is provided "as is" without # express or implied warranty. # X # The procedure below may be invoked to change the behavior of # listboxes so that only a single item may be selected at once. # The arguments give one or more windows whose behavior should # be changed; if one of the arguments is "Listbox" then the default # behavior is changed for all listboxes. X proc tk_listboxSingleSelect args { X foreach w $args { X bind $w {%W select from [%W nearest %y]} X bind $w {%W select from [%W nearest %y]} X bind $w {%W select from [%W nearest %y]} X } } SHAR_EOF $shar_touch -am 1015123693 'snmp2/tk/listbox.tcl' && chmod 0444 'snmp2/tk/listbox.tcl' || echo 'restore of snmp2/tk/listbox.tcl failed' shar_count="`wc -c < 'snmp2/tk/listbox.tcl'`" test 1170 -eq "$shar_count" || echo "snmp2/tk/listbox.tcl: original size 1170, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/tk/menu.tcl ============== if test -f 'snmp2/tk/menu.tcl' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/tk/menu.tcl (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/tk/menu.tcl (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/tk/menu.tcl' && # menu.tcl -- # # This file contains Tcl procedures used to manage Tk menus and # menubuttons. Most of the code here is dedicated to support for # menu traversal via the keyboard. # # $Header: /user6/ouster/wish/scripts/RCS/menu.tcl,v 1.11 92/08/08 14:49:55 ouster Exp $ SPRITE (Berkeley) # # Copyright 1992 Regents of the University of California # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that this copyright # notice appears in all copies. The University of California # makes no representations about the suitability of this # software for any purpose. It is provided "as is" without # express or implied warranty. # X # The procedure below is publically available. It is used to indicate # the menus associated with a particular top-level window, for purposes # of keyboard menu traversal. Its first argument is the path name of # a top-level window, and any additional arguments are the path names of # the menu buttons associated with that top-level window, in the order # they should be traversed. If no menu buttons are named, the procedure # returns the current list of menus for w. If a single empty string is # supplied, then the menu list for w is cancelled. Otherwise, tk_menus # sets the menu list for w to the menu buttons. X proc tk_menus {w args} { X global tk_priv X X if {$args == ""} { X if [catch {set result [set tk_priv(menusFor$w)]}] { X return "" X } X return $result X } X X if {$args == "{}"} { X catch {unset tk_priv(menusFor$w)} X return "" X } X X set tk_priv(menusFor$w) $args } X # The procedure below is publically available. It takes any number of # arguments taht are names of widgets or classes. It sets up bindings # for the widgets or classes so that keyboard menu traversal is possible # when the input focus is in those widgets or classes. X proc tk_bindForTraversal args { X foreach w $args { X bind $w {tk_traverseToMenu %W %A} X bind $w {tk_firstMenu %W} X } } X # The procedure below does all of the work of posting a menu (including # unposting any other menu that might currently be posted). The "w" # argument is the name of the menubutton for the menu to be posted. # Note: if $w is disabled then the procedure does nothing. X proc tk_mbPost {w} { X global tk_priv tk_strictMotif X if {[lindex [$w config -state] 4] == "disabled"} { X return X } X set cur $tk_priv(posted) X if {$cur == $w} { X return X } X if {$cur != ""} tk_mbUnpost X set tk_priv(relief) [lindex [$w config -relief] 4] X $w config -relief raised X set tk_priv(cursor) [lindex [$w config -cursor] 4] X $w config -cursor arrow X $w post X grab -global $w X set tk_priv(posted) $w X if {$tk_priv(focus) == ""} { X set tk_priv(focus) [focus] X } X set menu [lindex [$w config -menu] 4] X set tk_priv(activeBg) [lindex [$menu config -activebackground] 4] X set tk_priv(activeFg) [lindex [$menu config -activeforeground] 4] X if $tk_strictMotif { X $menu config -activebackground [lindex [$menu config -background] 4] X $menu config -activeforeground [lindex [$menu config -foreground] 4] X } X focus $menu } X # The procedure below does all the work of unposting the menubutton that's # currently posted. It takes no arguments. X proc tk_mbUnpost {} { X global tk_priv X if {$tk_priv(posted) != ""} { X $tk_priv(posted) config -relief $tk_priv(relief) X $tk_priv(posted) config -cursor $tk_priv(cursor) X $tk_priv(posted) config -activebackground $tk_priv(activeBg) X $tk_priv(posted) config -activeforeground $tk_priv(activeFg) X $tk_priv(posted) unpost X grab none X focus $tk_priv(focus) X set tk_priv(focus) "" X set menu [lindex [$tk_priv(posted) config -menu] 4] X $menu config -activebackground $tk_priv(activeBg) X $menu config -activeforeground $tk_priv(activeFg) X set tk_priv(posted) {} X } } X # The procedure below is invoked to implement keyboard traversal to # a menu button. It takes two arguments: the name of a window where # a keystroke originated, and the ascii character that was typed. # This procedure finds a menu bar by looking upward for a top-level # window, then looking for a window underneath that named "menu". # Then it searches through all the subwindows of "menu" for a menubutton # with an underlined character matching char. If one is found, it # posts that menu. X proc tk_traverseToMenu {w char} { X global tk_priv X if {$char == ""} { X return X } X set char [string tolower $char] X X foreach mb [tk_getMenuButtons $w] { X if {[winfo class $mb] == "Menubutton"} { X set char2 [string index [lindex [$mb config -text] 4] \ X [lindex [$mb config -underline] 4]] X if {[string compare $char [string tolower $char2]] == 0} { X tk_mbPost $mb X [lindex [$mb config -menu] 4] activate 0 X return X } X } X } } X # The procedure below is used to implement keyboard traversal within # the posted menu. It takes two arguments: the name of the menu to # be traversed within, and an ASCII character. It searches for an # entry in the menu that has that character underlined. If such an # entry is found, it is invoked and the menu is unposted. X proc tk_traverseWithinMenu {w char} { X if {$char == ""} { X return X } X set char [string tolower $char] X set last [$w index last] X for {set i 0} {$i <= $last} {incr i} { X if [catch {set char2 [string index \ X [lindex [$w entryconfig $i -label] 4] \ X [lindex [$w entryconfig $i -underline] 4]]}] { X continue X } X if {[string compare $char [string tolower $char2]] == 0} { X tk_mbUnpost X $w invoke $i X return X } X } } X # The procedure below takes a single argument, which is the name of # a window. It returns a list containing path names for all of the # menu buttons associated with that window's top-level window, or an # empty list if there are none. X proc tk_getMenuButtons w { X global tk_priv X set top [winfo toplevel $w] X if [catch {set buttons [set tk_priv(menusFor$top)]}] { X return "" X } X return $buttons } X # The procedure below is used to traverse to the next or previous # menu in a menu bar. It takes one argument, which is a count of # how many menu buttons forward or backward (if negative) to move. # If there is no posted menu then this procedure has no effect. X proc tk_nextMenu count { X global tk_priv X if {$tk_priv(posted) == ""} { X return X } X set buttons [tk_getMenuButtons $tk_priv(posted)] X set length [llength $buttons] X for {set i 0} 1 {incr i} { X if {$i >= $length} { X return X } X if {[lindex $buttons $i] == $tk_priv(posted)} { X break X } X } X incr i $count X while 1 { X while {$i < 0} { X incr i $length X } X while {$i >= $length} { X incr i -$length X } X set mb [lindex $buttons $i] X if {[lindex [$mb configure -state] 4] != "disabled"} { X break X } X incr i $count X } X tk_mbUnpost X tk_mbPost $mb X [lindex [$mb config -menu] 4] activate 0 } X # The procedure below is used to traverse to the next or previous entry # in the posted menu. It takes one argument, which is 1 to go to the # next entry or -1 to go to the previous entry. Disabled entries are # skipped in this process. X proc tk_nextMenuEntry count { X global tk_priv X if {$tk_priv(posted) == ""} { X return X } X set menu [lindex [$tk_priv(posted) config -menu] 4] X set length [expr [$menu index last]+1] X set i [$menu index active] X if {$i == "none"} { X set i 0 X } else { X incr i $count X } X while 1 { X while {$i < 0} { X incr i $length X } X while {$i >= $length} { X incr i -$length X } X if {[catch {$menu entryconfigure $i -state} state] == 0} { X if {[lindex $state 4] != "disabled"} { X break X } X } X incr i $count X } X $menu activate $i } X # The procedure below invokes the active entry in the posted menu, # if there is one. Otherwise it does nothing. X proc tk_invokeMenu {menu} { X set i [$menu index active] X if {$i != "none"} { X tk_mbUnpost X update idletasks X $menu invoke $i X } } X # The procedure below is invoked to keyboard-traverse to the first # menu for a given source window. The source window is passed as # parameter. X proc tk_firstMenu w { X set mb [lindex [tk_getMenuButtons $w] 0] X if {$mb != ""} { X tk_mbPost $mb X [lindex [$mb config -menu] 4] activate 0 X } } X # The procedure below is invoked when a button-1-down event is # received by a menu button. If the mouse is in the menu button # then it posts the button's menu. If the mouse isn't in the # button's menu, then it deactivates any active entry in the menu. # Remember, event-sharing can cause this procedure to be invoked # for two different menu buttons on the same event. X proc tk_mbButtonDown w { X global tk_priv X if {[lindex [$w config -state] 4] == "disabled"} { X return X } X if {$tk_priv(inMenuButton) == $w} { X tk_mbPost $w X } X set menu [lindex [$tk_priv(posted) config -menu] 4] X if {$tk_priv(window) != $menu} { X $menu activate none X } } SHAR_EOF $shar_touch -am 1015123693 'snmp2/tk/menu.tcl' && chmod 0644 'snmp2/tk/menu.tcl' || echo 'restore of snmp2/tk/menu.tcl failed' shar_count="`wc -c < 'snmp2/tk/menu.tcl'`" test 8987 -eq "$shar_count" || echo "snmp2/tk/menu.tcl: original size 8987, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/tk/text.tcl ============== if test -f 'snmp2/tk/text.tcl' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/tk/text.tcl (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/tk/text.tcl (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/tk/text.tcl' && # text.tcl -- # # This file contains Tcl procedures used to manage Tk entries. # # $Header: /user6/ouster/wish/scripts/RCS/text.tcl,v 1.2 92/07/16 16:26:33 ouster Exp $ SPRITE (Berkeley) # # Copyright 1992 Regents of the University of California # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that this copyright # notice appears in all copies. The University of California # makes no representations about the suitability of this # software for any purpose. It is provided "as is" without # express or implied warranty. # X # The procedure below is invoked when dragging one end of the selection. # The arguments are the text window name and the index of the character # that is to be the new end of the selection. X proc tk_textSelectTo {w index} { X global tk_priv X X case $tk_priv(selectMode) { X char { X if [$w compare $index < anchor] { X set first $index X set last anchor X } else { X set first anchor X set last [$w index $index+1c] X } X } X word { X if [$w compare $index < anchor] { X set first [$w index "$index wordstart"] X set last [$w index "anchor wordend"] X } else { X set first [$w index "anchor wordstart"] X set last [$w index "$index wordend"] X } X } X line { X if [$w compare $index < anchor] { X set first [$w index "$index linestart"] X set last [$w index "anchor lineend + 1c"] X } else { X set first [$w index "anchor linestart"] X set last [$w index "$index lineend + 1c"] X } X } X } X $w tag remove sel 0.0 $first X $w tag add sel $first $last X $w tag remove sel $last end } X # The procedure below is invoked to backspace over one character in # a text widget. The name of the widget is passed as argument. X proc tk_textBackspace w { X $w delete insert-1c insert } X # The procedure below compares three indices, a, b, and c. Index b must # be less than c. The procedure returns 1 if a is closer to b than to c, # and 0 otherwise. The "w" argument is the name of the text widget in # which to do the comparison. X proc tk_textIndexCloser {w a b c} { X set a [$w index $a] X set b [$w index $b] X set c [$w index $c] X if [$w compare $a <= $b] { X return 1 X } X if [$w compare $a >= $c] { X return 0 X } X scan $a "%d.%d" lineA chA X scan $b "%d.%d" lineB chB X scan $c "%d.%d" lineC chC X if {$chC == 0} { X incr lineC -1 X set chC [string length [$w get $lineC.0 $lineC.end]] X } X if {$lineB != $lineC} { X return [expr {($lineA-$lineB) < ($lineC-$lineA)}] X } X return [expr {($chA-$chB) < ($chC-$chA)}] } X # The procedure below is called to reset the selection anchor to # whichever end is FARTHEST from the index argument. X proc tk_textResetAnchor {w index} { X global tk_priv X if {[$w tag ranges sel] == ""} { X set tk_priv(selectMode) char X $w mark set anchor $index X return X } X if [tk_textIndexCloser $w $index sel.first sel.last] { X if {$tk_priv(selectMode) == "char"} { X $w mark set anchor sel.last X } else { X $w mark set anchor sel.last-1c X } X } else { X $w mark set anchor sel.first X } } SHAR_EOF $shar_touch -am 1015123693 'snmp2/tk/text.tcl' && chmod 0444 'snmp2/tk/text.tcl' || echo 'restore of snmp2/tk/text.tcl failed' shar_count="`wc -c < 'snmp2/tk/text.tcl'`" test 3124 -eq "$shar_count" || echo "snmp2/tk/text.tcl: original size 3124, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/tk/tk.tcl ============== if test -f 'snmp2/tk/tk.tcl' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/tk/tk.tcl (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/tk/tk.tcl (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/tk/tk.tcl' && # tk.tcl -- # # Initialization script normally executed in the interpreter for each # Tk-based application. Arranges class bindings for widgets. # # $Header: /user6/ouster/wish/scripts/RCS/tk.tcl,v 1.19 92/08/08 14:50:08 ouster Exp $ SPRITE (Berkeley) # # Copyright 1992 Regents of the University of California # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that this copyright # notice appears in all copies. The University of California # makes no representations about the suitability of this # software for any purpose. It is provided "as is" without # express or implied warranty. X # Insist on running with a compatible version of Tcl. X if "[info tclversion] != {6.4}" { X error "wrong version of Tcl loaded ([info tclversion]): need 6.4" } X # Initialize the auto-load path to include Tk's directory as well as # Tcl's directory: X set auto_path "$tk_library [info library]" X # Turn off strict Motif look and feel as a default. X set tk_strictMotif 0 X # ---------------------------------------------------------------------- # Class bindings for various flavors of button widgets. $tk_priv(window) # keeps track of the button containing the mouse, and $tk_priv(relief) # saves the original relief of the button so it can be restored when # the mouse button is released. # ---------------------------------------------------------------------- X bind Button {tk_butEnter %W} bind Button {tk_butLeave %W} bind Button <1> {tk_butDown %W} bind Button {tk_butUp %W} X bind CheckButton {tk_butEnter %W} bind CheckButton {tk_butLeave %W} bind CheckButton <1> {tk_butDown %W} bind CheckButton {tk_butUp %W} X bind RadioButton {tk_butEnter %W} bind RadioButton {tk_butLeave %W} bind RadioButton <1> {tk_butDown %W} bind RadioButton {tk_butUp %W} X # ---------------------------------------------------------------------- # Class bindings for entry widgets. # ---------------------------------------------------------------------- X bind Entry <1> { X %W cursor @%x X %W select from @%x X if {[lindex [%W config -state] 4] == "normal"} {focus %W} } bind Entry {%W select to @%x} bind Entry {%W select adjust @%x} bind Entry {%W select to @%x} bind Entry <2> {%W scan mark %x} bind Entry {%W scan dragto %x} bind Entry { X if {"%A" != ""} { X %W insert cursor %A X tk_entrySeeCaret %W X } } bind Entry {tk_entryBackspace %W; tk_entrySeeCaret %W} bind Entry {tk_entryBackspace %W; tk_entrySeeCaret %W} bind Entry {tk_entryBackspace %W; tk_entrySeeCaret %W} bind Entry {%W delete sel.first sel.last; tk_entrySeeCaret %W} bind Entry {%W delete 0 end} bind Entry {%W insert cursor [selection get]; tk_entrySeeCaret %W} bind Entry {tk_entryBackword %W; tk_entrySeeCaret %W} tk_bindForTraversal Entry X # ---------------------------------------------------------------------- # Class bindings for listbox widgets. # ---------------------------------------------------------------------- X bind Listbox <1> {%W select from [%W nearest %y]} bind Listbox {%W select to [%W nearest %y]} bind Listbox {%W select adjust [%W nearest %y]} bind Listbox {%W select to [%W nearest %y]} bind Listbox <2> {%W scan mark %x %y} bind Listbox {%W scan dragto %x %y} X # ---------------------------------------------------------------------- # Class bindings for scrollbar widgets. When strict Motif is requested, # the bindings use $tk_priv(buttons) and $tk_priv(activeFg) to set the # -activeforeground color to -foreground when the mouse is in the window # and restore it when the mouse leaves. # ---------------------------------------------------------------------- X bind Scrollbar { X if $tk_strictMotif { X set tk_priv(activeFg) [lindex [%W config -activeforeground] 4] X %W config -activeforeground [lindex [%W config -foreground] 4] X } } bind Scrollbar { X if {$tk_strictMotif && ($tk_priv(buttons) == 0)} { X %W config -activeforeground $tk_priv(activeFg) X } } bind Scrollbar {incr tk_priv(buttons)} bind Scrollbar {incr tk_priv(buttons) -1} X # ---------------------------------------------------------------------- # Class bindings for scale widgets. When strict Motif is requested, # the bindings use $tk_priv(buttons) and $tk_priv(activeFg) to set the # -activeforeground color to -foreground when the mouse is in the window # and restore it when the mouse leaves. # ---------------------------------------------------------------------- X bind Scale { X if $tk_strictMotif { X set tk_priv(activeFg) [lindex [%W config -activeforeground] 4] X %W config -activeforeground [lindex [%W config -sliderforeground] 4] X } } bind Scale { X if {$tk_strictMotif && ($tk_priv(buttons) == 0)} { X %W config -activeforeground $tk_priv(activeFg) X } } bind Scale {incr tk_priv(buttons)} bind Scale {incr tk_priv(buttons) -1} X # ---------------------------------------------------------------------- # Class bindings for menubutton widgets. Variables used: # $tk_priv(posted) - keeps track of the menubutton whose menu is # currently posted (or empty string, if none). # $tk_priv(inMenuButton)- if non-null, identifies menu button # containing mouse pointer. # $tk_priv(relief) - keeps track of original relief of posted # menu button, so it can be restored later. # $tk_priv(dragging) - if non-null, identifies menu button whose # menu is currently being dragged in a tear-off # operation. # $tk_priv(focus) - records old focus window so focus can be # returned there after keyboard traversal # to menu. # ---------------------------------------------------------------------- X bind Menubutton { X set tk_priv(inMenuButton) %W X if {[lindex [%W config -state] 4] != "disabled"} { X if {!$tk_strictMotif} { X %W config -state active X } X } } bind Menubutton { X set tk_priv(inMenuButton) {} X if {[lindex [%W config -state] 4] != "disabled"} { X if {!$tk_strictMotif} { X %W config -state normal X } X } } bind Menubutton <1> {tk_mbButtonDown %W} bind Menubutton { X if {($tk_priv(inMenuButton) != "") && ($tk_priv(posted) != "")} { X [lindex [$tk_priv(posted) config -menu] 4] activate 0 X } else { X tk_mbUnpost X } } X # In the binding below, it's important to ignore grab-related entries # and exits because they lag reality and can cause menus to chase # their own tail, repeatedly posting and unposting. X bind Menubutton { X set tk_priv(inMenuButton) %W X if {([lindex [%W config -state] 4] != "disabled") X && ("%m" != "NotifyGrab") && ("%m" != "NotifyUngrab")} { X if {!$tk_strictMotif} { X %W config -state active X } X tk_mbPost %W X } } bind Menubutton <2> { X if {($tk_priv(posted) == "") X && ([lindex [%W config -state] 4] != "disabled")} { X set tk_priv(dragging) %W X [lindex [$tk_priv(dragging) config -menu] 4] post %X %Y X } } bind Menubutton { X if {$tk_priv(dragging) != ""} { X [lindex [$tk_priv(dragging) config -menu] 4] post %X %Y X } } bind Menubutton {set tk_priv(dragging) ""} X # ---------------------------------------------------------------------- # Class bindings for menu widgets. $tk_priv(x) and $tk_priv(y) are used # to keep track of the position of the mouse cursor in the menu window # during dragging of tear-off menus. $tk_priv(window) keeps track of # the menu containing the mouse, if any. # ---------------------------------------------------------------------- X bind Menu {set tk_priv(window) %W; %W activate @%y} bind Menu {set tk_priv(window) {}; %W activate none} bind Menu { X if {$tk_priv(window) != ""} { X %W activate @%y X } } bind Menu {tk_invokeMenu %W} bind Menu <2> {set tk_priv(x) %x; set tk_priv(y) %y} bind Menu { X if {$tk_priv(posted) == ""} { X %W post [expr %X-$tk_priv(x)] [expr %Y-$tk_priv(y)] X } } bind Menu { } bind Menu { } bind Menu {tk_mbUnpost} bind Menu {tk_traverseWithinMenu %W %A} bind Menu {tk_nextMenu -1} bind Menu {tk_nextMenu 1} bind Menu {tk_nextMenuEntry -1} bind Menu {tk_nextMenuEntry 1} bind Menu {tk_invokeMenu %W} X # ---------------------------------------------------------------------- # Class bindings for text widgets. $tk_priv(selectMode) holds one of # "char", "word", or "line" to indicate which selection mode is active. # ---------------------------------------------------------------------- X bind Text <1> { X set tk_priv(selectMode) char X %W mark set insert @%x,%y X %W mark set anchor insert X if {[lindex [%W config -state] 4] == "normal"} {focus %W} } bind Text { X set tk_priv(selectMode) word X %W mark set insert "@%x,%y wordstart" X tk_textSelectTo %W insert } bind Text { X set tk_priv(selectMode) line X %W mark set insert "@%x,%y linestart" X tk_textSelectTo %W insert } bind Text {tk_textSelectTo %W @%x,%y} bind Text { X tk_textResetAnchor %W @%x,%y X tk_textSelectTo %W @%x,%y } bind Text {tk_textSelectTo %W @%x,%y} bind Text <2> {%W scan mark %y} bind Text {%W scan dragto %y} bind Text { X if {"%A" != ""} { X %W insert insert %A X %W yview -pickplace insert X } } bind Text {%W insert insert \n; %W yview -pickplace insert} bind Text {tk_textBackspace %W; %W yview -pickplace insert} bind Text {tk_textBackspace %W; %W yview -pickplace insert} bind Text {tk_textBackspace %W; %W yview -pickplace insert} bind Text {%W delete sel.first sel.last} bind Text { X %W insert insert [selection get] X %W yview -pickplace insert } tk_bindForTraversal Text X # Initialize the elements of tk_priv that require initialization. X set tk_priv(buttons) 0 set tk_priv(dragging) {} set tk_priv(focus) {} set tk_priv(inMenuButton) {} set tk_priv(posted) {} set tk_priv(selectMode) char set tk_priv(window) {} SHAR_EOF $shar_touch -am 1015123693 'snmp2/tk/tk.tcl' && chmod 0444 'snmp2/tk/tk.tcl' || echo 'restore of snmp2/tk/tk.tcl failed' shar_count="`wc -c < 'snmp2/tk/tk.tcl'`" test 10433 -eq "$shar_count" || echo "snmp2/tk/tk.tcl: original size 10433, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/tk/tkerror.tcl ============== if test -f 'snmp2/tk/tkerror.tcl' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/tk/tkerror.tcl (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/tk/tkerror.tcl (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/tk/tkerror.tcl' && # This file contains a default version of the tkError procedure. It # just prints out a stack trace. X proc tkerror err { X global errorInfo X puts stdout "$errorInfo" } SHAR_EOF $shar_touch -am 1015123693 'snmp2/tk/tkerror.tcl' && chmod 0444 'snmp2/tk/tkerror.tcl' || echo 'restore of snmp2/tk/tkerror.tcl failed' shar_count="`wc -c < 'snmp2/tk/tkerror.tcl'`" test 174 -eq "$shar_count" || echo "snmp2/tk/tkerror.tcl: original size 174, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/tk/wish.tcl ============== if test -f 'snmp2/tk/wish.tcl' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/tk/wish.tcl (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/tk/wish.tcl (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/tk/wish.tcl' && # wish.tcl -- # # This script is invoked by the "wish" program whenever it starts up. # It invokes initialization scripts for Tcl and Tk, then does a few # wish-specific things like setting the window geometry, if one was # specified. # # $Header: /user6/ouster/wish/scripts/RCS/wish.tcl,v 1.1 92/03/06 09:40:56 ouster Exp $ SPRITE (Berkeley) # # Copyright 1992 Regents of the University of California # Permission to use, copy, modify, and distribute this # software and its documentation for any purpose and without # fee is hereby granted, provided that this copyright # notice appears in all copies. The University of California # makes no representations about the suitability of this # software for any purpose. It is provided "as is" without # express or implied warranty. # X source [info library]/init.tcl source $tk_library/tk.tcl X if [info exists geometry] { X wm geometry . $geometry } SHAR_EOF $shar_touch -am 1015123693 'snmp2/tk/wish.tcl' && chmod 0444 'snmp2/tk/wish.tcl' || echo 'restore of snmp2/tk/wish.tcl failed' shar_count="`wc -c < 'snmp2/tk/wish.tcl'`" test 901 -eq "$shar_count" || echo "snmp2/tk/wish.tcl: original size 901, current size $shar_count" rm -f _sharnew.tmp fi # ============= snmp2/tk/tclIndex ============== if test -f 'snmp2/tk/tclIndex' && test X"$1" != X"-c"; then echo 'x - skipping snmp2/tk/tclIndex (file already exists)' rm -f _sharnew.tmp else > _sharnew.tmp echo 'x - extracting snmp2/tk/tclIndex (text)' sed 's/^X//' << 'SHAR_EOF' > 'snmp2/tk/tclIndex' && # Tcl autoload index file: each line identifies a Tcl # procedure and the file where that procedure is # defined. Generated by the "auto_mkindex" command. X tk_entryBackspace entry.tcl tk_entryBackword entry.tcl tk_entrySeeCaret entry.tcl tk_butEnter button.tcl tk_butLeave button.tcl tk_butDown button.tcl tk_butUp button.tcl tk_menus menu.tcl tk_bindForTraversal menu.tcl tk_mbPost menu.tcl tk_mbUnpost menu.tcl tk_traverseToMenu menu.tcl tk_traverseWithinMenu menu.tcl tk_getMenuButtons menu.tcl SHAR_EOF : || echo 'restore of snmp2/tk/tclIndex failed' fi echo 'End of snmp2 part 21' echo 'File snmp2/tk/tclIndex is continued in part 22' echo 22 > _sharseq.tmp exit 0