This source file includes following definitions.
- pppox_sk
- sk_pppox
1
2
3
4
5
6
7
8
9
10
11 #ifndef __LINUX_IF_PPPOX_H
12 #define __LINUX_IF_PPPOX_H
13
14 #include <linux/if.h>
15 #include <linux/netdevice.h>
16 #include <linux/ppp_channel.h>
17 #include <linux/skbuff.h>
18 #include <linux/workqueue.h>
19 #include <uapi/linux/if_pppox.h>
20
21 static inline struct pppoe_hdr *pppoe_hdr(const struct sk_buff *skb)
22 {
23 return (struct pppoe_hdr *)skb_network_header(skb);
24 }
25
26 struct pppoe_opt {
27 struct net_device *dev;
28 int ifindex;
29 struct pppoe_addr pa;
30 struct sockaddr_pppox relay;
31
32 struct work_struct padt_work;
33 };
34
35 struct pptp_opt {
36 struct pptp_addr src_addr;
37 struct pptp_addr dst_addr;
38 u32 ack_sent, ack_recv;
39 u32 seq_sent, seq_recv;
40 int ppp_flags;
41 };
42 #include <net/sock.h>
43
44 struct pppox_sock {
45
46 struct sock sk;
47 struct ppp_channel chan;
48 struct pppox_sock *next;
49 union {
50 struct pppoe_opt pppoe;
51 struct pptp_opt pptp;
52 } proto;
53 __be16 num;
54 };
55 #define pppoe_dev proto.pppoe.dev
56 #define pppoe_ifindex proto.pppoe.ifindex
57 #define pppoe_pa proto.pppoe.pa
58 #define pppoe_relay proto.pppoe.relay
59
60 static inline struct pppox_sock *pppox_sk(struct sock *sk)
61 {
62 return (struct pppox_sock *)sk;
63 }
64
65 static inline struct sock *sk_pppox(struct pppox_sock *po)
66 {
67 return (struct sock *)po;
68 }
69
70 struct module;
71
72 struct pppox_proto {
73 int (*create)(struct net *net, struct socket *sock, int kern);
74 int (*ioctl)(struct socket *sock, unsigned int cmd,
75 unsigned long arg);
76 struct module *owner;
77 };
78
79 extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp);
80 extern void unregister_pppox_proto(int proto_num);
81 extern void pppox_unbind_sock(struct sock *sk);
82 extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
83 extern int pppox_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
84
85 #define PPPOEIOCSFWD32 _IOW(0xB1 ,0, compat_size_t)
86
87
88 enum {
89 PPPOX_NONE = 0,
90 PPPOX_CONNECTED = 1,
91 PPPOX_BOUND = 2,
92 PPPOX_RELAY = 4,
93 PPPOX_DEAD = 16
94 };
95
96 #endif