if_sppp.h revision 4911
1/* 2 * Defines for synchronous PPP/Cisco link level subroutines. 3 * 4 * Copyright (C) 1994 Cronyx Ltd. 5 * Author: Serge Vakulenko, <vak@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 organisations 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.1, Thu Oct 27 21:15:02 MSK 1994 15 */ 16 17#ifndef _NET_IF_HDLC_H_ 18#define _NET_IF_HDLC_H_ 1 19 20struct slcp { 21 u_short state; /* state machine */ 22 u_long magic; /* local magic number */ 23 u_long rmagic; /* remote magic number */ 24 u_char lastid; /* id of last keepalive echo request */ 25}; 26 27struct sipcp { 28 u_short state; /* state machine */ 29}; 30 31struct sppp { 32 struct ifnet pp_if; /* network interface data */ 33 struct ifqueue pp_fastq; /* fast output queue */ 34 struct sppp *pp_next; /* next interface in keepalive list */ 35 u_int pp_flags; /* use Cisco protocol instead of PPP */ 36 u_short pp_alivecnt; /* keepalive packets counter */ 37 u_short pp_loopcnt; /* loopback detection counter */ 38 u_long pp_seq; /* local sequence number */ 39 u_long pp_rseq; /* remote sequence number */ 40 struct slcp lcp; /* LCP params */ 41 struct sipcp ipcp; /* IPCP params */ 42}; 43 44#define PP_KEEPALIVE 0x01 /* use keepalive protocol */ 45#define PP_CISCO 0x02 /* use Cisco protocol instead of PPP */ 46 47#define PP_MTU 1500 /* max. transmit unit */ 48 49#define LCP_STATE_CLOSED 0 /* LCP state: closed (conf-req sent) */ 50#define LCP_STATE_ACK_RCVD 1 /* LCP state: conf-ack received */ 51#define LCP_STATE_ACK_SENT 2 /* LCP state: conf-ack sent */ 52#define LCP_STATE_OPENED 3 /* LCP state: opened */ 53 54#define IPCP_STATE_CLOSED 0 /* IPCP state: closed (conf-req sent) */ 55#define IPCP_STATE_ACK_RCVD 1 /* IPCP state: conf-ack received */ 56#define IPCP_STATE_ACK_SENT 2 /* IPCP state: conf-ack sent */ 57#define IPCP_STATE_OPENED 3 /* IPCP state: opened */ 58 59#ifdef KERNEL 60void sppp_attach (struct ifnet *ifp); 61void sppp_detach (struct ifnet *ifp); 62void sppp_input (struct ifnet *ifp, struct mbuf *m); 63int sppp_output (struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, 64 struct rtentry *rt); 65int sppp_ioctl (struct ifnet *ifp, int cmd, caddr_t data); 66struct mbuf *sppp_dequeue (struct ifnet *ifp); 67void sppp_flush (struct ifnet *ifp); 68#endif 69 70#endif /* _NET_IF_HDLC_H_ */ 71