| 1 | |
| 2 | * Defines for synchronous PPP/Cisco link level subroutines.
|
| 3 | *
|
| 4 | * Copyright (C) 1994 Cronyx Ltd.
|
| 5 | * Author: Serge Vakulenko, <[email protected]>
|
| 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 | *
|
| 18 |
|
| 19 |
|
| 20 | #ifndef _SYNCPPP_H_
|
| 21 | #define _SYNCPPP_H_ 1
|
| 22 |
|
| 23 | #ifdef __KERNEL__
|
| 24 | struct slcp {
|
| 25 | u16 state;
|
| 26 | u32 magic;
|
| 27 | u_char echoid;
|
| 28 | u_char confid;
|
| 29 | };
|
| 30 |
|
| 31 | struct sipcp {
|
| 32 | u16 state;
|
| 33 | u_char confid;
|
| 34 | };
|
| 35 |
|
| 36 | struct sppp
|
| 37 | {
|
| 38 | struct sppp * pp_next;
|
| 39 | u32 pp_flags;
|
| 40 | u16 pp_alivecnt;
|
| 41 | u16 pp_loopcnt;
|
| 42 | u32 pp_seq;
|
| 43 | u32 pp_rseq;
|
| 44 | struct slcp lcp;
|
| 45 | struct sipcp ipcp;
|
| 46 | u32 ibytes,obytes;
|
| 47 | u32 ipkts,opkts;
|
| 48 | struct timer_list pp_timer;
|
| 49 | struct net_device *pp_if;
|
| 50 | char pp_link_state;
|
| 51 | spinlock_t lock;
|
| 52 | };
|
| 53 |
|
| 54 | struct ppp_device
|
| 55 | {
|
| 56 | struct net_device *dev;
|
| 57 | struct sppp sppp;
|
| 58 | };
|
| 59 |
|
| 60 | static inline struct sppp *sppp_of(struct net_device *dev)
|
| 61 | {
|
| 62 | struct ppp_device **ppp = dev->priv;
|
| 63 | BUG_ON((*ppp)->dev != dev);
|
| 64 | return &(*ppp)->sppp;
|
| 65 | }
|
| 66 |
|
| 67 | #define PP_KEEPALIVE 0x01
|
| 68 | #define PP_CISCO 0x02
|
| 69 | #define PP_TIMO 0x04
|
| 70 | #define PP_DEBUG 0x08
|
| 71 |
|
| 72 | #define PPP_MTU 1500
|
| 73 |
|
| 74 | #define LCP_STATE_CLOSED 0
|
| 75 | #define LCP_STATE_ACK_RCVD 1
|
| 76 | #define LCP_STATE_ACK_SENT 2
|
| 77 | #define LCP_STATE_OPENED 3
|
| 78 |
|
| 79 | #define IPCP_STATE_CLOSED 0
|
| 80 | #define IPCP_STATE_ACK_RCVD 1
|
| 81 | #define IPCP_STATE_ACK_SENT 2
|
| 82 | #define IPCP_STATE_OPENED 3
|
| 83 |
|
| 84 | #define SPPP_LINK_DOWN 0
|
| 85 | #define SPPP_LINK_UP 1
|
| 86 |
|
| 87 | void sppp_attach (struct ppp_device *pd);
|
| 88 | void sppp_detach (struct net_device *dev);
|
| 89 | int sppp_do_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd);
|
| 90 | struct sk_buff *sppp_dequeue (struct net_device *dev);
|
| 91 | int sppp_isempty (struct net_device *dev);
|
| 92 | void sppp_flush (struct net_device *dev);
|
| 93 | int sppp_open (struct net_device *dev);
|
| 94 | int sppp_reopen (struct net_device *dev);
|
| 95 | int sppp_close (struct net_device *dev);
|
| 96 | #endif
|
| 97 |
|
| 98 | #define SPPPIOCCISCO (SIOCDEVPRIVATE)
|
| 99 | #define SPPPIOCPPP (SIOCDEVPRIVATE+1)
|
| 100 | #define SPPPIOCDEBUG (SIOCDEVPRIVATE+2)
|
| 101 | #define SPPPIOCSFLAGS (SIOCDEVPRIVATE+3)
|
| 102 | #define SPPPIOCGFLAGS (SIOCDEVPRIVATE+4)
|
| 103 |
|
| 104 | #endif
|