Changeset 32721


Ignore:
Timestamp:
Jul 16, 2017, 10:38:46 PM (4 weeks ago)
Author:
brainslayer
Message:

merge fixes

Location:
src/linux/universal/linux-3.2/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.2/include/linux/hashtable.h

    r32658 r32721  
    119119 * @member: the name of the hlist_node within the struct
    120120 */
    121 #define hash_for_each(h, name, bkt, obj, member)                                \
     121#define hash_for_each(name, bkt, h, obj, member)                                \
    122122        for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\
    123123                        (bkt)++)\
     
    131131 * @member: the name of the hlist_node within the struct
    132132 */
    133 #define hash_for_each_rcu(h, name, bkt, obj, member)                    \
     133#define hash_for_each_rcu(name, bkt,h, obj, member)                     \
    134134        for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\
    135135                        (bkt)++)\
     
    145145 * @member: the name of the hlist_node within the struct
    146146 */
    147 #define hash_for_each_safe(h, name, bkt, tmp, obj, member)                      \
     147#define hash_for_each_safe(name, bkt, h, tmp, obj, member)                      \
    148148        for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\
    149149                        (bkt)++)\
     
    158158 * @key: the key of the objects to iterate over
    159159 */
    160 #define hash_for_each_possible(h, name, obj, member, key)                       \
     160#define hash_for_each_possible(name, obj, h, member, key)                       \
    161161        hlist_for_each_entry(obj, h, &name[hash_min(key, HASH_BITS(name))], member)
    162162
     
    170170 * @key: the key of the objects to iterate over
    171171 */
    172 #define hash_for_each_possible_rcu(h, name, obj, member, key)           \
     172#define hash_for_each_possible_rcu(name, obj, h, member, key)           \
    173173        hlist_for_each_entry_rcu(obj, h, &name[hash_min(key, HASH_BITS(name))],\
    174174                member)
     
    183183 * @key: the key of the objects to iterate over
    184184 */
    185 #define hash_for_each_possible_safe(h, name, obj, tmp, member, key)     \
     185#define hash_for_each_possible_safe(name, obj, h, tmp, member, key)     \
    186186        hlist_for_each_entry_safe(obj, tmp,\
    187187                &name[hash_min(key, h, HASH_BITS(name))], member)
  • src/linux/universal/linux-3.2/include/net/netfilter/nf_conntrack_dscpremark_ext.h

    r32697 r32721  
    9898#endif /* CONFIG_NF_CONNTRACK_DSCPREMARK_EXT */
    9999#endif /* _NF_CONNTRACK_DSCPREMARK_H */
     100/*
     101 **************************************************************************
     102 * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
     103B * Permission to use, copy, modify, and/or distribute this software for
     104 * any purpose with or without fee is hereby granted, provided that the
     105 * above copyright notice and this permission notice appear in all copies.
     106 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     107 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     108 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     109 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     110 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     111 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
     112 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     113 **************************************************************************
     114 */
     115
     116/* DSCP remark conntrack extension APIs. */
     117
     118#ifndef _NF_CONNTRACK_DSCPREMARK_H
     119#define _NF_CONNTRACK_DSCPREMARK_H
     120#include <net/netfilter/nf_conntrack.h>
     121#include <net/netfilter/nf_conntrack_extend.h>
     122
     123/* Rule flags */
     124#define NF_CT_DSCPREMARK_EXT_DSCP_RULE_VALID 0x1
     125
     126/* Rule validity */
     127#define NF_CT_DSCPREMARK_EXT_RULE_VALID 0x1
     128#define NF_CT_DSCPREMARK_EXT_RULE_NOT_VALID 0x0
     129
     130/*
     131 * DSCP remark conntrack extension structure.
     132 */
     133struct nf_ct_dscpremark_ext {
     134        __u32 flow_priority;    /* Original direction packet priority */
     135        __u32 reply_priority;   /* Reply direction packet priority */
     136        __u8 flow_dscp;         /* IP DSCP value for original direction */
     137        __u8 reply_dscp;        /* IP DSCP value for reply direction */
     138        __u16 rule_flags;       /* Rule Validity flags */
     139};
     140
     141/*
     142 * nf_ct_dscpremark_ext_find()
     143 *      Finds the extension data of the conntrack entry if it exists.
     144 */
     145static inline struct nf_ct_dscpremark_ext *
     146nf_ct_dscpremark_ext_find(const struct nf_conn *ct)
     147{
     148#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT
     149        return nf_ct_ext_find(ct, NF_CT_EXT_DSCPREMARK);
     150#else
     151        return NULL;
     152#endif
     153}
     154
     155/*
     156 * nf_ct_dscpremark_ext_add()
     157 *      Adds the extension data to the conntrack entry.
     158 */
     159static inline
     160struct nf_ct_dscpremark_ext *nf_ct_dscpremark_ext_add(struct nf_conn *ct,
     161                                                      gfp_t gfp)
     162{
     163#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT
     164        struct nf_ct_dscpremark_ext *ncde;
     165
     166        ncde = nf_ct_ext_add(ct, NF_CT_EXT_DSCPREMARK, gfp);
     167        if (!ncde)
     168                return NULL;
     169
     170        return ncde;
     171#else
     172        return NULL;
     173#endif
     174};
     175
     176#ifdef CONFIG_NF_CONNTRACK_DSCPREMARK_EXT
     177extern int nf_conntrack_dscpremark_ext_init(void);
     178extern void nf_conntrack_dscpremark_ext_fini(void);
     179extern int nf_conntrack_dscpremark_ext_set_dscp_rule_valid(struct nf_conn *ct);
     180extern int
     181nf_conntrack_dscpremark_ext_get_dscp_rule_validity(struct nf_conn *ct);
     182#else
     183/*
     184 * nf_conntrack_dscpremark_ext_init()
     185 */
     186static inline int nf_conntrack_dscpremark_ext_init(void)
     187{
     188        return 0;
     189}
     190
     191/*
     192 * nf_conntrack_dscpremark_ext_fini()
     193 */
     194static inline void nf_conntrack_dscpremark_ext_fini(void)
     195{
     196}
     197#endif /* CONFIG_NF_CONNTRACK_DSCPREMARK_EXT */
     198#endif /* _NF_CONNTRACK_DSCPREMARK_H */
Note: See TracChangeset for help on using the changeset viewer.