xref: /illumos-gate/usr/src/cmd/mailx/hdr/configdefs.h (revision 9164a50bf932130cbb5097a16f6986873ce0e6e5)
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 /*
37  * mailx -- a modified version of a University of California at Berkeley
38  *	mail program
39  *
40  * This file contains the definitions of data structures used in
41  * configuring the network behavior of Mail when replying.
42  */
43 
44 /*
45  * The following constants are used when you are running 4.1a bsd or
46  * later on a local network.  The name thus found is inserted
47  * into the host table slot whose name was originally EMPTY.
48  */
49 #define	EMPTY		"** empty **"
50 #define	EMPTYID		'E'
51 
52 /*
53  * The following data structure is the host table.  You must have
54  * an entry here for your own machine, plus any special stuff you
55  * expect the mailer to know about.  Not all hosts need be here, however:
56  * mailx can dope out stuff about hosts on the fly by looking
57  * at addresses.  The machines needed here are:
58  *	1) The local machine
59  *	2) Any machines on the path to a network gateway
60  *	3) Any machines with nicknames that you want to have considered
61  *	   the same.
62  * The machine id letters can be anything you like and are not seen
63  * externally.  Be sure not to use characters with the 0200 bit set --
64  * these have special meanings.
65  */
66 struct netmach {
67 	char	*nt_machine;
68 	char	nt_mid;
69 	short	nt_type;
70 };
71 
72 /*
73  * Network type codes.  Basically, there is one for each different
74  * network, if the network can be discerned by the separator character,
75  * such as @ for the arpa net.  The purpose of these codes is to
76  * coalesce cases where more than one character means the same thing,
77  * such as % and @ for the arpanet.  Also, the host table uses a
78  * bit map of these codes to show what it is connected to.
79  * BN -- connected to Bell Net.
80  * AN -- connected to ARPA net, SN -- connected to Schmidt net.
81  */
82 #define	AN	1			/* Connected to ARPA net */
83 #define	BN	2			/* Connected to BTL net */
84 #define	SN	4			/* Connected to Schmidt net */
85 
86 /*
87  * Data structure for table mapping network characters to network types.
88  */
89 struct ntypetab {
90 	char	nt_char;		/* Actual character separator */
91 	int	nt_bcode;		/* Type bit code */
92 };
93 
94 /*
95  * Codes for the "kind" of a network.  IMPLICIT means that if there are
96  * physically several machines on the path, one does not list them in the
97  * address.  The arpa net is like this.  EXPLICIT means you list them,
98  * as in UUCP.
99  * By the way, this distinction means we lose if anyone actually uses the
100  * arpa net subhost convention: name@subhost@arpahost
101  */
102 #define	IMPLICIT	1
103 #define	EXPLICIT	2
104 
105 /*
106  * Table for mapping a network code to its type -- IMPLICIT routing or
107  * IMPLICIT routing.
108  */
109 struct nkindtab {
110 	int	nk_type;		/* Its bit code */
111 	int	nk_kind;		/* Whether explicit or implicit */
112 };
113 
114 /*
115  * The following table gives the order of preference of the various
116  * networks.  Thus, if we have a choice of how to get somewhere, we
117  * take the preferred route.
118  */
119 struct netorder {
120 	short	no_stat;
121 	char	no_char;
122 };
123 
124 /*
125  * External declarations for above defined tables.
126  */
127 extern struct netmach netmach[];
128 extern struct ntypetab ntypetab[];
129 extern struct nkindtab nkindtab[];
130 extern struct netorder netorder[];
131 extern char *metanet;
132