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_pipe.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 2004-2008 University of Zagreb
    3  * Copyright (c) 2007-2008 FreeBSD Foundation
    4  *
    5  * This software was developed by the University of Zagreb and the
    6  * FreeBSD Foundation under sponsorship by the Stichting NLnet and the
    7  * FreeBSD Foundation.
    8  *
    9  * Redistribution and use in source and binary forms, with or without
   10  * modification, are permitted provided that the following conditions
   11  * are met:
   12  * 1. Redistributions of source code must retain the above copyright
   13  *    notice, this list of conditions and the following disclaimer.
   14  * 2. Redistributions in binary form must reproduce the above copyright
   15  *    notice, this list of conditions and the following disclaimer in the
   16  *    documentation and/or other materials provided with the distribution.
   17  *
   18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   21  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   28  * SUCH DAMAGE.
   29  *
   30  * $FreeBSD: releng/10.2/sys/netgraph/ng_pipe.h 206360 2010-04-07 16:29:10Z joel $
   31  */
   32 
   33 #ifndef _NETGRAPH_PIPE_H_
   34 #define _NETGRAPH_PIPE_H_
   35 
   36 /* Node type name and magic cookie */
   37 #define NG_PIPE_NODE_TYPE       "pipe"
   38 #define NGM_PIPE_COOKIE         200708191
   39 
   40 /* Hook names */
   41 #define NG_PIPE_HOOK_UPPER      "upper"
   42 #define NG_PIPE_HOOK_LOWER      "lower"
   43 
   44 #define MAX_FSIZE 16384 /* Largest supported frame size, in bytes, for BER */
   45 #define MAX_OHSIZE 256  /* Largest supported dummy-framing size, in bytes */
   46 
   47 /* Statistics structure for one hook */
   48 struct ng_pipe_hookstat {
   49         u_int64_t               fwd_octets;
   50         u_int64_t               fwd_frames;
   51         u_int64_t               in_disc_octets;
   52         u_int64_t               in_disc_frames;
   53         u_int64_t               out_disc_octets;
   54         u_int64_t               out_disc_frames;
   55 };
   56 
   57 /* Keep this in sync with the above structure definition */
   58 #define NG_PIPE_HOOKSTAT_INFO   {                                       \
   59         { "FwdOctets",          &ng_parse_uint64_type   },              \
   60         { "FwdFrames",          &ng_parse_uint64_type   },              \
   61         { "queueDropOctets",    &ng_parse_uint64_type   },              \
   62         { "queueDropFrames",    &ng_parse_uint64_type   },              \
   63         { "delayDropOctets",    &ng_parse_uint64_type   },              \
   64         { "delayDropFrames",    &ng_parse_uint64_type   },              \
   65         { NULL },                                                       \
   66 }
   67 
   68 /* Statistics structure returned by NGM_PIPE_GET_STATS */
   69 struct ng_pipe_stats {
   70         struct ng_pipe_hookstat downstream;
   71         struct ng_pipe_hookstat upstream;
   72 };
   73 
   74 /* Keep this in sync with the above structure definition */
   75 #define NG_PIPE_STATS_INFO(hstype)      {                               \
   76         { "downstream",         (hstype) },                             \
   77         { "upstream",           (hstype) },                             \
   78         { NULL },                                                       \
   79 }
   80 
   81 /* Runtime structure for one hook */
   82 struct ng_pipe_hookrun {
   83         u_int32_t               fifo_queues;
   84         u_int32_t               qin_octets;
   85         u_int32_t               qin_frames;
   86         u_int32_t               qout_octets;
   87         u_int32_t               qout_frames;
   88 };
   89 
   90 /* Keep this in sync with the above structure definition */
   91 #define NG_PIPE_HOOKRUN_INFO    {                                       \
   92         { "queues",             &ng_parse_uint32_type   },              \
   93         { "queuedOctets",       &ng_parse_uint32_type   },              \
   94         { "queuedFrames",       &ng_parse_uint32_type   },              \
   95         { "delayedOctets",      &ng_parse_uint32_type   },              \
   96         { "delayedFrames",      &ng_parse_uint32_type   },              \
   97         { NULL },                                                       \
   98 }
   99 
  100 /* Runtime structure returned by NGM_PIPE_GET_RUN */
  101 struct ng_pipe_run {
  102         struct ng_pipe_hookrun  downstream;
  103         struct ng_pipe_hookrun  upstream;
  104 };
  105 
  106 /* Keep this in sync with the above structure definition */
  107 #define NG_PIPE_RUN_INFO(hstype)        {                               \
  108         { "downstream",         (hstype) },                             \
  109         { "upstream",           (hstype) },                             \
  110         { NULL },                                                       \
  111 }
  112 
  113 /* Config structure for one hook */
  114 struct ng_pipe_hookcfg {
  115         u_int64_t               bandwidth;
  116         u_int64_t               ber;
  117         u_int32_t               qin_size_limit;
  118         u_int32_t               qout_size_limit;
  119         u_int32_t               duplicate;
  120         u_int32_t               fifo;
  121         u_int32_t               drr;
  122         u_int32_t               wfq;
  123         u_int32_t               droptail;
  124         u_int32_t               drophead;
  125 };
  126 
  127 /* Keep this in sync with the above structure definition */
  128 #define NG_PIPE_HOOKCFG_INFO    {                                       \
  129         { "bandwidth",          &ng_parse_uint64_type   },              \
  130         { "BER",                &ng_parse_uint64_type   },              \
  131         { "queuelen",           &ng_parse_uint32_type   },              \
  132         { "delaylen",           &ng_parse_uint32_type   },              \
  133         { "duplicate",          &ng_parse_uint32_type   },              \
  134         { "fifo",               &ng_parse_uint32_type   },              \
  135         { "drr",                &ng_parse_uint32_type   },              \
  136         { "wfq",                &ng_parse_uint32_type   },              \
  137         { "droptail",           &ng_parse_uint32_type   },              \
  138         { "drophead",           &ng_parse_uint32_type   },              \
  139         { NULL },                                                       \
  140 }
  141 
  142 /* Config structure returned by NGM_PIPE_GET_CFG */
  143 struct ng_pipe_cfg {
  144         u_int64_t               bandwidth;
  145         u_int64_t               delay;
  146         u_int32_t               header_offset;
  147         u_int32_t               overhead;
  148         struct ng_pipe_hookcfg  downstream;
  149         struct ng_pipe_hookcfg  upstream;
  150 };
  151 
  152 /* Keep this in sync with the above structure definition */
  153 #define NG_PIPE_CFG_INFO(hstype)        {                               \
  154         { "bandwidth",          &ng_parse_uint64_type   },              \
  155         { "delay",              &ng_parse_uint64_type   },              \
  156         { "header_offset",      &ng_parse_uint32_type   },              \
  157         { "overhead",           &ng_parse_uint32_type   },              \
  158         { "downstream",         (hstype)                },              \
  159         { "upstream",           (hstype)                },              \
  160         { NULL },                                                       \
  161 }
  162 
  163 /* Netgraph commands */
  164 enum {
  165         NGM_PIPE_GET_STATS=1,           /* get stats */
  166         NGM_PIPE_CLR_STATS,             /* clear stats */
  167         NGM_PIPE_GETCLR_STATS,          /* atomically get and clear stats */
  168         NGM_PIPE_GET_RUN,               /* get current runtime status */
  169         NGM_PIPE_GET_CFG,               /* get configurable parameters */
  170         NGM_PIPE_SET_CFG,               /* set configurable parameters */
  171 };
  172 
  173 #endif /* _NETGRAPH_PIPE_H_ */

Cache object: ca9e00cbf26cb046c9b85b67d5c743b1


[ 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.