1 /* 2 * Copyright (c) 1989 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Bill Jolitz. 7 * 8 * Redistribution and use in source and binary forms are permitted 9 * provided that the above copyright notice and this paragraph are 10 * duplicated in all such forms and that any documentation, 11 * advertising materials, and other materials related to such 12 * distribution and use acknowledge that the software was developed 13 * by the University of California, Berkeley. The name of the 14 * University may not be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 19 * 20 * @(#)phonenumber.h 5.1 (Berkeley) 05/16/89 21 */ 22 23 /* 24 * Telephone number address processing 25 */ 26 27 /* 28 * Structures returned by network 29 * data base library. 30 */ 31 struct phonenumberent { 32 char *pn_name; /* directory listing name */ 33 char **pn_aliases; /* alias list */ 34 int pn_length; /* length of phone number address */ 35 char **pn_addr_list; /* list of addresses from name server */ 36 struct pn_addr *pn_addrtype; /* list of phone number address types */ 37 }; 38 39 struct pn_addrtype { 40 u_char pn_tos ; /* type of service */ 41 # define PNT_POTS 0 /* plain ordinary telephone service */ 42 # define PNT_ISDN 1 /* Integrated Services Digital Network*/ 43 int pn_tnplan ; /* type of numbering plan */ 44 # define PNAT_INTL 0x21 /* International number */ 45 # define PNAT_NATNL 0x41 /* National number */ 46 # define PNAT_LOCAL 0x81 /* Local(directory) number */ 47 } ; 48 49 struct phonenumberent *getphonenumberbyname(), *getnamebyphonenumber(), 50 *getphonenumberent(); 51 52 /* 53 * Error return codes from getphonenumberbyname() and getnamebyphonenumber() 54 */ 55 56 extern int pn_errno; 57 58 #define ENTRY_NOT_FOUND 1 /* Authoritive Answer Host not found */ 59 #define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */ 60 #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ 61 #define NO_ADDRESS 4 /* Valid host name, no address, look for MX record */ 62