aboutsummaryrefslogtreecommitdiff
path: root/include/linux/if_ppp.h
blob: 4c6c6fb5b467e0a725ed4873f1d5a421d5deee9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
 * if_ppp.h - Point-to-Point Protocol definitions.
 *
 * Copyright (c) 1989 Carnegie Mellon University.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted
 * provided that the above copyright notice and this paragraph are
 * duplicated in all such forms and that any documentation,
 * advertising materials, and other materials related to such
 * distribution and use acknowledge that the software was developed
 * by Carnegie Mellon University.  The name of the
 * University may not be used to endorse or promote products derived
 * from this software without specific prior written permission.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 *
 */


#ifndef _IF_PPP_H_
#define _IF_PPP_H_

#include <linux/types.h>
#include <linux/compiler.h>


#define	PPP_MTU		1500	
#define PPP_MAXMRU	65000	
#define PROTO_IPX	0x002b	
#define PROTO_DNA_RT    0x0027  



#define SC_COMP_PROT	0x00000001	
#define SC_COMP_AC	0x00000002	
#define	SC_COMP_TCP	0x00000004	
#define SC_NO_TCP_CCID	0x00000008	
#define SC_REJ_COMP_AC	0x00000010	
#define SC_REJ_COMP_TCP	0x00000020	
#define SC_CCP_OPEN	0x00000040	
#define SC_CCP_UP	0x00000080	
#define SC_ENABLE_IP	0x00000100	
#define SC_LOOP_TRAFFIC	0x00000200	
#define SC_MULTILINK	0x00000400	
#define SC_MP_SHORTSEQ	0x00000800	
#define SC_COMP_RUN	0x00001000	
#define SC_DECOMP_RUN	0x00002000	
#define SC_MP_XSHORTSEQ	0x00004000	
#define SC_DEBUG	0x00010000	
#define SC_LOG_INPKT	0x00020000	
#define SC_LOG_OUTPKT	0x00040000	
#define SC_LOG_RAWIN	0x00080000	
#define SC_LOG_FLUSH	0x00100000	
#define	SC_SYNC		0x00200000	
#define	SC_MUST_COMP    0x00400000	
#define	SC_MASK		0x0f600fff	

#define SC_XMIT_BUSY	0x10000000	
#define SC_RCV_ODDP	0x08000000	
#define SC_RCV_EVNP	0x04000000	
#define SC_RCV_B7_1	0x02000000	
#define SC_RCV_B7_0	0x01000000	
#define SC_DC_FERROR	0x00800000	
#define SC_DC_ERROR	0x00400000	


struct npioctl {
	int		protocol;	
	enum NPmode	mode;
};

struct ppp_option_data {
	__u8	__user *ptr;
	__u32	length;
	int	transmit;
};

struct ifpppstatsreq {
	struct ifreq	 b;
	struct ppp_stats stats;			
};

struct ifpppcstatsreq {
	struct ifreq	      b;
	struct ppp_comp_stats stats;
};

struct pppol2tp_ioc_stats {
	__u16		tunnel_id;	
	__u16		session_id;	
	__u32		using_ipsec:1;	
	__aligned_u64	tx_packets;
	__aligned_u64	tx_bytes;
	__aligned_u64	tx_errors;
	__aligned_u64	rx_packets;
	__aligned_u64	rx_bytes;
	__aligned_u64	rx_seq_discards;
	__aligned_u64	rx_oos_packets;
	__aligned_u64	rx_errors;
};

#define ifr__name       b.ifr_ifrn.ifrn_name
#define stats_ptr       b.ifr_ifru.ifru_data


#define	PPPIOCGFLAGS	_IOR('t', 90, int)	
#define	PPPIOCSFLAGS	_IOW('t', 89, int)	
#define	PPPIOCGASYNCMAP	_IOR('t', 88, int)	
#define	PPPIOCSASYNCMAP	_IOW('t', 87, int)	
#define	PPPIOCGUNIT	_IOR('t', 86, int)	
#define	PPPIOCGRASYNCMAP _IOR('t', 85, int)	
#define	PPPIOCSRASYNCMAP _IOW('t', 84, int)	
#define	PPPIOCGMRU	_IOR('t', 83, int)	
#define	PPPIOCSMRU	_IOW('t', 82, int)	
#define	PPPIOCSMAXCID	_IOW('t', 81, int)	
#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) 
#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) 
#define PPPIOCXFERUNIT	_IO('t', 78)		
#define PPPIOCSCOMPRESS	_IOW('t', 77, struct ppp_option_data)
#define PPPIOCGNPMODE	_IOWR('t', 76, struct npioctl) 
#define PPPIOCSNPMODE	_IOW('t', 75, struct npioctl)  
#define PPPIOCSPASS	_IOW('t', 71, struct sock_fprog) 
#define PPPIOCSACTIVE	_IOW('t', 70, struct sock_fprog) 
#define PPPIOCGDEBUG	_IOR('t', 65, int)	
#define PPPIOCSDEBUG	_IOW('t', 64, int)	
#define PPPIOCGIDLE	_IOR('t', 63, struct ppp_idle) 
#define PPPIOCNEWUNIT	_IOWR('t', 62, int)	
#define PPPIOCATTACH	_IOW('t', 61, int)	
#define PPPIOCDETACH	_IOW('t', 60, int)	
#define PPPIOCSMRRU	_IOW('t', 59, int)	
#define PPPIOCCONNECT	_IOW('t', 58, int)	
#define PPPIOCDISCONN	_IO('t', 57)		
#define PPPIOCATTCHAN	_IOW('t', 56, int)	
#define PPPIOCGCHAN	_IOR('t', 55, int)	
#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)

#define SIOCGPPPSTATS   (SIOCDEVPRIVATE + 0)
#define SIOCGPPPVER     (SIOCDEVPRIVATE + 1)	
#define SIOCGPPPCSTATS  (SIOCDEVPRIVATE + 2)

#if !defined(ifr_mtu)
#define ifr_mtu	ifr_ifru.ifru_metric
#endif

#endif