1 /* BEGIN INCLUDE FILE ... tp_master_table.incl.pl1 */
  2 
  3 /* Revised 9-Jan-79 by M. N. Davidoff
  4    Modified 13-Aug-79 by M. N. Davidoff to add master_table.use_xcn_mode. */
  5 
  6 /* automatic */
  7 
  8      declare channel_offset         offset (master_table.area);
  9      declare io_offset              offset (master_table.area);
 10      declare master_table_ptr       pointer;
 11      declare worker_offset          offset (master_table.area);
 12 
 13 /* based */
 14 
 15 /* master table including the master process entry */
 16 
 17      declare 1 master_table         aligned based (master_table_ptr),
 18                2 header,
 19                  3 alloc_lock       bit (36),               /* allocation lock */
 20                  3 tp_dir           char (168) unaligned,   /* TP subsystem's directory */
 21                  3 tp_state         fixed binary (17),      /* state of the TP subsystem */
 22                  3 tp_start_time    fixed binary (71),      /* time of last tp_start, 0 if none */
 23                  3 tp_stop_time     fixed binary (71),      /* time of last tp_stop, 0 if none */
 24                  3 transaction_no_lock
 25                                     bit (36),               /* getting next transaction number lock */
 26                  3 transaction_no   fixed decimal (30),     /* current transaction number */
 27                  3 message_sequence_no_lock
 28                                     bit (36),               /* getting next message sequence number lock */
 29                  3 message_sequence_no
 30                                     fixed decimal (30),     /* to ensure order of messages within a transaction */
 31                  3 tp_flags         unaligned,
 32                    4 immediate_shutdown
 33                                     bit (1),                /* on if -immediate control argument given to tp_stop */
 34                    4 use_xcn_mode   bit (1),                /* on to run transactions using vfile_'s transaction mode */
 35                    4 pad            bit (34),
 36                  3 pad              bit (36),
 37                  3 master,                                  /* master process information */
 38                    4 user_id        char (32) unaligned,    /* master process's User_id */
 39                    4 lock_id        bit (36),               /* master process's lock_id */
 40                    4 process_id     bit (36) unaligned,     /* master process's process_id */
 41                    4 outer_module   char (32) unaligned,    /* master process's outer module */
 42                    4 monitor_event_channel
 43                                     fixed binary (71),      /* event-call channel for the master process monitor */
 44                    4 worker_error_event_channel
 45                                     fixed binary (71),      /* event-call channel for worker errors */
 46                    4 io_error_event_channel
 47                                     fixed binary (71),      /* event-call channel for I/O process errors */
 48                  3 worker_process_chain
 49                                     offset (master_table.area),
 50                                                             /* start of worker process entry chain */
 51                  3 io_process_chain offset (master_table.area),
 52                                                             /* start of I/O process entry chain */
 53                  3 user_wakeup      (MAX_TP_USERS),         /* signed on user table, parallels person-name table entries */
 54                    4 lock_id        bit (36),               /* lock_id of I/O process the tp_user is on */
 55                    4 channel_offset offset (master_table.area),
 56                                                             /* offset of channel entry the tp_user is on */
 57                2 area               area (sys_info$max_seg_size - divide (length (unspec (master_table.header)), 36, 19));
 58 
 59 /* worker process entry */
 60 
 61      declare 1 worker               aligned based (worker_offset),
 62                2 next_worker        offset (master_table.area),
 63                                                             /* next worker entry in worker process entry chain */
 64                2 state              fixed binary (17),      /* state of the worker process */
 65                2 name               char (32) unaligned,    /* worker process's name */
 66                2 user_id            char (32) unaligned,    /* worker process's User_id */
 67                2 lock_id            bit (36),               /* worker process's lock_id */
 68                2 process_id         bit (36) unaligned,     /* worker process's process_id */
 69                2 flags              unaligned,
 70                  3 dont_restart     bit (1),                /* on if master process shouldn't restart this worker process */
 71                  3 pad              bit (35),
 72                2 wakeup_lock        bit (36),               /* locked if wakeup was sent or transaction being run */
 73                2 event_channel      fixed binary (71),      /* event-wait channel to wakeup the worker on */
 74                2 current_transaction,
 75                  3 transaction_no   fixed decimal (30),     /* transaction number */
 76                  3 deadline         fixed binary (71),      /* transaction's deadline */
 77                  3 tp_user_id       char (32) unaligned,    /* tp_user who submitted transaction */
 78                  3 user_index       fixed binary (17),      /* user table index of tp_user_id */
 79                  3 command_name     char (32) unaligned;    /* command user typed */
 80 
 81 /* I/O process entry */
 82 
 83      declare 1 io                   aligned based (io_offset),
 84                2 next_io            offset (master_table.area),
 85                                                             /* next io in I/O process entry chain */
 86                2 state              fixed binary (17),      /* state of the I/O process */
 87                2 name               char (32) unaligned,    /* I/O process's name */
 88                2 user_id            char (32) unaligned,    /* I/O process's User_id */
 89                2 lock_id            bit (36),               /* I/O process's lock_id */
 90                2 process_id         bit (36) unaligned,     /* I/O process's process_id */
 91                2 outer_module       char (32) unaligned,    /* I/O process's outer module */
 92                2 pad                bit (36),
 93                2 monitor_wakeup_lock
 94                                     bit (36),               /* locked if wakeup was sent on monitor_event_channel */
 95                2 monitor_event_channel
 96                                     fixed binary (71),      /* event-call channel for I/O process shutdown */
 97                2 dial_event_channel fixed binary (71),      /* event channel for dialups and dial_manager_ */
 98                2 dial_id            char (12) unaligned,    /* dial_id that this process accepts */
 99                2 channel_chain      offset (master_table.area),
