The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/netgraph/ng_l2tp.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 
    2 /*
    3  * Copyright (c) 2001-2002 Packet Design, LLC.
    4  * All rights reserved.
    5  * 
    6  * Subject to the following obligations and disclaimer of warranty,
    7  * use and redistribution of this software, in source or object code
    8  * forms, with or without modifications are expressly permitted by
    9  * Packet Design; provided, however, that:
   10  * 
   11  *    (i)  Any and all reproductions of the source or object code
   12  *         must include the copyright notice above and the following
   13  *         disclaimer of warranties; and
   14  *    (ii) No rights are granted, in any manner or form, to use
   15  *         Packet Design trademarks, including the mark "PACKET DESIGN"
   16  *         on advertising, endorsements, or otherwise except as such
   17  *         appears in the above copyright notice or in the software.
   18  * 
   19  * THIS SOFTWARE IS BEING PROVIDED BY PACKET DESIGN "AS IS", AND
   20  * TO THE MAXIMUM EXTENT PERMITTED BY LAW, PACKET DESIGN MAKES NO
   21  * REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING
   22  * THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED
   23  * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
   24  * OR NON-INFRINGEMENT.  PACKET DESIGN DOES NOT WARRANT, GUARANTEE,
   25  * OR MAKE ANY REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS
   26  * OF THE USE OF THIS SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY,
   27  * RELIABILITY OR OTHERWISE.  IN NO EVENT SHALL PACKET DESIGN BE
   28  * LIABLE FOR ANY DAMAGES RESULTING FROM OR ARISING OUT OF ANY USE
   29  * OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, ANY DIRECT,
   30  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, PUNITIVE, OR CONSEQUENTIAL
   31  * DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF
   32  * USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY THEORY OF
   33  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
   35  * THE USE OF THIS SOFTWARE, EVEN IF PACKET DESIGN IS ADVISED OF
   36  * THE POSSIBILITY OF SUCH DAMAGE.
   37  * 
   38  * Author: Archie Cobbs <archie@freebsd.org>
   39  *
   40  * $FreeBSD: releng/5.3/sys/netgraph/ng_l2tp.h 136588 2004-10-16 08:43:07Z cvs2svn $
   41  */
   42 
   43 #ifndef _NETGRAPH_NG_L2TP_H_
   44 #define _NETGRAPH_NG_L2TP_H_
   45 
   46 /* Node type name and magic cookie */
   47 #define NG_L2TP_NODE_TYPE       "l2tp"
   48 #define NGM_L2TP_COOKIE         1091515793
   49 
   50 /* Hook names */
   51 #define NG_L2TP_HOOK_CTRL       "ctrl"          /* control channel hook */
   52 #define NG_L2TP_HOOK_LOWER      "lower"         /* hook to lower layers */
   53 
   54 /* Session hooks: prefix plus hex session ID, e.g., "session_3e14" */
   55 #define NG_L2TP_HOOK_SESSION_P  "session_"      /* session data hook (prefix) */
   56 #define NG_L2TP_HOOK_SESSION_F  "session_%04x"  /* session data hook (format) */
   57 
   58 /* Set intial sequence numbers to not yet enabled node. */
   59 struct ng_l2tp_seq_config {
   60         u_int16_t       ns;             /* sequence number to send next */
   61         u_int16_t       nr;             /* sequence number to be recved next */
   62         u_int16_t       rack;           /* last 'nr' received */
   63         u_int16_t       xack;           /* last 'nr' sent */
   64 };
   65 
   66 /* Keep this in sync with the above structure definition. */
   67 #define NG_L2TP_SEQ_CONFIG_TYPE_INFO    {                       \
   68           { "ns",               &ng_parse_uint16_type   },      \
   69           { "nr",               &ng_parse_uint16_type   },      \
   70           { NULL }                                              \
   71 }
   72 
   73 /* Configuration for a node */
   74 struct ng_l2tp_config {
   75         u_char          enabled;        /* enables traffic flow */
   76         u_char          match_id;       /* tunnel id must match 'tunnel_id' */
   77         u_int16_t       tunnel_id;      /* local tunnel id */
   78         u_int16_t       peer_id;        /* peer's tunnel id */
   79         u_int16_t       peer_win;       /* peer's max recv window size */
   80         u_int16_t       rexmit_max;     /* max retransmits before failure */
   81         u_int16_t       rexmit_max_to;  /* max delay between retransmits */
   82 };
   83 
   84 /* Keep this in sync with the above structure definition */
   85 #define NG_L2TP_CONFIG_TYPE_INFO        {                       \
   86           { "enabled",          &ng_parse_uint8_type    },      \
   87           { "match_id",         &ng_parse_uint8_type    },      \
   88           { "tunnel_id",        &ng_parse_hint16_type   },      \
   89           { "peer_id",          &ng_parse_hint16_type   },      \
   90           { "peer_win",         &ng_parse_uint16_type   },      \
   91           { "rexmit_max",       &ng_parse_uint16_type   },      \
   92           { "rexmit_max_to",    &ng_parse_uint16_type   },      \
   93           { NULL }                                              \
   94 }
   95 
   96 /* Configuration for a session hook */
   97 struct ng_l2tp_sess_config {
   98         u_int16_t       session_id;     /* local session id */
   99         u_int16_t       peer_id;        /* peer's session id */
  100         u_char          control_dseq;   /* whether we control data sequencing */
  101         u_char          enable_dseq;    /* whether to enable data sequencing */
  102         u_char          include_length; /* whether to include length field */
  103 };
  104 
  105 /* Keep this in sync with the above structure definition */
  106 #define NG_L2TP_SESS_CONFIG_TYPE_INFO   {                       \
  107           { "session_id",       &ng_parse_hint16_type   },      \
  108           { "peer_id",          &ng_parse_hint16_type   },      \
  109           { "control_dseq",     &ng_parse_uint8_type    },      \
  110           { "enable_dseq",      &ng_parse_uint8_type    },      \
  111           { "include_length",   &ng_parse_uint8_type    },      \
  112           { NULL }                                              \
  113 }
  114 
  115 /* Statistics struct */
  116 struct ng_l2tp_stats {
  117         u_int32_t xmitPackets;          /* number of packets xmit */
  118         u_int32_t xmitOctets;           /* number of octets xmit */
  119         u_int32_t xmitZLBs;             /* ack-only packets transmitted */
  120         u_int32_t xmitDrops;            /* xmits dropped due to full window */
  121         u_int32_t xmitTooBig;           /* ctrl pkts dropped because too big */
  122         u_int32_t xmitInvalid;          /* ctrl packets with no session ID */
  123         u_int32_t xmitDataTooBig;       /* data pkts dropped because too big */
  124         u_int32_t xmitRetransmits;      /* retransmitted packets */
  125         u_int32_t recvPackets;          /* number of packets rec'd */
  126         u_int32_t recvOctets;           /* number of octets rec'd */
  127         u_int32_t recvRunts;            /* too short packets rec'd */
  128         u_int32_t recvInvalid;          /* invalid packets rec'd */
  129         u_int32_t recvWrongTunnel;      /* packets rec'd with wrong tunnel id */
  130         u_int32_t recvUnknownSID;       /* pkts rec'd with unknown session id */
  131         u_int32_t recvBadAcks;          /* ctrl pkts rec'd with invalid 'nr' */
  132         u_int32_t recvOutOfOrder;       /* out of order ctrl pkts rec'd */
  133         u_int32_t recvDuplicates;       /* duplicate ctrl pkts rec'd */
  134         u_int32_t recvDataDrops;        /* dup/out of order data pkts rec'd */
  135         u_int32_t recvZLBs;             /* ack-only packets rec'd */
  136         u_int32_t memoryFailures;       /* times we couldn't allocate memory */
  137 };
  138 
  139 /* Keep this in sync with the above structure definition */
  140 #define NG_L2TP_STATS_TYPE_INFO {                       \
  141           { "xmitPackets",      &ng_parse_uint32_type   },      \
  142           { "xmitOctets",       &ng_parse_uint32_type   },      \
  143           { "xmitZLBs",         &ng_parse_uint32_type   },      \
  144           { "xmitDrops",        &ng_parse_uint32_type   },      \
  145           { "xmitTooBig",       &ng_parse_uint32_type   },      \
  146           { "xmitInvalid",      &ng_parse_uint32_type   },      \
  147           { "xmitDataTooBig",   &ng_parse_uint32_type   },      \
  148           { "xmitRetransmits",  &ng_parse_uint32_type   },      \
  149           { "recvPackets",      &ng_parse_uint32_type   },      \
  150           { "recvOctets",       &ng_parse_uint32_type   },      \
  151           { "recvRunts",        &ng_parse_uint32_type   },      \
  152           { "recvInvalid",      &ng_parse_uint32_type   },      \
  153           { "recvWrongTunnel",  &ng_parse_uint32_type   },      \
  154           { "recvUnknownSID",   &ng_parse_uint32_type   },      \
  155           { "recvBadAcks",      &ng_parse_uint32_type   },      \
  156           { "recvOutOfOrder",   &ng_parse_uint32_type   },      \
  157           { "recvDuplicates",   &ng_parse_uint32_type   },      \
  158           { "recvDataDrops",    &ng_parse_uint32_type   },      \
  159           { "recvZLBs",         &ng_parse_uint32_type   },      \
  160           { "memoryFailures",   &ng_parse_uint32_type   },      \
  161           { NULL }                                              \
  162 }
  163 
  164 /* Session statistics struct. */
  165 struct ng_l2tp_session_stats {
  166         u_int64_t xmitPackets;          /* number of packets xmit */
  167         u_int64_t xmitOctets;           /* number of octets xmit */
  168         u_int64_t recvPackets;          /* number of packets received */
  169         u_int64_t recvOctets;           /* number of octets received */
  170 };
  171 
  172 /* Keep this in sync with the above structure definition. */
  173 #define NG_L2TP_SESSION_STATS_TYPE_INFO {                       \
  174           { "xmitPackets",      &ng_parse_uint64_type   },      \
  175           { "xmitOctets",       &ng_parse_uint64_type   },      \
  176           { "recvPackets",      &ng_parse_uint64_type   },      \
  177           { "recvOctets",       &ng_parse_uint64_type   },      \
  178           { NULL }                                              \
  179 }
  180 
  181 /* Netgraph commands */
  182 enum {
  183         NGM_L2TP_SET_CONFIG = 1,        /* supply a struct ng_l2tp_config */
  184         NGM_L2TP_GET_CONFIG,            /* returns a struct ng_l2tp_config */
  185         NGM_L2TP_SET_SESS_CONFIG,       /* supply struct ng_l2tp_sess_config */
  186         NGM_L2TP_GET_SESS_CONFIG,       /* supply a session id (u_int16_t) */
  187         NGM_L2TP_GET_STATS,             /* returns struct ng_l2tp_stats */
  188         NGM_L2TP_CLR_STATS,             /* clears stats */
  189         NGM_L2TP_GETCLR_STATS,          /* returns & clears stats */
  190         NGM_L2TP_GET_SESSION_STATS,     /* returns session stats */
  191         NGM_L2TP_CLR_SESSION_STATS,     /* clears session stats */
  192         NGM_L2TP_GETCLR_SESSION_STATS,  /* returns & clears session stats */
  193         NGM_L2TP_ACK_FAILURE,           /* sent *from* node after ack timeout */
  194         NGM_L2TP_SET_SEQ                /* supply a struct ng_l2tp_seq_config */
  195 };
  196 
  197 #endif /* _NETGRAPH_NG_L2TP_H_ */

Cache object: c5aa2c2e58659b76c8281a71a7baa93d


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.