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
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.
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]
26 * Copyright (c) 1998 by Sun Microsystems, Inc.
27 * All rights reserved.
30 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
31 /* All Rights Reserved */
33 #pragma ident "%Z%%M% %I% %E% SMI"
36 # include <sys/types.h>
42 typedef struct strbuf strbuf_t; /* STREAMS buffer */
52 short type; /* type of connection */
53 int readfd; /* STREAM fd to read from */
54 int writefd; /* STREAM fd to write to */
55 int wait; /* number of systems waiting for */
56 char *file; /* pipe name if type==MD_FIFO */
57 short state; /* Current state of client */
58 short admin; /* Non zero if admin */
59 short event; /* Event returned from poll */
60 MQUE * mque; /* backlogged message ptr */
61 uid_t uid; /* Clients UID */
62 gid_t gid; /* Clients GID */
63 void (**on_discon)(); /* Clean up functions */
75 MESG * mcreate ( char * );
76 int mlisteninit ( MESG * );
77 MESG * mlisten ( void );
78 int mlistenadd ( MESG *, short );
79 int mon_discon ( MESG *, void (*)());
80 MESG * mlistenreset ( void );
81 int mdestroy ( MESG * );
83 MESG * mconnect ( char *, int, int );
84 int mgetm ( MESG *, int, ... );
85 int mwrite ( MESG *, char * );
86 int mputm ( MESG *, int, ... );
87 int mread ( MESG *, char *, int );
88 short msize ( char * );
89 short mpeek ( MESG * );
90 int mdisconnect ( MESG * );
92 void __mbfree ( void );
97 int mrecv ( char *, int );
100 int Putmsg (MESG *, strbuf_t *, strbuf_t *, int);
101 int Getmsg (MESG *, strbuf_t *, strbuf_t *, int *);
102 int read3_2 (MESG * md, char *msgbuf, int size);
103 int write3_2 (MESG *, char *, int);
104 int read_fifo (int, char *, unsigned int);
105 int write_fifo (int, char *, unsigned int);
106 int ResetFifoBuffer (int);
107 fifobuffer_t *GetFifoBuffer (int);
109 char * htos ( char *, unsigned short );
110 char * ltos ( char *, unsigned long );
111 unsigned long stol ( char * );
112 unsigned short stoh ( char * );
113 int _getmessage ( char *, short, va_list );
114 int _putmessage ( char *, short, va_list );
115 int getmessage ( char *, short, ... );
116 int putmessage ( char *, short, ... );