attach_tty_: proc; return; /* can't enter here */ /* procedure to attach an answering service line. Adapted from g115_driver_ by Robert Sonnier. Modified 5/16/78 by JPD */ /* ...... arguments ........ */ dcl (a_stream, a_chan) char (*); dcl a_iocb ptr; dcl a_ec fixed bin (35); dcl a_dial_sw bit (1) aligned; dcl dial_ev_chan fixed bin (71); /* event channel for waiting on chan_id */ dcl ec fixed bin (35); /* error code */ dcl mask bit (36) aligned; dcl (n_dev, /* dummy for number of dialed dev arg */ al, /* arg len */ i, /* misc */ nargs /* arg count */ ) fixed bin; dcl (DIAL, got_chan) bit (1) aligned; dcl (dev_name, /* tty_chan name from initializer */ dim_name, /* dim that system thinks would be nice */ chan_id /* channel to be attached */ ) char (32) aligned; dcl arg char (al) based (ap), me char (11) int static options (constant) init ("attach_tty_"), stream char (32), msg char (256) varying; dcl (ap, /* ptr to i/p arg */ iocbp int static /* ptr to iocb for chan */ ) ptr; dcl cleanup condition; dcl (null, addr) builtin; dcl 1 ev_info aligned, /* event info structure accepted by block */ 2 chan fixed bin (71), 2 message fixed bin (71), 2 sender bit (36), 2 origin bit (36), 2 chan_index fixed bin; /* index of chan in wait list */ dcl 1 dial_wait aligned, /* wait list for dial wakeup */ 2 num fixed bin, 2 pad fixed bin init (0), 2 chan fixed bin (71); dcl 1 status_flags aligned, /* status structure for convert_dial_message_ */ 2 dialed_up bit (1) unal, /* 1 = device has dialed or been given to process */ 2 hung_up bit (1) unal, /* 1 = device has hung up */ 2 control bit (1) unal, /* 1 = accepted, rejected, or number signal */ 2 stat_pad bit (33) unal; dcl (error_table_$action_not_performed, error_table_$badcall, error_table_$bad_arg ) fixed bin (35) external; dcl attach_tty_$attach_tty_ entry options (variable); /* needed by iox attach */ dcl convert_dial_message_ entry (fixed bin (71), char (*)aligned, char (*)aligned, fixed bin, 1 aligned like status_flags, fixed bin (35)); dcl dial_manager_$allow_dials entry (ptr, fixed bin (35)); dcl dial_manager_$privileged_attach entry (ptr, fixed bin (35)); dcl dial_manager_$release_channel entry (ptr, fixed bin (35)); dcl cu_$arg_ptr entry (fixed bin, ptr, fixed bin, fixed bin (35)); dcl cu_$arg_count entry (fixed bin); dcl com_err_ entry options (variable); dcl hcs_$initiate_count entry (char (*), char (*), char (*), fixed bin (24), fixed bin (2), ptr, fixed bin (35)); dcl ioa_ entry options (variable); dcl iox_$attach_name entry (char (*), ptr, char (*), ptr, fixed bin (35)); dcl iox_$open entry (ptr, fixed bin, bit (1) aligned, fixed bin (35)); dcl iox_$modes entry (ptr, char (*), char (*), fixed bin (35)); dcl iox_$control entry (ptr, char (*), ptr, fixed bin (35)); dcl iox_$close ext entry (ptr, fixed bin (35)); dcl iox_$detach_iocb entry (ptr, fixed bin (35)); dcl iox_$put_chars entry (ptr, ptr, fixed bin (21), fixed bin (35)); dcl ipc_$block entry (ptr, ptr, fixed bin (35)); dcl ipc_$create_ev_chn entry (fixed bin (71), fixed bin (35)); dcl ipc_$delete_ev_chn entry (fixed bin (71), fixed bin (35)); dcl ipc_$decl_ev_call_chn entry (fixed bin (71), entry, ptr, fixed bin, fixed bin (35)); dcl convert_ipc_code_ entry (fixed bin (35)); dcl hcs_$set_ips_mask entry (bit (36) aligned, bit (36) aligned); dcl hcs_$reset_ips_mask entry (bit (36) aligned, bit (36) aligned); %include dial_manager_arg; dcl 1 dial_arg aligned like dial_manager_arg static; /* Save the stuff here */ attach_chan: entry (a_stream, a_iocb, a_chan, a_dial_sw, a_ec); a_iocb, iocbp = null; ec, a_ec = 0; chan_id = a_chan; stream = a_stream; DIAL = a_dial_sw; call ipc_$create_ev_chn (dial_ev_chan, ec); /* make a new ev chan for this device */ if ec ^= 0 then do; goto attach_return; end; dial_wait.num = 1; /* we will wait on one channel */ dial_wait.chan = dial_ev_chan; /* this one */ dial_arg.version = dial_manager_arg_version_1; /* use the constant */ dial_arg.dial_qualifier = chan_id; dial_arg.dial_channel = dial_wait.chan; dial_arg.channel_name = chan_id; /* this is the tty we want */ on cleanup call clean_up; /* ================================================== */ if DIAL then do; call dial_manager_$allow_dials (addr (dial_arg), ec); if ec ^= 0 then do; goto attach_return; end; call ioa_ ("waiting for channel ^a to dial (qualifier = ^a)", chan_id, chan_id); end; else do; call dial_manager_$privileged_attach (addr (dial_arg), ec); /* ask for it */ if ec = error_table_$action_not_performed then go to attach; else if ec ^= 0 then do; goto attach_return; end; /* if all is well we will wait */ call ioa_ ("waiting for device on channel ""^a"" to become active.", chan_id); end; wait: call ipc_$block (addr (dial_wait), addr (ev_info), ec); if ec ^= 0 then do; goto attach_return; end; call convert_dial_message_ (ev_info.message, dev_name, dim_name, n_dev, status_flags, ec); if ec ^= 0 then do; goto attach_return; end; if status_flags.hung_up then do; /* it must have been the control terminal */ go to wait; /* operator wanted to continue */ end; else if ^status_flags.dialed_up then go to wait; /* we wait until a "dial" is received */ attach: call iox_$attach_name (stream, iocbp, "tty_ " || chan_id, addr (attach_tty_$attach_tty_), ec); a_iocb = iocbp; attach_return: a_ec = ec; return; detach_chan: entry (a_iocb, a_ec); iocbp = a_iocb; ec, a_ec = 0; call clean_up; return; clean_up: proc; /* int proc to put everything back as it was */ mask = "0"b; /* mask operations in case hangup proc is active */ call hcs_$set_ips_mask ("0"b, mask); if iocbp ^= null then do; call iox_$control (iocbp, "abort", null, ec); call iox_$control (iocbp, "hangup", null, ec); call iox_$close (iocbp, ec); call iox_$detach_iocb (iocbp, ec); iocbp = null; end; call dial_manager_$release_channel (addr (dial_arg), ec); call ipc_$delete_ev_chn (dial_ev_chan, ec); call hcs_$reset_ips_mask (mask, mask); end clean_up; /* Hangup Processing done here */ hangup_proc: entry (infop, a_ec); dcl infop ptr; /* pointer to hangup_proc info */ dcl 1 hangup_proc based (infop), 2 entry_var entry variable, 2 data_ptr ptr, 2 prior fixed bin; dcl error_table_$no_operation fixed bin (35) ext; if infop = null () then do; a_ec = error_table_$no_operation; return; end; call ipc_$decl_ev_call_chn (dial_arg.dial_channel, hangup_proc.entry_var, hangup_proc.data_ptr, hangup_proc.prior, a_ec); if a_ec ^= 0 then call convert_ipc_code_ (a_ec); return; end attach_tty_; */ ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group Bull including Bull HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell Bull Inc., Groupe Bull and Bull HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, Bull or Bull HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by Bull HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved */