static void br_pass_frame_up(struct net_bridge *br, struct sk_buff *skb)
{
	struct net_device *indev, *brdev = br->dev;

#if defined(CONFIG_MIPS_BRCM) && defined(CONFIG_BLOG)
	blog_link(IF_DEVICE, blog_ptr(skb), (void*)br->dev, DIR_RX, skb->len);
#endif

#if defined(CONFIG_BR_IGMP_STATISTIC)
    if ( !is_multicast_ether_addr(eth_hdr(skb)->h_dest) )
    {
        if ( IS_LAN_DEV(skb->dev->name) )
        {
            /* 上行流转发设备数据报文统计 */
            br_igmp_statistic_inc(skb,IGMP_UP_REQUEST_PACKET);
        }
    }
#endif    
	brdev->stats.rx_packets++;
	brdev->stats.rx_bytes += skb->len;

	indev = skb->dev;
    /* add lan interface (eth0.5) in iptables 20090217 */
    skb->lanindev = indev;
	skb->dev = brdev;

	NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, indev, NULL,
		netif_receive_skb);
}
Exemple #2
0
static void br_pass_frame_up(struct net_bridge *br, struct sk_buff *skb)
{
	struct net_device *indev, *brdev = br->dev;

#if defined(CONFIG_MIPS_BRCM) && defined(CONFIG_BLOG)
	blog_link(IF_DEVICE, blog_ptr(skb), (void*)br->dev, DIR_RX, skb->len);
#endif

	brdev->stats.rx_packets++;
	brdev->stats.rx_bytes += skb->len;

	indev = skb->dev;
	skb->dev = brdev;

	NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, indev, NULL,
		netif_receive_skb);
}
Exemple #3
0
basics::Persistable_blog basics::Persistor_blog::read_blog(bfs::path content_storage_file)
{
    // Parsing content from file
    rapidxml::xml_document<> content;
    rapidxml::file<> content_file(content_storage_file.string().c_str());

    // Retreiving root node
    content.parse<0>(content_file.data());
    rapidxml::xml_node<> *blog_root = content.first_node("blog");

    // Retreiving config
    rapidxml::xml_node<> *conf = blog_root->first_node("config");
    basics::Configuration_blog config(nv(conf, "meta-desc"),
                                      nv(conf, "meta-author"),
                                      nv(conf, "meta-title"),
                                      nv(conf, "meta-conf-bootstrap"),
                                      nv(conf, "meta-conf-css"),
                                      nvs(conf, "nav-items"),
                                      nv(conf, "home-link"),
                                      nv(conf, "title"),
                                      nv(conf, "subtitle"),
                                      nv(conf, "about"),
                                      av(conf, "about", "line"),
                                      nvs(conf, "links"),
                                      av(conf, "links", "line"),
                                      nv(conf, "philosophy"),
                                      nv(conf, "backtotop"),
                                      std::stoi(nv(conf, "post-per-page")));


    // Iterating over "post" nodes
    rapidxml::xml_node<> *post_node = blog_root->first_node("posts");
    std::vector<basics::Post> posts;
    rapidxml::xml_node<> *post;
    for (post = post_node->first_node("post"); post; post = post->next_sibling("post")) {
        // Attributes
        std::string timestamp_str = post->first_attribute("date")->value();
        std::string author = post->first_attribute("author")->value();

        // title child node
        rapidxml::xml_node<> *title_node = post->first_node("title");
        std::string title = title_node->value();

        // mylife child node
        rapidxml::xml_node<> *life_node = post->first_node("mylife");
        std::string life = basics::unescape_string(life_node->value());

        // Reading editions
        rapidxml::xml_node<> *eds = post->first_node("editions");
        std::vector<std::string> editions;
        rapidxml::xml_node<> *ed;
        for (ed = eds->first_node("edition"); ed; ed = ed->next_sibling("edition")) {
            std::string edition = ed->value();
            editions.push_back(edition);
        }

        // Creating a new Post object from all infos
        basics::Post another_post(title, author, life, timestamp_str);
        another_post.set_editions(editions);

        posts.push_back(another_post);
    }

    basics::Persistable_blog blog_ptr(posts, config);
    return blog_ptr;
}
static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
	struct net_device_stats *stats = &dev->stats;
	struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data);

	/* Handle non-VLAN frames if they are sent to us, for example by DHCP.
	 *
	 * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING
	 * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs...
	 */
	if (veth->h_vlan_proto != htons(ETH_P_8021Q) ||
	    vlan_dev_info(dev)->flags & VLAN_FLAG_REORDER_HDR) {
		unsigned int orig_headroom = skb_headroom(skb);
		u16 vlan_tci;

		vlan_dev_info(dev)->cnt_encap_on_xmit++;

		vlan_tci = vlan_dev_info(dev)->vlan_id;
		vlan_tci |= vlan_dev_get_egress_qos_mask(dev, skb);
        /* 802.1p remark */
        /*Start of modified by f00120964 for qos function 2012-1-6*/
#if defined(CONFIG_IMQ) && !defined(CONFIG_DT_QOS)
        /* mark -----|-----|-------|------|-------|-----|------|------  */
        /* START OF Add: t00163975 2011-05-21 FOR 移植BCM Eth上行的QoS */
        /* START Modify by l00184769 20110708 把原来的为hhb3写的else分支去掉,使得与通用代码一致 */
        /* BCM Eth qos     lan |dscp |default|  wmm |      |802.1p|policer|queue */
        /* IMQ QOS |802.1p|queue|policer */
        if (skb->mark & 0x10)        
        {            
            vlan_tci = ((vlan_tci & 0x1fff) | ((skb->mark & 0xe0) << 8));        
        }
        /* END Modify by l00184769 20110708 把原来的为hhb3写的else分支去掉,使得与通用代码一致 */
        /* END OF Add: t00163975 2011-05-21 */

    	if (__constant_htons(ETH_P_PPP_SES) == skb->protocol) 
    	{
            /* PPP_LCP = 0xc021 802.1p mark 7 */
    	    if ((0xc0 == skb->data[20]) && (0x21 == skb->data[21]))
            {
                vlan_tci = ((vlan_tci & 0x1fff) | (0xe000));
            }
    	}        
#endif

#ifdef CONFIG_DT_QOS
	vlan_tci |= (s_dtQosMarkto8021P[(skb->mark & 0x7)] << 13);
#endif

	 /*End of modified by f00120964 for qos function 2012-1-6*/
#ifdef CONFIG_BCM96362
        /* |lan |dscp |default|wmm |    |802.1p|policer|queue| */
        if (skb->mark & 0x100)        
        {            
            vlan_tci = ((vlan_tci & 0x1fff) | ((skb->mark & 0xe00) << 4));        
        }
#endif

		skb = __vlan_put_tag(skb, vlan_tci);
		if (!skb) {
			stats->tx_dropped++;
			return NETDEV_TX_OK;
		}

		if (orig_headroom < VLAN_HLEN)
			vlan_dev_info(dev)->cnt_inc_headroom_on_tx++;
	}
	
/* Start of add by z00202017 2011/12/28 for Internet LED */
#if defined(CONFIG_BCM963268) && defined(CONFIG_BLOG)
    blog_link(IF_DEVICE, blog_ptr(skb), (void*)dev, DIR_TX, skb->len );
#endif
/* End of add by z00202017 2011/12/28 for Internet LED */

	stats->tx_packets++;
	stats->tx_bytes += skb->len;

	skb->dev = vlan_dev_info(dev)->real_dev;
	dev_queue_xmit(skb);
	return NETDEV_TX_OK;
}