1 /*-
2  * Copyright (c) 1993 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  * %sccs.include.redist.c%
9  *
10  *	@(#)phonenumber.h	5.2 (Berkeley) 05/29/93
11  */
12 
13 /*
14  * Telephone number address processing
15  */
16 
17 /*
18  * Structures returned by network
19  * data base library.
20  */
21 struct	phonenumberent {
22 	char	*pn_name;	/* directory listing name */
23 	char	**pn_aliases;	/* alias list */
24 	int	pn_length;	/* length of phone number address */
25 	char	**pn_addr_list;	/* list of addresses from name server */
26 	struct	pn_addr	*pn_addrtype;	/* list of phone number address types */
27 };
28 
29 struct pn_addrtype {
30 	u_char	pn_tos ;	/* type of service */
31 # define	PNT_POTS	0	/* plain ordinary telephone service */
32 # define	PNT_ISDN	1	/* Integrated Services Digital Network*/
33 	int	pn_tnplan ;	/* type of numbering plan */
34 # define	PNAT_INTL	0x21	/* International number */
35 # define	PNAT_NATNL	0x41	/* National number */
36 # define	PNAT_LOCAL	0x81	/* Local(directory) number */
37 } ;
38 
39 struct phonenumberent	*getphonenumberbyname(), *getnamebyphonenumber(),
40 			*getphonenumberent();
41 
42 /*
43  * Error return codes from getphonenumberbyname() and getnamebyphonenumber()
44  */
45 
46 extern  int pn_errno;
47 
48 #define	ENTRY_NOT_FOUND	1 /* Authoritive Answer Host not found */
49 #define	TRY_AGAIN	2 /* Non-Authoritive Host not found, or SERVERFAIL */
50 #define	NO_RECOVERY	3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
51 #define NO_ADDRESS	4 /* Valid host name, no address, look for MX record */
52