home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-08-18 | 222.8 KB | 7,415 lines |
- #!/bin/osavtcl
- # Copyright (c) 1992-1998 The Santa Cruz Operation, Inc.. All Rights Reserved.
- #
- # THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE
- # SANTA CRUZ OPERATION INC.
- #
- # The copyright notice above does not evidence any actual or intended
- # publication of such source code.
-
- #******************************************************************************
- #
- # Copyright (C) 1992-1998 The Santa Cruz Operation, Inc.
- # All Rights Reserved.
- #
- # The information in this file is provided for the exclusive use of
- # the licensees of The Santa Cruz Operation, Inc. Such users have the
- # right to use, modify, and incorporate this code into other products
- # for purposes authorized by the license agreement provided they include
- # this notice and the associated copyright notice with any such product.
- # The information in this file is provided "AS IS" without warranty.
- #
- #===============================================================================
- #@package: SCO_PPP_MSGS SCO_PPP_MSGS
- proc SCO_PPP_MSGS {} {}
- global SCO_PPP_MSGS
- set SCO_PPP_MSGS(@catalog@) {ppp.cat@sa 1}
- set SCO_PPP_MSGS(MSG_SHORT_TITLE) {1 {PPP Manager}}
- set SCO_PPP_MSGS(MSG_TITLE) {2 {PPP Manager on %1$s}}
- set SCO_PPP_MSGS(MSG_PROMPT) {3 {PPP configuration on %1$s:}}
- set SCO_PPP_MSGS(MSG_PDHOST) {4 Host}
- set SCO_PPP_MSGS(MSG_MN_PDHOST) {5 t}
- set SCO_PPP_MSGS(MSG_PBOPEN) {6 {Open Host...}}
- set SCO_PPP_MSGS(MSG_MN_PBOPEN) {7 O}
- set SCO_PPP_MSGS(MSG_SH_PBOPEN) {8 {Open manager on another host}}
- set SCO_PPP_MSGS(MSG_PBEXIT) {9 Exit}
- set SCO_PPP_MSGS(MSG_MN_PBEXIT) {10 x}
- set SCO_PPP_MSGS(MSG_SH_PBEXIT) {11 {Exit manager}}
- set SCO_PPP_MSGS(MSG_PDOPTIONS) {12 Options}
- set SCO_PPP_MSGS(MSG_MN_PDOPTIONS) {13 O}
- set SCO_PPP_MSGS(MSG_HDR_DL_BUNDLE) {14 Bundles}
- set SCO_PPP_MSGS(MSG_HDR_DL_LINK) {15 {Link Groups}}
- set SCO_PPP_MSGS(MSG_HDR_DL_AUTH) {16 {PPP Authentication}}
- set SCO_PPP_MSGS(MSG_MN_PDVIEW) {17 V}
- set SCO_PPP_MSGS(MSG_PDVIEW) {18 View}
- set SCO_PPP_MSGS(MSG_FTDVIEW) {19 View}
- set SCO_PPP_MSGS(MSG_MN_FTDVIEW) {20 V}
- set SCO_PPP_MSGS(MSG_MN_TBVIEW_AUTHS) {21 A}
- set SCO_PPP_MSGS(MSG_MN_TBVIEW_LINKS) {22 L}
- set SCO_PPP_MSGS(MSG_MN_TBVIEW_BUNDLES) {23 B}
- set SCO_PPP_MSGS(MSG_SH_TBVIEW_AUTHS) {24 {View the authentication database}}
- set SCO_PPP_MSGS(MSG_SH_TBVIEW_LINKS) {25 {View configured link groups}}
- set SCO_PPP_MSGS(MSG_SH_TBVIEW_BUNDLES) {26 {View configured bundles}}
- set SCO_PPP_MSGS(MSG_TBVIEW_AUTHS) {27 Authentication}
- set SCO_PPP_MSGS(MSG_TBVIEW_LINKS) {28 {Link Groups}}
- set SCO_PPP_MSGS(MSG_TBVIEW_BUNDLES) {29 Bundles}
- set SCO_PPP_MSGS(MSG_MN_PBVIEW_COLLAPSE) {30 C}
- set SCO_PPP_MSGS(MSG_MN_PBVIEW_COLLAPSEALL) {31 p}
- set SCO_PPP_MSGS(MSG_MN_PBVIEW_EXPAND) {32 E}
- set SCO_PPP_MSGS(MSG_MN_PBVIEW_EXPANDALL) {33 n}
- set SCO_PPP_MSGS(MSG_PBVIEW_COLLAPSE) {34 {Collapse Selected}}
- set SCO_PPP_MSGS(MSG_PBVIEW_COLLAPSEALL) {35 {Collapse All}}
- set SCO_PPP_MSGS(MSG_PBVIEW_EXPAND) {36 {Expand Selected}}
- set SCO_PPP_MSGS(MSG_PBVIEW_EXPANDALL) {37 {Expand All}}
- set SCO_PPP_MSGS(MSG_SH_PBVIEW_COLLAPSE) {38 {Collapse selected item}}
- set SCO_PPP_MSGS(MSG_SH_PBVIEW_COLLAPSEALL) {39 {Collapse all groups}}
- set SCO_PPP_MSGS(MSG_SH_PBVIEW_EXPAND) {40 {Expand selected item}}
- set SCO_PPP_MSGS(MSG_SH_PBVIEW_EXPANDALL) {41 {Expand all groups}}
- set SCO_PPP_MSGS(MSG_SB_INIT) {42 {Initializing manager...}}
- set SCO_PPP_MSGS(MSG_SB_READING) {43 {Reading configuration...}}
- set SCO_PPP_MSGS(MSG_SB_VERIFYING) {44 {Verifying configuration...}}
- set SCO_PPP_MSGS(MSG_SB_WRITING) {45 {Writing configuration...}}
- set SCO_PPP_MSGS(ERR_ONLY_ONE_PPP) {46 {The PPP Manager is already running}}
- set SCO_PPP_MSGS(ERR_ONLY_ONE_PIC) {47 {There is already a PPP Manager running.\n\nExit running PPP managers to continue.}}
- set SCO_PPP_MSGS(MSG_CICON_O) {48 out}
- set SCO_PPP_MSGS(MSG_CICON_I) {49 in}
- set SCO_PPP_MSGS(MSG_CICON_B) {50 bundle}
- set SCO_PPP_MSGS(MSG_CICON_BG) {51 BG}
- set SCO_PPP_MSGS(MSG_CICON_A) {52 name}
- set SCO_PPP_MSGS(MSG_CICON_L) {53 link}
- set SCO_PPP_MSGS(MSG_CICON_LG) {54 {link group}}
- set SCO_PPP_MSGS(MSG_CICON_IO) {55 bi-directional}
- set SCO_PPP_MSGS(MSG_CICON_AL) {56 AL}
- set SCO_PPP_MSGS(MSG_CICON_NP) {57 {network protocol}}
- set SCO_PPP_MSGS(MSG_CICON_LP) {58 {link protocol}}
- set SCO_PPP_MSGS(MSG_CICON_PA) {59 P}
- set SCO_PPP_MSGS(MSG_MN_PBDELETE) {60 D}
- set SCO_PPP_MSGS(MSG_MN_PBMODIFY) {61 M}
- set SCO_PPP_MSGS(MSG_MN_PDADD) {62 A}
- set SCO_PPP_MSGS(MSG_MN_PDEDIT) {63 E}
- set SCO_PPP_MSGS(MSG_PBDELETE) {64 Delete}
- set SCO_PPP_MSGS(MSG_PBMODIFY) {65 Modify...}
- set SCO_PPP_MSGS(MSG_PDADD) {66 Add}
- set SCO_PPP_MSGS(MSG_PDEDIT) {67 Edit}
- set SCO_PPP_MSGS(MSG_SH_PBDELETE) {68 {Deleted selected entry}}
- set SCO_PPP_MSGS(MSG_SH_PBMODIFY) {69 {Modify selected entry}}
- set SCO_PPP_MSGS(MSG_AUTH_BOTH) {70 {CHAP & PAP}}
- set SCO_PPP_MSGS(MSG_AUTH_CHAP) {71 CHAP}
- set SCO_PPP_MSGS(MSG_AUTH_CHAP_PEERSECRET) {72 {CHAP remote secret:}}
- set SCO_PPP_MSGS(MSG_AUTH_NAME) {73 {Authentication name:}}
- set SCO_PPP_MSGS(MSG_AUTH_PAP) {74 PAP}
- set SCO_PPP_MSGS(MSG_AUTH_PAP_PEERSECRET) {75 {PAP remote secret:}}
- set SCO_PPP_MSGS(MSG_TITLE_AUTH_ADD) {76 {Add PPP Authentication}}
- set SCO_PPP_MSGS(MSG_TITLE_AUTH_MOD) {77 {Modify PPP Authentication}}
- set SCO_PPP_MSGS(MSG_SH_AUTH_BOTH) {78 {Provide secrets for both CHAP and PAP}}
- set SCO_PPP_MSGS(MSG_SH_AUTH_CHAP) {79 {Provide secrets for CHAP only}}
- set SCO_PPP_MSGS(MSG_SH_AUTH_CHAP_PEERSECRET) {80 {CHAP secret when authenticated by remote}}
- set SCO_PPP_MSGS(MSG_SH_AUTH_NAME) {81 {Database look-up name}}
- set SCO_PPP_MSGS(MSG_SH_AUTH_PAP) {82 {Provide secrets for PAP only}}
- set SCO_PPP_MSGS(MSG_SH_AUTH_PAP_PEERSECRET) {83 {PAP secret when authenticated by remote}}
- set SCO_PPP_MSGS(MSG_AUTH_APROTOCOL) {84 {Authentication protocol:}}
- set SCO_PPP_MSGS(MSG_LINKS_NAME) {85 {Link group name:}}
- set SCO_PPP_MSGS(MSG_TITLE_LINKS_ADD) {86 {Add Link Group}}
- set SCO_PPP_MSGS(MSG_TITLE_LINKS_MOD) {87 {Modify Link Group}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_NAME) {88 {Name of link group}}
- set SCO_PPP_MSGS(ERR_LINKS_NAME_CREATE) {89 {Failed to create link group}}
- set SCO_PPP_MSGS(ERR_LINKS_NAME_DUPLICATE) {90 {Link group already exists}}
- set SCO_PPP_MSGS(ERR_LINKS_NAME_NULL) {91 {Link group name must be supplied}}
- set SCO_PPP_MSGS(MSG_CONFIRM_DELETE) {92 {Are you sure you want to delete the selected item?}}
- set SCO_PPP_MSGS(MSG_LINKS_FLOW) {93 {Flow control:}}
- set SCO_PPP_MSGS(MSG_LINKS_FLOW_HARDWARE) {94 Hardware}
- set SCO_PPP_MSGS(MSG_LINKS_FLOW_NONE) {95 None}
- set SCO_PPP_MSGS(MSG_LINKS_FLOW_SOFTWARE) {96 Software}
- set SCO_PPP_MSGS(MSG_LINKS_PHONE) {97 {Advertised phone number:}}
- set SCO_PPP_MSGS(MSG_LINKS_TYPES) {98 {Group link type:}}
- set SCO_PPP_MSGS(MSG_LINKS_TYPES_ACU) {99 {Modem (ACU)}}
- set SCO_PPP_MSGS(MSG_LINKS_TYPES_DIRECT) {100 Direct}
- set SCO_PPP_MSGS(MSG_LINKS_TYPES_ISDN_ASYNC) {101 {ISDN (async)}}
- set SCO_PPP_MSGS(MSG_LINKS_TYPES_ISDN_SYNC) {102 {ISDN (sync)}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_FLOW_HARDWARE) {103 {Use hardware flow control}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_FLOW_NONE) {104 {No flow control}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_FLOW_SOFTWARE) {105 {Use software flow control}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_MAXLINKS) {106 {Maximum number of concurrent links in multilink}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_PHONE) {107 {Advertised phone number to access the links}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_TYPES) {108 {Link group type}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_TYPES_ACU) {109 {Link group will contain only modem links}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_TYPES_DIRECT) {110 {Link group will contain static connections}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_TYPES_ISDN_ASYNC) {111 {Link group will contain asynchronous ISDN links}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_TYPES_ISDN_SYNC) {112 {Link group will contain synchronous ISDN links}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_FLOW) {113 {Flow control used by link group}}
- set SCO_PPP_MSGS(MSG_LINKS_BANDWIDTH) {114 {Estimate of single link bandwidth:}}
- set SCO_PPP_MSGS(MSG_LINKS_AVAIL) {115 {Available links}}
- set SCO_PPP_MSGS(MSG_LINKS_SEL) {116 {Selected links}}
- set SCO_PPP_MSGS(MSG_LINK_ADD) {117 {Add >>}}
- set SCO_PPP_MSGS(MSG_LINK_REMOVE) {118 {<< Remove}}
- set SCO_PPP_MSGS(MSG_TITLE_LINK_ADD) {119 {Add Links}}
- set SCO_PPP_MSGS(MSG_TITLE_LINK_MOD) {120 {Modify Links}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_AVAIL) {121 {List of links available for use within the link group}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_SEL) {122 {List of links selected for use within the link group}}
- set SCO_PPP_MSGS(MSG_SH_LINK_ADD) {123 {Add link to selected list of links}}
- set SCO_PPP_MSGS(MSG_SH_LINK_REMOVE) {124 {Remove link from selected list of links}}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_AUTHNAME) {125 {Override name for transmitted CHAP/PAP packets:}}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_PEERAUTHNAME) {126 {Override name for received CHAP/PAP packets:}}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_AUTHTMOUT) {127 {Time allowed for authentication phase:}}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_ED) {128 {Offer endpoint discrimination on incoming links:}}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_MRRU) {129 {MRRU offered on incoming links:}}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_ED_NO) {130 No}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_ED_YES) {131 Yes}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_CHAP) {132 {Authenticate remote using CHAP:}}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_CHAP_NO) {133 No}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_CHAP_YES) {134 Yes}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_PAP) {135 {Authenticate remote using PAP:}}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_PAP_NO) {136 No}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_PAP_YES) {137 Yes}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_SSN_NO) {138 No}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_SSN_YES) {139 Yes}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_SSN) {140 {Offer short sequence numbers on incoming links:}}
- set SCO_PPP_MSGS(MSG_TITLE_GLOBAL_BUNDLE) {141 {Global Bundle Parameters}}
- set SCO_PPP_MSGS(MSG_MN_PBGLOBAL_BUNDLE) {142 G}
- set SCO_PPP_MSGS(MSG_PBGLOBAL_BUNDLE) {143 {Global Bundle...}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_AUTHTMOUT) {144 {Time allowed for authentication phase to complete in seconds}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_MRRU) {145 {Offered maximum received reconstructed unit in bytes}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_AUTHNAME) {146 {Authentication name to override transmitted authentication packets}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_PEERAUTHNAME) {147 {Authentication name to override received authentication packets.}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_ED_NO) {148 {Do not offer endpoint discriminator}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_ED_YES) {149 {Offer endpoint discriminator}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_SSN_NO) {150 {Do not offer short sequence numbers}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_SSN_YES) {151 {Offer short sequence numbers}}
- set SCO_PPP_MSGS(MSG_SH_PBGLOBAL_BUNDLE) {152 {Global bundle values}}
- set SCO_PPP_MSGS(ERR_GLOBAL_BUNDLE_CREATE) {153 {Failed to create global bundle values}}
- set SCO_PPP_MSGS(ERR_GLOBAL_BUNDLE_REPLACE) {154 {Failed to change global bundle values}}
- set SCO_PPP_MSGS(MSG_BUNDLE_ED) {155 {Use endpoint discrimination:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_MRRU) {156 {Maximum received reconstructed unit size:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_ED_NO) {157 No}
- set SCO_PPP_MSGS(MSG_BUNDLE_ED_YES) {158 Yes}
- set SCO_PPP_MSGS(MSG_BUNDLE_SSN_NO) {159 No}
- set SCO_PPP_MSGS(MSG_BUNDLE_SSN_YES) {160 Yes}
- set SCO_PPP_MSGS(MSG_BUNDLE_SSN) {161 {Use short sequence numbers:}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_MRRU) {162 {Maximum received reconstructed unit in bytes}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_ED_NO) {163 {Do not use endpoint discrimination}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_ED_YES) {164 {Use endpoint discrimination}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_SSN_NO) {165 {Do not use short sequence numbers}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_SSN_YES) {166 {Use short sequence numbers}}
- set SCO_PPP_MSGS(MSG_BUNDLE_ADDLOAD) {167 {Load when links are added:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_ADDSAMPLE) {168 {Sample period for link additions:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_BOD) {169 {Bandwidth on demand:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_DROPLOAD) {170 {Load when links are removed:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_DROPSAMPLE) {171 {Sample period for link removals:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_MAXFRAGS) {172 {Maximum number of pending fragments:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_MAXIDLE) {173 {Inactivity timeout:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_MINFRAG) {174 {Packet size at which packet fragmentation starts:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_THRASHTIME) {175 {Minimum period between bandwidth changes:}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_ADDLOAD) {176 {Percentage of load at which new links are added}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_ADDSAMPLE) {177 {Time in seconds over which the load average for link additions is calculated}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_DROPLOAD) {178 {Percentage of load at which existing links are removed}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_DROPSAMPLE) {179 {Time in seconds over which the load average for link removals calculated}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_MAXFRAGS) {180 {Maximum number of pending fragments awaiting assembly per active link}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_MAXIDLE) {181 {Time in seconds of no activity before bundle is assumed inactive}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_MINFRAG) {182 {Packets with a size in bytes less than this value will not be fragmented}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_THRASHTIME) {183 {Minimum time in seconds between link additions and link removals}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_REQUIRE_CHAP_NO) {184 {Remote system need not authenticate using CHAP}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_REQUIRE_CHAP_YES) {185 {Remote system must authenticate using CHAP}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_REQUIRE_PAP_NO) {186 {Remote system need not authenticate using PAP}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_REQUIRE_PAP_YES) {187 {Remote system must authenticate using PAP}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_BOD) {188 {Bandwidth on demand enabled for call initiator}}
- set SCO_PPP_MSGS(MSG_BOD_NONE) {189 none}
- set SCO_PPP_MSGS(MSG_BOD_ANY) {190 {incoming & outgoing initiated calls}}
- set SCO_PPP_MSGS(MSG_BOD_IN) {191 {incoming initiated calls only}}
- set SCO_PPP_MSGS(MSG_BOD_OUT) {192 {outgoing initiated calls only}}
- set SCO_PPP_MSGS(MSG_BUNDLE_FT_BOD) {193 Bandwidth}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_BOD) {194 {Bandwidth on demand parameters}}
- set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_BOD) {195 {Bandwidth on demand parameters:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_CALLERID) {196 {Caller ID:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_LOGIN) {197 {Login user name:}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_CALLERID) {198 {Caller's identity contained in call information}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_LOGIN) {199 {Caller's identity when logging in through PPP shell}}
- set SCO_PPP_MSGS(MSG_NPROTOCOLS) {200 {Network protocols:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_FT_NPROTOCOLS) {201 {Network Protocols}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_NPROTOCOLS) {202 {Available network protocols}}
- set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_NPROTOCOLS) {203 {Network protocols available:}}
- set SCO_PPP_MSGS(MSG_SH_NPROTOCOLS) {204 {Network protocols available for inclusion in bundle}}
- set SCO_PPP_MSGS(MSG_LINK_FT_LPROTOCOLS) {205 {Link Protocols}}
- set SCO_PPP_MSGS(MSG_TITLE_LINK_FT_LPROTOCOLS) {206 {Link protocols available:}}
- set SCO_PPP_MSGS(MSG_SH_LINK_FT_LPROTOCOLS) {207 {Available link protocols}}
- set SCO_PPP_MSGS(MSG_BUNDLE_FT_LPROTOCOLS) {208 {Link Protocols}}
- set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_LPROTOCOLS) {209 {Link protocols available:}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_LPROTOCOLS) {210 {Available link protocols}}
- set SCO_PPP_MSGS(MSG_LPROTOCOLS) {211 {Link protocols:}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_LPROTOCOLS) {212 {Link protocols available for inclusion in bundle}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_LPROTOCOLS) {213 {Link protocols available for inclusion in link group}}
- set SCO_PPP_MSGS(ERR_NPROTOCOLS_ONE_SELECTED) {214 {At least one network protocol must be selected}}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_FT_AUTH) {215 Authentication}
- set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_FT_MULTILINK) {216 Multilink}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_FT_AUTH) {217 {Authentication parameters}}
- set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_FT_MULTILINK) {218 {Multilink parameters}}
- set SCO_PPP_MSGS(MSG_TITLE_GLOBAL_BUNDLE_FT_AUTH) {219 {Authentication parameters:}}
- set SCO_PPP_MSGS(MSG_TITLE_GLOBAL_BUNDLE_FT_MULTILINK) {220 {Multilink parameters:}}
- set SCO_PPP_MSGS(ERR_BUNDLE_CREATE) {221 {Failed to create bundle entry}}
- set SCO_PPP_MSGS(ERR_BUNDLE_NAME_EXIST) {222 {Bundle name already exists}}
- set SCO_PPP_MSGS(ERR_BUNDLE_NAME_NULL) {223 {Bundle name must be supplied}}
- set SCO_PPP_MSGS(ERR_BUNDLE_REMOTESYS_NULL) {224 {Remote system name must be supplied}}
- set SCO_PPP_MSGS(ERR_BUNDLE_RENAME) {225 {Failed to rename bundle entry}}
- set SCO_PPP_MSGS(ERR_BUNDLE_REPLACE) {226 {Failed to change bundle entry}}
- set SCO_PPP_MSGS(MSG_BRINGUP_AUTOMATIC) {227 {automatically (on demand)}}
- set SCO_PPP_MSGS(MSG_BRINGUP_MANUAL) {228 {manually (via pppattach)}}
- set SCO_PPP_MSGS(MSG_BUNDLE_AUTHTMOUT) {229 {Time allowed for authentication phase:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_BRINGUP) {230 {Method of initiating links:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_FT_AUTH) {231 Authentication}
- set SCO_PPP_MSGS(MSG_BUNDLE_FT_MULTILINK) {232 Multilink}
- set SCO_PPP_MSGS(MSG_BUNDLE_FT_BUNDLE) {233 Bundle}
- set SCO_PPP_MSGS(MSG_BUNDLE_MAXLINKS) {234 {Maximum number of active links:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_MINLINKS) {235 {Minimum number of active links:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_NAME) {236 {Bundle name:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_AUTHNAME) {237 {Override name for transmitted CHAP/PAP packets:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_PEERAUTHNAME) {238 {Override name for received CHAP/PAP packets:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_REMOTESYS) {239 {Remote system name:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_CHAP) {240 {Require remote to authenticate using CHAP:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_CHAP_NO) {241 No}
- set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_CHAP_YES) {242 Yes}
- set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_PAP) {243 {Require remote to authenticate using PAP:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_PAP_NO) {244 No}
- set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_PAP_YES) {245 Yes}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_AUTHTMOUT) {246 {Time allowed for authentication phase to complete in seconds}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_AUTH) {247 {Authentication parameters}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_MULTILINK) {248 {Multilink parameters}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_BUNDLE) {249 {Bundle parameters}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_MAXLINKS) {250 {Maximum number of active links allowed}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_MINLINKS) {251 {Minimum number of links to keep active when removing links}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_NAME) {252 {Name of bundle}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_AUTHNAME) {253 {Authentication name to override transmitted authentication packets}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_PEERAUTHNAME) {254 {Authentication name to override received authentication packets}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_REMOTESYS) {255 {Remote system name to dial up}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_REQUIRE_CHAP_NO) {256 {Remote system need not authenticate using CHAP}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_REQUIRE_CHAP_YES) {257 {Remote system must authenticate using CHAP}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_REQUIRE_PAP_NO) {258 {Remote system need not authenticate using PAP}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_REQUIRE_PAP_YES) {259 {Remote system must authenticate using PAP}}
- set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_ADD) {260 {Add Bundle}}
- set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_MOD) {261 {Modify Bundle}}
- set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_AUTH) {262 {Authentication parameters:}}
- set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_MULTILINK) {263 {Multilink parameters:}}
- set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_BUNDLE) {264 {Bundle parameters:}}
- set SCO_PPP_MSGS(MSG_LGS_AVAIL) {265 {Available link groups}}
- set SCO_PPP_MSGS(MSG_LGS_SEL) {266 {Selected link groups}}
- set SCO_PPP_MSGS(MSG_LG_ADD) {267 {Add >>}}
- set SCO_PPP_MSGS(MSG_LG_REMOVE) {268 {<< Remove}}
- set SCO_PPP_MSGS(MSG_SH_LGS_AVAIL) {269 {Link groups available}}
- set SCO_PPP_MSGS(MSG_SH_LGS_SEL) {270 {Link groups selected}}
- set SCO_PPP_MSGS(MSG_SH_LG_ADD) {271 {Add link group to selected list}}
- set SCO_PPP_MSGS(MSG_SH_LG_REMOVE) {272 {Remove link group from selected list}}
- set SCO_PPP_MSGS(MSG_TITLE_LG_ADD) {273 {Add Links}}
- set SCO_PPP_MSGS(MSG_TITLE_LG_MOD) {274 {Modify Links}}
- set SCO_PPP_MSGS(ERR_LG_DELETE) {275 {Failed to remove link group entry}}
- set SCO_PPP_MSGS(ERR_LG_REPLACE) {276 {Failed to replace link group entry}}
- set SCO_PPP_MSGS(ERR_BUNDLE_DELETE) {277 {Failed to delete bundle entry}}
- set SCO_PPP_MSGS(ERR_PROTOCOL_DELETE) {278 {Failed to delete protocol entry}}
- set SCO_PPP_MSGS(ERR_PROTOCOL_NETWORK_ONE) {279 {Deleting the last network protocol is not permitted}}
- set SCO_PPP_MSGS(MSG_LINKS_POP) {280 {Modules popped before use:}}
- set SCO_PPP_MSGS(MSG_LINKS_PUSH) {281 {Modules pushed before use:}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_POP) {282 {Streams modules that must be removed before use by PPP}}
- set SCO_PPP_MSGS(MSG_SH_LINKS_PUSH) {283 {Streams modules that must be added before use by PPP}}
- set SCO_PPP_MSGS(MSG_BUNDLE_FT_ADVANCED) {284 Advanced}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_ADVANCED) {285 {Advanced parameters}}
- set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_ADVANCED) {286 {Advanced parameters:}}
- set SCO_PPP_MSGS(MSG_LINK_FT_ADVANCED) {287 Advanced}
- set SCO_PPP_MSGS(MSG_SH_LINK_FT_ADVANCED) {288 {Advanced parameters}}
- set SCO_PPP_MSGS(MSG_TITLE_LINK_FT_ADVANCED) {289 {Advanced parameters:}}
- set SCO_PPP_MSGS(ERR_LINKS_DELETE) {290 {Failed to delete link group entry}}
- set SCO_PPP_MSGS(ERR_PROTOCOL_LCP_DELETE) {291 {Deleting the LCP protocol entry is not permitted}}
- set SCO_PPP_MSGS(ERR_PROTOCOL_LCP_DESELECT) {292 {The LCP protocol must always be selected}}
- set SCO_PPP_MSGS(ERR_PROTOCOL_REPLACE) {293 {Failed to replace protocol entry}}
- set SCO_PPP_MSGS(MSG_FT_LINKS) {294 {Link Group}}
- set SCO_PPP_MSGS(MSG_SH_FT_LINKS) {295 {Link group parameters}}
- set SCO_PPP_MSGS(MSG_TITLE_FT_LINKS) {296 {Link group parameters:}}
- set SCO_PPP_MSGS(MSG_FILE_SEL) {297 {Select File}}
- set SCO_PPP_MSGS(ERR_GUI_NOT_FOUND) {298 {The manager required for this option is not available}}
- set SCO_PPP_MSGS(ERR_GUI_FAILED) {299 {The SCOadmin manager required for this option is unavailable}}
- set SCO_PPP_MSGS(ERR_BUNDLE_LOGIN_NULL) {300 {Login name must be supplied if not auto detecting PPP session}}
- set SCO_PPP_MSGS(MSG_BUNDLE_AUTO_DETECT) {301 {Use auto-detected PPP session:}}
- set SCO_PPP_MSGS(MSG_BUNDLE_AUTO_DETECT_NO) {302 No}
- set SCO_PPP_MSGS(MSG_BUNDLE_AUTO_DETECT_YES) {303 Yes}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_AUTO_DETECT_NO) {304 {Caller must log in}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_AUTO_DETECT_YES) {305 {Caller is automatically detected via caller ID and authentication ID}}
- set SCO_PPP_MSGS(MSG_TITLE_LPROTOCOLS_ADD) {306 {Add Link Protocols}}
- set SCO_PPP_MSGS(MSG_TITLE_LPROTOCOLS_MOD) {307 {Modify Link Protocols}}
- set SCO_PPP_MSGS(MSG_TITLE_NPROTOCOLS_ADD) {308 {Add Network Protocols}}
- set SCO_PPP_MSGS(MSG_TITLE_NPROTOCOLS_MOD) {309 {Modify Network Protocols}}
- set SCO_PPP_MSGS(ERR_PROTOCOL_CREATE) {310 {Failed to create protocol entry}}
- set SCO_PPP_MSGS(ERR_PROTOCOL_FAILED) {311 {Unable to change protocol entry}}
- set SCO_PPP_MSGS(MSG_PROTOCOL_DIALOG_BUILD) {312 {Building protocol dialog...}}
- set SCO_PPP_MSGS(ERR_LINKS_CREATE) {313 {Failed to create link group entry}}
- set SCO_PPP_MSGS(MSG_MN_PBAUTH_ADD_NAME) {314 N}
- set SCO_PPP_MSGS(MSG_MN_PBBUNDLES_ADD_BUNDLE) {315 B}
- set SCO_PPP_MSGS(MSG_MN_PBBUNDLES_ADD_LG) {316 G}
- set SCO_PPP_MSGS(MSG_MN_PBBUNDLES_ADD_LP) {317 L}
- set SCO_PPP_MSGS(MSG_MN_PBBUNDLES_ADD_NP) {318 N}
- set SCO_PPP_MSGS(MSG_MN_PBLINKS_ADD_LG) {319 G}
- set SCO_PPP_MSGS(MSG_MN_PBLINKS_ADD_LINK) {320 i}
- set SCO_PPP_MSGS(MSG_MN_PBLINKS_ADD_LP) {321 L}
- set SCO_PPP_MSGS(MSG_PBAUTH_ADD_NAME) {322 Name...}
- set SCO_PPP_MSGS(MSG_PBBUNDLES_ADD_BUNDLE) {323 Bundle...}
- set SCO_PPP_MSGS(MSG_PBBUNDLES_ADD_LG) {324 {Link Groups...}}
- set SCO_PPP_MSGS(MSG_PBBUNDLES_ADD_LP) {325 {Link Protocol...}}
- set SCO_PPP_MSGS(MSG_PBBUNDLES_ADD_NP) {326 {Network Protocol...}}
- set SCO_PPP_MSGS(MSG_PBLINKS_ADD_LINK) {327 Links...}
- set SCO_PPP_MSGS(MSG_PBLINKS_ADD_LP) {328 {Link Protocol...}}
- set SCO_PPP_MSGS(MSG_PBLINLS_ADD_LG) {329 {Link Group...}}
- set SCO_PPP_MSGS(MSG_CICON_D) {330 disabled}
- set SCO_PPP_MSGS(MSG_BUNDLE_TYPE) {331 Type:}
- set SCO_PPP_MSGS(MSG_BUNDLE_TYPE_INCOMING) {332 Incoming}
- set SCO_PPP_MSGS(MSG_BUNDLE_TYPE_OUTGOING) {333 Outgoing}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_TYPE_INCOMING) {334 {Enable/disable incoming bundle connections}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_TYPE_OUTGOING) {335 {Enable/disable outgoing bundle connections}}
- set SCO_PPP_MSGS(MSG_BUNDLE_AUTHID) {336 {Authentication ID:}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_AUTHID) {337 {Bundle is used if received authentication ID matches this name}}
- set SCO_PPP_MSGS(MSG_SH_AUTH_CHAP_LOCALSECRET) {338 {CHAP secret when authenticating remote}}
- set SCO_PPP_MSGS(MSG_SH_AUTH_PAP_LOCALSECRET) {339 {PAP secret when authenticating remote}}
- set SCO_PPP_MSGS(MSG_AUTH_CHAP_LOCALSECRET) {340 {CHAP local secret:}}
- set SCO_PPP_MSGS(MSG_AUTH_PAP_LOCALSECRET) {341 {PAP local secret:}}
- set SCO_PPP_MSGS(ERR_AUTH_CHAP_CREATE) {342 {Failed to create CHAP authentication entry}}
- set SCO_PPP_MSGS(ERR_AUTH_CHAP_DELETE) {343 {Failed to delete CHAP authentication entry}}
- set SCO_PPP_MSGS(ERR_AUTH_CHAP_REPLACE) {344 {Failed to replace CHAP authentication entry}}
- set SCO_PPP_MSGS(ERR_AUTH_PAP_CREATE) {345 {Failed to create PAP authentication entry}}
- set SCO_PPP_MSGS(ERR_AUTH_PAP_DELETE) {346 {Failed to delete PAP authentication entry}}
- set SCO_PPP_MSGS(ERR_AUTH_PAP_REPLACE) {347 {Failed to replace PAP authentication entry}}
- set SCO_PPP_MSGS(ERR_AUTH_NAME_DUPLICATE) {348 {The name already exists in the authentication database}}
- set SCO_PPP_MSGS(ERR_AUTH_NAME_NULL) {349 {The name must be supplied}}
- set SCO_PPP_MSGS(MSG_VERSION) {350 {PPP Manager %s}}
- set SCO_PPP_MSGS(ERR_NO_DEVS) {351 {There are no devices available.\n\nUse the Network Configuration Manager to add devices.}}
- set SCO_PPP_MSGS(MSG_AUTO_CREATE_GROUPS) {352 {Automatically create default link groups?}}
- set SCO_PPP_MSGS(ERR_GET_SERVER_CONFIG) {353 {Failed to read PPP configuration.}}
- set SCO_PPP_MSGS(ERR_SET_SERVER_CONFIG) {354 {Failed to save PPP configuration.}}
- set SCO_PPP_MSGS(ERR_BUNDLE_CALLER_AUTH_NULL) {355 {One of caller ID or authentication ID must be supplied}}
- set SCO_PPP_MSGS(MSG_WIDGET_VALIDATE) {356 {Verifying values...}}
- set SCO_PPP_MSGS(MSG_WIDGET_SET_VALUES) {357 {Setting values...}}
- set SCO_PPP_MSGS(ERR_PPP_USER_CREATE_FAILED) {358 {Failed to create the PPP user.\n\nUse the account manager to create the PPP user.}}
- set SCO_PPP_MSGS(MSG_AUTO_CREATE_STATUS) {359 {Creating link groups, please wait}}
- set SCO_PPP_MSGS(MSG_TITLE_PASSWD) {360 {Set password for PPP user %1s}}
- set SCO_PPP_MSGS(MSG_PASSWD1) {361 {Enter password:}}
- set SCO_PPP_MSGS(MSG_SH_PASSWD1) {362 {Password for PPP user}}
- set SCO_PPP_MSGS(MSG_PASSWD2) {363 {Confirm password:}}
- set SCO_PPP_MSGS(MSG_SH_PASSWD2) {364 {Confirm password for PPP user}}
- set SCO_PPP_MSGS(ERR_PPP_PASSWD_NOT_MATCH) {365 {The passwords entered are not the same}}
- set SCO_PPP_MSGS(ERR_PPP_PASSWD_SET_FAILED) {366 {Failed to set password for user %1s}}
- set SCO_PPP_MSGS(MSG_TIP_CREATE_BUNDLES) {367 {Create incoming and outgoing configurations\nby selecting Add Bundle from the Edit menu}}
- set SCO_PPP_MSGS(ERR_BUNDLE_NO_NETWORK_PROTOCOLS) {368 {No network protocols available}}
- set SCO_PPP_MSGS(ERR_BUNDLE_NO_LINK_PROTOCOLS) {369 {No link protocols available}}
- set SCO_PPP_MSGS(ERR_LINKS_NO_LINK_PROTOCOLS) {370 {No link protocols available}}
- set SCO_PPP_MSGS(MSG_BUNDLE_REMOTESYS_OUTGOING_EXIT) {371 {Return to PPP}}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_REMOTESYS_OUTGOING_EXIT) {372 {Return to the PPP manager}}
- set SCO_PPP_MSGS(MSG_MN_BUNDLE_REMOTESYS_OUTGOING_EXIT) {373 R}
- set SCO_PPP_MSGS(MSG_BUNDLE_REMOTESYS_EDIT) {374 Edit...}
- set SCO_PPP_MSGS(MSG_SH_BUNDLE_REMOTESYS_EDIT) {375 {Edit remote system attributes}}
- set SCO_PPP_MSGS(MSG_L_LINK_GROUP_UNKNOWN) {376 ?}
- set SCO_PPP_MSGS(MSG_L_LINK_GROUP_TYPE) {377 type}
- set SCO_PPP_MSGS(MSG_L_LINK_GROUP_TYPE_PSTN) {378 ACU}
- set SCO_PPP_MSGS(MSG_L_LINK_GROUP_TYPE_ISDN_SYNC) {379 {ISDN sync}}
- set SCO_PPP_MSGS(MSG_L_LINK_GROUP_TYPE_ISDN_ASYNC) {380 {ISDN async}}
- set SCO_PPP_MSGS(MSG_L_LINK_GROUP_TYPE_STATIC) {381 direct}
- set SCO_PPP_MSGS(MSG_L_LINK_GROUP_FLOW) {382 flow}
- set SCO_PPP_MSGS(MSG_L_LINK_GROUP_FLOW_HARDWARE) {383 hardware}
- set SCO_PPP_MSGS(MSG_L_LINK_GROUP_FLOW_SOFTWARE) {384 software}
- set SCO_PPP_MSGS(MSG_L_LINK_GROUP_FLOW_NONE) {385 none}
- set SCO_PPP_MSGS(MSG_L_LINK_GROUP_PHONE) {386 phone}
- set SCO_PPP_MSGS(MSG_L_BUNDLE_DISABLED) {387 DISABLED}
- set SCO_PPP_MSGS(MSG_L_BUNDLE_OUTGOING) {388 system}
- set SCO_PPP_MSGS(MSG_L_BUNDLE_INCOMING_LOGIN) {389 login}
- set SCO_PPP_MSGS(MSG_L_BUNDLE_INCOMING_CALLERID) {390 {caller ID}}
- set SCO_PPP_MSGS(MSG_L_BUNDLE_INCOMING_AUTHID) {391 {authentication ID}}
- set SCO_PPP_MSGS(MSG_L_AUTH_PROTOCOLS) {392 protocols}
- set SCO_PPP_MSGS(MSG_CICON_UP) {393 ^}
- set SCO_PPP_MSGS(ERR_NO_INTERVAL) {394 {Must specify an interval time}}
- set SCO_PPP_MSGS(MSG_AUTO_REFRESH_TITLE) {395 {Set Auto Refresh Interval}}
- set SCO_PPP_MSGS(MSG_AUTO_REFRESH_LABEL) {396 {Refresh interval (minutes):}}
- set SCO_PPP_MSGS(MSG_REFRESHING) {397 Refreshing...}
- set SCO_PPP_MSGS(MSG_PBVIEW_REFRESH_SH) {398 {Current view}}
- set SCO_PPP_MSGS(MSG_CICON_S) {399 S}
- set SCO_PPP_MSGS(MSG_TITLE_ADD) {400 Add}
- set SCO_PPP_MSGS(MSG_TITLE_MOD) {401 Modify}
- ##################################################
- proc dl:Globals {} {
- uplevel 1 global dl_field dl_format dl_poslist dl_def dl_list dl_index \
- dl_iconList dl_icon dl_visposlist dl_vislist dl_levels \
- dl_charmIconList dl_extra dl_types dl_defer
- }
- proc dl:iconList {{mode ""}} {
- dl:Globals
- if {[cequal $mode CHARM]} {
- return $dl_charmIconList
- } else {
- return $dl_iconList
- }
- }
- proc dl:addicon {icon pixmap {iconpath ""} {charm ""}} {
- dl:Globals
- if {![cequal $iconpath ""] && ![cequal [csubstr $iconpath end 1] "/"]} {
- set iconpath ${iconpath}/
- }
- if {![info exist dl_iconList]} {
- set dl_iconList ""
- dl:addicon CE expand.px /usr/lib/scoadmin/neticons "+"
- dl:addicon CC collapse.px /usr/lib/scoadmin/neticons "-"
- dl:addicon CN none.px /usr/lib/scoadmin/neticons " "
- }
- set dl_icon($icon) [llength $dl_iconList]
- lappend dl_iconList ${iconpath}$pixmap
- lappend dl_charmIconList $charm
- }
- proc dl:icon {i} {
- dl:Globals
- switch $i {
- CT { return CONNECT_T }
- CH { return CONNECT_H }
- CI { return CONNECT_I }
- CL { return CONNECT_L }
- NI { return NO_ICON }
- default { return $dl_icon($i) }
- }
- }
- proc dl:format {DL level type {formatList ""}} {
- dl:Globals
- if {[cequal $formatList ""]} {
- set formatList $type
- set type 0
- }
- if {![info exist dl_field(${DL},${type},$level)]} {
- if {$level >= $dl_levels(${DL})} {
- for {set i $dl_levels(${DL})} {$i <= $level} {incr i} {
- dl:type $DL $i 0
- }
- set dl_levels($DL) $i
- }
- dl:type $DL $level $type
- }
- foreach f $formatList {
- lassign $f field format def
- lappend dl_field(${DL},${type},$level) $field
- lappend dl_format(${DL},${type},$level) $format
- lappend dl_def(${DL},${type},$level) $def
- }
- set_add dl_types($DL) $type
- }
- proc dl:type {DL level type} {
- dl:Globals
- set dl_field(${DL},${type},$level) {_LEVEL _TYPE IND VIS}
- set dl_format(${DL},${type},$level) {{DATA} {DATA} {DATA} {DATA}}
- set dl_def(${DL},${type},$level) {0 0 - 0}
- for {set i 0} {$i <= $level} {incr i} {
- if {$dl_extra} {
- if {$i == $level} {
- lappend dl_field(${DL},${type},$level) ECICON
- if {[VtInfo -charm]} {
- lappend dl_format(${DL},${type},$level) {ICON 1 0 0}
- } else {
- lappend dl_format(${DL},${type},$level) {ICON 1 0 0}
- }
- lappend dl_def(${DL},${type},$level) [dl:icon NI]
- } else {
- lappend dl_field(${DL},${type},$level) ECICON$i
- if {[VtInfo -charm]} {
- lappend dl_format(${DL},${type},$level) {ICON 1 0 0}
- } else {
- lappend dl_format(${DL},${type},$level) {ICON 1 0 0}
- }
- lappend dl_def(${DL},${type},$level) [dl:icon NI]
- }
- }
- if {$i < $level} {
- lappend dl_field(${DL},${type},$level) ICON${i}
- } else {
- lappend dl_field(${DL},${type},$level) ICON
- }
- if {[VtInfo -charm]} {
- lappend dl_format(${DL},${type},$level) {ICON 1 0 1}
- } else {
- lappend dl_format(${DL},${type},$level) {ICON 1 0 1}
- }
- lappend dl_def(${DL},${type},$level) NO_ICON
- }
- }
- proc dl:clear {DL} {
- dl:Globals
- if {[info exist dl_types($DL)]} {
- foreach type $dl_types($DL) {
- for {set level 0} {$level < $dl_levels($DL)} {incr level} {
- catch {unset dl_field(${DL},${type},$level)}
- catch {unset dl_format(${DL},${type},$level)}
- catch {unset dl_def(${DL},${type},$level)}
- }
- }
- }
- catch {unset dl_poslist($DL)}
- catch {unset dl_visposlist($DL)}
- catch {unset dl_list($DL)}
- catch {unset dl_vislist($DL)}
- catch {unset dl_types($DL)}
- set dl_levels($DL) 0
- set dl_index($DL) 0
- set dl_poslist($DL) ""
- set dl_visposlist($DL) ""
- }
- proc dl:init {DL} {
- dl:Globals
- set dl_extra 1
- set dl_defer($DL) 0
- set dl_levels($DL) 0
- dl:clear $DL
- }
- proc dl:set {DL ind attr value} {
- ##~debug_sus
- dl:Globals
- set l_pos [lsearch $dl_poslist($DL) $ind]
- if {$l_pos == -1} {
- error "pos $ind not found in $dl_poslist($DL)"
- }
- set dl_pos [expr $l_pos + 1]
- set level [lindex $dl_list(${DL},$ind) 0]
- set type [lindex $dl_list(${DL},$ind) 1]
- set i [lsearch $dl_field(${DL},${type},$level) $attr]
- if {$i == -1} {
- error "attribute $attr not in level $level, $dl_field(${DL},${type},$level)"
- }
- set dl_list(${DL},$ind) [lreplace $dl_list(${DL},$ind) $i $i $value]
- ##~debug_res
- }
- proc dl:get {DL ind attr} {
- ##~debug_sus
- dl:Globals
- set l_pos [lsearch $dl_poslist($DL) $ind]
- if {$l_pos == -1} {
- error "pos $ind not found in $dl_poslist($DL)"
- }
- set dl_pos [expr $l_pos + 1]
- set level [lindex $dl_list(${DL},$ind) 0]
- set type [lindex $dl_list(${DL},$ind) 1]
- set i [lsearch $dl_field(${DL},${type},$level) $attr]
- if {$i == -1} {
- error "attribute $attr not in level $level, $dl_field(${DL},${type},$level)"
- }
- ##~debug_res
- return [lindex [lrange $dl_list(${DL},$ind) $i $i] 0]
- }
- proc dl:isPresent {DL ind {attr ""}} {
- dl:Globals
- set l_pos [lsearch $dl_poslist($DL) $ind]
- if {[cequal $attr ""]} {
- return [expr $l_pos != -1]
- }
- if {$l_pos == -1} {
- error "pos $ind not found in $dl_poslist($DL)"
- }
- set dl_pos [expr $l_pos + 1]
- set level [lindex $dl_list(${DL},$ind) 0]
- set type [lindex $dl_list(${DL},$ind) 1]
- set i [lsearch $dl_field(${DL},${type},$level) $attr]
- return [expr $i != -1]
- }
- proc dl:select {DL ind} {
- ##~debug_sus
- dl:Globals
- set l_pos [lsearch $dl_visposlist($DL) $ind]
- if {$l_pos == -1} {
- ##~debug_res
- return
- }
- incr l_pos
- VtDrawnListSelectItem $DL -position $l_pos
- ##~debug_res
- }
- proc dl:selected {DL attr} {
- ##~debug_sus
- dl:Globals
- set selected [lindex [VtDrawnListGetSelectedItem $DL -byRecordList] 0]
- if {[llength $selected] == 0} {
- ##~debug_res
- return ""
- }
- set level [lindex $selected 0]
- set type [lindex $selected 1]
- set i [lsearch $dl_field(${DL},${type},$level) $attr]
- if {$i == -1} {
- error "attribute $attr not in level $level, $dl_field(${DL},${type},$level)"
- }
- ##~debug_res
- return [lindex [lrange $selected $i $i] 0]
- }
- proc dl:add {DL pos level {type 0}} {
- ##~debug_sus
- dl:Globals
- if {![info exist dl_field(${DL},${type},$level)]} {
- if {$level >= $dl_levels($DL)} {
- for {set i $dl_levels($DL)} {$i <= $level} {incr i} {
- dl:type $DL $i 0
- }
- set dl_levels($DL) $i
- }
- dl:type $DL $level $type
- }
- switch $pos {
- start {
- set l_pos 0
- }
- end {
- set l_pos end
- }
- default {
- set l_pos [lsearch $dl_poslist($DL) $pos]
- if {$l_pos == -1} {
- error "pos $pos not found in $dl_poslist($DL)"
- }
- incr l_pos
- if {$l_pos >= [llength $dl_poslist($DL)]} {
- set l_pos end
- }
- }
- }
- if {[info exist dl_index($DL)]} {
- incr dl_index($DL)
- } else {
- set dl_index($DL) 0
- }
- set ind l$dl_index($DL)
- set dl_poslist($DL) [linsert $dl_poslist($DL) $l_pos $ind]
- set dl_list(${DL},$ind) $dl_def(${DL},${type},$level)
- dl:set $DL $ind IND $ind
- dl:set $DL $ind _LEVEL $level
- dl:set $DL $ind _TYPE $type
- ##~debug_res
- return $ind
- }
- proc dl:next {DL ind} {
- ##~debug_sus
- dl:Globals
- if {[cequal $ind end]} {
- ##~debug_res
- return end
- }
- if {[cequal $ind start]} {
- if {[llength $dl_poslist($DL)] > 0} {
- ##~debug_res
- return [lindex $dl_poslist($DL) 0]
- } else {
- ##~debug_res
- return end
- }
- }
- set l_pos [lsearch $dl_poslist($DL) $ind]
- if {$l_pos == -1} {
- error "pos $ind not found in $dl_poslist($DL)"
- }
- incr l_pos
- if {$l_pos >= [llength $dl_poslist($DL)]} {
- set ind end
- } else {
- set ind [lindex $dl_poslist($DL) $l_pos]
- }
- ##~debug_res
- return $ind
- }
- proc dl:prev {DL ind} {
- ##~debug_sus
- dl:Globals
- if {[cequal $ind start]} {
- return start
- }
- if {[cequal $ind end]} {
- if {[llength $dl_poslist($DL)] > 0} {
- ##~debug_res
- return [lindex [lrange $dl_poslist($DL) end end] 0]
- } else {
- ##~debug_res
- return start
- }
- }
- set l_pos [lsearch $dl_poslist($DL) $ind]
- if {$l_pos == -1} {
- error "pos $ind not found in $dl_poslist($DL)"
- }
- incr l_pos -1
- if {$l_pos < 0} {
- set ind start
- } else {
- set ind [lindex $dl_poslist($DL) $l_pos]
- }
- ##~debug_res
- return $ind
- }
- proc dl:defer {DL {defer ""}} {
- dl:Globals
- if {[cequal $defer ""]} {
- if {[info exists dl_defer($DL)]} {
- return $dl_defer($DL)
- } else {
- return 0
- }
- } else {
- set dl_defer($DL) $defer
- }
- }
- proc dl:fixconn {DL ind} {
- ##~debug_sus
- dl:Globals
- if {$dl_defer($DL)} {
- ##~debug_res
- return
- }
- while {![cequal $ind start]} {
- set level [dl:get $DL $ind _LEVEL]
- if {$level <= 0} {
- break
- }
- set ind [dl:prev $DL $ind]
- }
- set top_ind $ind
- set ind $top_ind
- if {$dl_extra} {
- set_add doExpandCollapse $ind
- }
- set ind [dl:next $DL $ind]
- set parent(0) $top_ind
- while {![cequal $ind end]} {
- set level [dl:get $DL $ind _LEVEL]
- if {$level == 0} {
- break
- }
- set below_level [expr $level - 1]
- set parent($level) $ind
- lappend children($parent($below_level)) $ind
- set last_level $level
- set ind [dl:next $DL $ind]
- }
- foreach p [Array children] {
- set level [dl:get $DL $p _LEVEL]
- set cs $children($p)
- while {![lempty $cs]} {
- if {[llength $cs] == 1} {
- set i1 [dl:icon CL]
- } else {
- set i1 [dl:icon CT]
- }
- set c [lvarpop cs]
- set n [lindex $cs 0]
- set I1 ICON${level}
- set vis [dl:get $DL $c VIS]
- if {$vis} {
- if {$dl_extra} {
- set_add doExpandCollapse $c
- }
- dl:set $DL $c $I1 $i1
- set doShow($c) 1
- }
- if {![lempty $n]} {
- set CI [dl:icon CI]
- set c [dl:next $DL $c]
- while {$n != $c} {
- set vis [dl:get $DL $c VIS]
- if {$vis} {
- dl:set $DL $c $I1 $CI
- set doShow($c) 1
- }
- set c [dl:next $DL $c]
- }
- }
- }
- }
- if {$dl_extra} {
- foreach ind [check doExpandCollapse] {
- set state [dl:state $DL $ind]
- set level [dl:get $DL $ind _LEVEL]
- if {$level == 0 && [cequal $state none]} {
- set state top
- }
- switch $state {
- collapsed { dl:set $DL $ind ECICON [dl:icon CE] }
- expanded { dl:set $DL $ind ECICON [dl:icon CC] }
- none { dl:set $DL $ind ECICON [dl:icon CH] }
- top { dl:set $DL $ind ECICON [dl:icon NI] }
- default { dl:set $DL $ind ECICON [dl:icon NI] }
- }
- set doShow($ind) 1
- }
- }
- foreach ind [Array doShow] {
- dl:show $DL $ind $doShow($ind)
- }
- ##~debug_res
- }
- proc dl:collapse {DL ind {all 0}} {
- dl:Globals
- set sel_ind [dl:selected $DL IND]
- if {![cequal $sel_ind ""]} {
- set before_vis [dl:get $DL $sel_ind VIS]
- } else {
- set before_vis 0
- }
- if {$all} {
- set level [dl:get $DL $ind _LEVEL]
- if {$level > 0} {
- set top_ind [dl:find $DL $ind up {{_LEVEL 0}}]
- if {![cequal $top_ind start]} {
- set ind $top_ind
- }
- }
- }
- set below_level [dl:get $DL $ind _LEVEL]
- set top_ind $ind
- set ind [dl:next $DL $ind]
- while {![cequal $ind end]} {
- set level [dl:get $DL $ind _LEVEL]
- if {$level <= $below_level} {
- break
- }
- dl:show $DL $ind 0
- set ind [dl:next $DL $ind]
- }
- if {![cequal $sel_ind ""]} {
- set after_vis [dl:get $DL $sel_ind VIS]
- } else {
- set after_vis 0
- }
- if {$before_vis && !$after_vis} {
- set top_ind [dl:find $DL $sel_ind up {{VIS 1}}]
- if {![cequal $top_ind start]} {
- set l_pos [lsearch $dl_visposlist($DL) $top_ind]
- if {$l_pos >= 0} {
- set dl_pos [expr $l_pos + 1]
- VtDrawnListSelectItem $DL -position $dl_pos
- }
- }
- }
- dl:fixconn $DL $top_ind
- }
- proc dl:expand {DL ind {all 0}} {
- dl:Globals
- set below_level [dl:get $DL $ind _LEVEL]
- set top_ind $ind
- set ind [dl:next $DL $ind]
- while {![cequal $ind end]} {
- set level [dl:get $DL $ind _LEVEL]
- if {$level <= $below_level} {
- break
- }
- if {$all || $level - $below_level == 1} {
- dl:show $DL $ind 1
- }
- set ind [dl:next $DL $ind]
- }
- dl:fixconn $DL $top_ind
- }
- proc dl:state {DL ind} {
- dl:Globals
- set level [dl:get $DL $ind _LEVEL]
- set l_pos [lsearch $dl_visposlist($DL) $ind]
- if {$l_pos == -1} {
- return invisible
- }
- incr l_pos
- set next_ind [dl:next $DL $ind]
- if {[cequal $next_ind end]} {
- set next_level 0
- } else {
- if {$l_pos >= [llength $dl_visposlist($DL)]} {
- set next_visind ""
- set next_level [expr $level + 1]
- } else {
- set next_visind [lindex $dl_visposlist($DL) $l_pos]
- set next_level [dl:get $DL $next_ind _LEVEL]
- }
- }
- if {$next_level > $level} {
- if {[cequal $next_ind $next_visind]} {
- return expanded
- } else {
- return collapsed
- }
- } else {
- return none
- }
- }
- proc dl:isShow {DL ind} {
- return [dl:get $DL $ind VIS]
- }
- proc dl:show {DL ind {new_vis ""}} {
- ##~debug_sus
- dl:Globals
- set level [dl:get $DL $ind _LEVEL]
- set type [dl:get $DL $ind _TYPE]
- set vis [dl:get $DL $ind VIS]
- if {[cequal $new_vis ""]} {
- set new_vis $vis
- }
- if {!$new_vis && !$vis} {
- return
- } elseif {!$new_vis && $vis} {
- set l_pos [lsearch $dl_visposlist($DL) $ind]
- set dl_pos [expr $l_pos + 1]
- VtDrawnListDeleteItem $DL -position $dl_pos
- lvarpop dl_visposlist($DL) $l_pos
- dl:set $DL $ind VIS 0
- } elseif {$new_vis && !$vis} {
- if {$level == 0} {
- lappend dl_visposlist($DL) $ind
- set dl_pos 0
- } else {
- set prev_ind [dl:prev $DL $ind]
- set prev_vis 0
- while {![cequal $prev_ind start]} {
- set prev_vis [dl:get $DL $prev_ind VIS]
- if {$prev_vis} {
- break
- }
- set prev_ind [dl:prev $DL $prev_ind]
- }
- if {!$prev_vis} {
- error "no previous visible element"
- }
- set l_pos [lsearch $dl_visposlist($DL) $prev_ind]
- incr l_pos
- set dl_visposlist($DL) [linsert $dl_visposlist($DL) $l_pos $ind]
- set dl_pos [expr $l_pos + 1]
- }
- VtDrawnListAddItem $DL \
- -formatList $dl_format(${DL},${type},$level) \
- -fieldList $dl_list(${DL},$ind) \
- -position $dl_pos
- set dl_vislist(${DL},$ind) $dl_list(${DL},$ind)
- dl:set $DL $ind VIS 1
- } else {
- set l_pos [lsearch $dl_visposlist($DL) $ind]
- set dl_pos [expr $l_pos + 1]
- if {![cequal $dl_list(${DL},$ind) $dl_vislist(${DL},$ind)]} {
- VtDrawnListSetItem $DL \
- -formatList $dl_format(${DL},${type},$level) \
- -fieldList $dl_list(${DL},$ind) \
- -position $dl_pos
- set dl_vislist(${DL},$ind) $dl_list(${DL},$ind)
- }
- }
- ##~debug_res
- }
- proc dl:delete {DL ind} {
- ##~debug_sus
- dl:Globals
- set ind_level [dl:get $DL $ind _LEVEL]
- if {$ind_level > 0} {
- set top_ind [dl:prev $DL $ind]
- } else {
- set top_ind end
- }
- set next_ind [dl:next $DL $ind]
- dl:show $DL $ind 0
- set l_pos [lsearch $dl_poslist($DL) $ind]
- lvarpop dl_poslist($DL) $l_pos
- unset dl_list(${DL},$ind)
- set ind $next_ind
- while {![cequal $ind end]} {
- set level [dl:get $DL $ind _LEVEL]
- if {$level <= $ind_level} {
- break
- }
- set next_ind [dl:next $DL $ind]
- dl:show $DL $ind 0
- set l_pos [lsearch $dl_poslist($DL) $ind]
- lvarpop dl_poslist($DL) $l_pos
- unset dl_list(${DL},$ind)
- set ind $next_ind
- }
- if {![cequal $top_ind end]} {
- dl:fixconn $DL $top_ind
- }
- ##~debug_res
- }
- proc dl:find {DL ind direction {true_fields ""} {false_fields ""}} {
- dl:Globals
- switch -exact -- $direction {
- 1 -
- forward -
- down {
- set first start
- set last end
- set listFirst 0
- set move dl:next
- }
- -1 -
- backward -
- up {
- set first end
- set last start
- set listFirst end
- set move dl:prev
- }
- }
- if {[lempty $true_fields] && [lempty $false_fields]} {
- set ind [eval $move \$DL \$ind]
- return $ind
- }
- if {[cequal $ind ""] || [llength $dl_poslist($DL)] == 0} {
- return $last
- } elseif {[cequal $ind $first]} {
- set ind [lindex $dl_poslist($DL) $listFirst]
- } else {
- set l_pos [lsearch $dl_poslist($DL) $ind]
- if {$l_pos == -1} {
- return $last
- }
- }
- while {![cequal $ind $last]} {
- set continue_search 0
- foreach field $true_fields {
- lassign $field attr test_value
- set value [dl:get $DL $ind $attr]
- if {![cequal $value $test_value]} {
- set continue_search 1
- break
- }
- }
- if {!$continue_search} {
- foreach field $false_fields {
- lassign $field attr test_value
- set value [dl:get $DL $ind $attr]
- if {[cequal $value $test_value]} {
- set continue_search 1
- break
- }
- }
- }
- if {!$continue_search} {
- break
- }
- set ind [eval $move \$DL \$ind]
- }
- return $ind
- }
- proc dl:sort {DL in out} {
- dl:Globals
- set out_pos [lsearch $dl_poslist($DL) [lindex $in 0]]
- set out_vispos -1
- foreach out_ind $out {
- set in_ind [lvarpop in]
- set dl_poslist($DL) [lreplace $dl_poslist($DL) $out_pos $out_pos $out_ind]
- set vis [dl:get $DL $out_ind VIS]
- if {$vis} {
- if {$out_vispos == -1} {
- set out_vispos [lsearch $dl_visposlist($DL) $in_ind]
- }
- set dl_visposlist($DL) [lreplace $dl_visposlist($DL) $out_vispos $out_vispos $out_ind]
- set dl_vislist(${DL},$out_ind) ""
- dl:show $DL $out_ind 1
- incr out_vispos
- }
- incr out_pos
- }
- return 1
- }
- ##################################################
- ##################################################
- proc ppp:chain_clear {} {
- global ppp_work_chain
- set ppp_work_chain ""
- }
- proc ppp:chain_add {rec} {
- global ppp_work_chain
- if {![info exist ppp_work_chain]} {
- set ppp_work_chain ""
- }
- lappend ppp_work_chain $rec
- }
- proc ppp:chain_next {} {
- global ppp_work_chain
- if {![info exist ppp_work_chain]} {
- set ppp_work_chain ""
- }
- if {![lempty $ppp_work_chain]} {
- set rec [lvarpop ppp_work_chain]
- keylget rec op op
- keylget rec mb mb
- keylget rec ind ind
- keylget rec sel sel
- keylget rec view view
- keylget rec parent_cbs parent_cbs
- keylget rec func func
- $func $op "$mb" "$ind" "$sel" $view $parent_cbs
- }
- }
- proc validTag {str} {
- set tag [string trim $str]
- set tag [translit " ^" "__" $tag]
- set l [clength $tag]
- if {$l > 32} {
- set tag [csubstr $tag 0 32]
- set l [clength $tag]
- }
- for {set i 0} {$i < $l} {incr i} {
- set c [string index $tag $i]
- if {![ctype print $c]} {
- set tag [translit "$c" "_"]
- }
- }
- return $tag
- }
- proc validName {str} {
- return [validTag $str]
- }
- proc validSecret {str} {
- return [string trim $str]
- }
- proc throwError {dialog mess} {
- set EDerror [VtErrorDialog $dialog.EDerror \
- -ok \
- -message $mess \
- -autoDestroy 1 \
- ]
- VtShow $EDerror
- VtUnLock
- }
- proc confirm {dialog message okCallback} {
- set above_message ""
- catch {VxGetVar $dialog message} above_message
- if {[cequal $message $above_message]} {
- return 0
- }
- set QDconfirm [VtQuestionDialog $dialog.QDconfirm \
- -ok \
- -okCallback $okCallback \
- -autoLock [lindex $okCallback 0] \
- -cancel \
- -message $message \
- ]
- VtShow $QDconfirm
- SetVar $QDconfirm message
- return 1
- }
- ##################################################
- proc Globals {} {
- uplevel 1 global FDppp mbWidgetMap mbFuncMap visibleMap sensitiveMap \
- DLlist TBview managedHost sel2mb
- uplevel 1 PPP:Globals
- }
- ##################################################
- proc FormTabDialog {FTD} {
- if {[VtInfo -charm]} {
- set type menu
- } else {
- set type tab
- }
- if {[cequal $type tab]} {
- if {[VtInfo -colors] <= 256} {
- set type sensitive
- } else {
- set type reverse
- }
- set FTD [SaFormTabDialog $FTD \
- -type tab \
- -style $type \
- -CHARM_numColumns 2 \
- ]
- } else {
- set FTD [SaFormTabDialog $FTD \
- -type menu \
- -label [ILM SCO_PPP_MSG_FTDVIEW] \
- -mnemonic [ILM SCO_PPP_MSG_MN_FTDVIEW] \
- ]
- }
- return $FTD
- }
- proc FormTabs {FTD FT_data} {
- foreach FT $FT_data {
- set current_FT [lvarpop FT]
- uplevel 1 eval "set $current_FT \[cw SaFormTab $FTD.$current_FT $FT\]"
- }
- }
- ##################################################
- proc SetAutoRefreshIntervalCB {cbs} {
- set dialog [keylget cbs dialog]
- set interval [VxGetVar $dialog interval]
- set newInterval [VtGetValues [VxGetVar $interval text] -value]
- if {$newInterval == {}} {
- ErrorPush errStack 0 SCO_PPP_ERR_NO_INTERVAL
- SaDisplayErrorStacks $dialog.err [list $errStack] NOHELP
- VtUnLock
- return
- }
- SaAutoRefreshSetInterval [expr {$newInterval * 60}]
- VxEndFormCB $cbs
- }
- proc GetAutoRefreshIntervalCB {cbs} {
- keylget cbs dialog parent
- set dialog [VtFormDialog $parent.getInterval \
- -title [IntlLocalizeMsg SCO_PPP_MSG_AUTO_REFRESH_TITLE] \
- -ok -okCallback SetAutoRefreshIntervalCB \
- -cancelButton CANCEL \
- -cancel -cancelCallback VxEndFormCB]
- set interval [expr {[SaAutoRefreshGetInterval] / 60}]
- set alform [SaAlignedForm $dialog.interval [list \
- [list SCO_PPP_MSG_AUTO_REFRESH_LABEL \
- [list VxSpinButton 8 1 "" 30 "" 1 $interval "" ""]] \
- ]]
- VtSetValues $alform -topSide FORM -bottomSide FORM -rightSide FORM
- set intervalL [VxGetVar $alform label1]
- VtSetValues $intervalL -font medNormalFont
- VxSetVar $dialog interval [VxGetVar $alform widget1]
- VtShow $dialog
- VtUnLock
- }
- proc RefreshDisplayCB {cbs} {
- Globals
- global TBview_bundles TBview_links TBview_auths
- if {[cequal $TBview $TBview_auths]} {
- VtUnLock
- return
- }
- set ind start
- set ind [dl:next $DLlist $ind]
- while {![cequal $ind end]} {
- set sel [dl:get $DLlist $ind SEL]
- set tag [dl:get $DLlist $ind OBJ]
- set doUpdate 0
- switch $sel {
- sel101 {
- set status [PPP:action bundle $tag status]
- set doUpdate 1
- }
- sel202 {
- set status [PPP:action link $tag status]
- set doUpdate 1
- }
- }
- if {$doUpdate} {
- set phase dead
- keylget status phase phase
- set old_icon [dl:get $DLlist $ind PHASE]
- switch $phase {
- network {
- set icon [dl:icon up]
- }
- default {
- set icon [dl:icon NI]
- }
- }
- if {![cequal $old_icon $icon]} {
- dl:set $DLlist $ind PHASE $icon
- dl:show $DLlist $ind [dl:isShow $DLlist $ind]
- }
- }
- set ind [dl:next $DLlist $ind]
- }
- VtUnLock
- }
- ##################################################
- proc ppp:PBquickExitCB {cbs} {
- owner unlink -nocomplain /tmp/ppp.pipe
- owner unlink -nocomplain /tmp/PPP.pipe
- VtUnLock
- VtClose
- exit 0
- }
- proc ppp:PBexitCB {cbs} {
- Globals
- global failed_once env
- SaAutoRefreshPause
- SaAutoRefreshStore "pppGUI"
- if {[info exist env(PPP_LINK_CLEAN)] && $env(PPP_LINK_CLEAN) == 1} {
- set used_tags ""
- foreach tag [GRP:list lg] {
- set links [GRP:get $tag tags]
- foreach link $links {
- set_add used_tags $link
- }
- }
- set i3 [intersect3 $used_tags [PPP:list link]]
- foreach link [lindex $i3 2] {
- PPP:delete link $link
- }
- }
- if {[info exist env(PPP_PROTOCOL_CLEAN)] && $env(PPP_PROTOCOL_CLEAN) == 1} {
- set used_tags ""
- foreach type {bundle link} {
- foreach tag [PPP:list ${type}] {
- set protocols ""
- PPP:get ${type} ${tag} protocols protocols
- foreach protocol $protocols {
- set_add used_tags $protocol
- }
- }
- }
- set i3 [intersect3 $used_tags [PPP:list protocol]]
- foreach protocol [lindex $i3 2] {
- PPP:get protocol ${protocol} protocol key
- PPP:delete protocol/${key} $protocol
- }
- }
- if {![info exists TBview]} {
- set TBview ""
- }
- SaScreenPolicySet "pppGUI" TBview "$TBview"
- if {!$failed_once && ![PPP:write_config $FDppp SCO_PPP_MSG_SB_WRITING]} {
- set failed_once 1
- return [throwError $FDppp [ILM SCO_PPP_ERR_SET_SERVER_CONFIG]]
- }
- PPP:exit
- ppp:PBquickExitCB $cbs
- }
- ##################################################
- proc ppp:PBexpandCB {range cbs} {
- Globals
- switch $range {
- all {
- set ind start
- while {![cequal $ind end]} {
- set ind [dl:find $DLlist $ind down {{_LEVEL 0}}]
- if {![cequal $ind end]} {
- dl:expand $DLlist $ind 1
- }
- set ind [dl:next $DLlist $ind]
- }
- }
- defn {
- set ind [dl:selected $DLlist IND]
- set top_ind [dl:find $DLlist $ind up {{_LEVEL 0}}]
- if {[cequal $top_ind start]} {
- set top_ind $ind
- }
- dl:expand $DLlist $top_ind 1
- }
- selected {
- set ind [dl:selected $DLlist IND]
- dl:expand $DLlist $ind
- SaDrawnListShowSelectedItem $DLlist 1
- }
- }
- ppp:DLselectCB $cbs
- VtUnLock
- }
- proc ppp:PBcollapseCB {range cbs} {
- Globals
- switch $range {
- all {
- set ind start
- while {![cequal $ind end]} {
- set ind [dl:find $DLlist $ind down {{_LEVEL 0}}]
- if {![cequal $ind end]} {
- dl:collapse $DLlist $ind 1
- }
- set ind [dl:next $DLlist $ind]
- }
- }
- defn {
- set ind [dl:selected $DLlist IND]
- set top_ind [dl:find $DLlist $ind up {{_LEVEL 0}}]
- if {[cequal $top_ind start]} {
- set top_ind $ind
- }
- dl:collapse $DLlist $top_ind 1
- }
- selected {
- set ind [dl:selected $DLlist IND]
- dl:collapse $DLlist $ind
- }
- }
- ppp:DLselectCB $cbs
- VtUnLock
- }
- proc ppp:DLexpandCollapseCB {cbs} {
- Globals
- set ind [dl:selected $DLlist IND]
- if {![cequal $ind ""]} {
- set state [dl:state $DLlist $ind]
- switch $state {
- expanded { dl:collapse $DLlist $ind }
- collapsed { dl:expand $DLlist $ind }
- default { ppp:PBmodifyCB $cbs }
- }
- }
- ppp:DLselectCB $cbs
- VtUnLock
- }
- ##################################################
- proc pppGUI {} {
- Globals
- global Charm iconpath versionNumber managedHost failed_once
- global TBview_bundles TBview_links TBview_auths
- set shortHostname [SaHostExtractSystemName $managedHost]
- set pppGUI [VtOpen pppGUI pppGUI]
- VtSetAppValues $pppGUI \
- -versionString [ILM SCO_PPP_MSG_VERSION $versionNumber]
- set Charm [VtInfo -charm]
- VtLock
- if {[id userid] != 0 && !([isOwner] && [isOwner -host $managedHost])} {
- SaDisplayNoAuths $pppGUI.EDnoAuthBox \
- [ILM SCO_PPP_MSG_TITLE "$shortHostname"] \
- ppp:PBquickExitCB \
- $managedHost
- VtUnLock
- return
- }
- if {![OnlyOneCopy /tmp/ppp.pipe]} {
- set EDoneCopy [VtErrorDialog $pppGUI.EDoneCopy \
- -wmDecoration { TITLE RESIZE BORDER } \
- -autoDestroy 1 \
- -ok \
- -okCallback ppp:PBquickExitCB \
- -message [ILM SCO_PPP_ERR_ONLY_ONE_PPP] \
- ]
- VtShowDialog $EDoneCopy
- VtUnLock
- return
- }
- if {![OnlyOneCopy /tmp/PPP.pipe]} {
- set EDoneCopy [VtErrorDialog $pppGUI.EDoneCopy \
- -wmDecoration { TITLE RESIZE BORDER } \
- -autoDestroy 1 \
- -ok \
- -okCallback ppp:PBquickExitCB \
- -message [ILM SCO_PPP_ERR_ONLY_ONE_PIC] \
- ]
- VtShowDialog $EDoneCopy
- VtUnLock
- return
- }
- set FDppp [VtFormDialog $pppGUI.FDppp \
- -title [ILM SCO_PPP_MSG_TITLE "$shortHostname"] \
- -wmShadowThickness 0 \
- -marginHeight 0 \
- -marginWidth 0 \
- -wmCloseCallback pic:PBexitCB \
- ]
- ##########
- set MBppp [VtMenuBar $FDppp.MBppp \
- -helpMenuItemList [SaHelpGetOptionsList] \
- ]
- set PDhost [cw VtPulldown $MBppp.PDhost \
- SCO_PPP_MSG_PDHOST \
- SCO_PPP_MSG_MN_PDHOST \
- "" \
- ]
- set PBopen [cw VtPushButton $PDhost.PBopen \
- SCO_PPP_MSG_PBOPEN \
- SCO_PPP_MSG_MN_PBOPEN \
- SCO_PPP_MSG_SH_PBOPEN \
- -callback SaOpenHostCB \
- -autoLock SaOpenHostCB \
- ]
- VtSeparator $PDhost.Ssep
- set PBexit [cw VtPushButton $PDhost.PBexit \
- SCO_PPP_MSG_PBEXIT \
- SCO_PPP_MSG_MN_PBEXIT \
- SCO_PPP_MSG_SH_PBEXIT \
- -callback ppp:PBexitCB \
- -autoLock ppp:PBexitCB \
- ]
- ##########
- wset $FDppp PDedit [cw VtPulldown $MBppp.PDedit \
- SCO_PPP_MSG_PDEDIT \
- SCO_PPP_MSG_MN_PDEDIT \
- "" \
- ]
- wset $FDppp PDadd [cw VtPulldown $PDedit.PDadd \
- SCO_PPP_MSG_PDADD \
- SCO_PPP_MSG_MN_PDADD \
- "" \
- -userData mb110 \
- ]
- wset $FDppp PBmodify [cw VtPushButton $PDedit.PBmodify \
- SCO_PPP_MSG_PBMODIFY \
- SCO_PPP_MSG_MN_PBMODIFY \
- SCO_PPP_MSG_SH_PBMODIFY \
- -callback ppp:PBmodifyCB \
- -autoLock ppp:PBmodifyCB \
- -userData mb120 \
- ]
- wset $FDppp PBdelete [cw VtPushButton $PDedit.PBdelete \
- SCO_PPP_MSG_PBDELETE \
- SCO_PPP_MSG_MN_PBDELETE \
- SCO_PPP_MSG_SH_PBDELETE \
- -callback ppp:PBdeleteCB \
- -autoLock ppp:PBdeleteCB \
- -userData mb130 \
- ]
- #####
- wset $FDppp PBbundle_add_bundle [cw VtPushButton $PDadd.PBbundle_add_bundle \
- SCO_PPP_MSG_PBBUNDLES_ADD_BUNDLE \
- SCO_PPP_MSG_MN_PBBUNDLES_ADD_BUNDLE \
- "" \
- -callback ppp:PBaddCB \
- -autoLock ppp:PBaddCB \
- -userData mb112 \
- ]
- wset $FDppp PBbundle_add_link_group [cw VtPushButton $PDadd.PBbundle_add_link_group \
- SCO_PPP_MSG_PBBUNDLES_ADD_LG \
- SCO_PPP_MSG_MN_PBBUNDLES_ADD_LG \
- "" \
- -callback ppp:PBaddCB \
- -autoLock ppp:PBaddCB \
- -userData mb113 \
- ]
- wset $FDppp PBbundle_add_network_protocol [cw VtPushButton $PDadd.PBbundle_add_network_protocol \
- SCO_PPP_MSG_PBBUNDLES_ADD_NP \
- SCO_PPP_MSG_MN_PBBUNDLES_ADD_NP \
- "" \
- -callback ppp:PBaddCB \
- -autoLock ppp:PBaddCB \
- -userData mb114 \
- ]
- wset $FDppp PBbundle_add_link_protocol [cw VtPushButton $PDadd.PBbundle_add_link_protocol \
- SCO_PPP_MSG_PBBUNDLES_ADD_LP \
- SCO_PPP_MSG_MN_PBBUNDLES_ADD_LP \
- "" \
- -callback ppp:PBaddCB \
- -autoLock ppp:PBaddCB \
- -userData mb115 \
- ]
- ##########
- wset $FDppp PBlink_group_add_link_group [cw VtPushButton $PDadd.PBlink_group_add_link_group \
- SCO_PPP_MSG_PBLINLS_ADD_LG \
- SCO_PPP_MSG_MN_PBLINKS_ADD_LG \
- "" \
- -callback ppp:PBaddCB \
- -autoLock ppp:PBaddCB \
- -userData mb201 \
- ]
- wset $FDppp PBlink_group_add_link [cw VtPushButton $PDadd.PBlink_group_add_link \
- SCO_PPP_MSG_PBLINKS_ADD_LINK \
- SCO_PPP_MSG_MN_PBLINKS_ADD_LINK \
- "" \
- -callback ppp:PBaddCB \
- -autoLock ppp:PBaddCB \
- -userData mb211 \
- ]
- wset $FDppp PBlink_group_add_link_protocol [cw VtPushButton $PDadd.PBlink_group_add_link_protocol \
- SCO_PPP_MSG_PBLINKS_ADD_LP \
- SCO_PPP_MSG_MN_PBLINKS_ADD_LP \
- "" \
- -callback ppp:PBaddCB \
- -autoLock ppp:PBaddCB \
- -userData mb212 \
- ]
- ##########
- wset $FDppp PBauth_add_auth [cw VtPushButton $PDadd.PBauth_add_auth \
- SCO_PPP_MSG_PBAUTH_ADD_NAME \
- SCO_PPP_MSG_MN_PBAUTH_ADD_NAME \
- "" \
- -callback ppp:PBaddCB \
- -autoLock ppp:PBaddCB \
- -userData mb301 \
- ]
- ##########
- set PDview [cw VtPulldown $MBppp.PDview \
- SCO_PPP_MSG_PDVIEW \
- SCO_PPP_MSG_MN_PDVIEW \
- "" \
- ]
- wset $FDppp TBview_bundles [cw VtToggleButton $PDview.TBview_bundles \
- SCO_PPP_MSG_TBVIEW_BUNDLES \
- SCO_PPP_MSG_MN_TBVIEW_BUNDLES \
- SCO_PPP_MSG_SH_TBVIEW_BUNDLES \
- -value 0 \
- -userData mb1001 \
- -callback ppp:PDviewCB \
- ]
- wset $FDppp TBview_links [cw VtToggleButton $PDview.TBview_links \
- SCO_PPP_MSG_TBVIEW_LINKS \
- SCO_PPP_MSG_MN_TBVIEW_LINKS \
- SCO_PPP_MSG_SH_TBVIEW_LINKS \
- -value 0 \
- -userData mb1002 \
- -callback ppp:PDviewCB \
- ]
- wset $FDppp TBview_auths [cw VtToggleButton $PDview.TBview_auths \
- SCO_PPP_MSG_TBVIEW_AUTHS \
- SCO_PPP_MSG_MN_TBVIEW_AUTHS \
- SCO_PPP_MSG_SH_TBVIEW_AUTHS \
- -value 0 \
- -userData mb1003 \
- -callback ppp:PDviewCB \
- ]
- VtSeparator $PDview.Ssep1
- wset $FDppp PBexpand [cw VtPushButton $PDview.PBexpand \
- SCO_PPP_MSG_PBVIEW_EXPAND \
- SCO_PPP_MSG_MN_PBVIEW_EXPAND \
- SCO_PPP_MSG_SH_PBVIEW_EXPAND \
- -callback "ppp:PBexpandCB selected" \
- -autoLock ppp:PBexpandCB \
- ]
- wset $FDppp PBexpandall [cw VtPushButton $PDview.PBexpandall \
- SCO_PPP_MSG_PBVIEW_EXPANDALL \
- SCO_PPP_MSG_MN_PBVIEW_EXPANDALL \
- SCO_PPP_MSG_SH_PBVIEW_EXPANDALL \
- -callback "ppp:PBexpandCB all" \
- -autoLock ppp:PBexpandCB \
- ]
- VtSeparator $PDview.Ssep2
- wset $FDppp PBcollapse [cw VtPushButton $PDview.PBcollapse \
- SCO_PPP_MSG_PBVIEW_COLLAPSE \
- SCO_PPP_MSG_MN_PBVIEW_COLLAPSE \
- SCO_PPP_MSG_SH_PBVIEW_COLLAPSE \
- -callback "ppp:PBcollapseCB selected" \
- -autoLock ppp:PBcollapseCB \
- ]
- wset $FDppp PBcollapseall [cw VtPushButton $PDview.PBcollapseall \
- SCO_PPP_MSG_PBVIEW_COLLAPSEALL \
- SCO_PPP_MSG_MN_PBVIEW_COLLAPSEALL \
- SCO_PPP_MSG_SH_PBVIEW_COLLAPSEALL \
- -callback "ppp:PBcollapseCB all" \
- -autoLock ppp:PBcollapseCB \
- ]
- VtSeparator $PDview.Ssep3
- SaAutoRefresh RefreshDisplayCB $PDview \
- [ILM SCO_PPP_MSG_PBVIEW_REFRESH_SH] \
- SaShortHelpCB GetAutoRefreshIntervalCB
- ##########
- wset $FDppp PDoptions [cw VtPulldown $MBppp.PDoptions \
- SCO_PPP_MSG_PDOPTIONS \
- SCO_PPP_MSG_MN_PDOPTIONS \
- "" \
- ]
- wset $FDppp PBglobal_bundle [cw VtPushButton $PDoptions.PBglobal_bundle \
- SCO_PPP_MSG_PBGLOBAL_BUNDLE \
- SCO_PPP_MSG_MN_PBGLOBAL_BUNDLE \
- SCO_PPP_MSG_SH_PBGLOBAL_BUNDLE \
- -callback ppp:PBglobal_bundleCB \
- -autoLock ppp:PBglobal_bundleCB \
- ]
- ##########
- VtSeparator $PDoptions.Ssep
- wset $FDppp pointHelp [SaShortHelpMenuOptions $PDoptions]
- ##########
- wset $FDppp Lprompt [VtLabel $FDppp.Lprompt \
- -MOTIF_leftOffset 5 \
- -MOTIF_topOffset 5 \
- -CHARM_leftOffset 1 \
- -leftSide FORM \
- -label [ILM SCO_PPP_MSG_PROMPT "$shortHostname"] \
- ]
- set MOTIF_labelFormatList {{STRING 30} {STRING 30}}
- dl:addicon d disabled.px $iconpath [ILM SCO_PPP_MSG_CICON_D]
- dl:addicon o outgoing.px $iconpath [ILM SCO_PPP_MSG_CICON_O]
- dl:addicon i incoming.px $iconpath [ILM SCO_PPP_MSG_CICON_I]
- dl:addicon io inout.px $iconpath [ILM SCO_PPP_MSG_CICON_IO]
- dl:addicon b host.px $iconpath [ILM SCO_PPP_MSG_CICON_B]
- dl:addicon a auth.px $iconpath [ILM SCO_PPP_MSG_CICON_A]
- dl:addicon l modem.px $iconpath [ILM SCO_PPP_MSG_CICON_L]
- dl:addicon lg multi-modem.px $iconpath [ILM SCO_PPP_MSG_CICON_LG]
- dl:addicon pn nprotocol.px $iconpath [ILM SCO_PPP_MSG_CICON_NP]
- dl:addicon pl lprotocol.px $iconpath [ILM SCO_PPP_MSG_CICON_LP]
- dl:addicon up flash.px $iconpath [ILM SCO_PPP_MSG_CICON_UP]
- dl:addicon s serial.px $iconpath [ILM SCO_PPP_MSG_CICON_S]
- wset $FDppp DLlist [VtDrawnList $FDppp.DLlist \
- -MOTIF_formatList {{ICON 1}} \
- -MOTIF_labelFormatList $MOTIF_labelFormatList \
- -MOTIF_labelList [list [ILM SCO_PPP_MSG_HDR_DL_BUNDLE] ""] \
- -callback ppp:DLselectCB \
- -defaultCallback ppp:DLexpandCollapseCB \
- -autoLock "ppp:DLexpandCollapseCB" \
- -columns 69 \
- -MOTIF_rows 15 \
- -CHARM_rows 12 \
- -selection SINGLE \
- -leftSide FORM \
- -rightSide FORM \
- -MOTIF_leftOffset 5 \
- -MOTIF_rightOffset 5 \
- -horizontalScrollBar 1 \
- -MOTIF_iconList [dl:iconList] \
- -CHARM_iconList [dl:iconList CHARM] \
- ]
- VtSetValues $FDppp -resizable 0
- StatusBar $FDppp $DLlist 1
- SaCharmSetMaxFormDimensions $FDppp
- dl:init $DLlist
- VtShow $FDppp
- ppp:initOp
- set TBview $TBview_links
- if {[catch {SaScreenPolicyGet pppGUI TBview} TBview]
- || [cequal $TBview ""]} {
- set TBview $TBview_links
- }
- set failed_once 0
- if {![PPP:read_config $FDppp SCO_PPP_MSG_SB_INIT SCO_PPP_MSG_SB_READING SCO_PPP_MSG_SB_VERIFYING]} {
- set failed_once 1
- return [throwError $FDppp [ILM SCO_PPP_ERR_GET_SERVER_CONFIG]]
- }
- ppp:fake_view_switch $TBview
- if [ErrorCatch errStack 0 "SaScreenPolicyGet pppGUI autoRefreshState" refreshState] {
- SaAutoRefreshOn
- SaAutoRefreshSetInterval 120
- }
- SaAutoRefreshLoad "pppGUI"
- if {[lempty [Devices:list]]} {
- set WDnoDevs [VtWarningDialog $FDppp.WDnoDevs \
- -autoDestroy 1 \
- -ok \
- -message [ILM SCO_PPP_ERR_NO_DEVS] \
- ]
- VtShow $WDnoDevs
- VtUnLock
- return
- }
- set pppGUI_first 1
- if {[lempty [GRP:list lg]] && $pppGUI_first \
- && ![lempty [Devices:list]] \
- && ![lempty [PPP:list link]]} {
- set QDauto_create [VtQuestionDialog $FDppp.QDauto_create \
- -autoDestroy 1 \
- -ok \
- -okCallback ppp:auto_create \
- -autoLock ppp:auto_create \
- -cancel \
- -message [ILM SCO_PPP_MSG_AUTO_CREATE_GROUPS] \
- ]
- VtShow $QDauto_create
- VtUnLock
- return
- }
- VtUnLock
- }
- proc ppp:auto_create {cbs} {
- Globals
- global TBview_bundles TBview_links TBview_auths
- StatusPush $FDppp [ILM SCO_PPP_MSG_AUTO_CREATE_STATUS]
- GRP:auto_create
- StatusPop $FDppp
- ppp:fake_view_switch $TBview_bundles
- if {![lempty [GRP:list lg]]} {
- set IDauto_create [VtQuestionDialog $FDppp.IDauto_create \
- -autoDestroy 1 \
- -ok \
- -message [ILM SCO_PPP_MSG_TIP_CREATE_BUNDLES] \
- ]
- VtShow $IDauto_create
- }
- VtUnLock
- }
- proc ppp:fake_view_switch {new_TBview} {
- Globals
- VtSetValues $TBview -value 0
- VtSetValues $new_TBview -value 1
- keylset fake_cbs dialog $FDppp
- keylset fake_cbs widget $new_TBview
- set TBview null
- SetVar $FDppp TBview
- ppp:PDviewCB 1 $fake_cbs
- }
- proc ppp:TBview_bundlesCB {op mb ind sel view cbs} {
- Globals
- global view_state
- set header SCO_PPP_MSG_HDR_DL_BUNDLE
- VtSetValues $DLlist -MOTIF_labelList [list [ILM $header] ""]
- dl:clear $DLlist
- ppp:setFormats
- foreach bundle_tag [PPP:list bundle] {
- if {[lsearch $view_state($TBview) $bundle_tag] != -1} {
- set expanded 1
- } else {
- set expanded 0
- }
- set bundle_ind [bundle:DLadd_bundle end $bundle_tag 1]
- bundle:DLinfo $bundle_ind
- PPP:get bundle $bundle_tag protocols protocols_tags
- set nprotocol_tags ""
- set lprotocol_tags ""
- foreach protocol_tag $protocols_tags {
- if {![PPP:isPresent protocol $protocol_tag]} {
- continue
- }
- PPP:get protocol ${protocol_tag} protocol protocol
- keylget ppp_type_info(protocol/${protocol}) sub_defn sub_defn
- switch $sub_defn {
- network {
- lappend nprotocol_tags $protocol_tag
- }
- link {
- lappend lprotocol_tags $protocol_tag
- }
- }
- }
- foreach nprotocol_tag $nprotocol_tags {
- set protocol_ind [bundle:DLadd_protocol end $bundle_ind $nprotocol_tag $expanded]
- bundle:DLinfo_protocol $protocol_ind $expanded
- }
- foreach lprotocol_tag $lprotocol_tags {
- set protocol_ind [bundle:DLadd_protocol end $bundle_ind $lprotocol_tag $expanded]
- bundle:DLinfo_protocol $protocol_ind $expanded
- }
- set links_tags ""
- set protocols ""
- PPP:get bundle $bundle_tag links links_tags
- foreach lg_tag [links_to_lgs $links_tags] {
- set name [GRP:get $lg_tag name]
- set lg_ind [bundle_link_group:DLadd_link_group end sel101 $bundle_ind $lg_tag $expanded]
- bundle_link_group:DLinfo $lg_ind
- }
- dl:fixconn $DLlist $bundle_ind
- }
- }
- proc ppp:TBview_linksCB {op mb ind sel view cbs} {
- Globals
- global view_state
- set header SCO_PPP_MSG_HDR_DL_LINK
- VtSetValues $DLlist -MOTIF_labelList [list [ILM $header] ""]
- dl:clear $DLlist
- ppp:setFormats
- foreach lg_tag [lsort -command lsort_grp [GRP:list lg]] {
- if {[lsearch $view_state($TBview) $lg_tag] != -1} {
- set expanded 1
- } else {
- set expanded 0
- }
- set lg_ind [link_group:DLadd_link_group end $lg_tag 1]
- link_group:DLinfo $lg_ind
- set info [GRP:get $lg_tag info]
- set group_attrs ""
- keylget info group_attrs group_attrs
- set protocol_tags ""
- keylget group_attrs protocols protocol_tags
- foreach protocol_tag $protocol_tags {
- if {![PPP:isPresent protocol $protocol_tag]} {
- continue
- }
- PPP:get protocol $protocol_tag protocol val
- keylget ppp_type_info(protocol/$val) sub_defn ptype
- set val [translit "a-z" "A-Z" $val]
- switch $ptype {
- link {
- set protocol_ind [link_group:DLadd_protocol end $lg_ind $protocol_tag $expanded]
- link_group:DLinfo_protocol $protocol_ind $expanded
- }
- }
- }
- set link_tags [GRP:get $lg_tag tags]
- foreach link_tag [lsort -command lsort_link $link_tags] {
- set link_ind [link_group_link:DLadd_link end $lg_ind $link_tag $expanded]
- link_group_link:DLinfo $link_ind
- }
- dl:fixconn $DLlist $lg_ind
- }
- }
- proc ppp:TBview_authsCB {op mb ind sel view cbs} {
- Globals
- set header SCO_PPP_MSG_HDR_DL_AUTH
- VtSetValues $DLlist -MOTIF_labelList [list [ILM $header] ""]
- dl:clear $DLlist
- ppp:setFormats
- foreach auth_tag [lsort -command lsort_auth [PPP:list auth]] {
- set name ""
- set protocol ""
- PPP:get auth $auth_tag name name
- PPP:get auth $auth_tag protocol protocol
- if {[info exists name_ind($name)]} {
- dl:set $DLlist $name_ind($name) $protocol $auth_tag
- } else {
- set name_ind($name) [auth:DLadd_auth end $name]
- dl:set $DLlist $name_ind($name) $protocol $auth_tag
- }
- }
- foreach ind [Array name_ind] {
- auth:DLinfo $name_ind($ind)
- ppp:viewsort $name_ind($ind)
- dl:fixconn $DLlist $name_ind($ind)
- }
- }
- ##################################################
- proc ppp:viewsort {ind} {
- Globals
- GetUser $TBview view
- set level [dl:get $DLlist $ind _LEVEL]
- while {$level > 0} {
- set ind [dl:prev $DLlist $ind]
- set level [dl:get $DLlist $ind _LEVEL]
- }
- switch $view {
- mb1001 {
- ppp:viewsort_bundles $ind
- }
- mb1002 {
- ppp:viewsort_links $ind
- }
- }
- }
- proc ppp:viewsort_bundles {ind} {
- Globals
- set in ""
- set out ""
- set bl ""
- set pn ""
- set pl ""
- set last ""
- set ind [dl:next $DLlist $ind]
- while {![cequal $ind end]} {
- set level [dl:get $DLlist $ind _LEVEL]
- if {$level == 0} {
- break
- }
- lappend in $ind
- set sel [dl:get $DLlist $ind SEL]
- switch $sel {
- sel105 {
- lappend bl $ind
- }
- sel106 {
- lappend pn $ind
- }
- sel107 {
- lappend pl $ind
- }
- }
- set ind [dl:next $DLlist $ind]
- }
- if {![lempty $pn]} {
- set out [concat $out $pn]
- }
- if {![lempty $pl]} {
- set out [concat $out $pl]
- }
- if {![lempty $bl]} {
- set out [concat $out $bl]
- }
- dl:sort $DLlist $in $out
- }
- proc ppp:viewsort_links {ind} {
- Globals
- set in ""
- set out ""
- set l ""
- set pl ""
- set ind [dl:next $DLlist $ind]
- while {![cequal $ind end]} {
- set level [dl:get $DLlist $ind _LEVEL]
- if {$level == 0} {
- break
- }
- lappend in $ind
- set sel [dl:get $DLlist $ind SEL]
- switch $sel {
- sel202 {
- lappend l $ind
- }
- sel203 {
- lappend pl $ind
- }
- }
- set ind [dl:next $DLlist $ind]
- }
- if {![lempty $pl]} {
- set out [concat $out $pl]
- }
- if {![lempty $l]} {
- set out [concat $out $l]
- }
- dl:sort $DLlist $in $out
- }
- proc ppp:viewsort_auths {ind} {
- }
- ##################################################
- proc ppp:initOp {} {
- Globals
- wget $FDppp PDadd PBmodify PBdelete \
- PBbundle_add_bundle PBbundle_add_link_group PBbundle_add_network_protocol PBbundle_add_link_protocol \
- PBlink_group_add_link_group PBlink_group_add_link PBlink_group_add_link_protocol \
- PBauth_add_auth
- set mbFuncMap(mb1001) ppp:TBview_bundlesCB
- set mbFuncMap(mb1002) ppp:TBview_linksCB
- set mbFuncMap(mb1003) ppp:TBview_authsCB
- set mbFuncMap(mb112) ppp:PBbundleCB
- set mbFuncMap(mb113) ppp:PBbundle_link_groupCB
- set mbFuncMap(mb114) ppp:PBbundle_network_protocolCB
- set mbFuncMap(mb115) ppp:PBbundle_link_protocolCB
- set mbFuncMap(mb201) ppp:PBlink_groupCB
- set mbFuncMap(mb211) ppp:PBlink_group_linkCB
- set mbFuncMap(mb212) ppp:PBlink_group_link_protocolCB
- set mbFuncMap(mb301) ppp:PBauthCB
- set mbWidgetMap(mb110) $PDadd
- set mbWidgetMap(mb120) $PBmodify
- set mbWidgetMap(mb130) $PBdelete
- set mbWidgetMap(mb112) $PBbundle_add_bundle
- set mbWidgetMap(mb113) $PBbundle_add_link_group
- set mbWidgetMap(mb114) $PBbundle_add_network_protocol
- set mbWidgetMap(mb115) $PBbundle_add_link_protocol
- set mbWidgetMap(mb201) $PBlink_group_add_link_group
- set mbWidgetMap(mb211) $PBlink_group_add_link
- set mbWidgetMap(mb212) $PBlink_group_add_link_protocol
- set mbWidgetMap(mb301) $PBauth_add_auth
- set sel2mb(sel101) mb112
- set sel2mb(sel105) mb113
- set sel2mb(sel106) mb114
- set sel2mb(sel107) mb115
- set sel2mb(sel201) mb201
- set sel2mb(sel202) mb211
- set sel2mb(sel203) mb212
- set sel2mb(sel301) mb301
- set visibleMap(all) {mb112 mb113 mb114 mb115 mb201 mb211 mb212 mb301}
- set visibleMap(mb1001) {mb112 mb113 mb114 mb115}
- set visibleMap(mb1002) {mb201 mb211 mb212}
- set visibleMap(mb1003) {mb301}
- set sensitiveMap(mb1001) ppp:setButtons_bundles
- set sensitiveMap(mb1002) ppp:setButtons_links
- set sensitiveMap(mb1003) ppp:setButtons_auths
- }
- proc ppp:execOp {op mb ind sel view cbs} {
- Globals
- ppp:chain_clear
- set res [eval $mbFuncMap($mb) \$op \"\$mb\" \"\$ind\" \"\$sel\" \"$view\" \$cbs]
- return $res
- }
- proc ppp:setButtons {ind} {
- Globals
- GetUser $TBview view
- set i3 [intersect3 $visibleMap($view) $visibleMap(all)]
- foreach button [lindex $i3 1] {
- VtSetValues $mbWidgetMap($button) -hidden 0
- }
- foreach button [lindex $i3 2] {
- VtSetValues $mbWidgetMap($button) -hidden 1
- }
- wget $FDppp PDadd PBmodify PBdelete
- if {[cequal $ind ""]} {
- SetSens $PBmodify 0
- SetSens $PBdelete 0
- foreach button $visibleMap(all) {
- SetSens $mbWidgetMap($button) 0
- }
- } else {
- SetSens $PBmodify 1
- SetSens $PBdelete 1
- }
- $sensitiveMap($view) $ind
- }
- proc ppp:setButtons_bundles {ind} {
- Globals
- wget $FDppp PBmodify PBbundle_add_bundle PBbundle_add_link_group PBbundle_add_network_protocol PBbundle_add_link_protocol
- if {[cequal $ind ""]} {
- SetSens $PBbundle_add_bundle 1
- } else {
- set sel [dl:get $DLlist $ind SEL]
- switch $sel {
- sel101 {
- set bundle_tag [dl:get $DLlist $ind OBJ]
- SetSens $PBbundle_add_link_group 1
- SetSens $PBbundle_add_network_protocol 1
- SetSens $PBbundle_add_link_protocol 1
- }
- sel105 {
- SetSens $PBmodify 0
- SetSens $PBbundle_add_link_group 0
- SetSens $PBbundle_add_network_protocol 0
- SetSens $PBbundle_add_link_protocol 0
- }
- sel106 -
- sel107 {
- set proto [dl:get $DLlist $ind PROTO]
- set n [num_visible_opts protocol/$proto]
- if {$n > 0} {
- SetSens $PBmodify 1
- } else {
- SetSens $PBmodify 0
- }
- SetSens $PBbundle_add_link_group 0
- SetSens $PBbundle_add_network_protocol 0
- SetSens $PBbundle_add_link_protocol 0
- }
- }
- }
- }
- proc ppp:setButtons_links {ind} {
- Globals
- wget $FDppp PBmodify PBlink_group_add_link_group PBlink_group_add_link PBlink_group_add_link_protocol
- if {[cequal $ind ""]} {
- SetSens $PBlink_group_add_link_group 1
- } else {
- set sel [dl:get $DLlist $ind SEL]
- switch $sel {
- sel201 {
- SetSens $PBlink_group_add_link 1
- SetSens $PBlink_group_add_link_protocol 1
- }
- sel202 {
- SetSens $PBmodify 0
- SetSens $PBlink_group_add_link 0
- SetSens $PBlink_group_add_link_protocol 0
- }
- sel203 {
- set proto [dl:get $DLlist $ind PROTO]
- set n [num_visible_opts protocol/$proto]
- if {$n > 0} {
- SetSens $PBmodify 1
- } else {
- SetSens $PBmodify 0
- }
- SetSens $PBlink_group_add_link 0
- SetSens $PBlink_group_add_link_protocol 0
- }
- }
- }
- }
- proc ppp:setButtons_auths {ind} {
- Globals
- wget $FDppp PBauth_add_auth
- SetSens $PBauth_add_auth 1
- }
- proc ppp:setFormats {} {
- Globals
- GetUser $TBview view
- switch $view {
- mb1001 {
- dl:format $DLlist 0 0 {
- {OBJ {DATA} ""}
- {SEL {DATA} ""}
- {PHASE {ICON 1 0 0} [dl:icon NI]}
- {NAME {STRING 20} ""}
- {FREE {STRING 40} ""}
- }
- dl:format $DLlist 1 0 {
- {OBJ {DATA} ""}
- {SEL {DATA} ""}
- {BUNDLEIND {DATA} ""}
- {NAME {STRING 20} ""}
- {FREE {STRING 40} ""}
- }
- dl:format $DLlist 1 1 {
- {OBJ {DATA} ""}
- {SEL {DATA} ""}
- {PROTO {DATA} ""}
- {BUNDLEIND {DATA} ""}
- {PROTOCOL {STRING 20} ""}
- {FREE {STRING 40} ""}
- }
- dl:format $DLlist 1 2 {
- {OBJ {DATA} ""}
- {SEL {DATA} ""}
- {PROTO {DATA} ""}
- {BUNDLEIND {DATA} ""}
- {PROTOCOL {STRING 20} ""}
- {FREE {STRING 40} ""}
- }
- }
- mb1002 {
- dl:format $DLlist 0 0 {
- {OBJ {DATA} ""}
- {SEL {DATA} ""}
- {TYPE {DATA} ""}
- {NAME {STRING 20} ""}
- {FREE {STRING 40} ""}
- }
- dl:format $DLlist 1 0 {
- {OBJ {DATA} ""}
- {SEL {DATA} ""}
- {LGIND {DATA} ""}
- {PHASE {ICON 1 0 0} [dl:icon NI]}
- {DEV {STRING 20} ""}
- }
- dl:format $DLlist 1 1 {
- {OBJ {DATA} ""}
- {SEL {DATA} ""}
- {PROTO {DATA} ""}
- {LGIND {DATA} ""}
- {PROTOCOL {STRING 20} ""}
- {FREE {STRING 40} ""}
- }
- }
- mb1003 {
- dl:format $DLlist 0 0 {
- {SEL {DATA} ""}
- {chap {DATA} ""}
- {pap {DATA} ""}
- {NAME {STRING 20} ""}
- {FREE {STRING 40} ""}
- }
- }
- }
- }
- ##################################################
- proc ppp:DLselectCB {cbs} {
- Globals
- if {[dl:defer $DLlist]} {
- return
- }
- wget $FDppp PBexpand PBcollapse
- wget $FDppp PBexpandall PBcollapseall
- set selected [dl:selected $DLlist IND]
- if {[cequal $selected ""]} {
- GetUser $TBview sel
- SetSens $PBexpand 0
- SetSens $PBcollapse 0
- } else {
- set level [dl:get $DLlist $selected _LEVEL]
- set sel [dl:get $DLlist $selected SEL]
- set state [dl:state $DLlist $selected]
- switch $state {
- collapsed {
- SetSens $PBexpand 1
- SetSens $PBcollapse 0
- }
- expanded {
- SetSens $PBexpand 0
- SetSens $PBcollapse 1
- }
- default {
- SetSens $PBexpand 0
- if {$level > 0 } {
- SetSens $PBcollapse 1
- } else {
- SetSens $PBcollapse 0
- }
- }
- }
- }
- set total 0
- set expanded 0
- set collapsed 0
- set ind start
- while {![cequal $ind end]} {
- set ind [dl:next $DLlist $ind]
- if {![cequal $ind end]} {
- set state [dl:state $DLlist $ind]
- switch $state {
- expanded {
- incr expanded
- incr total
- }
- collapsed {
- incr collapsed
- incr total
- }
- }
- }
- }
- if {$expanded < $total } {
- SetSens $PBexpandall 1
- } else {
- SetSens $PBexpandall 0
- }
- if {$collapsed < $total} {
- SetSens $PBcollapseall 1
- } else {
- SetSens $PBcollapseall 0
- }
- ppp:setButtons $selected
- }
- proc ppp:PDviewCB {force {cbs 0}} {
- Globals
- global view_state
- global TBview_bundles TBview_links TBview_auths
- if {$cbs == 0} {
- set cbs $force
- set force 0
- }
- keylget cbs widget TBwidget
- if {!$force && [cequal $TBwidget $TBview]} {
- VtSetValues $TBview -value 1
- VtUnLock
- return
- }
- if {![cequal $TBview null]} {
- VtSetValues $TBview -value 0
- }
- if {![cequal $TBview $TBview_auths]} {
- set view_state($TBview) ""
- set ind start
- while {![cequal $ind end]} {
- set ind [dl:find $DLlist $ind down {{_LEVEL 0}}]
- if {![cequal $ind end]} {
- set tag [dl:get $DLlist $ind OBJ]
- set state [dl:state $DLlist $ind]
- if {![cequal $state collapsed]} {
- lappend view_state($TBview) $tag
- }
- }
- set ind [dl:next $DLlist $ind]
- }
- }
- set TBview $TBwidget
- SetVar $FDppp TBview
- GetUser $TBview view
- if {![info exist view_state($TBview)]} {
- set view_state($TBview) ""
- }
- VtDrawnListDeleteItem $DLlist -all
- ppp:execOp view $view "" "" $view $cbs
- ppp:DLselectCB $cbs
- VtUnLock
- }
- proc ppp:PBaddCB {cbs} {
- Globals
- set ind [dl:selected $DLlist IND]
- if {[cequal $ind ""]} {
- set sel ""
- } else {
- set sel [dl:selected $DLlist SEL]
- }
- keylget cbs widget PBwidget
- GetUser $PBwidget mb
- GetUser $TBview view
- ppp:execOp add $mb "$ind" "$sel" $view $cbs
- }
- proc ppp:PBmodifyCB {cbs} {
- Globals
- set ind [dl:selected $DLlist IND]
- if {[cequal $ind ""]} {
- VtUnLock
- return
- }
- set sel [dl:selected $DLlist SEL]
- set mb $sel2mb($sel)
- GetUser $TBview view
- ppp:execOp modify $mb "$ind" "$sel" $view $cbs
- }
- proc ppp:PBdeleteCB {cbs} {
- Globals
- set ind [dl:selected $DLlist IND]
- if {[cequal $ind ""]} {
- VtUnLock
- return
- }
- set sel [dl:selected $DLlist SEL]
- set mb $sel2mb($sel)
- GetUser $TBview view
- ppp:execOp delete $mb "$ind" "$sel" $view $cbs
- }
- ##################################################
- proc ppp:PBauthCB {op mb ind sel view cbs} {
- Globals
- switch $op {
- add {
- auth:buildCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- modify {
- auth:buildCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- delete {
- keylget cbs dialog dialog
- if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "auth:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
- VtUnLock
- return
- }
- }
- }
- }
- proc auth:DLadd_auth {ind name} {
- Globals
- set name_ind [dl:add $DLlist $ind 0]
- dl:set $DLlist $name_ind ICON [dl:icon a]
- dl:set $DLlist $name_ind SEL sel301
- dl:set $DLlist $name_ind NAME $name
- dl:show $DLlist $name_ind 1
- return $name_ind
- }
- proc auth:DLinfo {ind} {
- Globals
- global free_gap
- set chap [dl:get $DLlist $ind chap]
- set pap [dl:get $DLlist $ind pap]
- set s ""
- append s [format "%s: " [ILM SCO_PPP_MSG_L_AUTH_PROTOCOLS]]
- if {![cequal $chap ""]} {
- append s "CHAP"
- }
- if {![cequal $chap ""] && ![cequal $pap ""]} {
- append s " "
- }
- if {![cequal $pap ""]} {
- append s "PAP"
- }
- dl:set $DLlist $ind FREE $s
- dl:show $DLlist $ind
- }
- proc auth:buildCB {op mb ind sel view cbs} {
- Globals
- keylget cbs dialog dialog
- if {[cequal $op add]} {
- set title [ILM SCO_PPP_MSG_TITLE_AUTH_ADD]
- } else {
- set title [ILM SCO_PPP_MSG_TITLE_AUTH_MOD]
- }
- wset $dialog FDauth [VtFormDialog $dialog.FDauth \
- -title $title \
- -ok \
- -okCallback auth:changeCB \
- -cancel \
- -cancelCallback VxEndFormCB \
- -autoDestroy 1 \
- -autoLock auth:changeCB \
- -help \
- ]
- wset $FDauth AFauth [AlignedForm $FDauth.AFauth [list \
- [list SCO_PPP_MSG_AUTH_APROTOCOL Laprotocol RBaprotocol \
- [list VtRadioBox \
- -horizontal \
- -callback auth:RBaprotocolCB \
- ]] \
- [list SCO_PPP_MSG_AUTH_NAME Lname Tname \
- [list VtText \
- -shortHelpString [ILM SCO_PPP_MSG_SH_AUTH_NAME] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_AUTH_CHAP_LOCALSECRET Lchap_localsecret Tchap_localsecret \
- [list VtText \
- -rightSide FORM \
- -shortHelpString [ILM SCO_PPP_MSG_SH_AUTH_CHAP_LOCALSECRET] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_AUTH_CHAP_PEERSECRET Lchap_peersecret Tchap_peersecret \
- [list VtText \
- -rightSide FORM \
- -shortHelpString [ILM SCO_PPP_MSG_SH_AUTH_CHAP_PEERSECRET] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_AUTH_PAP_LOCALSECRET Lpap_localsecret Tpap_localsecret \
- [list VtText \
- -rightSide FORM \
- -shortHelpString [ILM SCO_PPP_MSG_SH_AUTH_PAP_LOCALSECRET] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_AUTH_PAP_PEERSECRET Lpap_peersecret Tpap_peersecret \
- [list VtText \
- -rightSide FORM \
- -shortHelpString [ILM SCO_PPP_MSG_SH_AUTH_PAP_PEERSECRET] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- ####################
- wset $FDauth TBchap [cw VtToggleButton $RBaprotocol.TBchap \
- SCO_PPP_MSG_AUTH_CHAP \
- "" \
- SCO_PPP_MSG_SH_AUTH_CHAP \
- -userData chap \
- -value 0 \
- ]
- wset $FDauth TBpap [cw VtToggleButton $RBaprotocol.TBpap \
- SCO_PPP_MSG_AUTH_PAP \
- "" \
- SCO_PPP_MSG_SH_AUTH_PAP \
- -userData pap \
- -value 0 \
- ]
- wset $FDauth TBboth [cw VtToggleButton $RBaprotocol.TBboth \
- SCO_PPP_MSG_AUTH_BOTH \
- "" \
- SCO_PPP_MSG_SH_AUTH_BOTH \
- -userData both \
- -value 0 \
- ]
- ####################
- set STauth [StatusBar $FDauth $AFauth]
- ####################
- VtShow $FDauth
- wput $FDauth Lname Tname RBaprotocol \
- Lchap_peersecret Tchap_peersecret Lchap_localsecret Tchap_localsecret \
- Lpap_peersecret Tpap_peersecret Lpap_localsecret Tpap_localsecret
- wput $FDauth op mb ind sel
- set auth_tag(chap) ""
- set auth_tag(pap) ""
- if {[cequal $op add]} {
- SetValues $RBaprotocol TBchap
- } else {
- SetSens $Lname 0
- SetSens $Tname 0
- set name [dl:get $DLlist $ind NAME]
- SetValues $Tname name
- foreach tag [PPP:list auth] {
- PPP:get auth $tag name auth_name
- PPP:get auth $tag protocol auth_protocol
- if {[cequal $name $auth_name]} {
- set auth_tag($auth_protocol) $tag
- }
- }
- set i 0
- if {![cequal $auth_tag(chap) ""]} {
- incr i 1
- PPP:get auth $auth_tag(chap) localsecret localsecret
- PPP:get auth $auth_tag(chap) peersecret peersecret
- set localsecret [cshrink $localsecret]
- set peersecret [cshrink $peersecret]
- SetValues $Tchap_localsecret localsecret
- SetValues $Tchap_peersecret peersecret
- }
- if {![cequal $auth_tag(pap) ""]} {
- incr i 2
- PPP:get auth $auth_tag(pap) localsecret localsecret
- PPP:get auth $auth_tag(pap) peersecret peersecret
- set localsecret [cshrink $localsecret]
- set peersecret [cshrink $peersecret]
- SetValues $Tpap_localsecret localsecret
- SetValues $Tpap_peersecret peersecret
- }
- switch $i {
- 0 {
- SetValues $RBaprotocol TBchap
- }
- 1 {
- SetValues $RBaprotocol TBchap
- }
- 2 {
- SetValues $RBaprotocol TBpap
- }
- 3 {
- SetValues $RBaprotocol TBboth
- }
- }
- }
- VxSetVar $FDauth chap_tag $auth_tag(chap)
- VxSetVar $FDauth pap_tag $auth_tag(pap)
- SetSens $RBaprotocol 1
- SaSetTabGroups $FDauth [list \
- $RBaprotocol \
- $Tname \
- $Tchap_localsecret \
- $Tchap_peersecret \
- $Tpap_localsecret \
- $Tpap_peersecret \
- ]
- SaSetFocusList $FDauth [list \
- $RBaprotocol \
- $Tname \
- $Tchap_localsecret \
- $Tchap_peersecret \
- $Tpap_localsecret \
- $Tpap_peersecret \
- ]
- VtUnLock
- }
- proc auth:RBaprotocolCB {cbs} {
- keylget cbs dialog FDauth
- keylget cbs widget RBaprotocol
- if {![GetSens $RBaprotocol]} {
- return
- }
- wget $FDauth RBaprotocol \
- Lchap_peersecret Tchap_peersecret Lchap_localsecret Tchap_localsecret \
- Lpap_peersecret Tpap_peersecret Lpap_localsecret Tpap_localsecret
- GetValues $RBaprotocol TB
- GetUser $TB aprotocol
- set chap 1
- set pap 1
- switch $aprotocol {
- chap { set pap 0 }
- pap { set chap 0 }
- }
- SetSens $Lchap_peersecret $chap
- SetSens $Tchap_peersecret $chap
- SetSens $Lchap_localsecret $chap
- SetSens $Tchap_localsecret $chap
- SetSens $Lpap_peersecret $pap
- SetSens $Tpap_peersecret $pap
- SetSens $Lpap_localsecret $pap
- SetSens $Tpap_localsecret $pap
- }
- proc auth:changeCB {cbs} {
- Globals
- keylget cbs dialog FDauth
- wget $FDauth RBaprotocol Tname \
- Lchap_peersecret Tchap_peersecret Lchap_localsecret Tchap_localsecret \
- Lpap_peersecret Tpap_peersecret Lpap_localsecret Tpap_localsecret
- wget $FDauth op ind
- GetValues $Tname name
- set name [validTag $name]
- SetValues $Tname name
- GetValues $Tchap_peersecret chap_peersecret
- GetValues $Tchap_localsecret chap_localsecret
- GetVar $FDauth chap_tag
- GetValues $Tpap_peersecret pap_peersecret
- GetValues $Tpap_localsecret pap_localsecret
- GetVar $FDauth pap_tag
- GetValues $RBaprotocol TB
- GetUser $TB aprotocol
- if {[cequal $name ""]} {
- return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_NAME_NULL]]
- }
- if {[cequal $op add]} {
- foreach tag [PPP:list auth] {
- PPP:get auth $tag name auth_name
- if {[cequal $name $auth_name]} {
- return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_NAME_DUPLICATE]]
- }
- }
- }
- set i 0
- if {[cequal $chap_tag ""] && ![cequal $aprotocol pap]} {
- set chap_tag chap_$name
- incr i 1
- set attrValueList ""
- keylset attrValueList protocol chap
- keylset attrValueList name $name
- keylset attrValueList localsecret $chap_localsecret
- keylset attrValueList peersecret $chap_peersecret
- if {![PPP:create auth $chap_tag $attrValueList]} {
- return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_CHAP_CREATE]]
- }
- } elseif {![cequal $chap_tag ""] && [cequal $aprotocol pap]} {
- if {![PPP:delete auth $chap_tag]} {
- return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_CHAP_DELETE]]
- }
- } elseif {![cequal $chap_tag ""]} {
- if {![PPP:replace auth $chap_tag localsecret $chap_localsecret]} {
- return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_CHAP_REPLACE]]
- }
- if {![PPP:replace auth $chap_tag peersecret $chap_peersecret]} {
- return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_CHAP_REPLACE]]
- }
- } else {
- incr i 1
- }
- if {[cequal $pap_tag ""] && ![cequal $aprotocol chap]} {
- set pap_tag pap_$name
- incr i 2
- set attrValueList ""
- keylset attrValueList protocol pap
- keylset attrValueList name $name
- keylset attrValueList localsecret $pap_localsecret
- keylset attrValueList peersecret $pap_peersecret
- if {![PPP:create auth $pap_tag $attrValueList]} {
- return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_PAP_CREATE]]
- }
- } elseif {![cequal $pap_tag ""] && [cequal $aprotocol chap]} {
- if {![PPP:delete auth $pap_tag]} {
- return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_PAP_DELETE]]
- }
- } elseif {![cequal $pap_tag ""]} {
- if {![PPP:replace auth $pap_tag localsecret $pap_localsecret]} {
- return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_PAP_REPLACE]]
- }
- if {![PPP:replace auth $pap_tag peersecret $pap_peersecret]} {
- return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_PAP_REPLACE]]
- }
- } else {
- incr i 2
- }
- if {$i == 3} {
- set ind [auth:DLadd_auth end $name]
- }
- dl:set $DLlist $ind chap $chap_tag
- dl:set $DLlist $ind pap $pap_tag
- dl:show $DLlist $ind 1
- auth:DLinfo $ind
- ppp:viewsort $ind
- dl:fixconn $DLlist $ind
- VxEndFormCB $cbs
- ppp:chain_next
- VtUnLock
- }
- proc auth:deleteCB {op mb ind sel view cbs args} {
- Globals
- set chap_tag [dl:get $DLlist $ind chap]
- set pap_tag [dl:get $DLlist $ind pap]
- if {![cequal $chap_tag ""]} {
- if {![PPP:delete auth $chap_tag]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_AUTH_CHAP_DELETE]]
- }
- }
- if {![cequal $pap_tag ""]} {
- if {![PPP:delete auth $pap_tag]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_AUTH_PAP_DELETE]]
- }
- }
- dl:delete $DLlist $ind
- VtUnLock
- }
- ##################################################
- proc ppp:PBlink_groupCB {op mb ind sel view cbs} {
- Globals
- switch $op {
- add {
- link_group:buildCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- modify {
- link_group:buildCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- delete {
- keylget cbs dialog dialog
- if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "link_group:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
- VtUnLock
- return
- }
- }
- }
- }
- proc link_group:RBtypeCB {cbs} {
- keylget cbs dialog FDlinks
- keylget cbs value value
- wget $FDlinks RBtype Lflow RBflow TBflowHardware Tpush Tpop
- GetValues $RBtype TB
- GetUser $TB type
- if {[cequal $type ISDN_SYNC]} {
- SetSens $Lflow 0
- SetSens $RBflow 0
- SetValues $RBflow TBflowHardware
- } else {
- SetSens $Lflow 1
- SetSens $RBflow 1
- }
- VtSetValues $Tpop -value [PPP:default link pop [list [list type $type]]]
- VtSetValues $Tpush -value [PPP:default link push [list [list type $type]]]
- VtUnLock
- }
- proc link_group:buildCB {op mb ind sel view cbs} {
- Globals
- keylget cbs dialog dialog
- if {[cequal $op add]} {
- set title [ILM SCO_PPP_MSG_TITLE_LINKS_ADD]
- } else {
- set title [ILM SCO_PPP_MSG_TITLE_LINKS_MOD]
- }
- wset $dialog FDlinks [VtFormDialog $dialog.FDlinks \
- -title $title \
- -ok \
- -okCallback link_group:changeCB \
- -cancel \
- -cancelCallback VxEndFormCB \
- -autoDestroy 1 \
- -autoLock link_group:changeCB \
- -help \
- ]
- set FTDlinks [FormTabDialog $FDlinks.FTDlinks]
- FormTabs $FTDlinks [list \
- [list FTlinks \
- SCO_PPP_MSG_FT_LINKS \
- SCO_PPP_MSG_TITLE_FT_LINKS \
- SCO_PPP_MSG_SH_FT_LINKS \
- ] \
- ]
- if {[cequal $op add]} {
- set FTlprotocols [cw SaFormTab $FTDlinks.FTlprotocols \
- SCO_PPP_MSG_LINK_FT_LPROTOCOLS \
- SCO_PPP_MSG_TITLE_LINK_FT_LPROTOCOLS \
- SCO_PPP_MSG_SH_LINK_FT_LPROTOCOLS \
- ]
- } else {
- set FTlprotocols ""
- }
- set FTadvanced [cw SaFormTab $FTDlinks.FTadvanced \
- SCO_PPP_MSG_LINK_FT_ADVANCED \
- SCO_PPP_MSG_TITLE_LINK_FT_ADVANCED \
- SCO_PPP_MSG_SH_LINK_FT_ADVANCED \
- ]
- wset $FDlinks AFlinks [AlignedForm $FTlinks.AFlinks [list \
- [list SCO_PPP_MSG_LINKS_NAME Lname Tname \
- [list VtText \
- -userData "" \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_NAME] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_LINKS_TYPES Ltype RBtype \
- [list VtRadioBox \
- -callback link_group:RBtypeCB \
- -autoLock link_group:RBtypeCB \
- -horizontal \
- -numColumns 2 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_TYPES] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_LINKS_FLOW Lflow RBflow \
- [list VtRadioBox \
- -horizontal \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_FLOW] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_LINKS_PHONE Lphone Tphone \
- [list VtText \
- -userData "" \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_PHONE] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- if {[cequal $op add]} {
- wset $FDlinks AFlprotocols [AlignedForm $FTlprotocols.AFlprotocols [list \
- [list SCO_PPP_MSG_LPROTOCOLS Llprotocols LSlprotocols \
- [list VtList \
- -callback link_group:LSlprotocols_selectCB \
- -selection MULTIPLE \
- -scrollBar 1 \
- -columns 25 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_LPROTOCOLS] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- } else {
- set LSlprotocols ""
- }
- wset $FDlinks AFadvanced [AlignedForm $FTadvanced.AFadvanced [list \
- [list SCO_PPP_MSG_LINKS_BANDWIDTH Lbandwidth SBbandwidth \
- [list VxSpinButton \
- 10 0 "" 2147483647 "" 1 0 "" "" \
- ]] \
- [list SCO_PPP_MSG_LINKS_PUSH Lpush Tpush \
- [list VtText \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_PUSH] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_LINKS_POP Lpop Tpop \
- [list VtText \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_POP] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- VtSetValues $SBbandwidth \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_MAXLINKS] \
- -shortHelpCallback SaShortHelpCB
- foreach type {ACU ISDN_SYNC ISDN_ASYNC Direct} {
- set type_sens($type) [expr ![lempty [availableLinks $type]]]
- }
- wset $FDlinks TBtypeACU [VtToggleButton $RBtype.TBtypeACU \
- -userData ACU \
- -sensitive $type_sens(ACU) \
- -label [ILM SCO_PPP_MSG_LINKS_TYPES_ACU] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_TYPES_ACU] \
- -shortHelpCallback SaShortHelpCB \
- ]
- wset $FDlinks TBtypeDirect [VtToggleButton $RBtype.TBtypeDirect \
- -userData Direct \
- -sensitive $type_sens(Direct) \
- -label [ILM SCO_PPP_MSG_LINKS_TYPES_DIRECT] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_TYPES_DIRECT] \
- -shortHelpCallback SaShortHelpCB \
- ]
- wset $FDlinks TBtypeISDN_SYNC [VtToggleButton $RBtype.TBtypeISDN_SYNC \
- -userData ISDN_SYNC \
- -sensitive $type_sens(ISDN_SYNC) \
- -label [ILM SCO_PPP_MSG_LINKS_TYPES_ISDN_SYNC] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_TYPES_ISDN_SYNC] \
- -shortHelpCallback SaShortHelpCB \
- ]
- wset $FDlinks TBtypeISDN_ASYNC [VtToggleButton $RBtype.TBtypeISDN_ASYNC \
- -userData ISDN_ASYNC \
- -sensitive $type_sens(ISDN_ASYNC) \
- -label [ILM SCO_PPP_MSG_LINKS_TYPES_ISDN_ASYNC] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_TYPES_ISDN_ASYNC] \
- -shortHelpCallback SaShortHelpCB \
- ]
- set type_sel ""
- foreach type {ACU ISDN_SYNC ISDN_ASYNC Direct} {
- if {$type_sens($type)} {
- eval lappend type_sel \$TBtype$type
- }
- }
- ##########
- wset $FDlinks TBflowHardware [VtToggleButton $RBflow.TBflowHardware \
- -userData hardware \
- -label [ILM SCO_PPP_MSG_LINKS_FLOW_HARDWARE] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_FLOW_HARDWARE] \
- -shortHelpCallback SaShortHelpCB \
- ]
- wset $FDlinks TBflowSoftware [VtToggleButton $RBflow.TBflowSoftware \
- -userData software \
- -label [ILM SCO_PPP_MSG_LINKS_FLOW_SOFTWARE] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_FLOW_SOFTWARE] \
- -shortHelpCallback SaShortHelpCB \
- ]
- wset $FDlinks TBflowNone [VtToggleButton $RBflow.TBflowNone \
- -userData none \
- -label [ILM SCO_PPP_MSG_LINKS_FLOW_NONE] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_FLOW_NONE] \
- -shortHelpCallback SaShortHelpCB \
- ]
- StatusBar $FDlinks $FTDlinks
- VtShow $FDlinks
- SaFormTabDialogMaxSize $FTDlinks
- SaFormTabSetSelected $FTlinks
- wput $FDlinks Tname RBtype Lflow RBflow Tphone SBbandwidth LSlprotocols \
- Tpop Tpush
- wput $FDlinks FTlinks FTlprotocols
- wput $FDlinks op mb ind sel view cbs
- if {[cequal $op add]} {
- if {![lempty $type_sel]} {
- VtSetValues $RBtype -value [lindex $type_sel 0]
- }
- SetValues $RBflow TBflowHardware
- } else {
- set lg_obj [dl:get $DLlist $ind OBJ]
- set name [dl:get $DLlist $ind NAME]
- SetValues $Tname name
- SetUser $Tname ind
- set info [GRP:get $lg_obj info]
- set group_attrs ""
- keylget info group_attrs group_attrs
- set phone ""
- keylget group_attrs phone phone
- SetValues $Tphone phone
- set flow hardware
- keylget group_attrs flow flow
- set flow_map(hardware) $TBflowHardware
- set flow_map(software) $TBflowSoftware
- set flow_map(none) $TBflowNone
- set flow $flow_map($flow)
- SetValues $RBflow flow
- set type [devTypes ACU]
- keylget group_attrs type type
- set type_map([devTypes ACU]) $TBtypeACU
- set type_map([devTypes ISDN_SYNC]) $TBtypeISDN_SYNC
- set type_map([devTypes ISDN_ASYNC]) $TBtypeISDN_ASYNC
- set type_map([devTypes Direct]) $TBtypeDirect
- set type $type_map($type)
- SetValues $RBtype type
- set bandwidth 0
- keylget group_attrs bandwidth bandwidth
- GetVar $SBbandwidth text
- SetValues $text bandwidth
- set push ""
- keylget group_attrs push push
- SetVar $Tpush push
- set pop ""
- keylget group_attrs pop pop
- SetVar $Tpop pop
- set bandwidth 0
- keylget group_attrs bandwidth bandwidth
- GetVar $SBbandwidth text
- SetValues $text bandwidth
- set tags [GRP:get $lg_obj tags]
- if {![lempty $tags]} {
- SetSens $RBtype 0
- }
- set lprotocols ""
- }
- if {[cequal $op add]} {
- set protocols ""
- set lprotocols [defn_list protocol link link]
- } else {
- set lprotocols ""
- }
- if {![lempty $LSlprotocols]} {
- set lpSel ""
- foreach protocol $lprotocols {
- keylget ppp_type_info($protocol) val val
- set proto [translit "a-z" "A-Z" $val]
- VtListAddItem $LSlprotocols \
- -item $proto
- if {[cequal $op add] || ![lempty [findProtocolTag $val $protocols]]} {
- VtListSelectItem $LSlprotocols \
- -item $proto
- set_add lpSel $proto
- }
- }
- VxSetVar $LSlprotocols firstError 1
- SetVar $LSlprotocols lpSel
- }
- VtUnLock
- }
- proc link_group:LSlprotocols_selectCB {cbs} {
- keylget cbs dialog FDlinks
- keylget cbs value value
- keylget cbs mode mode
- keylget cbs widget LSlprotocols
- keylget cbs selectedItemList itemList
- GetVar $LSlprotocols lpSel
- set i3 [intersect3 $lpSel $itemList]
- if {[cequal "" [lindex $i3 0]]} {
- set value [lindex $i3 2]
- set mode select
- } else {
- set value [lindex $i3 0]
- set mode deselect
- }
- GetVar $LSlprotocols lpSel
- if {[cequal $mode deselect] && [cequal $value LCP]} {
- VtListSelectItem $LSlprotocols \
- -item $value
- GetVar $LSlprotocols firstError
- if {$firstError} {
- VxSetVar $LSlprotocols firstError 0
- return [throwError $FDlinks [ILM SCO_PPP_ERR_PROTOCOL_LCP_DESELECT]]
- }
- }
- VxSetVar $LSlprotocols lpSel $itemList
- }
- proc link_group:changeCB {cbs} {
- Globals
- keylget cbs dialog FDlinks
- wget $FDlinks Tname RBtype Lflow RBflow Tphone SBbandwidth LSlprotocols \
- Tpop Tpush FTlinks
- wget $FDlinks op ind mb sel view
- GetValues $Tname name
- GetUser $Tname lg_ind
- GetValues $Tphone phone
- GetVar $SBbandwidth text
- GetValues $text bandwidth
- GetValues $RBflow TB
- GetUser $TB flow
- GetValues $RBtype TB
- GetUser $TB type
- GetValues $Tpush push
- GetValues $Tpop pop
- set protocols ""
- set name [validName $name]
- if {[cequal $name ""]} {
- return [throwError $FDlinks [ILM SCO_PPP_ERR_LINKS_NAME_NULL]]
- }
- if {[cequal $op add]} {
- set old_flow ""
- set old_phone ""
- set old_bandwidth ""
- set old_push ""
- set old_pop ""
- set lprotocols [VtListGetSelectedItem $LSlprotocols -byItemList]
- if {[GRP:isTagPresent lg $name]} {
- SaFormTabSetSelected $FTlinks
- return [throwError $FDlinks [ILM SCO_PPP_ERR_LINKS_NAME_DUPLICATE]]
- }
- set lg_obj lg_${name}
- while {[GRP:isPresent $lg_obj]} {
- set lg_obj [cycleName $lg_obj]
- }
- foreach proto $lprotocols {
- set val [translit "A-Z" "a-z" $proto]
- set protocol_tag ${val}_${name}
- while {[PPP:isPresent protocol $protocol_tag]} {
- set protocol_tag [cycleName $protocol_tag]
- }
- if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type link/$type]]]} {
- foreach protocol_tag $protocols {
- if {![PPP:isPresent protocol $protocol_tag]} {
- continue
- }
- PPP:get protocol $protocol_tag protocol protocol
- PPP:delete protocol/${protocol} $protocol_tag
- }
- return [throwError $FDlinks [ILM SCO_PPP_ERR_LINKS_CREATE]]
- }
- set_add protocols $protocol_tag
- set algorithms [defn_list algorithm link protocol/$val]
- if {![lempty $algorithms]} {
- set txalgorithms ""
- set rxalgorithms ""
- foreach algorithm $algorithms {
- set alval ""
- keylget ppp_type_info($algorithm) val alval
- if {[cequal $alval ""]} {
- continue
- }
- set tx_tag tx_${val}_${alval}_${name}
- set rx_tag rx_${val}_${alval}_${name}
- while {[PPP:isPresent algorithm $rx_tag] || [PPP:isPresent algorithm $tx_tag]} {
- set tx_tag [cycleName $tx_tag]
- set rx_tag [cycleName $rx_tag]
- }
- set_add rxalgorithms $rx_tag
- set_add txalgorithms $tx_tag
- if {![PPP:create algorithm/${alval} $rx_tag]} {
- set_del rxalgorithms $rx_tag
- }
- if {![PPP:create algorithm/${alval} $tx_tag]} {
- set_del txalgorithms $tx_tag
- }
- }
- PPP:replace protocol/${val} $protocol_tag txalgorithms $txalgorithms
- PPP:replace protocol/${val} $protocol_tag rxalgorithms $rxalgorithms
- }
- }
- if {![GRP:create lg $lg_obj]} {
- return [throwError $FDlinks [ILM SCO_PPP_ERR_LINKS_NAME_CREATE]]
- }
- set info [GRP:get $lg_obj info]
- } else {
- set lg_obj [dl:get $DLlist $lg_ind OBJ]
- set old_name [dl:get $DLlist $lg_ind NAME]
- if {![cequal $name $old_name]} {
- if {[GRP:isTagPresent lg $name]} {
- SaFormTabSetSelected $FTlinks
- return [throwError $FDlinks [ILM SCO_PPP_ERR_LINKS_NAME_DUPLICATE]]
- }
- dl:set $DLlist $lg_ind NAME $name
- dl:show $DLlist $lg_ind 1
- }
- dl:set $DLlist $lg_ind TYPE $type
- set info [GRP:get $lg_obj info]
- keylget info group_attrs group_attrs
- keylget group_attrs flow old_flow
- keylget group_attrs phone old_phone
- keylget group_attrs bandwidth old_bandwidth
- keylget group_attrs push old_push
- keylget group_attrs pop old_pop
- keylget group_attrs protocols protocols
- }
- GRP:replace $lg_obj name $name
- set group_attrs ""
- keylset group_attrs type [devTypes $type]
- keylset group_attrs protocols $protocols
- keylset group_attrs flow $flow
- keylset group_attrs phone $phone
- keylset group_attrs bandwidth $bandwidth
- keylset group_attrs push $push
- keylset group_attrs pop $pop
- keylset info group_attrs $group_attrs
- GRP:replace $lg_obj info $info
- if {![cequal $flow $old_flow] ||
- ![cequal $phone $old_phone] ||
- ![cequal $bandwidth $old_bandwidth] ||
- ![cequal $push $old_push] ||
- ![cequal $pop $old_pop]} {
- set tags [GRP:get $lg_obj tags]
- keyldel group_attrs type
- foreach link_tag $tags {
- PPP:replace link $link_tag $group_attrs
- PPP:action link $link_tag reset
- }
- }
- if {[cequal $op add]} {
- set lg_ind [link_group:DLadd_link_group end $lg_obj 1]
- dl:select $DLlist $lg_ind
- set protocols_ind ""
- foreach protocol_tag $protocols {
- set protocol_ind [link_group:DLadd_protocol $lg_ind $lg_ind $protocol_tag 1]
- link_group:DLinfo_protocol $protocol_ind 1
- lappend protocols_ind $protocol_ind
- }
- }
- link_group:DLinfo $lg_ind
- ppp:viewsort $lg_ind
- dl:fixconn $DLlist $lg_ind
- ppp:DLselectCB $cbs
- if {[cequal $op add]} {
- set parent_cbs [VxGetVar $FDlinks cbs]
- foreach protocol_tag $protocols {
- set val [defn_type protocol $protocol_tag]
- set defn_info ""
- set modify_on_add 1
- keylget ppp_type_info(protocol/$val) defn_info defn_info
- keylget defn_info modify_on_add modify_on_add
- if {$modify_on_add} {
- set rec ""
- keylset rec op modify
- keylset rec mb mb120
- keylset rec ind [lvarpop protocols_ind]
- keylset rec sel sel203
- keylset rec view $view
- keylset rec parent_cbs $parent_cbs
- keylset rec func link_group_link_protocol:build_modifyCB
- ppp:chain_add $rec
- }
- }
- set rec ""
- keylset rec op add
- keylset rec mb mb211
- keylset rec ind $lg_ind
- keylset rec sel sel201
- keylset rec view $view
- keylset rec parent_cbs $parent_cbs
- keylset rec func link_group_link:buildCB
- ppp:chain_add $rec
- }
- VxEndFormCB $cbs
- ppp:chain_next
- VtUnLock
- }
- proc link_group:deleteCB {op mb ind sel view cbs args} {
- Globals
- set lg_obj [dl:get $DLlist $ind OBJ]
- set tags [GRP:get $lg_obj tags]
- set info [GRP:get $lg_obj info]
- set group_attrs ""
- keylget info group_attrs group_attrs
- if {![lempty $tags]} {
- set link_ind [dl:next $DLlist $ind]
- set level [dl:get $DLlist $link_ind _LEVEL]
- set del_link_ind ""
- set del_proto_ind ""
- while {![cequal $link_ind end] && $level > 0} {
- set sel [dl:get $DLlist $link_ind SEL]
- switch $sel {
- sel202 {
- lappend del_link_ind $link_ind
- }
- sel203 {
- lappend del_proto_ind $link_ind
- }
- }
- set link_ind [dl:next $DLlist $link_ind]
- if {![cequal $link_ind end]} {
- set level [dl:get $DLlist $link_ind _LEVEL]
- }
- }
- foreach protocol_ind $del_proto_ind {
- set proto [dl:get $DLlist $protocol_ind PROTO]
- set protocol_tag [dl:get $DLlist $protocol_ind OBJ]
- if {![PPP:isPresent protocol $protocol_tag]} {
- continue
- }
- set algorithms ""
- set txalgorithms ""
- set rxalgorithms ""
- PPP:get protocol $protocol_tag algorithms algorithms
- PPP:get protocol $protocol_tag txalgorithms txalgorithms
- PPP:get protocol $protocol_tag rxalgorithms rxalgorithms
- foreach al_tag [concat $algorithms $txalgorithms $rxalgorithms] {
- if {![PPP:isPresent algorithm $al_tag]} {
- continue
- }
- PPP:get algorithm $al_tag algorithm algorithm
- if {![PPP:delete algorithm/$algorithm $al_tag]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_LINKS_DELETE]]
- }
- }
- if {![PPP:delete protocol/${proto} $protocol_tag]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_LINKS_DELETE]]
- }
- dl:delete $DLlist $protocol_ind
- }
- dl:defer $DLlist 1
- foreach link_ind $del_link_ind {
- link_group_link:deleteCB delete mb130 $link_ind sel202 $view $cbs $args
- }
- dl:defer $DLlist 0
- }
- GRP:lg_update_ref $lg_obj ""
- GRP:delete $lg_obj
- dl:delete $DLlist $ind
- ppp:DLselectCB $cbs
- VtUnLock
- }
- proc link_group:DLadd_link_group {ind lg_tag show} {
- Globals
- set info [GRP:get $lg_tag info]
- set name [GRP:get $lg_tag name]
- set group_attrs ""
- set type ""
- keylget info group_attrs group_attrs
- keylget group_attrs type type
- set type [devTypes $type]
- set lg_ind [dl:add $DLlist $ind 0]
- dl:set $DLlist $lg_ind ICON [dl:icon lg]
- dl:set $DLlist $lg_ind SEL sel201
- dl:set $DLlist $lg_ind OBJ $lg_tag
- dl:set $DLlist $lg_ind NAME $name
- dl:set $DLlist $lg_ind TYPE $type
- dl:show $DLlist $lg_ind $show
- return $lg_ind
- }
- proc link_group:DLinfo {ind} {
- Globals
- global free_gap
- set tag [dl:get $DLlist $ind OBJ]
- set info [GRP:get $tag info]
- set group_attrs ""
- keylget info group_attrs group_attrs
- set type ""
- set flow ""
- set phone ""
- keylget group_attrs type type
- keylget group_attrs flow flow
- keylget group_attrs phone phone
- set s ""
- set show_flow 1
- append s [format "%s: " [ILM SCO_PPP_MSG_L_LINK_GROUP_TYPE]]
- switch [devTypes $type] {
- ACU { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_TYPE_PSTN]] }
- ISDN_SYNC {
- append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_TYPE_ISDN_SYNC]]
- set show_flow 0
- }
- ISDN_ASYNC {
- append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_TYPE_ISDN_ASYNC]]
- set show_flow 0
- }
- Direct { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_TYPE_STATIC]] }
- default { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_UNKNOWN]] }
- }
- if {$show_flow} {
- append s $free_gap
- append s [format "%s: " [ILM SCO_PPP_MSG_L_LINK_GROUP_FLOW]]
- switch $flow {
- hardware { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_FLOW_HARDWARE]] }
- software { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_FLOW_SOFTWARE]] }
- none { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_FLOW_NONE]] }
- default { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_UNKNOWN]] }
- }
- }
- if {![cequal $phone ""]} {
- append s $free_gap
- append s [format "%s: %s" [ILM SCO_PPP_MSG_L_LINK_GROUP_PHONE] $phone]
- }
- dl:set $DLlist $ind FREE $s
- dl:show $DLlist $ind
- }
- ##################################################
- proc ppp:PBlink_group_linkCB {op mb ind sel view cbs} {
- Globals
- switch $op {
- add {
- link_group_link:buildCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- delete {
- keylget cbs dialog dialog
- if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "link_group_link:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
- VtUnLock
- return
- }
- }
- }
- }
- proc link_group_link:DLselectCB {from cbs} {
- keylget cbs dialog FDlink
- keylget cbs widget list
- set len [llength [VtDrawnListGetItem $list -all]]
- set pos [VtDrawnListGetSelectedItem $list -byPositionList]
- if {$pos == 0} {
- if {$len > 0} {
- VtDrawnListSelectItem $list -position 1
- set pos 1
- }
- }
- if {[cequal $from "linksAvail"]} {
- GetVar $FDlink PBadd
- SetSens $PBadd 1
- } else {
- GetVar $FDlink PBremove
- SetSens $PBremove 1
- }
- VtUnLock
- }
- proc link_group_link:PBaddCB {cbs} {
- keylget cbs dialog FDlink
- wget $FDlink PBadd DLlinksAvail DLlinksSel type linkFormatList
- set selected [lindex [VtDrawnListGetSelectedItem $DLlinksAvail -byRecordList] 0]
- set delpos [lindex [VtDrawnListGetSelectedItem $DLlinksAvail -byPositionList] 0]
- set addpos 0
- VtDrawnListAddItem $DLlinksSel \
- -position $addpos \
- -fieldList $selected
- VtDrawnListDeleteItem $DLlinksAvail -position $delpos
- SetSens $PBadd 0
- VtUnLock
- }
- proc link_group_link:PBremoveCB {cbs} {
- keylget cbs dialog FDlink
- wget $FDlink PBremove DLlinksAvail DLlinksSel type linkFormatList
- set selected [lindex [VtDrawnListGetSelectedItem $DLlinksSel -byRecordList] 0]
- set delpos [lindex [VtDrawnListGetSelectedItem $DLlinksSel -byPositionList] 0]
- set addpos 0
- lassign $selected dev link_tag loc
- VtDrawnListAddItem $DLlinksAvail \
- -position $addpos \
- -fieldList $selected
- VtDrawnListDeleteItem $DLlinksSel -position $delpos
- SetSens $PBremove 0
- VtUnLock
- }
- proc link_group_link:buildCB {op mb ind sel view cbs} {
- Globals
- global iconpath
- keylget cbs dialog FDlink
- if {[cequal $op add]} {
- set title [ILM SCO_PPP_MSG_TITLE_LINK_ADD]
- } else {
- set title [ILM SCO_PPP_MSG_TITLE_LINK_MOD]
- }
- wset $FDlink FDlink [VtFormDialog $FDlink.FDlink \
- -title $title \
- -ok \
- -okCallback link_group_link:changeCB \
- -cancel \
- -cancelCallback VxEndFormCB \
- -autoDestroy 1 \
- -autoLock link_group_link:changeCB \
- -resizable 0 \
- -help \
- ]
- set AFlink FORM
- wset $FDlink Flinks [VtForm $FDlink.Fdevices \
- -marginWidth 0 \
- -marginHeight 0 \
- -CHARM_marginHeight 1 \
- -leftSide FORM \
- -rightSide FORM \
- -topSide $AFlink \
- -CHARM_topOffset 0 \
- -MOTIF_topOffset 5 \
- -CHARM_resizable 0 \
- ]
- wset $FDlink LlinksAvail [VtLabel $Flinks.LlinksAvail \
- -label [ILM SCO_PPP_MSG_LINKS_AVAIL] \
- -topSide FORM \
- ]
- set linkFormatList {{DATA} {DATA} {DATA} {ICON 1} {STRING 30}}
- wset $FDlink DLlinksAvail [VtDrawnList $Flinks.DLlinksAvail \
- -formatList $linkFormatList \
- -iconList [list $iconpath/modem.px $iconpath/serial.px] \
- -CHARM_rows 7 \
- -MOTIF_rows 8 \
- -CHARM_columns 23 \
- -MOTIF_columns 20 \
- -horizontalScrollBar 1 \
- -callback "link_group_link:DLselectCB linksAvail" \
- -autoLock link_group_link:DLselectCB \
- -leftSide FORM \
- -topSide $LlinksAvail \
- -bottomSide FORM \
- -shortHelpCallback SaShortHelpCB \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_AVAIL] \
- ]
- ##########
- wset $FDlink RCbuttons [VtRowColumn $Flinks.RCbuttons \
- -CHARM_spacing 1 \
- -MOTIF_spacing 10 \
- -numColumns 1 \
- -packing COLUMN \
- -leftSide $DLlinksAvail \
- -rightSide NONE \
- -topSide 25 \
- -bottomSide FORM \
- ]
- wset $FDlink PBadd [VtPushButton $RCbuttons.PBadd \
- -label [ILM SCO_PPP_MSG_LINK_ADD] \
- -labelCenter \
- -callback link_group_link:PBaddCB \
- -autoLock link_group_link:PBaddCB \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINK_ADD] \
- -shortHelpCallback SaShortHelpCB \
- ]
- wset $FDlink PBremove [VtPushButton $RCbuttons.RCremove \
- -label [ILM SCO_PPP_MSG_LINK_REMOVE] \
- -callback link_group_link:PBremoveCB \
- -autoLock link_group_link:PBremoveCB \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINK_REMOVE] \
- -shortHelpCallback SaShortHelpCB \
- ]
- ##########
- wset $FDlink LlinksSel [VtLabel $Flinks.LlinksSel \
- -label [ILM SCO_PPP_MSG_LINKS_SEL] \
- -labelCenter \
- -topSide FORM \
- -leftSide $RCbuttons \
- ]
- wset $FDlink DLlinksSel [VtDrawnList $Flinks.DLlinksSel \
- -formatList $linkFormatList \
- -iconList [list $iconpath/modem.px $iconpath/serial.px] \
- -CHARM_rows 7 \
- -MOTIF_rows 8 \
- -CHARM_columns 23 \
- -MOTIF_columns 20 \
- -horizontalScrollBar 1 \
- -callback "link_group_link:DLselectCB linksSel" \
- -autoLock link_group_link:DLselectCB \
- -leftSide $RCbuttons \
- -MOTIF_rightSide FORM \
- -topSide $LlinksSel \
- -rightSide NONE \
- -bottomSide FORM \
- -shortHelpCallback SaShortHelpCB \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_SEL] \
- ]
- SetSens $PBadd 0
- SetSens $PBremove 0
- StatusBar $FDlink $Flinks
- VtShow $FDlink
- set lg_obj [dl:get $DLlist $ind OBJ]
- set type [dl:get $DLlist $ind TYPE]
- wput $FDlink linkFormatList
- wput $FDlink op mb ind sel type view cbs
- switch $type {
- Direct {
- set icon 1
- }
- default {
- set icon 0
- }
- }
- set link_tags [GRP:get $lg_obj tags]
- foreach link_tag [lsort -command lsort_link $link_tags] {
- PPP:get link ${link_tag} dev dev
- if {![info exist link_channels($dev)]} {
- PPP:get link $link_tag type link_type
- set Devices_tag [Devices:find [devTypes $link_type] $dev]
- set link_channels($dev) [Devices:get $Devices_tag channels]
- }
- if {![info exist link_instance($dev)]} {
- set link_instance($dev) 1
- } else {
- incr link_instance($dev)
- }
- if {$link_channels($dev) > 1} {
- set show_dev "$dev ($link_instance($dev))"
- } else {
- set show_dev "$dev"
- }
- VtDrawnListAddItem $DLlinksSel \
- -position 0 \
- -fieldList [list $dev $link_tag s $icon $show_dev]
- }
- set links_devs_avail ""
- foreach link_tag [lsort -command lsort_link [availableLinks $type]] {
- PPP:get link ${link_tag} dev dev
- if {![info exist link_channels($dev)]} {
- PPP:get link $link_tag type link_type
- set Devices_tag [Devices:find [devTypes $link_type] $dev]
- set link_channels($dev) [Devices:get $Devices_tag channels]
- }
- set links ""
- keylget links_devs_avail ${dev} links
- set_add links $link_tag
- keylset links_devs_avail ${dev} $links
- }
- foreach dev [lsort [keylkeys links_devs_avail]] {
- keylget links_devs_avail ${dev} links
- foreach link_tag $links {
- if {![info exist link_instance($dev)]} {
- set link_instance($dev) 1
- } else {
- incr link_instance($dev)
- }
- if {$link_channels($dev) > 1} {
- set show_dev "$dev ($link_instance($dev))"
- } else {
- set show_dev "$dev"
- }
- VtDrawnListAddItem $DLlinksAvail \
- -position 0 \
- -fieldList [list $dev $link_tag a $icon $show_dev]
- }
- }
- SetVar $FDlink links_devs_avail
- VtUnLock
- }
- proc link_group_link:changeCB {cbs} {
- Globals
- keylget cbs dialog FDlink
- wget $FDlink links_devs_avail DLlinksSel DLlinksAvail
- wget $FDlink op ind sel view mb
- set lg_obj [dl:get $DLlist $ind OBJ]
- set name [GRP:get $lg_obj name]
- set info [GRP:get $lg_obj info]
- set group_attrs ""
- set flow ""
- set type ""
- set protocols ""
- keylget info group_attrs group_attrs
- keylget group_attrs flow flow
- keylget group_attrs type type
- keylget group_attrs protocols protocols
- set linksSel [VtDrawnListGetItem $DLlinksSel -all]
- set linksAvail [VtDrawnListGetItem $DLlinksAvail -all]
- set add_link_tags ""
- set del_link_tags ""
- set grp_lcp_tag [findProtocolTag lcp $protocols]
- if {![PPP:isPresent protocol/lcp $grp_lcp_tag]} {
- set grp_lcp_tag ""
- }
- if {[cequal $grp_lcp_tag ""]} {
- foreach linkSel $linksSel {
- lassign $linkSel dev link_tag loc
- if {[cequal $loc a]} {
- continue
- }
- PPP:get link $link_tag protocols link_protocols
- set grp_lcp_tag [findProtocolTag lcp $link_protocols]
- if {![cequal $grp_lcp_tag ""]} {
- break
- }
- }
- }
- if {[cequal $grp_lcp_tag ""]} {
- foreach linkAvail $linksAvail {
- lassign $linkAvail dev link_tag loc
- if {[cequal $loc a]} {
- continue
- }
- PPP:get link $link_tag protocols link_protocols
- set grp_lcp_tag [findProtocolTag lcp $link_protocols]
- if {![cequal $grp_lcp_tag ""]} {
- break
- }
- }
- }
- set state [dl:state $DLlist $ind]
- switch $state {
- collapsed {
- set expanded 0
- }
- default {
- set expanded 1
- }
- }
- if {![lempty $linksSel] && [cequal $grp_lcp_tag ""]} {
- set grp_lcp_tag lcp_$name
- while {[PPP:isPresent protocol/lcp $grp_lcp_tag]} {
- set grp_lcp_tag [cycleName $grp_lcp_tag]
- }
- PPP:create protocol/lcp $grp_lcp_tag "" [list [list parent_type link/$type]]
- keylget group_attrs protocols protocols
- set_add protocols $grp_lcp_tag
- keylset group_attrs protocols $protocols
- set lcp_ind [link_group:DLadd_protocol $ind $ind $grp_lcp_tag $expanded]
- link_group:DLinfo_protocol $lcp_ind $expanded
- }
- foreach linkAvail $linksAvail {
- lassign $linkAvail dev link_tag loc
- if {[cequal $loc a]} {
- continue
- }
- set_add del_link_tags $link_tag
- set link_protocols ""
- if {[regexp "^link_(.*)$" $link_tag d body] && ![PPP:isPresent protocol/lcp lcp_$body]} {
- set lcp_tag lcp_$body
- } else {
- set lcp_tag lcp_0
- }
- while {[PPP:isPresent protocol/lcp $lcp_tag]} {
- set lcp_tag [cycleName $lcp_tag]
- }
- set_add link_protocols $lcp_tag
- PPP:create protocol/lcp $lcp_tag "" [list [list parent_type link/$type]]
- PPP:replace link $link_tag protocols $link_protocols
- PPP:action link $link_tag reset
- }
- foreach linkSel $linksSel {
- lassign $linkSel dev link_tag loc
- if {[cequal $loc s]} {
- continue
- }
- set tags ""
- keylget links_devs_avail $dev tags
- if {[lempty $tags]} {
- set link_tag link_0
- while {[PPP:isPresent link $link_tag]} {
- set link_tag [cycleName $link_tag]
- }
- set attrValueList ""
- keylset attrValueList dev $dev
- keylset attrValueList flow $flow
- keylset attrValueList type $type
- keylset attrValueList protocols $protocols
- PPP:create link $link_tag $attrValueList
- PPP:action link $link_tag reset
- } else {
- set link_tag [lvarpop tags]
- keylset links_devs_avail $dev $tags
- PPP:get link ${link_tag} protocols link_protocols
- set lcp_tag [findProtocolTag lcp $link_protocols]
- if {![cequal $lcp_tag end]} {
- PPP:delete protocol/lcp $lcp_tag
- }
- PPP:replace link $link_tag protocols $protocols
- PPP:action link $link_tag reset
- }
- set_add add_link_tags $link_tag
- }
- set link_tags [GRP:get $lg_obj tags]
- foreach link_tag $add_link_tags {
- set link_ind [link_group_link:DLadd_link $ind $ind $link_tag $expanded]
- link_group_link:DLinfo $link_ind
- set_add link_tags $link_tag
- }
- foreach link_tag $del_link_tags {
- set link_ind [dl:find $DLlist start down [list [list OBJ $link_tag]]]
- if {![cequal $link_ind end]} {
- dl:delete $DLlist $link_ind
- }
- set_del link_tags $link_tag
- }
- GRP:lg_update_ref $lg_obj $link_tags
- keylset info group_attrs $group_attrs
- GRP:replace $lg_obj info $info
- ppp:viewsort $ind
- dl:fixconn $DLlist $ind
- ppp:DLselectCB $cbs
- VxEndFormCB $cbs
- ppp:chain_next
- VtUnLock
- }
- proc link_group_link:deleteCB {op mb ind sel view cbs args} {
- Globals
- keylget cbs dialog FDlink
- set link_tag [dl:get $DLlist $ind OBJ]
- set lg_ind [dl:get $DLlist $ind LGIND]
- set lg_obj [dl:get $DLlist $lg_ind OBJ]
- set tags [GRP:get $lg_obj tags]
- set protocols ""
- if {[regexp "^link_(.*)$" $link_tag d body] && ![PPP:isPresent protocol/lcp lcp_$body]} {
- set lcp_tag lcp_$body
- } else {
- set lcp_tag lcp_0
- }
- while {[PPP:isPresent protocol/lcp $lcp_tag]} {
- set lcp_tag [cycleName $lcp_tag]
- }
- set_add protocols $lcp_tag
- PPP:get link $link_tag type type
- PPP:create protocol/lcp $lcp_tag "" [list [list parent_type link/$type]]
- PPP:replace link $link_tag protocols $protocols
- set_del tags $link_tag
- dl:delete $DLlist $ind
- GRP:lg_update_ref $lg_obj $tags
- dl:fixconn $DLlist $lg_ind
- ppp:DLselectCB $cbs
- VtUnLock
- }
- proc link_group_link:DLadd_link {ind lg_ind link_tag show} {
- Globals
- set dev ""
- PPP:get link $link_tag dev dev
- PPP:get link $link_tag type type
- set link_ind [dl:add $DLlist $ind 1]
- switch [devTypes $type] {
- Direct { dl:set $DLlist $link_ind ICON [dl:icon s] }
- default { dl:set $DLlist $link_ind ICON [dl:icon l] }
- }
- dl:set $DLlist $link_ind SEL sel202
- dl:set $DLlist $link_ind OBJ $link_tag
- dl:set $DLlist $link_ind DEV "$dev"
- dl:set $DLlist $link_ind LGIND $lg_ind
- set status [PPP:action link $link_tag status]
- set phase dead
- keylget status phase phase
- switch $phase {
- network {
- dl:set $DLlist $link_ind PHASE [dl:icon up]
- }
- default {
- dl:set $DLlist $link_ind PHASE [dl:icon NI]
- }
- }
- dl:show $DLlist $link_ind $show
- return $link_ind
- }
- proc link_group_link:DLinfo {ind} {
- }
- proc link_group:DLadd_protocol {ind lg_ind protocol_tag show} {
- Globals
- PPP:get protocol $protocol_tag protocol val
- keylget ppp_type_info(protocol/$val) sub_defn sub_defn
- set val [translit "a-z" "A-Z" $val]
- switch $sub_defn {
- link { set sel sel203 }
- }
- set lprotocol_ind [dl:add $DLlist $ind 1 1]
- dl:set $DLlist $lprotocol_ind ICON [dl:icon pl]
- dl:set $DLlist $lprotocol_ind SEL $sel
- dl:set $DLlist $lprotocol_ind OBJ $protocol_tag
- dl:set $DLlist $lprotocol_ind PROTOCOL "$val"
- dl:set $DLlist $lprotocol_ind PROTO [defn_type protocol $protocol_tag]
- dl:set $DLlist $lprotocol_ind LGIND $lg_ind
- dl:show $DLlist $lprotocol_ind $show
- return $lprotocol_ind
- }
- proc link_group:DLinfo_protocol {ind show} {
- Globals
- set protocol [dl:get $DLlist $ind PROTO]
- set protocol_tag [dl:get $DLlist $ind OBJ]
- dl:set $DLlist $ind FREE [PPP:info protocol/$protocol $protocol_tag]
- dl:show $DLlist $ind $show
- }
- ##################################################
- proc ppp:PBglobal_bundleCB {cbs} {
- return [global_bundle:buildCB $cbs]
- }
- proc global_bundle:buildCB {cbs} {
- Globals
- global managedHost
- keylget cbs dialog dialog
- wset $dialog FDglobal_bundle [VtFormDialog $dialog.FDglobal_bundle \
- -title [ILM SCO_PPP_MSG_TITLE_GLOBAL_BUNDLE] \
- -ok \
- -okCallback global_bundle:changeCB \
- -cancel \
- -cancelCallback VxEndFormCB \
- -autoDestroy 1 \
- -autoLock global_bundle:changeCB \
- -help \
- ]
- set FTDglobal_bundle [FormTabDialog $FDglobal_bundle.FTDglobal_bundle]
- FormTabs $FTDglobal_bundle [list \
- [list FTauth \
- SCO_PPP_MSG_GLOBAL_BUNDLE_FT_AUTH \
- SCO_PPP_MSG_TITLE_GLOBAL_BUNDLE_FT_AUTH \
- SCO_PPP_MSG_SH_GLOBAL_BUNDLE_FT_AUTH \
- ] \
- [list FTmultilink \
- SCO_PPP_MSG_GLOBAL_BUNDLE_FT_MULTILINK \
- SCO_PPP_MSG_TITLE_GLOBAL_BUNDLE_FT_MULTILINK \
- SCO_PPP_MSG_SH_GLOBAL_BUNDLE_FT_MULTILINK \
- ] \
- ]
- wset $FDglobal_bundle AFauth [AlignedForm $FTauth.AFauth [list \
- [list SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_CHAP Lrequirechap RBrequirechap \
- [list VtRadioBox \
- -horizontal \
- ]] \
- [list SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_PAP Lrequirepap RBrequirepap \
- [list VtRadioBox \
- -horizontal \
- ]] \
- [list SCO_PPP_MSG_GLOBAL_BUNDLE_AUTHNAME Lauthname CBauthname \
- [list VtComboBox \
- -columns 25 \
- -rows 5 \
- -value "" \
- -itemList [authNames] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_GLOBAL_BUNDLE_AUTHNAME] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_GLOBAL_BUNDLE_PEERAUTHNAME Lpeerauthname CBpeerauthname \
- [list VtComboBox \
- -columns 25 \
- -rows 5 \
- -value "" \
- -itemList [authNames] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_GLOBAL_BUNDLE_PEERAUTHNAME] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_GLOBAL_BUNDLE_AUTHTMOUT Lauthtmout SBauthtmout \
- [list VxSpinButton \
- 10 5 "" 300 "" 1 60 "" "" \
- ]] \
- ]]
- wset $FDglobal_bundle AFmultilink [AlignedForm $FTmultilink.AFmultilink [list \
- [list SCO_PPP_MSG_GLOBAL_BUNDLE_MRRU Lmrru SBmrru \
- [list VxSpinButton \
- 10 256 "" 16384 "" 1 1500 "" "" \
- ]] \
- [list SCO_PPP_MSG_GLOBAL_BUNDLE_SSN Lssn RBssn \
- [list VtRadioBox \
- -horizontal \
- ]] \
- [list SCO_PPP_MSG_GLOBAL_BUNDLE_ED Led RBed \
- [list VtRadioBox \
- -horizontal \
- ]] \
- ]]
- wset $FDglobal_bundle TBrequirepap_yes [cw VtToggleButton $RBrequirepap.TBrequirepap_yes \
- SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_PAP_YES \
- "" \
- SCO_PPP_MSG_SH_GLOBAL_BUNDLE_REQUIRE_PAP_YES \
- -userData enabled \
- -value 0 \
- ]
- wset $FDglobal_bundle TBrequirepap_no [cw VtToggleButton $RBrequirepap.TBrequirepap_no \
- SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_PAP_NO \
- "" \
- SCO_PPP_MSG_SH_GLOBAL_BUNDLE_REQUIRE_PAP_NO \
- -userData disabled \
- -value 1 \
- ]
- wset $FDglobal_bundle TBrequirechap_yes [cw VtToggleButton $RBrequirechap.TBreqchap_yes \
- SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_CHAP_YES \
- "" \
- SCO_PPP_MSG_SH_GLOBAL_BUNDLE_REQUIRE_CHAP_YES \
- -userData enabled \
- -value 0 \
- ]
- wset $FDglobal_bundle TBrequirechap_no [cw VtToggleButton $RBrequirechap.TBreqchap_no \
- SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_CHAP_NO \
- "" \
- SCO_PPP_MSG_SH_GLOBAL_BUNDLE_REQUIRE_CHAP_NO \
- -userData disabled \
- -value 1 \
- ]
- VtSetValues $SBauthtmout \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_GLOBAL_BUNDLE_AUTHTMOUT] \
- -shortHelpCallback SaShortHelpCB
- VtSetValues $SBmrru \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_GLOBAL_BUNDLE_MRRU] \
- -shortHelpCallback SaShortHelpCB
- wset $FDglobal_bundle TBssn_yes [cw VtToggleButton $RBssn.TBssn_yes \
- SCO_PPP_MSG_GLOBAL_BUNDLE_SSN_YES \
- "" \
- SCO_PPP_MSG_SH_GLOBAL_BUNDLE_SSN_YES \
- -userData enabled \
- -value 1 \
- ]
- wset $FDglobal_bundle TBssn_no [cw VtToggleButton $RBssn.TBssn_no \
- SCO_PPP_MSG_GLOBAL_BUNDLE_SSN_NO \
- "" \
- SCO_PPP_MSG_SH_GLOBAL_BUNDLE_SSN_NO \
- -userData disabled \
- -value 0 \
- ]
- wset $FDglobal_bundle TBed_yes [cw VtToggleButton $RBed.TBed_yes \
- SCO_PPP_MSG_GLOBAL_BUNDLE_ED_YES \
- "" \
- SCO_PPP_MSG_SH_GLOBAL_BUNDLE_ED_YES \
- -userData enabled \
- -value 1 \
- ]
- wset $FDglobal_bundle TBed_no [cw VtToggleButton $RBed.TBed_no \
- SCO_PPP_MSG_GLOBAL_BUNDLE_ED_NO \
- "" \
- SCO_PPP_MSG_SH_GLOBAL_BUNDLE_ED_NO \
- -userData disabled \
- -value 0 \
- ]
- StatusBar $FDglobal_bundle $FTDglobal_bundle
- VtShow $FDglobal_bundle
- SaFormTabDialogMaxSize $FTDglobal_bundle
- SaFormTabSetSelected $FTauth
- if {[PPP:isPresent global/bundle bundle]} {
- PPP:get global bundle requirepap requirepap
- PPP:get global bundle requirechap requirechap
- PPP:get global bundle authname authname
- PPP:get global bundle peerauthname peerauthname
- PPP:get global bundle authtmout authtmout
- PPP:get global bundle mrru mrru
- PPP:get global bundle ssn ssn
- PPP:get global bundle ed ed
- } else {
- set requirepap enabled
- set requirechap enabled
- set authname $managedHost
- set peerauthname ""
- set authtmout 60
- set mrru 1500
- set ssn enabled
- set ed enabled
- }
- switch $requirepap {
- enabled { SetValues $RBrequirepap TBrequirepap_yes }
- disabled { SetValues $RBrequirepap TBrequirepap_no }
- }
- switch $requirechap {
- enabled { SetValues $RBrequirechap TBrequirechap_yes }
- disabled { SetValues $RBrequirechap TBrequirechap_no }
- }
- SetValues $CBauthname authname
- SetValues $CBpeerauthname peerauthname
- SetUser $CBpeerauthname peerauthname
- GetVar $SBauthtmout text
- SetValues $text authtmout
- GetVar $SBmrru text
- SetValues $text mrru
- switch $ssn {
- enabled { SetValues $RBssn TBssn_yes }
- disabled { SetValues $RBssn TBssn_no }
- }
- switch $ed {
- enabled { SetValues $RBed TBed_yes }
- disabled { SetValues $RBed TBed_no }
- }
- wput $FDglobal_bundle RBrequirepap RBrequirechap CBauthname CBpeerauthname \
- SBauthtmout SBmrru RBssn RBed
- VtUnLock
- }
- proc global_bundle:changeCB {cbs} {
- Globals
- keylget cbs dialog FDglobal_bundle
- wget $FDglobal_bundle RBrequirepap RBrequirechap CBauthname CBpeerauthname \
- SBauthtmout SBmrru RBssn RBed
- GetValues $RBrequirepap TB
- GetUser $TB requirepap
- GetValues $RBrequirechap TB
- GetUser $TB requirechap
- GetValues $CBauthname authname
- GetValues $CBpeerauthname peerauthname
- GetVar $SBauthtmout text
- GetValues $text authtmout
- GetVar $SBmrru text
- GetValues $text mrru
- GetValues $RBssn TB
- GetUser $TB ssn
- GetValues $RBed TB
- GetUser $TB ed
- set authname [validName $authname]
- set peerauthname [validName $peerauthname]
- set rec ""
- keylset rec requirepap $requirepap
- keylset rec requirechap $requirechap
- keylset rec authname $authname
- keylset rec peerauthname $peerauthname
- keylset rec authtmout $authtmout
- keylset rec mrru $mrru
- keylset rec ssn $ssn
- keylset rec ed $ed
- if {![PPP:isPresent global/bundle bundle]} {
- keylset rec type bundle
- if {![PPP:create global/bundle bundle $rec]} {
- return [throwError $FDglobal_bundle [ILM SCO_PPP_ERR_GLOBAL_BUNDLE_CREATE]]
- }
- } else {
- if {![PPP:replace global/bundle bundle $rec]} {
- return [throwError $FDglobal_bundle [ILM SCO_PPP_ERR_GLOBAL_BUNDLE_REPLACE]]
- }
- }
- VxEndFormCB $cbs
- ppp:chain_next
- VtUnLock
- }
- ##################################################
- proc bodMap {bod} {
- set in [list none in out any [ILM SCO_PPP_MSG_BOD_NONE] [ILM SCO_PPP_MSG_BOD_IN] [ILM SCO_PPP_MSG_BOD_OUT] [ILM SCO_PPP_MSG_BOD_ANY]]
- set out [list [ILM SCO_PPP_MSG_BOD_NONE] [ILM SCO_PPP_MSG_BOD_IN] [ILM SCO_PPP_MSG_BOD_OUT] [ILM SCO_PPP_MSG_BOD_ANY] none in out any ]
- return [lindex $out [lsearch $in $bod]]
- }
- proc bringupMap {bringup} {
- set in [list automatic manual [ILM SCO_PPP_MSG_BRINGUP_AUTOMATIC] [ILM SCO_PPP_MSG_BRINGUP_MANUAL]]
- set out [list [ILM SCO_PPP_MSG_BRINGUP_AUTOMATIC] [ILM SCO_PPP_MSG_BRINGUP_MANUAL] automatic manual]
- return [lindex $out [lsearch $in $bringup]]
- }
- proc ppp:PBbundleCB {op mb ind sel view cbs} {
- Globals
- switch $op {
- add {
- bundle:buildCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- modify {
- bundle:buildCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- delete {
- keylget cbs dialog dialog
- if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "bundle:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
- VtUnLock
- return
- }
- }
- }
- }
- ##################################################
- proc bundle:DLadd_bundle {ind bundle_tag show} {
- Globals
- set bundle_ind [dl:add $DLlist $ind 0]
- set type disabled
- PPP:get bundle $bundle_tag type type
- switch $type {
- disabled { set icon [dl:icon d] }
- in { set icon [dl:icon i] }
- out { set icon [dl:icon o] }
- bi-directional { set icon [dl:icon io] }
- }
- dl:set $DLlist $bundle_ind ICON $icon
- dl:set $DLlist $bundle_ind SEL sel101
- dl:set $DLlist $bundle_ind OBJ $bundle_tag
- dl:set $DLlist $bundle_ind NAME $bundle_tag
- set status [PPP:action bundle $bundle_tag status]
- set phase dead
- keylget status phase phase
- switch $phase {
- network {
- dl:set $DLlist $bundle_ind PHASE [dl:icon up]
- }
- default {
- dl:set $DLlist $bundle_ind PHASE [dl:icon NI]
- }
- }
- dl:show $DLlist $bundle_ind $show
- return $bundle_ind
- }
- proc bundle:DLinfo {ind} {
- Globals
- global free_gap
- set tag [dl:get $DLlist $ind OBJ]
- set type disabled
- set bringup manual
- set remotesys ""
- set login ""
- set callerid ""
- set authid ""
- PPP:get bundle $tag type type
- PPP:get bundle $tag bringup bringup
- PPP:get bundle $tag remotesys remotesys
- PPP:get bundle $tag login login
- PPP:get bundle $tag callerid callerid
- PPP:get bundle $tag authid authid
- set s ""
- if {[cequal $type disabled]} {
- append s [format "%s" [ILM SCO_PPP_MSG_L_BUNDLE_DISABLED]]
- } else {
- if {[cequal $type out] || [cequal $type bi-directional]} {
- append s [format "%s: %s" [ILM SCO_PPP_MSG_L_BUNDLE_OUTGOING] $remotesys]
- }
- if {[cequal $type in] || [cequal $type bi-directional]} {
- if {![cequal $s ""]} {
- append s $free_gap
- }
- if {![cequal $login ""]} {
- append s [format "%s: %s" [ILM SCO_PPP_MSG_L_BUNDLE_INCOMING_LOGIN] $login]
- }
- if {![cequal $s ""]} {
- append s $free_gap
- }
- if {![cequal $callerid ""]} {
- append s [format "%s: %s" [ILM SCO_PPP_MSG_L_BUNDLE_INCOMING_CALLERID] $callerid]
- }
- if {![cequal $s ""]} {
- append s $free_gap
- }
- if {![cequal $authid ""]} {
- append s [format "%s: %s" [ILM SCO_PPP_MSG_L_BUNDLE_INCOMING_AUTHID] $authid]
- }
- }
- }
- dl:set $DLlist $ind FREE $s
- dl:show $DLlist $ind
- }
- proc bundle:DLadd_protocol {ind bundle_ind protocol_tag show} {
- Globals
- PPP:get protocol $protocol_tag protocol val
- keylget ppp_type_info(protocol/$val) sub_defn sub_defn
- set val [translit "a-z" "A-Z" $val]
- switch $sub_defn {
- network { set sel sel106 }
- link { set sel sel107 }
- }
- set nprotocol_ind [dl:add $DLlist $ind 1 2]
- dl:set $DLlist $nprotocol_ind ICON [dl:icon pn]
- dl:set $DLlist $nprotocol_ind SEL $sel
- dl:set $DLlist $nprotocol_ind OBJ $protocol_tag
- dl:set $DLlist $nprotocol_ind PROTOCOL "$val"
- dl:set $DLlist $nprotocol_ind PROTO [defn_type protocol $protocol_tag]
- dl:set $DLlist $nprotocol_ind BUNDLEIND $bundle_ind
- dl:show $DLlist $nprotocol_ind $show
- return $nprotocol_ind
- }
- proc bundle:DLinfo_protocol {ind show} {
- Globals
- set protocol [dl:get $DLlist $ind PROTO]
- set protocol_tag [dl:get $DLlist $ind OBJ]
- dl:set $DLlist $ind FREE [PPP:info protocol/$protocol $protocol_tag]
- dl:show $DLlist $ind $show
- }
- proc bundle:auto_detect_values {cbs} {
- keylget cbs dialog FDbundle
- wget $FDbundle CBauthname CBpeerauthname SBauthtmout \
- RBrequirechap RBrequirepap RBssn RBed SBmrru \
- TBrequirepap_yes TBrequirepap_no TBrequirechap_yes TBrequirechap_no \
- TBssn_yes TBssn_no TBed_no TBed_yes
- PPP:get global bundle authname global_authname
- PPP:get global bundle peerauthname global_peerauthname
- PPP:get global bundle authtmout global_authtmout
- PPP:get global bundle requirechap global_requirechap
- PPP:get global bundle requirepap global_requirepap
- PPP:get global bundle ssn global_ssn
- PPP:get global bundle ed global_ed
- PPP:get global bundle mrru global_mrru
- switch $global_requirepap {
- enabled { SetValues $RBrequirepap TBrequirepap_yes }
- disabled { SetValues $RBrequirepap TBrequirepap_no }
- }
- switch $global_requirechap {
- enabled { SetValues $RBrequirechap TBrequirechap_yes }
- disabled { SetValues $RBrequirechap TBrequirechap_no }
- }
- GetValues $CBauthname authname
- if {[cequal $authname ""]} {
- SetValues $CBauthname global_authname
- }
- GetValues $CBpeerauthname peerauthname
- if {[cequal $peerauthname ""]} {
- SetValues $CBpeerauthname global_peerauthname
- SetUser $CBpeerauthname global_peerauthname
- }
- GetVar $SBauthtmout text
- SetValues $text global_authtmout
- GetVar $SBmrru text
- SetValues $text global_mrru
- switch $global_ssn {
- enabled { SetValues $RBssn TBssn_yes }
- disabled { SetValues $RBssn TBssn_no }
- }
- switch $global_ed {
- enabled { SetValues $RBed TBed_yes }
- disabled { SetValues $RBed TBed_no }
- }
- }
- proc bundle:RBauto_detectCB {cbs} {
- global PPP_USER
- keylget cbs dialog FDbundle
- keylget cbs value TB
- GetUser $TB auto_detect
- GetVar $FDbundle Llogin
- GetVar $FDbundle CBlogin
- if {$auto_detect} {
- SetSens $CBlogin 0
- SetSens $Llogin 0
- bundle:auto_detect_values $cbs
- } else {
- GetValues $CBlogin login
- if {[cequal $login ""]} {
- GetUser $CBlogin ppp_used_users
- if {[lsearch $ppp_used_users $PPP_USER] != -1} {
- set ppp_used_users $PPP_USER
- }
- VtSetValues $CBlogin -value [lindex $ppp_used_users 0]
- }
- SetSens $CBlogin 1
- SetSens $Llogin 1
- }
- }
- proc bundle:TnameCB {cbs} {
- keylget cbs dialog FDbundle
- wget $FDbundle Tname CBremotesys CBpeerauthname CBlogin \
- TBtype_incoming TBtype_outgoing
- GetValues $Tname name
- GetValues $CBremotesys remotesys
- GetValues $CBpeerauthname peerauthname
- GetValues $CBlogin login
- GetValues $TBtype_incoming type_incoming
- GetValues $TBtype_outgoing type_outgoing
- if {[cequal $remotesys ""] && $type_outgoing} {
- SetValues $CBremotesys name
- }
- if {[cequal $peerauthname ""]} {
- SetValues $CBpeerauthname name
- SetUser $CBpeerauthname name
- }
- if {[cequal $login ""] && $type_incoming} {
- SetValues $CBlogin name
- }
- }
- proc bundle:LSnprotocols_selectCB {cbs} {
- keylget cbs dialog FDbundle
- keylget cbs value value
- keylget cbs mode mode
- keylget cbs widget LSnprotocols
- keylget cbs selectedItemList itemList
- GetVar $LSnprotocols npSel
- set i3 [intersect3 $npSel $itemList]
- if {[cequal "" [lindex $i3 0]]} {
- set value [lindex $i3 2]
- set mode select
- } else {
- set value [lindex $i3 0]
- set mode deselect
- }
- if {[lempty $itemList]} {
- VtListSelectItem $LSnprotocols \
- -item $value
- GetVar $LSnprotocols firstError
- if {$firstError} {
- VxSetVar $LSnprotocols firstError 0
- return [throwError $FDbundle [ILM SCO_PPP_ERR_NPROTOCOLS_ONE_SELECTED]]
- }
- } else {
- VxSetVar $LSnprotocols npSel $itemList
- }
- }
- proc bundle:TBtypeCB {cbs} {
- keylget cbs dialog FDbundle
- keylget cbs widget TB
- keylget cbs value value
- wget $FDbundle Lremotesys CBremotesys Lbringup CBbringup \
- Lauto_detect RBauto_detect Lcallerid Tcallerid Lauthid CBauthid \
- Llogin CBlogin CBpeerauthname op
- set TB [VxGetShortName $TB]
- set auto_detect [VtGetValues $RBauto_detect -value]
- set auto_detect [VtGetValues $auto_detect -userData]
- switch $TB {
- TBtype_incoming {
- SetSens $Llogin [expr $value && !$auto_detect]
- SetSens $CBlogin [expr $value && !$auto_detect]
- SetSens $Lauto_detect $value
- SetSens $RBauto_detect $value
- SetSens $Lcallerid $value
- SetSens $Tcallerid $value
- SetSens $Lauthid $value
- SetSens $CBauthid $value
- if {$auto_detect} {
- bundle:auto_detect_values $cbs
- }
- if {[cequal $op add]} {
- if {$value} {
- GetValues $CBpeerauthname hidden
- SetUser $CBpeerauthname hidden
- VtSetValues $CBpeerauthname -value ""
- } else {
- GetUser $CBpeerauthname hidden
- SetValues $CBpeerauthname hidden
- }
- }
- }
- TBtype_outgoing {
- SetSens $Lremotesys $value
- SetSens $CBremotesys $value
- SetSens $Lbringup $value
- SetSens $CBbringup $value
- }
- }
- }
- proc bundle:PBcall_guiCB {Twidget gui_path gui_args label short_help mnemonic cbs} {
- global managedHost
- keylget cbs dialog FDwidget
- set value [VtGetValues $Twidget -value]
- if {![file executable $gui_path] && ![SaFile -host $managedHost executable $gui_path]} {
- return [throwError $FDwidget [ILM SCO_PPP_ERR_GUI_NOT_FOUND]]
- }
- if {[catch {eval exec $gui_path $gui_args -t \"$value\" -o -l \"$label\" -h \"$short_help\" -m \"$mnemonic\" $managedHost} res]} {
- return [throwError $FDwidget [ILM SCO_PPP_ERR_GUI_FAILED]]
- }
- if {![cequal $res ""]} {
- set i [string first "\n" $res]
- if {$i != -1} {
- incr i
- set res [csubstr $res $i end]
- VtSetValues $Twidget -value [string trim $res]
- keylset cbs widget $Twidget
- }
- }
- VtUnLock
- }
- proc bundle:buildCB {op mb ind sel view cbs} {
- Globals
- global iconpath managedHost PPP_SHELL PPP_USER
- keylget cbs dialog dialog
- ####################
- if {[cequal $op add]} {
- set title [ILM SCO_PPP_MSG_TITLE_BUNDLE_ADD]
- } else {
- set title [ILM SCO_PPP_MSG_TITLE_BUNDLE_MOD]
- }
- wset $dialog FDbundle [VtFormDialog $dialog.FDbundle \
- -title $title \
- -ok \
- -okCallback bundle:changeCB \
- -cancel \
- -cancelCallback VxEndFormCB \
- -autoDestroy 1 \
- -autoLock bundle:changeCB \
- -help \
- ]
- set FTDbundle [FormTabDialog $FDbundle.FTDbundle]
- ####################
- FormTabs $FTDbundle [list \
- [list FTbundle \
- SCO_PPP_MSG_BUNDLE_FT_BUNDLE \
- SCO_PPP_MSG_TITLE_BUNDLE_FT_BUNDLE \
- SCO_PPP_MSG_SH_BUNDLE_FT_BUNDLE \
- ] \
- [list FTauth \
- SCO_PPP_MSG_BUNDLE_FT_AUTH \
- SCO_PPP_MSG_TITLE_BUNDLE_FT_AUTH \
- SCO_PPP_MSG_SH_BUNDLE_FT_AUTH \
- ] \
- [list FTmultilink \
- SCO_PPP_MSG_BUNDLE_FT_MULTILINK \
- SCO_PPP_MSG_TITLE_BUNDLE_FT_MULTILINK \
- SCO_PPP_MSG_SH_BUNDLE_FT_MULTILINK \
- ] \
- [list FTbod \
- SCO_PPP_MSG_BUNDLE_FT_BOD \
- SCO_PPP_MSG_TITLE_BUNDLE_FT_BOD \
- SCO_PPP_MSG_SH_BUNDLE_FT_BOD \
- ] \
- ]
- if {[cequal $op add]} {
- set FTnprotocols [cw SaFormTab $FTDbundle.FTnprotocols \
- SCO_PPP_MSG_BUNDLE_FT_NPROTOCOLS \
- SCO_PPP_MSG_TITLE_BUNDLE_FT_NPROTOCOLS \
- SCO_PPP_MSG_SH_BUNDLE_FT_NPROTOCOLS \
- ]
- set FTlprotocols [cw SaFormTab $FTDbundle.FTlprotocols \
- SCO_PPP_MSG_BUNDLE_FT_LPROTOCOLS \
- SCO_PPP_MSG_TITLE_BUNDLE_FT_LPROTOCOLS \
- SCO_PPP_MSG_SH_BUNDLE_FT_LPROTOCOLS \
- ]
- } else {
- set FTnprotocols ""
- set FTlprotocols ""
- }
- set FTadvanced [cw SaFormTab $FTDbundle.FTadvanced \
- SCO_PPP_MSG_BUNDLE_FT_ADVANCED \
- SCO_PPP_MSG_TITLE_BUNDLE_FT_ADVANCED \
- SCO_PPP_MSG_SH_BUNDLE_FT_ADVANCED \
- ]
- ####################
- set sites ""
- foreach tag [Systems:list] {
- lappend sites [Systems:get $tag site]
- }
- wset $FDbundle AFbundle [AlignedForm $FTbundle.AFbundle [list \
- [list SCO_PPP_MSG_BUNDLE_NAME Lname Tname \
- [list VtText \
- -callback bundle:TnameCB \
- -losingFocusCallback bundle:TnameCB \
- -columns 25 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_NAME] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_TYPE Ltype Ftype \
- [list VtForm \
- -marginWidth 0 \
- -marginHeight 0 \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_REMOTESYS Lremotesys Fremotesys \
- [list VtForm \
- -marginWidth 0 \
- -marginHeight 0 \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_BRINGUP Lbringup CBbringup \
- [list VtComboBox \
- -readOnly \
- -columns 25 \
- -rows 2 \
- -itemList [list [bringupMap automatic] [bringupMap manual]] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_CALLERID] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_AUTO_DETECT Lauto_detect RBauto_detect \
- [list VtRadioBox \
- -callback bundle:RBauto_detectCB \
- -horizontal \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_LOGIN Llogin CBlogin \
- [list VtComboBox \
- -columns 25 \
- -rows 5 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_LOGIN] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_CALLERID Lcallerid Tcallerid \
- [list VtText \
- -columns 25 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_CALLERID] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_AUTHID Lauthid CBauthid \
- [list VtComboBox \
- -columns 25 \
- -rows 5 \
- -value "" \
- -itemList [concat [authNames] "*"] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_AUTHID] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- wset $FDbundle TBtype_outgoing [cw VtToggleButton $Ftype.TBtype_outgoing \
- SCO_PPP_MSG_BUNDLE_TYPE_OUTGOING \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_TYPE_OUTGOING \
- -value 0 \
- -topSide FORM \
- -callback bundle:TBtypeCB \
- ]
- wset $FDbundle TBtype_incoming [cw VtToggleButton $Ftype.TBtype_incoming \
- SCO_PPP_MSG_BUNDLE_TYPE_INCOMING \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_TYPE_INCOMING \
- -value 0 \
- -leftSide $TBtype_outgoing \
- -topSide FORM \
- -callback bundle:TBtypeCB \
- ]
- wset $FDbundle TBauto_detect_yes [cw VtToggleButton $RBauto_detect.TBauto_detect_yes \
- SCO_PPP_MSG_BUNDLE_AUTO_DETECT_YES \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_AUTO_DETECT_YES \
- -value 1 \
- -userData 1 \
- ]
- wset $FDbundle TBauto_detect_no [cw VtToggleButton $RBauto_detect.TBauto_detect_no \
- SCO_PPP_MSG_BUNDLE_AUTO_DETECT_NO \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_AUTO_DETECT_NO \
- -value 0 \
- -userData 0 \
- ]
- wset $FDbundle CBremotesys [cw VtComboBox $Fremotesys.CBremotesys \
- SCO_PPP_MSG_SH_BUNDLE_REMOTESYS \
- -columns 25 \
- -itemList $sites \
- -rows 5 \
- ]
- set gui_path /usr/lib/scoadmin/outgoing/outgoingGUI
- set gui_args ""
- set exit_label [ILM SCO_PPP_MSG_BUNDLE_REMOTESYS_OUTGOING_EXIT]
- set exit_short_help [ILM SCO_PPP_MSG_SH_BUNDLE_REMOTESYS_OUTGOING_EXIT]
- set exit_mnemonic [ILM SCO_PPP_MSG_MN_BUNDLE_REMOTESYS_OUTGOING_EXIT]
- wset $FDbundle PBremotesys [cw VtPushButton $Fremotesys.PBremotesys \
- SCO_PPP_MSG_BUNDLE_REMOTESYS_EDIT \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_REMOTESYS_EDIT \
- -callback "bundle:PBcall_guiCB $CBremotesys \"$gui_path\" \"$gui_args\" \"$exit_label\" \"$exit_short_help\" \"$exit_mnemonic\"" \
- -autoLock bundle:PBcall_guiCB \
- -leftSide $CBremotesys \
- -topSide FORM \
- ]
- if {![file executable $gui_path] && ![SaFile -host $managedHost executable $gui_path]} {
- SetSens $PBremotesys 0
- }
- ####################
- wset $FDbundle AFauth [AlignedForm $FTauth.AFauth [list \
- [list SCO_PPP_MSG_BUNDLE_REQUIRE_CHAP Lrequirechap RBrequirechap \
- [list VtRadioBox \
- -horizontal \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_REQUIRE_PAP Lrequirepap RBrequirepap \
- [list VtRadioBox \
- -horizontal \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_AUTHNAME Lauthname CBauthname \
- [list VtComboBox \
- -columns 25 \
- -rows 5 \
- -value "" \
- -itemList [authNames] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_AUTHNAME] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_PEERAUTHNAME Lpeerauthname CBpeerauthname \
- [list VtComboBox \
- -columns 25 \
- -rows 5 \
- -value "" \
- -itemList [authNames] \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_PEERAUTHNAME] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_AUTHTMOUT Lauthtmout SBauthtmout \
- [list VxSpinButton \
- 10 5 "" 300 "" 1 60 "" "" \
- ]] \
- ]]
- wset $FDbundle TBrequirepap_yes [cw VtToggleButton $RBrequirepap.TBrequirepap_yes \
- SCO_PPP_MSG_BUNDLE_REQUIRE_PAP_YES \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_REQUIRE_PAP_YES \
- -userData enabled \
- -value 0 \
- ]
- wset $FDbundle TBrequirepap_no [cw VtToggleButton $RBrequirepap.TBrequirepap_no \
- SCO_PPP_MSG_BUNDLE_REQUIRE_PAP_NO \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_REQUIRE_PAP_NO \
- -userData disabled \
- -value 1 \
- ]
- wset $FDbundle TBrequirechap_yes [cw VtToggleButton $RBrequirechap.TBreqchap_yes \
- SCO_PPP_MSG_BUNDLE_REQUIRE_CHAP_YES \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_REQUIRE_CHAP_YES \
- -userData enabled \
- -value 0 \
- ]
- wset $FDbundle TBrequirechap_no [cw VtToggleButton $RBrequirechap.TBreqchap_no \
- SCO_PPP_MSG_BUNDLE_REQUIRE_CHAP_NO \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_REQUIRE_CHAP_NO \
- -userData disabled \
- -value 1 \
- ]
- VtSetValues $SBauthtmout \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_AUTHTMOUT] \
- -shortHelpCallback SaShortHelpCB
- ####################
- wset $FDbundle AFmultilink [AlignedForm $FTmultilink.AFmultilink [list \
- [list SCO_PPP_MSG_BUNDLE_MAXLINKS Lmaxlinks SBmaxlinks \
- [list VxSpinButton \
- 10 1 "" 1024 "" 1 1 "" "" \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_MINLINKS Lminlinks SBminlinks \
- [list VxSpinButton \
- 10 1 "" 1024 "" 1 1 "" "" \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_MRRU Lmrru SBmrru \
- [list VxSpinButton \
- 10 256 "" 16384 "" 1 1500 "" "" \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_SSN Lssn RBssn \
- [list VtRadioBox \
- -horizontal \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_ED Led RBed \
- [list VtRadioBox \
- -horizontal \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_MINFRAG Lminfrag SBminfrag \
- [list VxSpinButton \
- 10 50 "" 4096 "" 1 100 "" "" \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_MAXFRAGS Lmaxfrags SBmaxfrags \
- [list VxSpinButton \
- 10 1 "" 500 "" 1 5 "" "" \
- ]] \
- ]]
- VtSetValues $SBmrru \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MRRU] \
- -shortHelpCallback SaShortHelpCB
- wset $FDbundle TBssn_yes [cw VtToggleButton $RBssn.TBssn_yes \
- SCO_PPP_MSG_BUNDLE_SSN_YES \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_SSN_YES \
- -userData enabled \
- -value 0 \
- ]
- wset $FDbundle TBssn_no [cw VtToggleButton $RBssn.TBssn_no \
- SCO_PPP_MSG_BUNDLE_SSN_NO \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_SSN_NO \
- -userData disabled \
- -value 1 \
- ]
- wset $FDbundle TBed_yes [cw VtToggleButton $RBed.TBed_yes \
- SCO_PPP_MSG_BUNDLE_ED_YES \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_ED_YES \
- -userData enabled \
- -value 1 \
- ]
- wset $FDbundle TBed_no [cw VtToggleButton $RBed.TBed_no \
- SCO_PPP_MSG_BUNDLE_ED_NO \
- "" \
- SCO_PPP_MSG_SH_BUNDLE_ED_NO \
- -userData disabled \
- -value 0 \
- ]
- VtSetValues $SBmaxlinks \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MAXLINKS] \
- -shortHelpCallback SaShortHelpCB
- VtSetValues $SBminlinks \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MINLINKS] \
- -shortHelpCallback SaShortHelpCB
- VtSetValues $SBminfrag \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MINFRAG] \
- -shortHelpCallback SaShortHelpCB
- VtSetValues $SBmaxfrags \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MAXFRAGS] \
- -shortHelpCallback SaShortHelpCB
- ####################
- wset $FDbundle AFbod [AlignedForm $FTbod.AFbod [list \
- [list SCO_PPP_MSG_BUNDLE_ADDLOAD Laddload SBaddload \
- [list VxSpinButton \
- 10 1 "" 100 "" 1 60 "" "" \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_ADDSAMPLE Laddsample SBaddsample \
- [list VxSpinButton \
- 10 2 "" 4000 "" 1 2 "" "" \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_DROPLOAD Ldropload SBdropload \
- [list VxSpinButton \
- 10 1 "" 100 "" 1 20 "" "" \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_DROPSAMPLE Ldropsample SBdropsample \
- [list VxSpinButton \
- 10 2 "" 4000 "" 1 2 "" "" \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_THRASHTIME Lthrashtime SBthrashtime \
- [list VxSpinButton \
- 10 5 "" 4000 "" 1 60 "" "" \
- ]] \
- [list SCO_PPP_MSG_BUNDLE_BOD Lbod CBbod \
- [list VtComboBox \
- -readOnly \
- -itemList [list [bodMap none] [bodMap in] [bodMap out] [bodMap any]] \
- -rows 4 \
- -columns 25 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_BOD] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- VtSetValues $SBaddload \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_ADDLOAD] \
- -shortHelpCallback SaShortHelpCB
- VtSetValues $SBaddsample \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_ADDSAMPLE] \
- -shortHelpCallback SaShortHelpCB
- VtSetValues $SBdropload \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_DROPLOAD] \
- -shortHelpCallback SaShortHelpCB
- VtSetValues $SBdropsample \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_DROPSAMPLE] \
- -shortHelpCallback SaShortHelpCB
- VtSetValues $SBthrashtime \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_THRASHTIME] \
- -shortHelpCallback SaShortHelpCB
- ####################
- if {[cequal $op add]} {
- wset $FDbundle AFnprotocols [AlignedForm $FTnprotocols.AFnprotocols [list \
- [list SCO_PPP_MSG_NPROTOCOLS Lnprotocols LSnprotocols \
- [list VtList \
- -callback bundle:LSnprotocols_selectCB \
- -selection MULTIPLE \
- -scrollBar 1 \
- -columns 25 \
- -rows 5 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_NPROTOCOLS] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- wset $FDbundle AFlprotocols [AlignedForm $FTlprotocols.AFlprotocols [list \
- [list SCO_PPP_MSG_LPROTOCOLS Llprotocols LSlprotocols \
- [list VtList \
- -selection MULTIPLE \
- -scrollBar 1 \
- -columns 25 \
- -rows 5 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_LPROTOCOLS] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- } else {
- set LSnprotocols ""
- set LSlprotocols ""
- }
- ####################
- wset $FDbundle AFadvanced [AlignedForm $FTadvanced.AFadvanced [list \
- [list SCO_PPP_MSG_BUNDLE_MAXIDLE Lmaxidle SBmaxidle \
- [list VxSpinButton \
- 10 0 "" 32768 "" 1 0 "" "" \
- ]] \
- ]]
- VtSetValues $SBmaxidle \
- -rightSide NONE \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MAXIDLE] \
- -shortHelpCallback SaShortHelpCB
- ####################
- StatusBar $FDbundle $FTDbundle
- VtShow $FDbundle
- SaFormTabDialogMaxSize $FTDbundle
- SaFormTabSetSelected $FTbundle
- ####################
- set type bi-directional
- set maxidle 0
- set remotesys ""
- set bringup automatic
- set login ""
- set callerid ""
- set authid ""
- set requirepap disabled
- set requirechap disabled
- set authname ""
- set peerauthname ""
- set authtmout 60
- set mrru 1500
- set ssn enabled
- set ed enabled
- set maxlinks 1
- set minlinks 1
- set minfrag 100
- set maxfrags 5
- set thrashtime 300
- set bod none
- set addload 60
- set addsample 30
- set dropload 20
- set dropsample 120
- if {[cequal $op add]} {
- set bundle_tag ""
- set authname $managedHost
- set protocols ""
- } else {
- set bundle_tag [dl:get $DLlist $ind OBJ]
- PPP:get bundle $bundle_tag type type
- PPP:get bundle $bundle_tag maxidle maxidle
- PPP:get bundle $bundle_tag remotesys remotesys
- PPP:get bundle $bundle_tag bringup bringup
- PPP:get bundle $bundle_tag login login
- PPP:get bundle $bundle_tag callerid callerid
- PPP:get bundle $bundle_tag authid authid
- PPP:get bundle $bundle_tag requirepap requirepap
- PPP:get bundle $bundle_tag requirechap requirechap
- PPP:get bundle $bundle_tag authname authname
- PPP:get bundle $bundle_tag peerauthname peerauthname
- PPP:get bundle $bundle_tag authtmout authtmout
- PPP:get bundle $bundle_tag minfrag minfrag
- PPP:get bundle $bundle_tag maxfrags maxfrags
- PPP:get bundle $bundle_tag mrru mrru
- PPP:get bundle $bundle_tag ssn ssn
- PPP:get bundle $bundle_tag ed ed
- PPP:get bundle $bundle_tag maxlinks maxlinks
- PPP:get bundle $bundle_tag minlinks minlinks
- PPP:get bundle $bundle_tag thrashtime thrashtime
- PPP:get bundle $bundle_tag bod bod
- PPP:get bundle $bundle_tag dropload dropload
- PPP:get bundle $bundle_tag dropsample dropsample
- PPP:get bundle $bundle_tag addload addload
- PPP:get bundle $bundle_tag addsample addsample
- PPP:get bundle $bundle_tag protocols protocols
- }
- ####################
- switch $type {
- in {
- set type_incoming 1
- set type_outgoing 0
- }
- out {
- set type_incoming 0
- set type_outgoing 1
- }
- bi-directional {
- set type_incoming 1
- set type_outgoing 1
- }
- default {
- set type_incoming 0
- set type_outgoing 0
- }
- }
- ####################
- if {$type_incoming && [cequal $login ""]} {
- PPP:get global bundle authname authname
- PPP:get global bundle peerauthname peerauthname
- PPP:get global bundle authtmout authtmout
- PPP:get global bundle requirechap requirechap
- PPP:get global bundle requirepap requirepap
- PPP:get global bundle ssn ssn
- PPP:get global bundle ed ed
- PPP:get global bundle mrru mrru
- }
- ####################
- SetValues $Tname bundle_tag
- SetUser $Tname bundle_tag
- set sens_in 0
- set sens_out 0
- if {$type_incoming} {
- VtSetValues $TBtype_incoming -value 1
- set sens_in 1
- }
- if {$type_outgoing} {
- VtSetValues $TBtype_outgoing -value 1
- set sens_out 1
- }
- SetSens $Lauto_detect $sens_in
- SetSens $RBauto_detect $sens_in
- SetSens $Llogin $sens_in
- SetSens $CBlogin $sens_in
- SetSens $Lcallerid $sens_in
- SetSens $Tcallerid $sens_in
- SetSens $Lauthid $sens_in
- SetSens $CBauthid $sens_in
- SetSens $Lremotesys $sens_out
- SetSens $CBremotesys $sens_out
- SetSens $Lbringup $sens_out
- SetSens $CBbringup $sens_out
- SetValues $CBremotesys remotesys
- set bringup_ilm [bringupMap $bringup]
- SetValues $CBbringup bringup_ilm
- set ppp_users ""
- set ppp_used_users ""
- set all_uids ""
- set all_users [SaGetPwEnts $managedHost]
- foreach user [keylkeys all_users] {
- keylget all_users $user user_info
- keylget user_info pw_shell pw_shell
- keylget user_info pw_uid pw_uid
- lappend all_uids $pw_uid
- if {[cequal $pw_shell $PPP_SHELL]} {
- lappend ppp_used_users $user
- }
- lappend ppp_users $user
- }
- foreach used_bundle_tag [check ppp_tags(bundle)] {
- PPP:get bundle $used_bundle_tag login used_bundle_login
- if {![cequal $login ""] && [lsearch $ppp_used_users $used_bundle_login] != -1} {
- set_del ppp_used_users $used_bundle_login
- }
- }
- if {[lempty $ppp_used_users]} {
- VtSetValues $CBlogin -itemList [concat $PPP_USER "*"]
- VtSetValues $CBlogin -userData $PPP_USER
- } else {
- VtSetValues $CBlogin -itemList [concat $ppp_used_users "*"]
- VtSetValues $CBlogin -userData [lindex $ppp_used_users 0]
- }
- SetVar $CBlogin all_users
- SetVar $CBlogin all_uids
- SetVar $CBlogin ppp_users
- SetVar $CBlogin ppp_used_users
- SetValues $CBlogin login
- SetValues $Tcallerid callerid
- SetValues $CBauthid authid
- if {[cequal $login ""]} {
- SetValues $RBauto_detect TBauto_detect_yes
- SetSens $Llogin 0
- SetSens $CBlogin 0
- } else {
- SetValues $RBauto_detect TBauto_detect_no
- }
- GetVar $SBmaxidle text
- SetValues $text maxidle
- ####################
- switch $requirepap {
- enabled { SetValues $RBrequirepap TBrequirepap_yes }
- disabled { SetValues $RBrequirepap TBrequirepap_no }
- }
- switch $requirechap {
- enabled { SetValues $RBrequirechap TBrequirechap_yes }
- disabled { SetValues $RBrequirechap TBrequirechap_no }
- }
- SetValues $CBauthname authname
- SetValues $CBpeerauthname peerauthname
- SetUser $CBpeerauthname peerauthname
- GetVar $SBauthtmout text
- SetValues $text authtmout
- ####################
- GetVar $SBmaxlinks text
- SetValues $text maxlinks
- GetVar $SBminlinks text
- SetValues $text minlinks
- GetVar $SBmrru text
- SetValues $text mrru
- GetVar $SBmaxfrags text
- SetValues $text maxfrags
- GetVar $SBminfrag text
- SetValues $text minfrag
- switch $ssn {
- enabled { SetValues $RBssn TBssn_yes }
- disabled { SetValues $RBssn TBssn_no }
- }
- switch $ed {
- enabled { SetValues $RBed TBed_yes }
- disabled { SetValues $RBed TBed_no }
- }
- ####################
- GetVar $SBaddload text
- SetValues $text addload
- GetVar $SBaddsample text
- SetValues $text addsample
- GetVar $SBdropload text
- SetValues $text dropload
- GetVar $SBdropsample text
- SetValues $text dropsample
- GetVar $SBthrashtime text
- SetValues $text thrashtime
- set bod_ilm [bodMap $bod]
- SetValues $CBbod bod_ilm
- ####################
- if {[cequal $op add]} {
- set nprotocols [defn_list protocol network bundle]
- set lprotocols [defn_list protocol link bundle]
- } else {
- set nprotocols ""
- set lprotocols ""
- }
- set npSel ""
- if {![lempty $nprotocols]} {
- foreach protocol $nprotocols {
- keylget ppp_type_info($protocol) val val
- set proto [translit "a-z" "A-Z" $val]
- VtListAddItem $LSnprotocols \
- -item $proto
- if {[cequal $op add] || ![lempty [findProtocolTag $val $protocols]]} {
- VtListSelectItem $LSnprotocols \
- -item $proto
- set_add npSel $proto
- }
- }
- VxSetVar $LSnprotocols firstError 1
- SetVar $LSnprotocols npSel
- }
- foreach protocol $lprotocols {
- keylget ppp_type_info($protocol) val val
- set proto [translit "a-z" "A-Z" $val]
- VtListAddItem $LSlprotocols \
- -item $proto
- }
- ####################
- wput $FDbundle \
- TBtype_incoming TBtype_outgoing SBmaxidle \
- Lremotesys Lbringup Lauto_detect Lcallerid Lauthid \
- CBremotesys CBbringup Tname \
- Llogin CBlogin Tcallerid CBauthid RBauto_detect \
- RBrequirepap RBrequirechap SBauthtmout CBauthname CBpeerauthname \
- RBssn RBed SBminfrag SBmaxfrags SBmaxlinks SBminlinks SBmrru \
- SBaddload SBaddsample SBdropload SBdropsample SBthrashtime CBbod \
- LSnprotocols LSlprotocols
- wput $FDbundle FTbundle FTauth FTmultilink FTbod FTnprotocols FTlprotocols
- wput $FDbundle op mb ind sel view cbs
- VtUnLock
- }
- proc bundle:changeCB {cbs} {
- Globals
- global managedHost PPP_HOME PPP_SHELL PPP_COMMENT PPP_GROUP PPP_MODE
- keylget cbs dialog FDbundle
- wget $FDbundle \
- TBtype_incoming TBtype_outgoing SBmaxidle \
- CBremotesys CBbringup Tname \
- Llogin CBlogin Tcallerid CBauthid RBauto_detect \
- RBrequirepap RBrequirechap SBauthtmout CBauthname CBpeerauthname \
- RBssn RBed SBminfrag SBmaxfrags SBmaxlinks SBminlinks SBmrru \
- SBaddload SBaddsample SBdropload SBdropsample SBthrashtime CBbod \
- LSnprotocols LSlprotocols
- wget $FDbundle FTbundle FTauth FTmultilink FTbod FTnprotocols FTlprotocols
- wget $FDbundle op mb ind sel view
- ####################
- GetValues $TBtype_incoming type_incoming
- GetValues $TBtype_outgoing type_outgoing
- set type [expr $type_incoming + 2 * $type_outgoing]
- switch $type {
- 1 { set type in }
- 2 { set type out }
- 3 { set type bi-directional }
- default { set type disabled }
- }
- GetValues $Tname name
- set name [validName $name]
- SetValues $Tname name
- GetUser $Tname bundle_tag
- GetValues $CBremotesys remotesys
- set remotesys [validName $remotesys]
- GetValues $CBbringup bringup
- set bringup [bringupMap $bringup]
- GetValues $RBauto_detect TB
- GetUser $TB auto_detect
- GetValues $CBlogin login
- GetVar $CBlogin all_users
- GetVar $CBlogin all_uids
- GetVar $CBlogin ppp_users
- GetVar $CBlogin ppp_used_users
- GetValues $Tcallerid callerid
- GetValues $CBauthid authid
- GetVar $SBmaxidle text
- GetValues $text maxidle
- ####################
- GetValues $RBrequirepap TB
- GetUser $TB requirepap
- GetValues $RBrequirechap TB
- GetUser $TB requirechap
- GetValues $CBauthname authname
- GetValues $CBpeerauthname peerauthname
- GetVar $SBauthtmout text
- GetValues $text authtmout
- set authname [validName $authname]
- set peerauthname [validName $peerauthname]
- ####################
- GetVar $SBmaxlinks text
- GetValues $text maxlinks
- GetVar $SBminlinks text
- GetValues $text minlinks
- GetVar $SBmrru text
- GetValues $text mrru
- GetVar $SBminfrag text
- GetValues $text minfrag
- GetVar $SBmaxfrags text
- GetValues $text maxfrags
- GetValues $RBssn TB
- GetUser $TB ssn
- GetValues $RBed TB
- GetUser $TB ed
- ####################
- GetVar $SBaddload text
- GetValues $text addload
- GetVar $SBaddsample text
- GetValues $text addsample
- GetVar $SBdropload text
- GetValues $text dropload
- GetVar $SBdropsample text
- GetValues $text dropsample
- GetVar $SBthrashtime text
- GetValues $text thrashtime
- GetValues $CBbod bod
- set bod [bodMap $bod]
- ####################
- if {[cequal $name ""]} {
- SaFormTabSetSelected $FTbundle
- return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_NAME_NULL]]
- }
- if {$type_incoming && [cequal $login ""] && !$auto_detect} {
- SaFormTabSetSelected $FTbundle
- return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_LOGIN_NULL]]
- }
- if {$type_incoming && [cequal $authid ""] && [cequal $callerid ""] && $auto_detect} {
- SaFormTabSetSelected $FTbundle
- return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_CALLER_AUTH_NULL]]
- }
- if {$type_outgoing && ![cequal $op modify] && [cequal $name ""] && ![cequal $remotesys ""]} {
- set name $remotesys
- }
- if {$type_outgoing && [cequal $remotesys ""]} {
- SaFormTabSetSelected $FTbundle
- return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_REMOTESYS_NULL]]
- }
- if {$auto_detect} {
- set login ""
- }
- if {$type_incoming && \
- ![cequal $login ""] && \
- ![cequal $login "*"] && \
- [lsearch $ppp_users $login] == -1 && \
- !$auto_detect} {
- set attrValueList ""
- keylset attrValueList pw_name $login
- keylset attrValueList pw_shell $PPP_SHELL
- keylset attrValueList pw_dir $PPP_HOME
- keylset attrValueList createHome 1
- keylset attrValueList loginGroup $PPP_GROUP
- keylset attrValueList comment $PPP_COMMENT
- keylset attrValueList mode $PPP_MODE
- rename GetUser PPP_GetUser
- catch {rename account_GetUser GetUser}
- set objcall [list ObjectCreate {sco account} [SetInstance $login] $attrValueList]
- set bmipResponse [SMOC $objcall]
- catch {rename GetUser account_GetUser}
- rename PPP_GetUser GetUser
- set firstBmip [lindex $bmipResponse 0]
- set errStack [BmipResponseErrorStack firstBmip]
- if { ![lempty $errStack] } {
- return [throwError $FDbundle [ILM SCO_PPP_ERR_PPP_USER_CREATE_FAILED]]
- }
- set parent_cbs [VxGetVar $FDbundle cbs]
- set rec ""
- keylset rec op $login
- keylset rec mb $mb
- keylset rec ind $ind
- keylset rec sel $sel
- keylset rec view $view
- keylset rec parent_cbs $parent_cbs
- keylset rec func bundle_passwd:buildCB
- ppp:chain_add $rec
- }
- ####################
- if {[cequal $op add]} {
- set nprotocols [VtListGetSelectedItem $LSnprotocols -byItemList]
- set lprotocols [VtListGetSelectedItem $LSlprotocols -byItemList]
- if {[lempty $nprotocols]} {
- SaFormTabSetSelected $FTnprotocols
- return [throwError $FDbundle [ILM SCO_PPP_ERR_NPROTOCOLS_ONE_SELECTED]]
- }
- set bundle_tag $name
- if {[PPP:isPresent bundle $bundle_tag]} {
- SaFormTabSetSelected $FTbundle
- return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_NAME_EXIST]]
- }
- set protocols ""
- set nprotocols_add ""
- set lprotocols_add ""
- foreach proto $nprotocols {
- set val [translit "A-Z" "a-z" $proto]
- set protocol_tag ${val}_${bundle_tag}
- while {[PPP:isPresent protocol $protocol_tag]} {
- set protocol_tag [cycleName $protocol_tag]
- }
- if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type bundle]]]} {
- foreach protocol_tag $protocols {
- PPP:get protocol $protocol_tag protocol protocol
- PPP:delete protocol/${protocol} $protocol_tag
- }
- return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_CREATE]]
- }
- set_add protocols $protocol_tag
- set_add nprotocols_add $protocol_tag
- }
- foreach proto $lprotocols {
- set val [translit "A-Z" "a-z" $proto]
- set protocol_tag ${val}_${bundle_tag}
- while {[PPP:isPresent protocol $protocol_tag]} {
- set protocol_tag [cycleName $protocol_tag]
- }
- if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type bundle]]]} {
- foreach protocol_tag $protocols {
- PPP:get protocol $protocol_tag protocol protocol
- PPP:delete protocol/${protocol} $protocol_tag
- }
- return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_CREATE]]
- }
- set_add protocols $protocol_tag
- set_add lprotocols_add $protocol_tag
- set algorithms [defn_list algorithm link protocol/$val]
- if {![lempty $algorithms]} {
- set txalgorithms ""
- set rxalgorithms ""
- foreach algorithm $algorithms {
- set alval ""
- keylget ppp_type_info($algorithm) val alval
- if {[cequal $alval ""]} {
- continue
- }
- set tx_tag tx_${val}_${alval}_${bundle_tag}
- set rx_tag rx_${val}_${alval}_${bundle_tag}
- while {[PPP:isPresent algorithm $rx_tag] || [PPP:isPresent algorithm $tx_tag]} {
- set tx_tag [cycleName $tx_tag]
- set rx_tag [cycleName $rx_tag]
- }
- set_add rxalgorithms $rx_tag
- set_add txalgorithms $tx_tag
- if {![PPP:create algorithm/${alval} $rx_tag]} {
- set_del rxalgorithms $rx_tag
- }
- if {![PPP:create algorithm/${alval} $tx_tag]} {
- set_del txalgorithms $tx_tag
- }
- }
- PPP:replace protocol/${val} $protocol_tag txalgorithms $txalgorithms
- PPP:replace protocol/${val} $protocol_tag rxalgorithms $rxalgorithms
- }
- }
- set rec ""
- keylset rec protocols $protocols
- keylset rec type $type
- if {![PPP:create bundle $bundle_tag $rec]} {
- foreach tag [concat $txalgorithms $rxalgorithms] {
- set val [defn_type algorithm $tag]
- PPP:delete algorithm/$val $tag
- }
- foreach tag $protocols {
- set val [defn_type protocol $tag]
- PPP:delete protocol/$val $tag
- }
- return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_CREATE]]
- }
- set ind [bundle:DLadd_bundle end $bundle_tag 1]
- } elseif {[cequal $op modify]} {
- set bundle_tag [dl:get $DLlist $ind OBJ]
- if {![cequal $bundle_tag $name]} {
- if {[PPP:isPresent bundle $name]} {
- SaFormTabSetSelected $FTbundle
- return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_NAME_EXIST]]
- }
- if {![PPP:rename bundle $bundle_tag $name]} {
- SaFormTabSetSelected $FTbundle
- return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_RENAME]]
- }
- GRP:lg_change_ref bundle $bundle_tag $name
- set bundle_tag $name
- dl:set $DLlist $ind OBJ $bundle_tag
- dl:set $DLlist $ind NAME $bundle_tag
- dl:show $DLlist $ind 1
- }
- }
- set rec ""
- foreach opt {
- type maxidle
- remotesys bringup
- login authid callerid
- authname peerauthname authtmout requirechap requirepap
- maxlinks minlinks ssn ed maxfrags minfrag mrru
- bod addsample addload dropsample dropload thrashtime
- } {
- PPP:get bundle $bundle_tag $opt value
- if {![eval cequal \"$value\" \"\$$opt\"]} {
- eval keylset rec $opt \"\$$opt\"
- }
- }
- if {![lempty $rec]} {
- if {![PPP:replace bundle $bundle_tag $rec]} {
- return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_REPLACE]]
- }
- PPP:action bundle $name reset
- }
- if {$type_incoming && [cequal $login ""]} {
- set global_rec ""
- foreach opt {
- authname peerauthname authtmout requirechap requirepap
- ssn ed mrru
- } {
- PPP:get global/bundle bundle $opt value
- if {![eval cequal \"$value\" \"\$$opt\"]} {
- eval keylset global_rec $opt \"\$$opt\"
- }
- }
- if {![lempty $global_rec]} {
- PPP:replace global/bundle bundle $global_rec
- }
- }
- switch $type {
- disabled { set icon [dl:icon d] }
- in { set icon [dl:icon i] }
- out { set icon [dl:icon o] }
- bi-directional { set icon [dl:icon io] }
- }
- dl:set $DLlist $ind ICON $icon
- dl:show $DLlist $ind 1
- if {[cequal $op add]} {
- set nprotocols_ind ""
- foreach protocol_tag $nprotocols_add {
- set protocol_ind [bundle:DLadd_protocol $ind $ind $protocol_tag 1]
- bundle:DLinfo_protocol $protocol_ind 1
- lappend nprotocols_ind $protocol_ind
- }
- foreach protocol_tag $lprotocols_add {
- set protocol_ind [bundle:DLadd_protocol $ind $ind $protocol_tag 1]
- bundle:DLinfo_protocol $protocol_ind 1
- }
- }
- bundle:DLinfo $ind
- ppp:viewsort $ind
- dl:fixconn $DLlist $ind
- ppp:DLselectCB $cbs
- if {[cequal $op add]} {
- set parent_cbs [VxGetVar $FDbundle cbs]
- foreach protocol_tag $nprotocols_add {
- set val [defn_type protocol $protocol_tag]
- set defn_info ""
- set modify_on_add 1
- keylget ppp_type_info(protocol/$val) defn_info defn_info
- keylget defn_info modify_on_add modify_on_add
- if {$modify_on_add} {
- set rec ""
- keylset rec op modify
- keylset rec mb mb120
- keylset rec ind [lvarpop nprotocols_ind]
- keylset rec sel sel106
- keylset rec view $view
- keylset rec parent_cbs $parent_cbs
- keylset rec func bundle_protocol:build_modifyCB
- ppp:chain_add $rec
- }
- }
- set rec ""
- keylset rec op add
- keylset rec mb mb113
- keylset rec ind $ind
- keylset rec sel sel101
- keylset rec view $view
- keylset rec parent_cbs $parent_cbs
- keylset rec func bundle_link_group:buildCB
- ppp:chain_add $rec
- }
- VxEndFormCB $cbs
- ppp:chain_next
- VtUnLock
- }
- proc bundle:deleteCB {op mb ind sel view cbs args} {
- Globals
- set bundle_tag [dl:get $DLlist $ind OBJ]
- set del_lgs ""
- set lg_ind [dl:next $DLlist $ind]
- while {![cequal $lg_ind end]} {
- set sel [dl:get $DLlist $lg_ind SEL]
- set level [dl:get $DLlist $lg_ind _LEVEL]
- if {$level == 0} {
- break
- }
- switch $sel {
- sel105 {
- set lg_tag [dl:get $DLlist $lg_ind OBJ]
- GRP:lg_del_ref $lg_tag bundle $bundle_tag
- set_add del_lgs $lg_ind
- }
- sel106 -
- sel107 {
- set proto [dl:get $DLlist $lg_ind PROTO]
- set protocol_tag [dl:get $DLlist $lg_ind OBJ]
- set algorithms ""
- set txalgorithms ""
- set rxalgorithms ""
- PPP:get protocol $protocol_tag algorithms algorithms
- PPP:get protocol $protocol_tag txalgorithms txalgorithms
- PPP:get protocol $protocol_tag rxalgorithms rxalgorithms
- foreach al_tag [concat $algorithms $txalgorithms $rxalgorithms] {
- if {![PPP:isPresent algorithm $al_tag]} {
- continue
- }
- PPP:get algorithm $al_tag algorithm algorithm
- if {![PPP:delete algorithm/$algorithm $al_tag]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_BUNDLE_DELETE]]
- }
- }
- if {![PPP:delete protocol/${proto} $protocol_tag]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_BUNDLE_DELETE]]
- }
- set_add del_lgs $lg_ind
- }
- }
- set lg_ind [dl:next $DLlist $lg_ind]
- }
- foreach del_lg $del_lgs {
- dl:delete $DLlist $del_lg
- }
- if {![PPP:delete bundle $bundle_tag]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_BUNDLE_DELETE]]
- }
- dl:delete $DLlist $ind
- ppp:DLselectCB $cbs
- VtUnLock
- }
- ##################################################
- proc ppp:PBbundle_link_groupCB {op mb ind sel view cbs} {
- Globals
- switch $op {
- add {
- bundle_link_group:buildCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- delete {
- keylget cbs dialog dialog
- if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "bundle_link_group:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
- VtUnLock
- return
- }
- }
- }
- }
- proc bundle_link_group:DLselectCB {from cbs} {
- keylget cbs dialog FDlg
- keylget cbs widget list
- set len [llength [VtDrawnListGetItem $list -all]]
- set pos [VtDrawnListGetSelectedItem $list -byPositionList]
- if {$pos == 0} {
- if {$len > 0} {
- VtDrawnListSelectItem $list -position 1
- set pos 1
- }
- }
- if {[cequal $from "lgsAvail"]} {
- GetVar $FDlg PBadd
- SetSens $PBadd 1
- } else {
- GetVar $FDlg PBremove
- SetSens $PBremove 1
- }
- VtUnLock
- }
- proc bundle_link_group:PBaddCB {cbs} {
- keylget cbs dialog FDlg
- wget $FDlg PBadd DLlgsAvail DLlgsSel lgFormatList
- set selected [lindex [VtDrawnListGetSelectedItem $DLlgsAvail -byRecordList] 0]
- set delpos [lindex [VtDrawnListGetSelectedItem $DLlgsAvail -byPositionList] 0]
- set addpos 0
- VtDrawnListAddItem $DLlgsSel \
- -position $addpos \
- -fieldList $selected
- VtDrawnListDeleteItem $DLlgsAvail -position $delpos
- SetSens $PBadd 0
- VtUnLock
- }
- proc bundle_link_group:PBremoveCB {cbs} {
- keylget cbs dialog FDlg
- wget $FDlg PBremove DLlgsAvail DLlgsSel lgFormatList
- set selected [lindex [VtDrawnListGetSelectedItem $DLlgsSel -byRecordList] 0]
- set delpos [lindex [VtDrawnListGetSelectedItem $DLlgsSel -byPositionList] 0]
- set addpos 0
- VtDrawnListAddItem $DLlgsAvail \
- -position $addpos \
- -fieldList $selected
- VtDrawnListDeleteItem $DLlgsSel -position $delpos
- SetSens $PBremove 0
- VtUnLock
- }
- proc bundle_link_group:buildCB {op mb ind sel view cbs} {
- Globals
- global iconpath
- keylget cbs dialog FDlg
- if {[cequal $op add]} {
- set title [ILM SCO_PPP_MSG_TITLE_LG_ADD]
- } else {
- set title [ILM SCO_PPP_MSG_TITLE_LG_MOD]
- }
- wset $FDlg FDlg [VtFormDialog $FDlg.FDlg \
- -title $title \
- -ok \
- -okCallback bundle_link_group:changeCB \
- -cancel \
- -cancelCallback VxEndFormCB \
- -autoDestroy 1 \
- -autoLock bundle_link_group:changeCB \
- -resizable 0 \
- -help \
- ]
- wset $FDlg Flgs [VtForm $FDlg.Fdevices \
- -marginWidth 0 \
- -marginHeight 0 \
- -CHARM_marginHeight 1 \
- -leftSide FORM \
- -rightSide FORM \
- -topSide FORM \
- -CHARM_topOffset 0 \
- -MOTIF_topOffset 5 \
- -CHARM_resizable 0 \
- ]
- wset $FDlg LlgsAvail [VtLabel $Flgs.LlgsAvail \
- -label [ILM SCO_PPP_MSG_LGS_AVAIL] \
- -topSide FORM \
- ]
- set lgFormatList {{DATA} {DATA} {ICON 1} {STRING 30}}
- wset $FDlg DLlgsAvail [VtDrawnList $Flgs.DLlgsAvail \
- -formatList $lgFormatList \
- -iconList [list $iconpath/multi-modem.px $iconpath/modem.px $iconpath/serial.px] \
- -CHARM_rows 7 \
- -MOTIF_rows 8 \
- -CHARM_columns 23 \
- -MOTIF_columns 20 \
- -horizontalScrollBar 1 \
- -callback "bundle_link_group:DLselectCB lgsAvail" \
- -autoLock bundle_link_group:DLselectCB \
- -leftSide FORM \
- -topSide $LlgsAvail \
- -bottomSide FORM \
- -shortHelpCallback SaShortHelpCB \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LGS_AVAIL] \
- ]
- ##########
- wset $FDlg RCbuttons [VtRowColumn $Flgs.RCbuttons \
- -CHARM_spacing 1 \
- -MOTIF_spacing 10 \
- -numColumns 1 \
- -packing COLUMN \
- -leftSide $DLlgsAvail \
- -rightSide NONE \
- -topSide 25 \
- -bottomSide FORM \
- ]
- wset $FDlg PBadd [VtPushButton $RCbuttons.PBadd \
- -label [ILM SCO_PPP_MSG_LG_ADD] \
- -labelCenter \
- -callback bundle_link_group:PBaddCB \
- -autoLock bundle_link_group:PBaddCB \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LG_ADD] \
- -shortHelpCallback SaShortHelpCB \
- ]
- wset $FDlg PBremove [VtPushButton $RCbuttons.RCremove \
- -label [ILM SCO_PPP_MSG_LG_REMOVE] \
- -callback bundle_link_group:PBremoveCB \
- -autoLock bundle_link_group:PBremoveCB \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LG_REMOVE] \
- -shortHelpCallback SaShortHelpCB \
- ]
- ##########
- wset $FDlg LlgsSel [VtLabel $Flgs.LlgsSel \
- -label [ILM SCO_PPP_MSG_LGS_SEL] \
- -labelCenter \
- -topSide FORM \
- -leftSide $RCbuttons \
- ]
- wset $FDlg DLlgsSel [VtDrawnList $Flgs.DLlgsSel \
- -formatList $lgFormatList \
- -iconList [list $iconpath/multi-modem.px $iconpath/modem.px $iconpath/serial.px] \
- -CHARM_rows 7 \
- -MOTIF_rows 8 \
- -CHARM_columns 23 \
- -MOTIF_columns 20 \
- -horizontalScrollBar 1 \
- -callback "bundle_link_group:DLselectCB lgsSel" \
- -autoLock bundle_link_group:DLselectCB \
- -leftSide $RCbuttons \
- -MOTIF_rightSide FORM \
- -topSide $LlgsSel \
- -rightSide NONE \
- -bottomSide FORM \
- -shortHelpCallback SaShortHelpCB \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LGS_SEL] \
- ]
- SetSens $PBadd 0
- SetSens $PBremove 0
- StatusBar $FDlg $Flgs
- VtShow $FDlg
- set owner_tag [dl:get $DLlist $ind OBJ]
- set links ""
- PPP:get bundle $owner_tag links links
- set icon 0
- wput $FDlg lgFormatList
- wput $FDlg op mb ind sel view cbs
- set lgsAvail ""
- set lgsSel ""
- foreach link_tag $links {
- if {[GRP:isMember lg $link_tag member_grps]} {
- foreach grp $member_grps {
- set_add lgsSel $grp
- }
- }
- }
- set i3 [intersect3 $lgsSel [GRP:list lg]]
- set lgsAvail [lindex $i3 2]
- foreach lg_tag $lgsAvail {
- set name [GRP:get $lg_tag name]
- set tags [GRP:get $lg_tag tags]
- if {[lempty $tags]} {
- continue
- }
- VtDrawnListAddItem $DLlgsAvail \
- -position 0 \
- -fieldList [list $lg_tag a $icon $name]
- }
- foreach lg_tag $lgsSel {
- set name [GRP:get $lg_tag name]
- VtDrawnListAddItem $DLlgsSel \
- -position 0 \
- -fieldList [list $lg_tag s $icon $name]
- }
- VtUnLock
- }
- proc bundle_link_group:changeCB {cbs} {
- Globals
- keylget cbs dialog FDlg
- wget $FDlg DLlgsSel DLlgsAvail
- wget $FDlg op ind sel view mb
- set bundle_tag [dl:get $DLlist $ind OBJ]
- set lgsSel [VtDrawnListGetItem $DLlgsSel -all]
- set lgsAvail [VtDrawnListGetItem $DLlgsAvail -all]
- set add_lgs ""
- set del_lgs ""
- set link_tags ""
- foreach lgSel $lgsSel {
- lassign $lgSel lg_tag orig
- if {[cequal $orig a]} {
- set_add add_lgs $lg_tag
- GRP:lg_add_ref $lg_tag bundle $bundle_tag
- }
- set tags [GRP:get $lg_tag tags]
- foreach tag $tags {
- set_add link_tags $tag
- }
- }
- foreach lgAvail $lgsAvail {
- lassign $lgAvail lg_tag orig
- if {[cequal $orig s]} {
- set_add del_lgs $lg_tag
- GRP:lg_del_ref $lg_tag bundle $bundle_tag
- }
- }
- PPP:get bundle $bundle_tag links links
- if {![sequal $links $link_tags]} {
- if {![PPP:replace bundle $bundle_tag links $link_tags]} {
- return [throwError $FDlg [ILM SCO_PPP_ERR_LG_REPLACE]]
- }
- PPP:action bundle $bundle_tag reset
- set state [dl:state $DLlist $ind]
- switch $state {
- collapsed {
- set expanded 0
- }
- default {
- set expanded 1
- }
- }
- foreach lg $add_lgs {
- set lg_ind [bundle_link_group:DLadd_link_group $ind $sel $ind $lg $expanded]
- bundle_link_group:DLinfo $lg_ind
- }
- if {![lempty $del_lgs]} {
- set lg_sel sel105
- set above_level [dl:get $DLlist $ind _LEVEL]
- set lg_ind [dl:next $DLlist $ind]
- set level [dl:get $DLlist $lg_ind _LEVEL]
- set del_found ""
- while {$level > $above_level && ![cequal $lg_ind end]} {
- set search_sel [dl:get $DLlist $lg_ind SEL]
- set search_obj [dl:get $DLlist $lg_ind OBJ]
- if {[cequal $lg_sel $search_sel] && [set_isMember $del_lgs $search_obj]} {
- set_add del_found $lg_ind
- }
- set lg_ind [dl:next $DLlist $lg_ind]
- set level [dl:get $DLlist $lg_ind _LEVEL]
- }
- foreach lg_ind $del_found {
- dl:delete $DLlist $lg_ind
- }
- }
- ppp:viewsort $ind
- dl:fixconn $DLlist $ind
- }
- ppp:DLselectCB $cbs
- VxEndFormCB $cbs
- ppp:chain_next
- VtUnLock
- }
- proc bundle_link_group:deleteCB {op mb ind sel view cbs args} {
- Globals
- set lg_tag [dl:get $DLlist $ind OBJ]
- set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
- set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
- set tags [GRP:get $lg_tag tags]
- set links ""
- PPP:get bundle ${bundle_tag} links links
- foreach tag $tags {
- set_del links $tag
- }
- GRP:lg_del_ref $lg_tag bundle $bundle_tag
- if {![PPP:replace bundle $bundle_tag links $links]} {
- return [throwError $FDlg [ILM SCO_PPP_ERR_LG_DELETE]]
- }
- dl:delete $DLlist $ind
- dl:fixconn $DLlist $bundle_ind
- ppp:DLselectCB $cbs
- VtUnLock
- }
- proc bundle_link_group:DLadd_link_group {ind sel bundle_ind lg_tag show} {
- Globals
- set name [GRP:get $lg_tag name]
- set lg_ind [dl:add $DLlist $ind 1]
- dl:set $DLlist $lg_ind ICON [dl:icon lg]
- dl:set $DLlist $lg_ind SEL sel105
- dl:set $DLlist $lg_ind OBJ $lg_tag
- dl:set $DLlist $lg_ind BUNDLEIND $bundle_ind
- dl:set $DLlist $lg_ind NAME $name
- dl:show $DLlist $lg_ind $show
- return $lg_ind
- }
- proc bundle_link_group:DLinfo {ind} {
- link_group:DLinfo $ind
- }
- ##################################################
- proc ppp:PBbundle_network_protocolCB {op mb ind sel view cbs} {
- Globals
- switch $op {
- add {
- bundle_network_protocol:build_addCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- modify {
- bundle_protocol:build_modifyCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- delete {
- set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
- set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
- set proto [dl:get $DLlist $ind PROTO]
- set protocol_tag [dl:get $DLlist $ind OBJ]
- keylget ppp_type_info(protocol/$proto) sub_defn sub_defn
- if {[cequal $sub_defn network] && [num_network_protocols $bundle_tag] == 1} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_NETWORK_ONE]]
- }
- keylget cbs dialog dialog
- if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "bundle_protocol:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
- VtUnLock
- return
- }
- }
- }
- }
- proc ppp:PBbundle_link_protocolCB {op mb ind sel view cbs} {
- Globals
- switch $op {
- add {
- bundle_link_protocol:build_addCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- modify {
- bundle_protocol:build_modifyCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- delete {
- keylget cbs dialog dialog
- if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "bundle_protocol:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
- VtUnLock
- return
- }
- }
- }
- }
- proc bundle_link_protocol:build_addCB {op mb ind sel view cbs} {
- Globals
- keylget cbs dialog dialog
- set lprotocols [defn_list protocol link bundle]
- set bundle_tag [dl:get $DLlist $ind OBJ]
- PPP:get bundle $bundle_tag protocols protocols
- foreach protocol_tag $protocols {
- set val [defn_type protocol $protocol_tag]
- if {[PPP:isPresent protocol $protocol_tag]} {
- set_del lprotocols protocol/$val
- }
- }
- if {[lempty $lprotocols]} {
- set EDno_protocols [VtErrorDialog $dialog.EDno_protocols \
- -wmDecoration { TITLE RESIZE BORDER } \
- -autoDestroy 1 \
- -ok \
- -message [ILM SCO_PPP_ERR_BUNDLE_NO_LINK_PROTOCOLS] \
- ]
- VtShowDialog $EDno_protocols
- VtUnLock
- return
- }
- if {[cequal $op add]} {
- set title [ILM SCO_PPP_MSG_TITLE_LPROTOCOLS_ADD]
- } else {
- set title [ILM SCO_PPP_MSG_TITLE_LPROTOCOLS_MOD]
- }
- wset $dialog FDlp [VtFormDialog $dialog.FDlp \
- -title $title \
- -ok \
- -okCallback bundle_link_protocol:change_addCB \
- -cancel \
- -cancelCallback VxEndFormCB \
- -autoDestroy 1 \
- -autoLock bundle_link_protocol:change_addCB \
- -help \
- ]
- wset $FDlp AFlprotocols [AlignedForm $FDlp.AFlprotocols [list \
- [list SCO_PPP_MSG_LPROTOCOLS Llprotocols LSlprotocols \
- [list VtList \
- -callback bundle_link_protocol:LSlprotocols_selectCB \
- -selection MULTIPLE \
- -scrollBar 1 \
- -columns 25 \
- -rows 5 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_LPROTOCOLS] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- StatusBar $FDlp $AFlprotocols
- VtShow $FDlp
- wput $FDlp LSlprotocols
- wput $FDlp op mb ind sel view cbs
- set lpSel ""
- foreach protocol $lprotocols {
- keylget ppp_type_info($protocol) val val
- set proto [translit "a-z" "A-Z" $val]
- VtListAddItem $LSlprotocols \
- -item $proto
- }
- VxSetVar $LSlprotocols firstError 1
- SetVar $LSlprotocols lpSel
- VtUnLock
- }
- proc bundle_link_protocol:change_addCB {cbs} {
- Globals
- keylget cbs dialog FDlp
- wget $FDlp LSlprotocols
- wget $FDlp op ind mb sel view
- set bundle_tag [dl:get $DLlist $ind OBJ]
- set bundle_ind $ind
- PPP:get bundle $bundle_tag protocols protocols
- set new_protocols ""
- set lprotocols [VtListGetSelectedItem $LSlprotocols -byItemList]
- foreach proto $lprotocols {
- set val [translit "A-Z" "a-z" $proto]
- set protocol_tag ${val}_${bundle_tag}
- while {[PPP:isPresent protocol $protocol_tag]} {
- set protocol_tag [cycleName $protocol_tag]
- }
- if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type bundle]]]} {
- foreach protocol_tag $protocols {
- if {![PPP:isPresent protocol $protocol_tag]} {
- continue
- }
- PPP:get protocol $protocol_tag protocol protocol
- PPP:delete protocol/${protocol} $protocol_tag
- }
- return [throwError $FDlp [ILM SCO_PPP_ERR_PROTOCOL_CREATE]]
- }
- set_add protocols $protocol_tag
- set_add new_protocols $protocol_tag
- set algorithms [defn_list algorithm link protocol/$val]
- if {![lempty $algorithms]} {
- set txalgorithms ""
- set rxalgorithms ""
- foreach algorithm $algorithms {
- set alval ""
- keylget ppp_type_info($algorithm) val alval
- if {[cequal $alval ""]} {
- continue
- }
- set tx_tag tx_${val}_${alval}_${bundle_tag}
- set rx_tag rx_${val}_${alval}_${bundle_tag}
- while {[PPP:isPresent algorithm $rx_tag] || [PPP:isPresent algorithm $tx_tag]} {
- set tx_tag [cycleName $tx_tag]
- set rx_tag [cycleName $rx_tag]
- }
- set_add rxalgorithms $rx_tag
- set_add txalgorithms $tx_tag
- if {![PPP:create algorithm/${alval} $rx_tag]} {
- set_del rxalgorithms $rx_tag
- }
- if {![PPP:create algorithm/${alval} $tx_tag]} {
- set_del txalgorithms $tx_tag
- }
- }
- PPP:replace protocol/${val} $protocol_tag txalgorithms $txalgorithms
- PPP:replace protocol/${val} $protocol_tag rxalgorithms $rxalgorithms
- }
- }
- PPP:replace bundle $bundle_tag protocols $protocols
- PPP:action bundle $bundle_tag reset
- set state [dl:state $DLlist $bundle_ind]
- if {[cequal $state collapsed]} {
- set expanded 0
- } else {
- set expanded 1
- }
- foreach protocol_tag $protocols {
- if {[set_isMember $new_protocols $protocol_tag]} {
- set protocol_ind [bundle:DLadd_protocol $bundle_ind $bundle_ind $protocol_tag $expanded]
- bundle:DLinfo_protocol $protocol_ind $expanded
- }
- }
- ppp:viewsort $bundle_ind
- dl:fixconn $DLlist $bundle_ind
- ppp:DLselectCB $cbs
- if {[cequal $op add]} {
- set parent_cbs [VxGetVar $FDlp cbs]
- foreach protocol_tag $new_protocols {
- set val [defn_type protocol $protocol_tag]
- set defn_info ""
- set modify_on_add 0
- keylget ppp_type_info(protocol/$val) defn_info defn_info
- keylget defn_info modify_on_add modify_on_add
- if {$modify_on_add} {
- set rec ""
- keylset rec op modify
- keylset rec mb mb120
- keylset rec ind $protocol_ind
- keylset rec sel sel107
- keylset rec view $view
- keylset rec parent_cbs $parent_cbs
- keylset rec func bundle_protocol:build_modifyCB
- ppp:chain_add $rec
- }
- }
- }
- VxEndFormCB $cbs
- ppp:chain_next
- VtUnLock
- }
- proc bundle_link_protocol:LSlprotocols_selectCB {cbs} {
- keylget cbs dialog FDlp
- keylget cbs value value
- keylget cbs mode mode
- keylget cbs widget LSlprotocols
- keylget cbs selectedItemList itemList
- GetVar $LSlprotocols lpSel
- set i3 [intersect3 $lpSel $itemList]
- if {[cequal "" [lindex $i3 0]]} {
- set value [lindex $i3 2]
- set mode select
- } else {
- set value [lindex $i3 0]
- set mode deselect
- }
- VxSetVar $LSlprotocols lpSel $itemList
- }
- proc bundle_network_protocol:build_addCB {op mb ind sel view cbs} {
- Globals
- keylget cbs dialog dialog
- set nprotocols [defn_list protocol network bundle]
- set bundle_tag [dl:get $DLlist $ind OBJ]
- PPP:get bundle $bundle_tag protocols protocols
- foreach protocol_tag $protocols {
- set val [defn_type protocol $protocol_tag]
- if {[PPP:isPresent protocol $protocol_tag]} {
- set_del nprotocols protocol/$val
- }
- }
- if {[lempty $nprotocols]} {
- set EDno_protocols [VtErrorDialog $dialog.EDno_protocols \
- -wmDecoration { TITLE RESIZE BORDER } \
- -autoDestroy 1 \
- -ok \
- -message [ILM SCO_PPP_ERR_BUNDLE_NO_NETWORK_PROTOCOLS] \
- ]
- VtShowDialog $EDno_protocols
- VtUnLock
- return
- }
- if {[cequal $op add]} {
- set title [ILM SCO_PPP_MSG_TITLE_NPROTOCOLS_ADD]
- } else {
- set title [ILM SCO_PPP_MSG_TITLE_NPROTOCOLS_MOD]
- }
- wset $dialog FDnp [VtFormDialog $dialog.FDnp \
- -title $title \
- -ok \
- -okCallback bundle_network_protocol:change_addCB \
- -cancel \
- -cancelCallback VxEndFormCB \
- -autoDestroy 1 \
- -autoLock bundle_network_protocol:change_addCB \
- -help \
- ]
- wset $FDnp AFnprotocols [AlignedForm $FDnp.AFnprotocols [list \
- [list SCO_PPP_MSG_NPROTOCOLS Lnprotocols LSnprotocols \
- [list VtList \
- -callback bundle_network_protocol:LSnprotocols_selectCB \
- -selection MULTIPLE \
- -scrollBar 1 \
- -columns 25 \
- -rows 5 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_NPROTOCOLS] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- StatusBar $FDnp $AFnprotocols
- VtShow $FDnp
- wput $FDnp LSnprotocols
- wput $FDnp op mb ind sel view cbs
- set npSel ""
- foreach protocol $nprotocols {
- keylget ppp_type_info($protocol) val val
- set proto [translit "a-z" "A-Z" $val]
- VtListAddItem $LSnprotocols \
- -item $proto
- }
- VxSetVar $LSnprotocols firstError 1
- SetVar $LSnprotocols npSel
- VtUnLock
- }
- proc bundle_network_protocol:change_addCB {cbs} {
- Globals
- keylget cbs dialog FDnp
- wget $FDnp LSnprotocols
- wget $FDnp op ind mb sel view
- set bundle_tag [dl:get $DLlist $ind OBJ]
- set bundle_ind $ind
- PPP:get bundle $bundle_tag protocols protocols
- set new_protocols ""
- set nprotocols [VtListGetSelectedItem $LSnprotocols -byItemList]
- foreach proto $nprotocols {
- set val [translit "A-Z" "a-z" $proto]
- set protocol_tag ${val}_${bundle_tag}
- while {[PPP:isPresent protocol $protocol_tag]} {
- set protocol_tag [cycleName $protocol_tag]
- }
- if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type bundle]]]} {
- foreach protocol_tag $protocols {
- if {![PPP:isPresent protocol $protocol_tag]} {
- continue
- }
- PPP:get protocol $protocol_tag protocol protocol
- PPP:delete protocol/${protocol} $protocol_tag
- }
- return [throwError $FDnp [ILM SCO_PPP_ERR_PROTOCOL_CREATE]]
- }
- set_add protocols $protocol_tag
- set_add new_protocols $protocol_tag
- }
- PPP:replace bundle $bundle_tag protocols $protocols
- PPP:action bundle $bundle_tag reset
- set state [dl:state $DLlist $bundle_ind]
- if {[cequal $state collapsed]} {
- set expanded 0
- } else {
- set expanded 1
- }
- foreach protocol_tag $protocols {
- if {[set_isMember $new_protocols $protocol_tag]} {
- set protocol_ind [bundle:DLadd_protocol $bundle_ind $bundle_ind $protocol_tag $expanded]
- bundle:DLinfo_protocol $protocol_ind $expanded
- }
- }
- ppp:viewsort $bundle_ind
- dl:fixconn $DLlist $bundle_ind
- ppp:DLselectCB $cbs
- if {[cequal $op add]} {
- set parent_cbs [VxGetVar $FDnp cbs]
- foreach protocol_tag $new_protocols {
- set val [defn_type protocol $protocol_tag]
- set defn_info ""
- set modify_on_add 1
- keylget ppp_type_info(protocol/$val) defn_info defn_info
- keylget defn_info modify_on_add modify_on_add
- if {$modify_on_add} {
- set rec ""
- keylset rec op modify
- keylset rec mb mb120
- keylset rec ind $protocol_ind
- keylset rec sel sel106
- keylset rec view $view
- keylset rec parent_cbs $parent_cbs
- keylset rec func bundle_protocol:build_modifyCB
- ppp:chain_add $rec
- }
- }
- }
- VxEndFormCB $cbs
- ppp:chain_next
- VtUnLock
- }
- proc bundle_network_protocol:LSnprotocols_selectCB {cbs} {
- keylget cbs dialog FDnp
- keylget cbs value value
- keylget cbs mode mode
- keylget cbs widget LSnprotocols
- keylget cbs selectedItemList itemList
- GetVar $LSnprotocols npSel
- set i3 [intersect3 $npSel $itemList]
- if {[cequal "" [lindex $i3 0]]} {
- set value [lindex $i3 2]
- set mode select
- } else {
- set value [lindex $i3 0]
- set mode deselect
- }
- VxSetVar $LSnprotocols npSel $itemList
- }
- proc bundle_protocol:build_modifyCB {op mb ind sel view cbs} {
- Globals
- widget:build $op $mb $ind $sel $view $cbs
- ppp:DLselectCB $cbs
- VtUnLock
- }
- proc bundle_protocol:deleteCB {op mb ind sel view cbs args} {
- Globals
- set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
- set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
- set proto [dl:get $DLlist $ind PROTO]
- set protocol_tag [dl:get $DLlist $ind OBJ]
- keylget ppp_type_info(protocol/$proto) sub_defn sub_defn
- if {[cequal $sub_defn network] && [num_network_protocols $bundle_tag] == 1} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_NETWORK_ONE]]
- }
- if {[cequal $sel sel107]} {
- set algorithms ""
- set txalgorithms ""
- set rxalgorithms ""
- PPP:get protocol $protocol_tag algorithms algorithms
- PPP:get protocol $protocol_tag txalgorithms txalgorithms
- PPP:get protocol $protocol_tag rxalgorithms rxalgorithms
- foreach al_tag [concat $algorithms $txalgorithms $rxalgorithms] {
- if {![PPP:isPresent algorithm $al_tag]} {
- continue
- }
- PPP:get algorithm $al_tag algorithm algorithm
- if {![PPP:delete algorithm/$algorithm $al_tag]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
- }
- }
- }
- PPP:get bundle $bundle_tag protocols protocols
- set_del protocols $protocol_tag
- if {![PPP:replace bundle $bundle_tag protocols $protocols]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
- }
- if {![PPP:delete protocol/${proto} $protocol_tag]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
- }
- dl:delete $DLlist $ind
- dl:fixconn $DLlist $bundle_ind
- ppp:DLselectCB $cbs
- VtUnLock
- }
- ##################################################
- proc bundle_passwd:buildCB {op mb ind sel view cbs} {
- Globals
- global iconpath managedHost PPP_SHELL PPP_USER
- keylget cbs dialog dialog
- ####################
- set login $op
- wset $dialog FDpasswd [VtFormDialog $dialog.FDpasswd \
- -title [ILM SCO_PPP_MSG_TITLE_PASSWD $login] \
- -ok \
- -okCallback "bundle_passwd:changeCB 1" \
- -cancel \
- -cancelCallback "bundle_passwd:changeCB 0" \
- -autoDestroy 1 \
- -autoLock bundle_passwd:changeCB \
- -help \
- ]
- wset $FDpasswd AFpasswd [AlignedForm $FDpasswd.AFpasswd [list \
- [list SCO_PPP_MSG_PASSWD1 Lpasswd1 Tpasswd1 \
- [list VtText \
- -noEcho \
- -columns 25 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_PASSWD1] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- [list SCO_PPP_MSG_PASSWD2 Lpasswd2 Tpasswd2 \
- [list VtText \
- -noEcho \
- -columns 25 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_PASSWD2] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- ####################
- StatusBar $FDpasswd $AFpasswd
- VtShow $FDpasswd
- ####################
- VtSetValues $Tpasswd1 -value ""
- VtSetValues $Tpasswd2 -value ""
- wput $FDpasswd Tpasswd1 Tpasswd2
- wput $FDpasswd op mb ind sel view cbs
- VtUnLock
- }
- proc bundle_passwd:changeCB {change cbs} {
- Globals
- if {$change} {
- keylget cbs dialog FDpasswd
- wget $FDpasswd Tpasswd1 Tpasswd2
- wget $FDpasswd op mb ind sel view
- ####################
- set login $op
- GetValues $Tpasswd1 passwd1
- GetValues $Tpasswd2 passwd2
- if {![cequal $passwd1 $passwd2]} {
- VtSetValues $Tpasswd1 -value ""
- VtSetValues $Tpasswd2 -value ""
- return [throwError $FDpasswd [ILM SCO_PPP_ERR_PPP_PASSWD_NOT_MATCH]]
- }
- rename GetUser PPP_GetUser
- catch {rename account_GetUser GetUser}
- set objcall [list ObjectGet {sco accounts} [SetInstance NULL] {nextUid}]
- set bmipResponse [SMOC $objcall]
- set objcall [list ObjectAction {sco account} [SetInstance $login] setPassword $passwd1]
- set bmipResponse [SMOC $objcall]
- catch {rename GetUser account_GetUser}
- rename PPP_GetUser GetUser
- set firstBmip [lindex $bmipResponse 0]
- set errStack [BmipResponseErrorStack firstBmip]
- if { ![lempty $errStack] } {
- return [throwError $FDpasswd [ILM SCO_PPP_ERR_PPP_PASSWD_SET_FAILED $login]]
- }
- }
- VxEndFormCB $cbs
- ppp:chain_next
- VtUnLock
- }
- ##################################################
- proc ppp:PBlink_group_link_protocolCB {op mb ind sel view cbs} {
- Globals
- switch $op {
- add {
- link_group_link_protocol:build_addCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- modify {
- link_group_link_protocol:build_modifyCB $op "$mb" "$ind" "$sel" $view $cbs
- }
- delete {
- set lg_ind [dl:get $DLlist $ind LGIND]
- set lg_tag [dl:get $DLlist $lg_ind OBJ]
- set proto [dl:get $DLlist $ind PROTO]
- set protocol_tag [dl:get $DLlist $ind OBJ]
- if {[cequal $proto lcp]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_LCP_DELETE]]
- }
- keylget cbs dialog dialog
- if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "link_group_link_protocol:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
- VtUnLock
- return
- }
- }
- }
- }
- proc link_group_link_protocol:build_addCB {op mb ind sel view cbs} {
- Globals
- keylget cbs dialog dialog
- set lprotocols [defn_list protocol link link]
- set lg_tag [dl:get $DLlist $ind OBJ]
- set info [GRP:get $lg_tag info]
- set group_attrs ""
- keylget info group_attrs group_attrs
- keylget group_attrs protocols protocols
- foreach protocol_tag $protocols {
- set val [defn_type protocol $protocol_tag]
- if {[PPP:isPresent protocol $protocol_tag]} {
- set_del lprotocols protocol/$val
- }
- }
- if {[lempty $lprotocols]} {
- set EDno_protocols [VtErrorDialog $dialog.EDno_protocols \
- -wmDecoration { TITLE RESIZE BORDER } \
- -autoDestroy 1 \
- -ok \
- -message [ILM SCO_PPP_ERR_LINKS_NO_LINK_PROTOCOLS] \
- ]
- VtShowDialog $EDno_protocols
- VtUnLock
- return
- }
- if {[cequal $op add]} {
- set title [ILM SCO_PPP_MSG_TITLE_LPROTOCOLS_ADD]
- } else {
- set title [ILM SCO_PPP_MSG_TITLE_LPROTOCOLS_MOD]
- }
- wset $dialog FDlp [VtFormDialog $dialog.FDlp \
- -title $title \
- -ok \
- -okCallback link_group_link_protocol:change_addCB \
- -cancel \
- -cancelCallback VxEndFormCB \
- -autoDestroy 1 \
- -autoLock link_group_link_protocol:change_addCB \
- -help \
- ]
- wset $FDlp AFlprotocols [AlignedForm $FDlp.AFlprotocols [list \
- [list SCO_PPP_MSG_LPROTOCOLS Llprotocols LSlprotocols \
- [list VtList \
- -callback link_group_link_protocol:LSlprotocols_selectCB \
- -selection MULTIPLE \
- -scrollBar 1 \
- -columns 25 \
- -rows 5 \
- -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_LPROTOCOLS] \
- -shortHelpCallback SaShortHelpCB \
- ]] \
- ]]
- StatusBar $FDlp $AFlprotocols
- VtShow $FDlp
- wput $FDlp LSlprotocols
- wput $FDlp op mb ind sel view cbs
- set lpSel ""
- foreach protocol $lprotocols {
- keylget ppp_type_info($protocol) val val
- set proto [translit "a-z" "A-Z" $val]
- VtListAddItem $LSlprotocols \
- -item $proto
- }
- VxSetVar $LSlprotocols firstError 1
- SetVar $LSlprotocols lpSel
- VtUnLock
- }
- proc link_group_link_protocol:change_addCB {cbs} {
- Globals
- keylget cbs dialog FDlp
- wget $FDlp LSlprotocols
- wget $FDlp op ind mb sel view
- set lg_obj [dl:get $DLlist $ind OBJ]
- set lg_ind $ind
- set info ""
- set info [GRP:get $lg_obj info]
- set name [GRP:get $lg_obj name]
- set group_attrs ""
- keylget info group_attrs group_attrs
- keylget group_attrs protocols protocols
- keylget group_attrs type type
- set new_protocols ""
- set lprotocols [VtListGetSelectedItem $LSlprotocols -byItemList]
- foreach proto $lprotocols {
- set val [translit "A-Z" "a-z" $proto]
- set protocol_tag ${val}_${name}
- while {[PPP:isPresent protocol $protocol_tag]} {
- set protocol_tag [cycleName $protocol_tag]
- }
- if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type link/$type]]]} {
- foreach protocol_tag $protocols {
- if {![PPP:isPresent protocol $protocol_tag]} {
- continue
- }
- PPP:get protocol $protocol_tag protocol protocol
- PPP:delete protocol/${protocol} $protocol_tag
- }
- return [throwError $FDlp [ILM SCO_PPP_ERR_PROTOCOL_CREATE]]
- }
- set_add protocols $protocol_tag
- set_add new_protocols $protocol_tag
- set algorithms [defn_list algorithm link protocol/$val]
- if {![lempty $algorithms]} {
- set txalgorithms ""
- set rxalgorithms ""
- foreach algorithm $algorithms {
- set alval ""
- keylget ppp_type_info($algorithm) val alval
- if {[cequal $alval ""]} {
- continue
- }
- set tx_tag tx_${val}_${alval}_${name}
- set rx_tag rx_${val}_${alval}_${name}
- while {[PPP:isPresent algorithm $rx_tag] || [PPP:isPresent algorithm $tx_tag]} {
- set tx_tag [cycleName $tx_tag]
- set rx_tag [cycleName $rx_tag]
- }
- set_add rxalgorithms $rx_tag
- set_add txalgorithms $tx_tag
- if {![PPP:create algorithm/${alval} $rx_tag]} {
- set_del rxalgorithms $rx_tag
- }
- if {![PPP:create algorithm/${alval} $tx_tag]} {
- set_del txalgorithms $tx_tag
- }
- }
- PPP:replace protocol/${val} $protocol_tag txalgorithms $txalgorithms
- PPP:replace protocol/${val} $protocol_tag rxalgorithms $rxalgorithms
- }
- }
- set tags [GRP:get $lg_obj tags]
- foreach link_tag $tags {
- PPP:replace link $link_tag protocols $protocols
- PPP:action link $link_tag reset
- }
- keylset group_attrs protocols $protocols
- keylset info group_attrs $group_attrs
- GRP:replace $lg_obj info $info
- set state [dl:state $DLlist $lg_ind]
- if {[cequal $state collapsed]} {
- set expanded 0
- } else {
- set expanded 1
- }
- foreach protocol_tag $protocols {
- if {[set_isMember $new_protocols $protocol_tag]} {
- set protocol_ind [link_group:DLadd_protocol $lg_ind $lg_ind $protocol_tag $expanded]
- link_group:DLinfo_protocol $protocol_ind $expanded
- }
- }
- ppp:viewsort $lg_ind
- dl:fixconn $DLlist $lg_ind
- ppp:DLselectCB $cbs
- if {[cequal $op add]} {
- set parent_cbs [VxGetVar $FDlp cbs]
- foreach protocol_tag $new_protocols {
- set val [defn_type protocol $protocol_tag]
- set defn_info ""
- set modify_on_add 1
- keylget ppp_type_info(protocol/$val) defn_info defn_info
- keylget defn_info modify_on_add modify_on_add
- if {$modify_on_add} {
- set rec ""
- keylset rec op modify
- keylset rec mb mb120
- keylset rec ind $protocol_ind
- keylset rec sel sel203
- keylset rec view $view
- keylset rec parent_cbs $parent_cbs
- keylset rec func bundle_protocol:build_modifyCB
- ppp:chain_add $rec
- }
- }
- }
- VxEndFormCB $cbs
- ppp:chain_next
- VtUnLock
- }
- proc link_group_link_protocol:LSlprotocols_selectCB {cbs} {
- keylget cbs dialog FDlp
- keylget cbs value value
- keylget cbs mode mode
- keylget cbs widget LSlprotocols
- keylget cbs selectedItemList itemList
- GetVar $LSlprotocols lpSel
- set i3 [intersect3 $lpSel $itemList]
- if {[cequal "" [lindex $i3 0]]} {
- set value [lindex $i3 2]
- set mode select
- } else {
- set value [lindex $i3 0]
- set mode deselect
- }
- VxSetVar $LSlprotocols lpSel $itemList
- }
- proc link_group_link_protocol:build_modifyCB {op mb ind sel view cbs} {
- Globals
- widget:build $op $mb $ind $sel $view $cbs
- ppp:DLselectCB $cbs
- VtUnLock
- }
- proc link_group_link_protocol:deleteCB {op mb ind sel view cbs args} {
- Globals
- set lg_ind [dl:get $DLlist $ind LGIND]
- set lg_tag [dl:get $DLlist $lg_ind OBJ]
- set proto [dl:get $DLlist $ind PROTO]
- set protocol_tag [dl:get $DLlist $ind OBJ]
- if {[cequal $proto lcp]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_LCP_DELETE]]
- }
- set tags [GRP:get $lg_tag tags]
- set info [GRP:get $lg_tag info]
- set group_attrs ""
- keylget info group_attrs group_attrs
- keylget group_attrs protocols protocols
- set algorithms ""
- set txalgorithms ""
- set rxalgorithms ""
- PPP:get protocol $protocol_tag algorithms algorithms
- PPP:get protocol $protocol_tag txalgorithms txalgorithms
- PPP:get protocol $protocol_tag rxalgorithms rxalgorithms
- foreach al_tag [concat $algorithms $txalgorithms $rxalgorithms] {
- if {![PPP:isPresent algorithm $al_tag]} {
- continue
- }
- PPP:get algorithm $al_tag algorithm algorithm
- if {![PPP:delete algorithm/$algorithm $al_tag]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
- }
- }
- set_del protocols $protocol_tag
- keylset group_attrs protocols $protocols
- keylset info group_attrs $group_attrs
- if {![GRP:replace $lg_tag info $info]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
- }
- foreach link_tag $tags {
- if {![PPP:replace link ${link_tag} protocols $protocols]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
- }
- }
- if {![PPP:delete protocol/${proto} $protocol_tag]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
- }
- dl:delete $DLlist $ind
- dl:fixconn $DLlist $lg_ind
- ppp:DLselectCB $cbs
- VtUnLock
- }
- ##################################################
- proc widget:Globals {} {
- uplevel 1 global widget_groups widget_FT
- }
- proc widget:init {owner_type} {
- Globals
- widget:Globals
- if {[info exist widget_groups($owner_type)]} {
- return
- }
- set defn_info ""
- keylget ppp_type_info($owner_type) defn_info defn_info
- set title ""
- keylget defn_info title title
- set new_title [lindex [PPP:ilm $title] 0]
- keylset defn_info title $new_title
- keylset ppp_type_info($owner_type) defn_info $defn_info
- set option_group_labels ""
- keylget ppp_type_info($owner_type) option_group_labels option_group_labels
- set wgroups ""
- foreach group_name [keylkeys option_group_labels] {
- keylget option_group_labels $group_name labels
- set new_labels [lindex [PPP:ilm $labels] 0]
- keylset option_group_labels $group_name $new_labels
- keylset wgroups $group_name ""
- }
- keylset ppp_type_info($owner_type) option_group_labels $option_group_labels
- set options ""
- foreach opt [keylkeys ppp_opt_info($owner_type)] {
- keylget ppp_opt_info($owner_type) ${opt}.gui_visible gui_visible
- if {$gui_visible} {
- foreach attr {label short_help} {
- keylget ppp_opt_info($owner_type) ${opt}.$attr label
- set new_label [lindex [PPP:ilm $label] 0]
- keylset ppp_opt_info($owner_type) ${opt}.$attr $new_label
- }
- keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
- keylget ppp_opt_info($owner_type) ${opt}.option_info option_info
- switch $widget_type {
- TEXT -
- SPIN_BUTTON {
- }
- CALL_GUI {
- foreach attr {labels short_helps exit_label exit_short_help exit_mnemonic} {
- keylget ppp_opt_info($owner_type) ${opt}.option_info.$attr labels
- set new_labels [lindex [PPP:ilm $labels] 0]
- keylset ppp_opt_info($owner_type) ${opt}.option_info.$attr $new_labels
- }
- }
- RONLY_COMBO -
- FILE_SEL -
- RADIO_BOX {
- foreach attr {labels short_helps} {
- keylget ppp_opt_info($owner_type) ${opt}.option_info.$attr labels
- set new_labels [lindex [PPP:ilm $labels] 0]
- keylset ppp_opt_info($owner_type) ${opt}.option_info.$attr $new_labels
- }
- }
- default {
- keylset ppp_opt_info($owner_type) ${opt}.gui_visible 0
- }
- }
- keylget ppp_opt_info($owner_type) ${opt}.gui_visible gui_visible
- if {$gui_visible} {
- keylget ppp_opt_info($owner_type) ${opt}.option_group group
- set l ""
- keylget wgroups $group l
- if {![cequal $group ""]} {
- lappend l $opt
- keylset wgroups $group $l
- }
- }
- }
- }
- foreach group_name [keylkeys wgroups] {
- keylget wgroups $group_name group
- set no_order 100
- if {[lempty $group]} {
- keyldel wgroups $group_name
- continue
- }
- foreach opt [keylkeys group] {
- keylget ppp_opt_info($owner_type) ${opt}.option_info info
- set order $no_order
- keylget info order order
- if {$order == $no_order} {
- incr no_order
- }
- set order_array($order) $opt
- }
- set order [lsort -integer -increasing [array names order_array]]
- set new_group ""
- foreach order_index $order {
- lappend new_group $order_array($order_index)
- }
- keylset wgroups $group_name $new_group
- unset order_array
- }
- set widget_groups($owner_type) $wgroups
- }
- proc widget:build {op mb ind sel view cbs} {
- widget:Globals
- Globals
- keylget cbs dialog dialog
- if {[cequal $op modify]} {
- set owner_tag [dl:get $DLlist $ind OBJ]
- } else {
- set owner_tag ""
- }
- switch $sel {
- sel105 -
- sel106 -
- sel107 {
- set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
- set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
- set link_tags ""
- set owner_val [dl:get $DLlist $ind PROTO]
- set owner_tag [dl:get $DLlist $ind OBJ]
- set owner_type protocol/${owner_val}
- }
- sel202 -
- sel203 {
- set bundle_tag ""
- set lg_ind [dl:get $DLlist $ind LGIND]
- set lg_tag [dl:get $DLlist $lg_ind OBJ]
- set link_tags [GRP:get $lg_tag tags]
- set owner_val [dl:get $DLlist $ind PROTO]
- set owner_tag [dl:get $DLlist $ind OBJ]
- set owner_type protocol/${owner_val}
- }
- }
- set infoValueList ""
- keylset infoValueList bundle $bundle_tag
- keylset infoValueList links $link_tags
- StatusPush $FDppp [ILM SCO_PPP_MSG_PROTOCOL_DIALOG_BUILD]
- widget:init $owner_type
- catch {unset widget_FT}
- set defn_info ""
- keylget ppp_type_info($owner_type) defn_info defn_info
- set title ""
- keylget defn_info title title
- if {[cequal $op add]} {
- set title "[ILM SCO_PPP_MSG_TITLE_ADD] $title"
- } else {
- set title "[ILM SCO_PPP_MSG_TITLE_MOD] $title"
- }
- wset $dialog FDwidget [VtFormDialog $dialog.FD$owner_type \
- -title $title \
- -ok \
- -okCallback widget:changeCB \
- -cancel \
- -cancelCallback VxEndFormCB \
- -autoDestroy 1 \
- -autoLock widget:changeCB \
- -help \
- ]
- set FTDwidget [FormTabDialog $FDwidget.FTD$owner_type]
- set group_names [keylkeys widget_groups($owner_type)]
- set widget_forms ""
- set first_group_name ""
- foreach group_name $group_names {
- if {[cequal $first_group_name ""]} {
- set first_group_name $group_name
- }
- set option_group_labels ""
- keylget ppp_type_info($owner_type) option_group_labels option_group_labels
- keylget option_group_labels $group_name labels
- lassign $labels ft sh title
- set FTwidget($group_name) [SaFormTab $FTDwidget.FT$group_name \
- -label $ft \
- -title $title \
- -shortHelpString $sh \
- -shortHelpCallback SaShortHelpCB \
- ]
- lappend widget_forms $FTwidget($group_name)
- widget:build_form $owner_type $owner_tag $group_name $FDwidget $FTwidget($group_name)
- }
- StatusBar $FDwidget $FTDwidget
- VtShow $FDwidget
- StatusPush $FDwidget [ILM SCO_PPP_MSG_WIDGET_SET_VALUES]
- SaFormTabDialogMaxSize $FTDwidget
- SaFormTabSetSelected $FTwidget($first_group_name)
- foreach group_name $group_names {
- widget:build_values $owner_type $owner_tag $group_name $FDwidget
- }
- keylget ppp_type_info($owner_type) options options
- set real_attrValueList ""
- foreach opt [keylkeys ppp_opt_info($owner_type)] {
- set value ""
- if {[cequal $owner_tag ""]} {
- keylget options $opt value
- } else {
- PPP:get ${owner_type} ${owner_tag} $opt value
- }
- keylset real_attrValueList $opt $value
- }
- set opt_list [keylkeys ppp_opt_info($owner_type)]
- set res_list [PPP:validate $owner_type $opt_list $real_attrValueList get $infoValueList]
- foreach res $res_list {
- if {![lempty $res]} {
- lassign $res failed error actions
- if {$failed} {
- return [throwError $FDwidget $error]
- }
- if {![lempty $actions]} {
- widget:actions $owner_type $actions $FDwidget
- }
- } else {
- return [throwError $FDwidget [ILM SCO_PPP_ERR_PROTOCOL_FAILED]]
- }
- }
- wput $FDwidget op mb ind sel view cbs widget_forms
- StatusPop $FDwidget
- StatusPop $FDppp
- return $FDwidget
- }
- proc widget:build_form {owner_type owner_tag group_name FDwidget FTwidget} {
- widget:Globals
- Globals
- global managedHost
- keylget widget_groups($owner_type) $group_name widget_group
- set focus_list ""
- set tab_list ""
- set af ""
- set widget_grps [keylkeys widget_group]
- foreach opt $widget_grps {
- set widget_type ""
- set label ""
- set short_help ""
- set option_info ""
- keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
- keylget ppp_opt_info($owner_type) ${opt}.label label
- keylget ppp_opt_info($owner_type) ${opt}.short_help short_help
- keylget ppp_opt_info($owner_type) ${opt}.option_info option_info
- switch $widget_type {
- TEXT {
- lappend af [list $label L$opt T$opt \
- [list VtText \
- -callback widget:validateCB \
- -losingFocusCallback widget:validateCB \
- -autoLock widget:validateCB \
- -columns 25 \
- -shortHelpString $short_help \
- -shortHelpCallback SaShortHelpCB \
- ]]
- }
- FILE_SEL {
- lappend af [list $label L$opt F$opt \
- [list VtForm \
- -marginWidth 0 \
- -marginHeight 0 \
- ]]
- }
- CALL_GUI {
- lappend af [list $label L$opt F$opt \
- [list VtForm \
- -marginWidth 0 \
- -marginHeight 0 \
- ]]
- }
- RONLY_COMBO {
- lappend af [list $label L$opt CB$opt \
- [list VtComboBox \
- -callback widget:validateCB \
- -valueChangedCallback widget:validateCB \
- -autoLock widget:validateCB \
- -readOnly \
- -columns 25 \
- -shortHelpString $short_help \
- -shortHelpCallback SaShortHelpCB \
- ]]
- }
- SPIN_BUTTON {
- set min 0
- set max 2147483647
- keylget option_info min min
- keylget option_info max max
- lappend af [list $label L$opt SB$opt \
- [list VxSpinButton \
- 10 $min "" $max "" 1 $min "" "" \
- ]]
- }
- RADIO_BOX {
- set numColumns 1
- keylget option_info numColumns numColumns
- lappend af [list $label L$opt RB$opt \
- [list VtRadioBox \
- -callback widget:validateCB \
- -autoLock widget:validateCB \
- -horizontal \
- ]]
- }
- }
- }
- set AFwidget($group_name) [AlignedForm $FTwidget.AF$group_name 0 $af]
- foreach opt $widget_grps {
- set widget_type ""
- set label ""
- set short_help ""
- set option_info ""
- keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
- keylget ppp_opt_info($owner_type) ${opt}.label label
- keylget ppp_opt_info($owner_type) ${opt}.short_help short_help
- keylget ppp_opt_info($owner_type) ${opt}.option_info option_info
- eval VxSetVar $FDwidget L$opt \$L$opt
- switch $widget_type {
- TEXT {
- eval VxSetVar $FDwidget T$opt \$T$opt
- eval lappend focus_list \$T$opt
- eval lappend tab_list \$T$opt
- }
- FILE_SEL {
- set filter "/*"
- keylget option_info filter filter
- eval VxSetVar $FDwidget F$opt \$F$opt
- keylget option_info labels labels
- keylget option_info short_helps short_helps
- eval set form \$F$opt
- set T [VtText $form.T$opt \
- -callback widget:validateCB \
- -losingFocusCallback widget:validateCB \
- -autoLock widget:validateCB \
- -columns 25 \
- -shortHelpString $short_help \
- -shortHelpCallback SaShortHelpCB \
- ]
- set PB [VtPushButton $form.PB$opt \
- -label $labels \
- -callback "widget:PBfile_selCB $T" \
- -autoLock widget:PBfile_selCB \
- -leftSide $T \
- -topSide FORM \
- -shortHelpString $short_helps \
- -shortHelpCallback SaShortHelpCB \
- ]
- SetVar $T filter
- eval VxSetVar $FDwidget T$opt \$T
- eval VxSetVar $FDwidget PB$opt \$PB
- eval lappend focus_list \$T \$PB
- eval lappend tab_list \$T \$PB
- }
- CALL_GUI {
- eval VxSetVar $FDwidget F$opt \$F$opt
- keylget option_info labels labels
- keylget option_info short_helps short_helps
- keylget option_info gui_path gui_path
- keylget option_info gui_args gui_args
- keylget option_info exit_label exit_label
- keylget option_info exit_short_help exit_short_help
- keylget option_info exit_mnemonic exit_mnemonic
- eval set form \$F$opt
- set T [VtText $form.T$opt \
- -callback widget:validateCB \
- -losingFocusCallback widget:validateCB \
- -autoLock widget:PBcall_guiCB \
- -columns 25 \
- -shortHelpString $short_help \
- -shortHelpCallback SaShortHelpCB \
- ]
- set PB [VtPushButton $form.PB$opt \
- -label $labels \
- -callback "widget:PBcall_guiCB $T \"$gui_path\" \"$gui_args\" \"$exit_label\" \"$exit_short_help\" \"$exit_mnemonic\"" \
- -autoLock widget:PBcall_guiCB \
- -leftSide $T \
- -topSide FORM \
- -shortHelpString $short_helps \
- -shortHelpCallback SaShortHelpCB \
- ]
- if {![file executable $gui_path] && ![SaFile -host $managedHost executable $gui_path]} {
- SetSens $PB 0
- }
- eval VxSetVar $FDwidget T$opt \$T
- eval VxSetVar $FDwidget PB$opt \$PB
- eval lappend focus_list \$T \$PB
- eval lappend tab_list \$T \$PB
- }
- RONLY_COMBO {
- eval VxSetVar $FDwidget CB$opt \$CB$opt
- keylget option_info labels labels
- eval VtSetValues \$CB$opt \
- -itemList \$labels
- eval lappend focus_list \$CB$opt
- eval lappend tab_list \$CB$opt
- }
- SPIN_BUTTON {
- eval VxSetVar $FDwidget SB$opt \$SB$opt
- eval VtSetValues \$SB$opt \
- -rightSide NONE \
- -shortHelpString \"$short_help\" \
- -shortHelpCallback SaShortHelpCB
- set text [eval VxGetVar \$SB$opt text]
- VtSetValues $text \
- -callback widget:validateCB \
- -losingFocusCallback widget:validateCB \
- -autoLock widget:validateCB
- VxSetVar $text opt $opt
- lappend focus_list $text
- lappend tab_list $text
- }
- RADIO_BOX {
- eval VxSetVar $FDwidget RB$opt \$RB$opt
- keylget option_info labels labels
- keylget option_info values values
- keylget option_info short_helps short_helps
- foreach value $values {
- set label [lvarpop labels]
- set short_help [lvarpop short_helps]
- set TB${opt}_$value [eval VtToggleButton \$RB$opt.TB${opt}_$value \
- -label \"$label\" \
- -shortHelpString \"$short_help\" \
- -shortHelpCallback SaShortHelpCB \
- -userData \"$value\" \
- -value 0 \
- ]
- eval VxSetVar $FDwidget TB${opt}_$value \$TB${opt}_$value
- }
- eval lappend focus_list \$RB$opt
- eval lappend tab_list \$RB$opt
- }
- }
- }
- SaFormTabSetFocusList $FTwidget $focus_list
- SaFormTabSetTabGroup $FTwidget $tab_list
- }
- proc widget:actions {owner_type actions FDwidget} {
- widget:Globals
- Globals
- foreach rec $actions {
- set action [lvarpop rec]
- switch $action {
- sense {
- lassign $rec opt sub value
- widget:set_sens $owner_type $opt $sub $value $FDwidget
- }
- replace {
- lassign $rec opt value
- widget:set_value $owner_type $opt $value $FDwidget
- }
- }
- }
- }
- proc widget:set_sens {owner_type opt sub value FDwidget} {
- widget:Globals
- Globals
- set widget_type ""
- set option_info ""
- keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
- if {[cequal $sub ""]} {
- set label [VxGetVar $FDwidget L$opt]
- VtSetSensitive $label $value
- }
- switch $widget_type {
- TEXT {
- set widget [VxGetVar $FDwidget T$opt]
- }
- FILE_SEL {
- set widget [VxGetVar $FDwidget F$opt]
- }
- CALL_GUI {
- switch $sub {
- "" {
- set widget [VxGetVar $FDwidget F$opt]
- }
- text {
- set widget [VxGetVar $FDwidget T$opt]
- }
- select {
- set widget [VxGetVar $FDwidget PB$opt]
- }
- }
- }
- RONLY_COMBO {
- set widget [VxGetVar $FDwidget CB$opt]
- }
- SPIN_BUTTON {
- set widget [VxGetVar $FDwidget SB$opt]
- }
- RADIO_BOX {
- switch $sub {
- "" {
- set widget [VxGetVar $FDwidget RB$opt]
- }
- default {
- set widget [VxGetVar $FDwidget TB${opt}_$sub]
- }
- }
- }
- }
- VtSetSensitive $widget $value
- }
- proc widget:set_value {owner_type opt value FDwidget} {
- widget:Globals
- Globals
- set widget_type ""
- set option_info ""
- keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
- keylget ppp_opt_info($owner_type) ${opt}.option_info option_info
- switch $widget_type {
- TEXT {
- set widget [VxGetVar $FDwidget T$opt]
- VtSetValues $widget -value $value
- }
- FILE_SEL {
- set widget [VxGetVar $FDwidget T$opt]
- VtSetValues $widget -value $value
- }
- CALL_GUI {
- set widget [VxGetVar $FDwidget T$opt]
- VtSetValues $widget -value $value
- }
- RONLY_COMBO {
- keylget option_info labels labels
- keylget option_info values values
- set widget [VxGetVar $FDwidget CB$opt]
- VtSetValues $widget -value [lindex $labels [lsearch $values $value]]
- }
- SPIN_BUTTON {
- set widget [VxGetVar $FDwidget SB$opt]
- set text [VxGetVar $widget text]
- VtSetValues $text -value $value
- VxSetVar $text opt $opt
- }
- RADIO_BOX {
- set widget [VxGetVar $FDwidget RB$opt]
- set tb [VxGetVar $FDwidget TB${opt}_$value]
- VtSetValues $widget -value $tb
- }
- }
- VxSetVar $widget opt $opt
- }
- proc widget:build_values {owner_type owner_tag group_name FDwidget} {
- widget:Globals
- Globals
- keylget widget_groups($owner_type) $group_name widget_group
- keylget ppp_type_info($owner_type) options options
- foreach opt [keylkeys widget_group] {
- set value ""
- if {[cequal $owner_tag ""]} {
- keylget options $opt value
- } else {
- PPP:get ${owner_type} ${owner_tag} $opt value
- }
- widget:set_value $owner_type $opt $value $FDwidget
- }
- }
- proc widget:PBfile_selCB {Twidget cbs} {
- global managedHost
- keylget cbs dialog FDwidget
- set value [VtGetValues $Twidget -value]
- set filter "/*"
- GetVar $Twidget filter
- set FSfile_sel [SaFileSelectionDialog $FDwidget.FSfile_sel \
- -host $managedHost \
- -filter $filter \
- -title [ILM SCO_PPP_MSG_FILE_SEL] \
- -okCallback "widget:FSfile_selCB $Twidget" \
- -autoLock widget:FSfile_selCB \
- -cancelCallback VxEndFormCB \
- -autoDestroy 0 \
- -help \
- -selection $value \
- ]
- VtShow $FSfile_sel
- VtUnLock
- }
- proc widget:FSfile_selCB {Twidget cbs} {
- keylget cbs selection value
- VtSetValues $Twidget -value $value
- VxEndFormCB $cbs
- VtUnLock
- }
- proc widget:PBcall_guiCB {Twidget gui_path gui_args label short_help mnemonic cbs} {
- global managedHost
- keylget cbs dialog FDwidget
- set value [VtGetValues $Twidget -value]
- if {![file executable $gui_path] && ![SaFile -host $managedHost executable $gui_path]} {
- return [throwError $FDwidget [ILM SCO_PPP_ERR_GUI_NOT_FOUND]]
- }
- if {[catch {eval exec $gui_path $gui_args -t \"$value\" -o -l \"$label\" -h \"$short_help\" -m \"$mnemonic\" $managedHost} res]} {
- return [throwError $FDwidget [ILM SCO_PPP_ERR_GUI_FAILED]]
- }
- if {![cequal $res ""]} {
- set i [string first "\n" $res]
- if {$i != -1} {
- incr i
- set res [csubstr $res $i end]
- VtSetValues $Twidget -value [string trim $res]
- keylset cbs widget $Twidget
- widget:validateCB $cbs
- return
- }
- }
- VtUnLock
- }
- proc widget:get_value {owner_type opt FDwidget} {
- widget:Globals
- Globals
- set value ""
- set widget_type ""
- keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
- keylget ppp_opt_info($owner_type) ${opt}.option_info option_info
- switch $widget_type {
- TEXT {
- set widget [VxGetVar $FDwidget T$opt]
- set value [VtGetValues $widget -value]
- }
- FILE_SEL {
- set widget [VxGetVar $FDwidget T$opt]
- set value [VtGetValues $widget -value]
- }
- CALL_GUI {
- set widget [VxGetVar $FDwidget T$opt]
- set value [VtGetValues $widget -value]
- }
- RONLY_COMBO {
- keylget option_info labels labels
- keylget option_info values values
- set widget [VxGetVar $FDwidget CB$opt]
- set value [lindex $values [lsearch $labels [VtGetValues $widget -value]]]
- }
- SPIN_BUTTON {
- set widget [VxGetVar $FDwidget SB$opt]
- set T [VxGetVar $widget text]
- set value [VtGetValues $T -value]
- }
- RADIO_BOX {
- set widget [VxGetVar $FDwidget RB$opt]
- set tb [VtGetValues $widget -value]
- set value [VtGetValues $tb -userData]
- }
- }
- return $value
- }
- proc widget:validateCB {cbs} {
- keylget cbs mode mode
- switch $mode {
- selectSame {
- VtUnLock
- return
- }
- }
- VtLock
- widget:Globals
- Globals
- keylget cbs dialog FDwidget
- keylget cbs widget widget
- StatusPush $FDwidget [ILM SCO_PPP_MSG_WIDGET_VALIDATE]
- set validate_opt [VxGetVar $widget opt]
- wget $FDwidget op mb ind sel view widget_forms
- if {[cequal $op modify]} {
- set owner_tag [dl:get $DLlist $ind OBJ]
- } else {
- set owner_tag ""
- }
- switch $sel {
- sel106 -
- sel107 {
- set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
- set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
- set link_tags ""
- set owner_val [dl:get $DLlist $ind PROTO]
- set owner_tag [dl:get $DLlist $ind OBJ]
- set owner_type protocol/${owner_val}
- }
- sel203 {
- set bundle_tag ""
- set lg_ind [dl:get $DLlist $ind LGIND]
- set lg_tag [dl:get $DLlist $lg_ind OBJ]
- set link_tags [GRP:get $lg_tag tags]
- set owner_val [dl:get $DLlist $ind PROTO]
- set owner_tag [dl:get $DLlist $ind OBJ]
- set owner_type protocol/${owner_val}
- }
- }
- set infoValueList ""
- keylset infoValueList bundle $bundle_tag
- keylset infoValueList links $link_tags
- set attrValueList ""
- set real_attrValueList ""
- set group_names [keylkeys widget_groups($owner_type)]
- foreach group_name $group_names {
- keylget widget_groups($owner_type) $group_name widget_group
- keylget ppp_type_info($owner_type) options options
- foreach opt [keylkeys widget_group] {
- set old_value ""
- if {[cequal $owner_tag ""]} {
- keylget options $opt old_value
- } else {
- PPP:get ${owner_type} ${owner_tag} $opt old_value
- }
- set value [widget:get_value $owner_type $opt $FDwidget]
- if {[cequal $opt $validate_opt]} {
- set validate_old_value $old_value
- set validate_value $value
- }
- lappend real_attrValueList [list $opt $value]
- if {![cequal $value $old_value]} {
- lappend attrValueList [list $opt $value]
- }
- }
- }
- set res_list [PPP:validate $owner_type $validate_opt $real_attrValueList replace $infoValueList]
- foreach res $res_list {
- if {![lempty $res]} {
- lassign $res failed error actions
- if {$failed} {
- widget:set_value $owner_type $validate_opt $validate_old_value $FDwidget
- StatusPop $FDwidget
- return [throwError $FDwidget $error]
- }
- if {![lempty $actions]} {
- widget:actions $owner_type $actions $FDwidget
- }
- } else {
- StatusPop $FDwidget
- return [throwError $FDwidget [ILM SCO_PPP_ERR_PROTOCOL_FAILED]]
- }
- }
- StatusPop $FDwidget
- VtUnLock
- }
- proc widget:changeCB {cbs} {
- widget:Globals
- Globals
- keylget cbs dialog FDwidget
- wget $FDwidget op mb ind sel view widget_forms
- if {[cequal $op modify]} {
- set owner_tag [dl:get $DLlist $ind OBJ]
- } else {
- set owner_tag ""
- }
- switch $sel {
- sel106 -
- sel107 {
- set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
- set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
- set link_tags ""
- set owner_val [dl:get $DLlist $ind PROTO]
- set owner_tag [dl:get $DLlist $ind OBJ]
- set owner_type protocol/${owner_val}
- }
- sel203 {
- set bundle_tag ""
- set lg_ind [dl:get $DLlist $ind LGIND]
- set lg_tag [dl:get $DLlist $lg_ind OBJ]
- set link_tags [GRP:get $lg_tag tags]
- set owner_val [dl:get $DLlist $ind PROTO]
- set owner_tag [dl:get $DLlist $ind OBJ]
- set owner_type protocol/${owner_val}
- }
- }
- set infoValueList ""
- keylset infoValueList bundle $bundle_tag
- keylset infoValueList links $link_tags
- set attrValueList ""
- set real_attrValueList ""
- foreach group_name [keylkeys widget_groups($owner_type)] {
- keylget widget_groups($owner_type) $group_name widget_group
- keylget ppp_type_info($owner_type) options options
- foreach opt [keylkeys widget_group] {
- set old_value ""
- if {[cequal $owner_tag ""]} {
- keylget options $opt old_value
- } else {
- PPP:get ${owner_type} ${owner_tag} $opt old_value
- }
- set value [widget:get_value $owner_type $opt $FDwidget]
- lappend real_attrValueList [list $opt $value]
- if {![cequal $value $old_value]} {
- lappend attrValueList [list $opt $value]
- }
- }
- }
- set close_actions ""
- set opt_list [keylkeys real_attrValueList]
- set res_list [PPP:validate $owner_type $opt_list $real_attrValueList close $infoValueList]
- foreach res $res_list {
- if {![lempty $res]} {
- lassign $res failed error actions
- if {![lempty $actions]} {
- set close_actions [concat $close_actions $actions]
- }
- if {$failed} {
- return [throwError $FDwidget $error]
- }
- } else {
- return [throwError $FDwidget [ILM SCO_PPP_ERR_PROTOCOL_FAILED]]
- }
- }
- foreach rec $close_actions {
- set action [lvarpop rec]
- switch $action {
- sense {
- }
- replace {
- lassign $rec opt value
- keylset attrValueList $opt $value
- }
- }
- }
- if {![PPP:replace $owner_type $owner_tag $attrValueList]} {
- return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_REPLACE]]
- }
- switch $sel {
- sel105 -
- sel106 -
- sel107 {
- set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
- set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
- PPP:action bundle $bundle_tag reset
- }
- sel203 {
- set lg_ind [dl:get $DLlist $ind LGIND]
- set lg_tag [dl:get $DLlist $lg_ind OBJ]
- set tags [GRP:get $lg_tag tags]
- foreach link_tag $tags {
- PPP:action link $link_tag reset
- }
- }
- }
- VxEndFormCB $cbs
- ppp:chain_next
- VtUnLock
- }
- ##################################################
- ##################################################
- proc pppGUIMain {} {
- global managedHost argv iconpath versionNumber optind \
- PPP_SHELL PPP_HOME PPP_USER PPP_COMMENT PPP_GROUP PPP_MODE free_gap
- set PPP_USER ppp
- set PPP_SHELL /usr/bin/pppsh
- set PPP_HOME /home/ppp
- set PPP_COMMENT "PPP account"
- set PPP_GROUP 1
- set PPP_MODE 0755
- set free_gap " "
- set ppptalk_log_flag 0
- set debug_log_flag 0
- set show_psm_flag 0
- set version_flag 0
- set optString "dlPRUV"
- set argc [llength $argv]
- while { [set opt [getopt $argc $argv $optString]] != -1 } {
- switch $opt {
- d {
- set debug_log_flag 1
- }
- l {
- set ppptalk_log_flag 1
- }
- P {
- set show_psm_flag 1
- }
- R {
- exec /usr/bin/scoadmin -p Networking -f -c /usr/lib/scoadmin/ppp/ppp.obj
- return
- }
- U {
- exec /usr/bin/scoadmin -p Networking -d ppp.obj
- return
- }
- V {
- set version_flag 1
- }
- }
- }
- set argv [join [lrange $argv $optind end] ]
- set managedHost [GetManagedHost]
- set versionNumber [SaGetSSOVersion]
- set iconpath /usr/lib/scoadmin/neticons
- if {$debug_log_flag} {
- debug_on pppGUI
- }
- if {$ppptalk_log_flag} {
- PPP:ppptalk_log 1
- }
- if {$show_psm_flag || $version_flag} {
- set objcall [list ObjectAction {sco ppp} [SetInstance NULL] registered_psm_osa {}]
- set bmipResponse [SMOC $objcall]
- set firstBmip [lindex $bmipResponse 0]
- set errStack [BmipResponseErrorStack firstBmip]
- if {[lempty $errStack]} {
- set registered_psm_osa [BmipResponseActionInfo firstBmip]
- } else {
- set registered_psm_osa ""
- }
- }
- if {$version_flag} {
- set objcall [list ObjectAction {sco ppp} [SetInstance NULL] version {}]
- set bmipResponse [SMOC $objcall]
- set firstBmip [lindex $bmipResponse 0]
- set errStack [BmipResponseErrorStack firstBmip]
- if {[lempty $errStack]} {
- echo pppOsa [BmipResponseActionInfo firstBmip]
- }
- if {$show_psm_flag} {
- foreach psm [keylget registered_psm_osa reg] {
- set objcall [list ObjectAction [list sco $psm] [SetInstance NULL] version {}]
- set bmipResponse [SMOC $objcall]
- set firstBmip [lindex $bmipResponse 0]
- set errStack [BmipResponseErrorStack firstBmip]
- if {[lempty $errStack]} {
- echo $psm [BmipResponseActionInfo firstBmip]
- }
- }
- }
- return
- }
- if {$show_psm_flag} {
- foreach field {add mod del reg} {
- echo "$field [keylget registered_psm_osa $field]"
- }
- return
- }
- if {$debug_log_flag && ![cequal $managedHost [SaHostGetLocalName]]} {
- set objcall [list ObjectAction {sco ppp} [SetInstance NULL] debug 1]
- set bmipResponse [SMOC $objcall]
- }
- pppGUI
- VtMainLoop
- }
- ##################################################
- loadlibindex /usr/lib/sysadm.tlib
- loadlibindex /usr/lib/netadm.tlib
- loadlibindex /usr/lib/ppp/pppadm.tlib
- ErrorTopLevelCatch pppGUIMain [ILM SCO_PPP_MSG_SHORT_TITLE]
-