100                                                             /* start of channel entry chain */
101                2 flags              unaligned,
102                  3 registered_dial  bit (1),                /* on if dial_id is registered */
103                  3 dont_restart     bit (1),                /* on if master process shouldn't restart this I/O process */
104                  3 pad              bit (34);
105 
106 /* channel entry of an I/O process */
107 
108      declare 1 channel              aligned based (channel_offset),
109                2 next_channel       offset (master_table.area),
110                                                             /* next channel in channel entry chain */
111                2 name               char (32) unaligned,    /* this channel's name */
112                2 type               fixed binary (17),      /* how this channel is attached */
113                2 device,
114                  3 outer_module     char (32) unaligned,    /* I/O module connected to the channel */
115                  3 tp_tty_outer_module_index
116                                     fixed binary (17),      /* used by tp_tty_ only */
117                  3 devx             fixed binary (17),      /* ring 0 device index */
118                2 ipc,
119                  3 wakeup_lock      bit (36),               /* locked if a wakeup was sent on event_channel */
120                  3 process_id       bit (36) unaligned,     /* I/O process's process_id */
121                  3 event_channel    fixed binary (71),      /* event-call channel for input/output */
122                2 user,                                      /* information about the TP user on this channel */
123                  3 user_state       fixed binary (17),      /* what's going on now */
124                  3 tp_user_id       char (32) unaligned,    /* what tp_user is signed on */
125                  3 user_index       fixed binary (17),      /* user table index of tp_user_id */
126                  3 flags            unaligned,
127                    4 test_mode      bit (1),                /* on if user is in test mode */
128                    4 signoff_hold   bit (1),                /* on for tp_io_signoff -hold */
129                    4 pad            bit (34),
130                  3 pad              bit (36),
131                2 output,                                    /* information about the output being printed on this channel */
132                  3 transaction_no   fixed decimal (30),     /* transaction that generated the output */
133                  3 deadline         fixed binary (71),      /* original deadline of the transaction */
134                  3 write_position   fixed binary (21),      /* position in message of next char, 0 if message finished */
135                  3 heading_length   fixed binary (21),      /* length of header message */
136                  3 heading          char (256) unaligned,   /* transaction header message */
137                  3 flags            unaligned,
138                    4 user_messages  bit (1),                /* on if a TP_user_id destination message was found */
139                    4 shutdown_message_sent
140                                     bit (1),                /* on if the TP shutdown message has been sent */
141                    4 pad            bit (34),
142                2 terminal_info,                             /* information about a user's terminal */
143                  3 id               char (4) unaligned,     /* terminal id from answerback */
144                  3 term_type        char (32) unaligned,    /* terminal type name */
145                  3 line_type        fixed binary (17),      /* line type number */
146                  3 baud_rate        fixed binary (17);      /* baud rate at which the terminal is running */
147 
148 /* internal static */
149 
150      declare INIT_DATABASE_EC       char (19) internal static options (constant) initial ("tp_init_database.ec");
151      declare MASTER_TABLE_NAME      char (16) internal static options (constant) initial ("tp_master_table_");
152      declare MAX_TP_USERS           fixed binary internal static options (constant) initial (200);
153      declare TCF_IO_SWITCH_NAME     char (4) internal static options (constant) initial ("tcf_");
154      declare TCF_NAME               char (6) internal static options (constant) initial ("tp.tcf");
155 
156 /* TP subsystem states */
157 
158      declare TP_DOWN                fixed binary internal static options (constant) initial (0);
159      declare TP_UP                  fixed binary internal static options (constant) initial (1);
160      declare TP_START_SHUTDOWN      fixed binary internal static options (constant) initial (2);
161      declare TP_SHUTDOWN            fixed binary internal static options (constant) initial (3);
162 
163 /* worker process states */
164 
165      declare WORKER_RUN             fixed binary internal static options (constant) initial (0);
166      declare WORKER_FINISH_CURRENT  fixed binary internal static options (constant) initial (1);
167      declare WORKER_FINISH_ALL      fixed binary internal static options (constant) initial (2);
168 
169 /* I/O process states */
170 
171      declare IO_ACCEPT_INPUT        fixed binary internal static options (constant) initial (0);
172      declare IO_WAIT_FOR_WORKERS    fixed binary internal static options (constant) initial (1);
173      declare IO_LOGOUT_WHEN_DONE    fixed binary internal static options (constant) initial (2);
174 
175 /* channel entry channel types */
176 
177      declare OWN_CHANNEL            fixed binary internal static options (constant) initial (1);
178      declare DIALED_CHANNEL         fixed binary internal static options (constant) initial (2);
179      declare SLAVE_CHANNEL          fixed binary internal static options (constant) initial (3);
180 
181 /* channel entry user_states */
182 
183      declare SIGNED_OFF             fixed binary internal static options (constant) initial (0);
184      declare WAITING_FOR_PASSWORD   fixed binary internal static options (constant) initial (1);
185      declare SIGNED_ON              fixed binary internal static options (constant) initial (2);
186      declare SIGNING_OFF            fixed binary internal static options (constant) initial (3);
187      declare SIGNOFF_OUTPUT_WAIT    fixed binary internal static options (constant) initial (4);
188 
189 /* external static */
190 
191      declare sys_info$max_seg_size  fixed binary (19) external static;
192      declare tp_channel_offset_     offset (master_table.area) external static initial (null);
193      declare tp_io_offset_          offset (master_table.area) external static initial (null);
194      declare tp_master_table_ptr_   pointer external static initial (null);
195      declare tp_worker_offset_      offset (master_table.area) external static initial (null);
196 
197 /* END INCLUDE FILE ... tp_master_table.incl.pl1 */