/*
 * Header file for SunOS 4.0 streams SLIP module
 *
 * Copyright 1988 by Rayan Zachariassen
 *
 * You may do anything with this file except put your own
 * copyright on it or change or remove this copyright notice.
 */

#ifndef	_sys_slip_h
#define	_sys_slip_h

/*
 * To compensate for lack of M_HANGUP on dialout lines, we use M_UNHANGUP
 * as symptom of a possible carrier change, and generate a signal whenever
 * an M_UNHANGUP passes by so the application can check for DCD.  This is
 * a workaround that should go away when M_HANGUP is generated on dialouts.
 */

#include <sys/signal.h>

/* signal to send application on stream device non-hangup DCD change */
#define	SIGDCD		SIGUSR1


#define	SLIPIFNAME	"slip"		/* base name of network interface */

#define	SLIOGUNIT	_IOR(t, 62, int)		/* get SLIP unit no. */
#define	SLIOGSTATS	_IOR(t, 63, struct slipstat)	/* get statistics */
#define	SLIOSFLAGS	_IOW(t, 64, int)		/* set flags */

struct slipstat {
	u_int		sl_ibytes;	/* total number of data bytes in */
	u_int		sl_ipackets;	/* total number of data packets in */
	u_int		sl_ierrors;	/* total number of input errors */
	u_int		sl_obytes;	/* total number of data bytes out */
	u_int		sl_opackets;	/* total number of data packets out */
	u_int		sl_oerrors;	/* total number of output errors */
};

/* end of what the user-level process should care about */

/* See RFC1055 for the origin of the following magic numbers */

#define SLIPMAX		1006	/* this is the largest packet we'll accept */
#define SLIPMTU		552	/* this is the largest packet we'll send
				 * (the IP-level MTU) */

#define	END	0300		/* a frame just finished */
#define	ESC	0333		/* introduces an escape sequence */
#define	ESC_END	0334		/* the data contained an END */
#define	ESC_ESC	0335		/* the data contained an ESC */

#endif	/* !_sys_slip_h */
