Home | History | Annotate | Download | only in linux
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ***   To edit the content of this header, modify the corresponding
     11  ***   source file (e.g. under external/kernel-headers/original/) then
     12  ***   run bionic/libc/kernel/tools/update_all.py
     13  ***
     14  ***   Any manual change here will be lost the next time this script will
     15  ***   be run. You've been warned!
     16  ***
     17  ****************************************************************************
     18  ****************************************************************************/
     19 #ifndef _UAPI_LINUX_L2TP_H_
     20 #define _UAPI_LINUX_L2TP_H_
     21 #include <linux/types.h>
     22 #include <linux/socket.h>
     23 #include <linux/in.h>
     24 #include <linux/in6.h>
     25 #define IPPROTO_L2TP 115
     26 #define __SOCK_SIZE__ 16
     27 struct sockaddr_l2tpip {
     28   __kernel_sa_family_t l2tp_family;
     29   __be16 l2tp_unused;
     30   struct in_addr l2tp_addr;
     31   __u32 l2tp_conn_id;
     32   unsigned char __pad[__SOCK_SIZE__ - sizeof(__kernel_sa_family_t) - sizeof(__be16) - sizeof(struct in_addr) - sizeof(__u32)];
     33 };
     34 struct sockaddr_l2tpip6 {
     35   __kernel_sa_family_t l2tp_family;
     36   __be16 l2tp_unused;
     37   __be32 l2tp_flowinfo;
     38   struct in6_addr l2tp_addr;
     39   __u32 l2tp_scope_id;
     40   __u32 l2tp_conn_id;
     41 };
     42 enum {
     43   L2TP_CMD_NOOP,
     44   L2TP_CMD_TUNNEL_CREATE,
     45   L2TP_CMD_TUNNEL_DELETE,
     46   L2TP_CMD_TUNNEL_MODIFY,
     47   L2TP_CMD_TUNNEL_GET,
     48   L2TP_CMD_SESSION_CREATE,
     49   L2TP_CMD_SESSION_DELETE,
     50   L2TP_CMD_SESSION_MODIFY,
     51   L2TP_CMD_SESSION_GET,
     52   __L2TP_CMD_MAX,
     53 };
     54 #define L2TP_CMD_MAX (__L2TP_CMD_MAX - 1)
     55 enum {
     56   L2TP_ATTR_NONE,
     57   L2TP_ATTR_PW_TYPE,
     58   L2TP_ATTR_ENCAP_TYPE,
     59   L2TP_ATTR_OFFSET,
     60   L2TP_ATTR_DATA_SEQ,
     61   L2TP_ATTR_L2SPEC_TYPE,
     62   L2TP_ATTR_L2SPEC_LEN,
     63   L2TP_ATTR_PROTO_VERSION,
     64   L2TP_ATTR_IFNAME,
     65   L2TP_ATTR_CONN_ID,
     66   L2TP_ATTR_PEER_CONN_ID,
     67   L2TP_ATTR_SESSION_ID,
     68   L2TP_ATTR_PEER_SESSION_ID,
     69   L2TP_ATTR_UDP_CSUM,
     70   L2TP_ATTR_VLAN_ID,
     71   L2TP_ATTR_COOKIE,
     72   L2TP_ATTR_PEER_COOKIE,
     73   L2TP_ATTR_DEBUG,
     74   L2TP_ATTR_RECV_SEQ,
     75   L2TP_ATTR_SEND_SEQ,
     76   L2TP_ATTR_LNS_MODE,
     77   L2TP_ATTR_USING_IPSEC,
     78   L2TP_ATTR_RECV_TIMEOUT,
     79   L2TP_ATTR_FD,
     80   L2TP_ATTR_IP_SADDR,
     81   L2TP_ATTR_IP_DADDR,
     82   L2TP_ATTR_UDP_SPORT,
     83   L2TP_ATTR_UDP_DPORT,
     84   L2TP_ATTR_MTU,
     85   L2TP_ATTR_MRU,
     86   L2TP_ATTR_STATS,
     87   L2TP_ATTR_IP6_SADDR,
     88   L2TP_ATTR_IP6_DADDR,
     89   L2TP_ATTR_UDP_ZERO_CSUM6_TX,
     90   L2TP_ATTR_UDP_ZERO_CSUM6_RX,
     91   L2TP_ATTR_PAD,
     92   __L2TP_ATTR_MAX,
     93 };
     94 #define L2TP_ATTR_MAX (__L2TP_ATTR_MAX - 1)
     95 enum {
     96   L2TP_ATTR_STATS_NONE,
     97   L2TP_ATTR_TX_PACKETS,
     98   L2TP_ATTR_TX_BYTES,
     99   L2TP_ATTR_TX_ERRORS,
    100   L2TP_ATTR_RX_PACKETS,
    101   L2TP_ATTR_RX_BYTES,
    102   L2TP_ATTR_RX_SEQ_DISCARDS,
    103   L2TP_ATTR_RX_OOS_PACKETS,
    104   L2TP_ATTR_RX_ERRORS,
    105   L2TP_ATTR_STATS_PAD,
    106   __L2TP_ATTR_STATS_MAX,
    107 };
    108 #define L2TP_ATTR_STATS_MAX (__L2TP_ATTR_STATS_MAX - 1)
    109 enum l2tp_pwtype {
    110   L2TP_PWTYPE_NONE = 0x0000,
    111   L2TP_PWTYPE_ETH_VLAN = 0x0004,
    112   L2TP_PWTYPE_ETH = 0x0005,
    113   L2TP_PWTYPE_PPP = 0x0007,
    114   L2TP_PWTYPE_PPP_AC = 0x0008,
    115   L2TP_PWTYPE_IP = 0x000b,
    116   __L2TP_PWTYPE_MAX
    117 };
    118 enum l2tp_l2spec_type {
    119   L2TP_L2SPECTYPE_NONE,
    120   L2TP_L2SPECTYPE_DEFAULT,
    121 };
    122 enum l2tp_encap_type {
    123   L2TP_ENCAPTYPE_UDP,
    124   L2TP_ENCAPTYPE_IP,
    125 };
    126 enum l2tp_seqmode {
    127   L2TP_SEQ_NONE = 0,
    128   L2TP_SEQ_IP = 1,
    129   L2TP_SEQ_ALL = 2,
    130 };
    131 enum l2tp_debug_flags {
    132   L2TP_MSG_DEBUG = (1 << 0),
    133   L2TP_MSG_CONTROL = (1 << 1),
    134   L2TP_MSG_SEQ = (1 << 2),
    135   L2TP_MSG_DATA = (1 << 3),
    136 };
    137 #define L2TP_GENL_NAME "l2tp"
    138 #define L2TP_GENL_VERSION 0x1
    139 #define L2TP_GENL_MCGROUP "l2tp"
    140 #endif
    141