if_sppp.h revision 13765
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 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
20struct slcp {
21	u_short state;          /* state machine */
22	u_long  magic;          /* local magic number */
23	u_char  echoid;         /* id of last keepalive echo request */
24	u_char  confid;         /* id of last configuration request */
25};
26
27struct sipcp {
28	u_short state;          /* state machine */
29	u_char  confid;         /* id of last configuration request */
30};
31
32struct 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_short pp_alivecnt;    /* keepalive packets counter */
38	u_short pp_loopcnt;     /* loopback detection counter */
39	u_long  pp_seq;         /* local sequence number */
40	u_long  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
62void sppp_attach (struct ifnet *ifp);
63void sppp_detach (struct ifnet *ifp);
64void sppp_input (struct ifnet *ifp, struct mbuf *m);
65int sppp_ioctl (struct ifnet *ifp, int cmd, void *data);
66struct mbuf *sppp_dequeue (struct ifnet *ifp);
67int sppp_isempty (struct ifnet *ifp);
68void sppp_flush (struct ifnet *ifp);
69#endif
70
71#endif /* _NET_IF_HDLC_H_ */
72