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