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

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

Version: ~ [ linux-5.6-rc1 ] ~ [ linux-5.5.2 ] ~ [ linux-5.4.17 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.102 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.170 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.213 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.213 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.81 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp