#if defined(CONFIG_BLOG) #ifndef __BLOG_RULE_H_INCLUDED__ #define __BLOG_RULE_H_INCLUDED__ /* * <:copyright-BRCM:2010:DUAL/GPL:standard * * Copyright (c) 2010 Broadcom * All Rights Reserved * * Unless you and Broadcom execute a separate written software license * agreement governing use of this software, this software is licensed * to you under the terms of the GNU General Public License version 2 * (the "GPL"), available at http://www.broadcom.com/licenses/GPLv2.php, * with the following added to such license: * * As a special exception, the copyright holders of this software give * you permission to link this software with independent modules, and * to copy and distribute the resulting executable under terms of your * choice, provided that you also meet, for each linked independent * module, the terms and conditions of the license of that module. * An independent module is a module which is not derived from this * software. The special exception does not apply to any modifications * of the software. * * Not withstanding the above, under no circumstances may you combine * this software in any way with any other Broadcom software provided * under a license other than the GPL, without Broadcom's express prior * written consent. * :> */ /* ******************************************************************************* * * File Name : blog_rule.h * * Description: Blog rules are extensions to a Blog structure that can be used * to specify additional fiters and modifications. * ******************************************************************************* */ #define CC_CONFIG_BLOG_RULE_DEBUG #define BLOG_RULE_VERSION "v1.0" #define BLOG_RULE_VLAN_TAG_MAX 3 #define BLOG_RULE_ACTION_MAX 16 #define BLOG_RULE_PBITS_MASK 0xE000 #define BLOG_RULE_PBITS_SHIFT 13 #define BLOG_RULE_DEI_MASK 0x1000 #define BLOG_RULE_DEI_SHIFT 12 #define BLOG_RULE_VID_MASK 0x0FFF #define BLOG_RULE_VID_SHIFT 0 #define BLOG_RULE_GET_TCI_PBITS(_tci) \ ( ((_tci) & BLOG_RULE_PBITS_MASK) >> BLOG_RULE_PBITS_SHIFT ) #define BLOG_RULE_GET_TCI_DEI(_tci) \ ( ((_tci) & BLOG_RULE_DEI_MASK) >> BLOG_RULE_DEI_SHIFT ) #define BLOG_RULE_GET_TCI_VID(_tci) \ ( (_tci) & BLOG_RULE_VID_MASK ) #define BLOG_RULE_DSCP_IN_TOS_MASK 0xFC #define BLOG_RULE_DSCP_IN_TOS_SHIFT 2 #define BLOG_RULE_IP_PROTO_MASK 0xFF #define BLOG_RULE_IP_PROTO_SHIFT 0 #define BLOG_RULE_IP6_NXT_HDR_MASK 0xFF #define BLOG_RULE_IP6_NXT_HDR_SHIFT 0 #define blog_rule_filterInUse(_filter) \ ({ \ char *_filter_p = (char *)(&_filter); \ int _i, _val; \ for(_i=0; _i