home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / update701 / root.13 / usr / lib / scoadmin / ppp / pppGUI / pppGUI
Encoding:
Text File  |  1998-08-18  |  222.8 KB  |  7,415 lines

  1. #!/bin/osavtcl
  2. # Copyright (c) 1992-1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  3. #                                                                         
  4. #        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  5. #                   SANTA CRUZ OPERATION INC.                             
  6. #                                                                         
  7. #   The copyright notice above does not evidence any actual or intended   
  8. #   publication of such source code.                                      
  9.  
  10. #******************************************************************************
  11. #
  12. #    Copyright (C) 1992-1998 The Santa Cruz Operation, Inc.
  13. #        All Rights Reserved.
  14. #
  15. #    The information in this file is provided for the exclusive use of
  16. #    the licensees of The Santa Cruz Operation, Inc.  Such users have the
  17. #    right to use, modify, and incorporate this code into other products
  18. #    for purposes authorized by the license agreement provided they include
  19. #    this notice and the associated copyright notice with any such product.
  20. #    The information in this file is provided "AS IS" without warranty.
  21. #
  22. #===============================================================================
  23. #@package: SCO_PPP_MSGS SCO_PPP_MSGS
  24. proc SCO_PPP_MSGS {} {}
  25. global SCO_PPP_MSGS
  26. set SCO_PPP_MSGS(@catalog@) {ppp.cat@sa 1}
  27. set SCO_PPP_MSGS(MSG_SHORT_TITLE) {1 {PPP Manager}}
  28. set SCO_PPP_MSGS(MSG_TITLE) {2 {PPP Manager on %1$s}}
  29. set SCO_PPP_MSGS(MSG_PROMPT) {3 {PPP configuration on %1$s:}}
  30. set SCO_PPP_MSGS(MSG_PDHOST) {4 Host}
  31. set SCO_PPP_MSGS(MSG_MN_PDHOST) {5 t}
  32. set SCO_PPP_MSGS(MSG_PBOPEN) {6 {Open Host...}}
  33. set SCO_PPP_MSGS(MSG_MN_PBOPEN) {7 O}
  34. set SCO_PPP_MSGS(MSG_SH_PBOPEN) {8 {Open manager on another host}}
  35. set SCO_PPP_MSGS(MSG_PBEXIT) {9 Exit}
  36. set SCO_PPP_MSGS(MSG_MN_PBEXIT) {10 x}
  37. set SCO_PPP_MSGS(MSG_SH_PBEXIT) {11 {Exit manager}}
  38. set SCO_PPP_MSGS(MSG_PDOPTIONS) {12 Options}
  39. set SCO_PPP_MSGS(MSG_MN_PDOPTIONS) {13 O}
  40. set SCO_PPP_MSGS(MSG_HDR_DL_BUNDLE) {14 Bundles}
  41. set SCO_PPP_MSGS(MSG_HDR_DL_LINK) {15 {Link Groups}}
  42. set SCO_PPP_MSGS(MSG_HDR_DL_AUTH) {16 {PPP Authentication}}
  43. set SCO_PPP_MSGS(MSG_MN_PDVIEW) {17 V}
  44. set SCO_PPP_MSGS(MSG_PDVIEW) {18 View}
  45. set SCO_PPP_MSGS(MSG_FTDVIEW) {19 View}
  46. set SCO_PPP_MSGS(MSG_MN_FTDVIEW) {20 V}
  47. set SCO_PPP_MSGS(MSG_MN_TBVIEW_AUTHS) {21 A}
  48. set SCO_PPP_MSGS(MSG_MN_TBVIEW_LINKS) {22 L}
  49. set SCO_PPP_MSGS(MSG_MN_TBVIEW_BUNDLES) {23 B}
  50. set SCO_PPP_MSGS(MSG_SH_TBVIEW_AUTHS) {24 {View the authentication database}}
  51. set SCO_PPP_MSGS(MSG_SH_TBVIEW_LINKS) {25 {View configured link groups}}
  52. set SCO_PPP_MSGS(MSG_SH_TBVIEW_BUNDLES) {26 {View configured bundles}}
  53. set SCO_PPP_MSGS(MSG_TBVIEW_AUTHS) {27 Authentication}
  54. set SCO_PPP_MSGS(MSG_TBVIEW_LINKS) {28 {Link Groups}}
  55. set SCO_PPP_MSGS(MSG_TBVIEW_BUNDLES) {29 Bundles}
  56. set SCO_PPP_MSGS(MSG_MN_PBVIEW_COLLAPSE) {30 C}
  57. set SCO_PPP_MSGS(MSG_MN_PBVIEW_COLLAPSEALL) {31 p}
  58. set SCO_PPP_MSGS(MSG_MN_PBVIEW_EXPAND) {32 E}
  59. set SCO_PPP_MSGS(MSG_MN_PBVIEW_EXPANDALL) {33 n}
  60. set SCO_PPP_MSGS(MSG_PBVIEW_COLLAPSE) {34 {Collapse Selected}}
  61. set SCO_PPP_MSGS(MSG_PBVIEW_COLLAPSEALL) {35 {Collapse All}}
  62. set SCO_PPP_MSGS(MSG_PBVIEW_EXPAND) {36 {Expand Selected}}
  63. set SCO_PPP_MSGS(MSG_PBVIEW_EXPANDALL) {37 {Expand All}}
  64. set SCO_PPP_MSGS(MSG_SH_PBVIEW_COLLAPSE) {38 {Collapse selected item}}
  65. set SCO_PPP_MSGS(MSG_SH_PBVIEW_COLLAPSEALL) {39 {Collapse all groups}}
  66. set SCO_PPP_MSGS(MSG_SH_PBVIEW_EXPAND) {40 {Expand selected item}}
  67. set SCO_PPP_MSGS(MSG_SH_PBVIEW_EXPANDALL) {41 {Expand all groups}}
  68. set SCO_PPP_MSGS(MSG_SB_INIT) {42 {Initializing manager...}}
  69. set SCO_PPP_MSGS(MSG_SB_READING) {43 {Reading configuration...}}
  70. set SCO_PPP_MSGS(MSG_SB_VERIFYING) {44 {Verifying configuration...}}
  71. set SCO_PPP_MSGS(MSG_SB_WRITING) {45 {Writing configuration...}}
  72. set SCO_PPP_MSGS(ERR_ONLY_ONE_PPP) {46 {The PPP Manager is already running}}
  73. set SCO_PPP_MSGS(ERR_ONLY_ONE_PIC) {47 {There is already a PPP Manager running.\n\nExit running PPP managers to continue.}}
  74. set SCO_PPP_MSGS(MSG_CICON_O) {48 out}
  75. set SCO_PPP_MSGS(MSG_CICON_I) {49 in}
  76. set SCO_PPP_MSGS(MSG_CICON_B) {50 bundle}
  77. set SCO_PPP_MSGS(MSG_CICON_BG) {51 BG}
  78. set SCO_PPP_MSGS(MSG_CICON_A) {52 name}
  79. set SCO_PPP_MSGS(MSG_CICON_L) {53 link}
  80. set SCO_PPP_MSGS(MSG_CICON_LG) {54 {link group}}
  81. set SCO_PPP_MSGS(MSG_CICON_IO) {55 bi-directional}
  82. set SCO_PPP_MSGS(MSG_CICON_AL) {56 AL}
  83. set SCO_PPP_MSGS(MSG_CICON_NP) {57 {network protocol}}
  84. set SCO_PPP_MSGS(MSG_CICON_LP) {58 {link protocol}}
  85. set SCO_PPP_MSGS(MSG_CICON_PA) {59 P}
  86. set SCO_PPP_MSGS(MSG_MN_PBDELETE) {60 D}
  87. set SCO_PPP_MSGS(MSG_MN_PBMODIFY) {61 M}
  88. set SCO_PPP_MSGS(MSG_MN_PDADD) {62 A}
  89. set SCO_PPP_MSGS(MSG_MN_PDEDIT) {63 E}
  90. set SCO_PPP_MSGS(MSG_PBDELETE) {64 Delete}
  91. set SCO_PPP_MSGS(MSG_PBMODIFY) {65 Modify...}
  92. set SCO_PPP_MSGS(MSG_PDADD) {66 Add}
  93. set SCO_PPP_MSGS(MSG_PDEDIT) {67 Edit}
  94. set SCO_PPP_MSGS(MSG_SH_PBDELETE) {68 {Deleted selected entry}}
  95. set SCO_PPP_MSGS(MSG_SH_PBMODIFY) {69 {Modify selected entry}}
  96. set SCO_PPP_MSGS(MSG_AUTH_BOTH) {70 {CHAP & PAP}}
  97. set SCO_PPP_MSGS(MSG_AUTH_CHAP) {71 CHAP}
  98. set SCO_PPP_MSGS(MSG_AUTH_CHAP_PEERSECRET) {72 {CHAP remote secret:}}
  99. set SCO_PPP_MSGS(MSG_AUTH_NAME) {73 {Authentication name:}}
  100. set SCO_PPP_MSGS(MSG_AUTH_PAP) {74 PAP}
  101. set SCO_PPP_MSGS(MSG_AUTH_PAP_PEERSECRET) {75 {PAP remote secret:}}
  102. set SCO_PPP_MSGS(MSG_TITLE_AUTH_ADD) {76 {Add PPP Authentication}}
  103. set SCO_PPP_MSGS(MSG_TITLE_AUTH_MOD) {77 {Modify PPP Authentication}}
  104. set SCO_PPP_MSGS(MSG_SH_AUTH_BOTH) {78 {Provide secrets for both CHAP and PAP}}
  105. set SCO_PPP_MSGS(MSG_SH_AUTH_CHAP) {79 {Provide secrets for CHAP only}}
  106. set SCO_PPP_MSGS(MSG_SH_AUTH_CHAP_PEERSECRET) {80 {CHAP secret when authenticated by remote}}
  107. set SCO_PPP_MSGS(MSG_SH_AUTH_NAME) {81 {Database look-up name}}
  108. set SCO_PPP_MSGS(MSG_SH_AUTH_PAP) {82 {Provide secrets for PAP only}}
  109. set SCO_PPP_MSGS(MSG_SH_AUTH_PAP_PEERSECRET) {83 {PAP secret when authenticated by remote}}
  110. set SCO_PPP_MSGS(MSG_AUTH_APROTOCOL) {84 {Authentication protocol:}}
  111. set SCO_PPP_MSGS(MSG_LINKS_NAME) {85 {Link group name:}}
  112. set SCO_PPP_MSGS(MSG_TITLE_LINKS_ADD) {86 {Add Link Group}}
  113. set SCO_PPP_MSGS(MSG_TITLE_LINKS_MOD) {87 {Modify Link Group}}
  114. set SCO_PPP_MSGS(MSG_SH_LINKS_NAME) {88 {Name of link group}}
  115. set SCO_PPP_MSGS(ERR_LINKS_NAME_CREATE) {89 {Failed to create link group}}
  116. set SCO_PPP_MSGS(ERR_LINKS_NAME_DUPLICATE) {90 {Link group already exists}}
  117. set SCO_PPP_MSGS(ERR_LINKS_NAME_NULL) {91 {Link group name must be supplied}}
  118. set SCO_PPP_MSGS(MSG_CONFIRM_DELETE) {92 {Are you sure you want to delete the selected item?}}
  119. set SCO_PPP_MSGS(MSG_LINKS_FLOW) {93 {Flow control:}}
  120. set SCO_PPP_MSGS(MSG_LINKS_FLOW_HARDWARE) {94 Hardware}
  121. set SCO_PPP_MSGS(MSG_LINKS_FLOW_NONE) {95 None}
  122. set SCO_PPP_MSGS(MSG_LINKS_FLOW_SOFTWARE) {96 Software}
  123. set SCO_PPP_MSGS(MSG_LINKS_PHONE) {97 {Advertised phone number:}}
  124. set SCO_PPP_MSGS(MSG_LINKS_TYPES) {98 {Group link type:}}
  125. set SCO_PPP_MSGS(MSG_LINKS_TYPES_ACU) {99 {Modem (ACU)}}
  126. set SCO_PPP_MSGS(MSG_LINKS_TYPES_DIRECT) {100 Direct}
  127. set SCO_PPP_MSGS(MSG_LINKS_TYPES_ISDN_ASYNC) {101 {ISDN (async)}}
  128. set SCO_PPP_MSGS(MSG_LINKS_TYPES_ISDN_SYNC) {102 {ISDN (sync)}}
  129. set SCO_PPP_MSGS(MSG_SH_LINKS_FLOW_HARDWARE) {103 {Use hardware flow control}}
  130. set SCO_PPP_MSGS(MSG_SH_LINKS_FLOW_NONE) {104 {No flow control}}
  131. set SCO_PPP_MSGS(MSG_SH_LINKS_FLOW_SOFTWARE) {105 {Use software flow control}}
  132. set SCO_PPP_MSGS(MSG_SH_LINKS_MAXLINKS) {106 {Maximum number of concurrent links in multilink}}
  133. set SCO_PPP_MSGS(MSG_SH_LINKS_PHONE) {107 {Advertised phone number to access the links}}
  134. set SCO_PPP_MSGS(MSG_SH_LINKS_TYPES) {108 {Link group type}}
  135. set SCO_PPP_MSGS(MSG_SH_LINKS_TYPES_ACU) {109 {Link group will contain only modem links}}
  136. set SCO_PPP_MSGS(MSG_SH_LINKS_TYPES_DIRECT) {110 {Link group will contain static connections}}
  137. set SCO_PPP_MSGS(MSG_SH_LINKS_TYPES_ISDN_ASYNC) {111 {Link group will contain asynchronous ISDN links}}
  138. set SCO_PPP_MSGS(MSG_SH_LINKS_TYPES_ISDN_SYNC) {112 {Link group will contain synchronous ISDN links}}
  139. set SCO_PPP_MSGS(MSG_SH_LINKS_FLOW) {113 {Flow control used by link group}}
  140. set SCO_PPP_MSGS(MSG_LINKS_BANDWIDTH) {114 {Estimate of single link bandwidth:}}
  141. set SCO_PPP_MSGS(MSG_LINKS_AVAIL) {115 {Available links}}
  142. set SCO_PPP_MSGS(MSG_LINKS_SEL) {116 {Selected links}}
  143. set SCO_PPP_MSGS(MSG_LINK_ADD) {117 {Add >>}}
  144. set SCO_PPP_MSGS(MSG_LINK_REMOVE) {118 {<< Remove}}
  145. set SCO_PPP_MSGS(MSG_TITLE_LINK_ADD) {119 {Add Links}}
  146. set SCO_PPP_MSGS(MSG_TITLE_LINK_MOD) {120 {Modify Links}}
  147. set SCO_PPP_MSGS(MSG_SH_LINKS_AVAIL) {121 {List of links available for use within the link group}}
  148. set SCO_PPP_MSGS(MSG_SH_LINKS_SEL) {122 {List of links selected for use within the link group}}
  149. set SCO_PPP_MSGS(MSG_SH_LINK_ADD) {123 {Add link to selected list of links}}
  150. set SCO_PPP_MSGS(MSG_SH_LINK_REMOVE) {124 {Remove link from selected list of links}}
  151. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_AUTHNAME) {125 {Override name for transmitted CHAP/PAP packets:}}
  152. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_PEERAUTHNAME) {126 {Override name for received CHAP/PAP packets:}}
  153. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_AUTHTMOUT) {127 {Time allowed for authentication phase:}}
  154. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_ED) {128 {Offer endpoint discrimination on incoming links:}}
  155. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_MRRU) {129 {MRRU offered on incoming links:}}
  156. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_ED_NO) {130 No}
  157. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_ED_YES) {131 Yes}
  158. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_CHAP) {132 {Authenticate remote using CHAP:}}
  159. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_CHAP_NO) {133 No}
  160. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_CHAP_YES) {134 Yes}
  161. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_PAP) {135 {Authenticate remote using PAP:}}
  162. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_PAP_NO) {136 No}
  163. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_REQUIRE_PAP_YES) {137 Yes}
  164. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_SSN_NO) {138 No}
  165. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_SSN_YES) {139 Yes}
  166. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_SSN) {140 {Offer short sequence numbers on incoming links:}}
  167. set SCO_PPP_MSGS(MSG_TITLE_GLOBAL_BUNDLE) {141 {Global Bundle Parameters}}
  168. set SCO_PPP_MSGS(MSG_MN_PBGLOBAL_BUNDLE) {142 G}
  169. set SCO_PPP_MSGS(MSG_PBGLOBAL_BUNDLE) {143 {Global Bundle...}}
  170. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_AUTHTMOUT) {144 {Time allowed for authentication phase to complete in seconds}}
  171. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_MRRU) {145 {Offered maximum received reconstructed unit in bytes}}
  172. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_AUTHNAME) {146 {Authentication name to override transmitted authentication packets}}
  173. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_PEERAUTHNAME) {147 {Authentication name to override received authentication packets.}}
  174. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_ED_NO) {148 {Do not offer endpoint discriminator}}
  175. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_ED_YES) {149 {Offer endpoint discriminator}}
  176. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_SSN_NO) {150 {Do not offer short sequence numbers}}
  177. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_SSN_YES) {151 {Offer short sequence numbers}}
  178. set SCO_PPP_MSGS(MSG_SH_PBGLOBAL_BUNDLE) {152 {Global bundle values}}
  179. set SCO_PPP_MSGS(ERR_GLOBAL_BUNDLE_CREATE) {153 {Failed to create global bundle values}}
  180. set SCO_PPP_MSGS(ERR_GLOBAL_BUNDLE_REPLACE) {154 {Failed to change global bundle values}}
  181. set SCO_PPP_MSGS(MSG_BUNDLE_ED) {155 {Use endpoint discrimination:}}
  182. set SCO_PPP_MSGS(MSG_BUNDLE_MRRU) {156 {Maximum received reconstructed unit size:}}
  183. set SCO_PPP_MSGS(MSG_BUNDLE_ED_NO) {157 No}
  184. set SCO_PPP_MSGS(MSG_BUNDLE_ED_YES) {158 Yes}
  185. set SCO_PPP_MSGS(MSG_BUNDLE_SSN_NO) {159 No}
  186. set SCO_PPP_MSGS(MSG_BUNDLE_SSN_YES) {160 Yes}
  187. set SCO_PPP_MSGS(MSG_BUNDLE_SSN) {161 {Use short sequence numbers:}}
  188. set SCO_PPP_MSGS(MSG_SH_BUNDLE_MRRU) {162 {Maximum received reconstructed unit in bytes}}
  189. set SCO_PPP_MSGS(MSG_SH_BUNDLE_ED_NO) {163 {Do not use endpoint discrimination}}
  190. set SCO_PPP_MSGS(MSG_SH_BUNDLE_ED_YES) {164 {Use endpoint discrimination}}
  191. set SCO_PPP_MSGS(MSG_SH_BUNDLE_SSN_NO) {165 {Do not use short sequence numbers}}
  192. set SCO_PPP_MSGS(MSG_SH_BUNDLE_SSN_YES) {166 {Use short sequence numbers}}
  193. set SCO_PPP_MSGS(MSG_BUNDLE_ADDLOAD) {167 {Load when links are added:}}
  194. set SCO_PPP_MSGS(MSG_BUNDLE_ADDSAMPLE) {168 {Sample period for link additions:}}
  195. set SCO_PPP_MSGS(MSG_BUNDLE_BOD) {169 {Bandwidth on demand:}}
  196. set SCO_PPP_MSGS(MSG_BUNDLE_DROPLOAD) {170 {Load when links are removed:}}
  197. set SCO_PPP_MSGS(MSG_BUNDLE_DROPSAMPLE) {171 {Sample period for link removals:}}
  198. set SCO_PPP_MSGS(MSG_BUNDLE_MAXFRAGS) {172 {Maximum number of pending fragments:}}
  199. set SCO_PPP_MSGS(MSG_BUNDLE_MAXIDLE) {173 {Inactivity timeout:}}
  200. set SCO_PPP_MSGS(MSG_BUNDLE_MINFRAG) {174 {Packet size at which packet fragmentation starts:}}
  201. set SCO_PPP_MSGS(MSG_BUNDLE_THRASHTIME) {175 {Minimum period between bandwidth changes:}}
  202. set SCO_PPP_MSGS(MSG_SH_BUNDLE_ADDLOAD) {176 {Percentage of load at which new links are added}}
  203. set SCO_PPP_MSGS(MSG_SH_BUNDLE_ADDSAMPLE) {177 {Time in seconds over which the load average for link additions is calculated}}
  204. set SCO_PPP_MSGS(MSG_SH_BUNDLE_DROPLOAD) {178 {Percentage of load at which existing links are removed}}
  205. set SCO_PPP_MSGS(MSG_SH_BUNDLE_DROPSAMPLE) {179 {Time in seconds over which the load average for link removals calculated}}
  206. set SCO_PPP_MSGS(MSG_SH_BUNDLE_MAXFRAGS) {180 {Maximum number of pending fragments awaiting assembly per active link}}
  207. set SCO_PPP_MSGS(MSG_SH_BUNDLE_MAXIDLE) {181 {Time in seconds of no activity before bundle is assumed inactive}}
  208. set SCO_PPP_MSGS(MSG_SH_BUNDLE_MINFRAG) {182 {Packets with a size in bytes less than this value will not be fragmented}}
  209. set SCO_PPP_MSGS(MSG_SH_BUNDLE_THRASHTIME) {183 {Minimum time in seconds between link additions and link removals}}
  210. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_REQUIRE_CHAP_NO) {184 {Remote system need not authenticate using CHAP}}
  211. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_REQUIRE_CHAP_YES) {185 {Remote system must authenticate using CHAP}}
  212. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_REQUIRE_PAP_NO) {186 {Remote system need not authenticate using PAP}}
  213. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_REQUIRE_PAP_YES) {187 {Remote system must authenticate using PAP}}
  214. set SCO_PPP_MSGS(MSG_SH_BUNDLE_BOD) {188 {Bandwidth on demand enabled for call initiator}}
  215. set SCO_PPP_MSGS(MSG_BOD_NONE) {189 none}
  216. set SCO_PPP_MSGS(MSG_BOD_ANY) {190 {incoming & outgoing initiated calls}}
  217. set SCO_PPP_MSGS(MSG_BOD_IN) {191 {incoming initiated calls only}}
  218. set SCO_PPP_MSGS(MSG_BOD_OUT) {192 {outgoing initiated calls only}}
  219. set SCO_PPP_MSGS(MSG_BUNDLE_FT_BOD) {193 Bandwidth}
  220. set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_BOD) {194 {Bandwidth on demand parameters}}
  221. set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_BOD) {195 {Bandwidth on demand parameters:}}
  222. set SCO_PPP_MSGS(MSG_BUNDLE_CALLERID) {196 {Caller ID:}}
  223. set SCO_PPP_MSGS(MSG_BUNDLE_LOGIN) {197 {Login user name:}}
  224. set SCO_PPP_MSGS(MSG_SH_BUNDLE_CALLERID) {198 {Caller's identity contained in call information}}
  225. set SCO_PPP_MSGS(MSG_SH_BUNDLE_LOGIN) {199 {Caller's identity when logging in through PPP shell}}
  226. set SCO_PPP_MSGS(MSG_NPROTOCOLS) {200 {Network protocols:}}
  227. set SCO_PPP_MSGS(MSG_BUNDLE_FT_NPROTOCOLS) {201 {Network Protocols}}
  228. set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_NPROTOCOLS) {202 {Available network protocols}}
  229. set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_NPROTOCOLS) {203 {Network protocols available:}}
  230. set SCO_PPP_MSGS(MSG_SH_NPROTOCOLS) {204 {Network protocols available for inclusion in bundle}}
  231. set SCO_PPP_MSGS(MSG_LINK_FT_LPROTOCOLS) {205 {Link Protocols}}
  232. set SCO_PPP_MSGS(MSG_TITLE_LINK_FT_LPROTOCOLS) {206 {Link protocols available:}}
  233. set SCO_PPP_MSGS(MSG_SH_LINK_FT_LPROTOCOLS) {207 {Available link protocols}}
  234. set SCO_PPP_MSGS(MSG_BUNDLE_FT_LPROTOCOLS) {208 {Link Protocols}}
  235. set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_LPROTOCOLS) {209 {Link protocols available:}}
  236. set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_LPROTOCOLS) {210 {Available link protocols}}
  237. set SCO_PPP_MSGS(MSG_LPROTOCOLS) {211 {Link protocols:}}
  238. set SCO_PPP_MSGS(MSG_SH_BUNDLE_LPROTOCOLS) {212 {Link protocols available for inclusion in bundle}}
  239. set SCO_PPP_MSGS(MSG_SH_LINKS_LPROTOCOLS) {213 {Link protocols available for inclusion in link group}}
  240. set SCO_PPP_MSGS(ERR_NPROTOCOLS_ONE_SELECTED) {214 {At least one network protocol must be selected}}
  241. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_FT_AUTH) {215 Authentication}
  242. set SCO_PPP_MSGS(MSG_GLOBAL_BUNDLE_FT_MULTILINK) {216 Multilink}
  243. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_FT_AUTH) {217 {Authentication parameters}}
  244. set SCO_PPP_MSGS(MSG_SH_GLOBAL_BUNDLE_FT_MULTILINK) {218 {Multilink parameters}}
  245. set SCO_PPP_MSGS(MSG_TITLE_GLOBAL_BUNDLE_FT_AUTH) {219 {Authentication parameters:}}
  246. set SCO_PPP_MSGS(MSG_TITLE_GLOBAL_BUNDLE_FT_MULTILINK) {220 {Multilink parameters:}}
  247. set SCO_PPP_MSGS(ERR_BUNDLE_CREATE) {221 {Failed to create bundle entry}}
  248. set SCO_PPP_MSGS(ERR_BUNDLE_NAME_EXIST) {222 {Bundle name already exists}}
  249. set SCO_PPP_MSGS(ERR_BUNDLE_NAME_NULL) {223 {Bundle name must be supplied}}
  250. set SCO_PPP_MSGS(ERR_BUNDLE_REMOTESYS_NULL) {224 {Remote system name must be supplied}}
  251. set SCO_PPP_MSGS(ERR_BUNDLE_RENAME) {225 {Failed to rename bundle entry}}
  252. set SCO_PPP_MSGS(ERR_BUNDLE_REPLACE) {226 {Failed to change bundle entry}}
  253. set SCO_PPP_MSGS(MSG_BRINGUP_AUTOMATIC) {227 {automatically (on demand)}}
  254. set SCO_PPP_MSGS(MSG_BRINGUP_MANUAL) {228 {manually (via pppattach)}}
  255. set SCO_PPP_MSGS(MSG_BUNDLE_AUTHTMOUT) {229 {Time allowed for authentication phase:}}
  256. set SCO_PPP_MSGS(MSG_BUNDLE_BRINGUP) {230 {Method of initiating links:}}
  257. set SCO_PPP_MSGS(MSG_BUNDLE_FT_AUTH) {231 Authentication}
  258. set SCO_PPP_MSGS(MSG_BUNDLE_FT_MULTILINK) {232 Multilink}
  259. set SCO_PPP_MSGS(MSG_BUNDLE_FT_BUNDLE) {233 Bundle}
  260. set SCO_PPP_MSGS(MSG_BUNDLE_MAXLINKS) {234 {Maximum number of active links:}}
  261. set SCO_PPP_MSGS(MSG_BUNDLE_MINLINKS) {235 {Minimum number of active links:}}
  262. set SCO_PPP_MSGS(MSG_BUNDLE_NAME) {236 {Bundle name:}}
  263. set SCO_PPP_MSGS(MSG_BUNDLE_AUTHNAME) {237 {Override name for transmitted CHAP/PAP packets:}}
  264. set SCO_PPP_MSGS(MSG_BUNDLE_PEERAUTHNAME) {238 {Override name for received CHAP/PAP packets:}}
  265. set SCO_PPP_MSGS(MSG_BUNDLE_REMOTESYS) {239 {Remote system name:}}
  266. set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_CHAP) {240 {Require remote to authenticate using CHAP:}}
  267. set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_CHAP_NO) {241 No}
  268. set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_CHAP_YES) {242 Yes}
  269. set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_PAP) {243 {Require remote to authenticate using PAP:}}
  270. set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_PAP_NO) {244 No}
  271. set SCO_PPP_MSGS(MSG_BUNDLE_REQUIRE_PAP_YES) {245 Yes}
  272. set SCO_PPP_MSGS(MSG_SH_BUNDLE_AUTHTMOUT) {246 {Time allowed for authentication phase to complete in seconds}}
  273. set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_AUTH) {247 {Authentication parameters}}
  274. set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_MULTILINK) {248 {Multilink parameters}}
  275. set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_BUNDLE) {249 {Bundle parameters}}
  276. set SCO_PPP_MSGS(MSG_SH_BUNDLE_MAXLINKS) {250 {Maximum number of active links allowed}}
  277. set SCO_PPP_MSGS(MSG_SH_BUNDLE_MINLINKS) {251 {Minimum number of links to keep active when removing links}}
  278. set SCO_PPP_MSGS(MSG_SH_BUNDLE_NAME) {252 {Name of bundle}}
  279. set SCO_PPP_MSGS(MSG_SH_BUNDLE_AUTHNAME) {253 {Authentication name to override transmitted authentication packets}}
  280. set SCO_PPP_MSGS(MSG_SH_BUNDLE_PEERAUTHNAME) {254 {Authentication name to override received authentication packets}}
  281. set SCO_PPP_MSGS(MSG_SH_BUNDLE_REMOTESYS) {255 {Remote system name to dial up}}
  282. set SCO_PPP_MSGS(MSG_SH_BUNDLE_REQUIRE_CHAP_NO) {256 {Remote system need not authenticate using CHAP}}
  283. set SCO_PPP_MSGS(MSG_SH_BUNDLE_REQUIRE_CHAP_YES) {257 {Remote system must authenticate using CHAP}}
  284. set SCO_PPP_MSGS(MSG_SH_BUNDLE_REQUIRE_PAP_NO) {258 {Remote system need not authenticate using PAP}}
  285. set SCO_PPP_MSGS(MSG_SH_BUNDLE_REQUIRE_PAP_YES) {259 {Remote system must authenticate using PAP}}
  286. set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_ADD) {260 {Add Bundle}}
  287. set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_MOD) {261 {Modify Bundle}}
  288. set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_AUTH) {262 {Authentication parameters:}}
  289. set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_MULTILINK) {263 {Multilink parameters:}}
  290. set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_BUNDLE) {264 {Bundle parameters:}}
  291. set SCO_PPP_MSGS(MSG_LGS_AVAIL) {265 {Available link groups}}
  292. set SCO_PPP_MSGS(MSG_LGS_SEL) {266 {Selected link groups}}
  293. set SCO_PPP_MSGS(MSG_LG_ADD) {267 {Add >>}}
  294. set SCO_PPP_MSGS(MSG_LG_REMOVE) {268 {<< Remove}}
  295. set SCO_PPP_MSGS(MSG_SH_LGS_AVAIL) {269 {Link groups available}}
  296. set SCO_PPP_MSGS(MSG_SH_LGS_SEL) {270 {Link groups selected}}
  297. set SCO_PPP_MSGS(MSG_SH_LG_ADD) {271 {Add link group to selected list}}
  298. set SCO_PPP_MSGS(MSG_SH_LG_REMOVE) {272 {Remove link group from selected list}}
  299. set SCO_PPP_MSGS(MSG_TITLE_LG_ADD) {273 {Add Links}}
  300. set SCO_PPP_MSGS(MSG_TITLE_LG_MOD) {274 {Modify Links}}
  301. set SCO_PPP_MSGS(ERR_LG_DELETE) {275 {Failed to remove link group entry}}
  302. set SCO_PPP_MSGS(ERR_LG_REPLACE) {276 {Failed to replace link group entry}}
  303. set SCO_PPP_MSGS(ERR_BUNDLE_DELETE) {277 {Failed to delete bundle entry}}
  304. set SCO_PPP_MSGS(ERR_PROTOCOL_DELETE) {278 {Failed to delete protocol entry}}
  305. set SCO_PPP_MSGS(ERR_PROTOCOL_NETWORK_ONE) {279 {Deleting the last network protocol is not permitted}}
  306. set SCO_PPP_MSGS(MSG_LINKS_POP) {280 {Modules popped before use:}}
  307. set SCO_PPP_MSGS(MSG_LINKS_PUSH) {281 {Modules pushed before use:}}
  308. set SCO_PPP_MSGS(MSG_SH_LINKS_POP) {282 {Streams modules that must be removed before use by PPP}}
  309. set SCO_PPP_MSGS(MSG_SH_LINKS_PUSH) {283 {Streams modules that must be added before use by PPP}}
  310. set SCO_PPP_MSGS(MSG_BUNDLE_FT_ADVANCED) {284 Advanced}
  311. set SCO_PPP_MSGS(MSG_SH_BUNDLE_FT_ADVANCED) {285 {Advanced parameters}}
  312. set SCO_PPP_MSGS(MSG_TITLE_BUNDLE_FT_ADVANCED) {286 {Advanced parameters:}}
  313. set SCO_PPP_MSGS(MSG_LINK_FT_ADVANCED) {287 Advanced}
  314. set SCO_PPP_MSGS(MSG_SH_LINK_FT_ADVANCED) {288 {Advanced parameters}}
  315. set SCO_PPP_MSGS(MSG_TITLE_LINK_FT_ADVANCED) {289 {Advanced parameters:}}
  316. set SCO_PPP_MSGS(ERR_LINKS_DELETE) {290 {Failed to delete link group entry}}
  317. set SCO_PPP_MSGS(ERR_PROTOCOL_LCP_DELETE) {291 {Deleting the LCP protocol entry is not permitted}}
  318. set SCO_PPP_MSGS(ERR_PROTOCOL_LCP_DESELECT) {292 {The LCP protocol must always be selected}}
  319. set SCO_PPP_MSGS(ERR_PROTOCOL_REPLACE) {293 {Failed to replace protocol entry}}
  320. set SCO_PPP_MSGS(MSG_FT_LINKS) {294 {Link Group}}
  321. set SCO_PPP_MSGS(MSG_SH_FT_LINKS) {295 {Link group parameters}}
  322. set SCO_PPP_MSGS(MSG_TITLE_FT_LINKS) {296 {Link group parameters:}}
  323. set SCO_PPP_MSGS(MSG_FILE_SEL) {297 {Select File}}
  324. set SCO_PPP_MSGS(ERR_GUI_NOT_FOUND) {298 {The manager required for this option is not available}}
  325. set SCO_PPP_MSGS(ERR_GUI_FAILED) {299 {The SCOadmin manager required for this option is unavailable}}
  326. set SCO_PPP_MSGS(ERR_BUNDLE_LOGIN_NULL) {300 {Login name must be supplied if not auto detecting PPP session}}
  327. set SCO_PPP_MSGS(MSG_BUNDLE_AUTO_DETECT) {301 {Use auto-detected PPP session:}}
  328. set SCO_PPP_MSGS(MSG_BUNDLE_AUTO_DETECT_NO) {302 No}
  329. set SCO_PPP_MSGS(MSG_BUNDLE_AUTO_DETECT_YES) {303 Yes}
  330. set SCO_PPP_MSGS(MSG_SH_BUNDLE_AUTO_DETECT_NO) {304 {Caller must log in}}
  331. set SCO_PPP_MSGS(MSG_SH_BUNDLE_AUTO_DETECT_YES) {305 {Caller is automatically detected via caller ID and authentication ID}}
  332. set SCO_PPP_MSGS(MSG_TITLE_LPROTOCOLS_ADD) {306 {Add Link Protocols}}
  333. set SCO_PPP_MSGS(MSG_TITLE_LPROTOCOLS_MOD) {307 {Modify Link Protocols}}
  334. set SCO_PPP_MSGS(MSG_TITLE_NPROTOCOLS_ADD) {308 {Add Network Protocols}}
  335. set SCO_PPP_MSGS(MSG_TITLE_NPROTOCOLS_MOD) {309 {Modify Network Protocols}}
  336. set SCO_PPP_MSGS(ERR_PROTOCOL_CREATE) {310 {Failed to create protocol entry}}
  337. set SCO_PPP_MSGS(ERR_PROTOCOL_FAILED) {311 {Unable to change protocol entry}}
  338. set SCO_PPP_MSGS(MSG_PROTOCOL_DIALOG_BUILD) {312 {Building protocol dialog...}}
  339. set SCO_PPP_MSGS(ERR_LINKS_CREATE) {313 {Failed to create link group entry}}
  340. set SCO_PPP_MSGS(MSG_MN_PBAUTH_ADD_NAME) {314 N}
  341. set SCO_PPP_MSGS(MSG_MN_PBBUNDLES_ADD_BUNDLE) {315 B}
  342. set SCO_PPP_MSGS(MSG_MN_PBBUNDLES_ADD_LG) {316 G}
  343. set SCO_PPP_MSGS(MSG_MN_PBBUNDLES_ADD_LP) {317 L}
  344. set SCO_PPP_MSGS(MSG_MN_PBBUNDLES_ADD_NP) {318 N}
  345. set SCO_PPP_MSGS(MSG_MN_PBLINKS_ADD_LG) {319 G}
  346. set SCO_PPP_MSGS(MSG_MN_PBLINKS_ADD_LINK) {320 i}
  347. set SCO_PPP_MSGS(MSG_MN_PBLINKS_ADD_LP) {321 L}
  348. set SCO_PPP_MSGS(MSG_PBAUTH_ADD_NAME) {322 Name...}
  349. set SCO_PPP_MSGS(MSG_PBBUNDLES_ADD_BUNDLE) {323 Bundle...}
  350. set SCO_PPP_MSGS(MSG_PBBUNDLES_ADD_LG) {324 {Link Groups...}}
  351. set SCO_PPP_MSGS(MSG_PBBUNDLES_ADD_LP) {325 {Link Protocol...}}
  352. set SCO_PPP_MSGS(MSG_PBBUNDLES_ADD_NP) {326 {Network Protocol...}}
  353. set SCO_PPP_MSGS(MSG_PBLINKS_ADD_LINK) {327 Links...}
  354. set SCO_PPP_MSGS(MSG_PBLINKS_ADD_LP) {328 {Link Protocol...}}
  355. set SCO_PPP_MSGS(MSG_PBLINLS_ADD_LG) {329 {Link Group...}}
  356. set SCO_PPP_MSGS(MSG_CICON_D) {330 disabled}
  357. set SCO_PPP_MSGS(MSG_BUNDLE_TYPE) {331 Type:}
  358. set SCO_PPP_MSGS(MSG_BUNDLE_TYPE_INCOMING) {332 Incoming}
  359. set SCO_PPP_MSGS(MSG_BUNDLE_TYPE_OUTGOING) {333 Outgoing}
  360. set SCO_PPP_MSGS(MSG_SH_BUNDLE_TYPE_INCOMING) {334 {Enable/disable incoming bundle connections}}
  361. set SCO_PPP_MSGS(MSG_SH_BUNDLE_TYPE_OUTGOING) {335 {Enable/disable outgoing bundle connections}}
  362. set SCO_PPP_MSGS(MSG_BUNDLE_AUTHID) {336 {Authentication ID:}}
  363. set SCO_PPP_MSGS(MSG_SH_BUNDLE_AUTHID) {337 {Bundle is used if received authentication ID matches this name}}
  364. set SCO_PPP_MSGS(MSG_SH_AUTH_CHAP_LOCALSECRET) {338 {CHAP secret when authenticating remote}}
  365. set SCO_PPP_MSGS(MSG_SH_AUTH_PAP_LOCALSECRET) {339 {PAP secret when authenticating remote}}
  366. set SCO_PPP_MSGS(MSG_AUTH_CHAP_LOCALSECRET) {340 {CHAP local secret:}}
  367. set SCO_PPP_MSGS(MSG_AUTH_PAP_LOCALSECRET) {341 {PAP local secret:}}
  368. set SCO_PPP_MSGS(ERR_AUTH_CHAP_CREATE) {342 {Failed to create CHAP authentication entry}}
  369. set SCO_PPP_MSGS(ERR_AUTH_CHAP_DELETE) {343 {Failed to delete CHAP authentication entry}}
  370. set SCO_PPP_MSGS(ERR_AUTH_CHAP_REPLACE) {344 {Failed to replace CHAP authentication entry}}
  371. set SCO_PPP_MSGS(ERR_AUTH_PAP_CREATE) {345 {Failed to create PAP authentication entry}}
  372. set SCO_PPP_MSGS(ERR_AUTH_PAP_DELETE) {346 {Failed to delete PAP authentication entry}}
  373. set SCO_PPP_MSGS(ERR_AUTH_PAP_REPLACE) {347 {Failed to replace PAP authentication entry}}
  374. set SCO_PPP_MSGS(ERR_AUTH_NAME_DUPLICATE) {348 {The name already exists in the authentication database}}
  375. set SCO_PPP_MSGS(ERR_AUTH_NAME_NULL) {349 {The name must be supplied}}
  376. set SCO_PPP_MSGS(MSG_VERSION) {350 {PPP Manager %s}}
  377. set SCO_PPP_MSGS(ERR_NO_DEVS) {351 {There are no devices available.\n\nUse the Network Configuration Manager to add devices.}}
  378. set SCO_PPP_MSGS(MSG_AUTO_CREATE_GROUPS) {352 {Automatically create default link groups?}}
  379. set SCO_PPP_MSGS(ERR_GET_SERVER_CONFIG) {353 {Failed to read PPP configuration.}}
  380. set SCO_PPP_MSGS(ERR_SET_SERVER_CONFIG) {354 {Failed to save PPP configuration.}}
  381. set SCO_PPP_MSGS(ERR_BUNDLE_CALLER_AUTH_NULL) {355 {One of caller ID or authentication ID must be supplied}}
  382. set SCO_PPP_MSGS(MSG_WIDGET_VALIDATE) {356 {Verifying values...}}
  383. set SCO_PPP_MSGS(MSG_WIDGET_SET_VALUES) {357 {Setting values...}}
  384. 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.}}
  385. set SCO_PPP_MSGS(MSG_AUTO_CREATE_STATUS) {359 {Creating link groups, please wait}}
  386. set SCO_PPP_MSGS(MSG_TITLE_PASSWD) {360 {Set password for PPP user %1s}}
  387. set SCO_PPP_MSGS(MSG_PASSWD1) {361 {Enter password:}}
  388. set SCO_PPP_MSGS(MSG_SH_PASSWD1) {362 {Password for PPP user}}
  389. set SCO_PPP_MSGS(MSG_PASSWD2) {363 {Confirm password:}}
  390. set SCO_PPP_MSGS(MSG_SH_PASSWD2) {364 {Confirm password for PPP user}}
  391. set SCO_PPP_MSGS(ERR_PPP_PASSWD_NOT_MATCH) {365 {The passwords entered are not the same}}
  392. set SCO_PPP_MSGS(ERR_PPP_PASSWD_SET_FAILED) {366 {Failed to set password for user %1s}}
  393. set SCO_PPP_MSGS(MSG_TIP_CREATE_BUNDLES) {367 {Create incoming and outgoing configurations\nby selecting Add Bundle from the Edit menu}}
  394. set SCO_PPP_MSGS(ERR_BUNDLE_NO_NETWORK_PROTOCOLS) {368 {No network protocols available}}
  395. set SCO_PPP_MSGS(ERR_BUNDLE_NO_LINK_PROTOCOLS) {369 {No link protocols available}}
  396. set SCO_PPP_MSGS(ERR_LINKS_NO_LINK_PROTOCOLS) {370 {No link protocols available}}
  397. set SCO_PPP_MSGS(MSG_BUNDLE_REMOTESYS_OUTGOING_EXIT) {371 {Return to PPP}}
  398. set SCO_PPP_MSGS(MSG_SH_BUNDLE_REMOTESYS_OUTGOING_EXIT) {372 {Return to the PPP manager}}
  399. set SCO_PPP_MSGS(MSG_MN_BUNDLE_REMOTESYS_OUTGOING_EXIT) {373 R}
  400. set SCO_PPP_MSGS(MSG_BUNDLE_REMOTESYS_EDIT) {374 Edit...}
  401. set SCO_PPP_MSGS(MSG_SH_BUNDLE_REMOTESYS_EDIT) {375 {Edit remote system attributes}}
  402. set SCO_PPP_MSGS(MSG_L_LINK_GROUP_UNKNOWN) {376 ?}
  403. set SCO_PPP_MSGS(MSG_L_LINK_GROUP_TYPE) {377 type}
  404. set SCO_PPP_MSGS(MSG_L_LINK_GROUP_TYPE_PSTN) {378 ACU}
  405. set SCO_PPP_MSGS(MSG_L_LINK_GROUP_TYPE_ISDN_SYNC) {379 {ISDN sync}}
  406. set SCO_PPP_MSGS(MSG_L_LINK_GROUP_TYPE_ISDN_ASYNC) {380 {ISDN async}}
  407. set SCO_PPP_MSGS(MSG_L_LINK_GROUP_TYPE_STATIC) {381 direct}
  408. set SCO_PPP_MSGS(MSG_L_LINK_GROUP_FLOW) {382 flow}
  409. set SCO_PPP_MSGS(MSG_L_LINK_GROUP_FLOW_HARDWARE) {383 hardware}
  410. set SCO_PPP_MSGS(MSG_L_LINK_GROUP_FLOW_SOFTWARE) {384 software}
  411. set SCO_PPP_MSGS(MSG_L_LINK_GROUP_FLOW_NONE) {385 none}
  412. set SCO_PPP_MSGS(MSG_L_LINK_GROUP_PHONE) {386 phone}
  413. set SCO_PPP_MSGS(MSG_L_BUNDLE_DISABLED) {387 DISABLED}
  414. set SCO_PPP_MSGS(MSG_L_BUNDLE_OUTGOING) {388 system}
  415. set SCO_PPP_MSGS(MSG_L_BUNDLE_INCOMING_LOGIN) {389 login}
  416. set SCO_PPP_MSGS(MSG_L_BUNDLE_INCOMING_CALLERID) {390 {caller ID}}
  417. set SCO_PPP_MSGS(MSG_L_BUNDLE_INCOMING_AUTHID) {391 {authentication ID}}
  418. set SCO_PPP_MSGS(MSG_L_AUTH_PROTOCOLS) {392 protocols}
  419. set SCO_PPP_MSGS(MSG_CICON_UP) {393 ^}
  420. set SCO_PPP_MSGS(ERR_NO_INTERVAL) {394 {Must specify an interval time}}
  421. set SCO_PPP_MSGS(MSG_AUTO_REFRESH_TITLE) {395 {Set Auto Refresh Interval}}
  422. set SCO_PPP_MSGS(MSG_AUTO_REFRESH_LABEL) {396 {Refresh interval (minutes):}}
  423. set SCO_PPP_MSGS(MSG_REFRESHING) {397 Refreshing...}
  424. set SCO_PPP_MSGS(MSG_PBVIEW_REFRESH_SH) {398 {Current view}}
  425. set SCO_PPP_MSGS(MSG_CICON_S) {399 S}
  426. set SCO_PPP_MSGS(MSG_TITLE_ADD) {400 Add}
  427. set SCO_PPP_MSGS(MSG_TITLE_MOD) {401 Modify}
  428. ##################################################
  429. proc dl:Globals {} {
  430.     uplevel 1 global dl_field dl_format dl_poslist dl_def dl_list dl_index \
  431.         dl_iconList dl_icon dl_visposlist dl_vislist dl_levels \
  432.         dl_charmIconList dl_extra dl_types dl_defer
  433. }
  434. proc dl:iconList {{mode ""}} {
  435.     dl:Globals
  436.     if {[cequal $mode CHARM]} {
  437.         return $dl_charmIconList
  438.     } else {
  439.         return $dl_iconList
  440.     }
  441. }
  442. proc dl:addicon {icon pixmap {iconpath ""} {charm ""}} {
  443.     dl:Globals
  444.     if {![cequal $iconpath ""] && ![cequal [csubstr $iconpath end 1] "/"]} {
  445.         set iconpath ${iconpath}/
  446.     }
  447.     if {![info exist dl_iconList]} {
  448.         set dl_iconList ""
  449.         dl:addicon CE expand.px /usr/lib/scoadmin/neticons "+"
  450.         dl:addicon CC collapse.px /usr/lib/scoadmin/neticons "-"
  451.         dl:addicon CN none.px /usr/lib/scoadmin/neticons " "
  452.     }
  453.     set dl_icon($icon) [llength $dl_iconList]
  454.     lappend dl_iconList ${iconpath}$pixmap
  455.     lappend dl_charmIconList $charm
  456. }
  457. proc dl:icon {i} {
  458.     dl:Globals
  459.     switch $i {
  460.         CT      { return CONNECT_T }
  461.         CH      { return CONNECT_H }
  462.         CI      { return CONNECT_I }
  463.         CL      { return CONNECT_L }
  464.         NI      { return NO_ICON }
  465.         default { return $dl_icon($i) }
  466.     }
  467. }
  468. proc dl:format {DL level type {formatList ""}} {
  469.     dl:Globals
  470.     if {[cequal $formatList ""]} {
  471.         set formatList $type
  472.         set type 0
  473.     }
  474.     if {![info exist dl_field(${DL},${type},$level)]} {
  475.         if {$level >= $dl_levels(${DL})} {
  476.             for {set i $dl_levels(${DL})} {$i <= $level} {incr i} {
  477.                 dl:type $DL $i 0
  478.             }
  479.             set dl_levels($DL) $i
  480.         }
  481.         dl:type $DL $level $type
  482.     }
  483.     foreach f $formatList {
  484.         lassign $f field format def
  485.         lappend dl_field(${DL},${type},$level) $field
  486.         lappend dl_format(${DL},${type},$level) $format
  487.         lappend dl_def(${DL},${type},$level) $def
  488.     }
  489.     set_add dl_types($DL) $type
  490. }
  491. proc dl:type {DL level type} {
  492.     dl:Globals
  493.     set dl_field(${DL},${type},$level) {_LEVEL _TYPE IND VIS}
  494.     set dl_format(${DL},${type},$level)  {{DATA} {DATA} {DATA} {DATA}}
  495.     set dl_def(${DL},${type},$level)  {0 0 - 0}
  496.     for {set i 0} {$i <= $level} {incr i} {
  497.         if {$dl_extra} {
  498.             if {$i == $level} {
  499.                 lappend dl_field(${DL},${type},$level) ECICON
  500.                 if {[VtInfo -charm]} {
  501.                     lappend dl_format(${DL},${type},$level)  {ICON 1 0 0}
  502.                 } else {
  503.                     lappend dl_format(${DL},${type},$level)  {ICON 1 0 0}
  504.                 }
  505.                 lappend dl_def(${DL},${type},$level)  [dl:icon NI]
  506.             } else {
  507.                 lappend dl_field(${DL},${type},$level) ECICON$i
  508.                 if {[VtInfo -charm]} {
  509.                     lappend dl_format(${DL},${type},$level)  {ICON 1 0 0}
  510.                 } else {
  511.                     lappend dl_format(${DL},${type},$level)  {ICON 1 0 0}
  512.                 }
  513.                 lappend dl_def(${DL},${type},$level)  [dl:icon NI]
  514.             }
  515.         }
  516.         if {$i < $level} {
  517.             lappend dl_field(${DL},${type},$level) ICON${i}
  518.         } else {
  519.             lappend dl_field(${DL},${type},$level) ICON
  520.         }
  521.         if {[VtInfo -charm]} {
  522.             lappend dl_format(${DL},${type},$level) {ICON 1 0 1}
  523.         } else {
  524.             lappend dl_format(${DL},${type},$level) {ICON 1 0 1}
  525.         }
  526.         lappend dl_def(${DL},${type},$level) NO_ICON
  527.     }
  528. }
  529. proc dl:clear {DL} {
  530.     dl:Globals
  531.     if {[info exist dl_types($DL)]} {
  532.         foreach type $dl_types($DL) {
  533.             for {set level 0} {$level < $dl_levels($DL)} {incr level} {
  534.                 catch {unset dl_field(${DL},${type},$level)}
  535.                 catch {unset dl_format(${DL},${type},$level)}
  536.                 catch {unset dl_def(${DL},${type},$level)}
  537.             }
  538.         }
  539.     }
  540.     catch {unset dl_poslist($DL)}
  541.     catch {unset dl_visposlist($DL)}
  542.     catch {unset dl_list($DL)}
  543.     catch {unset dl_vislist($DL)}
  544.     catch {unset dl_types($DL)}
  545.     set dl_levels($DL) 0
  546.     set dl_index($DL) 0
  547.     set dl_poslist($DL) ""
  548.     set dl_visposlist($DL) ""
  549. }
  550. proc dl:init {DL} {
  551.     dl:Globals
  552.     set dl_extra 1
  553.     set dl_defer($DL) 0
  554.     set dl_levels($DL) 0
  555.     dl:clear $DL
  556. }
  557. proc dl:set {DL ind attr value} {
  558. ##~debug_sus
  559.     dl:Globals
  560.     set l_pos [lsearch $dl_poslist($DL) $ind]
  561.     if {$l_pos == -1} {
  562.         error "pos $ind not found in $dl_poslist($DL)"
  563.     }
  564.     set dl_pos [expr $l_pos + 1]
  565.     set level [lindex $dl_list(${DL},$ind) 0]
  566.     set type [lindex $dl_list(${DL},$ind) 1]
  567.     set i [lsearch $dl_field(${DL},${type},$level) $attr]
  568.     if {$i == -1} {
  569.         error "attribute $attr not in level $level, $dl_field(${DL},${type},$level)"
  570.     }
  571.     set dl_list(${DL},$ind) [lreplace $dl_list(${DL},$ind) $i $i $value]
  572. ##~debug_res
  573. }
  574. proc dl:get {DL ind attr} {
  575. ##~debug_sus
  576.     dl:Globals
  577.     set l_pos [lsearch $dl_poslist($DL) $ind]
  578.     if {$l_pos == -1} {
  579.         error "pos $ind not found in $dl_poslist($DL)"
  580.     }
  581.     set dl_pos [expr $l_pos + 1]
  582.     set level [lindex $dl_list(${DL},$ind) 0]
  583.     set type [lindex $dl_list(${DL},$ind) 1]
  584.     set i [lsearch $dl_field(${DL},${type},$level) $attr]
  585.     if {$i == -1} {
  586.         error "attribute $attr not in level $level, $dl_field(${DL},${type},$level)"
  587.     }
  588. ##~debug_res
  589.     return [lindex [lrange $dl_list(${DL},$ind) $i $i] 0]
  590. }
  591. proc dl:isPresent {DL ind {attr ""}} {
  592.     dl:Globals
  593.     set l_pos [lsearch $dl_poslist($DL) $ind]
  594.     if {[cequal $attr ""]} {
  595.         return [expr $l_pos != -1]
  596.     }
  597.     if {$l_pos == -1} {
  598.         error "pos $ind not found in $dl_poslist($DL)"
  599.     }
  600.     set dl_pos [expr $l_pos + 1]
  601.     set level [lindex $dl_list(${DL},$ind) 0]
  602.     set type [lindex $dl_list(${DL},$ind) 1]
  603.     set i [lsearch $dl_field(${DL},${type},$level) $attr]
  604.     return [expr $i != -1]
  605. }
  606. proc dl:select {DL ind} {
  607. ##~debug_sus
  608.     dl:Globals
  609.     set l_pos [lsearch $dl_visposlist($DL) $ind]
  610.     if {$l_pos == -1} {
  611. ##~debug_res
  612.         return
  613.     }
  614.     incr l_pos
  615.     VtDrawnListSelectItem $DL -position $l_pos
  616. ##~debug_res
  617. }
  618. proc dl:selected {DL attr} {
  619. ##~debug_sus
  620.     dl:Globals
  621.     set selected [lindex [VtDrawnListGetSelectedItem $DL -byRecordList] 0]
  622.     if {[llength $selected] == 0} {
  623. ##~debug_res
  624.         return ""
  625.     }
  626.     set level [lindex $selected 0]
  627.     set type [lindex $selected 1]
  628.     set i [lsearch $dl_field(${DL},${type},$level) $attr]
  629.     if {$i == -1} {
  630.         error "attribute $attr not in level $level, $dl_field(${DL},${type},$level)"
  631.     }
  632. ##~debug_res
  633.     return [lindex [lrange $selected $i $i] 0]
  634. }
  635. proc dl:add {DL pos level {type 0}} {
  636. ##~debug_sus
  637.     dl:Globals
  638.     if {![info exist dl_field(${DL},${type},$level)]} {
  639.         if {$level >= $dl_levels($DL)} {
  640.             for {set i $dl_levels($DL)} {$i <= $level} {incr i} {
  641.                 dl:type $DL $i 0
  642.             }
  643.             set dl_levels($DL) $i
  644.         }
  645.         dl:type $DL $level $type
  646.     }
  647.     switch $pos {
  648.         start {
  649.             set l_pos 0
  650.         }
  651.         end {
  652.             set l_pos end
  653.         }
  654.         default {
  655.             set l_pos [lsearch $dl_poslist($DL) $pos]
  656.             if {$l_pos == -1} {
  657.                 error "pos $pos not found in $dl_poslist($DL)"
  658.             }
  659.             incr l_pos
  660.             if {$l_pos >= [llength $dl_poslist($DL)]} {
  661.                 set l_pos end
  662.             }
  663.         }
  664.     }
  665.     if {[info exist dl_index($DL)]} {
  666.         incr dl_index($DL)
  667.     } else {
  668.         set dl_index($DL) 0
  669.     }
  670.     set ind l$dl_index($DL)
  671.     set dl_poslist($DL) [linsert $dl_poslist($DL) $l_pos $ind]
  672.     set dl_list(${DL},$ind) $dl_def(${DL},${type},$level)
  673.     dl:set $DL $ind IND $ind
  674.     dl:set $DL $ind _LEVEL $level
  675.     dl:set $DL $ind _TYPE $type
  676. ##~debug_res
  677.     return $ind
  678. }
  679. proc dl:next {DL ind} {
  680. ##~debug_sus
  681.     dl:Globals
  682.     if {[cequal $ind end]} {
  683. ##~debug_res
  684.         return end
  685.     }
  686.     if {[cequal $ind start]} {
  687.         if {[llength $dl_poslist($DL)] > 0} {
  688. ##~debug_res
  689.             return [lindex $dl_poslist($DL) 0]
  690.         } else {
  691. ##~debug_res
  692.             return end
  693.         }
  694.     }
  695.     set l_pos [lsearch $dl_poslist($DL) $ind]
  696.     if {$l_pos == -1} {
  697.         error "pos $ind not found in $dl_poslist($DL)"
  698.     }
  699.     incr l_pos
  700.     if {$l_pos >= [llength $dl_poslist($DL)]} {
  701.         set ind end
  702.     } else {
  703.         set ind [lindex $dl_poslist($DL) $l_pos]
  704.     }
  705. ##~debug_res
  706.     return $ind
  707. }
  708. proc dl:prev {DL ind} {
  709. ##~debug_sus
  710.     dl:Globals
  711.     if {[cequal $ind start]} {
  712.         return start
  713.     }
  714.     if {[cequal $ind end]} {
  715.         if {[llength $dl_poslist($DL)] > 0} {
  716. ##~debug_res
  717.             return [lindex [lrange $dl_poslist($DL) end end] 0]
  718.         } else {
  719. ##~debug_res
  720.             return start
  721.         }
  722.     }
  723.     set l_pos [lsearch $dl_poslist($DL) $ind]
  724.     if {$l_pos == -1} {
  725.         error "pos $ind not found in $dl_poslist($DL)"
  726.     }
  727.     incr l_pos -1
  728.     if {$l_pos < 0} {
  729.         set ind start
  730.     } else {
  731.         set ind [lindex $dl_poslist($DL) $l_pos]
  732.     }
  733. ##~debug_res
  734.     return $ind
  735. }
  736. proc dl:defer {DL {defer ""}} {
  737.     dl:Globals
  738.     if {[cequal $defer ""]} {
  739.         if {[info exists dl_defer($DL)]} {
  740.             return $dl_defer($DL)
  741.         } else {
  742.             return 0
  743.         }
  744.     } else {
  745.         set dl_defer($DL) $defer
  746.     }
  747. }
  748. proc dl:fixconn {DL ind} {
  749. ##~debug_sus
  750.     dl:Globals
  751.     if {$dl_defer($DL)} {
  752. ##~debug_res
  753.         return
  754.     }
  755.     while {![cequal $ind start]} {
  756.         set level [dl:get $DL $ind _LEVEL]
  757.         if {$level <= 0} {
  758.             break
  759.         }
  760.         set ind [dl:prev $DL $ind]
  761.     }
  762.     set top_ind $ind
  763.     set ind $top_ind
  764.     if {$dl_extra} {
  765.         set_add doExpandCollapse $ind
  766.     }
  767.     set ind [dl:next $DL $ind]
  768.     set parent(0) $top_ind
  769.     while {![cequal $ind end]} {
  770.         set level [dl:get $DL $ind _LEVEL]
  771.         if {$level == 0} {
  772.             break
  773.         }
  774.         set below_level [expr $level - 1]
  775.         set parent($level) $ind
  776.         lappend children($parent($below_level)) $ind
  777.         set last_level $level
  778.         set ind [dl:next $DL $ind]
  779.     }
  780.     foreach p [Array children] {
  781.         set level [dl:get $DL $p _LEVEL]
  782.         set cs $children($p)    
  783.         while {![lempty $cs]} {
  784.             if {[llength $cs] == 1} {
  785.                 set i1 [dl:icon CL]
  786.             } else {
  787.                 set i1 [dl:icon CT]
  788.             }
  789.             set c [lvarpop cs]
  790.             set n [lindex $cs 0]
  791.             set I1 ICON${level}
  792.             set vis [dl:get $DL $c VIS]
  793.             if {$vis} {
  794.                 if {$dl_extra} {
  795.                     set_add doExpandCollapse $c
  796.                 }
  797.                 dl:set $DL $c $I1 $i1
  798.                 set doShow($c) 1
  799.             }
  800.             if {![lempty $n]} {
  801.                 set CI [dl:icon CI]
  802.                 set c [dl:next $DL $c]
  803.                 while {$n != $c} {
  804.                     set vis [dl:get $DL $c VIS]
  805.                     if {$vis} {
  806.                         dl:set $DL $c $I1 $CI
  807.                         set doShow($c) 1
  808.                     }
  809.                     set c [dl:next $DL $c]
  810.                 }
  811.             }
  812.         }
  813.     }
  814.     if {$dl_extra} {
  815.         foreach ind [check doExpandCollapse] {
  816.             set state [dl:state $DL $ind]
  817.             set level [dl:get $DL $ind _LEVEL]
  818.             if {$level == 0 && [cequal $state none]} {
  819.                 set state top
  820.             }
  821.             switch $state {
  822.                 collapsed { dl:set $DL $ind ECICON [dl:icon CE] }
  823.                 expanded  { dl:set $DL $ind ECICON [dl:icon CC] }
  824.                 none      { dl:set $DL $ind ECICON [dl:icon CH] }
  825.                 top       { dl:set $DL $ind ECICON [dl:icon NI] }
  826.                 default   { dl:set $DL $ind ECICON [dl:icon NI] }
  827.             }
  828.             set doShow($ind) 1
  829.         }
  830.     }
  831.     foreach ind [Array doShow] {
  832.         dl:show $DL $ind $doShow($ind)
  833.     }
  834. ##~debug_res
  835. }
  836. proc dl:collapse {DL ind {all 0}} {
  837.     dl:Globals
  838.     set sel_ind [dl:selected $DL IND]
  839.     if {![cequal $sel_ind ""]} {
  840.         set before_vis [dl:get $DL $sel_ind VIS]
  841.     } else {
  842.         set before_vis 0
  843.     }
  844.     if {$all} {
  845.         set level [dl:get $DL $ind _LEVEL]
  846.         if {$level > 0} {
  847.             set top_ind [dl:find $DL $ind up {{_LEVEL 0}}]
  848.             if {![cequal $top_ind start]} {
  849.                 set ind $top_ind
  850.             }
  851.         }
  852.     }
  853.     set below_level [dl:get $DL $ind _LEVEL]
  854.     set top_ind $ind
  855.     set ind [dl:next $DL $ind]    
  856.     while {![cequal $ind end]} {
  857.         set level [dl:get $DL $ind _LEVEL]
  858.         if {$level <= $below_level} {
  859.             break
  860.         }
  861.         dl:show $DL $ind 0
  862.         set ind [dl:next $DL $ind]
  863.     }
  864.     if {![cequal $sel_ind ""]} {
  865.         set after_vis [dl:get $DL $sel_ind VIS]
  866.     } else {
  867.         set after_vis 0
  868.     }
  869.     if {$before_vis && !$after_vis} {
  870.         set top_ind [dl:find $DL $sel_ind up {{VIS 1}}]
  871.         if {![cequal $top_ind start]} {
  872.             set l_pos [lsearch $dl_visposlist($DL) $top_ind]
  873.             if {$l_pos >= 0} {
  874.                 set dl_pos [expr $l_pos + 1]
  875.                 VtDrawnListSelectItem $DL -position $dl_pos
  876.             }
  877.         }
  878.     }
  879.     dl:fixconn $DL $top_ind
  880. }
  881. proc dl:expand {DL ind {all 0}} {
  882.     dl:Globals
  883.     set below_level [dl:get $DL $ind _LEVEL]
  884.     set top_ind $ind
  885.     set ind [dl:next $DL $ind]    
  886.     while {![cequal $ind end]} {
  887.         set level [dl:get $DL $ind _LEVEL]
  888.         if {$level <= $below_level} {
  889.             break
  890.         }
  891.         if {$all || $level - $below_level == 1} {
  892.             dl:show $DL $ind 1
  893.         }
  894.         set ind [dl:next $DL $ind]
  895.     }
  896.     dl:fixconn $DL $top_ind
  897. }
  898. proc dl:state {DL ind} {
  899.     dl:Globals
  900.     set level [dl:get $DL $ind _LEVEL]
  901.     set l_pos [lsearch $dl_visposlist($DL) $ind]
  902.     if {$l_pos == -1} {
  903.         return invisible
  904.     }
  905.     incr l_pos
  906.     set next_ind [dl:next $DL $ind]
  907.     if {[cequal $next_ind end]} {
  908.         set next_level 0
  909.     } else {
  910.         if {$l_pos >= [llength $dl_visposlist($DL)]} {
  911.             set next_visind ""
  912.             set next_level [expr $level + 1]
  913.         } else {
  914.             set next_visind [lindex $dl_visposlist($DL) $l_pos]
  915.             set next_level [dl:get $DL $next_ind _LEVEL]
  916.         }
  917.     }
  918.     if {$next_level > $level} {
  919.         if {[cequal $next_ind $next_visind]} {
  920.             return expanded
  921.         } else {
  922.             return collapsed
  923.         }
  924.     } else {
  925.         return none
  926.     }
  927. }
  928. proc dl:isShow {DL ind} {
  929.     return [dl:get $DL $ind VIS]
  930. }
  931. proc dl:show {DL ind {new_vis ""}} {
  932. ##~debug_sus
  933.     dl:Globals
  934.     set level [dl:get $DL $ind _LEVEL]
  935.     set type [dl:get $DL $ind _TYPE]
  936.     set vis [dl:get $DL $ind VIS]
  937.     if {[cequal $new_vis ""]} {
  938.         set new_vis $vis
  939.     }
  940.     if {!$new_vis && !$vis} {
  941.         return
  942.     } elseif {!$new_vis && $vis} {
  943.         set l_pos [lsearch $dl_visposlist($DL) $ind]
  944.         set dl_pos [expr $l_pos + 1]
  945.         VtDrawnListDeleteItem $DL -position $dl_pos
  946.         lvarpop dl_visposlist($DL) $l_pos
  947.         dl:set $DL $ind VIS 0
  948.     } elseif {$new_vis && !$vis} {
  949.         if {$level == 0} {
  950.             lappend dl_visposlist($DL) $ind
  951.             set dl_pos 0
  952.         } else {
  953.             set prev_ind [dl:prev $DL $ind]
  954.             set prev_vis 0
  955.             while {![cequal $prev_ind start]} {
  956.                 set prev_vis [dl:get $DL $prev_ind VIS]
  957.                 if {$prev_vis} {
  958.                     break
  959.                 }    
  960.                 set prev_ind [dl:prev $DL $prev_ind]
  961.             }
  962.             if {!$prev_vis} {
  963.                 error "no previous visible element"
  964.             }
  965.             set l_pos [lsearch $dl_visposlist($DL) $prev_ind]
  966.             incr l_pos
  967.             set dl_visposlist($DL) [linsert $dl_visposlist($DL) $l_pos $ind]
  968.             set dl_pos [expr $l_pos + 1]
  969.         }
  970.         VtDrawnListAddItem $DL \
  971.             -formatList $dl_format(${DL},${type},$level) \
  972.             -fieldList $dl_list(${DL},$ind) \
  973.             -position $dl_pos
  974.         set dl_vislist(${DL},$ind) $dl_list(${DL},$ind)
  975.         dl:set $DL $ind VIS 1
  976.     } else {
  977.         set l_pos [lsearch $dl_visposlist($DL) $ind]
  978.         set dl_pos [expr $l_pos + 1]
  979.         if {![cequal $dl_list(${DL},$ind) $dl_vislist(${DL},$ind)]} {
  980.             VtDrawnListSetItem $DL \
  981.                 -formatList $dl_format(${DL},${type},$level) \
  982.                 -fieldList $dl_list(${DL},$ind) \
  983.                 -position $dl_pos
  984.             set dl_vislist(${DL},$ind) $dl_list(${DL},$ind)
  985.         }
  986.     }
  987. ##~debug_res
  988. }
  989. proc dl:delete {DL ind} {
  990. ##~debug_sus
  991.     dl:Globals
  992.     set ind_level [dl:get $DL $ind _LEVEL]
  993.     if {$ind_level > 0} {
  994.         set top_ind [dl:prev $DL $ind]    
  995.     } else {
  996.         set top_ind end
  997.     }
  998.     set next_ind [dl:next $DL $ind]
  999.     dl:show $DL $ind 0
  1000.     set l_pos [lsearch $dl_poslist($DL) $ind]
  1001.     lvarpop dl_poslist($DL) $l_pos
  1002.     unset dl_list(${DL},$ind)
  1003.     set ind $next_ind
  1004.     while {![cequal $ind end]} {
  1005.         set level [dl:get $DL $ind _LEVEL]
  1006.         if {$level <= $ind_level} {
  1007.             break
  1008.         }
  1009.         set next_ind [dl:next $DL $ind]
  1010.         dl:show $DL $ind 0
  1011.         set l_pos [lsearch $dl_poslist($DL) $ind]
  1012.         lvarpop dl_poslist($DL) $l_pos
  1013.         unset dl_list(${DL},$ind)
  1014.         set ind $next_ind
  1015.     }
  1016.     if {![cequal $top_ind end]} {
  1017.         dl:fixconn $DL $top_ind
  1018.     }
  1019. ##~debug_res
  1020. }
  1021. proc dl:find {DL ind direction {true_fields ""} {false_fields ""}} {
  1022.     dl:Globals
  1023.     switch -exact -- $direction {
  1024.         1 -
  1025.         forward -
  1026.         down {
  1027.             set first start
  1028.             set last end
  1029.             set listFirst 0
  1030.             set move dl:next
  1031.         }
  1032.         -1 -
  1033.         backward -
  1034.         up {
  1035.             set first end
  1036.             set last start
  1037.             set listFirst end
  1038.             set move dl:prev
  1039.         }
  1040.     }
  1041.     if {[lempty $true_fields] && [lempty $false_fields]} {
  1042.         set ind [eval $move \$DL \$ind]
  1043.         return $ind
  1044.     }
  1045.     if {[cequal $ind ""] || [llength $dl_poslist($DL)] == 0} {
  1046.         return $last
  1047.     } elseif {[cequal $ind $first]} {
  1048.         set ind [lindex $dl_poslist($DL) $listFirst]
  1049.     } else {
  1050.         set l_pos [lsearch $dl_poslist($DL) $ind]
  1051.         if {$l_pos == -1} {
  1052.             return $last
  1053.         }
  1054.     }
  1055.     while {![cequal $ind $last]} {
  1056.         set continue_search 0
  1057.         foreach field $true_fields {
  1058.             lassign $field attr test_value
  1059.             set value [dl:get $DL $ind $attr]
  1060.             if {![cequal $value $test_value]} {
  1061.                 set continue_search 1
  1062.                 break
  1063.             }
  1064.         }
  1065.         if {!$continue_search} {
  1066.             foreach field $false_fields {
  1067.                 lassign $field attr test_value
  1068.                 set value [dl:get $DL $ind $attr]
  1069.                 if {[cequal $value $test_value]} {
  1070.                     set continue_search 1
  1071.                     break
  1072.                 }
  1073.             }
  1074.         }
  1075.         if {!$continue_search} {
  1076.             break
  1077.         }
  1078.         set ind [eval $move \$DL \$ind]
  1079.     }
  1080.     return $ind
  1081. }
  1082. proc dl:sort {DL in out} {
  1083.     dl:Globals
  1084.     set out_pos [lsearch $dl_poslist($DL) [lindex $in 0]]
  1085.     set out_vispos -1
  1086.     foreach out_ind $out {
  1087.         set in_ind [lvarpop in]
  1088.         set dl_poslist($DL) [lreplace $dl_poslist($DL) $out_pos $out_pos $out_ind]
  1089.         set vis [dl:get $DL $out_ind VIS]
  1090.         if {$vis} {
  1091.             if {$out_vispos == -1} {
  1092.                 set out_vispos [lsearch $dl_visposlist($DL) $in_ind]
  1093.             }
  1094.             set dl_visposlist($DL) [lreplace $dl_visposlist($DL) $out_vispos $out_vispos $out_ind]
  1095.             set dl_vislist(${DL},$out_ind) ""
  1096.             dl:show $DL $out_ind 1
  1097.             incr out_vispos
  1098.         }
  1099.         incr out_pos
  1100.     }
  1101.     return 1
  1102. }
  1103. ##################################################
  1104. ##################################################
  1105. proc ppp:chain_clear {} {
  1106.     global ppp_work_chain
  1107.     set ppp_work_chain ""
  1108. }
  1109. proc ppp:chain_add {rec} {
  1110.     global ppp_work_chain
  1111.     if {![info exist ppp_work_chain]} {
  1112.         set ppp_work_chain ""
  1113.     }
  1114.     lappend ppp_work_chain $rec
  1115. }
  1116. proc ppp:chain_next {} {
  1117.     global ppp_work_chain
  1118.     if {![info exist ppp_work_chain]} {
  1119.         set ppp_work_chain ""
  1120.     }
  1121.     if {![lempty $ppp_work_chain]} {
  1122.         set rec [lvarpop ppp_work_chain]
  1123.         keylget rec op op
  1124.         keylget rec mb mb
  1125.         keylget rec ind ind
  1126.         keylget rec sel sel
  1127.         keylget rec view view
  1128.         keylget rec parent_cbs parent_cbs
  1129.         keylget rec func func
  1130.         $func $op "$mb" "$ind" "$sel" $view $parent_cbs
  1131.     }
  1132. }
  1133. proc validTag {str} {
  1134.     set tag [string trim $str]
  1135.     set tag [translit " ^" "__" $tag]
  1136.     set l [clength $tag]
  1137.     if {$l > 32} {
  1138.         set tag [csubstr $tag 0 32]
  1139.         set l [clength $tag]
  1140.     }
  1141.     for {set i 0} {$i < $l} {incr i} {
  1142.         set c [string index $tag $i]
  1143.         if {![ctype print $c]} {
  1144.             set tag [translit "$c" "_"]
  1145.         }
  1146.     }
  1147.     return $tag
  1148. }
  1149. proc validName {str} {
  1150.     return [validTag $str]
  1151. }
  1152. proc validSecret {str} {
  1153.     return [string trim $str]
  1154. }
  1155. proc throwError {dialog mess} {
  1156.     set EDerror [VtErrorDialog $dialog.EDerror \
  1157.         -ok \
  1158.         -message $mess \
  1159.         -autoDestroy 1 \
  1160.     ]
  1161.     VtShow $EDerror
  1162.     VtUnLock
  1163. }
  1164. proc confirm {dialog message okCallback} {
  1165.     set above_message ""
  1166.     catch {VxGetVar $dialog message} above_message
  1167.     if {[cequal $message $above_message]} {
  1168.         return 0
  1169.     }
  1170.     set QDconfirm [VtQuestionDialog $dialog.QDconfirm \
  1171.         -ok \
  1172.         -okCallback $okCallback \
  1173.         -autoLock [lindex $okCallback 0] \
  1174.         -cancel \
  1175.         -message $message \
  1176.         ]
  1177.     VtShow $QDconfirm
  1178.     SetVar $QDconfirm message
  1179.     return 1
  1180. }
  1181. ##################################################
  1182. proc Globals {} {
  1183.     uplevel 1 global FDppp mbWidgetMap mbFuncMap visibleMap sensitiveMap \
  1184.         DLlist TBview managedHost sel2mb
  1185.     uplevel 1 PPP:Globals
  1186. }
  1187. ##################################################
  1188. proc FormTabDialog {FTD} {
  1189.     if {[VtInfo -charm]} {
  1190.         set type menu
  1191.     } else {
  1192.         set type tab
  1193.     }
  1194.     if {[cequal $type tab]} {
  1195.         if {[VtInfo -colors] <= 256} {
  1196.             set type sensitive
  1197.         } else {
  1198.             set type reverse
  1199.         }
  1200.         set FTD [SaFormTabDialog $FTD \
  1201.             -type tab \
  1202.             -style $type \
  1203.             -CHARM_numColumns 2 \
  1204.             ]
  1205.     } else {
  1206.         set FTD [SaFormTabDialog $FTD \
  1207.             -type menu \
  1208.             -label [ILM SCO_PPP_MSG_FTDVIEW] \
  1209.             -mnemonic [ILM SCO_PPP_MSG_MN_FTDVIEW] \
  1210.             ]
  1211.     }
  1212.     return $FTD
  1213. }
  1214. proc FormTabs {FTD FT_data} {
  1215.     foreach FT $FT_data {
  1216.         set current_FT [lvarpop FT]
  1217.         uplevel 1 eval "set $current_FT \[cw SaFormTab $FTD.$current_FT $FT\]"
  1218.     }
  1219. }
  1220. ##################################################
  1221. proc SetAutoRefreshIntervalCB {cbs} {
  1222.     set dialog [keylget cbs dialog]
  1223.     set interval [VxGetVar $dialog interval]
  1224.     set newInterval [VtGetValues [VxGetVar $interval text] -value]
  1225.     if {$newInterval == {}} {
  1226.         ErrorPush errStack 0 SCO_PPP_ERR_NO_INTERVAL
  1227.         SaDisplayErrorStacks $dialog.err [list $errStack] NOHELP
  1228.         VtUnLock
  1229.         return
  1230.     }
  1231.     SaAutoRefreshSetInterval [expr {$newInterval * 60}]
  1232.     VxEndFormCB $cbs
  1233. }
  1234. proc GetAutoRefreshIntervalCB {cbs} {
  1235.     keylget cbs dialog parent
  1236.     set dialog [VtFormDialog $parent.getInterval \
  1237.         -title [IntlLocalizeMsg SCO_PPP_MSG_AUTO_REFRESH_TITLE] \
  1238.         -ok -okCallback SetAutoRefreshIntervalCB \
  1239.         -cancelButton CANCEL \
  1240.         -cancel -cancelCallback VxEndFormCB]
  1241.     set interval [expr {[SaAutoRefreshGetInterval] / 60}]
  1242.     set alform [SaAlignedForm $dialog.interval [list \
  1243.         [list SCO_PPP_MSG_AUTO_REFRESH_LABEL \
  1244.             [list VxSpinButton 8 1 "" 30 "" 1 $interval "" ""]] \
  1245.         ]]
  1246.     VtSetValues $alform -topSide FORM -bottomSide FORM -rightSide FORM
  1247.     set intervalL [VxGetVar $alform label1]
  1248.     VtSetValues $intervalL -font medNormalFont
  1249.     VxSetVar $dialog interval [VxGetVar $alform widget1]
  1250.     VtShow $dialog
  1251.     VtUnLock
  1252. }
  1253. proc RefreshDisplayCB {cbs} {
  1254.     Globals
  1255.     global TBview_bundles TBview_links TBview_auths
  1256.     if {[cequal $TBview $TBview_auths]} {
  1257.         VtUnLock
  1258.         return
  1259.     }
  1260.     set ind start
  1261.     set ind [dl:next $DLlist $ind]
  1262.     while {![cequal $ind end]} {
  1263.         set sel [dl:get $DLlist $ind SEL]
  1264.         set tag [dl:get $DLlist $ind OBJ]
  1265.         set doUpdate 0
  1266.         switch $sel {
  1267.             sel101 {
  1268.                 set status [PPP:action bundle $tag status]
  1269.                 set doUpdate 1
  1270.             }
  1271.             sel202 {
  1272.                 set status [PPP:action link $tag status]
  1273.                 set doUpdate 1
  1274.             }
  1275.         }
  1276.         if {$doUpdate} {
  1277.             set phase dead
  1278.             keylget status phase phase
  1279.             set old_icon [dl:get $DLlist $ind PHASE]
  1280.             switch $phase {
  1281.                 network {
  1282.                     set icon [dl:icon up]
  1283.                 }
  1284.                 default {
  1285.                     set icon [dl:icon NI]
  1286.                 }
  1287.             }
  1288.             if {![cequal $old_icon $icon]} {
  1289.                 dl:set $DLlist $ind PHASE $icon
  1290.                 dl:show $DLlist $ind [dl:isShow $DLlist $ind]
  1291.             }
  1292.         }
  1293.         set ind [dl:next $DLlist $ind]
  1294.     }
  1295.     VtUnLock
  1296. }
  1297. ##################################################
  1298. proc ppp:PBquickExitCB {cbs} {
  1299.     owner unlink -nocomplain /tmp/ppp.pipe
  1300.     owner unlink -nocomplain /tmp/PPP.pipe
  1301.     VtUnLock
  1302.     VtClose
  1303.     exit 0
  1304. }
  1305. proc ppp:PBexitCB {cbs} {
  1306.     Globals
  1307.     global failed_once env
  1308.     SaAutoRefreshPause
  1309.     SaAutoRefreshStore "pppGUI"
  1310.     if {[info exist env(PPP_LINK_CLEAN)] && $env(PPP_LINK_CLEAN) == 1} {
  1311.         set used_tags ""
  1312.         foreach tag [GRP:list lg] {
  1313.             set links [GRP:get $tag tags]
  1314.             foreach link $links {
  1315.                 set_add used_tags $link
  1316.             }
  1317.         }
  1318.         set i3 [intersect3 $used_tags [PPP:list link]]
  1319.         foreach link [lindex $i3 2] {
  1320.             PPP:delete link $link
  1321.         }
  1322.     }
  1323.     if {[info exist env(PPP_PROTOCOL_CLEAN)] && $env(PPP_PROTOCOL_CLEAN) == 1} {
  1324.         set used_tags ""
  1325.         foreach type {bundle link} {
  1326.             foreach tag [PPP:list ${type}] {
  1327.                 set protocols ""
  1328.                 PPP:get ${type} ${tag} protocols protocols
  1329.                 foreach protocol $protocols {
  1330.                     set_add used_tags $protocol
  1331.                 }
  1332.             }
  1333.         }
  1334.         set i3 [intersect3 $used_tags [PPP:list protocol]]
  1335.         foreach protocol [lindex $i3 2] {
  1336.             PPP:get protocol ${protocol} protocol key
  1337.             PPP:delete protocol/${key} $protocol
  1338.         }
  1339.     }
  1340.     if {![info exists TBview]} {
  1341.         set TBview ""
  1342.     }
  1343.     SaScreenPolicySet "pppGUI" TBview "$TBview"
  1344.     if {!$failed_once && ![PPP:write_config $FDppp SCO_PPP_MSG_SB_WRITING]} {
  1345.         set failed_once 1
  1346.         return [throwError $FDppp [ILM SCO_PPP_ERR_SET_SERVER_CONFIG]]
  1347.     }
  1348.     PPP:exit
  1349.     ppp:PBquickExitCB $cbs
  1350. }
  1351. ##################################################
  1352. proc ppp:PBexpandCB {range cbs} {
  1353.     Globals
  1354.     switch $range {
  1355.         all {
  1356.             set ind start
  1357.             while {![cequal $ind end]} {
  1358.                 set ind [dl:find $DLlist $ind down {{_LEVEL 0}}]
  1359.                 if {![cequal $ind end]} {
  1360.                     dl:expand $DLlist $ind 1
  1361.                 }
  1362.                 set ind [dl:next $DLlist $ind]
  1363.             }
  1364.         }
  1365.         defn {
  1366.             set ind [dl:selected $DLlist IND]
  1367.             set top_ind [dl:find $DLlist $ind up {{_LEVEL 0}}]
  1368.             if {[cequal $top_ind start]} {
  1369.                 set top_ind $ind
  1370.             }
  1371.             dl:expand $DLlist $top_ind 1
  1372.         }
  1373.         selected {
  1374.             set ind [dl:selected $DLlist IND]
  1375.             dl:expand $DLlist $ind 
  1376.             SaDrawnListShowSelectedItem $DLlist 1
  1377.         }
  1378.     }
  1379.     ppp:DLselectCB $cbs
  1380.     VtUnLock
  1381. }
  1382. proc ppp:PBcollapseCB {range cbs} {
  1383.     Globals
  1384.     switch $range {
  1385.         all {
  1386.             set ind start
  1387.             while {![cequal $ind end]} {
  1388.                 set ind [dl:find $DLlist $ind down {{_LEVEL 0}}]
  1389.                 if {![cequal $ind end]} {
  1390.                     dl:collapse $DLlist $ind 1
  1391.                 }
  1392.                 set ind [dl:next $DLlist $ind]
  1393.             }
  1394.         }
  1395.         defn {
  1396.             set ind [dl:selected $DLlist IND]
  1397.             set top_ind [dl:find $DLlist $ind up {{_LEVEL 0}}]
  1398.             if {[cequal $top_ind start]} {
  1399.                 set top_ind $ind
  1400.             }
  1401.             dl:collapse $DLlist $top_ind 1
  1402.         }
  1403.         selected {
  1404.             set ind [dl:selected $DLlist IND]
  1405.             dl:collapse $DLlist $ind 
  1406.         }
  1407.     }
  1408.     ppp:DLselectCB $cbs
  1409.     VtUnLock
  1410. }
  1411. proc ppp:DLexpandCollapseCB {cbs} {
  1412.     Globals
  1413.     set ind [dl:selected $DLlist IND]
  1414.     if {![cequal $ind ""]} {
  1415.         set state [dl:state $DLlist $ind]
  1416.         switch $state {
  1417.             expanded  { dl:collapse $DLlist $ind }
  1418.             collapsed { dl:expand $DLlist $ind }
  1419.             default   { ppp:PBmodifyCB $cbs }
  1420.         }
  1421.     }
  1422.     ppp:DLselectCB $cbs
  1423.     VtUnLock
  1424. }
  1425. ##################################################
  1426. proc pppGUI {} {
  1427.     Globals
  1428.     global Charm iconpath versionNumber managedHost failed_once
  1429.     global TBview_bundles TBview_links TBview_auths
  1430.     set shortHostname [SaHostExtractSystemName $managedHost]
  1431.     set pppGUI [VtOpen pppGUI pppGUI]
  1432.     VtSetAppValues $pppGUI \
  1433.         -versionString [ILM SCO_PPP_MSG_VERSION $versionNumber]
  1434.     set Charm [VtInfo -charm]
  1435.     VtLock
  1436.     if {[id userid] != 0 && !([isOwner] && [isOwner -host $managedHost])} {
  1437.         SaDisplayNoAuths $pppGUI.EDnoAuthBox \
  1438.                [ILM SCO_PPP_MSG_TITLE "$shortHostname"] \
  1439.                ppp:PBquickExitCB \
  1440.             $managedHost
  1441.             VtUnLock
  1442.             return
  1443.     }
  1444.     if {![OnlyOneCopy /tmp/ppp.pipe]} {
  1445.         set EDoneCopy [VtErrorDialog $pppGUI.EDoneCopy \
  1446.             -wmDecoration { TITLE RESIZE BORDER } \
  1447.             -autoDestroy 1 \
  1448.             -ok \
  1449.             -okCallback ppp:PBquickExitCB \
  1450.             -message [ILM SCO_PPP_ERR_ONLY_ONE_PPP] \
  1451.             ]
  1452.         VtShowDialog $EDoneCopy
  1453.         VtUnLock
  1454.         return
  1455.     }
  1456.     if {![OnlyOneCopy /tmp/PPP.pipe]} {
  1457.         set EDoneCopy [VtErrorDialog $pppGUI.EDoneCopy \
  1458.             -wmDecoration { TITLE RESIZE BORDER } \
  1459.             -autoDestroy 1 \
  1460.             -ok \
  1461.             -okCallback ppp:PBquickExitCB \
  1462.             -message [ILM SCO_PPP_ERR_ONLY_ONE_PIC] \
  1463.             ]
  1464.         VtShowDialog $EDoneCopy
  1465.         VtUnLock
  1466.         return
  1467.     }
  1468.     set FDppp [VtFormDialog $pppGUI.FDppp \
  1469.         -title [ILM SCO_PPP_MSG_TITLE "$shortHostname"] \
  1470.         -wmShadowThickness 0 \
  1471.         -marginHeight 0 \
  1472.         -marginWidth 0 \
  1473.         -wmCloseCallback pic:PBexitCB \
  1474.         ]
  1475. ##########
  1476.     set MBppp [VtMenuBar $FDppp.MBppp \
  1477.         -helpMenuItemList [SaHelpGetOptionsList] \
  1478.         ]
  1479.     set PDhost [cw VtPulldown $MBppp.PDhost \
  1480.         SCO_PPP_MSG_PDHOST \
  1481.         SCO_PPP_MSG_MN_PDHOST \
  1482.         "" \
  1483.         ]
  1484.     set PBopen [cw VtPushButton $PDhost.PBopen \
  1485.         SCO_PPP_MSG_PBOPEN \
  1486.         SCO_PPP_MSG_MN_PBOPEN \
  1487.         SCO_PPP_MSG_SH_PBOPEN \
  1488.         -callback SaOpenHostCB \
  1489.         -autoLock SaOpenHostCB \
  1490.         ]
  1491.     VtSeparator $PDhost.Ssep
  1492.     set PBexit [cw VtPushButton $PDhost.PBexit \
  1493.         SCO_PPP_MSG_PBEXIT \
  1494.         SCO_PPP_MSG_MN_PBEXIT \
  1495.         SCO_PPP_MSG_SH_PBEXIT \
  1496.         -callback ppp:PBexitCB \
  1497.         -autoLock ppp:PBexitCB \
  1498.         ]
  1499. ##########
  1500.     wset $FDppp PDedit [cw VtPulldown $MBppp.PDedit \
  1501.         SCO_PPP_MSG_PDEDIT \
  1502.         SCO_PPP_MSG_MN_PDEDIT \
  1503.         "" \
  1504.         ]
  1505.     wset $FDppp PDadd [cw VtPulldown $PDedit.PDadd \
  1506.         SCO_PPP_MSG_PDADD \
  1507.         SCO_PPP_MSG_MN_PDADD \
  1508.         "" \
  1509.         -userData mb110 \
  1510.         ]
  1511.     wset $FDppp PBmodify [cw VtPushButton $PDedit.PBmodify \
  1512.         SCO_PPP_MSG_PBMODIFY \
  1513.         SCO_PPP_MSG_MN_PBMODIFY \
  1514.         SCO_PPP_MSG_SH_PBMODIFY \
  1515.         -callback ppp:PBmodifyCB \
  1516.         -autoLock ppp:PBmodifyCB \
  1517.         -userData mb120 \
  1518.         ]
  1519.     wset $FDppp PBdelete [cw VtPushButton $PDedit.PBdelete \
  1520.         SCO_PPP_MSG_PBDELETE \
  1521.         SCO_PPP_MSG_MN_PBDELETE \
  1522.         SCO_PPP_MSG_SH_PBDELETE \
  1523.         -callback ppp:PBdeleteCB \
  1524.         -autoLock ppp:PBdeleteCB \
  1525.         -userData mb130 \
  1526.         ]
  1527. #####
  1528.     wset $FDppp PBbundle_add_bundle [cw VtPushButton $PDadd.PBbundle_add_bundle \
  1529.         SCO_PPP_MSG_PBBUNDLES_ADD_BUNDLE \
  1530.         SCO_PPP_MSG_MN_PBBUNDLES_ADD_BUNDLE \
  1531.         "" \
  1532.         -callback ppp:PBaddCB \
  1533.         -autoLock ppp:PBaddCB \
  1534.         -userData mb112 \
  1535.         ]
  1536.     wset $FDppp PBbundle_add_link_group [cw VtPushButton $PDadd.PBbundle_add_link_group \
  1537.         SCO_PPP_MSG_PBBUNDLES_ADD_LG \
  1538.         SCO_PPP_MSG_MN_PBBUNDLES_ADD_LG \
  1539.         "" \
  1540.         -callback ppp:PBaddCB \
  1541.         -autoLock ppp:PBaddCB \
  1542.         -userData mb113 \
  1543.         ]
  1544.     wset $FDppp PBbundle_add_network_protocol [cw VtPushButton $PDadd.PBbundle_add_network_protocol \
  1545.         SCO_PPP_MSG_PBBUNDLES_ADD_NP \
  1546.         SCO_PPP_MSG_MN_PBBUNDLES_ADD_NP \
  1547.         "" \
  1548.         -callback ppp:PBaddCB \
  1549.         -autoLock ppp:PBaddCB \
  1550.         -userData mb114 \
  1551.         ]
  1552.     wset $FDppp PBbundle_add_link_protocol [cw VtPushButton $PDadd.PBbundle_add_link_protocol \
  1553.         SCO_PPP_MSG_PBBUNDLES_ADD_LP \
  1554.         SCO_PPP_MSG_MN_PBBUNDLES_ADD_LP \
  1555.         "" \
  1556.         -callback ppp:PBaddCB \
  1557.         -autoLock ppp:PBaddCB \
  1558.         -userData mb115 \
  1559.         ]
  1560. ##########
  1561.     wset $FDppp PBlink_group_add_link_group [cw VtPushButton $PDadd.PBlink_group_add_link_group \
  1562.         SCO_PPP_MSG_PBLINLS_ADD_LG \
  1563.         SCO_PPP_MSG_MN_PBLINKS_ADD_LG \
  1564.         "" \
  1565.         -callback ppp:PBaddCB \
  1566.         -autoLock ppp:PBaddCB \
  1567.         -userData mb201 \
  1568.         ]
  1569.     wset $FDppp PBlink_group_add_link [cw VtPushButton $PDadd.PBlink_group_add_link \
  1570.         SCO_PPP_MSG_PBLINKS_ADD_LINK \
  1571.         SCO_PPP_MSG_MN_PBLINKS_ADD_LINK \
  1572.         "" \
  1573.         -callback ppp:PBaddCB \
  1574.         -autoLock ppp:PBaddCB \
  1575.         -userData mb211 \
  1576.         ]
  1577.     wset $FDppp PBlink_group_add_link_protocol [cw VtPushButton $PDadd.PBlink_group_add_link_protocol \
  1578.         SCO_PPP_MSG_PBLINKS_ADD_LP \
  1579.         SCO_PPP_MSG_MN_PBLINKS_ADD_LP \
  1580.         "" \
  1581.         -callback ppp:PBaddCB \
  1582.         -autoLock ppp:PBaddCB \
  1583.         -userData mb212 \
  1584.         ]
  1585. ##########
  1586.     wset $FDppp PBauth_add_auth [cw VtPushButton $PDadd.PBauth_add_auth \
  1587.         SCO_PPP_MSG_PBAUTH_ADD_NAME \
  1588.         SCO_PPP_MSG_MN_PBAUTH_ADD_NAME \
  1589.         "" \
  1590.         -callback ppp:PBaddCB \
  1591.         -autoLock ppp:PBaddCB \
  1592.         -userData mb301 \
  1593.         ]
  1594. ##########
  1595.     set PDview [cw VtPulldown $MBppp.PDview \
  1596.         SCO_PPP_MSG_PDVIEW \
  1597.         SCO_PPP_MSG_MN_PDVIEW \
  1598.         "" \
  1599.         ]
  1600.     wset $FDppp TBview_bundles [cw VtToggleButton $PDview.TBview_bundles \
  1601.         SCO_PPP_MSG_TBVIEW_BUNDLES \
  1602.         SCO_PPP_MSG_MN_TBVIEW_BUNDLES \
  1603.         SCO_PPP_MSG_SH_TBVIEW_BUNDLES \
  1604.         -value 0 \
  1605.         -userData mb1001 \
  1606.         -callback ppp:PDviewCB \
  1607.         ]
  1608.     wset $FDppp TBview_links [cw VtToggleButton $PDview.TBview_links \
  1609.         SCO_PPP_MSG_TBVIEW_LINKS \
  1610.         SCO_PPP_MSG_MN_TBVIEW_LINKS \
  1611.         SCO_PPP_MSG_SH_TBVIEW_LINKS \
  1612.         -value 0 \
  1613.         -userData mb1002 \
  1614.         -callback ppp:PDviewCB \
  1615.         ]
  1616.     wset $FDppp TBview_auths [cw VtToggleButton $PDview.TBview_auths \
  1617.         SCO_PPP_MSG_TBVIEW_AUTHS \
  1618.         SCO_PPP_MSG_MN_TBVIEW_AUTHS \
  1619.         SCO_PPP_MSG_SH_TBVIEW_AUTHS \
  1620.         -value 0 \
  1621.         -userData mb1003 \
  1622.         -callback ppp:PDviewCB \
  1623.         ]
  1624.     VtSeparator $PDview.Ssep1
  1625.     wset $FDppp PBexpand [cw VtPushButton $PDview.PBexpand \
  1626.         SCO_PPP_MSG_PBVIEW_EXPAND \
  1627.         SCO_PPP_MSG_MN_PBVIEW_EXPAND \
  1628.         SCO_PPP_MSG_SH_PBVIEW_EXPAND \
  1629.         -callback "ppp:PBexpandCB selected" \
  1630.         -autoLock ppp:PBexpandCB \
  1631.         ]
  1632.     wset $FDppp PBexpandall [cw VtPushButton $PDview.PBexpandall \
  1633.         SCO_PPP_MSG_PBVIEW_EXPANDALL \
  1634.         SCO_PPP_MSG_MN_PBVIEW_EXPANDALL \
  1635.         SCO_PPP_MSG_SH_PBVIEW_EXPANDALL \
  1636.         -callback "ppp:PBexpandCB all" \
  1637.         -autoLock ppp:PBexpandCB \
  1638.         ]
  1639.     VtSeparator $PDview.Ssep2
  1640.     wset $FDppp PBcollapse [cw VtPushButton $PDview.PBcollapse \
  1641.         SCO_PPP_MSG_PBVIEW_COLLAPSE \
  1642.         SCO_PPP_MSG_MN_PBVIEW_COLLAPSE \
  1643.         SCO_PPP_MSG_SH_PBVIEW_COLLAPSE \
  1644.         -callback "ppp:PBcollapseCB selected" \
  1645.         -autoLock ppp:PBcollapseCB \
  1646.         ]
  1647.     wset $FDppp PBcollapseall [cw VtPushButton $PDview.PBcollapseall \
  1648.         SCO_PPP_MSG_PBVIEW_COLLAPSEALL \
  1649.         SCO_PPP_MSG_MN_PBVIEW_COLLAPSEALL \
  1650.         SCO_PPP_MSG_SH_PBVIEW_COLLAPSEALL \
  1651.         -callback "ppp:PBcollapseCB all" \
  1652.         -autoLock ppp:PBcollapseCB \
  1653.         ]
  1654.     VtSeparator $PDview.Ssep3
  1655.     SaAutoRefresh RefreshDisplayCB $PDview \
  1656.         [ILM SCO_PPP_MSG_PBVIEW_REFRESH_SH] \
  1657.         SaShortHelpCB GetAutoRefreshIntervalCB
  1658. ##########
  1659.     wset $FDppp PDoptions [cw VtPulldown $MBppp.PDoptions \
  1660.         SCO_PPP_MSG_PDOPTIONS \
  1661.         SCO_PPP_MSG_MN_PDOPTIONS \
  1662.         "" \
  1663.         ]
  1664.     wset $FDppp PBglobal_bundle [cw VtPushButton $PDoptions.PBglobal_bundle \
  1665.         SCO_PPP_MSG_PBGLOBAL_BUNDLE \
  1666.         SCO_PPP_MSG_MN_PBGLOBAL_BUNDLE \
  1667.         SCO_PPP_MSG_SH_PBGLOBAL_BUNDLE \
  1668.         -callback ppp:PBglobal_bundleCB \
  1669.         -autoLock ppp:PBglobal_bundleCB \
  1670.         ]
  1671. ##########
  1672.     VtSeparator $PDoptions.Ssep
  1673.     wset $FDppp pointHelp [SaShortHelpMenuOptions $PDoptions]
  1674. ##########
  1675.     wset $FDppp Lprompt [VtLabel $FDppp.Lprompt \
  1676.         -MOTIF_leftOffset 5 \
  1677.         -MOTIF_topOffset 5 \
  1678.         -CHARM_leftOffset 1 \
  1679.         -leftSide FORM \
  1680.         -label [ILM SCO_PPP_MSG_PROMPT "$shortHostname"] \
  1681.         ]
  1682.     set MOTIF_labelFormatList {{STRING 30} {STRING 30}}
  1683.     dl:addicon d disabled.px $iconpath [ILM SCO_PPP_MSG_CICON_D]
  1684.     dl:addicon o outgoing.px $iconpath [ILM SCO_PPP_MSG_CICON_O]
  1685.     dl:addicon i incoming.px $iconpath [ILM SCO_PPP_MSG_CICON_I]
  1686.     dl:addicon io inout.px $iconpath [ILM SCO_PPP_MSG_CICON_IO]
  1687.     dl:addicon b host.px $iconpath [ILM SCO_PPP_MSG_CICON_B]
  1688.     dl:addicon a auth.px $iconpath [ILM SCO_PPP_MSG_CICON_A]
  1689.     dl:addicon l modem.px $iconpath [ILM SCO_PPP_MSG_CICON_L]
  1690.     dl:addicon lg multi-modem.px $iconpath [ILM SCO_PPP_MSG_CICON_LG]
  1691.     dl:addicon pn nprotocol.px $iconpath [ILM SCO_PPP_MSG_CICON_NP]
  1692.     dl:addicon pl lprotocol.px $iconpath [ILM SCO_PPP_MSG_CICON_LP]
  1693.     dl:addicon up flash.px $iconpath [ILM SCO_PPP_MSG_CICON_UP]
  1694.     dl:addicon s serial.px $iconpath [ILM SCO_PPP_MSG_CICON_S]
  1695.     wset $FDppp DLlist [VtDrawnList $FDppp.DLlist \
  1696.         -MOTIF_formatList {{ICON 1}} \
  1697.         -MOTIF_labelFormatList $MOTIF_labelFormatList \
  1698.         -MOTIF_labelList [list [ILM SCO_PPP_MSG_HDR_DL_BUNDLE] ""] \
  1699.         -callback ppp:DLselectCB \
  1700.         -defaultCallback ppp:DLexpandCollapseCB \
  1701.         -autoLock "ppp:DLexpandCollapseCB" \
  1702.         -columns 69 \
  1703.         -MOTIF_rows 15 \
  1704.         -CHARM_rows 12 \
  1705.         -selection SINGLE \
  1706.         -leftSide FORM \
  1707.         -rightSide FORM \
  1708.         -MOTIF_leftOffset 5 \
  1709.         -MOTIF_rightOffset 5 \
  1710.         -horizontalScrollBar 1 \
  1711.         -MOTIF_iconList [dl:iconList] \
  1712.         -CHARM_iconList [dl:iconList CHARM] \
  1713.         ]
  1714.     VtSetValues $FDppp -resizable 0
  1715.     StatusBar $FDppp $DLlist 1
  1716.     SaCharmSetMaxFormDimensions $FDppp
  1717.     dl:init $DLlist
  1718.     VtShow $FDppp
  1719.     ppp:initOp
  1720.     set TBview $TBview_links
  1721.     if {[catch {SaScreenPolicyGet pppGUI TBview} TBview] 
  1722.             || [cequal $TBview ""]} {
  1723.         set TBview $TBview_links
  1724.     }
  1725.     set failed_once 0
  1726.     if {![PPP:read_config $FDppp SCO_PPP_MSG_SB_INIT SCO_PPP_MSG_SB_READING SCO_PPP_MSG_SB_VERIFYING]} {
  1727.         set failed_once 1
  1728.         return [throwError $FDppp [ILM SCO_PPP_ERR_GET_SERVER_CONFIG]]
  1729.     }
  1730.     ppp:fake_view_switch $TBview
  1731.     if [ErrorCatch errStack 0 "SaScreenPolicyGet pppGUI autoRefreshState" refreshState] {
  1732.         SaAutoRefreshOn
  1733.         SaAutoRefreshSetInterval 120
  1734.     }
  1735.     SaAutoRefreshLoad "pppGUI"
  1736.     if {[lempty [Devices:list]]} {
  1737.         set WDnoDevs [VtWarningDialog $FDppp.WDnoDevs \
  1738.             -autoDestroy 1 \
  1739.             -ok \
  1740.             -message [ILM SCO_PPP_ERR_NO_DEVS] \
  1741.             ]
  1742.         VtShow $WDnoDevs
  1743.         VtUnLock
  1744.         return
  1745.     }
  1746.     set pppGUI_first 1
  1747.     if {[lempty [GRP:list lg]] && $pppGUI_first \
  1748.             && ![lempty [Devices:list]] \
  1749.             && ![lempty [PPP:list link]]} {
  1750.         set QDauto_create [VtQuestionDialog $FDppp.QDauto_create \
  1751.             -autoDestroy 1 \
  1752.             -ok \
  1753.             -okCallback ppp:auto_create \
  1754.             -autoLock ppp:auto_create \
  1755.             -cancel \
  1756.             -message [ILM SCO_PPP_MSG_AUTO_CREATE_GROUPS] \
  1757.             ]
  1758.         VtShow $QDauto_create
  1759.         VtUnLock
  1760.         return
  1761.     }
  1762.     VtUnLock
  1763. }
  1764. proc ppp:auto_create {cbs} {
  1765.     Globals
  1766.     global TBview_bundles TBview_links TBview_auths
  1767.     StatusPush $FDppp [ILM SCO_PPP_MSG_AUTO_CREATE_STATUS]
  1768.     GRP:auto_create
  1769.     StatusPop $FDppp
  1770.     ppp:fake_view_switch $TBview_bundles
  1771.     if {![lempty [GRP:list lg]]} {
  1772.         set IDauto_create [VtQuestionDialog $FDppp.IDauto_create \
  1773.             -autoDestroy 1 \
  1774.             -ok \
  1775.             -message [ILM SCO_PPP_MSG_TIP_CREATE_BUNDLES] \
  1776.             ]
  1777.         VtShow $IDauto_create
  1778.     }
  1779.     VtUnLock
  1780. }
  1781. proc ppp:fake_view_switch {new_TBview} {
  1782.     Globals
  1783.     VtSetValues $TBview -value 0
  1784.     VtSetValues $new_TBview -value 1
  1785.     keylset fake_cbs dialog $FDppp
  1786.     keylset fake_cbs widget $new_TBview
  1787.     set TBview null
  1788.     SetVar $FDppp TBview
  1789.     ppp:PDviewCB 1 $fake_cbs
  1790. }
  1791. proc ppp:TBview_bundlesCB {op mb ind sel view cbs} {
  1792.     Globals
  1793.     global view_state
  1794.     set header SCO_PPP_MSG_HDR_DL_BUNDLE
  1795.     VtSetValues $DLlist -MOTIF_labelList [list [ILM $header] ""]
  1796.     dl:clear $DLlist
  1797.     ppp:setFormats
  1798.     foreach bundle_tag [PPP:list bundle] {
  1799.         if {[lsearch $view_state($TBview) $bundle_tag] != -1} {
  1800.             set expanded 1
  1801.         } else {
  1802.             set expanded 0
  1803.         }
  1804.         set bundle_ind [bundle:DLadd_bundle end $bundle_tag 1]
  1805.         bundle:DLinfo $bundle_ind
  1806.         PPP:get bundle $bundle_tag protocols protocols_tags
  1807.         set nprotocol_tags ""
  1808.         set lprotocol_tags ""
  1809.         foreach protocol_tag $protocols_tags {
  1810.             if {![PPP:isPresent protocol $protocol_tag]} {
  1811.                 continue
  1812.             }
  1813.             PPP:get protocol ${protocol_tag} protocol protocol
  1814.             keylget ppp_type_info(protocol/${protocol}) sub_defn sub_defn
  1815.             switch $sub_defn {
  1816.                 network {
  1817.                     lappend nprotocol_tags $protocol_tag
  1818.                 } 
  1819.                 link { 
  1820.                     lappend lprotocol_tags $protocol_tag
  1821.                 }
  1822.             }
  1823.         }
  1824.         foreach nprotocol_tag $nprotocol_tags {
  1825.                 set protocol_ind [bundle:DLadd_protocol end $bundle_ind $nprotocol_tag $expanded]    
  1826.                 bundle:DLinfo_protocol $protocol_ind $expanded
  1827.         }
  1828.         foreach lprotocol_tag $lprotocol_tags {
  1829.                 set protocol_ind [bundle:DLadd_protocol end $bundle_ind $lprotocol_tag $expanded]
  1830.                 bundle:DLinfo_protocol $protocol_ind $expanded
  1831.         }
  1832.         set links_tags ""
  1833.         set protocols ""
  1834.         PPP:get bundle $bundle_tag links links_tags
  1835.         foreach lg_tag [links_to_lgs $links_tags] {
  1836.             set name [GRP:get $lg_tag name]
  1837.             set lg_ind [bundle_link_group:DLadd_link_group end sel101 $bundle_ind $lg_tag $expanded]
  1838.             bundle_link_group:DLinfo $lg_ind
  1839.         }
  1840.         dl:fixconn $DLlist $bundle_ind
  1841.     }
  1842. }
  1843. proc ppp:TBview_linksCB {op mb ind sel view cbs} {
  1844.     Globals
  1845.     global view_state
  1846.     set header SCO_PPP_MSG_HDR_DL_LINK
  1847.     VtSetValues $DLlist -MOTIF_labelList [list [ILM $header] ""]
  1848.     dl:clear $DLlist
  1849.     ppp:setFormats
  1850.     foreach lg_tag [lsort -command lsort_grp [GRP:list lg]] {
  1851.         if {[lsearch $view_state($TBview) $lg_tag] != -1} {
  1852.             set expanded 1
  1853.         } else {
  1854.             set expanded 0
  1855.         }
  1856.         set lg_ind [link_group:DLadd_link_group end $lg_tag 1]
  1857.         link_group:DLinfo $lg_ind
  1858.         set info [GRP:get $lg_tag info]
  1859.         set group_attrs ""
  1860.         keylget info group_attrs group_attrs
  1861.         set protocol_tags ""
  1862.         keylget group_attrs protocols protocol_tags
  1863.         foreach protocol_tag $protocol_tags {
  1864.             if {![PPP:isPresent protocol $protocol_tag]} {
  1865.                 continue
  1866.             }
  1867.             PPP:get protocol $protocol_tag protocol val
  1868.             keylget ppp_type_info(protocol/$val) sub_defn ptype
  1869.             set val [translit "a-z" "A-Z" $val]
  1870.             switch $ptype {
  1871.                 link {
  1872.                     set protocol_ind [link_group:DLadd_protocol end $lg_ind $protocol_tag $expanded]
  1873.                     link_group:DLinfo_protocol $protocol_ind $expanded
  1874.                 }
  1875.             }
  1876.         }
  1877.         set link_tags [GRP:get $lg_tag tags]
  1878.         foreach link_tag [lsort -command lsort_link $link_tags] {
  1879.             set link_ind [link_group_link:DLadd_link end $lg_ind $link_tag $expanded]
  1880.             link_group_link:DLinfo $link_ind
  1881.         }
  1882.         dl:fixconn $DLlist $lg_ind
  1883.     }
  1884. }
  1885. proc ppp:TBview_authsCB {op mb ind sel view cbs} {
  1886.     Globals
  1887.     set header SCO_PPP_MSG_HDR_DL_AUTH
  1888.     VtSetValues $DLlist -MOTIF_labelList [list [ILM $header] ""]
  1889.     dl:clear $DLlist
  1890.     ppp:setFormats
  1891.     foreach auth_tag [lsort -command lsort_auth [PPP:list auth]] {
  1892.         set name ""
  1893.         set protocol ""
  1894.         PPP:get auth $auth_tag name name
  1895.         PPP:get auth $auth_tag protocol protocol
  1896.         if {[info exists name_ind($name)]} {
  1897.             dl:set $DLlist $name_ind($name) $protocol $auth_tag
  1898.         } else {
  1899.             set name_ind($name) [auth:DLadd_auth end $name]
  1900.             dl:set $DLlist $name_ind($name) $protocol $auth_tag
  1901.         }
  1902.     }
  1903.     foreach ind [Array name_ind] {
  1904.         auth:DLinfo $name_ind($ind)
  1905.         ppp:viewsort $name_ind($ind)
  1906.         dl:fixconn $DLlist $name_ind($ind)
  1907.     }
  1908. }
  1909. ##################################################
  1910. proc ppp:viewsort {ind} {
  1911.     Globals
  1912.     GetUser $TBview view
  1913.     set level [dl:get $DLlist $ind _LEVEL]
  1914.     while {$level > 0} {
  1915.         set ind [dl:prev $DLlist $ind]
  1916.         set level [dl:get $DLlist $ind _LEVEL]
  1917.     }
  1918.     switch $view {
  1919.         mb1001 {
  1920.             ppp:viewsort_bundles $ind
  1921.         }
  1922.         mb1002 {
  1923.             ppp:viewsort_links $ind
  1924.         }
  1925.     }
  1926. }
  1927. proc ppp:viewsort_bundles {ind} {
  1928.     Globals
  1929.     set in ""
  1930.     set out ""
  1931.     set bl ""
  1932.     set pn ""
  1933.     set pl ""
  1934.     set last ""
  1935.     set ind [dl:next $DLlist $ind]
  1936.     while {![cequal $ind end]} {
  1937.         set level [dl:get $DLlist $ind _LEVEL]
  1938.         if {$level == 0} {
  1939.             break
  1940.         }
  1941.         lappend in $ind
  1942.         set sel [dl:get $DLlist $ind SEL]
  1943.         switch $sel {
  1944.             sel105 {
  1945.                 lappend bl $ind
  1946.             }
  1947.             sel106 {
  1948.                 lappend pn $ind
  1949.             }
  1950.             sel107 {
  1951.                 lappend pl $ind
  1952.             }
  1953.         }
  1954.         set ind [dl:next $DLlist $ind]
  1955.     }
  1956.     if {![lempty $pn]} {
  1957.         set out [concat $out $pn]
  1958.     }
  1959.     if {![lempty $pl]} {
  1960.         set out [concat $out $pl]
  1961.     }
  1962.     if {![lempty $bl]} {
  1963.         set out [concat $out $bl]
  1964.     }
  1965.     dl:sort $DLlist $in $out
  1966. }
  1967. proc ppp:viewsort_links {ind} {
  1968.     Globals
  1969.     set in ""
  1970.     set out ""
  1971.     set l ""
  1972.     set pl ""
  1973.     set ind [dl:next $DLlist $ind]
  1974.     while {![cequal $ind end]} {
  1975.         set level [dl:get $DLlist $ind _LEVEL]
  1976.         if {$level == 0} {
  1977.             break
  1978.         }
  1979.         lappend in $ind
  1980.         set sel [dl:get $DLlist $ind SEL]
  1981.         switch $sel {
  1982.             sel202 {
  1983.                 lappend l $ind
  1984.             }
  1985.             sel203 {
  1986.                 lappend pl $ind
  1987.             }
  1988.         }
  1989.         set ind [dl:next $DLlist $ind]
  1990.     }
  1991.     if {![lempty $pl]} {
  1992.         set out [concat $out $pl]
  1993.     }
  1994.     if {![lempty $l]} {
  1995.         set out [concat $out $l]
  1996.     }
  1997.     dl:sort $DLlist $in $out
  1998. }
  1999. proc ppp:viewsort_auths {ind} {
  2000. }
  2001. ##################################################
  2002. proc ppp:initOp {} {
  2003.     Globals
  2004.     wget $FDppp PDadd PBmodify PBdelete \
  2005.         PBbundle_add_bundle PBbundle_add_link_group PBbundle_add_network_protocol PBbundle_add_link_protocol \
  2006.         PBlink_group_add_link_group PBlink_group_add_link PBlink_group_add_link_protocol \
  2007.         PBauth_add_auth
  2008.     set mbFuncMap(mb1001) ppp:TBview_bundlesCB
  2009.     set mbFuncMap(mb1002) ppp:TBview_linksCB
  2010.     set mbFuncMap(mb1003) ppp:TBview_authsCB
  2011.     set mbFuncMap(mb112)  ppp:PBbundleCB
  2012.     set mbFuncMap(mb113)  ppp:PBbundle_link_groupCB
  2013.     set mbFuncMap(mb114)  ppp:PBbundle_network_protocolCB
  2014.     set mbFuncMap(mb115)  ppp:PBbundle_link_protocolCB
  2015.     set mbFuncMap(mb201)  ppp:PBlink_groupCB
  2016.     set mbFuncMap(mb211)  ppp:PBlink_group_linkCB
  2017.     set mbFuncMap(mb212)  ppp:PBlink_group_link_protocolCB
  2018.     set mbFuncMap(mb301)  ppp:PBauthCB
  2019.     set mbWidgetMap(mb110) $PDadd
  2020.     set mbWidgetMap(mb120) $PBmodify
  2021.     set mbWidgetMap(mb130) $PBdelete
  2022.     set mbWidgetMap(mb112) $PBbundle_add_bundle
  2023.     set mbWidgetMap(mb113) $PBbundle_add_link_group
  2024.     set mbWidgetMap(mb114) $PBbundle_add_network_protocol
  2025.     set mbWidgetMap(mb115) $PBbundle_add_link_protocol
  2026.     set mbWidgetMap(mb201) $PBlink_group_add_link_group
  2027.     set mbWidgetMap(mb211) $PBlink_group_add_link
  2028.     set mbWidgetMap(mb212) $PBlink_group_add_link_protocol
  2029.     set mbWidgetMap(mb301) $PBauth_add_auth
  2030.     set sel2mb(sel101) mb112
  2031.     set sel2mb(sel105) mb113
  2032.     set sel2mb(sel106) mb114
  2033.     set sel2mb(sel107) mb115
  2034.     set sel2mb(sel201) mb201
  2035.     set sel2mb(sel202) mb211
  2036.     set sel2mb(sel203) mb212
  2037.     set sel2mb(sel301) mb301
  2038.     set visibleMap(all) {mb112 mb113 mb114 mb115 mb201 mb211 mb212 mb301}
  2039.     set visibleMap(mb1001) {mb112 mb113 mb114 mb115}
  2040.     set visibleMap(mb1002) {mb201 mb211 mb212}
  2041.     set visibleMap(mb1003) {mb301}
  2042.     set sensitiveMap(mb1001) ppp:setButtons_bundles
  2043.     set sensitiveMap(mb1002) ppp:setButtons_links
  2044.     set sensitiveMap(mb1003) ppp:setButtons_auths
  2045. }
  2046. proc ppp:execOp {op mb ind sel view cbs} {
  2047.     Globals
  2048.     ppp:chain_clear
  2049.     set res [eval $mbFuncMap($mb) \$op \"\$mb\" \"\$ind\" \"\$sel\" \"$view\" \$cbs]
  2050.     return $res
  2051. }
  2052. proc ppp:setButtons {ind} {
  2053.     Globals
  2054.     GetUser $TBview view
  2055.     set i3 [intersect3 $visibleMap($view) $visibleMap(all)]
  2056.     foreach button [lindex $i3 1] {
  2057.         VtSetValues $mbWidgetMap($button) -hidden 0
  2058.     }
  2059.     foreach button [lindex $i3 2] {
  2060.         VtSetValues $mbWidgetMap($button) -hidden 1
  2061.     }
  2062.     wget $FDppp PDadd PBmodify PBdelete
  2063.     if {[cequal $ind ""]} {
  2064.         SetSens $PBmodify 0
  2065.         SetSens $PBdelete 0
  2066.         foreach button $visibleMap(all) {
  2067.             SetSens $mbWidgetMap($button) 0
  2068.         }
  2069.     } else {
  2070.         SetSens $PBmodify 1
  2071.         SetSens $PBdelete 1
  2072.     }
  2073.     $sensitiveMap($view) $ind
  2074. }
  2075. proc ppp:setButtons_bundles {ind} {
  2076.     Globals
  2077.     wget $FDppp PBmodify PBbundle_add_bundle PBbundle_add_link_group PBbundle_add_network_protocol PBbundle_add_link_protocol
  2078.     if {[cequal $ind ""]} {
  2079.         SetSens $PBbundle_add_bundle 1
  2080.     } else {
  2081.         set sel [dl:get $DLlist $ind SEL]
  2082.         switch $sel {
  2083.             sel101 {
  2084.                 set bundle_tag [dl:get $DLlist $ind OBJ]
  2085.                 SetSens $PBbundle_add_link_group 1
  2086.                 SetSens $PBbundle_add_network_protocol 1
  2087.                 SetSens $PBbundle_add_link_protocol 1
  2088.             }
  2089.             sel105 {
  2090.                 SetSens $PBmodify 0
  2091.                 SetSens $PBbundle_add_link_group 0
  2092.                 SetSens $PBbundle_add_network_protocol 0
  2093.                 SetSens $PBbundle_add_link_protocol 0
  2094.             }
  2095.             sel106 -
  2096.             sel107 {
  2097.                 set proto [dl:get $DLlist $ind PROTO]
  2098.                 set n [num_visible_opts protocol/$proto]
  2099.                 if {$n > 0} {
  2100.                     SetSens $PBmodify 1
  2101.                 } else {
  2102.                     SetSens $PBmodify 0
  2103.                 }
  2104.                 SetSens $PBbundle_add_link_group 0
  2105.                 SetSens $PBbundle_add_network_protocol 0
  2106.                 SetSens $PBbundle_add_link_protocol 0
  2107.             }
  2108.         }
  2109.     }
  2110. }
  2111. proc ppp:setButtons_links {ind} {
  2112.     Globals
  2113.     wget $FDppp PBmodify PBlink_group_add_link_group PBlink_group_add_link PBlink_group_add_link_protocol
  2114.     if {[cequal $ind ""]} {
  2115.         SetSens $PBlink_group_add_link_group 1
  2116.     } else {
  2117.         set sel [dl:get $DLlist $ind SEL]
  2118.         switch $sel {
  2119.             sel201 {
  2120.                 SetSens $PBlink_group_add_link 1
  2121.                 SetSens $PBlink_group_add_link_protocol 1
  2122.             }
  2123.             sel202 {
  2124.                 SetSens $PBmodify 0
  2125.                 SetSens $PBlink_group_add_link 0
  2126.                 SetSens $PBlink_group_add_link_protocol 0
  2127.             }
  2128.             sel203 {
  2129.                 set proto [dl:get $DLlist $ind PROTO]
  2130.                 set n [num_visible_opts protocol/$proto]
  2131.                 if {$n > 0} {
  2132.                     SetSens $PBmodify 1
  2133.                 } else {
  2134.                     SetSens $PBmodify 0
  2135.                 }
  2136.                 SetSens $PBlink_group_add_link 0
  2137.                 SetSens $PBlink_group_add_link_protocol 0
  2138.             }
  2139.         }
  2140.     }
  2141. }
  2142. proc ppp:setButtons_auths {ind} {
  2143.     Globals
  2144.     wget $FDppp PBauth_add_auth
  2145.     SetSens $PBauth_add_auth 1
  2146. }
  2147. proc ppp:setFormats {} {
  2148.     Globals
  2149.     GetUser $TBview view
  2150.     switch $view {
  2151.         mb1001 {
  2152.             dl:format $DLlist 0 0 {
  2153.                 {OBJ {DATA} ""} 
  2154.                 {SEL {DATA} ""} 
  2155.                 {PHASE {ICON 1 0 0} [dl:icon NI]}
  2156.                 {NAME {STRING 20} ""} 
  2157.                 {FREE {STRING 40} ""}
  2158.             }
  2159.             dl:format $DLlist 1 0 { 
  2160.                 {OBJ {DATA} ""} 
  2161.                 {SEL {DATA} ""} 
  2162.                 {BUNDLEIND {DATA} ""} 
  2163.                 {NAME {STRING 20} ""} 
  2164.                 {FREE {STRING 40} ""}
  2165.             }
  2166.             dl:format $DLlist 1 1 { 
  2167.                 {OBJ {DATA} ""} 
  2168.                 {SEL {DATA} ""} 
  2169.                 {PROTO {DATA} ""} 
  2170.                 {BUNDLEIND {DATA} ""} 
  2171.                 {PROTOCOL {STRING 20} ""} 
  2172.                 {FREE {STRING 40} ""}
  2173.             }
  2174.             dl:format $DLlist 1 2 { 
  2175.                 {OBJ {DATA} ""} 
  2176.                 {SEL {DATA} ""} 
  2177.                 {PROTO {DATA} ""} 
  2178.                 {BUNDLEIND {DATA} ""} 
  2179.                 {PROTOCOL {STRING 20} ""} 
  2180.                 {FREE {STRING 40} ""}
  2181.             }
  2182.         }
  2183.         mb1002 {
  2184.             dl:format $DLlist 0 0 { 
  2185.                 {OBJ {DATA} ""}
  2186.                 {SEL {DATA} ""} 
  2187.                 {TYPE {DATA} ""} 
  2188.                 {NAME {STRING 20} ""} 
  2189.                 {FREE {STRING 40} ""}
  2190.             }
  2191.             dl:format $DLlist 1 0 { 
  2192.                 {OBJ {DATA} ""} 
  2193.                 {SEL {DATA} ""} 
  2194.                 {LGIND {DATA} ""} 
  2195.                 {PHASE {ICON 1 0 0} [dl:icon NI]}
  2196.                 {DEV {STRING 20} ""} 
  2197.             }
  2198.             dl:format $DLlist 1 1 { 
  2199.                 {OBJ {DATA} ""} 
  2200.                 {SEL {DATA} ""} 
  2201.                 {PROTO {DATA} ""} 
  2202.                 {LGIND {DATA} ""} 
  2203.                 {PROTOCOL {STRING 20} ""} 
  2204.                 {FREE {STRING 40} ""}
  2205.             }
  2206.         }
  2207.         mb1003 {
  2208.             dl:format $DLlist 0 0 { 
  2209.                 {SEL {DATA} ""} 
  2210.                 {chap {DATA} ""} 
  2211.                 {pap {DATA} ""} 
  2212.                 {NAME {STRING 20} ""} 
  2213.                 {FREE {STRING 40} ""}
  2214.             }
  2215.         }
  2216.     }
  2217. }
  2218. ##################################################
  2219. proc ppp:DLselectCB {cbs} {
  2220.     Globals
  2221.     if {[dl:defer $DLlist]} {
  2222.         return
  2223.     }
  2224.     wget $FDppp PBexpand PBcollapse
  2225.     wget $FDppp PBexpandall PBcollapseall
  2226.     set selected [dl:selected $DLlist IND]
  2227.     if {[cequal $selected ""]} {
  2228.         GetUser $TBview sel
  2229.         SetSens $PBexpand 0
  2230.         SetSens $PBcollapse 0
  2231.     } else {
  2232.         set level [dl:get $DLlist $selected _LEVEL]
  2233.         set sel [dl:get $DLlist $selected SEL]
  2234.         set state [dl:state $DLlist $selected]
  2235.         switch $state {
  2236.             collapsed {
  2237.                 SetSens $PBexpand 1
  2238.                 SetSens $PBcollapse 0
  2239.             }
  2240.             expanded {
  2241.                 SetSens $PBexpand 0
  2242.                 SetSens $PBcollapse 1
  2243.             }
  2244.             default {
  2245.                 SetSens $PBexpand 0
  2246.                 if {$level > 0 } {
  2247.                     SetSens $PBcollapse 1
  2248.                 } else {
  2249.                     SetSens $PBcollapse 0
  2250.                 }
  2251.             }
  2252.         }
  2253.     }
  2254.     set total 0
  2255.     set expanded 0
  2256.     set collapsed 0
  2257.     set ind start
  2258.     while {![cequal $ind end]} {
  2259.         set ind [dl:next $DLlist $ind]
  2260.         if {![cequal $ind end]} {
  2261.             set state [dl:state $DLlist $ind]
  2262.             switch $state {
  2263.                 expanded  { 
  2264.                     incr expanded 
  2265.                     incr total
  2266.                 }
  2267.                 collapsed { 
  2268.                     incr collapsed 
  2269.                     incr total
  2270.                 }
  2271.             }
  2272.         }
  2273.     }
  2274.     if {$expanded < $total } {
  2275.         SetSens $PBexpandall 1
  2276.     } else {
  2277.         SetSens $PBexpandall 0
  2278.     }
  2279.     if {$collapsed < $total} {
  2280.         SetSens $PBcollapseall 1
  2281.     } else {
  2282.         SetSens $PBcollapseall 0
  2283.     }
  2284.     ppp:setButtons $selected
  2285. }
  2286. proc ppp:PDviewCB {force {cbs 0}} {
  2287.     Globals
  2288.     global view_state
  2289.     global TBview_bundles TBview_links TBview_auths
  2290.     if {$cbs == 0} {
  2291.         set cbs $force
  2292.         set force 0
  2293.     }
  2294.     keylget cbs widget TBwidget
  2295.     if {!$force && [cequal $TBwidget $TBview]} {
  2296.         VtSetValues $TBview -value 1
  2297.         VtUnLock
  2298.         return
  2299.     }
  2300.     if {![cequal $TBview null]} {
  2301.         VtSetValues $TBview -value 0
  2302.     }
  2303.     if {![cequal $TBview $TBview_auths]} {
  2304.         set view_state($TBview) ""
  2305.         set ind start
  2306.         while {![cequal $ind end]} {
  2307.             set ind [dl:find $DLlist $ind down {{_LEVEL 0}}]
  2308.             if {![cequal $ind end]} {
  2309.                 set tag [dl:get $DLlist $ind OBJ]
  2310.                 set state [dl:state $DLlist $ind]
  2311.                 if {![cequal $state collapsed]} {
  2312.                     lappend view_state($TBview) $tag
  2313.                 }
  2314.             }
  2315.             set ind [dl:next $DLlist $ind]
  2316.         }
  2317.     }
  2318.     set TBview $TBwidget
  2319.     SetVar $FDppp TBview
  2320.     GetUser $TBview view
  2321.     if {![info exist view_state($TBview)]} {
  2322.         set view_state($TBview) ""
  2323.     }
  2324.     VtDrawnListDeleteItem $DLlist -all
  2325.     ppp:execOp view $view "" "" $view $cbs
  2326.     ppp:DLselectCB $cbs
  2327.     VtUnLock
  2328. }
  2329. proc ppp:PBaddCB {cbs} {
  2330.     Globals
  2331.     set ind [dl:selected $DLlist IND]
  2332.     if {[cequal $ind ""]} {
  2333.         set sel ""
  2334.     } else {
  2335.         set sel [dl:selected $DLlist SEL]
  2336.     }
  2337.     keylget cbs widget PBwidget
  2338.     GetUser $PBwidget mb
  2339.     GetUser $TBview view
  2340.     ppp:execOp add $mb "$ind" "$sel" $view $cbs
  2341. }
  2342. proc ppp:PBmodifyCB {cbs} {
  2343.     Globals
  2344.     set ind [dl:selected $DLlist IND]
  2345.     if {[cequal $ind ""]} {
  2346.         VtUnLock
  2347.         return
  2348.     }
  2349.     set sel [dl:selected $DLlist SEL]
  2350.     set mb $sel2mb($sel)
  2351.     GetUser $TBview view
  2352.     ppp:execOp modify $mb "$ind" "$sel" $view $cbs
  2353. }
  2354. proc ppp:PBdeleteCB {cbs} {
  2355.     Globals
  2356.     set ind [dl:selected $DLlist IND]
  2357.     if {[cequal $ind ""]} {
  2358.         VtUnLock
  2359.         return
  2360.     }
  2361.     set sel [dl:selected $DLlist SEL]
  2362.     set mb $sel2mb($sel)
  2363.     GetUser $TBview view
  2364.     ppp:execOp delete $mb "$ind" "$sel" $view $cbs
  2365. }
  2366. ##################################################
  2367. proc ppp:PBauthCB {op mb ind sel view cbs} {
  2368.     Globals
  2369.     switch $op {
  2370.         add {
  2371.             auth:buildCB $op "$mb" "$ind" "$sel" $view $cbs
  2372.         }
  2373.         modify {
  2374.             auth:buildCB $op "$mb" "$ind" "$sel" $view $cbs
  2375.         }
  2376.         delete {
  2377.             keylget cbs dialog dialog
  2378.             if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "auth:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
  2379.                 VtUnLock
  2380.                 return
  2381.             }
  2382.         }
  2383.     }
  2384. }
  2385. proc auth:DLadd_auth {ind name} {
  2386.     Globals
  2387.     set name_ind [dl:add $DLlist $ind 0]
  2388.     dl:set $DLlist $name_ind ICON [dl:icon a]
  2389.     dl:set $DLlist $name_ind SEL sel301
  2390.     dl:set $DLlist $name_ind NAME $name
  2391.     dl:show $DLlist $name_ind 1
  2392.     return $name_ind
  2393. }
  2394. proc auth:DLinfo {ind} {
  2395.     Globals
  2396.     global free_gap
  2397.     set chap [dl:get $DLlist $ind chap]
  2398.     set pap [dl:get $DLlist $ind pap]
  2399.     set s ""
  2400.     append s [format "%s: " [ILM SCO_PPP_MSG_L_AUTH_PROTOCOLS]]
  2401.     if {![cequal $chap ""]} {
  2402.         append s "CHAP"
  2403.     }
  2404.     if {![cequal $chap ""] && ![cequal $pap ""]} {
  2405.         append s " "
  2406.     }
  2407.     if {![cequal $pap ""]} {
  2408.         append s "PAP"
  2409.     }
  2410.     dl:set $DLlist $ind FREE $s
  2411.     dl:show $DLlist $ind
  2412. }
  2413. proc auth:buildCB {op mb ind sel view cbs} {
  2414.     Globals
  2415.     keylget cbs dialog dialog
  2416.     if {[cequal $op add]} {
  2417.         set title [ILM SCO_PPP_MSG_TITLE_AUTH_ADD]
  2418.     } else {
  2419.         set title [ILM SCO_PPP_MSG_TITLE_AUTH_MOD]
  2420.     }
  2421.     wset $dialog FDauth [VtFormDialog $dialog.FDauth \
  2422.         -title $title \
  2423.         -ok \
  2424.         -okCallback auth:changeCB \
  2425.         -cancel \
  2426.         -cancelCallback VxEndFormCB \
  2427.         -autoDestroy 1 \
  2428.         -autoLock auth:changeCB \
  2429.         -help \
  2430.         ]
  2431.     wset $FDauth AFauth [AlignedForm $FDauth.AFauth [list \
  2432.         [list SCO_PPP_MSG_AUTH_APROTOCOL Laprotocol RBaprotocol \
  2433.             [list VtRadioBox \
  2434.                 -horizontal \
  2435.                 -callback auth:RBaprotocolCB \
  2436.                 ]] \
  2437.         [list SCO_PPP_MSG_AUTH_NAME Lname Tname \
  2438.             [list VtText \
  2439.                 -shortHelpString [ILM SCO_PPP_MSG_SH_AUTH_NAME] \
  2440.                 -shortHelpCallback SaShortHelpCB \
  2441.                 ]] \
  2442.         [list SCO_PPP_MSG_AUTH_CHAP_LOCALSECRET Lchap_localsecret Tchap_localsecret \
  2443.             [list VtText \
  2444.                 -rightSide FORM \
  2445.                 -shortHelpString [ILM SCO_PPP_MSG_SH_AUTH_CHAP_LOCALSECRET] \
  2446.                 -shortHelpCallback SaShortHelpCB \
  2447.                 ]] \
  2448.         [list SCO_PPP_MSG_AUTH_CHAP_PEERSECRET Lchap_peersecret Tchap_peersecret \
  2449.             [list VtText \
  2450.                 -rightSide FORM \
  2451.                 -shortHelpString [ILM SCO_PPP_MSG_SH_AUTH_CHAP_PEERSECRET] \
  2452.                 -shortHelpCallback SaShortHelpCB \
  2453.                 ]] \
  2454.         [list SCO_PPP_MSG_AUTH_PAP_LOCALSECRET Lpap_localsecret Tpap_localsecret \
  2455.             [list VtText \
  2456.                 -rightSide FORM \
  2457.                 -shortHelpString [ILM SCO_PPP_MSG_SH_AUTH_PAP_LOCALSECRET] \
  2458.                 -shortHelpCallback SaShortHelpCB \
  2459.                 ]] \
  2460.         [list SCO_PPP_MSG_AUTH_PAP_PEERSECRET Lpap_peersecret Tpap_peersecret \
  2461.             [list VtText \
  2462.                 -rightSide FORM \
  2463.                 -shortHelpString [ILM SCO_PPP_MSG_SH_AUTH_PAP_PEERSECRET] \
  2464.                 -shortHelpCallback SaShortHelpCB \
  2465.                 ]] \
  2466.             ]]
  2467. ####################
  2468.     wset $FDauth TBchap [cw VtToggleButton $RBaprotocol.TBchap \
  2469.         SCO_PPP_MSG_AUTH_CHAP \
  2470.         "" \
  2471.         SCO_PPP_MSG_SH_AUTH_CHAP \
  2472.         -userData chap \
  2473.         -value 0 \
  2474.         ]
  2475.     wset $FDauth TBpap [cw VtToggleButton $RBaprotocol.TBpap \
  2476.         SCO_PPP_MSG_AUTH_PAP \
  2477.         "" \
  2478.         SCO_PPP_MSG_SH_AUTH_PAP \
  2479.         -userData pap \
  2480.         -value 0 \
  2481.         ]
  2482.     wset $FDauth TBboth [cw VtToggleButton $RBaprotocol.TBboth \
  2483.         SCO_PPP_MSG_AUTH_BOTH \
  2484.         "" \
  2485.         SCO_PPP_MSG_SH_AUTH_BOTH \
  2486.         -userData both \
  2487.         -value 0 \
  2488.         ]
  2489. ####################
  2490.     set STauth [StatusBar $FDauth $AFauth]
  2491. ####################
  2492.     VtShow $FDauth
  2493.     wput $FDauth Lname Tname RBaprotocol \
  2494.         Lchap_peersecret Tchap_peersecret Lchap_localsecret Tchap_localsecret \
  2495.         Lpap_peersecret Tpap_peersecret Lpap_localsecret Tpap_localsecret 
  2496.     wput $FDauth op mb ind sel
  2497.     set auth_tag(chap) ""
  2498.     set auth_tag(pap) ""
  2499.     if {[cequal $op add]} {
  2500.         SetValues $RBaprotocol TBchap
  2501.     } else {
  2502.         SetSens $Lname 0
  2503.         SetSens $Tname 0
  2504.         set name [dl:get $DLlist $ind NAME]
  2505.         SetValues $Tname name
  2506.         foreach tag [PPP:list auth] {
  2507.             PPP:get auth $tag name auth_name
  2508.             PPP:get auth $tag protocol auth_protocol
  2509.             if {[cequal $name $auth_name]} {
  2510.                 set auth_tag($auth_protocol) $tag
  2511.             }
  2512.         }
  2513.         set i 0
  2514.         if {![cequal $auth_tag(chap) ""]} {
  2515.             incr i 1
  2516.             PPP:get auth $auth_tag(chap) localsecret localsecret
  2517.             PPP:get auth $auth_tag(chap) peersecret peersecret
  2518.             set localsecret [cshrink $localsecret]
  2519.             set peersecret [cshrink $peersecret]
  2520.             SetValues $Tchap_localsecret localsecret
  2521.             SetValues $Tchap_peersecret peersecret
  2522.         }
  2523.         if {![cequal $auth_tag(pap) ""]} {
  2524.             incr i 2
  2525.             PPP:get auth $auth_tag(pap) localsecret localsecret
  2526.             PPP:get auth $auth_tag(pap) peersecret peersecret
  2527.             set localsecret [cshrink $localsecret]
  2528.             set peersecret [cshrink $peersecret]
  2529.             SetValues $Tpap_localsecret localsecret
  2530.             SetValues $Tpap_peersecret peersecret
  2531.         }
  2532.         switch $i {
  2533.             0 {
  2534.                 SetValues $RBaprotocol TBchap
  2535.             }
  2536.             1 {
  2537.                 SetValues $RBaprotocol TBchap
  2538.             }
  2539.             2 {
  2540.                 SetValues $RBaprotocol TBpap
  2541.             }
  2542.             3 {
  2543.                 SetValues $RBaprotocol TBboth
  2544.             }
  2545.         }
  2546.     }
  2547.     VxSetVar $FDauth chap_tag $auth_tag(chap)
  2548.     VxSetVar $FDauth pap_tag $auth_tag(pap)
  2549.     SetSens $RBaprotocol 1
  2550.     SaSetTabGroups $FDauth [list \
  2551.         $RBaprotocol \
  2552.         $Tname \
  2553.         $Tchap_localsecret \
  2554.         $Tchap_peersecret \
  2555.         $Tpap_localsecret \
  2556.         $Tpap_peersecret \
  2557.         ]
  2558.     SaSetFocusList $FDauth [list \
  2559.         $RBaprotocol \
  2560.         $Tname \
  2561.         $Tchap_localsecret \
  2562.         $Tchap_peersecret \
  2563.         $Tpap_localsecret \
  2564.         $Tpap_peersecret \
  2565.         ]
  2566.     VtUnLock
  2567. }
  2568. proc auth:RBaprotocolCB {cbs} {
  2569.     keylget cbs dialog FDauth
  2570.     keylget cbs widget RBaprotocol
  2571.     if {![GetSens $RBaprotocol]} {
  2572.         return
  2573.     }
  2574.     wget $FDauth RBaprotocol \
  2575.         Lchap_peersecret Tchap_peersecret Lchap_localsecret Tchap_localsecret \
  2576.         Lpap_peersecret Tpap_peersecret Lpap_localsecret Tpap_localsecret 
  2577.     GetValues $RBaprotocol TB
  2578.     GetUser $TB aprotocol
  2579.     set chap 1
  2580.     set pap 1
  2581.     switch $aprotocol {
  2582.         chap { set pap 0 }
  2583.         pap { set chap 0 }
  2584.     }
  2585.     SetSens $Lchap_peersecret $chap
  2586.     SetSens $Tchap_peersecret $chap
  2587.     SetSens $Lchap_localsecret $chap
  2588.     SetSens $Tchap_localsecret $chap
  2589.     SetSens $Lpap_peersecret $pap
  2590.     SetSens $Tpap_peersecret $pap
  2591.     SetSens $Lpap_localsecret $pap
  2592.     SetSens $Tpap_localsecret  $pap
  2593. }
  2594. proc auth:changeCB {cbs} {
  2595.     Globals
  2596.     keylget cbs dialog FDauth
  2597.     wget $FDauth RBaprotocol Tname \
  2598.         Lchap_peersecret Tchap_peersecret Lchap_localsecret Tchap_localsecret \
  2599.         Lpap_peersecret Tpap_peersecret Lpap_localsecret Tpap_localsecret 
  2600.     wget $FDauth op ind
  2601.     GetValues $Tname name
  2602.     set name [validTag $name]
  2603.     SetValues $Tname name
  2604.     GetValues $Tchap_peersecret chap_peersecret
  2605.     GetValues $Tchap_localsecret chap_localsecret
  2606.     GetVar $FDauth chap_tag
  2607.     GetValues $Tpap_peersecret pap_peersecret
  2608.     GetValues $Tpap_localsecret pap_localsecret
  2609.     GetVar $FDauth pap_tag
  2610.     GetValues $RBaprotocol TB
  2611.     GetUser $TB aprotocol 
  2612.     if {[cequal $name ""]} {
  2613.         return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_NAME_NULL]]
  2614.     }
  2615.     if {[cequal $op add]} {
  2616.         foreach tag [PPP:list auth] {
  2617.             PPP:get auth $tag name auth_name
  2618.             if {[cequal $name $auth_name]} {
  2619.                 return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_NAME_DUPLICATE]]
  2620.             }
  2621.         }
  2622.     }
  2623.     set i 0
  2624.     if {[cequal $chap_tag ""] && ![cequal $aprotocol pap]} {
  2625.         set chap_tag chap_$name
  2626.         incr i 1
  2627.         set attrValueList ""
  2628.         keylset attrValueList protocol chap
  2629.         keylset attrValueList name $name
  2630.         keylset attrValueList localsecret $chap_localsecret
  2631.         keylset attrValueList peersecret $chap_peersecret
  2632.         if {![PPP:create auth $chap_tag $attrValueList]} {
  2633.             return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_CHAP_CREATE]]
  2634.         }
  2635.     } elseif {![cequal $chap_tag ""] && [cequal $aprotocol pap]} {
  2636.         if {![PPP:delete auth $chap_tag]} {
  2637.             return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_CHAP_DELETE]]
  2638.         }
  2639.     } elseif {![cequal $chap_tag ""]} {
  2640.         if {![PPP:replace auth $chap_tag localsecret $chap_localsecret]} {
  2641.             return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_CHAP_REPLACE]]
  2642.         }
  2643.         if {![PPP:replace auth $chap_tag peersecret $chap_peersecret]} {
  2644.             return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_CHAP_REPLACE]]
  2645.         }
  2646.     } else {
  2647.         incr i 1
  2648.     }
  2649.     if {[cequal $pap_tag ""] && ![cequal $aprotocol chap]} {
  2650.         set pap_tag pap_$name
  2651.         incr i 2
  2652.         set attrValueList ""
  2653.         keylset attrValueList protocol pap
  2654.         keylset attrValueList name $name
  2655.         keylset attrValueList localsecret $pap_localsecret
  2656.         keylset attrValueList peersecret $pap_peersecret
  2657.         if {![PPP:create auth $pap_tag $attrValueList]} {
  2658.             return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_PAP_CREATE]]
  2659.         }
  2660.     } elseif {![cequal $pap_tag ""] && [cequal $aprotocol chap]} {
  2661.         if {![PPP:delete auth $pap_tag]} {
  2662.             return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_PAP_DELETE]]
  2663.         }
  2664.     } elseif {![cequal $pap_tag ""]} {
  2665.         if {![PPP:replace auth $pap_tag localsecret $pap_localsecret]} {
  2666.             return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_PAP_REPLACE]]
  2667.         }
  2668.         if {![PPP:replace auth $pap_tag peersecret $pap_peersecret]} {
  2669.             return [throwError $FDauth [ILM SCO_PPP_ERR_AUTH_PAP_REPLACE]]
  2670.         }
  2671.     } else {
  2672.         incr i 2
  2673.     }
  2674.     if {$i == 3} {
  2675.         set ind [auth:DLadd_auth end $name]
  2676.     }
  2677.     dl:set $DLlist $ind chap $chap_tag
  2678.     dl:set $DLlist $ind pap $pap_tag
  2679.     dl:show $DLlist $ind 1
  2680.     auth:DLinfo $ind
  2681.     ppp:viewsort $ind
  2682.     dl:fixconn $DLlist $ind
  2683.     VxEndFormCB $cbs
  2684.     ppp:chain_next
  2685.     VtUnLock
  2686. }
  2687. proc auth:deleteCB {op mb ind sel view cbs args} {
  2688.     Globals
  2689.     set chap_tag [dl:get $DLlist $ind chap]
  2690.     set pap_tag [dl:get $DLlist $ind pap]
  2691.     if {![cequal $chap_tag ""]} {
  2692.         if {![PPP:delete auth $chap_tag]} {
  2693.             return [throwError $FDppp [ILM SCO_PPP_ERR_AUTH_CHAP_DELETE]]
  2694.         }
  2695.     }
  2696.     if {![cequal $pap_tag ""]} {
  2697.         if {![PPP:delete auth $pap_tag]} {
  2698.             return [throwError $FDppp [ILM SCO_PPP_ERR_AUTH_PAP_DELETE]]
  2699.         }
  2700.     }
  2701.     dl:delete $DLlist $ind
  2702.     VtUnLock
  2703. }
  2704. ##################################################
  2705. proc ppp:PBlink_groupCB {op mb ind sel view cbs} {
  2706.     Globals
  2707.     switch $op {
  2708.         add {
  2709.             link_group:buildCB $op "$mb" "$ind" "$sel" $view $cbs
  2710.         }
  2711.         modify {
  2712.             link_group:buildCB $op "$mb" "$ind" "$sel" $view $cbs
  2713.         }
  2714.         delete {
  2715.             keylget cbs dialog dialog
  2716.             if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "link_group:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
  2717.                 VtUnLock
  2718.                 return
  2719.             }
  2720.         }
  2721.     }
  2722. }
  2723. proc link_group:RBtypeCB {cbs} {
  2724.     keylget cbs dialog FDlinks
  2725.     keylget cbs value value
  2726.     wget $FDlinks RBtype Lflow RBflow TBflowHardware Tpush Tpop
  2727.     GetValues $RBtype TB
  2728.     GetUser $TB type
  2729.     if {[cequal $type ISDN_SYNC]} {
  2730.         SetSens $Lflow 0
  2731.         SetSens $RBflow 0
  2732.         SetValues $RBflow TBflowHardware
  2733.     } else {
  2734.         SetSens $Lflow 1
  2735.         SetSens $RBflow 1
  2736.     }
  2737.     VtSetValues $Tpop -value [PPP:default link pop [list [list type $type]]]
  2738.     VtSetValues $Tpush -value [PPP:default link push [list [list type $type]]]
  2739.     VtUnLock
  2740. }
  2741. proc link_group:buildCB {op mb ind sel view cbs} {
  2742.     Globals
  2743.     keylget cbs dialog dialog
  2744.     if {[cequal $op add]} {
  2745.         set title [ILM SCO_PPP_MSG_TITLE_LINKS_ADD]
  2746.     } else {
  2747.         set title [ILM SCO_PPP_MSG_TITLE_LINKS_MOD]
  2748.     }
  2749.     wset $dialog FDlinks [VtFormDialog $dialog.FDlinks \
  2750.         -title $title \
  2751.         -ok \
  2752.         -okCallback link_group:changeCB \
  2753.         -cancel \
  2754.         -cancelCallback VxEndFormCB \
  2755.         -autoDestroy 1 \
  2756.         -autoLock link_group:changeCB \
  2757.         -help \
  2758.         ]
  2759.     set FTDlinks [FormTabDialog $FDlinks.FTDlinks]
  2760.     FormTabs $FTDlinks [list \
  2761.         [list FTlinks \
  2762.             SCO_PPP_MSG_FT_LINKS \
  2763.             SCO_PPP_MSG_TITLE_FT_LINKS \
  2764.             SCO_PPP_MSG_SH_FT_LINKS \
  2765.             ] \
  2766.         ]
  2767.     if {[cequal $op add]} {
  2768.         set FTlprotocols [cw SaFormTab $FTDlinks.FTlprotocols \
  2769.             SCO_PPP_MSG_LINK_FT_LPROTOCOLS \
  2770.             SCO_PPP_MSG_TITLE_LINK_FT_LPROTOCOLS \
  2771.             SCO_PPP_MSG_SH_LINK_FT_LPROTOCOLS \
  2772.             ]
  2773.     } else {
  2774.         set FTlprotocols ""
  2775.     }
  2776.     set FTadvanced [cw SaFormTab $FTDlinks.FTadvanced \
  2777.         SCO_PPP_MSG_LINK_FT_ADVANCED \
  2778.         SCO_PPP_MSG_TITLE_LINK_FT_ADVANCED \
  2779.         SCO_PPP_MSG_SH_LINK_FT_ADVANCED \
  2780.         ]
  2781.     wset $FDlinks AFlinks [AlignedForm $FTlinks.AFlinks [list \
  2782.         [list SCO_PPP_MSG_LINKS_NAME Lname Tname \
  2783.             [list VtText \
  2784.                 -userData "" \
  2785.                 -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_NAME] \
  2786.                 -shortHelpCallback SaShortHelpCB \
  2787.                 ]] \
  2788.         [list SCO_PPP_MSG_LINKS_TYPES Ltype RBtype \
  2789.             [list VtRadioBox \
  2790.                 -callback link_group:RBtypeCB \
  2791.                 -autoLock link_group:RBtypeCB \
  2792.                 -horizontal \
  2793.                 -numColumns 2 \
  2794.                 -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_TYPES] \
  2795.                 -shortHelpCallback SaShortHelpCB \
  2796.                 ]] \
  2797.         [list SCO_PPP_MSG_LINKS_FLOW Lflow RBflow \
  2798.             [list VtRadioBox \
  2799.                 -horizontal \
  2800.                 -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_FLOW] \
  2801.                 -shortHelpCallback SaShortHelpCB \
  2802.                 ]] \
  2803.         [list SCO_PPP_MSG_LINKS_PHONE Lphone Tphone \
  2804.             [list VtText \
  2805.                 -userData "" \
  2806.                 -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_PHONE] \
  2807.                 -shortHelpCallback SaShortHelpCB \
  2808.                 ]] \
  2809.             ]]
  2810.     if {[cequal $op add]} {
  2811.         wset $FDlinks AFlprotocols [AlignedForm $FTlprotocols.AFlprotocols [list \
  2812.             [list SCO_PPP_MSG_LPROTOCOLS Llprotocols LSlprotocols \
  2813.                 [list VtList \
  2814.                     -callback link_group:LSlprotocols_selectCB \
  2815.                     -selection MULTIPLE \
  2816.                     -scrollBar 1 \
  2817.                     -columns 25 \
  2818.                     -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_LPROTOCOLS] \
  2819.                     -shortHelpCallback SaShortHelpCB \
  2820.                     ]] \
  2821.                 ]]
  2822.     } else {
  2823.         set LSlprotocols ""
  2824.     }
  2825.     wset $FDlinks AFadvanced [AlignedForm $FTadvanced.AFadvanced [list \
  2826.         [list SCO_PPP_MSG_LINKS_BANDWIDTH Lbandwidth SBbandwidth \
  2827.             [list VxSpinButton \
  2828.                 10 0 "" 2147483647 "" 1 0 "" "" \
  2829.                 ]] \
  2830.         [list SCO_PPP_MSG_LINKS_PUSH Lpush Tpush \
  2831.             [list VtText \
  2832.                 -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_PUSH] \
  2833.                 -shortHelpCallback SaShortHelpCB \
  2834.                 ]] \
  2835.         [list SCO_PPP_MSG_LINKS_POP Lpop Tpop \
  2836.             [list VtText \
  2837.                 -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_POP] \
  2838.                 -shortHelpCallback SaShortHelpCB \
  2839.                 ]] \
  2840.             ]]
  2841.     VtSetValues $SBbandwidth \
  2842.         -rightSide NONE \
  2843.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_MAXLINKS] \
  2844.         -shortHelpCallback SaShortHelpCB
  2845.     foreach type {ACU ISDN_SYNC ISDN_ASYNC Direct} {
  2846.         set type_sens($type) [expr ![lempty [availableLinks $type]]]
  2847.     }
  2848.     wset $FDlinks TBtypeACU [VtToggleButton $RBtype.TBtypeACU \
  2849.         -userData ACU \
  2850.         -sensitive $type_sens(ACU) \
  2851.         -label [ILM SCO_PPP_MSG_LINKS_TYPES_ACU] \
  2852.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_TYPES_ACU] \
  2853.         -shortHelpCallback SaShortHelpCB \
  2854.     ]
  2855.     wset $FDlinks TBtypeDirect [VtToggleButton $RBtype.TBtypeDirect \
  2856.         -userData Direct \
  2857.         -sensitive $type_sens(Direct) \
  2858.         -label [ILM SCO_PPP_MSG_LINKS_TYPES_DIRECT] \
  2859.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_TYPES_DIRECT] \
  2860.         -shortHelpCallback SaShortHelpCB \
  2861.     ]
  2862.     wset $FDlinks TBtypeISDN_SYNC [VtToggleButton $RBtype.TBtypeISDN_SYNC \
  2863.         -userData ISDN_SYNC \
  2864.         -sensitive $type_sens(ISDN_SYNC) \
  2865.         -label [ILM SCO_PPP_MSG_LINKS_TYPES_ISDN_SYNC] \
  2866.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_TYPES_ISDN_SYNC] \
  2867.         -shortHelpCallback SaShortHelpCB \
  2868.     ]
  2869.     wset $FDlinks TBtypeISDN_ASYNC [VtToggleButton $RBtype.TBtypeISDN_ASYNC \
  2870.         -userData ISDN_ASYNC \
  2871.         -sensitive $type_sens(ISDN_ASYNC) \
  2872.         -label [ILM SCO_PPP_MSG_LINKS_TYPES_ISDN_ASYNC] \
  2873.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_TYPES_ISDN_ASYNC] \
  2874.         -shortHelpCallback SaShortHelpCB \
  2875.     ]
  2876.     set type_sel ""
  2877.     foreach type {ACU ISDN_SYNC ISDN_ASYNC Direct} {
  2878.         if {$type_sens($type)} {
  2879.             eval lappend type_sel \$TBtype$type
  2880.         }
  2881.     }
  2882. ##########
  2883.     wset $FDlinks TBflowHardware [VtToggleButton $RBflow.TBflowHardware \
  2884.         -userData hardware \
  2885.         -label [ILM SCO_PPP_MSG_LINKS_FLOW_HARDWARE] \
  2886.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_FLOW_HARDWARE] \
  2887.         -shortHelpCallback SaShortHelpCB \
  2888.     ]
  2889.     wset $FDlinks TBflowSoftware [VtToggleButton $RBflow.TBflowSoftware \
  2890.         -userData software \
  2891.         -label [ILM SCO_PPP_MSG_LINKS_FLOW_SOFTWARE] \
  2892.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_FLOW_SOFTWARE] \
  2893.         -shortHelpCallback SaShortHelpCB \
  2894.     ]
  2895.     wset $FDlinks TBflowNone [VtToggleButton $RBflow.TBflowNone \
  2896.         -userData none \
  2897.         -label [ILM SCO_PPP_MSG_LINKS_FLOW_NONE] \
  2898.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_FLOW_NONE] \
  2899.         -shortHelpCallback SaShortHelpCB \
  2900.     ]
  2901.     StatusBar $FDlinks $FTDlinks
  2902.     VtShow $FDlinks
  2903.     SaFormTabDialogMaxSize $FTDlinks
  2904.     SaFormTabSetSelected $FTlinks
  2905.     wput $FDlinks Tname RBtype Lflow RBflow Tphone SBbandwidth LSlprotocols \
  2906.         Tpop Tpush
  2907.     wput $FDlinks FTlinks FTlprotocols
  2908.     wput $FDlinks op mb ind sel view cbs
  2909.     if {[cequal $op add]} {
  2910.         if {![lempty $type_sel]} {
  2911.             VtSetValues $RBtype -value [lindex $type_sel 0]
  2912.         }
  2913.         SetValues $RBflow TBflowHardware
  2914.     } else {
  2915.         set lg_obj [dl:get $DLlist $ind OBJ]
  2916.         set name [dl:get $DLlist $ind NAME]
  2917.         SetValues $Tname name
  2918.         SetUser $Tname ind
  2919.         set info [GRP:get $lg_obj info]
  2920.         set group_attrs ""
  2921.         keylget info group_attrs group_attrs
  2922.         set phone ""
  2923.         keylget group_attrs phone phone
  2924.         SetValues $Tphone phone
  2925.         set flow hardware
  2926.         keylget group_attrs flow flow
  2927.         set flow_map(hardware) $TBflowHardware
  2928.         set flow_map(software) $TBflowSoftware
  2929.         set flow_map(none) $TBflowNone
  2930.         set flow $flow_map($flow)
  2931.         SetValues $RBflow flow
  2932.         set type [devTypes ACU]
  2933.         keylget group_attrs type type
  2934.         set type_map([devTypes ACU]) $TBtypeACU
  2935.         set type_map([devTypes ISDN_SYNC]) $TBtypeISDN_SYNC
  2936.         set type_map([devTypes ISDN_ASYNC]) $TBtypeISDN_ASYNC
  2937.         set type_map([devTypes Direct]) $TBtypeDirect
  2938.         set type $type_map($type)
  2939.         SetValues $RBtype type
  2940.         set bandwidth 0
  2941.         keylget group_attrs bandwidth bandwidth
  2942.         GetVar $SBbandwidth text
  2943.         SetValues $text bandwidth
  2944.         set push ""
  2945.         keylget group_attrs push push
  2946.         SetVar $Tpush push
  2947.         set pop ""
  2948.         keylget group_attrs pop pop
  2949.         SetVar $Tpop pop
  2950.         set bandwidth 0
  2951.         keylget group_attrs bandwidth bandwidth
  2952.         GetVar $SBbandwidth text
  2953.         SetValues $text bandwidth
  2954.         set tags [GRP:get $lg_obj tags]
  2955.         if {![lempty $tags]} {
  2956.             SetSens $RBtype 0
  2957.         }
  2958.         set lprotocols ""
  2959.     }
  2960.     if {[cequal $op add]} {
  2961.         set protocols ""
  2962.         set lprotocols [defn_list protocol link link]
  2963.     } else {
  2964.         set lprotocols ""
  2965.     }
  2966.     if {![lempty $LSlprotocols]} {
  2967.         set lpSel ""
  2968.         foreach protocol $lprotocols {
  2969.             keylget ppp_type_info($protocol) val val
  2970.             set proto [translit "a-z" "A-Z" $val]
  2971.             VtListAddItem $LSlprotocols \
  2972.                 -item $proto
  2973.             if {[cequal $op add] || ![lempty [findProtocolTag $val $protocols]]} {
  2974.                 VtListSelectItem $LSlprotocols \
  2975.                     -item $proto 
  2976.                 set_add lpSel $proto
  2977.             }
  2978.         }
  2979.         VxSetVar $LSlprotocols firstError 1
  2980.         SetVar $LSlprotocols lpSel
  2981.     }
  2982.     VtUnLock
  2983. }
  2984. proc link_group:LSlprotocols_selectCB {cbs} {
  2985.     keylget cbs dialog FDlinks
  2986.     keylget cbs value value
  2987.     keylget cbs mode mode
  2988.     keylget cbs widget LSlprotocols
  2989.     keylget cbs selectedItemList itemList
  2990.     GetVar $LSlprotocols lpSel
  2991.     set i3 [intersect3 $lpSel $itemList]
  2992.     if {[cequal "" [lindex $i3 0]]} {
  2993.         set value [lindex $i3 2]
  2994.         set mode select
  2995.     } else {
  2996.         set value [lindex $i3 0]
  2997.         set mode deselect
  2998.     }
  2999.     GetVar $LSlprotocols lpSel
  3000.     if {[cequal $mode deselect] && [cequal $value LCP]} {
  3001.         VtListSelectItem $LSlprotocols \
  3002.             -item $value 
  3003.         GetVar $LSlprotocols firstError
  3004.         if {$firstError} {
  3005.             VxSetVar $LSlprotocols firstError 0
  3006.             return [throwError $FDlinks [ILM SCO_PPP_ERR_PROTOCOL_LCP_DESELECT]]
  3007.         }
  3008.     }
  3009.     VxSetVar $LSlprotocols lpSel $itemList
  3010. }
  3011. proc link_group:changeCB {cbs} {
  3012.     Globals
  3013.     keylget cbs dialog FDlinks
  3014.     wget $FDlinks Tname RBtype Lflow RBflow Tphone SBbandwidth LSlprotocols \
  3015.         Tpop Tpush FTlinks
  3016.     wget $FDlinks op ind mb sel view 
  3017.     GetValues $Tname name
  3018.     GetUser $Tname lg_ind
  3019.     GetValues $Tphone phone
  3020.     GetVar $SBbandwidth text
  3021.     GetValues $text bandwidth
  3022.     GetValues $RBflow TB
  3023.     GetUser $TB flow
  3024.     GetValues $RBtype TB
  3025.     GetUser $TB type
  3026.     GetValues $Tpush push
  3027.     GetValues $Tpop pop
  3028.     set protocols ""
  3029.     set name [validName $name]
  3030.     if {[cequal $name ""]} {
  3031.         return [throwError $FDlinks [ILM SCO_PPP_ERR_LINKS_NAME_NULL]]
  3032.     }
  3033.     if {[cequal $op add]} {
  3034.         set old_flow ""
  3035.         set old_phone ""
  3036.         set old_bandwidth ""
  3037.         set old_push ""
  3038.         set old_pop ""
  3039.         set lprotocols [VtListGetSelectedItem $LSlprotocols -byItemList]
  3040.         if {[GRP:isTagPresent lg $name]} {
  3041.             SaFormTabSetSelected $FTlinks
  3042.             return [throwError $FDlinks [ILM SCO_PPP_ERR_LINKS_NAME_DUPLICATE]]
  3043.         }
  3044.         set lg_obj lg_${name}
  3045.         while {[GRP:isPresent $lg_obj]} {
  3046.             set lg_obj [cycleName $lg_obj]
  3047.         }
  3048.         foreach proto $lprotocols {
  3049.             set val [translit "A-Z" "a-z" $proto]
  3050.             set protocol_tag ${val}_${name}
  3051.             while {[PPP:isPresent protocol $protocol_tag]} {
  3052.                 set protocol_tag [cycleName $protocol_tag]
  3053.             }
  3054.             if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type link/$type]]]} {
  3055.                 foreach protocol_tag $protocols {
  3056.                     if {![PPP:isPresent protocol $protocol_tag]} {
  3057.                         continue
  3058.                     }
  3059.                     PPP:get protocol $protocol_tag protocol protocol
  3060.                     PPP:delete protocol/${protocol} $protocol_tag
  3061.                 }
  3062.                 return [throwError $FDlinks [ILM SCO_PPP_ERR_LINKS_CREATE]]
  3063.             }
  3064.             set_add protocols $protocol_tag
  3065.             set algorithms [defn_list algorithm link protocol/$val]
  3066.             if {![lempty $algorithms]} {
  3067.                 set txalgorithms ""
  3068.                 set rxalgorithms ""
  3069.                 foreach algorithm $algorithms {
  3070.                     set alval ""
  3071.                     keylget ppp_type_info($algorithm) val alval
  3072.                     if {[cequal $alval ""]} {
  3073.                         continue
  3074.                     }
  3075.                     set tx_tag tx_${val}_${alval}_${name}
  3076.                     set rx_tag rx_${val}_${alval}_${name}
  3077.                     while {[PPP:isPresent algorithm $rx_tag] || [PPP:isPresent algorithm $tx_tag]} {
  3078.                         set tx_tag [cycleName $tx_tag]
  3079.                         set rx_tag [cycleName $rx_tag]
  3080.                     }
  3081.                     set_add rxalgorithms $rx_tag
  3082.                     set_add txalgorithms $tx_tag
  3083.                     if {![PPP:create algorithm/${alval} $rx_tag]} {
  3084.                         set_del rxalgorithms $rx_tag
  3085.                     }
  3086.                     if {![PPP:create algorithm/${alval} $tx_tag]} {
  3087.                         set_del txalgorithms $tx_tag
  3088.                     }
  3089.                 }
  3090.                 PPP:replace protocol/${val} $protocol_tag txalgorithms $txalgorithms
  3091.                 PPP:replace protocol/${val} $protocol_tag rxalgorithms $rxalgorithms
  3092.             }
  3093.         }
  3094.         if {![GRP:create lg $lg_obj]} {
  3095.             return [throwError $FDlinks [ILM SCO_PPP_ERR_LINKS_NAME_CREATE]]
  3096.         }
  3097.         set info [GRP:get $lg_obj info]
  3098.     } else {
  3099.         set lg_obj [dl:get $DLlist $lg_ind OBJ]
  3100.         set old_name [dl:get $DLlist $lg_ind NAME]
  3101.         if {![cequal $name $old_name]} {
  3102.             if {[GRP:isTagPresent lg $name]} {
  3103.                 SaFormTabSetSelected $FTlinks
  3104.                 return [throwError $FDlinks [ILM SCO_PPP_ERR_LINKS_NAME_DUPLICATE]]
  3105.             }
  3106.             dl:set $DLlist $lg_ind NAME $name
  3107.             dl:show $DLlist $lg_ind 1
  3108.         }
  3109.         dl:set $DLlist $lg_ind TYPE $type
  3110.         set info [GRP:get $lg_obj info]
  3111.         keylget info group_attrs group_attrs
  3112.         keylget group_attrs flow old_flow
  3113.         keylget group_attrs phone old_phone
  3114.         keylget group_attrs bandwidth old_bandwidth
  3115.         keylget group_attrs push old_push
  3116.         keylget group_attrs pop old_pop
  3117.         keylget group_attrs protocols protocols
  3118.     }
  3119.     GRP:replace $lg_obj name $name
  3120.     set group_attrs ""
  3121.     keylset group_attrs type [devTypes $type]
  3122.     keylset group_attrs protocols $protocols
  3123.     keylset group_attrs flow $flow
  3124.     keylset group_attrs phone $phone
  3125.     keylset group_attrs bandwidth $bandwidth
  3126.     keylset group_attrs push $push
  3127.     keylset group_attrs pop $pop
  3128.     keylset info group_attrs $group_attrs
  3129.     GRP:replace $lg_obj info $info
  3130.     if {![cequal $flow $old_flow] || 
  3131.             ![cequal $phone $old_phone] ||
  3132.             ![cequal $bandwidth $old_bandwidth] ||
  3133.             ![cequal $push $old_push] ||
  3134.             ![cequal $pop $old_pop]} {
  3135.         set tags [GRP:get $lg_obj tags]
  3136.         keyldel group_attrs type
  3137.         foreach link_tag $tags {
  3138.             PPP:replace link $link_tag $group_attrs
  3139.             PPP:action link $link_tag reset
  3140.         }
  3141.     }
  3142.     if {[cequal $op add]} {
  3143.         set lg_ind [link_group:DLadd_link_group end $lg_obj 1]
  3144.         dl:select $DLlist $lg_ind
  3145.         set protocols_ind ""
  3146.         foreach protocol_tag $protocols {
  3147.             set protocol_ind [link_group:DLadd_protocol $lg_ind $lg_ind $protocol_tag 1]
  3148.             link_group:DLinfo_protocol $protocol_ind 1
  3149.             lappend protocols_ind $protocol_ind
  3150.         }
  3151.     }
  3152.     link_group:DLinfo $lg_ind
  3153.     ppp:viewsort $lg_ind
  3154.     dl:fixconn $DLlist $lg_ind
  3155.     ppp:DLselectCB $cbs
  3156.     if {[cequal $op add]} {
  3157.         set parent_cbs [VxGetVar $FDlinks cbs]
  3158.         foreach protocol_tag $protocols {
  3159.             set val [defn_type protocol $protocol_tag]
  3160.             set defn_info ""
  3161.             set modify_on_add 1
  3162.             keylget ppp_type_info(protocol/$val) defn_info defn_info
  3163.             keylget defn_info modify_on_add modify_on_add
  3164.             if {$modify_on_add} {
  3165.                 set rec ""
  3166.                 keylset rec op modify
  3167.                 keylset rec mb mb120
  3168.                 keylset rec ind [lvarpop protocols_ind]
  3169.                 keylset rec sel sel203
  3170.                 keylset rec view $view
  3171.                 keylset rec parent_cbs $parent_cbs
  3172.                 keylset rec func link_group_link_protocol:build_modifyCB
  3173.                 ppp:chain_add $rec
  3174.             }
  3175.         }
  3176.         set rec ""
  3177.         keylset rec op add
  3178.         keylset rec mb mb211
  3179.         keylset rec ind $lg_ind
  3180.         keylset rec sel sel201
  3181.         keylset rec view $view
  3182.         keylset rec parent_cbs $parent_cbs
  3183.         keylset rec func link_group_link:buildCB
  3184.         ppp:chain_add $rec
  3185.     }
  3186.     VxEndFormCB $cbs
  3187.     ppp:chain_next
  3188.     VtUnLock
  3189. }
  3190. proc link_group:deleteCB {op mb ind sel view cbs args} {
  3191.     Globals
  3192.     set lg_obj [dl:get $DLlist $ind OBJ]
  3193.     set tags [GRP:get $lg_obj tags]
  3194.     set info [GRP:get $lg_obj info]
  3195.     set group_attrs ""
  3196.     keylget info group_attrs group_attrs
  3197.     if {![lempty $tags]} {
  3198.         set link_ind [dl:next $DLlist $ind]
  3199.         set level [dl:get $DLlist $link_ind _LEVEL]
  3200.         set del_link_ind ""
  3201.         set del_proto_ind ""
  3202.         while {![cequal $link_ind end] && $level > 0} {
  3203.             set sel [dl:get $DLlist $link_ind SEL]
  3204.             switch $sel  {
  3205.                 sel202 {
  3206.                     lappend del_link_ind $link_ind
  3207.                 }
  3208.                 sel203 {
  3209.                     lappend del_proto_ind $link_ind
  3210.                 }
  3211.             }
  3212.             set link_ind [dl:next $DLlist $link_ind]
  3213.             if {![cequal $link_ind end]} {
  3214.                 set level [dl:get $DLlist $link_ind _LEVEL]
  3215.             }
  3216.         }
  3217.         foreach protocol_ind $del_proto_ind {
  3218.             set proto [dl:get $DLlist $protocol_ind PROTO]
  3219.             set protocol_tag [dl:get $DLlist $protocol_ind OBJ]
  3220.             if {![PPP:isPresent protocol $protocol_tag]} {
  3221.                 continue
  3222.             }
  3223.             set algorithms ""
  3224.             set txalgorithms ""
  3225.             set rxalgorithms ""
  3226.             PPP:get protocol $protocol_tag algorithms algorithms
  3227.             PPP:get protocol $protocol_tag txalgorithms txalgorithms
  3228.             PPP:get protocol $protocol_tag rxalgorithms rxalgorithms
  3229.             foreach al_tag [concat $algorithms $txalgorithms $rxalgorithms] {
  3230.                 if {![PPP:isPresent algorithm $al_tag]} {
  3231.                     continue
  3232.                 }
  3233.                 PPP:get algorithm $al_tag algorithm algorithm
  3234.                 if {![PPP:delete algorithm/$algorithm $al_tag]} {
  3235.                     return [throwError $FDppp [ILM SCO_PPP_ERR_LINKS_DELETE]]
  3236.                 }
  3237.             }
  3238.             if {![PPP:delete protocol/${proto} $protocol_tag]} {
  3239.                 return [throwError $FDppp [ILM SCO_PPP_ERR_LINKS_DELETE]]
  3240.             }
  3241.             dl:delete $DLlist $protocol_ind
  3242.         }
  3243.         dl:defer $DLlist 1
  3244.         foreach link_ind $del_link_ind {
  3245.             link_group_link:deleteCB delete mb130 $link_ind sel202 $view $cbs $args
  3246.         }
  3247.         dl:defer $DLlist 0
  3248.     }
  3249.     GRP:lg_update_ref $lg_obj ""
  3250.     GRP:delete $lg_obj
  3251.     dl:delete $DLlist $ind
  3252.     ppp:DLselectCB $cbs
  3253.     VtUnLock
  3254. }
  3255. proc link_group:DLadd_link_group {ind lg_tag show} {
  3256.     Globals
  3257.     set info [GRP:get $lg_tag info]
  3258.     set name [GRP:get $lg_tag name]
  3259.     set group_attrs ""
  3260.     set type ""
  3261.     keylget info group_attrs group_attrs
  3262.     keylget group_attrs type type
  3263.     set type [devTypes $type]
  3264.     set lg_ind [dl:add $DLlist $ind 0]
  3265.     dl:set $DLlist $lg_ind ICON [dl:icon lg]
  3266.     dl:set $DLlist $lg_ind SEL sel201
  3267.     dl:set $DLlist $lg_ind OBJ $lg_tag
  3268.     dl:set $DLlist $lg_ind NAME $name
  3269.     dl:set $DLlist $lg_ind TYPE $type
  3270.     dl:show $DLlist $lg_ind $show
  3271.     return $lg_ind
  3272. }
  3273. proc link_group:DLinfo {ind} {
  3274.     Globals
  3275.     global free_gap
  3276.     set tag [dl:get $DLlist $ind OBJ]
  3277.     set info [GRP:get $tag info]
  3278.     set group_attrs ""
  3279.     keylget info group_attrs group_attrs
  3280.     set type ""
  3281.     set flow ""
  3282.     set phone ""
  3283.     keylget group_attrs type type
  3284.     keylget group_attrs flow flow
  3285.     keylget group_attrs phone phone
  3286.     set s ""
  3287.     set show_flow 1
  3288.     append s [format "%s: " [ILM SCO_PPP_MSG_L_LINK_GROUP_TYPE]]
  3289.     switch [devTypes $type] {
  3290.         ACU        { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_TYPE_PSTN]] }
  3291.         ISDN_SYNC  {
  3292.                     append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_TYPE_ISDN_SYNC]]
  3293.                     set show_flow 0
  3294.             }
  3295.         ISDN_ASYNC {
  3296.                     append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_TYPE_ISDN_ASYNC]]
  3297.                     set show_flow 0
  3298.             }
  3299.         Direct     { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_TYPE_STATIC]] }
  3300.         default    { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_UNKNOWN]] }
  3301.     }
  3302.     if {$show_flow} {
  3303.         append s $free_gap
  3304.         append s [format "%s: " [ILM SCO_PPP_MSG_L_LINK_GROUP_FLOW]]
  3305.         switch $flow {
  3306.             hardware { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_FLOW_HARDWARE]] }
  3307.             software { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_FLOW_SOFTWARE]] }
  3308.             none     { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_FLOW_NONE]] }
  3309.             default  { append s [format "%s" [ILM SCO_PPP_MSG_L_LINK_GROUP_UNKNOWN]] }
  3310.         }
  3311.     }
  3312.     if {![cequal $phone ""]} {
  3313.         append s $free_gap
  3314.         append s [format "%s: %s" [ILM SCO_PPP_MSG_L_LINK_GROUP_PHONE] $phone]
  3315.     }
  3316.     dl:set $DLlist $ind FREE $s
  3317.     dl:show $DLlist $ind
  3318. }
  3319. ##################################################
  3320. proc ppp:PBlink_group_linkCB {op mb ind sel view cbs} {
  3321.     Globals
  3322.     switch $op {
  3323.         add {
  3324.             link_group_link:buildCB $op "$mb" "$ind" "$sel" $view $cbs
  3325.         }
  3326.         delete {
  3327.             keylget cbs dialog dialog
  3328.             if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "link_group_link:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
  3329.                 VtUnLock
  3330.                 return
  3331.             }
  3332.         }
  3333.     }
  3334. }
  3335. proc link_group_link:DLselectCB {from cbs} {
  3336.     keylget cbs dialog FDlink
  3337.     keylget cbs widget list
  3338.     set len [llength [VtDrawnListGetItem $list -all]]
  3339.     set pos [VtDrawnListGetSelectedItem $list -byPositionList]
  3340.     if {$pos == 0} {
  3341.         if {$len > 0} {
  3342.             VtDrawnListSelectItem $list -position 1
  3343.             set pos 1
  3344.         }
  3345.     }
  3346.     if {[cequal $from "linksAvail"]} {
  3347.         GetVar $FDlink PBadd
  3348.         SetSens $PBadd 1
  3349.     } else {
  3350.         GetVar $FDlink PBremove
  3351.         SetSens $PBremove 1
  3352.     }
  3353.     VtUnLock
  3354. }
  3355. proc link_group_link:PBaddCB {cbs} {
  3356.     keylget cbs dialog FDlink
  3357.     wget $FDlink PBadd DLlinksAvail DLlinksSel type linkFormatList
  3358.     set selected [lindex [VtDrawnListGetSelectedItem $DLlinksAvail -byRecordList] 0]
  3359.     set delpos [lindex [VtDrawnListGetSelectedItem $DLlinksAvail -byPositionList] 0]
  3360.     set addpos 0
  3361.     VtDrawnListAddItem $DLlinksSel \
  3362.         -position $addpos \
  3363.         -fieldList $selected
  3364.     VtDrawnListDeleteItem $DLlinksAvail -position $delpos
  3365.     SetSens $PBadd 0
  3366.     VtUnLock
  3367. }
  3368. proc link_group_link:PBremoveCB {cbs} {
  3369.     keylget cbs dialog FDlink
  3370.     wget $FDlink PBremove DLlinksAvail DLlinksSel type linkFormatList
  3371.     set selected [lindex [VtDrawnListGetSelectedItem $DLlinksSel -byRecordList] 0]
  3372.     set delpos [lindex [VtDrawnListGetSelectedItem $DLlinksSel -byPositionList] 0]
  3373.     set addpos 0
  3374.     lassign $selected dev link_tag loc
  3375.     VtDrawnListAddItem $DLlinksAvail \
  3376.         -position $addpos \
  3377.         -fieldList $selected
  3378.     VtDrawnListDeleteItem $DLlinksSel -position $delpos
  3379.     SetSens $PBremove 0
  3380.     VtUnLock
  3381. }
  3382. proc link_group_link:buildCB {op mb ind sel view cbs} {
  3383.     Globals
  3384.     global iconpath
  3385.     keylget cbs dialog FDlink
  3386.     if {[cequal $op add]} {
  3387.         set title [ILM SCO_PPP_MSG_TITLE_LINK_ADD]
  3388.     } else {
  3389.         set title [ILM SCO_PPP_MSG_TITLE_LINK_MOD]
  3390.     }
  3391.     wset $FDlink FDlink [VtFormDialog $FDlink.FDlink \
  3392.         -title $title \
  3393.         -ok \
  3394.         -okCallback link_group_link:changeCB \
  3395.         -cancel \
  3396.         -cancelCallback VxEndFormCB \
  3397.         -autoDestroy 1 \
  3398.         -autoLock link_group_link:changeCB \
  3399.         -resizable 0 \
  3400.         -help \
  3401.         ]
  3402.     set AFlink FORM
  3403.     wset $FDlink Flinks [VtForm $FDlink.Fdevices \
  3404.         -marginWidth 0 \
  3405.         -marginHeight 0 \
  3406.         -CHARM_marginHeight 1 \
  3407.         -leftSide FORM \
  3408.         -rightSide FORM \
  3409.         -topSide $AFlink \
  3410.         -CHARM_topOffset 0 \
  3411.         -MOTIF_topOffset 5 \
  3412.         -CHARM_resizable 0 \
  3413.         ]
  3414.     wset $FDlink LlinksAvail [VtLabel $Flinks.LlinksAvail \
  3415.         -label [ILM SCO_PPP_MSG_LINKS_AVAIL] \
  3416.         -topSide FORM \
  3417.         ]
  3418.     set linkFormatList {{DATA} {DATA} {DATA} {ICON 1} {STRING 30}}
  3419.     wset $FDlink DLlinksAvail [VtDrawnList $Flinks.DLlinksAvail \
  3420.         -formatList $linkFormatList \
  3421.         -iconList [list $iconpath/modem.px $iconpath/serial.px] \
  3422.         -CHARM_rows 7 \
  3423.         -MOTIF_rows 8 \
  3424.         -CHARM_columns 23 \
  3425.         -MOTIF_columns 20 \
  3426.         -horizontalScrollBar 1 \
  3427.         -callback "link_group_link:DLselectCB linksAvail" \
  3428.         -autoLock link_group_link:DLselectCB \
  3429.         -leftSide FORM \
  3430.         -topSide $LlinksAvail \
  3431.         -bottomSide FORM \
  3432.         -shortHelpCallback SaShortHelpCB \
  3433.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_AVAIL] \
  3434.         ]
  3435. ##########
  3436.     wset $FDlink RCbuttons [VtRowColumn $Flinks.RCbuttons \
  3437.         -CHARM_spacing 1 \
  3438.         -MOTIF_spacing 10 \
  3439.         -numColumns 1 \
  3440.         -packing COLUMN \
  3441.         -leftSide $DLlinksAvail \
  3442.         -rightSide NONE \
  3443.         -topSide 25 \
  3444.         -bottomSide FORM \
  3445.         ]
  3446.     wset $FDlink PBadd [VtPushButton $RCbuttons.PBadd \
  3447.         -label [ILM SCO_PPP_MSG_LINK_ADD] \
  3448.         -labelCenter \
  3449.         -callback link_group_link:PBaddCB \
  3450.         -autoLock link_group_link:PBaddCB \
  3451.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINK_ADD] \
  3452.         -shortHelpCallback SaShortHelpCB \
  3453.         ]
  3454.     wset $FDlink PBremove [VtPushButton $RCbuttons.RCremove \
  3455.         -label [ILM SCO_PPP_MSG_LINK_REMOVE] \
  3456.         -callback link_group_link:PBremoveCB \
  3457.         -autoLock link_group_link:PBremoveCB \
  3458.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINK_REMOVE] \
  3459.         -shortHelpCallback SaShortHelpCB \
  3460.         ]
  3461. ##########
  3462.     wset $FDlink LlinksSel [VtLabel $Flinks.LlinksSel \
  3463.         -label [ILM SCO_PPP_MSG_LINKS_SEL] \
  3464.         -labelCenter \
  3465.         -topSide FORM \
  3466.         -leftSide $RCbuttons \
  3467.         ]
  3468.     wset $FDlink DLlinksSel [VtDrawnList $Flinks.DLlinksSel \
  3469.         -formatList $linkFormatList \
  3470.         -iconList [list $iconpath/modem.px $iconpath/serial.px] \
  3471.         -CHARM_rows 7 \
  3472.         -MOTIF_rows 8 \
  3473.         -CHARM_columns 23 \
  3474.         -MOTIF_columns 20 \
  3475.         -horizontalScrollBar 1 \
  3476.         -callback "link_group_link:DLselectCB linksSel" \
  3477.         -autoLock link_group_link:DLselectCB \
  3478.         -leftSide $RCbuttons \
  3479.         -MOTIF_rightSide FORM \
  3480.         -topSide $LlinksSel \
  3481.         -rightSide NONE \
  3482.         -bottomSide FORM \
  3483.         -shortHelpCallback SaShortHelpCB \
  3484.         -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_SEL] \
  3485.         ]
  3486.     SetSens $PBadd 0
  3487.     SetSens $PBremove 0
  3488.     StatusBar $FDlink $Flinks
  3489.     VtShow $FDlink
  3490.     set lg_obj [dl:get $DLlist $ind OBJ]
  3491.     set type [dl:get $DLlist $ind TYPE]
  3492.     wput $FDlink linkFormatList
  3493.     wput $FDlink op mb ind sel type view cbs
  3494.     switch $type  {
  3495.         Direct {
  3496.             set icon 1
  3497.         }
  3498.         default {
  3499.             set icon 0
  3500.         }
  3501.     }
  3502.     set link_tags [GRP:get $lg_obj tags]
  3503.     foreach link_tag [lsort -command lsort_link $link_tags] {
  3504.         PPP:get link ${link_tag} dev dev
  3505.         if {![info exist link_channels($dev)]} {
  3506.             PPP:get link $link_tag type link_type
  3507.             set Devices_tag [Devices:find [devTypes $link_type] $dev]
  3508.             set link_channels($dev) [Devices:get $Devices_tag channels] 
  3509.         }
  3510.         if {![info exist link_instance($dev)]} {
  3511.             set link_instance($dev) 1
  3512.         } else {
  3513.             incr link_instance($dev)
  3514.         }
  3515.         if {$link_channels($dev) > 1} {
  3516.             set show_dev "$dev ($link_instance($dev))"
  3517.         } else {
  3518.             set show_dev "$dev"
  3519.         }
  3520.         VtDrawnListAddItem $DLlinksSel \
  3521.             -position 0 \
  3522.             -fieldList [list $dev $link_tag s $icon $show_dev]    
  3523.     }
  3524.     set links_devs_avail ""
  3525.     foreach link_tag [lsort -command lsort_link [availableLinks $type]] {
  3526.         PPP:get link ${link_tag} dev dev
  3527.         if {![info exist link_channels($dev)]} {
  3528.             PPP:get link $link_tag type link_type
  3529.             set Devices_tag [Devices:find [devTypes $link_type] $dev]
  3530.             set link_channels($dev) [Devices:get $Devices_tag channels] 
  3531.         }
  3532.         set links ""
  3533.         keylget links_devs_avail ${dev} links
  3534.         set_add links $link_tag
  3535.         keylset links_devs_avail ${dev} $links
  3536.     }
  3537.     foreach dev [lsort [keylkeys links_devs_avail]] {
  3538.         keylget links_devs_avail ${dev} links
  3539.         foreach link_tag $links {
  3540.             if {![info exist link_instance($dev)]} {
  3541.                 set link_instance($dev) 1
  3542.             } else {
  3543.                 incr link_instance($dev)
  3544.             }
  3545.             if {$link_channels($dev) > 1} {
  3546.                 set show_dev "$dev ($link_instance($dev))"
  3547.             } else {
  3548.                 set show_dev "$dev"
  3549.             }
  3550.             VtDrawnListAddItem $DLlinksAvail \
  3551.                 -position 0 \
  3552.                 -fieldList [list $dev $link_tag a $icon $show_dev]    
  3553.         }
  3554.     }
  3555.     SetVar $FDlink links_devs_avail
  3556.     VtUnLock
  3557. }
  3558. proc link_group_link:changeCB {cbs} {
  3559.     Globals
  3560.     keylget cbs dialog FDlink
  3561.     wget $FDlink links_devs_avail DLlinksSel DLlinksAvail
  3562.     wget $FDlink op ind sel view mb
  3563.     set lg_obj [dl:get $DLlist $ind OBJ]
  3564.     set name [GRP:get $lg_obj name]
  3565.     set info [GRP:get $lg_obj info]
  3566.     set group_attrs ""
  3567.     set flow ""
  3568.     set type ""
  3569.     set protocols ""
  3570.     keylget info group_attrs group_attrs
  3571.     keylget group_attrs flow flow
  3572.     keylget group_attrs type type
  3573.     keylget group_attrs protocols protocols
  3574.     set linksSel [VtDrawnListGetItem $DLlinksSel -all]
  3575.     set linksAvail [VtDrawnListGetItem $DLlinksAvail -all]
  3576.     set add_link_tags ""
  3577.     set del_link_tags ""
  3578.     set grp_lcp_tag [findProtocolTag lcp $protocols]
  3579.     if {![PPP:isPresent protocol/lcp $grp_lcp_tag]} {
  3580.         set grp_lcp_tag ""
  3581.     }
  3582.     if {[cequal $grp_lcp_tag ""]} {
  3583.         foreach linkSel $linksSel {
  3584.             lassign $linkSel dev link_tag loc
  3585.             if {[cequal $loc a]} {
  3586.                 continue
  3587.             }
  3588.             PPP:get link $link_tag protocols link_protocols
  3589.             set grp_lcp_tag [findProtocolTag lcp $link_protocols]
  3590.             if {![cequal $grp_lcp_tag ""]} {
  3591.                 break
  3592.             }
  3593.         }
  3594.     }
  3595.     if {[cequal $grp_lcp_tag ""]} {
  3596.         foreach linkAvail $linksAvail {
  3597.             lassign $linkAvail dev link_tag loc
  3598.             if {[cequal $loc a]} {
  3599.                 continue
  3600.             }
  3601.             PPP:get link $link_tag protocols link_protocols
  3602.             set grp_lcp_tag [findProtocolTag lcp $link_protocols]
  3603.             if {![cequal $grp_lcp_tag ""]} {
  3604.                 break
  3605.             }
  3606.         }
  3607.     }
  3608.     set state [dl:state $DLlist $ind]
  3609.     switch $state {
  3610.         collapsed {
  3611.             set expanded 0
  3612.         }
  3613.         default {
  3614.             set expanded 1
  3615.         }
  3616.     }
  3617.     if {![lempty $linksSel] && [cequal $grp_lcp_tag ""]} {
  3618.         set grp_lcp_tag lcp_$name
  3619.         while {[PPP:isPresent protocol/lcp $grp_lcp_tag]} {
  3620.             set grp_lcp_tag [cycleName $grp_lcp_tag]
  3621.         }
  3622.         PPP:create protocol/lcp $grp_lcp_tag "" [list [list parent_type link/$type]]
  3623.         keylget group_attrs protocols protocols
  3624.         set_add protocols $grp_lcp_tag
  3625.         keylset group_attrs protocols $protocols
  3626.         set lcp_ind [link_group:DLadd_protocol $ind $ind $grp_lcp_tag $expanded]
  3627.         link_group:DLinfo_protocol $lcp_ind $expanded
  3628.     } 
  3629.     foreach linkAvail $linksAvail {
  3630.         lassign $linkAvail dev link_tag loc
  3631.         if {[cequal $loc a]} {
  3632.             continue
  3633.         }
  3634.         set_add del_link_tags $link_tag
  3635.         set link_protocols ""
  3636.         if {[regexp "^link_(.*)$" $link_tag d body] && ![PPP:isPresent protocol/lcp lcp_$body]} {
  3637.             set lcp_tag lcp_$body
  3638.         } else {
  3639.             set lcp_tag lcp_0
  3640.         }
  3641.         while {[PPP:isPresent protocol/lcp $lcp_tag]} {
  3642.             set lcp_tag [cycleName $lcp_tag]
  3643.         }
  3644.         set_add link_protocols $lcp_tag
  3645.         PPP:create protocol/lcp $lcp_tag "" [list [list parent_type link/$type]]
  3646.         PPP:replace link $link_tag protocols $link_protocols
  3647.         PPP:action link $link_tag reset
  3648.     }
  3649.     foreach linkSel $linksSel {
  3650.         lassign $linkSel dev link_tag loc
  3651.         if {[cequal $loc s]} {
  3652.             continue
  3653.         }
  3654.         set tags ""    
  3655.         keylget links_devs_avail $dev tags
  3656.         if {[lempty $tags]} {
  3657.             set link_tag link_0
  3658.             while {[PPP:isPresent link $link_tag]} {
  3659.                 set link_tag [cycleName $link_tag]
  3660.             }
  3661.             set attrValueList ""
  3662.             keylset attrValueList dev $dev
  3663.             keylset attrValueList flow $flow
  3664.             keylset attrValueList type $type
  3665.             keylset attrValueList protocols $protocols
  3666.             PPP:create link $link_tag $attrValueList
  3667.             PPP:action link $link_tag reset
  3668.         } else {
  3669.             set link_tag [lvarpop tags]
  3670.             keylset links_devs_avail $dev $tags
  3671.             PPP:get link ${link_tag} protocols link_protocols
  3672.             set lcp_tag [findProtocolTag lcp $link_protocols]
  3673.             if {![cequal $lcp_tag end]} {
  3674.                 PPP:delete protocol/lcp $lcp_tag
  3675.             }
  3676.             PPP:replace link $link_tag protocols $protocols
  3677.             PPP:action link $link_tag reset
  3678.         }
  3679.         set_add add_link_tags $link_tag
  3680.     }
  3681.     set link_tags [GRP:get $lg_obj tags]
  3682.     foreach link_tag $add_link_tags {
  3683.         set link_ind [link_group_link:DLadd_link $ind $ind $link_tag $expanded]
  3684.         link_group_link:DLinfo $link_ind
  3685.         set_add link_tags $link_tag
  3686.     }
  3687.     foreach link_tag $del_link_tags {
  3688.         set link_ind [dl:find $DLlist start down [list [list OBJ $link_tag]]]
  3689.         if {![cequal $link_ind end]} {
  3690.             dl:delete $DLlist $link_ind
  3691.         }
  3692.         set_del link_tags $link_tag
  3693.     }
  3694.     GRP:lg_update_ref $lg_obj $link_tags
  3695.     keylset info group_attrs $group_attrs
  3696.     GRP:replace $lg_obj info $info
  3697.     ppp:viewsort $ind
  3698.     dl:fixconn $DLlist $ind
  3699.     ppp:DLselectCB $cbs
  3700.     VxEndFormCB $cbs
  3701.     ppp:chain_next
  3702.     VtUnLock
  3703. }
  3704. proc link_group_link:deleteCB {op mb ind sel view cbs args} {
  3705.     Globals
  3706.     keylget cbs dialog FDlink
  3707.     set link_tag [dl:get $DLlist $ind OBJ]
  3708.     set lg_ind [dl:get $DLlist $ind LGIND]
  3709.     set lg_obj [dl:get $DLlist $lg_ind OBJ]
  3710.     set tags [GRP:get $lg_obj tags]
  3711.     set protocols ""
  3712.     if {[regexp "^link_(.*)$" $link_tag d body] && ![PPP:isPresent protocol/lcp lcp_$body]} {
  3713.         set lcp_tag lcp_$body
  3714.     } else {
  3715.         set lcp_tag lcp_0
  3716.     }
  3717.     while {[PPP:isPresent protocol/lcp $lcp_tag]} {
  3718.         set lcp_tag [cycleName $lcp_tag]
  3719.     }
  3720.     set_add protocols $lcp_tag
  3721.     PPP:get link $link_tag type type
  3722.     PPP:create protocol/lcp $lcp_tag "" [list [list parent_type link/$type]]
  3723.     PPP:replace link $link_tag protocols $protocols
  3724.     set_del tags $link_tag
  3725.     dl:delete $DLlist $ind
  3726.     GRP:lg_update_ref $lg_obj $tags
  3727.     dl:fixconn $DLlist $lg_ind
  3728.     ppp:DLselectCB $cbs
  3729.     VtUnLock
  3730. }
  3731. proc link_group_link:DLadd_link {ind lg_ind link_tag show} {
  3732.     Globals
  3733.     set dev ""
  3734.     PPP:get link $link_tag dev dev
  3735.     PPP:get link $link_tag type type
  3736.     set link_ind [dl:add $DLlist $ind 1]
  3737.     switch [devTypes $type] {
  3738.         Direct  { dl:set $DLlist $link_ind ICON [dl:icon s] }
  3739.         default { dl:set $DLlist $link_ind ICON [dl:icon l] }
  3740.     }
  3741.     dl:set $DLlist $link_ind SEL sel202
  3742.     dl:set $DLlist $link_ind OBJ $link_tag
  3743.     dl:set $DLlist $link_ind DEV "$dev"
  3744.     dl:set $DLlist $link_ind LGIND $lg_ind
  3745.     set status [PPP:action link $link_tag status]
  3746.     set phase dead
  3747.     keylget status phase phase
  3748.     switch $phase {
  3749.         network {
  3750.             dl:set $DLlist $link_ind PHASE [dl:icon up]
  3751.         }
  3752.         default {
  3753.             dl:set $DLlist $link_ind PHASE [dl:icon NI]
  3754.         }
  3755.     }
  3756.     dl:show $DLlist $link_ind $show
  3757.     return $link_ind
  3758. }
  3759. proc link_group_link:DLinfo {ind} {
  3760. }
  3761. proc link_group:DLadd_protocol {ind lg_ind protocol_tag show} {
  3762.     Globals
  3763.     PPP:get protocol $protocol_tag protocol val
  3764.     keylget ppp_type_info(protocol/$val) sub_defn sub_defn
  3765.     set val [translit "a-z" "A-Z" $val]
  3766.     switch $sub_defn {
  3767.         link    { set sel sel203 }
  3768.     }
  3769.     set lprotocol_ind [dl:add $DLlist $ind 1 1]
  3770.     dl:set $DLlist $lprotocol_ind ICON [dl:icon pl]
  3771.     dl:set $DLlist $lprotocol_ind SEL $sel
  3772.     dl:set $DLlist $lprotocol_ind OBJ $protocol_tag
  3773.     dl:set $DLlist $lprotocol_ind PROTOCOL "$val"
  3774.     dl:set $DLlist $lprotocol_ind PROTO [defn_type protocol $protocol_tag]
  3775.     dl:set $DLlist $lprotocol_ind LGIND $lg_ind
  3776.     dl:show $DLlist $lprotocol_ind $show
  3777.     return $lprotocol_ind
  3778. }
  3779. proc link_group:DLinfo_protocol {ind show} {
  3780.     Globals
  3781.     set protocol [dl:get $DLlist $ind PROTO]
  3782.     set protocol_tag [dl:get $DLlist $ind OBJ]
  3783.     dl:set $DLlist $ind FREE [PPP:info protocol/$protocol $protocol_tag]
  3784.     dl:show $DLlist $ind $show
  3785. }
  3786. ##################################################
  3787. proc ppp:PBglobal_bundleCB {cbs} {
  3788.     return [global_bundle:buildCB $cbs]
  3789. }
  3790. proc global_bundle:buildCB {cbs} {
  3791.     Globals
  3792.     global managedHost
  3793.     keylget cbs dialog dialog
  3794.     wset $dialog FDglobal_bundle [VtFormDialog $dialog.FDglobal_bundle \
  3795.         -title [ILM SCO_PPP_MSG_TITLE_GLOBAL_BUNDLE] \
  3796.         -ok \
  3797.         -okCallback global_bundle:changeCB \
  3798.         -cancel \
  3799.         -cancelCallback VxEndFormCB \
  3800.         -autoDestroy 1 \
  3801.         -autoLock global_bundle:changeCB \
  3802.         -help \
  3803.         ]
  3804.     set FTDglobal_bundle [FormTabDialog $FDglobal_bundle.FTDglobal_bundle]
  3805.     FormTabs $FTDglobal_bundle [list \
  3806.         [list FTauth \
  3807.             SCO_PPP_MSG_GLOBAL_BUNDLE_FT_AUTH \
  3808.             SCO_PPP_MSG_TITLE_GLOBAL_BUNDLE_FT_AUTH \
  3809.             SCO_PPP_MSG_SH_GLOBAL_BUNDLE_FT_AUTH \
  3810.             ] \
  3811.         [list FTmultilink \
  3812.             SCO_PPP_MSG_GLOBAL_BUNDLE_FT_MULTILINK \
  3813.             SCO_PPP_MSG_TITLE_GLOBAL_BUNDLE_FT_MULTILINK \
  3814.             SCO_PPP_MSG_SH_GLOBAL_BUNDLE_FT_MULTILINK \
  3815.             ] \
  3816.         ]
  3817.     wset $FDglobal_bundle AFauth [AlignedForm $FTauth.AFauth [list \
  3818.         [list SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_CHAP Lrequirechap RBrequirechap \
  3819.             [list VtRadioBox \
  3820.                 -horizontal \
  3821.                 ]] \
  3822.         [list SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_PAP Lrequirepap RBrequirepap \
  3823.             [list VtRadioBox \
  3824.                 -horizontal \
  3825.                 ]] \
  3826.         [list SCO_PPP_MSG_GLOBAL_BUNDLE_AUTHNAME Lauthname CBauthname \
  3827.             [list VtComboBox \
  3828.                 -columns 25 \
  3829.                 -rows 5 \
  3830.                 -value "" \
  3831.                 -itemList [authNames] \
  3832.                 -shortHelpString [ILM SCO_PPP_MSG_SH_GLOBAL_BUNDLE_AUTHNAME] \
  3833.                 -shortHelpCallback SaShortHelpCB \
  3834.                 ]] \
  3835.         [list SCO_PPP_MSG_GLOBAL_BUNDLE_PEERAUTHNAME Lpeerauthname CBpeerauthname \
  3836.             [list VtComboBox \
  3837.                 -columns 25 \
  3838.                 -rows 5 \
  3839.                 -value "" \
  3840.                 -itemList [authNames] \
  3841.                 -shortHelpString [ILM SCO_PPP_MSG_SH_GLOBAL_BUNDLE_PEERAUTHNAME] \
  3842.                 -shortHelpCallback SaShortHelpCB \
  3843.                 ]] \
  3844.         [list SCO_PPP_MSG_GLOBAL_BUNDLE_AUTHTMOUT Lauthtmout SBauthtmout \
  3845.             [list VxSpinButton \
  3846.                 10 5 "" 300 "" 1 60 "" "" \
  3847.                 ]] \
  3848.             ]]
  3849.     wset $FDglobal_bundle AFmultilink [AlignedForm $FTmultilink.AFmultilink [list \
  3850.         [list SCO_PPP_MSG_GLOBAL_BUNDLE_MRRU Lmrru SBmrru \
  3851.             [list VxSpinButton \
  3852.                 10 256 "" 16384 "" 1 1500 "" "" \
  3853.                 ]] \
  3854.         [list SCO_PPP_MSG_GLOBAL_BUNDLE_SSN Lssn RBssn \
  3855.             [list VtRadioBox \
  3856.                 -horizontal \
  3857.                 ]] \
  3858.         [list SCO_PPP_MSG_GLOBAL_BUNDLE_ED Led RBed \
  3859.             [list VtRadioBox \
  3860.                 -horizontal \
  3861.                 ]] \
  3862.             ]]
  3863.     wset $FDglobal_bundle TBrequirepap_yes [cw VtToggleButton $RBrequirepap.TBrequirepap_yes \
  3864.         SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_PAP_YES \
  3865.         "" \
  3866.         SCO_PPP_MSG_SH_GLOBAL_BUNDLE_REQUIRE_PAP_YES \
  3867.         -userData enabled \
  3868.         -value 0 \
  3869.         ]
  3870.     wset $FDglobal_bundle TBrequirepap_no [cw VtToggleButton $RBrequirepap.TBrequirepap_no \
  3871.         SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_PAP_NO \
  3872.         "" \
  3873.         SCO_PPP_MSG_SH_GLOBAL_BUNDLE_REQUIRE_PAP_NO \
  3874.         -userData disabled \
  3875.         -value 1 \
  3876.         ]
  3877.     wset $FDglobal_bundle TBrequirechap_yes [cw VtToggleButton $RBrequirechap.TBreqchap_yes \
  3878.         SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_CHAP_YES \
  3879.         "" \
  3880.         SCO_PPP_MSG_SH_GLOBAL_BUNDLE_REQUIRE_CHAP_YES \
  3881.         -userData enabled \
  3882.         -value 0 \
  3883.         ]
  3884.     wset $FDglobal_bundle TBrequirechap_no [cw VtToggleButton $RBrequirechap.TBreqchap_no \
  3885.         SCO_PPP_MSG_GLOBAL_BUNDLE_REQUIRE_CHAP_NO \
  3886.         "" \
  3887.         SCO_PPP_MSG_SH_GLOBAL_BUNDLE_REQUIRE_CHAP_NO \
  3888.         -userData disabled \
  3889.         -value 1 \
  3890.         ]
  3891.     VtSetValues $SBauthtmout \
  3892.         -rightSide NONE \
  3893.         -shortHelpString [ILM SCO_PPP_MSG_SH_GLOBAL_BUNDLE_AUTHTMOUT] \
  3894.         -shortHelpCallback SaShortHelpCB
  3895.     VtSetValues $SBmrru \
  3896.         -rightSide NONE \
  3897.         -shortHelpString [ILM SCO_PPP_MSG_SH_GLOBAL_BUNDLE_MRRU] \
  3898.         -shortHelpCallback SaShortHelpCB
  3899.     wset $FDglobal_bundle TBssn_yes [cw VtToggleButton $RBssn.TBssn_yes \
  3900.         SCO_PPP_MSG_GLOBAL_BUNDLE_SSN_YES \
  3901.         "" \
  3902.         SCO_PPP_MSG_SH_GLOBAL_BUNDLE_SSN_YES \
  3903.         -userData enabled \
  3904.         -value 1 \
  3905.         ]
  3906.     wset $FDglobal_bundle TBssn_no [cw VtToggleButton $RBssn.TBssn_no \
  3907.         SCO_PPP_MSG_GLOBAL_BUNDLE_SSN_NO \
  3908.         "" \
  3909.         SCO_PPP_MSG_SH_GLOBAL_BUNDLE_SSN_NO \
  3910.         -userData disabled \
  3911.         -value 0 \
  3912.         ]
  3913.     wset $FDglobal_bundle TBed_yes [cw VtToggleButton $RBed.TBed_yes \
  3914.         SCO_PPP_MSG_GLOBAL_BUNDLE_ED_YES \
  3915.         "" \
  3916.         SCO_PPP_MSG_SH_GLOBAL_BUNDLE_ED_YES \
  3917.         -userData enabled \
  3918.         -value 1 \
  3919.         ]
  3920.     wset $FDglobal_bundle TBed_no [cw VtToggleButton $RBed.TBed_no \
  3921.         SCO_PPP_MSG_GLOBAL_BUNDLE_ED_NO \
  3922.         "" \
  3923.         SCO_PPP_MSG_SH_GLOBAL_BUNDLE_ED_NO \
  3924.         -userData disabled \
  3925.         -value 0 \
  3926.         ]
  3927.     StatusBar $FDglobal_bundle $FTDglobal_bundle
  3928.     VtShow $FDglobal_bundle
  3929.     SaFormTabDialogMaxSize $FTDglobal_bundle
  3930.     SaFormTabSetSelected $FTauth
  3931.     if {[PPP:isPresent global/bundle bundle]} {
  3932.         PPP:get global bundle requirepap requirepap
  3933.         PPP:get global bundle requirechap requirechap
  3934.         PPP:get global bundle authname authname
  3935.         PPP:get global bundle peerauthname peerauthname
  3936.         PPP:get global bundle authtmout authtmout
  3937.         PPP:get global bundle mrru mrru
  3938.         PPP:get global bundle ssn ssn
  3939.         PPP:get global bundle ed ed
  3940.     } else {
  3941.         set requirepap enabled
  3942.         set requirechap enabled
  3943.         set authname $managedHost
  3944.         set peerauthname ""
  3945.         set authtmout 60
  3946.         set mrru 1500
  3947.         set ssn enabled
  3948.         set ed enabled
  3949.     }
  3950.     switch $requirepap {
  3951.         enabled  { SetValues $RBrequirepap TBrequirepap_yes }
  3952.         disabled { SetValues $RBrequirepap TBrequirepap_no }
  3953.     }
  3954.     switch $requirechap {
  3955.         enabled  { SetValues $RBrequirechap TBrequirechap_yes }
  3956.         disabled { SetValues $RBrequirechap TBrequirechap_no }
  3957.     }
  3958.     SetValues $CBauthname authname
  3959.     SetValues $CBpeerauthname peerauthname
  3960.     SetUser $CBpeerauthname peerauthname
  3961.     GetVar $SBauthtmout text
  3962.     SetValues $text authtmout
  3963.     GetVar $SBmrru text
  3964.     SetValues $text mrru
  3965.     switch $ssn {
  3966.         enabled  { SetValues $RBssn TBssn_yes }
  3967.         disabled { SetValues $RBssn TBssn_no }
  3968.     }
  3969.     switch $ed {
  3970.         enabled  { SetValues $RBed TBed_yes }
  3971.         disabled { SetValues $RBed TBed_no }
  3972.     }
  3973.     wput $FDglobal_bundle RBrequirepap RBrequirechap CBauthname CBpeerauthname \
  3974.         SBauthtmout SBmrru RBssn RBed
  3975.     VtUnLock
  3976. }
  3977. proc global_bundle:changeCB {cbs} {
  3978.     Globals
  3979.     keylget cbs dialog FDglobal_bundle
  3980.     wget $FDglobal_bundle RBrequirepap RBrequirechap CBauthname CBpeerauthname \
  3981.         SBauthtmout SBmrru RBssn RBed
  3982.     GetValues $RBrequirepap TB
  3983.     GetUser $TB requirepap
  3984.     GetValues $RBrequirechap TB
  3985.     GetUser $TB requirechap
  3986.     GetValues $CBauthname authname
  3987.     GetValues $CBpeerauthname peerauthname
  3988.     GetVar $SBauthtmout text
  3989.     GetValues $text authtmout
  3990.     GetVar $SBmrru text
  3991.     GetValues $text mrru
  3992.     GetValues $RBssn TB
  3993.     GetUser $TB ssn
  3994.     GetValues $RBed TB
  3995.     GetUser $TB ed
  3996.     set authname [validName $authname]
  3997.     set peerauthname [validName $peerauthname]
  3998.     set rec ""
  3999.     keylset rec requirepap $requirepap
  4000.     keylset rec requirechap $requirechap
  4001.     keylset rec authname $authname
  4002.     keylset rec peerauthname $peerauthname
  4003.     keylset rec authtmout $authtmout
  4004.     keylset rec mrru $mrru
  4005.     keylset rec ssn $ssn
  4006.     keylset rec ed $ed
  4007.     if {![PPP:isPresent global/bundle bundle]} {
  4008.         keylset rec type bundle
  4009.         if {![PPP:create global/bundle bundle $rec]} {
  4010.             return [throwError $FDglobal_bundle [ILM SCO_PPP_ERR_GLOBAL_BUNDLE_CREATE]]
  4011.         }
  4012.     } else {
  4013.         if {![PPP:replace global/bundle bundle $rec]} {
  4014.             return [throwError $FDglobal_bundle [ILM SCO_PPP_ERR_GLOBAL_BUNDLE_REPLACE]]
  4015.         }
  4016.     }
  4017.     VxEndFormCB $cbs
  4018.     ppp:chain_next
  4019.     VtUnLock
  4020. }
  4021. ##################################################
  4022. proc bodMap {bod} {
  4023.     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]]
  4024.     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 ]
  4025.     return [lindex $out [lsearch $in $bod]]
  4026. }
  4027. proc bringupMap {bringup} {
  4028.     set in [list automatic manual [ILM SCO_PPP_MSG_BRINGUP_AUTOMATIC] [ILM SCO_PPP_MSG_BRINGUP_MANUAL]]
  4029.     set out [list [ILM SCO_PPP_MSG_BRINGUP_AUTOMATIC] [ILM SCO_PPP_MSG_BRINGUP_MANUAL] automatic manual]
  4030.     return [lindex $out [lsearch $in $bringup]]
  4031. }
  4032. proc ppp:PBbundleCB {op mb ind sel view cbs} {
  4033.     Globals
  4034.     switch $op {
  4035.         add {
  4036.             bundle:buildCB $op "$mb" "$ind" "$sel" $view $cbs
  4037.         }
  4038.         modify {
  4039.             bundle:buildCB $op "$mb" "$ind" "$sel" $view $cbs
  4040.         }
  4041.         delete {
  4042.             keylget cbs dialog dialog
  4043.             if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "bundle:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
  4044.                 VtUnLock
  4045.                 return
  4046.             }
  4047.         }
  4048.     }
  4049. }
  4050. ##################################################
  4051. proc bundle:DLadd_bundle {ind bundle_tag show} {
  4052.     Globals
  4053.     set bundle_ind [dl:add $DLlist $ind 0]
  4054.     set type disabled
  4055.     PPP:get bundle $bundle_tag type type
  4056.     switch $type {
  4057.         disabled       { set icon [dl:icon d] }
  4058.         in             { set icon [dl:icon i] }
  4059.         out            { set icon [dl:icon o] }
  4060.         bi-directional { set icon [dl:icon io] }
  4061.     }
  4062.     dl:set $DLlist $bundle_ind ICON $icon
  4063.     dl:set $DLlist $bundle_ind SEL sel101
  4064.     dl:set $DLlist $bundle_ind OBJ $bundle_tag
  4065.     dl:set $DLlist $bundle_ind NAME $bundle_tag
  4066.     set status [PPP:action bundle $bundle_tag status]
  4067.     set phase dead
  4068.     keylget status phase phase
  4069.     switch $phase {
  4070.         network {
  4071.             dl:set $DLlist $bundle_ind PHASE [dl:icon up]
  4072.         }
  4073.         default {
  4074.             dl:set $DLlist $bundle_ind PHASE [dl:icon NI]
  4075.         }
  4076.     }
  4077.     dl:show $DLlist $bundle_ind $show
  4078.     return $bundle_ind
  4079. }
  4080. proc bundle:DLinfo {ind} {
  4081.     Globals
  4082.     global free_gap
  4083.     set tag [dl:get $DLlist $ind OBJ]
  4084.     set type disabled
  4085.     set bringup manual
  4086.     set remotesys ""
  4087.     set login ""
  4088.     set callerid ""
  4089.     set authid ""
  4090.     PPP:get bundle $tag type type
  4091.     PPP:get bundle $tag bringup bringup
  4092.     PPP:get bundle $tag remotesys remotesys
  4093.     PPP:get bundle $tag login login
  4094.     PPP:get bundle $tag callerid callerid
  4095.     PPP:get bundle $tag authid authid
  4096.     set s ""
  4097.     if {[cequal $type disabled]} {
  4098.         append s [format "%s" [ILM SCO_PPP_MSG_L_BUNDLE_DISABLED]]
  4099.     } else {
  4100.         if {[cequal $type out] || [cequal $type bi-directional]} {
  4101.             append s [format "%s: %s" [ILM SCO_PPP_MSG_L_BUNDLE_OUTGOING] $remotesys]
  4102.         } 
  4103.         if {[cequal $type in] || [cequal $type bi-directional]} {
  4104.             if {![cequal $s ""]} {
  4105.                 append s $free_gap
  4106.             }
  4107.             if {![cequal $login ""]} {
  4108.                 append s [format "%s: %s" [ILM SCO_PPP_MSG_L_BUNDLE_INCOMING_LOGIN] $login]
  4109.             }    
  4110.             if {![cequal $s ""]} {
  4111.                 append s $free_gap
  4112.             }
  4113.             if {![cequal $callerid ""]} {
  4114.                 append s [format "%s: %s" [ILM SCO_PPP_MSG_L_BUNDLE_INCOMING_CALLERID] $callerid]
  4115.             }    
  4116.             if {![cequal $s ""]} {
  4117.                 append s $free_gap
  4118.             }
  4119.             if {![cequal $authid ""]} {
  4120.                 append s [format "%s: %s" [ILM SCO_PPP_MSG_L_BUNDLE_INCOMING_AUTHID] $authid]
  4121.             }    
  4122.         }
  4123.     }
  4124.     dl:set $DLlist $ind FREE $s
  4125.     dl:show $DLlist $ind
  4126. }
  4127. proc bundle:DLadd_protocol {ind bundle_ind protocol_tag show} {
  4128.     Globals
  4129.     PPP:get protocol $protocol_tag protocol val
  4130.     keylget ppp_type_info(protocol/$val) sub_defn sub_defn
  4131.     set val [translit "a-z" "A-Z" $val]
  4132.     switch $sub_defn {
  4133.         network { set sel sel106 }
  4134.         link    { set sel sel107 }
  4135.     }
  4136.     set nprotocol_ind [dl:add $DLlist $ind 1 2]
  4137.     dl:set $DLlist $nprotocol_ind ICON [dl:icon pn]
  4138.     dl:set $DLlist $nprotocol_ind SEL $sel
  4139.     dl:set $DLlist $nprotocol_ind OBJ $protocol_tag
  4140.     dl:set $DLlist $nprotocol_ind PROTOCOL "$val"
  4141.     dl:set $DLlist $nprotocol_ind PROTO [defn_type protocol $protocol_tag]
  4142.     dl:set $DLlist $nprotocol_ind BUNDLEIND $bundle_ind
  4143.     dl:show $DLlist $nprotocol_ind $show
  4144.     return $nprotocol_ind
  4145. }
  4146. proc bundle:DLinfo_protocol {ind show} {
  4147.     Globals
  4148.     set protocol [dl:get $DLlist $ind PROTO]
  4149.     set protocol_tag [dl:get $DLlist $ind OBJ]
  4150.     dl:set $DLlist $ind FREE [PPP:info protocol/$protocol $protocol_tag]
  4151.     dl:show $DLlist $ind $show
  4152. }
  4153. proc bundle:auto_detect_values {cbs} {
  4154.     keylget cbs dialog FDbundle
  4155.     wget $FDbundle CBauthname CBpeerauthname SBauthtmout \
  4156.         RBrequirechap RBrequirepap RBssn RBed SBmrru \
  4157.         TBrequirepap_yes TBrequirepap_no TBrequirechap_yes TBrequirechap_no \
  4158.         TBssn_yes TBssn_no TBed_no TBed_yes
  4159.     PPP:get global bundle authname global_authname
  4160.     PPP:get global bundle peerauthname global_peerauthname
  4161.     PPP:get global bundle authtmout global_authtmout
  4162.     PPP:get global bundle requirechap global_requirechap
  4163.     PPP:get global bundle requirepap global_requirepap
  4164.     PPP:get global bundle ssn global_ssn
  4165.     PPP:get global bundle ed global_ed
  4166.     PPP:get global bundle mrru global_mrru
  4167.     switch $global_requirepap {
  4168.         enabled  { SetValues $RBrequirepap TBrequirepap_yes }
  4169.         disabled { SetValues $RBrequirepap TBrequirepap_no }
  4170.     }
  4171.     switch $global_requirechap {
  4172.         enabled  { SetValues $RBrequirechap TBrequirechap_yes }
  4173.         disabled { SetValues $RBrequirechap TBrequirechap_no }
  4174.     }
  4175.     GetValues $CBauthname authname
  4176.     if {[cequal $authname ""]} {
  4177.         SetValues $CBauthname global_authname
  4178.     }
  4179.     GetValues $CBpeerauthname peerauthname
  4180.     if {[cequal $peerauthname ""]} {
  4181.         SetValues $CBpeerauthname global_peerauthname
  4182.         SetUser $CBpeerauthname global_peerauthname
  4183.     }
  4184.     GetVar $SBauthtmout text
  4185.     SetValues $text global_authtmout
  4186.     GetVar $SBmrru text
  4187.     SetValues $text global_mrru
  4188.     switch $global_ssn {
  4189.         enabled  { SetValues $RBssn TBssn_yes }
  4190.         disabled { SetValues $RBssn TBssn_no }
  4191.     }
  4192.     switch $global_ed {
  4193.         enabled  { SetValues $RBed TBed_yes }
  4194.         disabled { SetValues $RBed TBed_no }
  4195.     }
  4196. }
  4197. proc bundle:RBauto_detectCB {cbs} {
  4198.     global PPP_USER
  4199.     keylget cbs dialog FDbundle
  4200.     keylget cbs value TB
  4201.     GetUser $TB auto_detect
  4202.     GetVar $FDbundle Llogin
  4203.     GetVar $FDbundle CBlogin
  4204.     if {$auto_detect} {
  4205.         SetSens $CBlogin 0
  4206.         SetSens $Llogin 0
  4207.         bundle:auto_detect_values $cbs
  4208.     } else {
  4209.         GetValues $CBlogin login
  4210.         if {[cequal $login ""]} {
  4211.             GetUser $CBlogin ppp_used_users
  4212.             if {[lsearch $ppp_used_users $PPP_USER] != -1} {
  4213.                 set ppp_used_users $PPP_USER
  4214.             }
  4215.             VtSetValues $CBlogin -value [lindex $ppp_used_users 0]
  4216.         }
  4217.         SetSens $CBlogin 1
  4218.         SetSens $Llogin 1
  4219.     }
  4220. }
  4221. proc bundle:TnameCB {cbs} {
  4222.     keylget cbs dialog FDbundle
  4223.     wget $FDbundle Tname CBremotesys CBpeerauthname CBlogin \
  4224.         TBtype_incoming TBtype_outgoing
  4225.     GetValues $Tname name
  4226.     GetValues $CBremotesys remotesys
  4227.     GetValues $CBpeerauthname peerauthname
  4228.     GetValues $CBlogin login
  4229.     GetValues $TBtype_incoming type_incoming
  4230.     GetValues $TBtype_outgoing type_outgoing
  4231.     if {[cequal $remotesys ""] && $type_outgoing} {
  4232.         SetValues $CBremotesys name
  4233.     }
  4234.     if {[cequal $peerauthname ""]} {
  4235.         SetValues $CBpeerauthname name
  4236.         SetUser $CBpeerauthname name
  4237.     }
  4238.     if {[cequal $login ""] && $type_incoming} {
  4239.         SetValues $CBlogin name
  4240.     }
  4241. }
  4242. proc bundle:LSnprotocols_selectCB {cbs} {
  4243.     keylget cbs dialog FDbundle
  4244.     keylget cbs value value
  4245.     keylget cbs mode mode
  4246.     keylget cbs widget LSnprotocols
  4247.     keylget cbs selectedItemList itemList
  4248.     GetVar $LSnprotocols npSel
  4249.     set i3 [intersect3 $npSel $itemList]
  4250.     if {[cequal "" [lindex $i3 0]]} {
  4251.         set value [lindex $i3 2]
  4252.         set mode select
  4253.     } else {
  4254.         set value [lindex $i3 0]
  4255.         set mode deselect
  4256.     }
  4257.     if {[lempty $itemList]} {
  4258.         VtListSelectItem $LSnprotocols \
  4259.             -item $value 
  4260.         GetVar $LSnprotocols firstError
  4261.         if {$firstError} {
  4262.             VxSetVar $LSnprotocols firstError 0
  4263.             return [throwError $FDbundle [ILM SCO_PPP_ERR_NPROTOCOLS_ONE_SELECTED]]
  4264.         }
  4265.     } else {
  4266.         VxSetVar $LSnprotocols npSel $itemList
  4267.     }
  4268. }
  4269. proc bundle:TBtypeCB {cbs} {
  4270.     keylget cbs dialog FDbundle
  4271.     keylget cbs widget TB
  4272.     keylget cbs value value
  4273.     wget $FDbundle Lremotesys CBremotesys Lbringup CBbringup \
  4274.         Lauto_detect RBauto_detect Lcallerid Tcallerid Lauthid CBauthid \
  4275.         Llogin CBlogin CBpeerauthname op
  4276.     set TB [VxGetShortName $TB]
  4277.     set auto_detect [VtGetValues $RBauto_detect -value]
  4278.     set auto_detect [VtGetValues $auto_detect -userData]
  4279.     switch $TB {
  4280.         TBtype_incoming {
  4281.             SetSens $Llogin [expr $value && !$auto_detect]
  4282.             SetSens $CBlogin [expr $value && !$auto_detect]
  4283.             SetSens $Lauto_detect $value
  4284.             SetSens $RBauto_detect $value
  4285.             SetSens $Lcallerid $value
  4286.             SetSens $Tcallerid $value
  4287.             SetSens $Lauthid $value
  4288.             SetSens $CBauthid $value
  4289.             if {$auto_detect} {
  4290.                 bundle:auto_detect_values $cbs
  4291.             }
  4292.             if {[cequal $op add]} {
  4293.                 if {$value} {
  4294.                     GetValues $CBpeerauthname hidden
  4295.                     SetUser $CBpeerauthname hidden
  4296.                     VtSetValues $CBpeerauthname -value ""
  4297.                 } else {
  4298.                     GetUser $CBpeerauthname hidden
  4299.                     SetValues $CBpeerauthname hidden
  4300.                 }
  4301.             }
  4302.         }
  4303.         TBtype_outgoing {
  4304.             SetSens $Lremotesys $value
  4305.             SetSens $CBremotesys $value
  4306.             SetSens $Lbringup $value
  4307.             SetSens $CBbringup $value
  4308.         }
  4309.     }
  4310. }
  4311. proc bundle:PBcall_guiCB {Twidget gui_path gui_args label short_help mnemonic cbs} {
  4312.     global managedHost
  4313.     keylget cbs dialog FDwidget
  4314.     set value [VtGetValues $Twidget -value]
  4315.     if {![file executable $gui_path] && ![SaFile -host $managedHost executable $gui_path]} {
  4316.         return [throwError $FDwidget [ILM SCO_PPP_ERR_GUI_NOT_FOUND]]
  4317.     }
  4318.     if {[catch {eval exec $gui_path $gui_args -t \"$value\" -o -l \"$label\" -h \"$short_help\" -m \"$mnemonic\" $managedHost} res]} {
  4319.         return [throwError $FDwidget [ILM SCO_PPP_ERR_GUI_FAILED]]
  4320.     }
  4321.     if {![cequal $res ""]} {
  4322.         set i [string first "\n" $res]
  4323.         if {$i != -1} {
  4324.             incr i
  4325.             set res [csubstr $res $i end]
  4326.             VtSetValues $Twidget -value [string trim $res]
  4327.             keylset cbs widget $Twidget
  4328.         }
  4329.     }
  4330.     VtUnLock
  4331. }
  4332. proc bundle:buildCB {op mb ind sel view cbs} {
  4333.     Globals
  4334.     global iconpath managedHost PPP_SHELL PPP_USER 
  4335.     keylget cbs dialog dialog
  4336. ####################
  4337.     if {[cequal $op add]} {
  4338.         set title [ILM SCO_PPP_MSG_TITLE_BUNDLE_ADD]
  4339.     } else {
  4340.         set title [ILM SCO_PPP_MSG_TITLE_BUNDLE_MOD]
  4341.     }
  4342.     wset $dialog FDbundle [VtFormDialog $dialog.FDbundle \
  4343.         -title $title \
  4344.         -ok \
  4345.         -okCallback bundle:changeCB \
  4346.         -cancel \
  4347.         -cancelCallback VxEndFormCB \
  4348.         -autoDestroy 1 \
  4349.         -autoLock bundle:changeCB \
  4350.         -help \
  4351.         ]
  4352.     set FTDbundle [FormTabDialog $FDbundle.FTDbundle]
  4353. ####################
  4354.     FormTabs $FTDbundle [list \
  4355.         [list FTbundle \
  4356.             SCO_PPP_MSG_BUNDLE_FT_BUNDLE \
  4357.             SCO_PPP_MSG_TITLE_BUNDLE_FT_BUNDLE \
  4358.             SCO_PPP_MSG_SH_BUNDLE_FT_BUNDLE \
  4359.             ] \
  4360.         [list FTauth \
  4361.             SCO_PPP_MSG_BUNDLE_FT_AUTH \
  4362.             SCO_PPP_MSG_TITLE_BUNDLE_FT_AUTH \
  4363.             SCO_PPP_MSG_SH_BUNDLE_FT_AUTH \
  4364.             ] \
  4365.         [list FTmultilink \
  4366.             SCO_PPP_MSG_BUNDLE_FT_MULTILINK \
  4367.             SCO_PPP_MSG_TITLE_BUNDLE_FT_MULTILINK \
  4368.             SCO_PPP_MSG_SH_BUNDLE_FT_MULTILINK \
  4369.             ] \
  4370.         [list FTbod \
  4371.             SCO_PPP_MSG_BUNDLE_FT_BOD \
  4372.             SCO_PPP_MSG_TITLE_BUNDLE_FT_BOD \
  4373.             SCO_PPP_MSG_SH_BUNDLE_FT_BOD \
  4374.             ] \
  4375.         ]
  4376.     if {[cequal $op add]} {
  4377.         set FTnprotocols [cw SaFormTab $FTDbundle.FTnprotocols \
  4378.             SCO_PPP_MSG_BUNDLE_FT_NPROTOCOLS \
  4379.             SCO_PPP_MSG_TITLE_BUNDLE_FT_NPROTOCOLS \
  4380.             SCO_PPP_MSG_SH_BUNDLE_FT_NPROTOCOLS \
  4381.             ]
  4382.         set FTlprotocols [cw SaFormTab $FTDbundle.FTlprotocols \
  4383.             SCO_PPP_MSG_BUNDLE_FT_LPROTOCOLS \
  4384.             SCO_PPP_MSG_TITLE_BUNDLE_FT_LPROTOCOLS \
  4385.             SCO_PPP_MSG_SH_BUNDLE_FT_LPROTOCOLS \
  4386.             ]
  4387.     } else {
  4388.         set FTnprotocols ""
  4389.         set FTlprotocols ""
  4390.     }
  4391.     set FTadvanced [cw SaFormTab $FTDbundle.FTadvanced \
  4392.         SCO_PPP_MSG_BUNDLE_FT_ADVANCED \
  4393.         SCO_PPP_MSG_TITLE_BUNDLE_FT_ADVANCED \
  4394.         SCO_PPP_MSG_SH_BUNDLE_FT_ADVANCED \
  4395.         ]
  4396. ####################
  4397.     set sites ""
  4398.     foreach tag [Systems:list] {
  4399.         lappend sites [Systems:get $tag site]
  4400.     }
  4401.     wset $FDbundle AFbundle [AlignedForm $FTbundle.AFbundle [list \
  4402.         [list SCO_PPP_MSG_BUNDLE_NAME Lname Tname \
  4403.             [list VtText \
  4404.                 -callback bundle:TnameCB \
  4405.                 -losingFocusCallback bundle:TnameCB \
  4406.                 -columns 25 \
  4407.                 -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_NAME] \
  4408.                 -shortHelpCallback SaShortHelpCB \
  4409.                 ]] \
  4410.         [list SCO_PPP_MSG_BUNDLE_TYPE Ltype Ftype \
  4411.             [list VtForm \
  4412.                 -marginWidth 0 \
  4413.                 -marginHeight 0 \
  4414.                 ]] \
  4415.         [list SCO_PPP_MSG_BUNDLE_REMOTESYS Lremotesys Fremotesys \
  4416.             [list VtForm \
  4417.                 -marginWidth 0 \
  4418.                 -marginHeight 0 \
  4419.                 ]] \
  4420.         [list SCO_PPP_MSG_BUNDLE_BRINGUP Lbringup CBbringup \
  4421.             [list VtComboBox \
  4422.                 -readOnly \
  4423.                 -columns 25 \
  4424.                 -rows 2 \
  4425.                 -itemList [list [bringupMap automatic] [bringupMap manual]] \
  4426.                 -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_CALLERID] \
  4427.                 -shortHelpCallback SaShortHelpCB \
  4428.                 ]] \
  4429.         [list SCO_PPP_MSG_BUNDLE_AUTO_DETECT Lauto_detect RBauto_detect \
  4430.             [list VtRadioBox \
  4431.                 -callback bundle:RBauto_detectCB \
  4432.                 -horizontal \
  4433.                 ]] \
  4434.         [list SCO_PPP_MSG_BUNDLE_LOGIN Llogin CBlogin \
  4435.             [list VtComboBox \
  4436.                 -columns 25 \
  4437.                 -rows 5 \
  4438.                 -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_LOGIN] \
  4439.                 -shortHelpCallback SaShortHelpCB \
  4440.                 ]] \
  4441.         [list SCO_PPP_MSG_BUNDLE_CALLERID Lcallerid Tcallerid \
  4442.             [list VtText \
  4443.                 -columns 25 \
  4444.                 -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_CALLERID] \
  4445.                 -shortHelpCallback SaShortHelpCB \
  4446.                 ]] \
  4447.         [list SCO_PPP_MSG_BUNDLE_AUTHID Lauthid CBauthid \
  4448.             [list VtComboBox \
  4449.                 -columns 25 \
  4450.                 -rows 5 \
  4451.                 -value "" \
  4452.                 -itemList [concat [authNames] "*"] \
  4453.                 -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_AUTHID] \
  4454.                 -shortHelpCallback SaShortHelpCB \
  4455.                 ]] \
  4456.             ]]
  4457.     wset $FDbundle TBtype_outgoing [cw VtToggleButton $Ftype.TBtype_outgoing \
  4458.         SCO_PPP_MSG_BUNDLE_TYPE_OUTGOING \
  4459.         "" \
  4460.         SCO_PPP_MSG_SH_BUNDLE_TYPE_OUTGOING \
  4461.         -value 0 \
  4462.         -topSide FORM \
  4463.         -callback bundle:TBtypeCB \
  4464.         ]
  4465.     wset $FDbundle TBtype_incoming [cw VtToggleButton $Ftype.TBtype_incoming \
  4466.         SCO_PPP_MSG_BUNDLE_TYPE_INCOMING \
  4467.         "" \
  4468.         SCO_PPP_MSG_SH_BUNDLE_TYPE_INCOMING \
  4469.         -value 0 \
  4470.         -leftSide $TBtype_outgoing \
  4471.         -topSide FORM \
  4472.         -callback bundle:TBtypeCB \
  4473.         ]
  4474.     wset $FDbundle TBauto_detect_yes [cw VtToggleButton $RBauto_detect.TBauto_detect_yes \
  4475.         SCO_PPP_MSG_BUNDLE_AUTO_DETECT_YES \
  4476.         "" \
  4477.         SCO_PPP_MSG_SH_BUNDLE_AUTO_DETECT_YES \
  4478.         -value 1 \
  4479.         -userData 1 \
  4480.         ]
  4481.     wset $FDbundle TBauto_detect_no [cw VtToggleButton $RBauto_detect.TBauto_detect_no \
  4482.         SCO_PPP_MSG_BUNDLE_AUTO_DETECT_NO \
  4483.         "" \
  4484.         SCO_PPP_MSG_SH_BUNDLE_AUTO_DETECT_NO \
  4485.         -value 0 \
  4486.         -userData 0 \
  4487.         ]
  4488.     wset $FDbundle CBremotesys [cw VtComboBox $Fremotesys.CBremotesys \
  4489.         SCO_PPP_MSG_SH_BUNDLE_REMOTESYS \
  4490.         -columns 25 \
  4491.         -itemList $sites \
  4492.         -rows 5 \
  4493.         ]
  4494.     set gui_path /usr/lib/scoadmin/outgoing/outgoingGUI
  4495.     set gui_args ""
  4496.     set exit_label [ILM SCO_PPP_MSG_BUNDLE_REMOTESYS_OUTGOING_EXIT]
  4497.     set exit_short_help [ILM SCO_PPP_MSG_SH_BUNDLE_REMOTESYS_OUTGOING_EXIT]
  4498.     set exit_mnemonic [ILM SCO_PPP_MSG_MN_BUNDLE_REMOTESYS_OUTGOING_EXIT]
  4499.     wset $FDbundle PBremotesys [cw VtPushButton $Fremotesys.PBremotesys \
  4500.         SCO_PPP_MSG_BUNDLE_REMOTESYS_EDIT \
  4501.         "" \
  4502.         SCO_PPP_MSG_SH_BUNDLE_REMOTESYS_EDIT \
  4503.         -callback "bundle:PBcall_guiCB $CBremotesys \"$gui_path\" \"$gui_args\" \"$exit_label\" \"$exit_short_help\" \"$exit_mnemonic\"" \
  4504.         -autoLock bundle:PBcall_guiCB \
  4505.         -leftSide $CBremotesys \
  4506.         -topSide FORM \
  4507.         ]
  4508.     if {![file executable $gui_path] && ![SaFile -host $managedHost executable $gui_path]} {
  4509.         SetSens $PBremotesys 0
  4510.     }
  4511. ####################
  4512.     wset $FDbundle AFauth [AlignedForm $FTauth.AFauth [list \
  4513.         [list SCO_PPP_MSG_BUNDLE_REQUIRE_CHAP Lrequirechap RBrequirechap \
  4514.             [list VtRadioBox \
  4515.                 -horizontal \
  4516.                 ]] \
  4517.         [list SCO_PPP_MSG_BUNDLE_REQUIRE_PAP Lrequirepap RBrequirepap \
  4518.             [list VtRadioBox \
  4519.                 -horizontal \
  4520.                 ]] \
  4521.         [list SCO_PPP_MSG_BUNDLE_AUTHNAME Lauthname CBauthname \
  4522.             [list VtComboBox \
  4523.                 -columns 25 \
  4524.                 -rows 5 \
  4525.                 -value "" \
  4526.                 -itemList [authNames] \
  4527.                 -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_AUTHNAME] \
  4528.                 -shortHelpCallback SaShortHelpCB \
  4529.                 ]] \
  4530.         [list SCO_PPP_MSG_BUNDLE_PEERAUTHNAME Lpeerauthname CBpeerauthname \
  4531.             [list VtComboBox \
  4532.                 -columns 25 \
  4533.                 -rows 5 \
  4534.                 -value "" \
  4535.                 -itemList [authNames] \
  4536.                 -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_PEERAUTHNAME] \
  4537.                 -shortHelpCallback SaShortHelpCB \
  4538.                 ]] \
  4539.         [list SCO_PPP_MSG_BUNDLE_AUTHTMOUT Lauthtmout SBauthtmout \
  4540.             [list VxSpinButton \
  4541.                 10 5 "" 300 "" 1 60 "" "" \
  4542.                 ]] \
  4543.             ]]
  4544.     wset $FDbundle TBrequirepap_yes [cw VtToggleButton $RBrequirepap.TBrequirepap_yes \
  4545.         SCO_PPP_MSG_BUNDLE_REQUIRE_PAP_YES \
  4546.         "" \
  4547.         SCO_PPP_MSG_SH_BUNDLE_REQUIRE_PAP_YES \
  4548.         -userData enabled \
  4549.         -value 0 \
  4550.         ]
  4551.     wset $FDbundle TBrequirepap_no [cw VtToggleButton $RBrequirepap.TBrequirepap_no \
  4552.         SCO_PPP_MSG_BUNDLE_REQUIRE_PAP_NO \
  4553.         "" \
  4554.         SCO_PPP_MSG_SH_BUNDLE_REQUIRE_PAP_NO \
  4555.         -userData disabled \
  4556.         -value 1 \
  4557.         ]
  4558.     wset $FDbundle TBrequirechap_yes [cw VtToggleButton $RBrequirechap.TBreqchap_yes \
  4559.         SCO_PPP_MSG_BUNDLE_REQUIRE_CHAP_YES \
  4560.         "" \
  4561.         SCO_PPP_MSG_SH_BUNDLE_REQUIRE_CHAP_YES \
  4562.         -userData enabled \
  4563.         -value 0 \
  4564.         ]
  4565.     wset $FDbundle TBrequirechap_no [cw VtToggleButton $RBrequirechap.TBreqchap_no \
  4566.         SCO_PPP_MSG_BUNDLE_REQUIRE_CHAP_NO \
  4567.         "" \
  4568.         SCO_PPP_MSG_SH_BUNDLE_REQUIRE_CHAP_NO \
  4569.         -userData disabled \
  4570.         -value 1 \
  4571.         ]
  4572.     VtSetValues $SBauthtmout \
  4573.         -rightSide NONE \
  4574.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_AUTHTMOUT] \
  4575.         -shortHelpCallback SaShortHelpCB
  4576. ####################
  4577.     wset $FDbundle AFmultilink [AlignedForm $FTmultilink.AFmultilink [list \
  4578.         [list SCO_PPP_MSG_BUNDLE_MAXLINKS Lmaxlinks SBmaxlinks \
  4579.             [list VxSpinButton \
  4580.                 10 1 "" 1024 "" 1 1 "" "" \
  4581.                 ]] \
  4582.         [list SCO_PPP_MSG_BUNDLE_MINLINKS Lminlinks SBminlinks \
  4583.             [list VxSpinButton \
  4584.                 10 1 "" 1024 "" 1 1 "" "" \
  4585.                 ]] \
  4586.         [list SCO_PPP_MSG_BUNDLE_MRRU Lmrru SBmrru \
  4587.             [list VxSpinButton \
  4588.                 10 256 "" 16384 "" 1 1500 "" "" \
  4589.                 ]] \
  4590.         [list SCO_PPP_MSG_BUNDLE_SSN Lssn RBssn \
  4591.             [list VtRadioBox \
  4592.                 -horizontal \
  4593.                 ]] \
  4594.         [list SCO_PPP_MSG_BUNDLE_ED Led RBed \
  4595.             [list VtRadioBox \
  4596.                 -horizontal \
  4597.                 ]] \
  4598.         [list SCO_PPP_MSG_BUNDLE_MINFRAG Lminfrag SBminfrag \
  4599.             [list VxSpinButton \
  4600.                 10 50 "" 4096 "" 1 100 "" "" \
  4601.                 ]] \
  4602.         [list SCO_PPP_MSG_BUNDLE_MAXFRAGS Lmaxfrags SBmaxfrags \
  4603.             [list VxSpinButton \
  4604.                 10 1 "" 500 "" 1 5 "" "" \
  4605.                 ]] \
  4606.             ]]
  4607.     VtSetValues $SBmrru \
  4608.         -rightSide NONE \
  4609.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MRRU] \
  4610.         -shortHelpCallback SaShortHelpCB
  4611.     wset $FDbundle TBssn_yes [cw VtToggleButton $RBssn.TBssn_yes \
  4612.         SCO_PPP_MSG_BUNDLE_SSN_YES \
  4613.         "" \
  4614.         SCO_PPP_MSG_SH_BUNDLE_SSN_YES \
  4615.         -userData enabled \
  4616.         -value 0 \
  4617.         ]
  4618.     wset $FDbundle TBssn_no [cw VtToggleButton $RBssn.TBssn_no \
  4619.         SCO_PPP_MSG_BUNDLE_SSN_NO \
  4620.         "" \
  4621.         SCO_PPP_MSG_SH_BUNDLE_SSN_NO \
  4622.         -userData disabled \
  4623.         -value 1 \
  4624.         ]
  4625.     wset $FDbundle TBed_yes [cw VtToggleButton $RBed.TBed_yes \
  4626.         SCO_PPP_MSG_BUNDLE_ED_YES \
  4627.         "" \
  4628.         SCO_PPP_MSG_SH_BUNDLE_ED_YES \
  4629.         -userData enabled \
  4630.         -value 1 \
  4631.         ]
  4632.     wset $FDbundle TBed_no [cw VtToggleButton $RBed.TBed_no \
  4633.         SCO_PPP_MSG_BUNDLE_ED_NO \
  4634.         "" \
  4635.         SCO_PPP_MSG_SH_BUNDLE_ED_NO \
  4636.         -userData disabled \
  4637.         -value 0 \
  4638.         ]
  4639.     VtSetValues $SBmaxlinks \
  4640.         -rightSide NONE \
  4641.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MAXLINKS] \
  4642.         -shortHelpCallback SaShortHelpCB
  4643.     VtSetValues $SBminlinks \
  4644.         -rightSide NONE \
  4645.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MINLINKS] \
  4646.         -shortHelpCallback SaShortHelpCB
  4647.     VtSetValues $SBminfrag \
  4648.         -rightSide NONE \
  4649.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MINFRAG] \
  4650.         -shortHelpCallback SaShortHelpCB
  4651.     VtSetValues $SBmaxfrags \
  4652.         -rightSide NONE \
  4653.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MAXFRAGS] \
  4654.         -shortHelpCallback SaShortHelpCB
  4655. ####################
  4656.     wset $FDbundle AFbod [AlignedForm $FTbod.AFbod [list \
  4657.         [list SCO_PPP_MSG_BUNDLE_ADDLOAD Laddload SBaddload \
  4658.             [list VxSpinButton \
  4659.                 10 1 "" 100 "" 1 60 "" "" \
  4660.                 ]] \
  4661.         [list SCO_PPP_MSG_BUNDLE_ADDSAMPLE Laddsample SBaddsample \
  4662.             [list VxSpinButton \
  4663.                 10 2 "" 4000 "" 1 2 "" "" \
  4664.                 ]] \
  4665.         [list SCO_PPP_MSG_BUNDLE_DROPLOAD Ldropload SBdropload \
  4666.             [list VxSpinButton \
  4667.                 10 1 "" 100 "" 1 20 "" "" \
  4668.                 ]] \
  4669.         [list SCO_PPP_MSG_BUNDLE_DROPSAMPLE Ldropsample SBdropsample \
  4670.             [list VxSpinButton \
  4671.                 10 2 "" 4000 "" 1 2 "" "" \
  4672.                 ]] \
  4673.         [list SCO_PPP_MSG_BUNDLE_THRASHTIME Lthrashtime SBthrashtime \
  4674.             [list VxSpinButton \
  4675.                 10 5 "" 4000 "" 1 60 "" "" \
  4676.                 ]] \
  4677.         [list SCO_PPP_MSG_BUNDLE_BOD Lbod CBbod \
  4678.             [list VtComboBox \
  4679.                 -readOnly \
  4680.                 -itemList [list [bodMap none] [bodMap in] [bodMap out] [bodMap any]] \
  4681.                 -rows 4 \
  4682.                 -columns 25 \
  4683.                 -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_BOD] \
  4684.                 -shortHelpCallback SaShortHelpCB \
  4685.                 ]] \
  4686.             ]]
  4687.     VtSetValues $SBaddload \
  4688.         -rightSide NONE \
  4689.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_ADDLOAD] \
  4690.         -shortHelpCallback SaShortHelpCB
  4691.     VtSetValues $SBaddsample \
  4692.         -rightSide NONE \
  4693.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_ADDSAMPLE] \
  4694.         -shortHelpCallback SaShortHelpCB
  4695.     VtSetValues $SBdropload \
  4696.         -rightSide NONE \
  4697.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_DROPLOAD] \
  4698.         -shortHelpCallback SaShortHelpCB
  4699.     VtSetValues $SBdropsample \
  4700.         -rightSide NONE \
  4701.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_DROPSAMPLE] \
  4702.         -shortHelpCallback SaShortHelpCB
  4703.     VtSetValues $SBthrashtime \
  4704.         -rightSide NONE \
  4705.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_THRASHTIME] \
  4706.         -shortHelpCallback SaShortHelpCB
  4707. ####################
  4708.     if {[cequal $op add]} {
  4709.         wset $FDbundle AFnprotocols [AlignedForm $FTnprotocols.AFnprotocols [list \
  4710.             [list SCO_PPP_MSG_NPROTOCOLS Lnprotocols LSnprotocols \
  4711.                 [list VtList \
  4712.                     -callback bundle:LSnprotocols_selectCB \
  4713.                     -selection MULTIPLE \
  4714.                     -scrollBar 1 \
  4715.                     -columns 25 \
  4716.                     -rows 5 \
  4717.                     -shortHelpString [ILM SCO_PPP_MSG_SH_NPROTOCOLS] \
  4718.                     -shortHelpCallback SaShortHelpCB \
  4719.                     ]] \
  4720.                 ]]
  4721.         wset $FDbundle AFlprotocols [AlignedForm $FTlprotocols.AFlprotocols [list \
  4722.             [list SCO_PPP_MSG_LPROTOCOLS Llprotocols LSlprotocols \
  4723.                 [list VtList \
  4724.                     -selection MULTIPLE \
  4725.                     -scrollBar 1 \
  4726.                     -columns 25 \
  4727.                     -rows 5 \
  4728.                     -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_LPROTOCOLS] \
  4729.                     -shortHelpCallback SaShortHelpCB \
  4730.                     ]] \
  4731.                 ]]
  4732.     } else {
  4733.         set LSnprotocols ""
  4734.         set LSlprotocols ""
  4735.     }
  4736. ####################
  4737.     wset $FDbundle AFadvanced [AlignedForm $FTadvanced.AFadvanced [list \
  4738.         [list SCO_PPP_MSG_BUNDLE_MAXIDLE Lmaxidle SBmaxidle \
  4739.             [list VxSpinButton \
  4740.                 10 0 "" 32768 "" 1 0 "" "" \
  4741.                 ]] \
  4742.             ]]
  4743.     VtSetValues $SBmaxidle \
  4744.         -rightSide NONE \
  4745.         -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_MAXIDLE] \
  4746.         -shortHelpCallback SaShortHelpCB
  4747. ####################
  4748.     StatusBar $FDbundle $FTDbundle
  4749.     VtShow $FDbundle
  4750.     SaFormTabDialogMaxSize $FTDbundle
  4751.     SaFormTabSetSelected $FTbundle
  4752. ####################
  4753.     set type bi-directional
  4754.     set maxidle 0
  4755.     set remotesys ""
  4756.     set bringup automatic
  4757.     set login ""
  4758.     set callerid ""
  4759.     set authid ""
  4760.     set requirepap disabled
  4761.     set requirechap disabled
  4762.     set authname ""
  4763.     set peerauthname ""
  4764.     set authtmout 60
  4765.     set mrru 1500
  4766.     set ssn enabled
  4767.     set ed enabled
  4768.     set maxlinks 1
  4769.     set minlinks 1
  4770.     set minfrag 100
  4771.     set maxfrags 5
  4772.     set thrashtime 300
  4773.     set bod none
  4774.     set addload 60
  4775.     set addsample 30
  4776.     set dropload 20
  4777.     set dropsample 120
  4778.     if {[cequal $op add]} {
  4779.         set bundle_tag ""
  4780.         set authname $managedHost
  4781.         set protocols ""
  4782.     } else {
  4783.         set bundle_tag [dl:get $DLlist $ind OBJ]
  4784.         PPP:get bundle $bundle_tag type type
  4785.         PPP:get bundle $bundle_tag maxidle maxidle
  4786.         PPP:get bundle $bundle_tag remotesys remotesys
  4787.         PPP:get bundle $bundle_tag bringup bringup
  4788.         PPP:get bundle $bundle_tag login login
  4789.         PPP:get bundle $bundle_tag callerid callerid
  4790.         PPP:get bundle $bundle_tag authid authid
  4791.         PPP:get bundle $bundle_tag requirepap requirepap
  4792.         PPP:get bundle $bundle_tag requirechap requirechap
  4793.         PPP:get bundle $bundle_tag authname authname
  4794.         PPP:get bundle $bundle_tag peerauthname peerauthname
  4795.         PPP:get bundle $bundle_tag authtmout authtmout
  4796.         PPP:get bundle $bundle_tag minfrag minfrag
  4797.         PPP:get bundle $bundle_tag maxfrags maxfrags
  4798.         PPP:get bundle $bundle_tag mrru mrru
  4799.         PPP:get bundle $bundle_tag ssn ssn
  4800.         PPP:get bundle $bundle_tag ed ed
  4801.         PPP:get bundle $bundle_tag maxlinks maxlinks
  4802.         PPP:get bundle $bundle_tag minlinks minlinks
  4803.         PPP:get bundle $bundle_tag thrashtime thrashtime
  4804.         PPP:get bundle $bundle_tag bod bod
  4805.         PPP:get bundle $bundle_tag dropload dropload
  4806.         PPP:get bundle $bundle_tag dropsample dropsample
  4807.         PPP:get bundle $bundle_tag addload addload
  4808.         PPP:get bundle $bundle_tag addsample addsample
  4809.         PPP:get bundle $bundle_tag protocols protocols
  4810.     }
  4811. ####################
  4812.     switch $type {
  4813.         in {
  4814.             set type_incoming 1
  4815.             set type_outgoing 0
  4816.         }
  4817.         out {
  4818.             set type_incoming 0
  4819.             set type_outgoing 1
  4820.         }
  4821.         bi-directional {
  4822.             set type_incoming 1
  4823.             set type_outgoing 1
  4824.         }
  4825.         default {
  4826.             set type_incoming 0
  4827.             set type_outgoing 0
  4828.         }
  4829.     }
  4830. ####################
  4831.     if {$type_incoming && [cequal $login ""]} {
  4832.         PPP:get global bundle authname authname
  4833.         PPP:get global bundle peerauthname peerauthname
  4834.         PPP:get global bundle authtmout authtmout
  4835.         PPP:get global bundle requirechap requirechap
  4836.         PPP:get global bundle requirepap requirepap
  4837.         PPP:get global bundle ssn ssn
  4838.         PPP:get global bundle ed ed
  4839.         PPP:get global bundle mrru mrru
  4840.     }
  4841. ####################
  4842.     SetValues $Tname bundle_tag
  4843.     SetUser $Tname bundle_tag
  4844.     set sens_in 0
  4845.     set sens_out 0
  4846.     if {$type_incoming} {
  4847.         VtSetValues $TBtype_incoming -value 1
  4848.         set sens_in 1
  4849.     }
  4850.     if {$type_outgoing} {
  4851.         VtSetValues $TBtype_outgoing -value 1
  4852.         set sens_out 1
  4853.     }
  4854.     SetSens $Lauto_detect $sens_in
  4855.     SetSens $RBauto_detect $sens_in
  4856.     SetSens $Llogin $sens_in
  4857.     SetSens $CBlogin $sens_in
  4858.     SetSens $Lcallerid $sens_in
  4859.     SetSens $Tcallerid $sens_in
  4860.     SetSens $Lauthid $sens_in
  4861.     SetSens $CBauthid $sens_in
  4862.     SetSens $Lremotesys $sens_out
  4863.     SetSens $CBremotesys $sens_out
  4864.     SetSens $Lbringup $sens_out
  4865.     SetSens $CBbringup $sens_out
  4866.     SetValues $CBremotesys remotesys
  4867.     set bringup_ilm [bringupMap $bringup]
  4868.     SetValues $CBbringup bringup_ilm
  4869.     set ppp_users ""
  4870.     set ppp_used_users ""
  4871.     set all_uids ""
  4872.     set all_users [SaGetPwEnts $managedHost]
  4873.     foreach user [keylkeys all_users] {
  4874.         keylget all_users $user user_info
  4875.         keylget user_info pw_shell pw_shell
  4876.         keylget user_info pw_uid pw_uid
  4877.         lappend all_uids $pw_uid
  4878.         if {[cequal $pw_shell $PPP_SHELL]} {
  4879.             lappend ppp_used_users $user
  4880.         }
  4881.         lappend ppp_users $user
  4882.     }
  4883.     foreach used_bundle_tag [check ppp_tags(bundle)] {
  4884.         PPP:get bundle $used_bundle_tag login used_bundle_login
  4885.         if {![cequal $login ""] && [lsearch $ppp_used_users $used_bundle_login] != -1} {
  4886.             set_del ppp_used_users $used_bundle_login
  4887.         }
  4888.     }
  4889.     if {[lempty $ppp_used_users]} {
  4890.         VtSetValues $CBlogin -itemList [concat $PPP_USER "*"]
  4891.         VtSetValues $CBlogin -userData $PPP_USER
  4892.     } else {
  4893.         VtSetValues $CBlogin -itemList [concat $ppp_used_users "*"]
  4894.         VtSetValues $CBlogin -userData [lindex $ppp_used_users 0]
  4895.     }
  4896.     SetVar $CBlogin all_users
  4897.     SetVar $CBlogin all_uids
  4898.     SetVar $CBlogin ppp_users
  4899.     SetVar $CBlogin ppp_used_users
  4900.     SetValues $CBlogin login
  4901.     SetValues $Tcallerid callerid
  4902.     SetValues $CBauthid authid
  4903.     if {[cequal $login ""]} {
  4904.         SetValues $RBauto_detect TBauto_detect_yes
  4905.         SetSens $Llogin 0
  4906.         SetSens $CBlogin 0
  4907.     } else {
  4908.         SetValues $RBauto_detect TBauto_detect_no
  4909.     }
  4910.     GetVar $SBmaxidle text
  4911.     SetValues $text maxidle
  4912. ####################
  4913.     switch $requirepap {
  4914.         enabled  { SetValues $RBrequirepap TBrequirepap_yes }
  4915.         disabled { SetValues $RBrequirepap TBrequirepap_no }
  4916.     }
  4917.     switch $requirechap {
  4918.         enabled  { SetValues $RBrequirechap TBrequirechap_yes }
  4919.         disabled { SetValues $RBrequirechap TBrequirechap_no }
  4920.     }
  4921.     SetValues $CBauthname authname
  4922.     SetValues $CBpeerauthname peerauthname
  4923.     SetUser $CBpeerauthname peerauthname
  4924.     GetVar $SBauthtmout text
  4925.     SetValues $text authtmout
  4926. ####################
  4927.     GetVar $SBmaxlinks text
  4928.     SetValues $text maxlinks
  4929.     GetVar $SBminlinks text
  4930.     SetValues $text minlinks
  4931.     GetVar $SBmrru text
  4932.     SetValues $text mrru
  4933.     GetVar $SBmaxfrags text
  4934.     SetValues $text maxfrags
  4935.     GetVar $SBminfrag text
  4936.     SetValues $text minfrag
  4937.     switch $ssn {
  4938.         enabled  { SetValues $RBssn TBssn_yes }
  4939.         disabled { SetValues $RBssn TBssn_no }
  4940.     }
  4941.     switch $ed {
  4942.         enabled  { SetValues $RBed TBed_yes }
  4943.         disabled { SetValues $RBed TBed_no }
  4944.     }
  4945. ####################
  4946.     GetVar $SBaddload text
  4947.     SetValues $text addload
  4948.     GetVar $SBaddsample text
  4949.     SetValues $text addsample
  4950.     GetVar $SBdropload text
  4951.     SetValues $text dropload
  4952.     GetVar $SBdropsample text
  4953.     SetValues $text dropsample
  4954.     GetVar $SBthrashtime text
  4955.     SetValues $text thrashtime
  4956.     set bod_ilm [bodMap $bod]
  4957.     SetValues $CBbod bod_ilm
  4958. ####################
  4959.     if {[cequal $op add]} {
  4960.         set nprotocols [defn_list protocol network bundle]
  4961.         set lprotocols [defn_list protocol link bundle]
  4962.     } else {
  4963.         set nprotocols ""
  4964.         set lprotocols ""
  4965.     }
  4966.     set npSel ""
  4967.     if {![lempty $nprotocols]} {
  4968.         foreach protocol $nprotocols {
  4969.             keylget ppp_type_info($protocol) val val
  4970.             set proto [translit "a-z" "A-Z" $val]
  4971.             VtListAddItem $LSnprotocols \
  4972.                 -item $proto
  4973.             if {[cequal $op add] || ![lempty [findProtocolTag $val $protocols]]} {
  4974.                 VtListSelectItem $LSnprotocols \
  4975.                     -item $proto 
  4976.                 set_add npSel $proto
  4977.             }
  4978.         }
  4979.         VxSetVar $LSnprotocols firstError 1
  4980.         SetVar $LSnprotocols npSel
  4981.     }
  4982.     foreach protocol $lprotocols {
  4983.         keylget ppp_type_info($protocol) val val
  4984.         set proto [translit "a-z" "A-Z" $val]
  4985.         VtListAddItem $LSlprotocols \
  4986.             -item $proto
  4987.     }
  4988. ####################
  4989.     wput $FDbundle \
  4990.         TBtype_incoming TBtype_outgoing SBmaxidle \
  4991.         Lremotesys Lbringup Lauto_detect Lcallerid Lauthid \
  4992.         CBremotesys CBbringup Tname \
  4993.         Llogin CBlogin Tcallerid CBauthid RBauto_detect \
  4994.         RBrequirepap RBrequirechap SBauthtmout CBauthname CBpeerauthname \
  4995.         RBssn RBed SBminfrag SBmaxfrags SBmaxlinks SBminlinks SBmrru \
  4996.         SBaddload SBaddsample SBdropload SBdropsample SBthrashtime CBbod \
  4997.         LSnprotocols LSlprotocols
  4998.     wput $FDbundle FTbundle FTauth FTmultilink FTbod FTnprotocols FTlprotocols
  4999.     wput $FDbundle op mb ind sel view cbs
  5000.     VtUnLock
  5001. }
  5002. proc bundle:changeCB {cbs} {
  5003.     Globals
  5004.     global managedHost PPP_HOME PPP_SHELL PPP_COMMENT PPP_GROUP PPP_MODE
  5005.     keylget cbs dialog FDbundle
  5006.     wget $FDbundle \
  5007.         TBtype_incoming TBtype_outgoing SBmaxidle \
  5008.         CBremotesys CBbringup Tname \
  5009.         Llogin CBlogin Tcallerid CBauthid RBauto_detect \
  5010.         RBrequirepap RBrequirechap SBauthtmout CBauthname CBpeerauthname \
  5011.         RBssn RBed SBminfrag SBmaxfrags SBmaxlinks SBminlinks SBmrru \
  5012.         SBaddload SBaddsample SBdropload SBdropsample SBthrashtime CBbod \
  5013.         LSnprotocols LSlprotocols
  5014.     wget $FDbundle FTbundle FTauth FTmultilink FTbod FTnprotocols FTlprotocols
  5015.     wget $FDbundle op mb ind sel view
  5016. ####################
  5017.     GetValues $TBtype_incoming type_incoming
  5018.     GetValues $TBtype_outgoing type_outgoing
  5019.     set type [expr $type_incoming + 2 * $type_outgoing]
  5020.     switch $type {
  5021.         1       { set type in }
  5022.         2       { set type out }
  5023.         3       { set type bi-directional }
  5024.         default { set type disabled }
  5025.     }
  5026.     GetValues $Tname name
  5027.     set name [validName $name]
  5028.     SetValues $Tname name
  5029.     GetUser $Tname bundle_tag
  5030.     GetValues $CBremotesys remotesys
  5031.     set remotesys [validName $remotesys]
  5032.     GetValues $CBbringup bringup
  5033.     set bringup [bringupMap $bringup]
  5034.     GetValues $RBauto_detect TB
  5035.     GetUser $TB auto_detect
  5036.     GetValues $CBlogin login
  5037.     GetVar $CBlogin all_users
  5038.     GetVar $CBlogin all_uids
  5039.     GetVar $CBlogin ppp_users
  5040.     GetVar $CBlogin ppp_used_users
  5041.     GetValues $Tcallerid callerid
  5042.     GetValues $CBauthid authid
  5043.     GetVar $SBmaxidle text
  5044.     GetValues $text maxidle
  5045. ####################
  5046.     GetValues $RBrequirepap TB
  5047.     GetUser $TB requirepap
  5048.     GetValues $RBrequirechap TB
  5049.     GetUser $TB requirechap
  5050.     GetValues $CBauthname authname
  5051.     GetValues $CBpeerauthname peerauthname
  5052.     GetVar $SBauthtmout text
  5053.     GetValues $text authtmout
  5054.     set authname [validName $authname]
  5055.     set peerauthname [validName $peerauthname]
  5056. ####################
  5057.     GetVar $SBmaxlinks text
  5058.     GetValues $text maxlinks
  5059.     GetVar $SBminlinks text
  5060.     GetValues $text minlinks
  5061.     GetVar $SBmrru text
  5062.     GetValues $text mrru
  5063.     GetVar $SBminfrag text
  5064.     GetValues $text minfrag
  5065.     GetVar $SBmaxfrags text
  5066.     GetValues $text maxfrags
  5067.     GetValues $RBssn TB
  5068.     GetUser $TB ssn
  5069.     GetValues $RBed TB
  5070.     GetUser $TB ed
  5071. ####################
  5072.     GetVar $SBaddload text
  5073.     GetValues $text addload
  5074.     GetVar $SBaddsample text
  5075.     GetValues $text addsample
  5076.     GetVar $SBdropload text
  5077.     GetValues $text dropload
  5078.     GetVar $SBdropsample text
  5079.     GetValues $text dropsample
  5080.     GetVar $SBthrashtime text
  5081.     GetValues $text thrashtime
  5082.     GetValues $CBbod bod
  5083.     set bod [bodMap $bod]
  5084. ####################
  5085.     if {[cequal $name ""]} {
  5086.         SaFormTabSetSelected $FTbundle
  5087.         return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_NAME_NULL]]
  5088.     }
  5089.     if {$type_incoming && [cequal $login ""] && !$auto_detect} {
  5090.         SaFormTabSetSelected $FTbundle
  5091.         return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_LOGIN_NULL]]
  5092.     }
  5093.     if {$type_incoming && [cequal $authid ""] && [cequal $callerid ""] && $auto_detect} {
  5094.         SaFormTabSetSelected $FTbundle
  5095.         return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_CALLER_AUTH_NULL]]
  5096.     }
  5097.     if {$type_outgoing && ![cequal $op modify] && [cequal $name ""] && ![cequal $remotesys ""]} {
  5098.         set name $remotesys
  5099.     }
  5100.     if {$type_outgoing && [cequal $remotesys ""]} {
  5101.         SaFormTabSetSelected $FTbundle
  5102.         return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_REMOTESYS_NULL]]
  5103.     }
  5104.     if {$auto_detect} {
  5105.         set login ""
  5106.     }
  5107.     if {$type_incoming && \
  5108.             ![cequal $login ""] && \
  5109.             ![cequal $login "*"] && \
  5110.             [lsearch $ppp_users $login] == -1 && \
  5111.             !$auto_detect} {
  5112.         set attrValueList ""
  5113.         keylset attrValueList pw_name $login
  5114.         keylset attrValueList pw_shell $PPP_SHELL
  5115.         keylset attrValueList pw_dir $PPP_HOME
  5116.         keylset attrValueList createHome 1
  5117.         keylset attrValueList loginGroup $PPP_GROUP
  5118.         keylset attrValueList comment $PPP_COMMENT
  5119.         keylset attrValueList mode $PPP_MODE
  5120.         rename GetUser PPP_GetUser    
  5121.         catch {rename account_GetUser GetUser}
  5122.         set objcall [list ObjectCreate {sco account} [SetInstance $login] $attrValueList]
  5123.         set bmipResponse [SMOC $objcall]
  5124.         catch {rename GetUser account_GetUser}
  5125.         rename PPP_GetUser GetUser    
  5126.         set firstBmip [lindex $bmipResponse 0]
  5127.         set errStack [BmipResponseErrorStack firstBmip]
  5128.         if { ![lempty $errStack] } {
  5129.             return [throwError $FDbundle [ILM SCO_PPP_ERR_PPP_USER_CREATE_FAILED]]
  5130.         }
  5131.         set parent_cbs [VxGetVar $FDbundle cbs]
  5132.         set rec ""
  5133.         keylset rec op $login
  5134.         keylset rec mb $mb
  5135.         keylset rec ind $ind
  5136.         keylset rec sel $sel
  5137.         keylset rec view $view
  5138.         keylset rec parent_cbs $parent_cbs
  5139.         keylset rec func bundle_passwd:buildCB
  5140.         ppp:chain_add $rec
  5141.     }
  5142. ####################
  5143.     if {[cequal $op add]} {
  5144.         set nprotocols [VtListGetSelectedItem $LSnprotocols -byItemList]
  5145.         set lprotocols [VtListGetSelectedItem $LSlprotocols -byItemList]
  5146.         if {[lempty $nprotocols]} {
  5147.             SaFormTabSetSelected $FTnprotocols
  5148.             return [throwError $FDbundle [ILM SCO_PPP_ERR_NPROTOCOLS_ONE_SELECTED]]
  5149.         }
  5150.         set bundle_tag $name
  5151.         if {[PPP:isPresent bundle $bundle_tag]} {
  5152.             SaFormTabSetSelected $FTbundle
  5153.             return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_NAME_EXIST]]
  5154.         }
  5155.         set protocols ""
  5156.         set nprotocols_add ""
  5157.         set lprotocols_add ""
  5158.         foreach proto $nprotocols {
  5159.             set val [translit "A-Z" "a-z" $proto]
  5160.             set protocol_tag ${val}_${bundle_tag}
  5161.             while {[PPP:isPresent protocol $protocol_tag]} {
  5162.                 set protocol_tag [cycleName $protocol_tag]
  5163.             }
  5164.             if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type bundle]]]} {
  5165.                 foreach protocol_tag $protocols {
  5166.                     PPP:get protocol $protocol_tag protocol protocol
  5167.                     PPP:delete protocol/${protocol} $protocol_tag
  5168.                 }
  5169.                 return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_CREATE]]
  5170.             }
  5171.             set_add protocols $protocol_tag
  5172.             set_add nprotocols_add $protocol_tag
  5173.         }
  5174.         foreach proto $lprotocols {
  5175.             set val [translit "A-Z" "a-z" $proto]
  5176.             set protocol_tag ${val}_${bundle_tag}
  5177.             while {[PPP:isPresent protocol $protocol_tag]} {
  5178.                 set protocol_tag [cycleName $protocol_tag]
  5179.             }
  5180.             if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type bundle]]]} {
  5181.                 foreach protocol_tag $protocols {
  5182.                     PPP:get protocol $protocol_tag protocol protocol
  5183.                     PPP:delete protocol/${protocol} $protocol_tag
  5184.                 }
  5185.                 return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_CREATE]]
  5186.             }
  5187.             set_add protocols $protocol_tag
  5188.             set_add lprotocols_add $protocol_tag
  5189.             set algorithms [defn_list algorithm link protocol/$val]
  5190.             if {![lempty $algorithms]} {
  5191.                 set txalgorithms ""
  5192.                 set rxalgorithms ""
  5193.                 foreach algorithm $algorithms {
  5194.                     set alval ""
  5195.                     keylget ppp_type_info($algorithm) val alval
  5196.                     if {[cequal $alval ""]} {
  5197.                         continue
  5198.                     }
  5199.                     set tx_tag tx_${val}_${alval}_${bundle_tag}
  5200.                     set rx_tag rx_${val}_${alval}_${bundle_tag}
  5201.                     while {[PPP:isPresent algorithm $rx_tag] || [PPP:isPresent algorithm $tx_tag]} {
  5202.                         set tx_tag [cycleName $tx_tag]
  5203.                         set rx_tag [cycleName $rx_tag]
  5204.                     }
  5205.                     set_add rxalgorithms $rx_tag
  5206.                     set_add txalgorithms $tx_tag
  5207.                     if {![PPP:create algorithm/${alval} $rx_tag]} {
  5208.                         set_del rxalgorithms $rx_tag
  5209.                     }
  5210.                     if {![PPP:create algorithm/${alval} $tx_tag]} {
  5211.                         set_del txalgorithms $tx_tag
  5212.                     }
  5213.                 }
  5214.                 PPP:replace protocol/${val} $protocol_tag txalgorithms $txalgorithms
  5215.                 PPP:replace protocol/${val} $protocol_tag rxalgorithms $rxalgorithms
  5216.             }
  5217.         }
  5218.         set rec ""
  5219.         keylset rec protocols $protocols
  5220.         keylset rec type $type
  5221.         if {![PPP:create bundle $bundle_tag $rec]} {
  5222.             foreach tag [concat $txalgorithms $rxalgorithms] {
  5223.                 set val [defn_type algorithm $tag]
  5224.                 PPP:delete algorithm/$val $tag
  5225.             }
  5226.             foreach tag $protocols {
  5227.                 set val [defn_type protocol $tag]
  5228.                 PPP:delete protocol/$val $tag
  5229.             }
  5230.             return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_CREATE]]
  5231.         }
  5232.         set ind [bundle:DLadd_bundle end $bundle_tag 1]
  5233.     } elseif {[cequal $op modify]} {
  5234.         set bundle_tag [dl:get $DLlist $ind OBJ]
  5235.         if {![cequal $bundle_tag $name]} {
  5236.             if {[PPP:isPresent bundle $name]} {
  5237.                 SaFormTabSetSelected $FTbundle
  5238.                 return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_NAME_EXIST]]
  5239.             }
  5240.             if {![PPP:rename bundle $bundle_tag $name]} {
  5241.                 SaFormTabSetSelected $FTbundle
  5242.                 return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_RENAME]]
  5243.             }
  5244.             GRP:lg_change_ref bundle $bundle_tag $name
  5245.             set bundle_tag $name
  5246.             dl:set $DLlist $ind OBJ $bundle_tag
  5247.             dl:set $DLlist $ind NAME $bundle_tag
  5248.             dl:show $DLlist $ind 1
  5249.         }
  5250.     }
  5251.     set rec ""
  5252.     foreach opt {
  5253.         type maxidle
  5254.         remotesys bringup
  5255.         login authid callerid
  5256.         authname peerauthname authtmout requirechap requirepap
  5257.         maxlinks minlinks ssn ed maxfrags minfrag mrru
  5258.         bod addsample addload dropsample dropload thrashtime
  5259.     } {
  5260.         PPP:get bundle $bundle_tag $opt value
  5261.         if {![eval cequal \"$value\" \"\$$opt\"]} {
  5262.             eval keylset rec $opt \"\$$opt\"
  5263.         }
  5264.     }
  5265.     if {![lempty $rec]} {
  5266.         if {![PPP:replace bundle $bundle_tag $rec]} {
  5267.             return [throwError $FDbundle [ILM SCO_PPP_ERR_BUNDLE_REPLACE]]
  5268.         }
  5269.         PPP:action bundle $name reset
  5270.     }
  5271.     if {$type_incoming && [cequal $login ""]} {
  5272.         set global_rec ""
  5273.         foreach opt {
  5274.             authname peerauthname authtmout requirechap requirepap
  5275.             ssn ed mrru
  5276.         } {
  5277.             PPP:get global/bundle bundle $opt value
  5278.             if {![eval cequal \"$value\" \"\$$opt\"]} {
  5279.                 eval keylset global_rec $opt \"\$$opt\"
  5280.             }
  5281.         }
  5282.         if {![lempty $global_rec]} {
  5283.             PPP:replace global/bundle bundle $global_rec
  5284.         }
  5285.     }
  5286.     switch $type {
  5287.         disabled       { set icon [dl:icon d] }
  5288.         in             { set icon [dl:icon i] }
  5289.         out            { set icon [dl:icon o] }
  5290.         bi-directional { set icon [dl:icon io] }
  5291.     }
  5292.     dl:set $DLlist $ind ICON $icon
  5293.     dl:show $DLlist $ind 1
  5294.     if {[cequal $op add]} {
  5295.         set nprotocols_ind ""
  5296.         foreach protocol_tag $nprotocols_add {
  5297.             set protocol_ind [bundle:DLadd_protocol $ind $ind $protocol_tag 1]
  5298.             bundle:DLinfo_protocol $protocol_ind 1
  5299.             lappend nprotocols_ind $protocol_ind
  5300.         }
  5301.         foreach protocol_tag $lprotocols_add {
  5302.             set protocol_ind [bundle:DLadd_protocol $ind $ind $protocol_tag 1]
  5303.             bundle:DLinfo_protocol $protocol_ind 1
  5304.         }
  5305.     }
  5306.     bundle:DLinfo $ind
  5307.     ppp:viewsort $ind
  5308.     dl:fixconn $DLlist $ind
  5309.     ppp:DLselectCB $cbs
  5310.     if {[cequal $op add]} {
  5311.         set parent_cbs [VxGetVar $FDbundle cbs]
  5312.         foreach protocol_tag $nprotocols_add {
  5313.             set val [defn_type protocol $protocol_tag]
  5314.             set defn_info ""
  5315.             set modify_on_add 1
  5316.             keylget ppp_type_info(protocol/$val) defn_info defn_info
  5317.             keylget defn_info modify_on_add modify_on_add
  5318.             if {$modify_on_add} {
  5319.                 set rec ""
  5320.                 keylset rec op modify
  5321.                 keylset rec mb mb120
  5322.                 keylset rec ind [lvarpop nprotocols_ind]
  5323.                 keylset rec sel sel106
  5324.                 keylset rec view $view
  5325.                 keylset rec parent_cbs $parent_cbs
  5326.                 keylset rec func bundle_protocol:build_modifyCB
  5327.                 ppp:chain_add $rec
  5328.             }
  5329.         }
  5330.         set rec ""
  5331.         keylset rec op add
  5332.         keylset rec mb mb113
  5333.         keylset rec ind $ind
  5334.         keylset rec sel sel101
  5335.         keylset rec view $view
  5336.         keylset rec parent_cbs $parent_cbs
  5337.         keylset rec func bundle_link_group:buildCB
  5338.         ppp:chain_add $rec
  5339.     }
  5340.     VxEndFormCB $cbs
  5341.     ppp:chain_next
  5342.     VtUnLock
  5343. }
  5344. proc bundle:deleteCB {op mb ind sel view cbs args} {
  5345.     Globals
  5346.     set bundle_tag [dl:get $DLlist $ind OBJ]
  5347.     set del_lgs ""
  5348.     set lg_ind [dl:next $DLlist $ind]
  5349.     while {![cequal $lg_ind end]} {
  5350.         set sel [dl:get $DLlist $lg_ind SEL]
  5351.         set level [dl:get $DLlist $lg_ind _LEVEL]
  5352.         if {$level == 0} {
  5353.             break
  5354.         }
  5355.         switch $sel {
  5356.             sel105 {
  5357.                 set lg_tag [dl:get $DLlist $lg_ind OBJ]
  5358.                 GRP:lg_del_ref $lg_tag bundle $bundle_tag
  5359.                 set_add del_lgs $lg_ind
  5360.             }
  5361.             sel106 -
  5362.             sel107 {
  5363.                 set proto [dl:get $DLlist $lg_ind PROTO]
  5364.                 set protocol_tag [dl:get $DLlist $lg_ind OBJ]
  5365.                 set algorithms ""
  5366.                 set txalgorithms ""
  5367.                 set rxalgorithms ""
  5368.                 PPP:get protocol $protocol_tag algorithms algorithms
  5369.                 PPP:get protocol $protocol_tag txalgorithms txalgorithms
  5370.                 PPP:get protocol $protocol_tag rxalgorithms rxalgorithms
  5371.                 foreach al_tag [concat $algorithms $txalgorithms $rxalgorithms] {
  5372.                     if {![PPP:isPresent algorithm $al_tag]} {
  5373.                         continue
  5374.                     }
  5375.                     PPP:get algorithm $al_tag algorithm algorithm
  5376.                     if {![PPP:delete algorithm/$algorithm $al_tag]} {
  5377.                         return [throwError $FDppp [ILM SCO_PPP_ERR_BUNDLE_DELETE]]
  5378.                     }
  5379.                 }
  5380.                 if {![PPP:delete protocol/${proto} $protocol_tag]} {
  5381.                     return [throwError $FDppp [ILM SCO_PPP_ERR_BUNDLE_DELETE]]
  5382.                 }
  5383.                 set_add del_lgs $lg_ind
  5384.             }
  5385.         }
  5386.         set lg_ind [dl:next $DLlist $lg_ind]
  5387.     }
  5388.     foreach del_lg $del_lgs {
  5389.         dl:delete $DLlist $del_lg
  5390.     }
  5391.     if {![PPP:delete bundle $bundle_tag]} {
  5392.         return [throwError $FDppp [ILM SCO_PPP_ERR_BUNDLE_DELETE]]
  5393.     }
  5394.     dl:delete $DLlist $ind
  5395.     ppp:DLselectCB $cbs
  5396.     VtUnLock
  5397. }
  5398. ##################################################
  5399. proc ppp:PBbundle_link_groupCB {op mb ind sel view cbs} {
  5400.     Globals
  5401.     switch $op {
  5402.         add {
  5403.             bundle_link_group:buildCB $op "$mb" "$ind" "$sel" $view $cbs
  5404.         }
  5405.         delete {
  5406.             keylget cbs dialog dialog
  5407.             if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "bundle_link_group:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
  5408.                 VtUnLock
  5409.                 return
  5410.             }
  5411.         }
  5412.     }
  5413. }
  5414. proc bundle_link_group:DLselectCB {from cbs} {
  5415.     keylget cbs dialog FDlg
  5416.     keylget cbs widget list
  5417.     set len [llength [VtDrawnListGetItem $list -all]]
  5418.     set pos [VtDrawnListGetSelectedItem $list -byPositionList]
  5419.     if {$pos == 0} {
  5420.         if {$len > 0} {
  5421.             VtDrawnListSelectItem $list -position 1
  5422.             set pos 1
  5423.         }
  5424.     }
  5425.     if {[cequal $from "lgsAvail"]} {
  5426.         GetVar $FDlg PBadd
  5427.         SetSens $PBadd 1
  5428.     } else {
  5429.         GetVar $FDlg PBremove
  5430.         SetSens $PBremove 1
  5431.     }
  5432.     VtUnLock
  5433. }
  5434. proc bundle_link_group:PBaddCB {cbs} {
  5435.     keylget cbs dialog FDlg
  5436.     wget $FDlg PBadd DLlgsAvail DLlgsSel lgFormatList
  5437.     set selected [lindex [VtDrawnListGetSelectedItem $DLlgsAvail -byRecordList] 0]
  5438.     set delpos [lindex [VtDrawnListGetSelectedItem $DLlgsAvail -byPositionList] 0]
  5439.     set addpos 0
  5440.     VtDrawnListAddItem $DLlgsSel \
  5441.         -position $addpos \
  5442.         -fieldList $selected
  5443.     VtDrawnListDeleteItem $DLlgsAvail -position $delpos
  5444.     SetSens $PBadd 0
  5445.     VtUnLock
  5446. }
  5447. proc bundle_link_group:PBremoveCB {cbs} {
  5448.     keylget cbs dialog FDlg
  5449.     wget $FDlg PBremove DLlgsAvail DLlgsSel lgFormatList
  5450.     set selected [lindex [VtDrawnListGetSelectedItem $DLlgsSel -byRecordList] 0]
  5451.     set delpos [lindex [VtDrawnListGetSelectedItem $DLlgsSel -byPositionList] 0]
  5452.     set addpos 0
  5453.     VtDrawnListAddItem $DLlgsAvail \
  5454.         -position $addpos \
  5455.         -fieldList $selected
  5456.     VtDrawnListDeleteItem $DLlgsSel -position $delpos
  5457.     SetSens $PBremove 0
  5458.     VtUnLock
  5459. }
  5460. proc bundle_link_group:buildCB {op mb ind sel view cbs} {
  5461.     Globals
  5462.     global iconpath
  5463.     keylget cbs dialog FDlg
  5464.     if {[cequal $op add]} {
  5465.         set title [ILM SCO_PPP_MSG_TITLE_LG_ADD]
  5466.     } else {
  5467.         set title [ILM SCO_PPP_MSG_TITLE_LG_MOD]
  5468.     }
  5469.     wset $FDlg FDlg [VtFormDialog $FDlg.FDlg \
  5470.         -title $title \
  5471.         -ok \
  5472.         -okCallback bundle_link_group:changeCB \
  5473.         -cancel \
  5474.         -cancelCallback VxEndFormCB \
  5475.         -autoDestroy 1 \
  5476.         -autoLock bundle_link_group:changeCB \
  5477.         -resizable 0 \
  5478.         -help \
  5479.         ]
  5480.     wset $FDlg Flgs [VtForm $FDlg.Fdevices \
  5481.         -marginWidth 0 \
  5482.         -marginHeight 0 \
  5483.         -CHARM_marginHeight 1 \
  5484.         -leftSide FORM \
  5485.         -rightSide FORM \
  5486.         -topSide FORM \
  5487.         -CHARM_topOffset 0 \
  5488.         -MOTIF_topOffset 5 \
  5489.         -CHARM_resizable 0 \
  5490.         ]
  5491.     wset $FDlg LlgsAvail [VtLabel $Flgs.LlgsAvail \
  5492.         -label [ILM SCO_PPP_MSG_LGS_AVAIL] \
  5493.         -topSide FORM \
  5494.         ]
  5495.     set lgFormatList {{DATA} {DATA} {ICON 1} {STRING 30}}
  5496.     wset $FDlg DLlgsAvail [VtDrawnList $Flgs.DLlgsAvail \
  5497.         -formatList $lgFormatList \
  5498.         -iconList [list $iconpath/multi-modem.px $iconpath/modem.px $iconpath/serial.px] \
  5499.         -CHARM_rows 7 \
  5500.         -MOTIF_rows 8 \
  5501.         -CHARM_columns 23 \
  5502.         -MOTIF_columns 20 \
  5503.         -horizontalScrollBar 1 \
  5504.         -callback "bundle_link_group:DLselectCB lgsAvail" \
  5505.         -autoLock bundle_link_group:DLselectCB \
  5506.         -leftSide FORM \
  5507.         -topSide $LlgsAvail \
  5508.         -bottomSide FORM \
  5509.         -shortHelpCallback SaShortHelpCB \
  5510.         -shortHelpString [ILM SCO_PPP_MSG_SH_LGS_AVAIL] \
  5511.         ]
  5512. ##########
  5513.     wset $FDlg RCbuttons [VtRowColumn $Flgs.RCbuttons \
  5514.         -CHARM_spacing 1 \
  5515.         -MOTIF_spacing 10 \
  5516.         -numColumns 1 \
  5517.         -packing COLUMN \
  5518.         -leftSide $DLlgsAvail \
  5519.         -rightSide NONE \
  5520.         -topSide 25 \
  5521.         -bottomSide FORM \
  5522.         ]
  5523.     wset $FDlg PBadd [VtPushButton $RCbuttons.PBadd \
  5524.         -label [ILM SCO_PPP_MSG_LG_ADD] \
  5525.         -labelCenter \
  5526.         -callback bundle_link_group:PBaddCB \
  5527.         -autoLock bundle_link_group:PBaddCB \
  5528.         -shortHelpString [ILM SCO_PPP_MSG_SH_LG_ADD] \
  5529.         -shortHelpCallback SaShortHelpCB \
  5530.         ]
  5531.     wset $FDlg PBremove [VtPushButton $RCbuttons.RCremove \
  5532.         -label [ILM SCO_PPP_MSG_LG_REMOVE] \
  5533.         -callback bundle_link_group:PBremoveCB \
  5534.         -autoLock bundle_link_group:PBremoveCB \
  5535.         -shortHelpString [ILM SCO_PPP_MSG_SH_LG_REMOVE] \
  5536.         -shortHelpCallback SaShortHelpCB \
  5537.         ]
  5538. ##########
  5539.     wset $FDlg LlgsSel [VtLabel $Flgs.LlgsSel \
  5540.         -label [ILM SCO_PPP_MSG_LGS_SEL] \
  5541.         -labelCenter \
  5542.         -topSide FORM \
  5543.         -leftSide $RCbuttons \
  5544.         ]
  5545.     wset $FDlg DLlgsSel [VtDrawnList $Flgs.DLlgsSel \
  5546.         -formatList $lgFormatList \
  5547.         -iconList [list $iconpath/multi-modem.px $iconpath/modem.px $iconpath/serial.px] \
  5548.         -CHARM_rows 7 \
  5549.         -MOTIF_rows 8 \
  5550.         -CHARM_columns 23 \
  5551.         -MOTIF_columns 20 \
  5552.         -horizontalScrollBar 1 \
  5553.         -callback "bundle_link_group:DLselectCB lgsSel" \
  5554.         -autoLock bundle_link_group:DLselectCB \
  5555.         -leftSide $RCbuttons \
  5556.         -MOTIF_rightSide FORM \
  5557.         -topSide $LlgsSel \
  5558.         -rightSide NONE \
  5559.         -bottomSide FORM \
  5560.         -shortHelpCallback SaShortHelpCB \
  5561.         -shortHelpString [ILM SCO_PPP_MSG_SH_LGS_SEL] \
  5562.         ]
  5563.     SetSens $PBadd 0
  5564.     SetSens $PBremove 0
  5565.     StatusBar $FDlg $Flgs
  5566.     VtShow $FDlg
  5567.     set owner_tag [dl:get $DLlist $ind OBJ]
  5568.     set links ""
  5569.     PPP:get bundle $owner_tag links links
  5570.     set icon 0
  5571.     wput $FDlg lgFormatList
  5572.     wput $FDlg op mb ind sel view cbs
  5573.     set lgsAvail ""
  5574.     set lgsSel ""
  5575.     foreach link_tag $links {
  5576.         if {[GRP:isMember lg $link_tag member_grps]} {
  5577.             foreach grp $member_grps {
  5578.                 set_add lgsSel $grp
  5579.             }
  5580.         }
  5581.     }
  5582.     set i3 [intersect3 $lgsSel [GRP:list lg]]
  5583.     set lgsAvail [lindex $i3 2]
  5584.     foreach lg_tag $lgsAvail {    
  5585.         set name [GRP:get $lg_tag name]
  5586.         set tags [GRP:get $lg_tag tags]
  5587.         if {[lempty $tags]} {
  5588.             continue
  5589.         }
  5590.         VtDrawnListAddItem $DLlgsAvail \
  5591.             -position 0 \
  5592.             -fieldList [list $lg_tag a $icon $name]    
  5593.     }
  5594.     foreach lg_tag $lgsSel {    
  5595.         set name [GRP:get $lg_tag name]
  5596.         VtDrawnListAddItem $DLlgsSel \
  5597.             -position 0 \
  5598.             -fieldList [list $lg_tag s $icon $name]    
  5599.     }
  5600.     VtUnLock
  5601. }
  5602. proc bundle_link_group:changeCB {cbs} {
  5603.     Globals
  5604.     keylget cbs dialog FDlg
  5605.     wget $FDlg DLlgsSel DLlgsAvail
  5606.     wget $FDlg op ind sel view mb
  5607.     set bundle_tag [dl:get $DLlist $ind OBJ]
  5608.     set lgsSel [VtDrawnListGetItem $DLlgsSel -all]
  5609.     set lgsAvail [VtDrawnListGetItem $DLlgsAvail -all]
  5610.     set add_lgs ""
  5611.     set del_lgs ""
  5612.     set link_tags ""
  5613.     foreach lgSel $lgsSel {
  5614.         lassign $lgSel lg_tag orig
  5615.         if {[cequal $orig a]} {
  5616.             set_add add_lgs $lg_tag
  5617.             GRP:lg_add_ref $lg_tag bundle $bundle_tag
  5618.         }
  5619.         set tags [GRP:get $lg_tag tags]
  5620.         foreach tag $tags {
  5621.             set_add link_tags $tag
  5622.         }
  5623.     }
  5624.     foreach lgAvail $lgsAvail {
  5625.         lassign $lgAvail lg_tag orig
  5626.         if {[cequal $orig s]} {
  5627.             set_add del_lgs $lg_tag
  5628.             GRP:lg_del_ref $lg_tag bundle $bundle_tag
  5629.         }
  5630.     }
  5631.     PPP:get bundle $bundle_tag links links
  5632.     if {![sequal $links $link_tags]} {
  5633.         if {![PPP:replace bundle $bundle_tag links $link_tags]} {
  5634.             return [throwError $FDlg [ILM SCO_PPP_ERR_LG_REPLACE]]
  5635.         }
  5636.         PPP:action bundle $bundle_tag reset
  5637.         set state [dl:state $DLlist $ind]
  5638.         switch $state {
  5639.             collapsed {
  5640.                 set expanded 0
  5641.             }
  5642.             default {
  5643.                 set expanded 1
  5644.             }
  5645.         }
  5646.         foreach lg $add_lgs {
  5647.             set lg_ind [bundle_link_group:DLadd_link_group $ind $sel $ind $lg $expanded]
  5648.             bundle_link_group:DLinfo $lg_ind
  5649.         }
  5650.         if {![lempty $del_lgs]} {
  5651.             set lg_sel sel105
  5652.             set above_level [dl:get $DLlist $ind _LEVEL]
  5653.             set lg_ind [dl:next $DLlist $ind]
  5654.             set level [dl:get $DLlist $lg_ind _LEVEL]
  5655.             set del_found ""
  5656.             while {$level > $above_level && ![cequal $lg_ind end]} {
  5657.                 set search_sel [dl:get $DLlist $lg_ind SEL]
  5658.                 set search_obj [dl:get $DLlist $lg_ind OBJ]
  5659.                 if {[cequal $lg_sel $search_sel] && [set_isMember $del_lgs $search_obj]} {
  5660.                     set_add del_found $lg_ind
  5661.                 }
  5662.                 set lg_ind [dl:next $DLlist $lg_ind]
  5663.                 set level [dl:get $DLlist $lg_ind _LEVEL]
  5664.             }
  5665.             foreach lg_ind $del_found {
  5666.                 dl:delete $DLlist $lg_ind
  5667.             }
  5668.         }
  5669.         ppp:viewsort $ind
  5670.         dl:fixconn $DLlist $ind
  5671.     }
  5672.     ppp:DLselectCB $cbs
  5673.     VxEndFormCB $cbs
  5674.     ppp:chain_next
  5675.     VtUnLock
  5676. }
  5677. proc bundle_link_group:deleteCB {op mb ind sel view cbs args} {
  5678.     Globals
  5679.     set lg_tag [dl:get $DLlist $ind OBJ]
  5680.     set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
  5681.     set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
  5682.     set tags [GRP:get $lg_tag tags]
  5683.     set links ""
  5684.     PPP:get bundle ${bundle_tag} links links
  5685.     foreach tag $tags {
  5686.         set_del links $tag
  5687.     }
  5688.     GRP:lg_del_ref $lg_tag bundle $bundle_tag
  5689.     if {![PPP:replace bundle $bundle_tag links $links]} {
  5690.         return [throwError $FDlg [ILM SCO_PPP_ERR_LG_DELETE]]
  5691.     }
  5692.     dl:delete $DLlist $ind
  5693.     dl:fixconn $DLlist $bundle_ind
  5694.     ppp:DLselectCB $cbs
  5695.     VtUnLock
  5696. }
  5697. proc bundle_link_group:DLadd_link_group {ind sel bundle_ind lg_tag show} {
  5698.     Globals
  5699.     set name [GRP:get $lg_tag name]
  5700.     set lg_ind [dl:add $DLlist $ind 1]
  5701.     dl:set $DLlist $lg_ind ICON [dl:icon lg]
  5702.     dl:set $DLlist $lg_ind SEL sel105
  5703.     dl:set $DLlist $lg_ind OBJ $lg_tag
  5704.     dl:set $DLlist $lg_ind BUNDLEIND $bundle_ind
  5705.     dl:set $DLlist $lg_ind NAME $name
  5706.     dl:show $DLlist $lg_ind $show
  5707.     return $lg_ind
  5708. }
  5709. proc bundle_link_group:DLinfo {ind} {
  5710.     link_group:DLinfo $ind
  5711. }
  5712. ##################################################
  5713. proc ppp:PBbundle_network_protocolCB {op mb ind sel view cbs} {
  5714.     Globals
  5715.     switch $op {
  5716.         add {
  5717.             bundle_network_protocol:build_addCB $op "$mb" "$ind" "$sel" $view $cbs
  5718.         }
  5719.         modify {
  5720.             bundle_protocol:build_modifyCB $op "$mb" "$ind" "$sel" $view $cbs
  5721.         }
  5722.         delete {
  5723.             set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
  5724.             set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
  5725.             set proto [dl:get $DLlist $ind PROTO]
  5726.             set protocol_tag [dl:get $DLlist $ind OBJ]
  5727.             keylget ppp_type_info(protocol/$proto) sub_defn sub_defn
  5728.             if {[cequal $sub_defn network] && [num_network_protocols $bundle_tag] == 1} {
  5729.                 return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_NETWORK_ONE]]
  5730.             }
  5731.             keylget cbs dialog dialog
  5732.             if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "bundle_protocol:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
  5733.                 VtUnLock
  5734.                 return
  5735.             }
  5736.         }
  5737.     }
  5738. }
  5739. proc ppp:PBbundle_link_protocolCB {op mb ind sel view cbs} {
  5740.     Globals
  5741.     switch $op {
  5742.         add {
  5743.             bundle_link_protocol:build_addCB $op "$mb" "$ind" "$sel" $view $cbs
  5744.         }
  5745.         modify {
  5746.             bundle_protocol:build_modifyCB $op "$mb" "$ind" "$sel" $view $cbs
  5747.         }
  5748.         delete {
  5749.             keylget cbs dialog dialog
  5750.             if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "bundle_protocol:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
  5751.                 VtUnLock
  5752.                 return
  5753.             }
  5754.         }
  5755.     }
  5756. }
  5757. proc bundle_link_protocol:build_addCB {op mb ind sel view cbs} {
  5758.     Globals
  5759.     keylget cbs dialog dialog
  5760.     set lprotocols [defn_list protocol link bundle]
  5761.     set bundle_tag [dl:get $DLlist $ind OBJ]
  5762.     PPP:get bundle $bundle_tag protocols protocols
  5763.     foreach protocol_tag $protocols {
  5764.         set val [defn_type protocol $protocol_tag]
  5765.         if {[PPP:isPresent protocol $protocol_tag]} {
  5766.             set_del lprotocols protocol/$val
  5767.         }
  5768.     }
  5769.     if {[lempty $lprotocols]} {
  5770.         set EDno_protocols [VtErrorDialog $dialog.EDno_protocols \
  5771.             -wmDecoration { TITLE RESIZE BORDER } \
  5772.             -autoDestroy 1 \
  5773.             -ok \
  5774.             -message [ILM SCO_PPP_ERR_BUNDLE_NO_LINK_PROTOCOLS] \
  5775.             ]
  5776.         VtShowDialog $EDno_protocols
  5777.         VtUnLock
  5778.         return
  5779.     }
  5780.     if {[cequal $op add]} {
  5781.         set title [ILM SCO_PPP_MSG_TITLE_LPROTOCOLS_ADD]
  5782.     } else {
  5783.         set title [ILM SCO_PPP_MSG_TITLE_LPROTOCOLS_MOD]
  5784.     }
  5785.     wset $dialog FDlp [VtFormDialog $dialog.FDlp \
  5786.         -title $title \
  5787.         -ok \
  5788.         -okCallback bundle_link_protocol:change_addCB \
  5789.         -cancel \
  5790.         -cancelCallback VxEndFormCB \
  5791.         -autoDestroy 1 \
  5792.         -autoLock bundle_link_protocol:change_addCB \
  5793.         -help \
  5794.         ]
  5795.     wset $FDlp AFlprotocols [AlignedForm $FDlp.AFlprotocols [list \
  5796.         [list SCO_PPP_MSG_LPROTOCOLS Llprotocols LSlprotocols \
  5797.             [list VtList \
  5798.                 -callback bundle_link_protocol:LSlprotocols_selectCB \
  5799.                 -selection MULTIPLE \
  5800.                 -scrollBar 1 \
  5801.                 -columns 25 \
  5802.                 -rows 5 \
  5803.                 -shortHelpString [ILM SCO_PPP_MSG_SH_BUNDLE_LPROTOCOLS] \
  5804.                 -shortHelpCallback SaShortHelpCB \
  5805.                 ]] \
  5806.             ]]
  5807.     StatusBar $FDlp $AFlprotocols
  5808.     VtShow $FDlp
  5809.     wput $FDlp LSlprotocols 
  5810.     wput $FDlp op mb ind sel view cbs
  5811.     set lpSel ""
  5812.     foreach protocol $lprotocols {
  5813.         keylget ppp_type_info($protocol) val val
  5814.         set proto [translit "a-z" "A-Z" $val]
  5815.         VtListAddItem $LSlprotocols \
  5816.             -item $proto
  5817.     }
  5818.     VxSetVar $LSlprotocols firstError 1
  5819.     SetVar $LSlprotocols lpSel
  5820.     VtUnLock
  5821. }
  5822. proc bundle_link_protocol:change_addCB {cbs} {
  5823.     Globals
  5824.     keylget cbs dialog FDlp
  5825.     wget $FDlp LSlprotocols 
  5826.     wget $FDlp op ind mb sel view
  5827.     set bundle_tag [dl:get $DLlist $ind OBJ]
  5828.     set bundle_ind $ind
  5829.     PPP:get bundle $bundle_tag protocols protocols
  5830.     set new_protocols ""
  5831.     set lprotocols [VtListGetSelectedItem $LSlprotocols -byItemList]
  5832.     foreach proto $lprotocols {
  5833.         set val [translit "A-Z" "a-z" $proto]
  5834.         set protocol_tag ${val}_${bundle_tag}
  5835.         while {[PPP:isPresent protocol $protocol_tag]} {
  5836.             set protocol_tag [cycleName $protocol_tag]
  5837.         }
  5838.         if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type bundle]]]} {
  5839.             foreach protocol_tag $protocols {
  5840.                 if {![PPP:isPresent protocol $protocol_tag]} {
  5841.                     continue
  5842.                 }
  5843.                 PPP:get protocol $protocol_tag protocol protocol
  5844.                 PPP:delete protocol/${protocol} $protocol_tag
  5845.             }
  5846.             return [throwError $FDlp [ILM SCO_PPP_ERR_PROTOCOL_CREATE]]
  5847.         }
  5848.         set_add protocols $protocol_tag
  5849.         set_add new_protocols $protocol_tag
  5850.         set algorithms [defn_list algorithm link protocol/$val]
  5851.         if {![lempty $algorithms]} {
  5852.             set txalgorithms ""
  5853.             set rxalgorithms ""
  5854.             foreach algorithm $algorithms {
  5855.                 set alval ""
  5856.                 keylget ppp_type_info($algorithm) val alval
  5857.                 if {[cequal $alval ""]} {
  5858.                     continue
  5859.                 }
  5860.                 set tx_tag tx_${val}_${alval}_${bundle_tag}
  5861.                 set rx_tag rx_${val}_${alval}_${bundle_tag}
  5862.                 while {[PPP:isPresent algorithm $rx_tag] || [PPP:isPresent algorithm $tx_tag]} {
  5863.                     set tx_tag [cycleName $tx_tag]
  5864.                     set rx_tag [cycleName $rx_tag]
  5865.                 }
  5866.                 set_add rxalgorithms $rx_tag
  5867.                 set_add txalgorithms $tx_tag
  5868.                 if {![PPP:create algorithm/${alval} $rx_tag]} {
  5869.                     set_del rxalgorithms $rx_tag
  5870.                 }
  5871.                 if {![PPP:create algorithm/${alval} $tx_tag]} {
  5872.                     set_del txalgorithms $tx_tag
  5873.                 }
  5874.             }
  5875.             PPP:replace protocol/${val} $protocol_tag txalgorithms $txalgorithms
  5876.             PPP:replace protocol/${val} $protocol_tag rxalgorithms $rxalgorithms
  5877.         }
  5878.     }
  5879.     PPP:replace bundle $bundle_tag protocols $protocols
  5880.     PPP:action bundle $bundle_tag reset
  5881.     set state [dl:state $DLlist $bundle_ind]
  5882.     if {[cequal $state collapsed]} {
  5883.         set expanded 0
  5884.     } else {
  5885.         set expanded 1
  5886.     }
  5887.     foreach protocol_tag $protocols {
  5888.         if {[set_isMember $new_protocols $protocol_tag]} {
  5889.             set protocol_ind [bundle:DLadd_protocol $bundle_ind $bundle_ind $protocol_tag $expanded]
  5890.             bundle:DLinfo_protocol $protocol_ind $expanded
  5891.         }
  5892.     }
  5893.     ppp:viewsort $bundle_ind
  5894.     dl:fixconn $DLlist $bundle_ind
  5895.     ppp:DLselectCB $cbs
  5896.     if {[cequal $op add]} {
  5897.         set parent_cbs [VxGetVar $FDlp cbs]
  5898.         foreach protocol_tag $new_protocols {
  5899.             set val [defn_type protocol $protocol_tag]
  5900.             set defn_info ""
  5901.             set modify_on_add 0
  5902.             keylget ppp_type_info(protocol/$val) defn_info defn_info
  5903.             keylget defn_info modify_on_add modify_on_add
  5904.             if {$modify_on_add} {
  5905.                 set rec ""
  5906.                 keylset rec op modify
  5907.                 keylset rec mb mb120
  5908.                 keylset rec ind $protocol_ind
  5909.                 keylset rec sel sel107
  5910.                 keylset rec view $view
  5911.                 keylset rec parent_cbs $parent_cbs
  5912.                 keylset rec func bundle_protocol:build_modifyCB
  5913.                 ppp:chain_add $rec
  5914.             }
  5915.         }
  5916.     }
  5917.     VxEndFormCB $cbs
  5918.     ppp:chain_next
  5919.     VtUnLock
  5920. }
  5921. proc bundle_link_protocol:LSlprotocols_selectCB {cbs} {
  5922.     keylget cbs dialog FDlp
  5923.     keylget cbs value value
  5924.     keylget cbs mode mode
  5925.     keylget cbs widget LSlprotocols
  5926.     keylget cbs selectedItemList itemList
  5927.     GetVar $LSlprotocols lpSel
  5928.     set i3 [intersect3 $lpSel $itemList]
  5929.     if {[cequal "" [lindex $i3 0]]} {
  5930.         set value [lindex $i3 2]
  5931.         set mode select
  5932.     } else {
  5933.         set value [lindex $i3 0]
  5934.         set mode deselect
  5935.     }
  5936.     VxSetVar $LSlprotocols lpSel $itemList
  5937. }
  5938. proc bundle_network_protocol:build_addCB {op mb ind sel view cbs} {
  5939.     Globals
  5940.     keylget cbs dialog dialog
  5941.     set nprotocols [defn_list protocol network bundle]
  5942.     set bundle_tag [dl:get $DLlist $ind OBJ]
  5943.     PPP:get bundle $bundle_tag protocols protocols
  5944.     foreach protocol_tag $protocols {
  5945.         set val [defn_type protocol $protocol_tag]
  5946.         if {[PPP:isPresent protocol $protocol_tag]} {
  5947.             set_del nprotocols protocol/$val
  5948.         }
  5949.     }
  5950.     if {[lempty $nprotocols]} {
  5951.         set EDno_protocols [VtErrorDialog $dialog.EDno_protocols \
  5952.             -wmDecoration { TITLE RESIZE BORDER } \
  5953.             -autoDestroy 1 \
  5954.             -ok \
  5955.             -message [ILM SCO_PPP_ERR_BUNDLE_NO_NETWORK_PROTOCOLS] \
  5956.             ]
  5957.         VtShowDialog $EDno_protocols
  5958.         VtUnLock
  5959.         return
  5960.     }
  5961.     if {[cequal $op add]} {
  5962.         set title [ILM SCO_PPP_MSG_TITLE_NPROTOCOLS_ADD]
  5963.     } else {
  5964.         set title [ILM SCO_PPP_MSG_TITLE_NPROTOCOLS_MOD]
  5965.     }
  5966.     wset $dialog FDnp [VtFormDialog $dialog.FDnp \
  5967.         -title $title \
  5968.         -ok \
  5969.         -okCallback bundle_network_protocol:change_addCB \
  5970.         -cancel \
  5971.         -cancelCallback VxEndFormCB \
  5972.         -autoDestroy 1 \
  5973.         -autoLock bundle_network_protocol:change_addCB \
  5974.         -help \
  5975.         ]
  5976.     wset $FDnp AFnprotocols [AlignedForm $FDnp.AFnprotocols [list \
  5977.         [list SCO_PPP_MSG_NPROTOCOLS Lnprotocols LSnprotocols \
  5978.             [list VtList \
  5979.                 -callback bundle_network_protocol:LSnprotocols_selectCB \
  5980.                 -selection MULTIPLE \
  5981.                 -scrollBar 1 \
  5982.                 -columns 25 \
  5983.                 -rows 5 \
  5984.                 -shortHelpString [ILM SCO_PPP_MSG_SH_NPROTOCOLS] \
  5985.                 -shortHelpCallback SaShortHelpCB \
  5986.                 ]] \
  5987.             ]]
  5988.     StatusBar $FDnp $AFnprotocols
  5989.     VtShow $FDnp
  5990.     wput $FDnp LSnprotocols 
  5991.     wput $FDnp op mb ind sel view cbs
  5992.     set npSel ""
  5993.     foreach protocol $nprotocols {
  5994.         keylget ppp_type_info($protocol) val val
  5995.         set proto [translit "a-z" "A-Z" $val]
  5996.         VtListAddItem $LSnprotocols \
  5997.             -item $proto
  5998.     }
  5999.     VxSetVar $LSnprotocols firstError 1
  6000.     SetVar $LSnprotocols npSel
  6001.     VtUnLock
  6002. }
  6003. proc bundle_network_protocol:change_addCB {cbs} {
  6004.     Globals
  6005.     keylget cbs dialog FDnp
  6006.     wget $FDnp LSnprotocols 
  6007.     wget $FDnp op ind mb sel view
  6008.     set bundle_tag [dl:get $DLlist $ind OBJ]
  6009.     set bundle_ind $ind
  6010.     PPP:get bundle $bundle_tag protocols protocols
  6011.     set new_protocols ""
  6012.     set nprotocols [VtListGetSelectedItem $LSnprotocols -byItemList]
  6013.     foreach proto $nprotocols {
  6014.         set val [translit "A-Z" "a-z" $proto]
  6015.         set protocol_tag ${val}_${bundle_tag}
  6016.         while {[PPP:isPresent protocol $protocol_tag]} {
  6017.             set protocol_tag [cycleName $protocol_tag]
  6018.         }
  6019.         if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type bundle]]]} {
  6020.             foreach protocol_tag $protocols {
  6021.                 if {![PPP:isPresent protocol $protocol_tag]} {
  6022.                     continue
  6023.                 }
  6024.                 PPP:get protocol $protocol_tag protocol protocol
  6025.                 PPP:delete protocol/${protocol} $protocol_tag
  6026.             }
  6027.             return [throwError $FDnp [ILM SCO_PPP_ERR_PROTOCOL_CREATE]]
  6028.         }
  6029.         set_add protocols $protocol_tag
  6030.         set_add new_protocols $protocol_tag
  6031.     }
  6032.     PPP:replace bundle $bundle_tag protocols $protocols
  6033.     PPP:action bundle $bundle_tag reset
  6034.     set state [dl:state $DLlist $bundle_ind]
  6035.     if {[cequal $state collapsed]} {
  6036.         set expanded 0
  6037.     } else {
  6038.         set expanded 1
  6039.     }
  6040.     foreach protocol_tag $protocols {
  6041.         if {[set_isMember $new_protocols $protocol_tag]} {
  6042.             set protocol_ind [bundle:DLadd_protocol $bundle_ind $bundle_ind $protocol_tag $expanded]
  6043.             bundle:DLinfo_protocol $protocol_ind $expanded
  6044.         }
  6045.     }
  6046.     ppp:viewsort $bundle_ind
  6047.     dl:fixconn $DLlist $bundle_ind
  6048.     ppp:DLselectCB $cbs
  6049.     if {[cequal $op add]} {
  6050.         set parent_cbs [VxGetVar $FDnp cbs]
  6051.         foreach protocol_tag $new_protocols {
  6052.             set val [defn_type protocol $protocol_tag]
  6053.             set defn_info ""
  6054.             set modify_on_add 1
  6055.             keylget ppp_type_info(protocol/$val) defn_info defn_info
  6056.             keylget defn_info modify_on_add modify_on_add
  6057.             if {$modify_on_add} {
  6058.                 set rec ""
  6059.                 keylset rec op modify
  6060.                 keylset rec mb mb120
  6061.                 keylset rec ind $protocol_ind
  6062.                 keylset rec sel sel106
  6063.                 keylset rec view $view
  6064.                 keylset rec parent_cbs $parent_cbs
  6065.                 keylset rec func bundle_protocol:build_modifyCB
  6066.                 ppp:chain_add $rec
  6067.             }
  6068.         }
  6069.     }
  6070.     VxEndFormCB $cbs
  6071.     ppp:chain_next
  6072.     VtUnLock
  6073. }
  6074. proc bundle_network_protocol:LSnprotocols_selectCB {cbs} {
  6075.     keylget cbs dialog FDnp
  6076.     keylget cbs value value
  6077.     keylget cbs mode mode
  6078.     keylget cbs widget LSnprotocols
  6079.     keylget cbs selectedItemList itemList
  6080.     GetVar $LSnprotocols npSel
  6081.     set i3 [intersect3 $npSel $itemList]
  6082.     if {[cequal "" [lindex $i3 0]]} {
  6083.         set value [lindex $i3 2]
  6084.         set mode select
  6085.     } else {
  6086.         set value [lindex $i3 0]
  6087.         set mode deselect
  6088.     }
  6089.     VxSetVar $LSnprotocols npSel $itemList
  6090. }
  6091. proc bundle_protocol:build_modifyCB {op mb ind sel view cbs} {
  6092.     Globals
  6093.     widget:build $op $mb $ind $sel $view $cbs
  6094.     ppp:DLselectCB $cbs
  6095.     VtUnLock
  6096. }
  6097. proc bundle_protocol:deleteCB {op mb ind sel view cbs args} {
  6098.     Globals
  6099.     set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
  6100.     set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
  6101.     set proto [dl:get $DLlist $ind PROTO]
  6102.     set protocol_tag [dl:get $DLlist $ind OBJ]
  6103.     keylget ppp_type_info(protocol/$proto) sub_defn sub_defn
  6104.     if {[cequal $sub_defn network] && [num_network_protocols $bundle_tag] == 1} {
  6105.         return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_NETWORK_ONE]]
  6106.     }
  6107.     if {[cequal $sel sel107]} {
  6108.         set algorithms ""
  6109.         set txalgorithms ""
  6110.         set rxalgorithms ""
  6111.         PPP:get protocol $protocol_tag algorithms algorithms
  6112.         PPP:get protocol $protocol_tag txalgorithms txalgorithms
  6113.         PPP:get protocol $protocol_tag rxalgorithms rxalgorithms
  6114.         foreach al_tag [concat $algorithms $txalgorithms $rxalgorithms] {
  6115.             if {![PPP:isPresent algorithm $al_tag]} {
  6116.                 continue
  6117.             }
  6118.             PPP:get algorithm $al_tag algorithm algorithm
  6119.             if {![PPP:delete algorithm/$algorithm $al_tag]} {
  6120.                 return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
  6121.             }
  6122.         }
  6123.     }
  6124.     PPP:get bundle $bundle_tag protocols protocols
  6125.     set_del protocols $protocol_tag
  6126.     if {![PPP:replace bundle $bundle_tag protocols $protocols]} {
  6127.         return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
  6128.     }
  6129.     if {![PPP:delete protocol/${proto} $protocol_tag]} {
  6130.         return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
  6131.     }
  6132.     dl:delete $DLlist $ind
  6133.     dl:fixconn $DLlist $bundle_ind
  6134.     ppp:DLselectCB $cbs
  6135.     VtUnLock
  6136. }
  6137. ##################################################
  6138. proc bundle_passwd:buildCB {op mb ind sel view cbs} {
  6139.     Globals
  6140.     global iconpath managedHost PPP_SHELL PPP_USER 
  6141.     keylget cbs dialog dialog
  6142. ####################
  6143.     set login $op
  6144.     wset $dialog FDpasswd [VtFormDialog $dialog.FDpasswd \
  6145.         -title [ILM SCO_PPP_MSG_TITLE_PASSWD $login] \
  6146.         -ok \
  6147.         -okCallback "bundle_passwd:changeCB 1" \
  6148.         -cancel \
  6149.         -cancelCallback "bundle_passwd:changeCB 0" \
  6150.         -autoDestroy 1 \
  6151.         -autoLock bundle_passwd:changeCB \
  6152.         -help \
  6153.         ]
  6154.     wset $FDpasswd AFpasswd [AlignedForm $FDpasswd.AFpasswd [list \
  6155.         [list SCO_PPP_MSG_PASSWD1 Lpasswd1 Tpasswd1 \
  6156.             [list VtText \
  6157.                 -noEcho \
  6158.                 -columns 25 \
  6159.                 -shortHelpString [ILM SCO_PPP_MSG_SH_PASSWD1] \
  6160.                 -shortHelpCallback SaShortHelpCB \
  6161.                 ]] \
  6162.         [list SCO_PPP_MSG_PASSWD2 Lpasswd2 Tpasswd2 \
  6163.             [list VtText \
  6164.                 -noEcho \
  6165.                 -columns 25 \
  6166.                 -shortHelpString [ILM SCO_PPP_MSG_SH_PASSWD2] \
  6167.                 -shortHelpCallback SaShortHelpCB \
  6168.                 ]] \
  6169.             ]]
  6170. ####################
  6171.     StatusBar $FDpasswd $AFpasswd
  6172.     VtShow $FDpasswd
  6173. ####################
  6174.     VtSetValues $Tpasswd1 -value ""
  6175.     VtSetValues $Tpasswd2 -value ""
  6176.     wput $FDpasswd Tpasswd1 Tpasswd2
  6177.     wput $FDpasswd op mb ind sel view cbs
  6178.     VtUnLock
  6179. }
  6180. proc bundle_passwd:changeCB {change cbs} {
  6181.     Globals
  6182.     if {$change} {
  6183.         keylget cbs dialog FDpasswd
  6184.         wget $FDpasswd Tpasswd1 Tpasswd2
  6185.         wget $FDpasswd op mb ind sel view
  6186. ####################
  6187.         set login $op
  6188.         GetValues $Tpasswd1 passwd1
  6189.         GetValues $Tpasswd2 passwd2
  6190.         if {![cequal $passwd1 $passwd2]} {
  6191.             VtSetValues $Tpasswd1 -value ""
  6192.             VtSetValues $Tpasswd2 -value ""
  6193.             return [throwError $FDpasswd [ILM SCO_PPP_ERR_PPP_PASSWD_NOT_MATCH]]
  6194.         }
  6195.         rename GetUser PPP_GetUser    
  6196.         catch {rename account_GetUser GetUser}
  6197.         set objcall [list ObjectGet {sco accounts} [SetInstance NULL] {nextUid}]
  6198.         set bmipResponse [SMOC $objcall]
  6199.         set objcall [list ObjectAction {sco account} [SetInstance $login] setPassword $passwd1]
  6200.         set bmipResponse [SMOC $objcall]
  6201.         catch {rename GetUser account_GetUser}
  6202.         rename PPP_GetUser GetUser    
  6203.         set firstBmip [lindex $bmipResponse 0]
  6204.         set errStack [BmipResponseErrorStack firstBmip]
  6205.         if { ![lempty $errStack] } {
  6206.             return [throwError $FDpasswd [ILM SCO_PPP_ERR_PPP_PASSWD_SET_FAILED $login]]
  6207.         }
  6208.     }
  6209.     VxEndFormCB $cbs
  6210.     ppp:chain_next
  6211.     VtUnLock
  6212. }
  6213. ##################################################
  6214. proc ppp:PBlink_group_link_protocolCB {op mb ind sel view cbs} {
  6215.     Globals
  6216.     switch $op {
  6217.         add {
  6218.             link_group_link_protocol:build_addCB $op "$mb" "$ind" "$sel" $view $cbs
  6219.         }
  6220.         modify {
  6221.             link_group_link_protocol:build_modifyCB $op "$mb" "$ind" "$sel" $view $cbs
  6222.         }
  6223.         delete {
  6224.             set lg_ind [dl:get $DLlist $ind LGIND]
  6225.             set lg_tag [dl:get $DLlist $lg_ind OBJ]
  6226.             set proto [dl:get $DLlist $ind PROTO]
  6227.             set protocol_tag [dl:get $DLlist $ind OBJ]
  6228.             if {[cequal $proto lcp]} {
  6229.                 return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_LCP_DELETE]]
  6230.             }
  6231.             keylget cbs dialog dialog
  6232.             if {[confirm $dialog [ILM SCO_PPP_MSG_CONFIRM_DELETE] "link_group_link_protocol:deleteCB $op \"$mb\" \"$ind\" \"$sel\" $view \"$cbs\""]} {
  6233.                 VtUnLock
  6234.                 return
  6235.             }
  6236.         }
  6237.     }
  6238. }
  6239. proc link_group_link_protocol:build_addCB {op mb ind sel view cbs} {
  6240.     Globals
  6241.     keylget cbs dialog dialog
  6242.     set lprotocols [defn_list protocol link link]
  6243.     set lg_tag [dl:get $DLlist $ind OBJ]
  6244.     set info [GRP:get $lg_tag info]
  6245.     set group_attrs ""
  6246.     keylget info group_attrs group_attrs
  6247.     keylget group_attrs protocols protocols
  6248.     foreach protocol_tag $protocols {
  6249.         set val [defn_type protocol $protocol_tag]
  6250.         if {[PPP:isPresent protocol $protocol_tag]} {
  6251.             set_del lprotocols protocol/$val
  6252.         }
  6253.     }
  6254.     if {[lempty $lprotocols]} {
  6255.         set EDno_protocols [VtErrorDialog $dialog.EDno_protocols \
  6256.             -wmDecoration { TITLE RESIZE BORDER } \
  6257.             -autoDestroy 1 \
  6258.             -ok \
  6259.             -message [ILM SCO_PPP_ERR_LINKS_NO_LINK_PROTOCOLS] \
  6260.             ]
  6261.         VtShowDialog $EDno_protocols
  6262.         VtUnLock
  6263.         return
  6264.     }
  6265.     if {[cequal $op add]} {
  6266.         set title [ILM SCO_PPP_MSG_TITLE_LPROTOCOLS_ADD]
  6267.     } else {
  6268.         set title [ILM SCO_PPP_MSG_TITLE_LPROTOCOLS_MOD]
  6269.     }
  6270.     wset $dialog FDlp [VtFormDialog $dialog.FDlp \
  6271.         -title $title \
  6272.         -ok \
  6273.         -okCallback link_group_link_protocol:change_addCB \
  6274.         -cancel \
  6275.         -cancelCallback VxEndFormCB \
  6276.         -autoDestroy 1 \
  6277.         -autoLock link_group_link_protocol:change_addCB \
  6278.         -help \
  6279.         ]
  6280.     wset $FDlp AFlprotocols [AlignedForm $FDlp.AFlprotocols [list \
  6281.         [list SCO_PPP_MSG_LPROTOCOLS Llprotocols LSlprotocols \
  6282.             [list VtList \
  6283.                 -callback link_group_link_protocol:LSlprotocols_selectCB \
  6284.                 -selection MULTIPLE \
  6285.                 -scrollBar 1 \
  6286.                 -columns 25 \
  6287.                 -rows 5 \
  6288.                 -shortHelpString [ILM SCO_PPP_MSG_SH_LINKS_LPROTOCOLS] \
  6289.                 -shortHelpCallback SaShortHelpCB \
  6290.                 ]] \
  6291.             ]]
  6292.     StatusBar $FDlp $AFlprotocols
  6293.     VtShow $FDlp
  6294.     wput $FDlp LSlprotocols 
  6295.     wput $FDlp op mb ind sel view cbs
  6296.     set lpSel ""
  6297.     foreach protocol $lprotocols {
  6298.         keylget ppp_type_info($protocol) val val
  6299.         set proto [translit "a-z" "A-Z" $val]
  6300.         VtListAddItem $LSlprotocols \
  6301.             -item $proto
  6302.     }
  6303.     VxSetVar $LSlprotocols firstError 1
  6304.     SetVar $LSlprotocols lpSel
  6305.     VtUnLock
  6306. }
  6307. proc link_group_link_protocol:change_addCB {cbs} {
  6308.     Globals
  6309.     keylget cbs dialog FDlp
  6310.     wget $FDlp LSlprotocols 
  6311.     wget $FDlp op ind mb sel view
  6312.     set lg_obj [dl:get $DLlist $ind OBJ]
  6313.     set lg_ind $ind
  6314.     set info ""
  6315.     set info [GRP:get $lg_obj info]
  6316.     set name [GRP:get $lg_obj name]
  6317.     set group_attrs ""
  6318.     keylget info group_attrs group_attrs
  6319.     keylget group_attrs protocols protocols
  6320.     keylget group_attrs type type
  6321.     set new_protocols ""
  6322.     set lprotocols [VtListGetSelectedItem $LSlprotocols -byItemList]
  6323.     foreach proto $lprotocols {
  6324.         set val [translit "A-Z" "a-z" $proto]
  6325.         set protocol_tag ${val}_${name}
  6326.         while {[PPP:isPresent protocol $protocol_tag]} {
  6327.             set protocol_tag [cycleName $protocol_tag]
  6328.         }
  6329.         if {![PPP:create protocol/${val} $protocol_tag "" [list [list parent_type link/$type]]]} {
  6330.             foreach protocol_tag $protocols {
  6331.                 if {![PPP:isPresent protocol $protocol_tag]} {
  6332.                     continue
  6333.                 }
  6334.                 PPP:get protocol $protocol_tag protocol protocol
  6335.                 PPP:delete protocol/${protocol} $protocol_tag
  6336.             }
  6337.             return [throwError $FDlp [ILM SCO_PPP_ERR_PROTOCOL_CREATE]]
  6338.         }
  6339.         set_add protocols $protocol_tag
  6340.         set_add new_protocols $protocol_tag
  6341.         set algorithms [defn_list algorithm link protocol/$val]
  6342.         if {![lempty $algorithms]} {
  6343.             set txalgorithms ""
  6344.             set rxalgorithms ""
  6345.             foreach algorithm $algorithms {
  6346.                 set alval ""
  6347.                 keylget ppp_type_info($algorithm) val alval
  6348.                 if {[cequal $alval ""]} {
  6349.                     continue
  6350.                 }
  6351.                 set tx_tag tx_${val}_${alval}_${name}
  6352.                 set rx_tag rx_${val}_${alval}_${name}
  6353.                 while {[PPP:isPresent algorithm $rx_tag] || [PPP:isPresent algorithm $tx_tag]} {
  6354.                     set tx_tag [cycleName $tx_tag]
  6355.                     set rx_tag [cycleName $rx_tag]
  6356.                 }
  6357.                 set_add rxalgorithms $rx_tag
  6358.                 set_add txalgorithms $tx_tag
  6359.                 if {![PPP:create algorithm/${alval} $rx_tag]} {
  6360.                     set_del rxalgorithms $rx_tag
  6361.                 }
  6362.                 if {![PPP:create algorithm/${alval} $tx_tag]} {
  6363.                     set_del txalgorithms $tx_tag
  6364.                 }
  6365.             }
  6366.             PPP:replace protocol/${val} $protocol_tag txalgorithms $txalgorithms
  6367.             PPP:replace protocol/${val} $protocol_tag rxalgorithms $rxalgorithms
  6368.         }
  6369.     }
  6370.     set tags [GRP:get $lg_obj tags]
  6371.     foreach link_tag $tags {
  6372.         PPP:replace link $link_tag protocols $protocols
  6373.         PPP:action link $link_tag reset
  6374.     }
  6375.     keylset group_attrs protocols $protocols
  6376.     keylset info group_attrs $group_attrs
  6377.     GRP:replace $lg_obj info $info
  6378.     set state [dl:state $DLlist $lg_ind]
  6379.     if {[cequal $state collapsed]} {
  6380.         set expanded 0
  6381.     } else {
  6382.         set expanded 1
  6383.     }
  6384.     foreach protocol_tag $protocols {
  6385.         if {[set_isMember $new_protocols $protocol_tag]} {
  6386.             set protocol_ind [link_group:DLadd_protocol $lg_ind $lg_ind $protocol_tag $expanded]
  6387.             link_group:DLinfo_protocol $protocol_ind $expanded
  6388.         }
  6389.     }
  6390.     ppp:viewsort $lg_ind
  6391.     dl:fixconn $DLlist $lg_ind
  6392.     ppp:DLselectCB $cbs
  6393.     if {[cequal $op add]} {
  6394.         set parent_cbs [VxGetVar $FDlp cbs]
  6395.         foreach protocol_tag $new_protocols {
  6396.             set val [defn_type protocol $protocol_tag]
  6397.             set defn_info ""
  6398.             set modify_on_add 1
  6399.             keylget ppp_type_info(protocol/$val) defn_info defn_info
  6400.             keylget defn_info modify_on_add modify_on_add
  6401.             if {$modify_on_add} {
  6402.                 set rec ""
  6403.                 keylset rec op modify
  6404.                 keylset rec mb mb120
  6405.                 keylset rec ind $protocol_ind
  6406.                 keylset rec sel sel203
  6407.                 keylset rec view $view
  6408.                 keylset rec parent_cbs $parent_cbs
  6409.                 keylset rec func bundle_protocol:build_modifyCB
  6410.                 ppp:chain_add $rec
  6411.             }
  6412.         }
  6413.     }
  6414.     VxEndFormCB $cbs
  6415.     ppp:chain_next
  6416.     VtUnLock
  6417. }
  6418. proc link_group_link_protocol:LSlprotocols_selectCB {cbs} {
  6419.     keylget cbs dialog FDlp
  6420.     keylget cbs value value
  6421.     keylget cbs mode mode
  6422.     keylget cbs widget LSlprotocols
  6423.     keylget cbs selectedItemList itemList
  6424.     GetVar $LSlprotocols lpSel
  6425.     set i3 [intersect3 $lpSel $itemList]
  6426.     if {[cequal "" [lindex $i3 0]]} {
  6427.         set value [lindex $i3 2]
  6428.         set mode select
  6429.     } else {
  6430.         set value [lindex $i3 0]
  6431.         set mode deselect
  6432.     }
  6433.     VxSetVar $LSlprotocols lpSel $itemList
  6434. }
  6435. proc link_group_link_protocol:build_modifyCB {op mb ind sel view cbs} {
  6436.     Globals
  6437.     widget:build $op $mb $ind $sel $view $cbs
  6438.     ppp:DLselectCB $cbs
  6439.     VtUnLock
  6440. }
  6441. proc link_group_link_protocol:deleteCB {op mb ind sel view cbs args} {
  6442.     Globals
  6443.     set lg_ind [dl:get $DLlist $ind LGIND]
  6444.     set lg_tag [dl:get $DLlist $lg_ind OBJ]
  6445.     set proto [dl:get $DLlist $ind PROTO]
  6446.     set protocol_tag [dl:get $DLlist $ind OBJ]
  6447.     if {[cequal $proto lcp]} {
  6448.         return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_LCP_DELETE]]
  6449.     }
  6450.     set tags [GRP:get $lg_tag tags]
  6451.     set info [GRP:get $lg_tag info]
  6452.     set group_attrs ""
  6453.     keylget info group_attrs group_attrs
  6454.     keylget group_attrs protocols protocols
  6455.     set algorithms ""
  6456.     set txalgorithms ""
  6457.     set rxalgorithms ""
  6458.     PPP:get protocol $protocol_tag algorithms algorithms
  6459.     PPP:get protocol $protocol_tag txalgorithms txalgorithms
  6460.     PPP:get protocol $protocol_tag rxalgorithms rxalgorithms
  6461.     foreach al_tag [concat $algorithms $txalgorithms $rxalgorithms] {
  6462.         if {![PPP:isPresent algorithm $al_tag]} {
  6463.             continue
  6464.         }
  6465.         PPP:get algorithm $al_tag algorithm algorithm
  6466.         if {![PPP:delete algorithm/$algorithm $al_tag]} {
  6467.             return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
  6468.         }
  6469.     }
  6470.     set_del protocols $protocol_tag
  6471.     keylset group_attrs protocols $protocols
  6472.     keylset info group_attrs $group_attrs
  6473.     if {![GRP:replace $lg_tag info $info]} {
  6474.         return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
  6475.     }
  6476.     foreach link_tag $tags {
  6477.         if {![PPP:replace link ${link_tag} protocols $protocols]} {
  6478.             return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
  6479.         }
  6480.     }
  6481.     if {![PPP:delete protocol/${proto} $protocol_tag]} {
  6482.         return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_DELETE]]
  6483.     }
  6484.     dl:delete $DLlist $ind
  6485.     dl:fixconn $DLlist $lg_ind
  6486.     ppp:DLselectCB $cbs
  6487.     VtUnLock
  6488. }
  6489. ##################################################
  6490. proc widget:Globals {} {
  6491.     uplevel 1 global widget_groups widget_FT 
  6492. }
  6493. proc widget:init {owner_type} {
  6494.     Globals
  6495.     widget:Globals
  6496.     if {[info exist widget_groups($owner_type)]} {
  6497.         return
  6498.     }
  6499.     set defn_info ""
  6500.     keylget ppp_type_info($owner_type) defn_info defn_info
  6501.     set title ""
  6502.     keylget defn_info title title
  6503.     set new_title [lindex [PPP:ilm $title] 0]
  6504.     keylset defn_info title $new_title
  6505.     keylset ppp_type_info($owner_type) defn_info $defn_info
  6506.     set option_group_labels ""
  6507.     keylget ppp_type_info($owner_type) option_group_labels option_group_labels
  6508.     set wgroups ""
  6509.     foreach group_name [keylkeys option_group_labels] {
  6510.         keylget option_group_labels $group_name labels
  6511.         set new_labels [lindex [PPP:ilm $labels] 0]
  6512.         keylset option_group_labels $group_name $new_labels
  6513.         keylset wgroups $group_name ""
  6514.     }
  6515.     keylset ppp_type_info($owner_type) option_group_labels $option_group_labels
  6516.     set options ""
  6517.     foreach opt [keylkeys ppp_opt_info($owner_type)] {
  6518.         keylget ppp_opt_info($owner_type) ${opt}.gui_visible gui_visible
  6519.         if {$gui_visible} {
  6520.             foreach attr {label short_help} {
  6521.                 keylget ppp_opt_info($owner_type) ${opt}.$attr label
  6522.                 set new_label [lindex [PPP:ilm $label] 0]
  6523.                 keylset ppp_opt_info($owner_type) ${opt}.$attr $new_label
  6524.             }
  6525.             keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
  6526.             keylget ppp_opt_info($owner_type) ${opt}.option_info option_info
  6527.             switch $widget_type {
  6528.                 TEXT -
  6529.                 SPIN_BUTTON {
  6530.                 }
  6531.                 CALL_GUI {
  6532.                     foreach attr {labels short_helps exit_label exit_short_help exit_mnemonic} {
  6533.                         keylget ppp_opt_info($owner_type) ${opt}.option_info.$attr labels
  6534.                         set new_labels [lindex [PPP:ilm $labels] 0]
  6535.                         keylset ppp_opt_info($owner_type) ${opt}.option_info.$attr $new_labels
  6536.                     }
  6537.                 }
  6538.                 RONLY_COMBO -
  6539.                 FILE_SEL -
  6540.                 RADIO_BOX {
  6541.                     foreach attr {labels short_helps} {
  6542.                         keylget ppp_opt_info($owner_type) ${opt}.option_info.$attr labels
  6543.                         set new_labels [lindex [PPP:ilm $labels] 0]
  6544.                         keylset ppp_opt_info($owner_type) ${opt}.option_info.$attr $new_labels
  6545.                     }
  6546.                 }
  6547.                 default {
  6548.                     keylset ppp_opt_info($owner_type) ${opt}.gui_visible 0
  6549.                 }
  6550.             }
  6551.             keylget ppp_opt_info($owner_type) ${opt}.gui_visible gui_visible
  6552.             if {$gui_visible} {
  6553.                 keylget ppp_opt_info($owner_type) ${opt}.option_group group
  6554.                 set l ""
  6555.                 keylget wgroups $group l
  6556.                 if {![cequal $group ""]} {
  6557.                     lappend l $opt
  6558.                     keylset wgroups $group $l
  6559.                 }
  6560.             }
  6561.         }
  6562.     }
  6563.     foreach group_name [keylkeys wgroups] {
  6564.         keylget wgroups $group_name group
  6565.         set no_order 100
  6566.         if {[lempty $group]} {
  6567.             keyldel wgroups $group_name
  6568.             continue
  6569.         }
  6570.         foreach opt [keylkeys group] {
  6571.             keylget ppp_opt_info($owner_type) ${opt}.option_info info
  6572.             set order $no_order
  6573.             keylget info order order
  6574.             if {$order == $no_order} {
  6575.                 incr no_order
  6576.             }
  6577.             set order_array($order) $opt
  6578.         }
  6579.         set order [lsort -integer -increasing [array names order_array]]
  6580.         set new_group ""
  6581.         foreach order_index $order {
  6582.             lappend new_group $order_array($order_index)
  6583.         }
  6584.         keylset wgroups $group_name $new_group
  6585.         unset order_array
  6586.     }
  6587.     set widget_groups($owner_type) $wgroups
  6588. }
  6589. proc widget:build {op mb ind sel view cbs} {
  6590.     widget:Globals
  6591.     Globals
  6592.     keylget cbs dialog dialog
  6593.     if {[cequal $op modify]} {
  6594.         set owner_tag [dl:get $DLlist $ind OBJ]
  6595.     } else {
  6596.         set owner_tag ""
  6597.     }
  6598.     switch $sel {
  6599.         sel105 -
  6600.         sel106 -
  6601.         sel107 {
  6602.             set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
  6603.             set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
  6604.             set link_tags ""
  6605.             set owner_val [dl:get $DLlist $ind PROTO]
  6606.             set owner_tag [dl:get $DLlist $ind OBJ]
  6607.             set owner_type protocol/${owner_val}
  6608.         }
  6609.         sel202 -
  6610.         sel203 {
  6611.             set bundle_tag ""
  6612.             set lg_ind [dl:get $DLlist $ind LGIND]
  6613.             set lg_tag [dl:get $DLlist $lg_ind OBJ]
  6614.             set link_tags [GRP:get $lg_tag tags]
  6615.             set owner_val [dl:get $DLlist $ind PROTO]
  6616.             set owner_tag [dl:get $DLlist $ind OBJ]
  6617.             set owner_type protocol/${owner_val}
  6618.         }
  6619.     }
  6620.     set infoValueList ""
  6621.     keylset infoValueList bundle $bundle_tag
  6622.     keylset infoValueList links $link_tags
  6623.     StatusPush $FDppp [ILM SCO_PPP_MSG_PROTOCOL_DIALOG_BUILD]
  6624.     widget:init $owner_type
  6625.     catch {unset widget_FT}
  6626.     set defn_info ""
  6627.     keylget ppp_type_info($owner_type) defn_info defn_info
  6628.     set title ""
  6629.     keylget defn_info title title
  6630.     if {[cequal $op add]} {
  6631.         set title "[ILM SCO_PPP_MSG_TITLE_ADD] $title"
  6632.     } else {
  6633.         set title "[ILM SCO_PPP_MSG_TITLE_MOD] $title"
  6634.     }
  6635.     wset $dialog FDwidget [VtFormDialog $dialog.FD$owner_type \
  6636.         -title $title \
  6637.         -ok \
  6638.         -okCallback widget:changeCB \
  6639.         -cancel \
  6640.         -cancelCallback VxEndFormCB \
  6641.         -autoDestroy 1 \
  6642.         -autoLock widget:changeCB \
  6643.         -help \
  6644.         ]
  6645.     set FTDwidget [FormTabDialog $FDwidget.FTD$owner_type]
  6646.     set group_names [keylkeys widget_groups($owner_type)]
  6647.     set widget_forms ""
  6648.     set first_group_name ""
  6649.     foreach group_name $group_names {
  6650.         if {[cequal $first_group_name ""]} {
  6651.             set first_group_name $group_name
  6652.         }
  6653.         set option_group_labels ""
  6654.         keylget ppp_type_info($owner_type) option_group_labels option_group_labels
  6655.         keylget option_group_labels $group_name labels
  6656.         lassign $labels ft sh title
  6657.         set FTwidget($group_name) [SaFormTab $FTDwidget.FT$group_name \
  6658.             -label $ft \
  6659.             -title $title \
  6660.             -shortHelpString $sh \
  6661.             -shortHelpCallback SaShortHelpCB \
  6662.             ]
  6663.         lappend widget_forms $FTwidget($group_name)
  6664.         widget:build_form $owner_type $owner_tag $group_name $FDwidget $FTwidget($group_name)
  6665.     }
  6666.     StatusBar $FDwidget $FTDwidget
  6667.     VtShow $FDwidget
  6668.     StatusPush $FDwidget [ILM SCO_PPP_MSG_WIDGET_SET_VALUES]
  6669.     SaFormTabDialogMaxSize $FTDwidget
  6670.     SaFormTabSetSelected $FTwidget($first_group_name)
  6671.     foreach group_name $group_names {
  6672.         widget:build_values $owner_type $owner_tag $group_name $FDwidget
  6673.     }
  6674.     keylget ppp_type_info($owner_type) options options
  6675.     set real_attrValueList ""
  6676.     foreach opt [keylkeys ppp_opt_info($owner_type)] {
  6677.         set value ""
  6678.         if {[cequal $owner_tag ""]} {
  6679.             keylget options $opt value
  6680.         } else {
  6681.             PPP:get ${owner_type} ${owner_tag} $opt value
  6682.         }
  6683.         keylset real_attrValueList $opt $value
  6684.     }
  6685.     set opt_list [keylkeys ppp_opt_info($owner_type)]
  6686.     set res_list [PPP:validate $owner_type $opt_list $real_attrValueList get $infoValueList]
  6687.     foreach res $res_list {
  6688.         if {![lempty $res]} {
  6689.             lassign $res failed error actions
  6690.             if {$failed} {
  6691.                 return [throwError $FDwidget $error]
  6692.             }
  6693.             if {![lempty $actions]} {
  6694.                 widget:actions $owner_type $actions $FDwidget
  6695.             }
  6696.     } else {
  6697.             return [throwError $FDwidget [ILM SCO_PPP_ERR_PROTOCOL_FAILED]]
  6698.         }
  6699.     }
  6700.     wput $FDwidget op mb ind sel view cbs widget_forms
  6701.     StatusPop $FDwidget
  6702.     StatusPop $FDppp
  6703.     return $FDwidget
  6704. }
  6705. proc widget:build_form {owner_type owner_tag group_name FDwidget FTwidget} {
  6706.     widget:Globals
  6707.     Globals
  6708.     global managedHost
  6709.     keylget widget_groups($owner_type) $group_name widget_group
  6710.     set focus_list ""
  6711.     set tab_list ""
  6712.     set af ""
  6713.     set widget_grps [keylkeys widget_group]
  6714.     foreach opt $widget_grps {
  6715.         set widget_type ""
  6716.         set label ""
  6717.         set short_help ""
  6718.         set option_info ""
  6719.         keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
  6720.         keylget ppp_opt_info($owner_type) ${opt}.label label
  6721.         keylget ppp_opt_info($owner_type) ${opt}.short_help short_help
  6722.         keylget ppp_opt_info($owner_type) ${opt}.option_info option_info
  6723.         switch $widget_type {
  6724.             TEXT {
  6725.                 lappend af [list $label L$opt T$opt \
  6726.                     [list VtText \
  6727.                         -callback widget:validateCB \
  6728.                         -losingFocusCallback widget:validateCB \
  6729.                         -autoLock widget:validateCB \
  6730.                         -columns 25 \
  6731.                         -shortHelpString $short_help \
  6732.                         -shortHelpCallback SaShortHelpCB \
  6733.                         ]]
  6734.             }
  6735.             FILE_SEL {
  6736.                 lappend af [list $label L$opt F$opt \
  6737.                     [list VtForm \
  6738.                         -marginWidth 0 \
  6739.                         -marginHeight 0 \
  6740.                         ]]
  6741.             }
  6742.             CALL_GUI {
  6743.                 lappend af [list $label L$opt F$opt \
  6744.                     [list VtForm \
  6745.                         -marginWidth 0 \
  6746.                         -marginHeight 0 \
  6747.                         ]]
  6748.             }
  6749.             RONLY_COMBO {
  6750.                 lappend af [list $label L$opt CB$opt \
  6751.                     [list VtComboBox \
  6752.                         -callback widget:validateCB \
  6753.                         -valueChangedCallback widget:validateCB \
  6754.                         -autoLock widget:validateCB \
  6755.                         -readOnly \
  6756.                         -columns 25 \
  6757.                         -shortHelpString $short_help \
  6758.                         -shortHelpCallback SaShortHelpCB \
  6759.                         ]]
  6760.             }
  6761.             SPIN_BUTTON {
  6762.                 set min 0
  6763.                 set max 2147483647
  6764.                 keylget option_info min min
  6765.                 keylget option_info max max
  6766.                 lappend af [list $label L$opt SB$opt \
  6767.                     [list VxSpinButton \
  6768.                         10 $min "" $max "" 1 $min "" "" \
  6769.                         ]]
  6770.             }
  6771.             RADIO_BOX {
  6772.                 set numColumns 1
  6773.                 keylget option_info numColumns numColumns
  6774.                 lappend af [list $label L$opt RB$opt \
  6775.                     [list VtRadioBox \
  6776.                         -callback widget:validateCB \
  6777.                         -autoLock widget:validateCB \
  6778.                         -horizontal \
  6779.                         ]]
  6780.             }
  6781.         }
  6782.     }
  6783.     set AFwidget($group_name) [AlignedForm $FTwidget.AF$group_name 0 $af]
  6784.     foreach opt $widget_grps {
  6785.         set widget_type ""
  6786.         set label ""
  6787.         set short_help ""
  6788.         set option_info ""
  6789.         keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
  6790.         keylget ppp_opt_info($owner_type) ${opt}.label label
  6791.         keylget ppp_opt_info($owner_type) ${opt}.short_help short_help
  6792.         keylget ppp_opt_info($owner_type) ${opt}.option_info option_info
  6793.         eval VxSetVar $FDwidget L$opt \$L$opt
  6794.         switch $widget_type {
  6795.             TEXT {
  6796.                 eval VxSetVar $FDwidget T$opt \$T$opt
  6797.                 eval lappend focus_list \$T$opt
  6798.                 eval lappend tab_list \$T$opt
  6799.             }
  6800.             FILE_SEL {
  6801.                 set filter "/*"
  6802.                 keylget option_info filter filter
  6803.                 eval VxSetVar $FDwidget F$opt \$F$opt
  6804.                 keylget option_info labels labels
  6805.                 keylget option_info short_helps short_helps
  6806.                 eval set form \$F$opt
  6807.                 set T [VtText $form.T$opt \
  6808.                     -callback widget:validateCB \
  6809.                     -losingFocusCallback widget:validateCB \
  6810.                     -autoLock widget:validateCB \
  6811.                     -columns 25 \
  6812.                     -shortHelpString $short_help \
  6813.                     -shortHelpCallback SaShortHelpCB \
  6814.                     ]
  6815.                 set PB [VtPushButton $form.PB$opt \
  6816.                     -label $labels \
  6817.                     -callback "widget:PBfile_selCB $T" \
  6818.                     -autoLock widget:PBfile_selCB \
  6819.                     -leftSide $T \
  6820.                     -topSide FORM \
  6821.                     -shortHelpString $short_helps \
  6822.                     -shortHelpCallback SaShortHelpCB \
  6823.                     ]
  6824.                 SetVar $T filter
  6825.                 eval VxSetVar $FDwidget T$opt \$T
  6826.                 eval VxSetVar $FDwidget PB$opt \$PB
  6827.                 eval lappend focus_list \$T \$PB
  6828.                 eval lappend tab_list \$T \$PB
  6829.             }
  6830.             CALL_GUI {
  6831.                 eval VxSetVar $FDwidget F$opt \$F$opt
  6832.                 keylget option_info labels labels
  6833.                 keylget option_info short_helps short_helps
  6834.                 keylget option_info gui_path gui_path
  6835.                 keylget option_info gui_args gui_args
  6836.                 keylget option_info exit_label exit_label
  6837.                 keylget option_info exit_short_help exit_short_help
  6838.                 keylget option_info exit_mnemonic exit_mnemonic
  6839.                 eval set form \$F$opt
  6840.                 set T [VtText $form.T$opt \
  6841.                     -callback widget:validateCB \
  6842.                     -losingFocusCallback widget:validateCB \
  6843.                     -autoLock widget:PBcall_guiCB \
  6844.                     -columns 25 \
  6845.                     -shortHelpString $short_help \
  6846.                     -shortHelpCallback SaShortHelpCB \
  6847.                     ]
  6848.                 set PB [VtPushButton $form.PB$opt \
  6849.                     -label $labels \
  6850.                     -callback "widget:PBcall_guiCB $T \"$gui_path\" \"$gui_args\" \"$exit_label\" \"$exit_short_help\" \"$exit_mnemonic\"" \
  6851.                     -autoLock widget:PBcall_guiCB \
  6852.                     -leftSide $T \
  6853.                     -topSide FORM \
  6854.                     -shortHelpString $short_helps \
  6855.                     -shortHelpCallback SaShortHelpCB \
  6856.                     ]
  6857.                 if {![file executable $gui_path] && ![SaFile -host $managedHost executable $gui_path]} {
  6858.                     SetSens $PB 0
  6859.                 }
  6860.                 eval VxSetVar $FDwidget T$opt \$T
  6861.                 eval VxSetVar $FDwidget PB$opt \$PB
  6862.                 eval lappend focus_list \$T \$PB
  6863.                 eval lappend tab_list \$T \$PB
  6864.             }
  6865.             RONLY_COMBO {
  6866.                 eval VxSetVar $FDwidget CB$opt \$CB$opt
  6867.                 keylget option_info labels labels
  6868.                 eval VtSetValues \$CB$opt \
  6869.                     -itemList \$labels
  6870.                 eval lappend focus_list \$CB$opt
  6871.                 eval lappend tab_list \$CB$opt
  6872.             }
  6873.             SPIN_BUTTON {
  6874.                 eval VxSetVar $FDwidget SB$opt \$SB$opt
  6875.                 eval VtSetValues \$SB$opt \
  6876.                     -rightSide NONE \
  6877.                     -shortHelpString \"$short_help\" \
  6878.                     -shortHelpCallback SaShortHelpCB
  6879.                 set text [eval VxGetVar \$SB$opt text]
  6880.                 VtSetValues $text \
  6881.                     -callback widget:validateCB \
  6882.                     -losingFocusCallback widget:validateCB \
  6883.                     -autoLock widget:validateCB
  6884.                 VxSetVar $text opt $opt
  6885.                 lappend focus_list $text
  6886.                 lappend tab_list $text
  6887.             }
  6888.             RADIO_BOX {
  6889.                 eval VxSetVar $FDwidget RB$opt \$RB$opt
  6890.                 keylget option_info labels labels
  6891.                 keylget option_info values values
  6892.                 keylget option_info short_helps short_helps
  6893.                 foreach value $values {
  6894.                     set label [lvarpop labels]
  6895.                     set short_help [lvarpop short_helps]
  6896.                     set TB${opt}_$value [eval VtToggleButton \$RB$opt.TB${opt}_$value \
  6897.                         -label \"$label\" \
  6898.                         -shortHelpString \"$short_help\" \
  6899.                         -shortHelpCallback SaShortHelpCB \
  6900.                         -userData \"$value\" \
  6901.                         -value 0 \
  6902.                         ]
  6903.                     eval VxSetVar $FDwidget TB${opt}_$value \$TB${opt}_$value
  6904.                 }
  6905.                 eval lappend focus_list \$RB$opt
  6906.                 eval lappend tab_list \$RB$opt
  6907.             }
  6908.         }
  6909.     }
  6910.     SaFormTabSetFocusList $FTwidget $focus_list
  6911.     SaFormTabSetTabGroup $FTwidget $tab_list
  6912. }
  6913. proc widget:actions {owner_type actions FDwidget} {
  6914.     widget:Globals
  6915.     Globals
  6916.     foreach rec $actions {
  6917.         set action [lvarpop rec]
  6918.         switch $action {
  6919.             sense {
  6920.                 lassign $rec opt sub value
  6921.                 widget:set_sens $owner_type $opt $sub $value $FDwidget
  6922.             }
  6923.             replace {
  6924.                 lassign $rec opt value
  6925.                 widget:set_value $owner_type $opt $value $FDwidget
  6926.             }
  6927.         }
  6928.     }
  6929. }
  6930. proc widget:set_sens {owner_type opt sub value FDwidget} {
  6931.     widget:Globals
  6932.     Globals
  6933.     set widget_type ""
  6934.     set option_info ""
  6935.     keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
  6936.     if {[cequal $sub ""]} {
  6937.         set label [VxGetVar $FDwidget L$opt]
  6938.         VtSetSensitive $label $value
  6939.     }
  6940.     switch $widget_type {
  6941.         TEXT {
  6942.             set widget [VxGetVar $FDwidget T$opt]
  6943.         }
  6944.         FILE_SEL {
  6945.             set widget [VxGetVar $FDwidget F$opt]
  6946.         }
  6947.         CALL_GUI {
  6948.             switch $sub {
  6949.                 "" {
  6950.                     set widget [VxGetVar $FDwidget F$opt]
  6951.                 }
  6952.                 text {
  6953.                     set widget [VxGetVar $FDwidget T$opt]
  6954.                 }
  6955.                 select {
  6956.                     set widget [VxGetVar $FDwidget PB$opt]
  6957.                 }
  6958.             }
  6959.         }
  6960.         RONLY_COMBO {
  6961.             set widget [VxGetVar $FDwidget CB$opt]
  6962.         }
  6963.         SPIN_BUTTON {
  6964.             set widget [VxGetVar $FDwidget SB$opt]
  6965.         }
  6966.         RADIO_BOX {
  6967.             switch $sub {
  6968.                 "" {
  6969.                     set widget [VxGetVar $FDwidget RB$opt]
  6970.                 }
  6971.                 default {
  6972.                     set widget [VxGetVar $FDwidget TB${opt}_$sub]
  6973.                 }
  6974.             }
  6975.         }
  6976.     }
  6977.     VtSetSensitive $widget $value 
  6978. }
  6979. proc widget:set_value {owner_type opt value FDwidget} {
  6980.     widget:Globals
  6981.     Globals
  6982.     set widget_type ""
  6983.     set option_info ""
  6984.     keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
  6985.     keylget ppp_opt_info($owner_type) ${opt}.option_info option_info
  6986.     switch $widget_type {
  6987.         TEXT {
  6988.             set widget [VxGetVar $FDwidget T$opt]
  6989.             VtSetValues $widget -value $value
  6990.         }
  6991.         FILE_SEL {
  6992.             set widget [VxGetVar $FDwidget T$opt]
  6993.             VtSetValues $widget -value $value
  6994.         }
  6995.         CALL_GUI {
  6996.             set widget [VxGetVar $FDwidget T$opt]
  6997.             VtSetValues $widget -value $value
  6998.         }
  6999.         RONLY_COMBO {
  7000.             keylget option_info labels labels
  7001.             keylget option_info values values
  7002.             set widget [VxGetVar $FDwidget CB$opt]
  7003.             VtSetValues $widget -value [lindex $labels [lsearch $values $value]]
  7004.         }
  7005.         SPIN_BUTTON {
  7006.             set widget [VxGetVar $FDwidget SB$opt]
  7007.             set text [VxGetVar $widget text]
  7008.             VtSetValues $text -value $value
  7009.             VxSetVar $text opt $opt
  7010.         }
  7011.         RADIO_BOX {
  7012.             set widget [VxGetVar $FDwidget RB$opt]
  7013.             set tb [VxGetVar $FDwidget TB${opt}_$value]
  7014.             VtSetValues $widget -value $tb
  7015.         }
  7016.     }
  7017.     VxSetVar $widget opt $opt
  7018. }
  7019. proc widget:build_values {owner_type owner_tag group_name FDwidget} {
  7020.     widget:Globals
  7021.     Globals
  7022.     keylget widget_groups($owner_type) $group_name widget_group
  7023.     keylget ppp_type_info($owner_type) options options
  7024.     foreach opt [keylkeys widget_group] {
  7025.         set value ""
  7026.         if {[cequal $owner_tag ""]} {
  7027.             keylget options $opt value
  7028.         } else {
  7029.             PPP:get ${owner_type} ${owner_tag} $opt value
  7030.         }
  7031.         widget:set_value $owner_type $opt $value $FDwidget
  7032.     }
  7033. }
  7034. proc widget:PBfile_selCB {Twidget cbs} {
  7035.     global managedHost
  7036.     keylget cbs dialog FDwidget
  7037.     set value [VtGetValues $Twidget -value]
  7038.     set filter "/*"
  7039.     GetVar $Twidget filter
  7040.     set FSfile_sel [SaFileSelectionDialog $FDwidget.FSfile_sel \
  7041.         -host $managedHost \
  7042.         -filter $filter \
  7043.         -title [ILM SCO_PPP_MSG_FILE_SEL] \
  7044.         -okCallback "widget:FSfile_selCB $Twidget" \
  7045.         -autoLock widget:FSfile_selCB \
  7046.         -cancelCallback VxEndFormCB \
  7047.         -autoDestroy 0 \
  7048.         -help \
  7049.         -selection $value \
  7050.         ]
  7051.     VtShow $FSfile_sel
  7052.     VtUnLock
  7053. }
  7054. proc widget:FSfile_selCB {Twidget cbs} {
  7055.     keylget cbs selection value
  7056.     VtSetValues $Twidget -value  $value
  7057.     VxEndFormCB $cbs
  7058.     VtUnLock
  7059. }
  7060. proc widget:PBcall_guiCB {Twidget gui_path gui_args label short_help mnemonic cbs} {
  7061.     global managedHost
  7062.     keylget cbs dialog FDwidget
  7063.     set value [VtGetValues $Twidget -value]
  7064.     if {![file executable $gui_path] && ![SaFile -host $managedHost executable $gui_path]} {
  7065.         return [throwError $FDwidget [ILM SCO_PPP_ERR_GUI_NOT_FOUND]]
  7066.     }
  7067.     if {[catch {eval exec $gui_path $gui_args -t \"$value\" -o -l \"$label\" -h \"$short_help\" -m \"$mnemonic\" $managedHost} res]} {
  7068.         return [throwError $FDwidget [ILM SCO_PPP_ERR_GUI_FAILED]]
  7069.     }
  7070.     if {![cequal $res ""]} {
  7071.         set i [string first "\n" $res]
  7072.         if {$i != -1} {
  7073.             incr i
  7074.             set res [csubstr $res $i end]
  7075.             VtSetValues $Twidget -value [string trim $res]
  7076.             keylset cbs widget $Twidget
  7077.             widget:validateCB $cbs
  7078.             return
  7079.         }
  7080.     }
  7081.     VtUnLock
  7082. }
  7083. proc widget:get_value {owner_type opt FDwidget} {
  7084.     widget:Globals
  7085.     Globals
  7086.     set value ""
  7087.     set widget_type ""
  7088.     keylget ppp_opt_info($owner_type) ${opt}.widget_type widget_type
  7089.     keylget ppp_opt_info($owner_type) ${opt}.option_info option_info
  7090.     switch $widget_type {
  7091.         TEXT {
  7092.             set widget [VxGetVar $FDwidget T$opt]
  7093.             set value [VtGetValues $widget -value]
  7094.         }
  7095.         FILE_SEL {
  7096.             set widget [VxGetVar $FDwidget T$opt]
  7097.             set value [VtGetValues $widget -value]
  7098.         }
  7099.         CALL_GUI {
  7100.             set widget [VxGetVar $FDwidget T$opt]
  7101.             set value [VtGetValues $widget -value]
  7102.         }
  7103.         RONLY_COMBO {
  7104.             keylget option_info labels labels
  7105.             keylget option_info values values
  7106.             set widget [VxGetVar $FDwidget CB$opt]
  7107.             set value [lindex $values [lsearch $labels [VtGetValues $widget -value]]]
  7108.         }
  7109.         SPIN_BUTTON {
  7110.             set widget [VxGetVar $FDwidget SB$opt]
  7111.             set T [VxGetVar $widget text]
  7112.             set value [VtGetValues $T -value]
  7113.         }
  7114.         RADIO_BOX {
  7115.             set widget [VxGetVar $FDwidget RB$opt]
  7116.             set tb [VtGetValues $widget -value]
  7117.             set value [VtGetValues $tb -userData]
  7118.         }
  7119.     }
  7120.     return $value
  7121. }
  7122. proc widget:validateCB {cbs} {
  7123.     keylget cbs mode mode
  7124.     switch $mode {
  7125.         selectSame {
  7126.             VtUnLock
  7127.             return
  7128.         }
  7129.     }
  7130.     VtLock
  7131.     widget:Globals
  7132.     Globals
  7133.     keylget cbs dialog FDwidget
  7134.     keylget cbs widget widget
  7135.     StatusPush $FDwidget [ILM SCO_PPP_MSG_WIDGET_VALIDATE]
  7136.     set validate_opt [VxGetVar $widget opt]
  7137.     wget $FDwidget op mb ind sel view widget_forms
  7138.     if {[cequal $op modify]} {
  7139.         set owner_tag [dl:get $DLlist $ind OBJ]
  7140.     } else {
  7141.         set owner_tag ""
  7142.     }
  7143.     switch $sel {
  7144.         sel106 -
  7145.         sel107 {
  7146.             set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
  7147.             set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
  7148.             set link_tags ""
  7149.             set owner_val [dl:get $DLlist $ind PROTO]
  7150.             set owner_tag [dl:get $DLlist $ind OBJ]
  7151.             set owner_type protocol/${owner_val}
  7152.         }
  7153.         sel203 {
  7154.             set bundle_tag ""
  7155.             set lg_ind [dl:get $DLlist $ind LGIND]
  7156.             set lg_tag [dl:get $DLlist $lg_ind OBJ]
  7157.             set link_tags [GRP:get $lg_tag tags]
  7158.             set owner_val [dl:get $DLlist $ind PROTO]
  7159.             set owner_tag [dl:get $DLlist $ind OBJ]
  7160.             set owner_type protocol/${owner_val}
  7161.         }
  7162.     }
  7163.     set infoValueList ""
  7164.     keylset infoValueList bundle $bundle_tag
  7165.     keylset infoValueList links $link_tags
  7166.     set attrValueList ""
  7167.     set real_attrValueList ""
  7168.     set group_names [keylkeys widget_groups($owner_type)]
  7169.     foreach group_name $group_names {
  7170.         keylget widget_groups($owner_type) $group_name widget_group
  7171.         keylget ppp_type_info($owner_type) options options
  7172.         foreach opt [keylkeys widget_group] {
  7173.             set old_value ""
  7174.             if {[cequal $owner_tag ""]} {
  7175.                 keylget options $opt old_value
  7176.             } else {
  7177.                 PPP:get ${owner_type} ${owner_tag} $opt old_value
  7178.             }
  7179.             set value [widget:get_value $owner_type $opt $FDwidget]
  7180.             if {[cequal $opt $validate_opt]} {
  7181.                 set validate_old_value $old_value
  7182.                 set validate_value $value
  7183.             }
  7184.             lappend real_attrValueList [list $opt $value]
  7185.             if {![cequal $value $old_value]} {
  7186.                 lappend attrValueList [list $opt $value]
  7187.             }
  7188.         }
  7189.     }
  7190.     set res_list [PPP:validate $owner_type $validate_opt $real_attrValueList replace $infoValueList]
  7191.     foreach res $res_list {
  7192.         if {![lempty $res]} {
  7193.             lassign $res failed error actions
  7194.             if {$failed} {
  7195.                 widget:set_value $owner_type $validate_opt $validate_old_value $FDwidget
  7196.                 StatusPop $FDwidget
  7197.                 return [throwError $FDwidget $error]
  7198.             }
  7199.             if {![lempty $actions]} {    
  7200.                 widget:actions $owner_type $actions $FDwidget
  7201.             }
  7202.         } else {
  7203.             StatusPop $FDwidget
  7204.             return [throwError $FDwidget [ILM SCO_PPP_ERR_PROTOCOL_FAILED]]
  7205.         }
  7206.     }
  7207.     StatusPop $FDwidget
  7208.     VtUnLock
  7209. }
  7210. proc widget:changeCB {cbs} {
  7211.     widget:Globals
  7212.     Globals
  7213.     keylget cbs dialog FDwidget
  7214.     wget $FDwidget op mb ind sel view widget_forms
  7215.     if {[cequal $op modify]} {
  7216.         set owner_tag [dl:get $DLlist $ind OBJ]
  7217.     } else {
  7218.         set owner_tag ""
  7219.     }
  7220.     switch $sel {
  7221.         sel106 -
  7222.         sel107 {
  7223.             set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
  7224.             set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
  7225.             set link_tags ""
  7226.             set owner_val [dl:get $DLlist $ind PROTO]
  7227.             set owner_tag [dl:get $DLlist $ind OBJ]
  7228.             set owner_type protocol/${owner_val}
  7229.         }
  7230.         sel203 {
  7231.             set bundle_tag ""
  7232.             set lg_ind [dl:get $DLlist $ind LGIND]
  7233.             set lg_tag [dl:get $DLlist $lg_ind OBJ]
  7234.             set link_tags [GRP:get $lg_tag tags]
  7235.             set owner_val [dl:get $DLlist $ind PROTO]
  7236.             set owner_tag [dl:get $DLlist $ind OBJ]
  7237.             set owner_type protocol/${owner_val}
  7238.         }
  7239.     }
  7240.     set infoValueList ""
  7241.     keylset infoValueList bundle $bundle_tag
  7242.     keylset infoValueList links $link_tags
  7243.     set attrValueList ""
  7244.     set real_attrValueList ""
  7245.     foreach group_name [keylkeys widget_groups($owner_type)] {
  7246.         keylget widget_groups($owner_type) $group_name widget_group
  7247.         keylget ppp_type_info($owner_type) options options
  7248.         foreach opt [keylkeys widget_group] {
  7249.             set old_value ""
  7250.             if {[cequal $owner_tag ""]} {
  7251.                 keylget options $opt old_value
  7252.             } else {
  7253.                 PPP:get ${owner_type} ${owner_tag} $opt old_value
  7254.             }
  7255.             set value [widget:get_value $owner_type $opt $FDwidget]
  7256.             lappend real_attrValueList [list $opt $value]
  7257.             if {![cequal $value $old_value]} {
  7258.                 lappend attrValueList [list $opt $value]
  7259.             }
  7260.         }
  7261.     }
  7262.     set close_actions ""
  7263.     set opt_list [keylkeys real_attrValueList]
  7264.     set res_list [PPP:validate $owner_type $opt_list $real_attrValueList close $infoValueList]
  7265.     foreach res $res_list {
  7266.         if {![lempty $res]} {
  7267.             lassign $res failed error actions
  7268.             if {![lempty $actions]} {
  7269.                 set close_actions [concat $close_actions $actions]
  7270.             }
  7271.             if {$failed} {
  7272.                 return [throwError $FDwidget $error]
  7273.             }
  7274.         } else {
  7275.             return [throwError $FDwidget [ILM SCO_PPP_ERR_PROTOCOL_FAILED]]
  7276.         }
  7277.     }
  7278.     foreach rec $close_actions {
  7279.         set action [lvarpop rec]
  7280.         switch $action {
  7281.             sense {
  7282.             }
  7283.             replace {
  7284.                 lassign $rec opt value
  7285.                 keylset attrValueList $opt $value
  7286.             }
  7287.         }
  7288.     }
  7289.     if {![PPP:replace $owner_type $owner_tag $attrValueList]} {
  7290.         return [throwError $FDppp [ILM SCO_PPP_ERR_PROTOCOL_REPLACE]]
  7291.     }
  7292.     switch $sel {
  7293.         sel105 -
  7294.         sel106 -
  7295.         sel107 {
  7296.             set bundle_ind [dl:get $DLlist $ind BUNDLEIND]
  7297.             set bundle_tag [dl:get $DLlist $bundle_ind OBJ]
  7298.             PPP:action bundle $bundle_tag reset
  7299.         }
  7300.         sel203 {
  7301.             set lg_ind [dl:get $DLlist $ind LGIND]
  7302.             set lg_tag [dl:get $DLlist $lg_ind OBJ]
  7303.             set tags [GRP:get $lg_tag tags]
  7304.             foreach link_tag $tags {
  7305.                 PPP:action link $link_tag reset
  7306.             }
  7307.         }
  7308.     }
  7309.     VxEndFormCB $cbs
  7310.     ppp:chain_next
  7311.     VtUnLock
  7312. }
  7313. ##################################################
  7314. ##################################################
  7315. proc pppGUIMain {} {
  7316.     global managedHost argv iconpath versionNumber optind \
  7317.         PPP_SHELL PPP_HOME PPP_USER PPP_COMMENT PPP_GROUP PPP_MODE free_gap
  7318.     set PPP_USER ppp
  7319.     set PPP_SHELL /usr/bin/pppsh
  7320.     set PPP_HOME /home/ppp
  7321.     set PPP_COMMENT "PPP account"
  7322.     set PPP_GROUP 1
  7323.     set PPP_MODE 0755
  7324.     set free_gap "     "
  7325.     set ppptalk_log_flag 0
  7326.     set debug_log_flag 0
  7327.     set show_psm_flag 0
  7328.     set version_flag 0
  7329.     set optString "dlPRUV"
  7330.     set argc [llength $argv]
  7331.     while { [set opt [getopt $argc $argv $optString]] != -1 } {
  7332.         switch $opt {
  7333.             d {
  7334.                 set debug_log_flag 1
  7335.             }
  7336.             l {
  7337.                 set ppptalk_log_flag 1
  7338.             }
  7339.             P {
  7340.                 set show_psm_flag 1
  7341.             }
  7342.             R {
  7343.                 exec /usr/bin/scoadmin -p Networking -f -c /usr/lib/scoadmin/ppp/ppp.obj
  7344.                 return
  7345.             }
  7346.             U {
  7347.                 exec /usr/bin/scoadmin -p Networking -d ppp.obj
  7348.                 return
  7349.             }
  7350.             V {
  7351.                 set version_flag 1
  7352.             }
  7353.         }
  7354.     }
  7355.     set argv [join [lrange $argv $optind end] ]
  7356.     set managedHost [GetManagedHost]
  7357.     set versionNumber [SaGetSSOVersion]
  7358.     set iconpath /usr/lib/scoadmin/neticons
  7359.     if {$debug_log_flag} {
  7360.         debug_on pppGUI
  7361.     }
  7362.     if {$ppptalk_log_flag} {
  7363.         PPP:ppptalk_log 1
  7364.     }
  7365.     if {$show_psm_flag || $version_flag} {
  7366.         set objcall [list ObjectAction {sco ppp} [SetInstance NULL] registered_psm_osa {}]
  7367.         set bmipResponse [SMOC $objcall]
  7368.         set firstBmip [lindex $bmipResponse 0]
  7369.         set errStack [BmipResponseErrorStack firstBmip]
  7370.         if {[lempty $errStack]} {
  7371.             set registered_psm_osa [BmipResponseActionInfo firstBmip]
  7372.         } else {
  7373.             set registered_psm_osa ""
  7374.         }
  7375.     }
  7376.     if {$version_flag} {
  7377.         set objcall [list ObjectAction {sco ppp} [SetInstance NULL] version {}]
  7378.         set bmipResponse [SMOC $objcall]
  7379.         set firstBmip [lindex $bmipResponse 0]
  7380.         set errStack [BmipResponseErrorStack firstBmip]
  7381.         if {[lempty $errStack]} {
  7382.             echo pppOsa [BmipResponseActionInfo firstBmip]
  7383.         }
  7384.         if {$show_psm_flag} {
  7385.             foreach psm [keylget registered_psm_osa reg] {
  7386.                 set objcall [list ObjectAction [list sco $psm] [SetInstance NULL] version {}]
  7387.                 set bmipResponse [SMOC $objcall]
  7388.                 set firstBmip [lindex $bmipResponse 0]
  7389.                 set errStack [BmipResponseErrorStack firstBmip]
  7390.                 if {[lempty $errStack]} {
  7391.                     echo $psm [BmipResponseActionInfo firstBmip]
  7392.                 }
  7393.             }
  7394.         }
  7395.         return
  7396.     }
  7397.     if {$show_psm_flag} {
  7398.         foreach field {add mod del reg} {
  7399.             echo "$field [keylget registered_psm_osa $field]"
  7400.         }
  7401.         return
  7402.     }
  7403.     if {$debug_log_flag && ![cequal $managedHost [SaHostGetLocalName]]} {
  7404.         set objcall [list ObjectAction {sco ppp} [SetInstance NULL] debug 1]
  7405.         set bmipResponse [SMOC $objcall]
  7406.     }
  7407.     pppGUI
  7408.     VtMainLoop
  7409. }
  7410. ##################################################
  7411. loadlibindex /usr/lib/sysadm.tlib
  7412. loadlibindex /usr/lib/netadm.tlib
  7413. loadlibindex /usr/lib/ppp/pppadm.tlib
  7414. ErrorTopLevelCatch pppGUIMain [ILM SCO_PPP_MSG_SHORT_TITLE]
  7415.