3 * hosts.c -- use MMDF to get hostname information
8 #include "../../h/strings.h"
17 #include "../../zotnet/mts.h"
20 * We really should be careful with the number of fd's that this routine
21 * opens: the ch_seq ch_table.c module likes to keep 6 (yes, SIX) fds around
22 * to speed-up host lookups in the channel table. Unfortunately, after all
23 * of them get opened, six are always open (ch_table may close one to open
24 * another). The bottom line is that if repl calls post, then we get 12
25 * (yes, TWELVE) fds open, with only six usable.
27 * send will close all fds >= 3 prior to invoking post. It would be nice
28 * if one could control ch_seq's use of fds for table lookups, but such is
35 OfficialName (char *name)
38 static char buffer[BUFSIZ];
40 return ((ch = ch_h2chan (name, buffer)) == (Chan *) (-1) ? NULL
41 : ch == (Chan *) NULL ? LocalName ()
46 extern char *invo_name;
48 extern short ch_yloc; /* ok to intercept local names */
50 static int inited = 0;
53 OfficialName (char *name)
56 static char buffer[BUFSIZ];
59 mmdf_init (invo_name);
62 switch (dm_v2route (name, buffer, &route)) {
65 return ((ch_yloc && lexequ (name, LocalName ())) ? LocalName ()