hdlc.h revision 6059
16059Samurai/*
26059Samurai *	    Written by Toshiharu OHNO (tony-o@iij.ad.jp)
36059Samurai *
46059Samurai *   Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
56059Samurai *
66059Samurai * Redistribution and use in source and binary forms are permitted
76059Samurai * provided that the above copyright notice and this paragraph are
86059Samurai * duplicated in all such forms and that any documentation,
96059Samurai * advertising materials, and other materials related to such
106059Samurai * distribution and use acknowledge that the software was developed
116059Samurai * by the Internet Initiative Japan.  The name of the
126059Samurai * IIJ may not be used to endorse or promote products derived
136059Samurai * from this software without specific prior written permission.
146059Samurai * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
156059Samurai * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
166059Samurai * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
176059Samurai *
186059Samurai * $Id:$
196059Samurai *
206059Samurai *	TODO:
216059Samurai */
226059Samurai
236059Samurai#ifndef _HDLC_H_
246059Samurai#define _HDLC_H_
256059Samurai
266059Samurai/*
276059Samurai *  Definition for Async HDLC
286059Samurai */
296059Samurai#define HDLC_SYN 0x7e	/* SYNC character */
306059Samurai#define HDLC_ESC 0x7d	/* Escape character */
316059Samurai#define HDLC_XOR 0x20	/* Modifier value */
326059Samurai
336059Samurai#define	HDLC_ADDR 0xff
346059Samurai#define	HDLC_UI	  0x03
356059Samurai/*
366059Samurai *  Definition for HDLC Frame Check Sequence
376059Samurai */
386059Samurai#define INITFCS 0xffff	/* Initial value for FCS computation */
396059Samurai#define GOODFCS 0xf0b8	/* Good FCS value */
406059Samurai
416059Samurai#define	DEF_MRU		1500
426059Samurai#define	MAX_MRU		2000
436059Samurai#define	MIN_MRU		296
446059Samurai
456059Samurai/*
466059Samurai *  Output priority
476059Samurai */
486059Samurai#define	PRI_NORMAL	0	/* Normal priority */
496059Samurai#define	PRI_FAST	1	/* Fast (interructive) */
506059Samurai#define	PRI_URGENT	2	/* Urgent (LQR packets) */
516059Samurai
526059Samuraiunsigned char EscMap[33];
536059Samurai
546059Samuraivoid HdlcInput(struct mbuf *bp);
556059Samuraivoid HdlcOutput(int pri, u_short proto, struct mbuf *bp);
566059Samuraivoid AsyncOutput(int pri, struct mbuf *bp, int proto);
576059Samurai
586059Samurai#endif
59