~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/if_pppox.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /***************************************************************************
  3  * Linux PPP over X - Generic PPP transport layer sockets
  4  * Linux PPP over Ethernet (PPPoE) Socket Implementation (RFC 2516) 
  5  *
  6  * This file supplies definitions required by the PPP over Ethernet driver
  7  * (pppox.c).  All version information wrt this file is located in pppox.c
  8  */
  9 #ifndef __LINUX_IF_PPPOX_H
 10 #define __LINUX_IF_PPPOX_H
 11 
 12 #include <linux/if.h>
 13 #include <linux/netdevice.h>
 14 #include <linux/ppp_channel.h>
 15 #include <linux/skbuff.h>
 16 #include <linux/workqueue.h>
 17 #include <uapi/linux/if_pppox.h>
 18 
 19 static inline struct pppoe_hdr *pppoe_hdr(const struct sk_buff *skb)
 20 {
 21         return (struct pppoe_hdr *)skb_network_header(skb);
 22 }
 23 
 24 struct pppoe_opt {
 25         struct net_device      *dev;      /* device associated with socket*/
 26         int                     ifindex;  /* ifindex of device associated with socket */
 27         struct pppoe_addr       pa;       /* what this socket is bound to*/
 28         struct sockaddr_pppox   relay;    /* what socket data will be
 29                                              relayed to (PPPoE relaying) */
 30         struct work_struct      padt_work;/* Work item for handling PADT */
 31 };
 32 
 33 struct pptp_opt {
 34         struct pptp_addr src_addr;
 35         struct pptp_addr dst_addr;
 36         u32 ack_sent, ack_recv;
 37         u32 seq_sent, seq_recv;
 38         int ppp_flags;
 39 };
 40 #include <net/sock.h>
 41 
 42 struct pppox_sock {
 43         /* struct sock must be the first member of pppox_sock */
 44         struct sock sk;
 45         struct ppp_channel chan;
 46         struct pppox_sock       *next;    /* for hash table */
 47         union {
 48                 struct pppoe_opt pppoe;
 49                 struct pptp_opt  pptp;
 50         } proto;
 51         __be16                  num;
 52 };
 53 #define pppoe_dev       proto.pppoe.dev
 54 #define pppoe_ifindex   proto.pppoe.ifindex
 55 #define pppoe_pa        proto.pppoe.pa
 56 #define pppoe_relay     proto.pppoe.relay
 57 
 58 static inline struct pppox_sock *pppox_sk(struct sock *sk)
 59 {
 60         return (struct pppox_sock *)sk;
 61 }
 62 
 63 static inline struct sock *sk_pppox(struct pppox_sock *po)
 64 {
 65         return (struct sock *)po;
 66 }
 67 
 68 struct module;
 69 
 70 struct pppox_proto {
 71         int             (*create)(struct net *net, struct socket *sock, int kern);
 72         int             (*ioctl)(struct socket *sock, unsigned int cmd,
 73                                  unsigned long arg);
 74         struct module   *owner;
 75 };
 76 
 77 extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp);
 78 extern void unregister_pppox_proto(int proto_num);
 79 extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
 80 extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
 81 extern int pppox_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
 82 
 83 #define PPPOEIOCSFWD32    _IOW(0xB1 ,0, compat_size_t)
 84 
 85 /* PPPoX socket states */
 86 enum {
 87     PPPOX_NONE          = 0,  /* initial state */
 88     PPPOX_CONNECTED     = 1,  /* connection established ==TCP_ESTABLISHED */
 89     PPPOX_BOUND         = 2,  /* bound to ppp device */
 90     PPPOX_RELAY         = 4,  /* forwarding is enabled */
 91     PPPOX_DEAD          = 16  /* dead, useless, please clean me up!*/
 92 };
 93 
 94 #endif /* !(__LINUX_IF_PPPOX_H) */
 95 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php