All of lore.kernel.org
 help / color / mirror / Atom feed
* iproute2 util: Change signature of rtnl dump filters to use struct params
@ 2014-09-02 23:46 Vadim Kochan
  2014-09-03  7:32 ` Vadim Kochan
  0 siblings, 1 reply; 2+ messages in thread
From: Vadim Kochan @ 2014-09-02 23:46 UTC (permalink / raw)
  To: netdev

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,

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: iproute2 util: Change signature of rtnl dump filters to use struct params
  2014-09-02 23:46 iproute2 util: Change signature of rtnl dump filters to use struct params Vadim Kochan
@ 2014-09-03  7:32 ` Vadim Kochan
  0 siblings, 0 replies; 2+ messages in thread
From: Vadim Kochan @ 2014-09-03  7:32 UTC (permalink / raw)
  To: netdev

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,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-03  7:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-02 23:46 iproute2 util: Change signature of rtnl dump filters to use struct params Vadim Kochan
2014-09-03  7:32 ` Vadim Kochan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.