Message ID | CAMw6YJJq1MP+r6=8KrhBi9bPUS8E1JJjb3qOjbjVf4Ano0AVsA@mail.gmail.com |
---|---|
State | RFC, archived |
Delegated to: | stephen hemminger |
Headers | show |
Sorry, this it not patch for probably applying, it was get into patchwork queue after I copy pasted here the diff, this is only for discussing. Regards, On Wed, Sep 3, 2014 at 2:46 AM, Vadim Kochan <vadim4j@gmail.com> wrote: > Hi all, > > I am thinking about to make some refactoring and change the signature > of all rtnl dump filters to form: > > diff --git a/include/libnetlink.h b/include/libnetlink.h > index fe7d5d3..9514e67 100644 > --- a/include/libnetlink.h > +++ b/include/libnetlink.h > @@ -39,8 +39,14 @@ extern int rtnl_dump_request(struct rtnl_handle > *rth, int type, void *req, > int len) > __attribute__((warn_unused_result)); > > -typedef int (*rtnl_filter_t)(const struct sockaddr_nl *, > - struct nlmsghdr *n, void *); > +struct nl_param > +{ > + struct sockaddr_nl *who; > + struct nlmsghdr *n; > + void *arg; > +}; > + > +typedef int (*rtnl_filter_t)(struct nl_param *p); > > struct rtnl_dump_filter_arg > { > > What do you think? > > Regards, -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/libnetlink.h b/include/libnetlink.h index fe7d5d3..9514e67 100644 --- a/include/libnetlink.h +++ b/include/libnetlink.h @@ -39,8 +39,14 @@ extern int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len) __attribute__((warn_unused_result)); -typedef int (*rtnl_filter_t)(const struct sockaddr_nl *, - struct nlmsghdr *n, void *); +struct nl_param +{ + struct sockaddr_nl *who; + struct nlmsghdr *n; + void *arg; +}; + +typedef int (*rtnl_filter_t)(struct nl_param *p); struct rtnl_dump_filter_arg