xref: /illumos-gate/usr/src/cmd/mailx/hdr/configdefs.h (revision b30d193948be5a7794d7ae3ba0ed9c2f72c88e0f)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 
26 /*
27  * University Copyright- Copyright (c) 1982, 1986, 1988
28  * The Regents of the University of California
29  * All Rights Reserved
30  *
31  * University Acknowledgment- Portions of this document are derived from
32  * software developed by the University of California, Berkeley, and its
33  * contributors.
34  */
35 
36 #pragma ident	"%Z%%M%	%I%	%E% SMI"
37 
38 /*
39  * mailx -- a modified version of a University of California at Berkeley
40  *	mail program
41  *
42  * This file contains the definitions of data structures used in
43  * configuring the network behavior of Mail when replying.
44  */
45 
46 /*
47  * The following constants are used when you are running 4.1a bsd or
48  * later on a local network.  The name thus found is inserted
49  * into the host table slot whose name was originally EMPTY.
50  */
51 #define	EMPTY		"** empty **"
52 #define	EMPTYID		'E'
53 
54 /*
55  * The following data structure is the host table.  You must have
56  * an entry here for your own machine, plus any special stuff you
57  * expect the mailer to know about.  Not all hosts need be here, however:
58  * mailx can dope out stuff about hosts on the fly by looking
59  * at addresses.  The machines needed here are:
60  *	1) The local machine
61  *	2) Any machines on the path to a network gateway
62  *	3) Any machines with nicknames that you want to have considered
63  *	   the same.
64  * The machine id letters can be anything you like and are not seen
65  * externally.  Be sure not to use characters with the 0200 bit set --
66  * these have special meanings.
67  */
68 struct netmach {
69 	char	*nt_machine;
70 	char	nt_mid;
71 	short	nt_type;
72 };
73 
74 /*
75  * Network type codes.  Basically, there is one for each different
76  * network, if the network can be discerned by the separator character,
77  * such as @ for the arpa net.  The purpose of these codes is to
78  * coalesce cases where more than one character means the same thing,
79  * such as % and @ for the arpanet.  Also, the host table uses a
80  * bit map of these codes to show what it is connected to.
81  * BN -- connected to Bell Net.
82  * AN -- connected to ARPA net, SN -- connected to Schmidt net.
83  */
84 #define	AN	1			/* Connected to ARPA net */
85 #define	BN	2			/* Connected to BTL net */
86 #define	SN	4			/* Connected to Schmidt net */
87 
88 /*
89  * Data structure for table mapping network characters to network types.
90  */
91 struct ntypetab {
92 	char	nt_char;		/* Actual character separator */
93 	int	nt_bcode;		/* Type bit code */
94 };
95 
96 /*
97  * Codes for the "kind" of a network.  IMPLICIT means that if there are
98  * physically several machines on the path, one does not list them in the
99  * address.  The arpa net is like this.  EXPLICIT means you list them,
100  * as in UUCP.
101  * By the way, this distinction means we lose if anyone actually uses the
102  * arpa net subhost convention: name@subhost@arpahost
103  */
104 #define	IMPLICIT	1
105 #define	EXPLICIT	2
106 
107 /*
108  * Table for mapping a network code to its type -- IMPLICIT routing or
109  * IMPLICIT routing.
110  */
111 struct nkindtab {
112 	int	nk_type;		/* Its bit code */
113 	int	nk_kind;		/* Whether explicit or implicit */
114 };
115 
116 /*
117  * The following table gives the order of preference of the various
118  * networks.  Thus, if we have a choice of how to get somewhere, we
119  * take the preferred route.
120  */
121 struct netorder {
122 	short	no_stat;
123 	char	no_char;
124 };
125 
126 /*
127  * External declarations for above defined tables.
128  */
129 extern struct netmach netmach[];
130 extern struct ntypetab ntypetab[];
131 extern struct nkindtab nkindtab[];
132 extern struct netorder netorder[];
133 extern char *metanet;
134