COMPILATION LISTING OF SEGMENT mlsys_nit_interface_ Compiled by: Multics PL/I Compiler, Release 32e, of September 22, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 10/02/89 0824.4 mst Mon Options: optimize map 1 /****^ *********************************************************** 2* * * 3* * Copyright, (C) BULL HN Information Systems Inc., 1989 * 4* * * 5* * Copyright, (C) Honeywell Information Systems Inc., 1983 * 6* * * 7* *********************************************************** */ 8 9 10 11 /****^ HISTORY COMMENTS: 12* 1) change(86-06-11,Mills), approve(86-06-11,MCR7419), 13* audit(86-06-17,Margolin), install(86-06-30,MR12.0-1080): 14* This changes three entry points to call host_name_ entries instead of 15* host_table_ entries if all the domain software is installed. 16* 2) change(89-07-13,Lee), approve(89-08-01,MCR8125), 17* audit(89-08-29,LZimmerman), install(89-10-02,MR12.3-1079): 18* Modified the local procedure "canonicalize" to not drop any domains if 19* dropping domains causes the name to become ambiguous to the host table. 20* END HISTORY COMMENTS */ 21 22 23 /* format: off */ 24 25 /* Interface between the Multics Mail System and the Network Information Table (NIT): In this release, the NIT does not 26* actually exist and this module serves as an interface to the MRDS/CDS host table and nit_data_ CDS segment furnished as 27* part of the Hyperchannel TCP/IP RPQ */ 28 29 /* Created: July 1983 by G. Palter */ 30 /* Modified: 6 March 1984 by G. Palter to fix error #0425 -- attempting to create an address whose foreign system name is 31* actually the name of one of the containing domains of the local system (eg: ARPA for MIT-MULTICS.ARPA) will cause a 32* fatal process error */ 33 34 /* format: on,style4,delnl,insnl,ifthenstmt,ifthen */ 35 36 mlsys_nit_interface_: 37 procedure (); 38 39 return; /* not an entrypoint */ 40 41 42 /* Parameters */ 43 44 dcl P_system_name character (256) varying parameter; 45 46 dcl P_system_name_1 character (256) varying parameter; /* compare_system_names: the names to be compared */ 47 dcl P_system_name_2 character (256) varying parameter; /* ... */ 48 49 dcl P_relay_system character (256) varying parameter; /* is_mail_supported: set to forwarding system if any */ 50 dcl P_code fixed binary (35) parameter; /* is_mail_supported */ 51 52 53 /* Local copies of parameters */ 54 55 dcl system_name character (256) varying; 56 dcl relay_system character (256) varying; 57 58 /* Remaining declarations */ 59 60 /* format: off */ 61 dcl (LOWERCASE initial ("abcdefghijklmnopqrstuvwxyz"), 62 UPPERCASE initial ("ABCDEFGHIJKLMNOPQRSTUVWXYZ")) 63 character (26) static options (constant); 64 /* format: on */ 65 66 dcl nit_data_$local_host character (40) varying external; 67 68 /* format: off */ 69 dcl (mlsys_et_$ism_not_available, mlsys_et_$no_mail_service, mlsys_et_$unknown_system) 70 fixed binary (35) external; 71 72 /* format: on */ 73 74 dcl host_name_$local_compare entry (character (256), character (256), fixed bin (35)) returns (bit (1) aligned); 75 dcl host_name_$qualify_local entry (character (256), fixed bin (35)) returns (character (256)); 76 dcl host_name_$local_valid_destination entry (char (256), fixed bin (35)) returns (bit (1) aligned); 77 dcl mlsys_psp_$ism_not_available entry () returns (bit (1) aligned); 78 dcl mlsys_psp_$domains_available entry () returns (bit (1) aligned); 79 80 dcl sub_error_ condition; 81 82 dcl (after, before, length, null, reverse, rtrim, substr, translate) builtin; 83 84 /* Return the host name of the local system */ 85 86 get_local_system_name: 87 entry () returns (character (256) varying); 88 89 if mlsys_psp_$ism_not_available () then /* no NIT on this system */ 90 return (""); 91 92 else return (translate (nit_data_$local_host, UPPERCASE, LOWERCASE)); 93 94 95 96 /* Return the fully qualified host name of the given system */ 97 98 get_fully_qualified_name: 99 entry (P_system_name) returns (character (256) varying); 100 101 on condition (sub_error_) go to RETURN_INPUT_NAME;/* in case the database is damaged */ 102 103 if mlsys_psp_$ism_not_available () then /* no NIT on this system */ 104 RETURN_INPUT_NAME: 105 return (translate (P_system_name, UPPERCASE, LOWERCASE)); 106 107 else if canonicalize (P_system_name) = canonicalize ((nit_data_$local_host)) then 108 return (translate (nit_data_$local_host, UPPERCASE, LOWERCASE)); 109 /* avoid accessing the database when possible */ 110 111 else if mlsys_psp_$domains_available () then return (rtrim (host_name_$qualify_local ((P_system_name), (0)))); 112 else return (translate (host_table_mgr_$primary_name (P_system_name), UPPERCASE, LOWERCASE)); 113 114 /* Compare two system names to see if they identify the same system */ 115 116 compare_system_names: 117 entry (P_system_name_1, P_system_name_2) returns (bit (1) aligned); 118 119 on condition (sub_error_) go to COMPARE_LITERAL_SYSTEM_NAMES; 120 121 if mlsys_psp_$ism_not_available () then /* not NIT on this system */ 122 COMPARE_LITERAL_SYSTEM_NAMES: 123 return (translate (P_system_name_1, UPPERCASE, LOWERCASE) 124 = translate (P_system_name_2, UPPERCASE, LOWERCASE)); 125 126 else if translate (P_system_name_1, UPPERCASE, LOWERCASE) = translate (P_system_name_2, UPPERCASE, LOWERCASE) 127 then 128 return ("1"b); /* avoid accessing the database when possible */ 129 130 else if mlsys_psp_$domains_available () then 131 return (host_name_$local_compare ((P_system_name_1), (P_system_name_2), (0))); 132 133 else return (host_table_mgr_$primary_name (P_system_name_1) = host_table_mgr_$primary_name (P_system_name_2)); 134 135 136 /* Determine if the supplied system name identifies the local system */ 137 138 is_local_system: 139 entry (P_system_name) returns (bit (1) aligned); 140 141 if mlsys_psp_$ism_not_available () then /* no NIT here: if it's not null, it's foreign */ 142 return (P_system_name = ""); 143 144 else return (compare_system_names (P_system_name, (nit_data_$local_host))); 145 146 /* Return the canonical form of a system name: The canonicalized form of a system name is said name translated to 147* uppercase with all domains in common to the local system name removed */ 148 149 canonicalize_system_name: 150 entry (P_system_name) returns (character (256) varying); 151 152 return (canonicalize (P_system_name)); 153 154 155 156 /* Actually canonicalizes the name (called by several entrypoints) */ 157 158 canonicalize: 159 procedure (p_system_name) returns (character (256) varying); 160 161 dcl p_system_name character (*) varying parameter; /* because host_table_mgr_ returns the wrong size */ 162 163 dcl canonical_name character (256) varying; 164 dcl reversed_name character (256) varying; 165 dcl reversed_local_name character (256) varying; 166 dcl next_component character (256) varying; 167 dcl canonicalized_form character (256) varying; 168 dcl end_point fixed binary; 169 dcl continue bit (1) aligned; 170 171 canonical_name = translate (p_system_name, UPPERCASE, LOWERCASE); 172 end_point = length (p_system_name); 173 174 if mlsys_psp_$ism_not_available () then /* no NIT on the system */ 175 go to RETURN_FROM_CANONICALIZE; 176 177 reversed_name = reverse (canonical_name); 178 reversed_local_name = reverse (translate (nit_data_$local_host, UPPERCASE, LOWERCASE)); 179 continue = "1"b; 180 181 do while (continue); 182 if after (reversed_local_name, ".") = "" then go to RETURN_FROM_CANONICALIZE; 183 next_component = before (reversed_local_name, "."); 184 if before (reversed_name, ".") = next_component then do; 185 end_point = end_point - length (next_component) - 1; 186 if end_point <= 0 then do; /* system name is that of a containing domain */ 187 end_point = length (p_system_name); 188 go to RETURN_FROM_CANONICALIZE; 189 end; 190 reversed_name = after (reversed_name, "."); 191 reversed_local_name = after (reversed_local_name, "."); 192 end; 193 else continue = "0"b; 194 end; 195 196 RETURN_FROM_CANONICALIZE: 197 canonicalized_form = substr (canonical_name, 1, end_point); 198 199 if end_point < length (p_system_name) then /* RL: make sure removal of domains still makes name identifiable */ 200 if canonicalized_form = host_table_mgr_$primary_name (canonicalized_form) then 201 /* couldn't find in host table, return original name */ 202 return (canonical_name); 203 return (canonicalized_form); 204 205 end canonicalize; 206 207 /* Determines if mail can be sent to the given system by checking the NIT */ 208 209 is_mail_supported: 210 entry (P_system_name, P_relay_system, P_code); 211 212 dcl junk bit (1) auto aligned; 213 214 if mlsys_psp_$domains_available () then do; 215 P_relay_system = ""; 216 junk = host_name_$local_valid_destination ((P_system_name), P_code); 217 return; 218 end; 219 220 on condition (sub_error_) go to RETURN_ISM_NOT_AVAILABLE; 221 222 if mlsys_psp_$ism_not_available () then do; /* no NIT and/or mailer on this system */ 223 RETURN_ISM_NOT_AVAILABLE: 224 P_code = mlsys_et_$ism_not_available; 225 return; 226 end; 227 228 system_name = host_table_mgr_$primary_name (P_system_name); 229 230 relay_system = nit_$get_forwarding_host ("mail", system_name); 231 if relay_system ^= "" then 232 service_list_ptr = nit_$get_service_list ("mail", relay_system); 233 else service_list_ptr = nit_$get_service_list ("mail", system_name); 234 235 if service_list_ptr ^= null () then do; /* we can send it mail */ 236 free service_list; 237 P_relay_system = relay_system; 238 P_code = 0; /* success */ 239 end; 240 241 else if system_name = P_system_name then /* failure: host_table_mgr_ needs a code argument ... */ 242 P_code = mlsys_et_$unknown_system; /* ... so assume if the name hasn't changed, it's invalid */ 243 244 else P_code = mlsys_et_$no_mail_service; /* failure: no way to send mail to the given system */ 245 246 return; 247 1 1 /* Begin include file host_table_dcls.incl.pl1 */ 1 2 1 3 dcl host_table_mgr_$address entry (char (*) var, char (*) var) returns (char (40) var); 1 4 dcl host_table_mgr_$host_list entry (char (*) var) returns (ptr); 1 5 dcl host_table_mgr_$name_given_address entry (char (*) var, char (*) var) returns (char (40) var); 1 6 dcl host_table_mgr_$net_list entry (char (*) var) returns (ptr); 1 7 dcl host_table_mgr_$primary_name entry (char (*) var) returns (char (40) var); 1 8 dcl host_table_mgr_$shortest_name entry (char (*) var) returns (char (40) var); 1 9 1 10 dcl nit_$get_forwarding_host entry (varying char (*), varying char (*)) returns (varying char (40)); 1 11 dcl nit_$get_service_list entry (varying char(*), varying char (*)) returns (ptr); 1 12 1 13 dcl net_list_ptr ptr; 1 14 dcl n_nets fixed bin; 1 15 dcl NET_LIST_VERSION_2 char (8) aligned static options (constant) init ("hnetlst1"); 1 16 dcl 1 net_list aligned based (net_list_ptr), 1 17 2 version char (8), 1 18 2 n_nets fixed bin, 1 19 2 net (n_nets refer (net_list.n_nets)), 1 20 3 number fixed bin, 1 21 3 name varying char (40), 1 22 3 address varying char (40); 1 23 1 24 dcl host_list_ptr ptr; 1 25 dcl n_hosts fixed bin; 1 26 dcl HOST_LIST_VERSION_2 char (8) aligned static options (constant) init ("hostlst2"); 1 27 dcl 1 host_list aligned based (host_list_ptr), 1 28 2 version char (8), 1 29 2 n_hosts fixed bin, 1 30 2 host (n_hosts refer (host_list.n_hosts)), 1 31 3 name varying char (40); 1 32 1 33 dcl n_services fixed bin; 1 34 dcl service_list_ptr ptr; 1 35 dcl 1 service_list aligned based (service_list_ptr), 1 36 2 version char (4), 1 37 2 n_services fixed bin, 1 38 2 service (n_services refer (service_list.n_services)), 1 39 3 type char (8), 1 40 3 module varying char (168), 1 41 3 argument varying char (168); 1 42 1 43 /* End include file host_table_dcls.incl.pl1 */ 248 249 250 end mlsys_nit_interface_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 10/02/89 0819.7 mlsys_nit_interface_.pl1 >spec>install>1079>mlsys_nit_interface_.pl1 248 1 04/06/83 1016.0 host_table_dcls.incl.pl1 >ldd>include>host_table_dcls.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. LOWERCASE 000007 constant char(26) initial packed unaligned dcl 61 ref 92 103 107 112 121 121 126 126 171 178 P_code parameter fixed bin(35,0) dcl 50 set ref 209 216* 223* 238* 241* 244* P_relay_system parameter varying char(256) dcl 49 set ref 209 215* 237* P_system_name parameter varying char(256) dcl 44 set ref 98 103 107* 111 112* 138 141 144* 149 152* 209 216 228* 241 P_system_name_1 parameter varying char(256) dcl 46 set ref 116 121 126 130 133* P_system_name_2 parameter varying char(256) dcl 47 set ref 116 121 126 130 133* UPPERCASE 000000 constant char(26) initial packed unaligned dcl 61 ref 92 103 107 112 121 121 126 126 171 178 after builtin function dcl 82 ref 182 190 191 before builtin function dcl 82 ref 183 184 canonical_name 000100 automatic varying char(256) dcl 163 set ref 171* 177 196 199 canonicalized_form 000504 automatic varying char(256) dcl 167 set ref 196* 199 199* 203 continue 000606 automatic bit(1) dcl 169 set ref 179* 181 193* end_point 000605 automatic fixed bin(17,0) dcl 168 set ref 172* 185* 185 186 187* 196 199 host_name_$local_compare 000020 constant entry external dcl 74 ref 130 host_name_$local_valid_destination 000024 constant entry external dcl 76 ref 216 host_name_$qualify_local 000022 constant entry external dcl 75 ref 111 host_table_mgr_$primary_name 000032 constant entry external dcl 1-7 ref 112 133 133 199 228 junk 000310 automatic bit(1) dcl 212 set ref 216* length builtin function dcl 82 ref 172 185 187 199 mlsys_et_$ism_not_available 000012 external static fixed bin(35,0) dcl 69 ref 223 mlsys_et_$no_mail_service 000014 external static fixed bin(35,0) dcl 69 ref 244 mlsys_et_$unknown_system 000016 external static fixed bin(35,0) dcl 69 ref 241 mlsys_psp_$domains_available 000030 constant entry external dcl 78 ref 111 130 214 mlsys_psp_$ism_not_available 000026 constant entry external dcl 77 ref 89 103 121 141 174 222 n_services 1 based fixed bin(17,0) level 2 dcl 1-35 ref 236 next_component 000403 automatic varying char(256) dcl 166 set ref 183* 184 185 nit_$get_forwarding_host 000034 constant entry external dcl 1-10 ref 230 nit_$get_service_list 000036 constant entry external dcl 1-11 ref 231 233 nit_data_$local_host 000010 external static varying char(40) dcl 66 ref 92 107 107 144 178 null builtin function dcl 82 ref 235 p_system_name parameter varying char dcl 161 ref 158 171 172 187 199 relay_system 000201 automatic varying char(256) dcl 56 set ref 230* 231 231* 237 reverse builtin function dcl 82 ref 177 178 reversed_local_name 000302 automatic varying char(256) dcl 165 set ref 178* 182 183 191* 191 reversed_name 000201 automatic varying char(256) dcl 164 set ref 177* 184 190* 190 rtrim builtin function dcl 82 ref 111 service_list based structure level 1 dcl 1-35 ref 236 service_list_ptr 000312 automatic pointer dcl 1-34 set ref 231* 233* 235 236 sub_error_ 000302 stack reference condition dcl 80 ref 101 119 220 substr builtin function dcl 82 ref 196 system_name 000100 automatic varying char(256) dcl 55 set ref 228* 230* 233* 241 translate builtin function dcl 82 ref 92 103 107 112 121 121 126 126 171 178 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. HOST_LIST_VERSION_2 internal static char(8) initial dcl 1-26 NET_LIST_VERSION_2 internal static char(8) initial dcl 1-15 host_list based structure level 1 dcl 1-27 host_list_ptr automatic pointer dcl 1-24 host_table_mgr_$address 000000 constant entry external dcl 1-3 host_table_mgr_$host_list 000000 constant entry external dcl 1-4 host_table_mgr_$name_given_address 000000 constant entry external dcl 1-5 host_table_mgr_$net_list 000000 constant entry external dcl 1-6 host_table_mgr_$shortest_name 000000 constant entry external dcl 1-8 n_hosts automatic fixed bin(17,0) dcl 1-25 n_nets automatic fixed bin(17,0) dcl 1-14 n_services automatic fixed bin(17,0) dcl 1-33 net_list based structure level 1 dcl 1-16 net_list_ptr automatic pointer dcl 1-13 NAMES DECLARED BY EXPLICIT CONTEXT. COMPARE_LITERAL_SYSTEM_NAMES 000657 constant label dcl 121 ref 119 RETURN_FROM_CANONICALIZE 002175 constant label dcl 196 ref 174 182 188 RETURN_INPUT_NAME 000244 constant label dcl 103 ref 101 RETURN_ISM_NOT_AVAILABLE 001506 constant label dcl 223 ref 220 canonicalize 001736 constant entry internal dcl 158 ref 107 107 152 canonicalize_system_name 001315 constant entry external dcl 149 compare_system_names 000615 constant entry external dcl 116 ref 144 get_fully_qualified_name 000201 constant entry external dcl 98 get_local_system_name 000067 constant entry external dcl 86 is_local_system 001166 constant entry external dcl 138 is_mail_supported 001377 constant entry external dcl 209 mlsys_nit_interface_ 000044 constant entry external dcl 36 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 2774 3034 2455 3004 Length 3302 2455 40 232 317 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME mlsys_nit_interface_ 616 external procedure is an external procedure. on unit on line 101 64 on unit on unit on line 119 64 on unit canonicalize 422 internal procedure is called during a stack extension. on unit on line 220 64 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME canonicalize 000100 canonical_name canonicalize 000201 reversed_name canonicalize 000302 reversed_local_name canonicalize 000403 next_component canonicalize 000504 canonicalized_form canonicalize 000605 end_point canonicalize 000606 continue canonicalize mlsys_nit_interface_ 000100 system_name mlsys_nit_interface_ 000201 relay_system mlsys_nit_interface_ 000310 junk mlsys_nit_interface_ 000312 service_list_ptr mlsys_nit_interface_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. r_e_as alloc_char_temp call_ext_in call_ext_out_desc call_ext_out call_int_this_desc return_mac tra_ext_1 signal_op enable_op shorten_stack ext_entry int_entry int_entry_desc reverse_cs set_chars_eis any_to_any_truncate_op_freen_ THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. host_name_$local_compare host_name_$local_valid_destination host_name_$qualify_local host_table_mgr_$primary_name mlsys_psp_$domains_available mlsys_psp_$ism_not_available nit_$get_forwarding_host nit_$get_service_list THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. mlsys_et_$ism_not_available mlsys_et_$no_mail_service mlsys_et_$unknown_system nit_data_$local_host LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 36 000043 39 000053 86 000064 89 000101 92 000130 98 000175 101 000213 103 000232 107 000311 111 000427 112 000530 116 000611 119 000626 121 000645 126 000733 130 001004 133 001074 138 001162 141 001177 144 001244 149 001313 152 001327 209 001373 214 001406 215 001420 216 001423 217 001443 220 001455 222 001474 223 001506 225 001512 228 001524 230 001547 231 001601 233 001634 235 001661 236 001665 237 001673 238 001702 239 001703 241 001704 244 001720 246 001723 158 001735 171 001751 172 001771 174 001774 177 002005 178 002021 179 002044 181 002047 182 002052 183 002072 184 002110 185 002124 186 002130 187 002131 188 002135 190 002136 191 002161 192 002172 193 002173 194 002174 196 002175 199 002205 203 002245 ----------------------------------------------------------- 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