home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / vms / 20113 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  25.8 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!engr.uark.edu!mbox.ualr.edu!backup.ualr.edu!domiller
  2. Newsgroups: comp.os.vms
  3. Subject: Re: TT_AccPorNam field remains null on a SHOW USERS output ?
  4. Message-ID: <1992Dec30.154552.1@ualr.edu>
  5. From: domiller@ualr.edu
  6. Date: 30 Dec 92 15:45:52 GMT
  7. References: <1992Dec27.233720.1@woods.ulowell.edu> <1hnak7INNnna@gap.caltech.edu>
  8. Organization: University of Arkansas at Little Rock
  9. Nntp-Posting-Host: backup.ualr.edu
  10. Lines: 840
  11.  
  12. In article <1hnak7INNnna@gap.caltech.edu>, carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick) writes:
  13. > In article <1992Dec27.233720.1@woods.ulowell.edu>, sabotkap@woods.ulowell.edu writes:
  14. > =From a terminal hardwired to the system (ours is VMS 5.4), the server/port
  15. > =field is left blank (see below).  An attempt at using
  16. > =f$getdvi("TT","TT_AccPorNam") also returns an empty string.
  17. > =
  18. > That's because the system has already identified, as fully as possible, the
  19. > location from which the login is taking place.  Think:  There's no way for VMS
  20. > to be able to tell you where the terminal cable goes once it leaves the VAX. 
  21. > What information would you expect in the TT_ACCPORNAM field in this case?
  22.  
  23. Okay, it may be silly, but I also like to see where a terminal is (even if it
  24. is hardwired).  The following program will let you set the ACCPORNAM field of 
  25. a hardwired terminal to whatever makes sense to you.  I run it from SYSTARTUP
  26. to alter OPA0 and the TX lines we now have (it was of more use when we had
  27. 4 780s, each of which had 80 TX ports).
  28.     Dale
  29. ----------------------------------------------------------------------------
  30. | Dale O. Miller                          | #   #  ###  #     ####         |
  31. | University of Arkansas at Little Rock   | #   # #   # #     #   #        |
  32. | 2801 S. University                      | #   # ##### #     ####         |
  33. | Little Rock, AR  72204-1099  USA        | #   # #   # #     #  #         |
  34. | (501)569-8714                           |  ###  #   # ##### #   #        |
  35. | DOMILLER@UALR.EDU, DOMILLER@UALR.BITNET | Disclaimer: This does not      |
  36. | 92-20-28 W,34-43-30 N.ICBMNET           | say what I say it doesn't say. |
  37. ----------------------------------------------------------------------------
  38. $! ------------------ CUT HERE -----------------------
  39. $ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
  40. $!
  41. $! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
  42. $!   On 30-DEC-1992 15:37:43.74   By user DOMILLER 
  43. $!
  44. $! This VMS_SHARE Written by:
  45. $!    Andy Harper, Kings College London UK
  46. $!
  47. $! Acknowledgements to:
  48. $!    James Gray       - Original VMS_SHARE
  49. $!    Michael Bednarek - Original Concept and implementation
  50. $!
  51. $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
  52. $! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
  53. $!
  54. $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
  55. $!       1. ACCPORNAM.MAR;1
  56. $!       2. ACCPORNAM_MSG.MSG;1
  57. $!       3. EXAMPLE.COM;2
  58. $!       4. MAKE_ACCPORNAM.COM;1
  59. $!
  60. $set="set"
  61. $set symbol/scope=(nolocal,noglobal)
  62. $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
  63. $e="write sys$error  ""%UNPACK"", "
  64. $w="write sys$output ""%UNPACK"", "
  65. $ if f$trnlnm("SHARE_LOG") then $ w = "!"
  66. $ ve=f$getsyi("version")
  67. $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
  68. $ e "-E-OLDVER, Must run at least VMS 4.4"
  69. $ v=f$verify(v)
  70. $ exit 44
  71. $UNPACK: SUBROUTINE ! P1=filename, P2=checksum
  72. $ if f$search(P1) .eqs. "" then $ goto file_absent
  73. $ e "-W-EXISTS, File ''P1' exists. Skipped."
  74. $ delete 'f'*
  75. $ exit
  76. $file_absent:
  77. $ if f$parse(P1) .nes. "" then $ goto dirok
  78. $ dn=f$parse(P1,,,"DIRECTORY")
  79. $ w "-I-CREDIR, Creating directory ''dn'."
  80. $ create/dir 'dn'
  81. $ if $status then $ goto dirok
  82. $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
  83. $ delete 'f'*
  84. $ exit
  85. $dirok:
  86. $ w "-I-PROCESS, Processing file ''P1'."
  87. $ if .not. f$verify() then $ define/user sys$output nl:
  88. $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
  89. PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
  90. SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
  91. CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
  92. LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
  93. BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
  94. IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
  95. MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
  96. ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
  97. 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
  98. POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
  99. ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
  100. COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
  101. "output_file"));ENDPROCEDURE;Unpacker;QUIT;
  102. $ delete/nolog 'f'*
  103. $ CHECKSUM 'P1'
  104. $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
  105. $ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
  106. $ ENDSUBROUTINE
  107. $START:
  108. $ create 'f'
  109. X`09.Title`09ACCPORNAM`09- Set the Access Port Name for terminals
  110. X`09.Ident`09/V01.000/
  111. X`09.Enable`09SUP
  112. X`09.Default Displacement,Word
  113. X`09.Subtitle`09Introduction
  114. X
  115. X;+
  116. X;
  117. X; ----- ACCPORNAM:  Set the Access Port Name for terminals
  118. X;
  119. X;
  120. X; Facility:
  121. X;
  122. X;`09VAX/VMS system management
  123. X;
  124. X; Abstract:
  125. X;
  126. X;`09This module allows a suitably privileged user to set the Access
  127. X;`09Port Name (ACCPORNAM) for hard-wired terminals.
  128. X;
  129. X; Environment:
  130. X;
  131. X;`09VAX/VMS native mode, VMS V5.0 or later, CMKRNL privilege.
  132. X;
  133. X;
  134. X;
  135. X; Version:`09V01.000
  136. X; Date:`09`0924-Feb-1989
  137. X;
  138. X; Copyright `A9 1989  San Diego Supercomputer Center
  139. X;
  140. X; Gerard K. Newman`0924-Feb-1989
  141. X; San Diego Supercomputer Center
  142. X; General Atomics
  143. X; P.O. Box 85608
  144. X; San Diego, CA  92138-5608
  145. X; 619.534.5076
  146. X;
  147. X; Internet:`09GKN@SDS.SDSC.EDU
  148. X; BITNET:`09GKN@SDSC.BITNET
  149. X; SPAN:`09`09SDSC::GKN (27.1)
  150. X; MFENET:`09GKN@SDS.MFENET
  151. X; SDSCNET:`09GKN@SDS.SDSCNET
  152. X;
  153. X;
  154. X; Modifications:
  155. X;
  156. X;
  157. X;-
  158. X
  159. X`09.Page
  160. X`09.Subtitle`09Local definitions
  161. X
  162. X`09.Link`09 "SYS$SYSTEM:SYS.STB"/Selective_Search`09;Grab the system symbol
  163. V table
  164. X`09.Library "SYS$LIBRARY:LIB.MLB"`09`09`09;Get special macros from here
  165. X
  166. X`09.NoCross`09`09`09;Save a tree
  167. X
  168. X`09$CHFDEF`09`09`09`09;Define condition handler stuff
  169. X`09$DCDEF`09`09`09`09;Device class & type definitions
  170. X`09$SSDEF`09`09`09`09;System service codes
  171. X`09$STSDEF`09`09`09`09;Define severity codes
  172. X`09$TPADEF`09`09`09`09;TPARSE definitions
  173. X`09$TTYUCBDEF`09`09`09;Terminal UCB offsets
  174. X`09$UCBDEF`09`09`09`09;UCB offsets
  175. X
  176. X`09.Cross`09`09`09`09;Turn CREF back on
  177. X
  178. X
  179. X; Local macros
  180. X
  181. X; Item:`09`09Make an item list entry for $GETxxI
  182. X
  183. X.Macro`09Item`09Type=DVI,Item=,Length=4,RetAdr=,RetLen= ;Make an item list e
  184. Vntry for $GETxxI
  185. X`09.Word`09Length,Type'$_'Item`09;Length,,what
  186. X`09.Address RetAdr`09`09`09;Put it here
  187. X`09.If`09NB,RetLen`09`09;If we have an explicit return length
  188. X`09.Address RetLen`09`09`09; then use it
  189. X`09.Iff`09`09`09`09;  else
  190. X`09.Long`090`09`09`09;   we don't care
  191. X`09.Endc`09`09`09`09;`09...
  192. X.Endm`09Item`09`09`09`09;`09...
  193. X
  194. X; .Ascip:`09Create a pointer to an .Ascid string
  195. X
  196. X.Macro`09.Ascip`09STRING,?A`09`09;Point to a string descriptor in another PS
  197. VECT
  198. X`09.Enable`09LSB`09`09`09;Turn on the local symbol block
  199. X`09.Save`09`09`09`09;Save the current PSECT
  200. X`09.Psect`09STRINGS NOEXE,RD,NOWRT,PIC,SHR,PAGE
  201. XA:`09.Ascid`09\'STRING\`09`09;String
  202. X`09.Restore`09`09`09;Restore the current PSECT
  203. X`09.Address A`09`09`09;Store pointer to the string
  204. X`09.Disable LSB`09`09`09;Turn off the local symbol block
  205. X.Endm`09.Ascip`09`09`09`09;       ...
  206. X
  207. X`09.Page
  208. X`09.Subtitle`09TPARSE state table
  209. X
  210. X;+
  211. X;
  212. X; ----- TPARSE state table
  213. X;
  214. X;
  215. X; Valid commands:
  216. X;
  217. X;`09HELP or ?`09`09- Print a short help message
  218. X;`09SET <device> <string>`09- Set  the ACCPORNAM for <device> to <string>
  219. X;`09SHOW <device>`09`09- Show the ACCPORNAM for <device>
  220. X;`09EXIT`09`09`09- Quit
  221. X;
  222. X;-
  223. X
  224. X`09$INIT_STATE`09ACCP_STATES,ACCP_KEYS`09;Initialize the state table
  225. X
  226. X; Parse the major verb.
  227. X
  228. X`09$STATE`09`09`09`09`09;First state
  229. X
  230. X`09$TRAN`09TPA$_STRING,,UPCASE`09`09;Upcase the first token (!)
  231. X`09$TRAN`09TPA$_EOS,TPA$_EXIT`09`09;Ignore empty commands
  232. X`09$TRAN`09'?',TPA$_EXIT,HELP`09`09;Print help
  233. X`09$TRAN`09'EXIT',TPA$_EXIT,RET_EOF`09;Quit
  234. X`09$TRAN`09'HELP',TPA$_EXIT,HELP`09`09;    ...
  235. X`09$TRAN`09'SET',ST_SET`09`09`09;Set the ACCPORNAM
  236. X`09$TRAN`09'SHOW',ST_SHOW`09`09`09;Show the ACCPORNAM
  237. X
  238. X; Set <device> <string>
  239. X
  240. X`09$STATE`09ST_SET`09`09`09`09;Set the ACCPORNAM
  241. X
  242. X`09$TRAN`09TPA$_FILESPEC,,CHECK_DEVICE`09;Go check the device name out
  243. X
  244. X`09$STATE`09`09`09`09`09;Here to set the string
  245. X
  246. X`09$TRAN`09!ST_NAME,TPA$_EXIT,SET_ACCP`09;Go set the string
  247. X
  248. X; Show <device>
  249. X
  250. X`09$STATE`09ST_SHOW`09`09`09`09  ;Show the ACCPORNAM
  251. X
  252. X`09$TRAN`09TPA$_FILESPEC,TPA$_EXIT,SHOW_ACCP ;Go show the access port name
  253. X
  254. X; Sub-expression to swallow stuff until EOS.
  255. X
  256. X`09$STATE`09ST_NAME`09`09`09`09;Sub-expression to collect until EOS
  257. X
  258. X`09$TRAN`09TPA$_LAMBDA,,BLANKS_VISIBLE`09;Make blanks visible again
  259. X
  260. X`09$STATE`09ST_NAME_1`09`09`09;Here to collect until EOS
  261. X
  262. X`09$TRAN`09TPA$_EOS,TPA$_EXIT`09`09;Quit at EOS
  263. X`09$TRAN`09TPA$_ANY,ST_NAME_1`09`09;Else munch another character
  264. X
  265. X`09$END_STATE`09`09`09`09;End of the state table
  266. X
  267. X`09.Page
  268. X`09.Subtitle`09Impure storage
  269. X
  270. X`09.Psect`09IMPURE_DATA`09NOEXE,RD,WRT,PIC,NOSHR,PAGE
  271. X
  272. X
  273. X; TPARSE parameter block.
  274. X
  275. XTPARSE_BLOCK:`09.Long`09TPA$K_COUNT0`09;Argument count
  276. X`09`09.Blkb`09TPA$K_LENGTH0-4`09;Allocate the rest of the block
  277. X
  278. X
  279. X; Random other crud.
  280. X
  281. XDEVICE_CLASS:`09.Blkl`09`09`09;Device class
  282. XDEVICE_STS:`09.Blkl`09`09`09;Device status
  283. XDEVICE_DESC:`09.Blkl`09`09`09;Device name
  284. X`09`09.Address DEVICE_BUFF`09; descriptor
  285. XACCP_DESC:`09.Blkl`09`09`09;Access Port Name
  286. X`09`09.Address ACCP_BUFF`09; descriptor
  287. XTT_DESC:`09.Blkl`09`09`09;Physical terminal
  288. X`09`09.Address TT_BUFF`09; descriptor
  289. X
  290. XIN_BUFF:`09.Blkb`09128`09`09;Command input buffer
  291. XTT_BUFF:`09.Blkb`0964`09`09;Physical terminal name buffer
  292. XDEVICE_BUFF:`09.Blkb`0964`09`09;Device name buffer
  293. XACCP_BUFF:`09.Blkb`0964`09`09;Access Port Name buffer
  294. X
  295. X`09.Page
  296. X`09.Subtitle`09Pure storage
  297. X
  298. X`09.Psect`09PURE_DATA`09NOEXE,RD,NOWRT,PIC,SHR,PAGE
  299. X
  300. X
  301. X; $GETDVI wish list.
  302. X
  303. XDVI_LIST:`09Item`09Item=DEVCLASS,-`09`09;Get the device class
  304. X`09`09`09RetAdr=DEVICE_CLASS`09;Put it here
  305. X`09`09Item`09Item=STS,-`09`09;Get the device status word
  306. X`09`09`09RetAdr=DEVICE_STS`09;Put it here
  307. X`09`09Item`09Item=TT_PHYDEVNAM,-`09;Get the device name
  308. X`09`09`09Length=64,-`09`09;It can be this big
  309. X`09`09`09RetAdr=TT_BUFF,-`09;Put it here
  310. X`09`09`09RetLen=TT_DESC`09`09;Return the length here
  311. X`09`09Item`09Item=TT_ACCPORNAM,-`09;Get the Access Port Name
  312. X`09`09`09Length=64,-`09`09;It can be this big
  313. X`09`09`09RetAdr=ACCP_BUFF,-`09;Put it here
  314. X`09`09`09RetLen=ACCP_DESC`09;Return the length here
  315. X`09`09Item`09Item=DEVNAM,-`09`09;Get the device name
  316. X`09`09`09Length=64,-`09`09;It can be this big
  317. X`09`09`09RetAdr=DEVICE_BUFF,-`09;Put it here
  318. X`09`09`09RetLen=DEVICE_DESC`09;Return the length here
  319. X`09`09.Long`090`09`09`09;That's all
  320. X
  321. X
  322. X; Help text.
  323. X
  324. XHELP_TEXT:`09.Ascip`09<>
  325. X`09`09.Ascip`09<Commands:>
  326. X`09`09.Ascip`09<>
  327. X`09`09.Ascip`09<EXIT`09`09`09- Exit the program>
  328. X`09`09.Ascip`09<SET device string`09- Set  the ACCPORNAM for device to strin
  329. Vg>
  330. X`09`09.Ascip`09<SHOW device`09`09- Show the ACCPORNAM for device>
  331. X`09`09.Ascip`09<>
  332. X`09`09.Long`090
  333. X
  334. X
  335. X; Other random text.
  336. X
  337. XPROMPT:`09`09.Ascid`09"ACCP> "
  338. XUS:`09`09.Ascid`09"ACCP"
  339. X
  340. X`09.Page
  341. X`09.Subtitle`09Entry point
  342. X
  343. X`09.Psect`09CODE`09`09EXE,RD,NOWRT,PIC,SHR,PAGE
  344. X
  345. X`09.Entry`09START,`5EM<>`09`09;Entry here
  346. X
  347. X`09MOVAB`09COND_HANDLER,(FP)`09;Establish a condition handler
  348. X`09MOVAL`09TPARSE_BLOCK,R11`09;Address our TPARSE block
  349. X
  350. X; Loop here reading commands from SYS$INPUT.
  351. X
  352. X10$:`09MOVZBL`09#128,TPA$L_STRINGCNT(R11)    ;Reset the input
  353. X`09MOVAB`09IN_BUFF,TPA$L_STRINGPTR(R11) ; descriptor
  354. X`09MOVL`09#TPA$M_ABBREV,-`09`09     ;Reset the
  355. X`09`09TPA$L_OPTIONS(R11)`09     ; TPARSE options
  356. X`09PUSHAW`09TPA$L_STRINGCNT(R11)`09     ;Return the length here
  357. X`09PUSHAQ`09PROMPT`09`09`09     ;Prompt with this
  358. X`09PUSHAQ`09TPA$L_STRINGCNT(R11)`09     ;Here's the input buffer
  359. X`09CALLS`09#3,G`5ELIB$GET_INPUT`09     ;Fetch some input
  360. X`09BLBC`09R0,20$`09`09`09     ;Presume EOF
  361. X`09TSTW`09TPA$L_STRINGCNT(R11)`09     ;Any input?
  362. X`09BEQL`0910$`09`09`09     ;If EQL no, ask again
  363. X
  364. X; Feed the command to TPARSE.  Command execution handled by TPARSE
  365. X; action routines.
  366. X
  367. X`09PUSHAL`09ACCP_KEYS`09`09;Stack the keyword table address
  368. X`09PUSHAL`09ACCP_STATES`09`09;Stack the state table address
  369. X`09PUSHL`09R11`09`09`09;Stack the TPARSE block address
  370. X`09CALLS`09#3,G`5ELIB$TPARSE`09`09;Parse the command
  371. X`09BLBS`09R0,10$`09`09`09;Win!
  372. X
  373. X; Here on some sort of error.
  374. X
  375. X20$:`09CMPL`09#RMS$_EOF,R0`09`09;End of file?
  376. X`09BEQL`0940$`09`09`09;If EQL yes, not an error
  377. X`09BBS`09#STS$V_INHIB_MSG,R0,10$`09;Branch if we've already signalled the er
  378. Vror
  379. X`09CMPL`09#LIB$_SYNTAXERR,R0`09;Syntax error?
  380. X`09BNEQ`0930$`09`09`09;If NEQ no, a real problem
  381. X`09PUSHAQ`09TPA$L_TOKENCNT(R11)`09;Else stack the token descriptor address
  382. X`09PUSHL`09#1`09`09`09;1 FAO argument
  383. X`09PUSHL`09#ACCP$_SYNTAX`09`09;Stack the error code
  384. X`09CALLS`09#3,G`5ELIB$SIGNAL`09`09;Signal the error
  385. X`09BRB`0910$`09`09`09;And loop
  386. X
  387. X; Here on some drastic error.
  388. X
  389. X30$:`09PUSHL`09R0`09`09`09;Stack the error
  390. X`09CALLS`09#1,G`5ELIB$STOP`09`09;Punt.
  391. X
  392. X; Here to exit peacefully.
  393. X
  394. X40$:`09MOVL`09#SS$_NORMAL,R0`09`09;Success
  395. X`09RET`09`09
  396. X
  397. X`09.Page
  398. X`09.Subtitle`09HELP`09`09- List brief help
  399. X
  400. X;+
  401. X;
  402. X; ----- HELP:  List brief help
  403. X;
  404. X;
  405. X; This routine is called as a TPARSE action routine to print
  406. X; brief help on SYS$OUTPUT.
  407. X;
  408. X; Inputs:
  409. X;
  410. X;`09HELP_TEXT`09- Table of help text pointers.
  411. X;
  412. X; Outputs:
  413. X;
  414. X;`09As described above.
  415. X;
  416. X;-
  417. X
  418. XHELP:`09.Word`09`5Em<R2>`09`09`09;List brief help
  419. X
  420. X`09MOVAL`09HELP_TEXT,R2`09`09;Address the help text
  421. X
  422. X10$:`09PUSHL`09(R2)+`09`09`09;Stack the next descriptor address
  423. X`09BEQL`0920$`09`09`09;If EQL we're done
  424. X`09CALLS`09#1,G`5ELIB$PUT_OUTPUT`09;Display it
  425. X`09BRB`0910$`09`09`09;Around and around we go
  426. X
  427. X20$:`09RET`09`09`09`09;Done
  428. X
  429. X`09.Page
  430. X`09.Subtitle`09RET_EOF`09`09- Return RMS$_EOF
  431. X
  432. X;+
  433. X;
  434. X; ----- RET_EOF:  Return RMS$_EOF
  435. X;
  436. X;
  437. X; This routine is called as a TPARSE action routine for the EXIT command.
  438. X;
  439. X; Inputs:
  440. X;
  441. X;`09None
  442. X;
  443. X; Outputs:
  444. X;
  445. X;`09R0`09- RMS$_EOF
  446. X;
  447. X;-
  448. X
  449. XRET_EOF: .Word`09`5Em<>`09`09`09;Return RMS$_EOF
  450. X
  451. X`09MOVL`09#RMS$_EOF,R0`09`09;Return
  452. X`09RET`09`09`09`09; RMS$_EOF
  453. X
  454. X`09.Page
  455. X`09.Subtitle`09CHECK_DEVICE`09- Ensure that the device is a terminal
  456. X
  457. X;+
  458. X;
  459. X; ----- CHECK_DEVICE:  Ensure that the device is a terminal
  460. X;
  461. X;
  462. X; This routine will ensure that the target device is a terminal
  463. X; and is not a "ephemeral" device.
  464. X;
  465. X; Inputs:
  466. X;
  467. X;`09TPA$L_TOKENCNT(AP)`09- A descriptor of the device name
  468. X;
  469. X; Outputs:
  470. X;
  471. X;`09R0`09- Success or failure
  472. X;
  473. X;-
  474. X
  475. XCHECK_DEVICE: .Word `5Em<>`09`09`09;Ensure that the device is a terminal
  476. X
  477. X; Get the scoop on this device
  478. X
  479. X`09$GETDVIW_S DEVNAM=TPA$L_TOKENCNT(AP),-`09;Fetch the
  480. X`09`09ITMLST=DVI_LIST`09`09`09; poop on this device
  481. X`09BLBC`09R0,10$`09`09`09`09;Lose!
  482. X
  483. X; Reject if it's not a terminal, off line, or a template device.
  484. X
  485. X`09MOVAQ`09DEVICE_DESC,R1`09`09`09;Presume it's not a terminal
  486. X`09MOVL`09#ACCP$_NOTERM,R0`09`09;Presume not a terminal
  487. X`09CMPL`09#DC$_TERM,DEVICE_CLASS`09`09;Is it?
  488. X`09BNEQ`0920$`09`09`09`09;Nope.
  489. X`09MOVL`09#ACCP$_OFFLINE,R0`09`09;Presume device off line
  490. X`09BBC`09#UCB$V_ONLINE,DEVICE_STS,20$`09;Branch if so
  491. X`09MOVAL`09TT_DESC,R1`09`09`09;It's a terminal, so use this name for errors
  492. X`09MOVL`09#ACCP$_TEMPLATE,R0`09`09;Presume template device
  493. X`09BBS`09#UCB$V_TEMPLATE,DEVICE_STS,20$`09;Branch if so
  494. X`09MOVL`09#SS$_NORMAL,R0`09`09`09;Else we're
  495. X`09RET`09`09`09`09`09; Ok
  496. X
  497. X; Here on a system service error.
  498. X
  499. X10$:`09PUSHL`09R0`09`09`09;Stack the error code
  500. X`09CALLS`09#1,G`5ELIB$SIGNAL`09`09;Signal same
  501. X`09RET`09`09`09`09;Done
  502. X
  503. X; Here when it appears that we don't have an acceptible device.
  504. X
  505. X20$:`09PUSHL`09R1`09`09`09;Stack the device descriptor address
  506. X`09PUSHL`09#1`09`09`09;1 FAO argument
  507. X`09PUSHL`09R0`09`09`09;Stack the error code
  508. X`09CALLS`09#3,G`5ELIB$SIGNAL`09`09;Signal the error
  509. X`09RET`09`09`09`09;Done
  510. X
  511. X`09.Page
  512. X`09.Subtitle`09SHOW_ACCP`09- Show the Access Port Name
  513. X
  514. X;+
  515. X;
  516. X; ----- SHOW_ACCP:  Show the Access Port Name
  517. X;
  518. X;
  519. X; This routine is called as a TPARSE action routine to show the
  520. X; Access Port Name for the current device.
  521. X;
  522. X; Inputs:
  523. X;
  524. X;`09TPA$L_TOKENCNT(AP)`09- A descriptor of the device name
  525. X;
  526. X; Outputs:
  527. X;
  528. X;`09Access Port Name displayed.
  529. X;
  530. X;-
  531. X
  532. XSHOW_ACCP: .Word `5Em<>`09`09`09;Show the Access Port Name
  533. X
  534. X; Get the scoop on the device.
  535. X
  536. X`09$GETDVIW_S DEVNAM=TPA$L_TOKENCNT(AP),-`09;Fetch the
  537. X`09`09ITMLST=DVI_LIST`09`09`09; poop on this device
  538. X`09BLBC`09R0,10$`09`09`09`09;Lose!
  539. X
  540. X; Lose if it's not a terminal, off line, or a template device.
  541. X
  542. X`09MOVAQ`09DEVICE_DESC,R1`09`09`09;Presume it's not a terminal
  543. X`09MOVL`09#ACCP$_NOTERM,R0`09`09;Presume not a terminal
  544. X`09CMPL`09#DC$_TERM,DEVICE_CLASS`09`09;Is it?
  545. X`09BNEQ`0920$`09`09`09`09;Nope.
  546. X`09MOVL`09#ACCP$_OFFLINE,R0`09`09;Presume device off line
  547. X`09BBC`09#UCB$V_ONLINE,DEVICE_STS,20$`09;Branch if so
  548. X`09MOVAQ`09TT_DESC,R1`09`09`09;It's a terminal, so use this name
  549. X`09MOVL`09#ACCP$_TEMPLATE,R0`09`09;Presume template device
  550. X`09BBS`09#UCB$V_TEMPLATE,DEVICE_STS,20$`09;Branch if so
  551. X
  552. X; It's a terminal -- signal the Access Port Name.
  553. X
  554. X`09PUSHAQ`09ACCP_DESC`09`09;Stack the Access Port Name descriptor address
  555. X`09PUSHAQ`09TT_DESC`09`09`09;Stack the device name descriptor address
  556. X`09PUSHL`09#2`09`09`09;2 FAO arguments
  557. X`09PUSHL`09#ACCP$_ACCP`09`09;Stack the message code
  558. X`09CALLS`09#4,G`5ELIB$SIGNAL`09`09;Signal the message
  559. X`09RET`09`09`09`09;Done
  560. X
  561. X; Here when $GETDVI loses.
  562. X
  563. X10$:`09PUSHL`09R0`09`09`09;Stack the error
  564. X`09CALLS`09#1,G`5ELIB$SIGNAL`09`09;Signal it
  565. X`09RET`09`09`09`09;Done
  566. X
  567. X; Here when the device isn't a terminal or is otherwise unacceptable.
  568. X
  569. X20$:`09PUSHL`09R1`09`09`09;Stack the device descriptor address
  570. X`09PUSHL`09#1`09`09`09;1 FAO argument
  571. X`09PUSHL`09R0`09`09`09;Stack the error code
  572. X`09CALLS`09#3,G`5ELIB$SIGNAL`09`09;Signal the error
  573. X`09RET`09`09`09`09;Done
  574. X
  575. X`09.Page
  576. X`09.Subtitle`09SET_ACCP`09- Set the Access Port Name
  577. X
  578. X;+
  579. X;
  580. X; ----- SET_ACCP:  Set the Access Port Name
  581. X;
  582. X;
  583. X; This routine is called as a TPARSE action routine to set the Access
  584. X; Port Name for the specified device.  If  the device  already has an
  585. X; Access  Port Name  buffer then  we simply replace its contents.  If
  586. X; not, then  we allocate a  64 byte  chunk of  non-paged pool and use
  587. X; that.
  588. X;
  589. X; Inputs:
  590. X;
  591. X;`09TT_DESC`09`09`09- Descriptor of the device to hack
  592. X;`09TPA$L_TOKENCNT(AP)`09- Descriptor of the Access Port Name
  593. X;
  594. X; Outputs:
  595. X;
  596. X;`09Access Port Name bashed.
  597. X;
  598. X;-
  599. X
  600. XSET_ACCP: .Word`09`5Em<>`09`09`09;Set the Access Port Name
  601. X
  602. X`09CMPL`09TPA$L_TOKENCNT(AP),#63`09;Too big?
  603. X`09BGTRU`0910$`09`09`09;If GTRU yes
  604. X`09$CMKRNL_S B`5E20$,(AP)`09`09;Do this in kernel mode
  605. X`09RET`09`09`09`09;Done, status in R0
  606. X
  607. X; Here when the string is too long.
  608. X
  609. X10$:`09PUSHAQ`09TPA$L_TOKENCNT(AP)`09;Stack the string descriptor address
  610. X`09PUSHL`09#1`09`09`09;1 FAO argument
  611. X`09PUSHL`09#ACCP$_TOOLONG`09`09;Stack the error code
  612. X`09CALLS`09#1,G`5ELIB$SIGNAL`09`09;Signal the error
  613. X`09RET`09`09`09`09;Done
  614. X
  615. X; Here in kernel mode to do the hard work.
  616. X
  617. X20$:`09.Word`09`5Em<R2,R3,R4,R5,R6,R7,R8,R9,R10,R11> ;Here in kernel mode to
  618. V do the hard work.
  619. X
  620. X; Hunt down the device.
  621. X
  622. X`09MOVL`09G`5ECTL$GL_PCB,R4`09`09  ;Fetch my PCB address
  623. X`09JSB`09G`5ESCH$IOLOCKW`09`09  ;Lock the I/O database for write access
  624. X`09MOVAB`09TT_DESC,R1`09`09  ;Here's the device to find
  625. X`09JSB`09G`5EIOC$SEARCHDEV`09`09  ;Find the device
  626. X`09BLBC`09R0,40$`09`09`09  ;Lose.
  627. X`09MOVL`09R1,R5`09`09`09  ;Remember the UCB address
  628. X
  629. X; Check to make sure that the UCB is long enough to accomodate an Access Por
  630. Vt Name.
  631. X
  632. X`09MOVL`09#ACCP$_BADUCB,R0`09  ;Presume the UCB is too small
  633. X`09CMPW`09UCB$W_SIZE(R5),-`09  ;Is the UCB
  634. X`09`09#UCB$L_TT_ACCPORNAM+4`09  ; big enough?
  635. X`09BLSSU`0940$`09`09`09  ;If LSSU no, we have to lose.`20
  636. X`09MOVL`09UCB$L_TT_ACCPORNAM(R5),R2 ;Fetch the Access Port Name buffer addre
  637. Vss
  638. X`09BLSS`0930$`09`09`09  ;If LSS use the one that's there
  639. X
  640. X; We have to  allocate an Access Port Name buffer.  This is a problem for
  641. X; ephemeral devices, in that when the UCB goes away then we will lose the
  642. X; non-paged  pool for the  Access Port Name  buffer.  We  can't make this
  643. X; check in  CHECK_DEVICE because of  the cretinous misfeature  of $GETDVI
  644. X; which returns UCB$W_STS  for the  *virtual*  terminal when  you ask for
  645. X; information on the  *physical*  terminal.  If I  had wanted information
  646. X; for the *virtual* terminal I would have asked for it...
  647. X
  648. X`09MOVL`09#ACCP$_EPHEMERAL,R0`09;Presume that the device is ephemeral
  649. X`09BBS`09#UCB$V_DELETEUCB,-`09;Branch if this
  650. X`09`09UCB$W_STS(R5),40$`09; is the case
  651. X
  652. X; Allocate an Access Port Name buffer
  653. X
  654. X`09MOVL`09#64,R1`09`09`09  ;We'd like 64 bytes
  655. X`09JSB`09G`5EEXE$ALONPAGVAR`09  ;Get some pool
  656. X`09BLBC`09R0,40$`09`09`09  ;Lossage!
  657. X`09MOVL`09R2,UCB$L_TT_ACCPORNAM(R5) ;Fill in the address of the block
  658. X`09BBSS`09#TTY$V_PC_ACCPORNAM,-`09  ;Indicate that there's
  659. X`09`09UCB$W_TT_PRTCTL(R5),30$`09  ; an access port name buffer
  660. X
  661. X; Stuff the string into the Access Port Name buffer.
  662. X
  663. X30$:`09MOVZBL`09TPA$L_TOKENCNT(AP),R0`09    ;Grab the device length
  664. X`09MOVB`09R0,(R2)+`09`09    ;Stash the length
  665. X`09MOVC3`09R0,@TPA$L_TOKENPTR(AP),(R2) ;Stash the Access Port Name
  666. X`09MOVL`09#SS$_NORMAL,R0`09`09    ;Success
  667. X
  668. X40$:`09PUSHL`09R0`09`09`09;Save the status
  669. X`09MOVL`09G`5ECTL$GL_PCB,R4`09`09;Fetch my PCB address
  670. X`09JSB`09G`5ESCH$IOUNLOCK`09`09;Unlock the I/O database
  671. X`09POPL`09R0`09`09`09;Restore the status
  672. X`09RET`09`09`09`09;Back to user mode
  673. X
  674. X`09.Page
  675. X`09.Subtitle`09BLANKS_VISIBLE`09- Make blanks visible
  676. X
  677. X;+
  678. X;
  679. X; ----- BLANKS_VISIBLE:  Make blanks visible
  680. X;
  681. X;
  682. X; This routine is called as a TPARSE action routine to make
  683. X; blanks significant in the input string.
  684. X;
  685. X; Inputs:
  686. X;
  687. X;`09AP`09- TPARSE parameter block address
  688. X;
  689. X; Outputs:
  690. X;
  691. X;`09TPA$M_BLANKS set in TPA$L_OPTIONS(AP).
  692. X;
  693. X;-
  694. X
  695. XBLANKS_VISIBLE:`09.Word `5Em<>`09`09;Make blanks visible
  696. X
  697. X`09BISL`09#TPA$M_BLANKS,-`09`09;Make blanks
  698. X`09`09TPA$L_OPTIONS(AP)`09; visible
  699. X`09RET`09`09`09`09;Done
  700. X
  701. X`09.Page
  702. X`09.Subtitle`09UPCASE`09`09- Upcase the current token
  703. X
  704. X;+
  705. X;
  706. X; ----- UPCASE:  Upcase the current token
  707. X;
  708. X;
  709. X; This routine is called as a TPARSE action routine to upcase the
  710. X; current token.  The routine  returns failure to cause TPARSE to
  711. X; scan forward for the next transition.
  712. X;
  713. X; Inputs:
  714. X;
  715. X;`09TPA$L_TOKENCNT(AP)`09- A descriptor of the token
  716. X;
  717. X; Outputs:
  718. X;
  719. X;`09Token upcased.
  720. X;
  721. X;-
  722. X
  723. XUPCASE:`09.Word`09`5Em<>`09`09`09;Upcase the current token
  724. X
  725. X`09PUSHAL`09TPA$L_TOKENCNT(AP)`09;Here's the destination string
  726. X`09PUSHL`09(SP)`09`09`09;Which happens to be the source string
  727. X`09CALLS`09#2,G`5ESTR$UPCASE`09`09;Uppercasify it
  728. X`09CLRL`09R0`09`09`09;Lose
  729. X`09RET`09`09`09`09;Done
  730. X
  731. X`09.Page
  732. X`09.Subtitle`09COND_HANDLER`09- Condition handler
  733. X
  734. X;+
  735. X;
  736. X; ----- COND_HANDLER:  Condition handler
  737. X;
  738. X;
  739. X; This routine is the condition handler for this module.  We output an error
  740. X; message and exit with status if the error condition was severe.
  741. X;
  742. X; Inputs:
  743. X;
  744. X;`09CHF$L_SIGARGLST(AP)`09- Signal argument vector address
  745. X;`09CHF$L_MECARGLST(AP)`09- Mechanism argument vector address
  746. X;
  747. X; Outputs:
  748. X;
  749. X;`09An error message is output to SYS$OUTPUT and SYS$ERROR using
  750. X;`09$PUTMSG.  Image exit will be forced if the error was SEVERE.
  751. X;
  752. X;-
  753. X
  754. XCOND_HANDLER: .Word `5EM<R2>`09`09;Here on a signalled error
  755. X
  756. X`09MOVL`09CHF$L_SIGARGLST(AP),R2`09;Address the signal vector
  757. X`09SUBL`09#2,(R2)`09`09`09;Never mind the PC and PSL
  758. X`09$PUTMSG_S MSGVEC=(R2),-`09`09;Output the error code(s)
  759. X`09`09FACNAM=US`09`09;Use our name.
  760. X`09BISL3`09#STS$M_INHIB_MSG,-`09;Don't output
  761. X`09`09CHF$L_SIG_NAME(R2),R1`09; the message twice
  762. X`09CMPZV`09#STS$V_SEVERITY,-`09;Is this a
  763. X`09`09#STS$S_SEVERITY,-`09; severe (fatal)
  764. X`09`09R1,#STS$K_SEVERE`09;  error?
  765. X`09BEQL`0910$`09`09`09;If EQL yes, force image exit
  766. X`09MOVL`09CHF$L_MCHARGLST(AP),R2`09;Else address the mechanism argument list
  767. X`09MOVL`09R1,CHF$L_MCH_SAVR0(R2)`09;Return the error code and return to
  768. X`09RET`09`09`09`09; the previous thread of execution
  769. X
  770. X10$:`09$EXIT_S`09R1`09`09`09;Exit with status
  771. X
  772. X
  773. X
  774. X`09.End`09START
  775. $ CALL UNPACK ACCPORNAM.MAR;1 1142977795
  776. $ create 'f'
  777. X`09.Title`09ACCPMessage Message file for ACCPORNAM
  778. X`09.Ident`09"V01.000"
  779. X
  780. X!+
  781. X!
  782. X! ----- ACCPMessage:  Message file for ACCP
  783. X!
  784. X!
  785. X! This file contains the message defintions for ACCPORNAM.
  786. X!
  787. X!
  788. X! Version:`09V01.000
  789. X! Date:`09`0924-Feb-1989
  790. X!
  791. X! Copyright `A9 1989  San Diego Supercomputer Center
  792. X!
  793. X! Gerard K. Newman`0924-Feb-1989
  794. X! San Diego Supercomputer Center
  795. X! General Atomics
  796. X! P.O. Box 85608
  797. X! San Diego, CA  92138-5608
  798. X! 619.534.5076
  799. X!
  800. X! Internet:`09GKN@SDS.SDSC.EDU
  801. X! Bitnet:`09GKN@SDSC.BITNET
  802. X! SPAN:`09`09SDSC::GKN (27.1)
  803. X! MFEnet:`09GKN@SDS.MFENET
  804. X! SDSCnet:`09GKN@SDS.SDSCNET
  805. X!
  806. X!
  807. X! Modifications:
  808. X!
  809. X!
  810. X!-
  811. X
  812. X`09.Facility`09ACCP,100/Prefix=ACCP$_
  813. X
  814. X`09.Severity`09Informational
  815. X
  816. XACCP`09`09<Access port name of !AS set to !AS>/FAO_Count=2
  817. X
  818. X`09.Severity`09Error
  819. X
  820. XSYNTAX`09`09<Error parsing "!AS">/FAO_Count=1
  821. XNOTERM`09`09<!AS is not a terminal>/FAO_Count=1
  822. XOFFLINE`09`09<!AS is offline>/FAO_Count=1
  823. XTEMPLATE`09<!AS is only a template>/FAO_Count=1
  824. XEPHEMERAL`09<Device is ephemeral>
  825. XTOOLONG`09`09<"!AS" is too long to be an Access Port Name>/FAO_Count=1
  826. XBADUCB`09`09<UCB is too short for an Access Port Name>
  827. X
  828. X
  829. X`09.End
  830. $ CALL UNPACK ACCPORNAM_MSG.MSG;1 251932821
  831. $ create 'f'
  832. X$RUN ACCPORNAM
  833. XSET OPA0 SIGMA/NS213-SC
  834. XSET TXA0 SIGMA/VOCOM-40
  835. XSET TXA1 SIGMA/NS202
  836. XSET TXA2 SIGMA/NS213-03
  837. XSET TXA3 SIGMA/UNUSED03
  838. XSET TXA3 SIGMA/UNUSED04
  839. XSET TXA3 SIGMA/UNUSED05
  840. XSET TXA3 SIGMA/UNUSED06
  841. XSET TXA3 SIGMA/UNUSED07
  842. XEXIT
  843. $ CALL UNPACK EXAMPLE.COM;2 928176445
  844. $ create 'f'
  845. X$ macro accpornam
  846. X$ message accpornam_msg
  847. X$ link/notrace accpornam+accpornam_msg
  848. $ CALL UNPACK MAKE_ACCPORNAM.COM;1 2033063831
  849. $ v=f$verify(v)
  850. $ EXIT
  851.