summaryrefslogtreecommitdiff
path: root/usr/src/cmd/ttymon/tmstruct.h
diff options
context:
space:
mode:
authorstevel@tonic-gate <none@none>2005-06-14 00:00:00 -0700
committerstevel@tonic-gate <none@none>2005-06-14 00:00:00 -0700
commit7c478bd95313f5f23a4c958a745db2134aa03244 (patch)
treec871e58545497667cbb4b0a4f2daf204743e1fe7 /usr/src/cmd/ttymon/tmstruct.h
downloadillumos-joyent-7c478bd95313f5f23a4c958a745db2134aa03244.tar.gz
OpenSolaris Launch
Diffstat (limited to 'usr/src/cmd/ttymon/tmstruct.h')
-rw-r--r--usr/src/cmd/ttymon/tmstruct.h107
1 files changed, 107 insertions, 0 deletions
diff --git a/usr/src/cmd/ttymon/tmstruct.h b/usr/src/cmd/ttymon/tmstruct.h
new file mode 100644
index 0000000000..1598de05a1
--- /dev/null
+++ b/usr/src/cmd/ttymon/tmstruct.h
@@ -0,0 +1,107 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
+/* All Rights Reserved */
+
+
+#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.4 */
+
+/*
+ * /etc/ttydefs structure
+ */
+struct Gdef {
+ char *g_id; /* id for modes & speeds */
+ char *g_iflags; /* initial terminal flags */
+ char *g_fflags; /* final terminal flags */
+ short g_autobaud; /* autobaud indicator */
+ char *g_nextid; /* next id if this speed is wrong */
+};
+
+/*
+ * pmtab structure + internal data for ttymon
+ */
+struct pmtab {
+ /* the following fields are from pmtab */
+ char *p_tag; /* port/service tag */
+ long p_flags; /* flags */
+ char *p_identity; /* id for service to run as */
+ char *p_res1; /* reserved field */
+ char *p_res2; /* reserved field */
+ char *p_res3; /* reserved field */
+ char *p_device; /* full path name of device */
+ long p_ttyflags; /* ttyflags */
+ int p_count; /* wait_read count */
+ char *p_server; /* full service cmd line */
+ int p_timeout; /* timeout for input */
+ char *p_ttylabel; /* ttylabel in /etc/ttydefs */
+ char *p_modules; /* modules to push */
+ char *p_prompt; /* prompt message */
+ char *p_dmsg; /* disable message */
+ char *p_termtype; /* terminal type */
+ char *p_softcar; /* use softcarrier */
+
+ /* the following fields are for ttymon internal use */
+ int p_status; /* status of entry */
+ int p_fd; /* fd for the open device */
+ pid_t p_pid; /* pid of child on the device */
+ int p_inservice; /* service invoked */
+ int p_respawn; /* respawn count in this series */
+ long p_time; /* start time of a series */
+ uid_t p_uid; /* uid of p_identity */
+ gid_t p_gid; /* gid of p_identity */
+ char *p_dir; /* home dir of p_identity */
+ struct pmtab *p_next;
+};
+
+/*
+ * valid flags for p_flags field of pmtab
+ */
+#define X_FLAG 0x1 /* port/service disabled */
+#define U_FLAG 0x2 /* create utmp entry for the service */
+
+/*
+ * valid flags for p_ttyflags field of pmtab
+ */
+#define C_FLAG 0x1 /* invoke service on carrier */
+#define H_FLAG 0x2 /* hangup the line */
+#define B_FLAG 0x4 /* bi-directional line */
+#define R_FLAG 0x8 /* do wait_read */
+#define I_FLAG 0x10 /* initialize only */
+
+/*
+ * autobaud enabled flag
+ */
+#define A_FLAG 0x20 /* autobaud flag */
+
+/*
+ * values for p_status field of pmtab
+ */
+#define NOTVALID 0 /* entry is not valid */
+#define VALID 1 /* entry is valid */
+#define CHANGED 2 /* entry is valid but changed */
+#define GETTY 3 /* entry is for ttymon express */
+
+#define ALLOC_PMTAB \
+ ((struct pmtab *)calloc((unsigned)1, \
+ (unsigned)sizeof(struct pmtab)))
+
+#define PNULL ((struct pmtab *)NULL)