~ubuntu-branches/ubuntu/wily/openvswitch/wily

« back to all changes in this revision

Viewing changes to datapath/linux/compat/include/net/genetlink.h

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-08-10 11:35:15 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20150810113515-575vj06oq29emxsn
Tags: 2.4.0~git20150810.97bab95-0ubuntu1
* New upstream snapshot from 2.4 branch:
  - d/*: Align any relevant packaging changes with upstream.
* d/*: wrap-and-sort.
* d/openvswitch-{common,vswitch}.install: Correct install location for
  bash completion files.
* d/tests/openflow.py: Explicitly use ovs-testcontroller as provided
  by 2.4.0 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
#define genl_family rpl_genl_family
47
47
#define genl_notify rpl_genl_notify
48
 
void genl_notify(struct genl_family *family,
49
 
                 struct sk_buff *skb, struct net *net, u32 portid, u32 group,
50
 
                 struct nlmsghdr *nlh, gfp_t flags);
 
48
void rpl_genl_notify(struct genl_family *family,
 
49
                     struct sk_buff *skb, struct net *net, u32 portid, u32 group,
 
50
                     struct nlmsghdr *nlh, gfp_t flags);
51
51
 
52
52
static inline void *rpl_genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq,
53
53
                                    struct genl_family *family, int flags, u8 cmd)
105
105
}
106
106
#endif
107
107
 
 
108
#ifndef HAVE_GENL_HAS_LISTENERS
 
109
static inline int genl_has_listeners(struct genl_family *family,
 
110
                                     struct net *net, unsigned int group)
 
111
{
 
112
#ifdef HAVE_MCGRP_OFFSET
 
113
        if (WARN_ON_ONCE(group >= family->n_mcgrps))
 
114
                return -EINVAL;
 
115
        group = family->mcgrp_offset + group;
 
116
#endif
 
117
        return netlink_has_listeners(net->genl_sock, group);
 
118
}
 
119
#else
 
120
 
 
121
#ifndef HAVE_GENL_HAS_LISTENERS_TAKES_NET
 
122
static inline int rpl_genl_has_listeners(struct genl_family *family,
 
123
                                         struct net *net, unsigned int group)
 
124
{
 
125
#ifdef HAVE_GENL_NOTIFY_TAKES_FAMILY
 
126
    return genl_has_listeners(family, net->genl_sock, group);
 
127
#else
 
128
    return genl_has_listeners(&family->compat_family, net->genl_sock, group);
 
129
#endif
 
130
}
 
131
 
 
132
#define genl_has_listeners rpl_genl_has_listeners
 
133
#endif
 
134
 
 
135
#endif /* HAVE_GENL_HAS_LISTENERS */
 
136
 
 
137
#ifndef HAVE_GENLMSG_PARSE
 
138
static inline int genlmsg_parse(const struct nlmsghdr *nlh,
 
139
                                const struct genl_family *family,
 
140
                                struct nlattr *tb[], int maxtype,
 
141
                                const struct nla_policy *policy)
 
142
{
 
143
        return nlmsg_parse(nlh, family->hdrsize + GENL_HDRLEN, tb, maxtype,
 
144
                           policy);
 
145
}
 
146
#endif
 
147
 
108
148
#endif /* genetlink.h */