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