1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * Copyright 1999-2002 Sun Microsystems, Inc.  All rights reserved.
3*0Sstevel@tonic-gate  * Use is subject to license terms.
4*0Sstevel@tonic-gate  */
5*0Sstevel@tonic-gate 
6*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
7*0Sstevel@tonic-gate 
8*0Sstevel@tonic-gate struct ctl_buf {
9*0Sstevel@tonic-gate 	char *			text;
10*0Sstevel@tonic-gate 	size_t			used;
11*0Sstevel@tonic-gate };
12*0Sstevel@tonic-gate 
13*0Sstevel@tonic-gate #define	MAX_LINELEN		990	/* Like SMTP. */
14*0Sstevel@tonic-gate #ifndef NO_SOCKADDR_UN
15*0Sstevel@tonic-gate #define MAX_NTOP			PATH_MAX
16*0Sstevel@tonic-gate #else
17*0Sstevel@tonic-gate #define	MAX_NTOP		(sizeof "[255.255.255.255].65535")
18*0Sstevel@tonic-gate #endif
19*0Sstevel@tonic-gate 
20*0Sstevel@tonic-gate #define	allocated_p(Buf) ((Buf).text != NULL)
21*0Sstevel@tonic-gate #define	buffer_init(Buf) ((Buf).text = 0, (Buf.used) = 0)
22*0Sstevel@tonic-gate 
23*0Sstevel@tonic-gate #define	ctl_bufget	__ctl_bufget
24*0Sstevel@tonic-gate #define	ctl_bufput	__ctl_bufput
25*0Sstevel@tonic-gate #define	ctl_sa_ntop	__ctl_sa_ntop
26*0Sstevel@tonic-gate #define	ctl_sa_copy	__ctl_sa_copy
27*0Sstevel@tonic-gate 
28*0Sstevel@tonic-gate int			ctl_bufget(struct ctl_buf *, ctl_logfunc);
29*0Sstevel@tonic-gate void			ctl_bufput(struct ctl_buf *);
30*0Sstevel@tonic-gate const char *		ctl_sa_ntop(const struct sockaddr *, char *, size_t,
31*0Sstevel@tonic-gate 				    ctl_logfunc);
32*0Sstevel@tonic-gate void			ctl_sa_copy(const struct sockaddr *,
33*0Sstevel@tonic-gate 				    struct sockaddr *);
34