tmstruct.h revision 9521:b061a79d3d1a
1258945Sroberto/* 2258945Sroberto * CDDL HEADER START 3258945Sroberto * 4258945Sroberto * The contents of this file are subject to the terms of the 5258945Sroberto * Common Development and Distribution License, Version 1.0 only 6258945Sroberto * (the "License"). You may not use this file except in compliance 7258945Sroberto * with the License. 8258945Sroberto * 9258945Sroberto * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10258945Sroberto * or http://www.opensolaris.org/os/licensing. 11258945Sroberto * See the License for the specific language governing permissions 12258945Sroberto * and limitations under the License. 13258945Sroberto * 14258945Sroberto * When distributing Covered Code, include this CDDL HEADER in each 15258945Sroberto * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16258945Sroberto * If applicable, add the following below this CDDL HEADER, with the 17258945Sroberto * fields enclosed by brackets "[]" replaced with your own identifying 18258945Sroberto * information: Portions Copyright [yyyy] [name of copyright owner] 19258945Sroberto * 20258945Sroberto * CDDL HEADER END 21258945Sroberto */ 22258945Sroberto/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 23258945Sroberto/* All Rights Reserved */ 24258945Sroberto 25258945Sroberto 26258945Sroberto#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.4 */ 27258945Sroberto 28258945Sroberto/* 29258945Sroberto * /etc/ttydefs structure 30258945Sroberto */ 31258945Srobertostruct Gdef { 32258945Sroberto char *g_id; /* id for modes & speeds */ 33 char *g_iflags; /* initial terminal flags */ 34 char *g_fflags; /* final terminal flags */ 35 short g_autobaud; /* autobaud indicator */ 36 char *g_nextid; /* next id if this speed is wrong */ 37}; 38 39/* 40 * pmtab structure + internal data for ttymon 41 */ 42struct pmtab { 43 /* the following fields are from pmtab */ 44 char *p_tag; /* port/service tag */ 45 long p_flags; /* flags */ 46 char *p_identity; /* id for service to run as */ 47 char *p_res1; /* reserved field */ 48 char *p_res2; /* reserved field */ 49 char *p_res3; /* reserved field */ 50 char *p_device; /* full path name of device */ 51 long p_ttyflags; /* ttyflags */ 52 int p_count; /* wait_read count */ 53 char *p_server; /* full service cmd line */ 54 int p_timeout; /* timeout for input */ 55 char *p_ttylabel; /* ttylabel in /etc/ttydefs */ 56 char *p_modules; /* modules to push */ 57 char *p_prompt; /* prompt message */ 58 char *p_dmsg; /* disable message */ 59 char *p_termtype; /* terminal type */ 60 char *p_softcar; /* use softcarrier */ 61 62 /* the following fields are for ttymon internal use */ 63 int p_status; /* status of entry */ 64 int p_fd; /* fd for the open device */ 65 pid_t p_pid; /* pid of child on the device */ 66 int p_inservice; /* service invoked */ 67 int p_respawn; /* respawn count in this series */ 68 long p_time; /* start time of a series */ 69 uid_t p_uid; /* uid of p_identity */ 70 gid_t p_gid; /* gid of p_identity */ 71 char *p_dir; /* home dir of p_identity */ 72 struct pmtab *p_next; 73}; 74 75/* 76 * valid flags for p_flags field of pmtab 77 */ 78#define X_FLAG 0x1 /* port/service disabled */ 79#define U_FLAG 0x2 /* create utmp entry for the service */ 80 81/* 82 * valid flags for p_ttyflags field of pmtab 83 */ 84#define C_FLAG 0x1 /* invoke service on carrier */ 85#define H_FLAG 0x2 /* hangup the line */ 86#define B_FLAG 0x4 /* bi-directional line */ 87#define R_FLAG 0x8 /* do wait_read */ 88#define I_FLAG 0x10 /* initialize only */ 89 90/* 91 * autobaud enabled flag 92 */ 93#define A_FLAG 0x20 /* autobaud flag */ 94 95/* 96 * values for p_status field of pmtab 97 */ 98#define NOTVALID 0 /* entry is not valid */ 99#define VALID 1 /* entry is valid */ 100#define CHANGED 2 /* entry is valid but changed */ 101#define GETTY 3 /* entry is for ttymon express */ 102 103#define ALLOC_PMTAB \ 104 ((struct pmtab *)calloc((unsigned)1, \ 105 (unsigned)sizeof(struct pmtab))) 106 107#define PNULL ((struct pmtab *)NULL) 108