hdlc.h revision 26326
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 *
1826326Sbrian * $Id: hdlc.h,v 1.6 1997/02/22 16:10:17 peter Exp $
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
4226326Sbrian#define	MAX_MRU		16384
436059Samurai#define	MIN_MRU		296
446059Samurai
4526326Sbrian#define	DEF_MTU		0	/* whatever peer says */
4626326Sbrian#define	MAX_MTU		16384
4726326Sbrian#define	MIN_MTU		296
4826326Sbrian
496059Samurai/*
506059Samurai *  Output priority
516059Samurai */
5213733Sdfr/* PRI_NORMAL and PRI_FAST have meaning only on the IP queue.
5313733Sdfr * All IP frames have the same priority once they are compressed.
5413733Sdfr * IP frames stay on the IP queue till they can be sent on the
5513733Sdfr * link. They are compressed at that time.
5613733Sdfr*/
576059Samurai#define	PRI_NORMAL	0	/* Normal priority */
5813733Sdfr#define	PRI_FAST	1	/* Fast (interractive) */
5913733Sdfr#define	PRI_LINK	1	/* Urgent (LQR packets) */
606059Samurai
616059Samuraiunsigned char EscMap[33];
626059Samurai
636735Samuraivoid HdlcInit __P((void));
6413389Sphkvoid HdlcErrorCheck __P((void));
656735Samuraivoid HdlcInput __P((struct mbuf *bp));
666735Samuraivoid HdlcOutput __P((int pri, u_short proto, struct mbuf *bp));
676735Samuraivoid AsyncOutput __P((int pri, struct mbuf *bp, int proto));
6813389Sphku_short HdlcFcs __P((u_short, u_char *, int));
6913389Sphkvoid DecodePacket __P((u_short, struct mbuf *));
706059Samurai#endif
71