Home | History | Annotate | Line # | Download | only in net
if_sppp.h revision 1.2
      1 /*	$NetBSD: if_sppp.h,v 1.2 1999/03/25 05:25:42 explorer Exp $	*/
      2 
      3 /*
      4  * Defines for synchronous PPP/Cisco link level subroutines.
      5  *
      6  * Copyright (C) 1994 Cronyx Ltd.
      7  * Author: Serge Vakulenko, <vak (at) zebub.msk.su>
      8  *
      9  * This software is distributed with NO WARRANTIES, not even the implied
     10  * warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     11  *
     12  * Authors grant any other persons or organizations permission to use
     13  * or modify this software as long as this message is kept with the software,
     14  * all derivative works or modified versions.
     15  *
     16  * Version 1.7, Wed Jun  7 22:12:02 MSD 1995
     17  */
     18 
     19 #ifndef _NET_IF_HDLC_H_
     20 #define _NET_IF_HDLC_H_ 1
     21 
     22 struct slcp {
     23 	u_int16_t state;          /* state machine */
     24 	u_int32_t magic;          /* local magic number */
     25 	u_int8_t  echoid;         /* id of last keepalive echo request */
     26 	u_int8_t  confid;         /* id of last configuration request */
     27 };
     28 
     29 struct sipcp {
     30 	u_int16_t state;          /* state machine */
     31 	u_int8_t  confid;         /* id of last configuration request */
     32 };
     33 
     34 struct sppp {
     35 	struct ifnet	pp_if;		/* network interface data */
     36 	struct ifqueue	pp_fastq;	/* fast output queue */
     37 	struct sppp    *pp_next;	/* next interface in keepalive list */
     38 	u_int		pp_flags;	/* use Cisco protocol instead of PPP */
     39 	u_int16_t	pp_alivecnt;	/* keepalive packets counter */
     40 	u_int16_t	pp_loopcnt;	/* loopback detection counter */
     41 	u_int32_t	pp_seq;		/* local sequence number */
     42 	u_int32_t	pp_rseq;	/* remote sequence number */
     43 	struct slcp	lcp;		/* LCP params */
     44 	struct sipcp	ipcp;		/* IPCP params */
     45 };
     46 
     47 #define PP_KEEPALIVE    0x01    /* use keepalive protocol */
     48 #define PP_CISCO        0x02    /* use Cisco protocol instead of PPP */
     49 #define PP_TIMO         0x04    /* cp_timeout routine active */
     50 
     51 #define PP_MTU          1500    /* max. transmit unit */
     52 
     53 #define LCP_STATE_CLOSED        0       /* LCP state: closed (conf-req sent) */
     54 #define LCP_STATE_ACK_RCVD      1       /* LCP state: conf-ack received */
     55 #define LCP_STATE_ACK_SENT      2       /* LCP state: conf-ack sent */
     56 #define LCP_STATE_OPENED        3       /* LCP state: opened */
     57 
     58 #define IPCP_STATE_CLOSED       0       /* IPCP state: closed (conf-req sent) */
     59 #define IPCP_STATE_ACK_RCVD     1       /* IPCP state: conf-ack received */
     60 #define IPCP_STATE_ACK_SENT     2       /* IPCP state: conf-ack sent */
     61 #define IPCP_STATE_OPENED       3       /* IPCP state: opened */
     62 
     63 #ifdef _KERNEL
     64 void spppattach(void);
     65 void sppp_attach (struct ifnet *ifp);
     66 void sppp_detach (struct ifnet *ifp);
     67 void sppp_input (struct ifnet *ifp, struct mbuf *m);
     68 int sppp_ioctl (struct ifnet *ifp, int cmd, void *data);
     69 struct mbuf *sppp_dequeue (struct ifnet *ifp);
     70 int sppp_isempty (struct ifnet *ifp);
     71 void sppp_flush (struct ifnet *ifp);
     72 #endif
     73 
     74 #endif /* _NET_IF_HDLC_H_ */
     75