#if defined(CONFIG_BCM_KF_BLOG) #ifndef __BLOG_RULE_H_INCLUDED__ #define __BLOG_RULE_H_INCLUDED__ /* * <:copyright-BRCM:2010:DUAL/GPL:standard * * Copyright (c) 2010 Broadcom * All Rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as published by * the Free Software Foundation (the "GPL"). * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * * A copy of the GPL is available at http://www.broadcom.com/licenses/GPLv2.php, or by * writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * :> */ /* ******************************************************************************* * * 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 2 #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