1*ed01bec7Sbostic /*- 2*ed01bec7Sbostic * Copyright (c) 1993 The Regents of the University of California. 3022ef0b8Sbostic * All rights reserved. 4022ef0b8Sbostic * 5022ef0b8Sbostic * This code is derived from software contributed to Berkeley by 6022ef0b8Sbostic * Bill Jolitz. 7022ef0b8Sbostic * 8*ed01bec7Sbostic * %sccs.include.redist.c% 9022ef0b8Sbostic * 10*ed01bec7Sbostic * @(#)phonenumber.h 5.2 (Berkeley) 05/29/93 11022ef0b8Sbostic */ 12022ef0b8Sbostic 13022ef0b8Sbostic /* 14022ef0b8Sbostic * Telephone number address processing 15022ef0b8Sbostic */ 16022ef0b8Sbostic 17022ef0b8Sbostic /* 18022ef0b8Sbostic * Structures returned by network 19022ef0b8Sbostic * data base library. 20022ef0b8Sbostic */ 21022ef0b8Sbostic struct phonenumberent { 22022ef0b8Sbostic char *pn_name; /* directory listing name */ 23022ef0b8Sbostic char **pn_aliases; /* alias list */ 24022ef0b8Sbostic int pn_length; /* length of phone number address */ 25022ef0b8Sbostic char **pn_addr_list; /* list of addresses from name server */ 26022ef0b8Sbostic struct pn_addr *pn_addrtype; /* list of phone number address types */ 27022ef0b8Sbostic }; 28022ef0b8Sbostic 29022ef0b8Sbostic struct pn_addrtype { 30022ef0b8Sbostic u_char pn_tos ; /* type of service */ 31022ef0b8Sbostic # define PNT_POTS 0 /* plain ordinary telephone service */ 32022ef0b8Sbostic # define PNT_ISDN 1 /* Integrated Services Digital Network*/ 33022ef0b8Sbostic int pn_tnplan ; /* type of numbering plan */ 34022ef0b8Sbostic # define PNAT_INTL 0x21 /* International number */ 35022ef0b8Sbostic # define PNAT_NATNL 0x41 /* National number */ 36022ef0b8Sbostic # define PNAT_LOCAL 0x81 /* Local(directory) number */ 37022ef0b8Sbostic } ; 38022ef0b8Sbostic 39022ef0b8Sbostic struct phonenumberent *getphonenumberbyname(), *getnamebyphonenumber(), 40022ef0b8Sbostic *getphonenumberent(); 41022ef0b8Sbostic 42022ef0b8Sbostic /* 43022ef0b8Sbostic * Error return codes from getphonenumberbyname() and getnamebyphonenumber() 44022ef0b8Sbostic */ 45022ef0b8Sbostic 46022ef0b8Sbostic extern int pn_errno; 47022ef0b8Sbostic 48022ef0b8Sbostic #define ENTRY_NOT_FOUND 1 /* Authoritive Answer Host not found */ 49022ef0b8Sbostic #define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */ 50022ef0b8Sbostic #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ 51022ef0b8Sbostic #define NO_ADDRESS 4 /* Valid host name, no address, look for MX record */ 52