/*
* Copyright (C) 1999-2002
* Sony Computer Science Laboratories Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY SONY CSL AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL SONY CSL OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#define TCACODE_NONE 0 /* action is not set */
#define TCACODE_PASS 1 /* pass this packet */
#define TCACODE_DROP 2 /* discard this packet */
#define TCACODE_RETURN 3 /* do not process this packet */
#define TCACODE_MARK 4 /* mark dscp */
#define TCACODE_HANDLE 5 /* take action specified by handle */
#define TCACODE_NEXT 6 /* take action in the next tc element */
#define TCACODE_MAX 6
/* element stats */
int nskip; /* skip # of elements */
int nelements; /* # of element stats (WR) */
struct tce_stats *tce_stats; /* pointer to stats array */
};
/*
* packet information passed to the input function of tc elements
*/
struct cdnr_pktinfo {
int pkt_len; /* packet length */
u_int8_t pkt_dscp; /* diffserv code point */
};
/*
* traffic conditioner control block common to all types of tc elements
*/
struct cdnr_block {
LIST_ENTRY(cdnr_block) cb_next;
int cb_len; /* size of this tc element */
int cb_type; /* cdnr block type */
int cb_ref; /* reference count of this element */
u_long cb_handle; /* handle of this tc element */
struct top_cdnr *cb_top; /* back pointer to top */
struct tc_action cb_action; /* top level action for this tcb */
struct tc_action *(*cb_input)(struct cdnr_block *,
struct cdnr_pktinfo *);
};
/*
* top level traffic conditioner structure for an interface
*/
struct top_cdnr {
struct cdnr_block tc_block;