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