Re: [PATCH iproute2-next 7/9] Add support for nexthop objects

2019-05-30 Thread Roopa Prabhu
On Wed, May 29, 2019 at 9:04 PM David Ahern wrote: > > From: David Ahern > > Add nexthop subcommand to ip. Implement basic commands for creating, > deleting and dumping nexthop objects. Syntax follows 'nexthop' syntax > from existing 'ip route' command. > > Signed-off-by: David Ahern If you are

Re: [PATCH iproute2-next 7/9] Add support for nexthop objects

2019-05-30 Thread David Ahern
On 5/30/19 11:52 AM, Stephen Hemminger wrote: > On Wed, 29 May 2019 20:17:44 -0700 > David Ahern wrote: > >> + >> +static void print_nh_gateway(FILE *fp, const struct nhmsg *nhm, >> + const struct rtattr *rta) >> +{ >> +const char *gateway = format_host_rta(nhm->nh_fa

Re: [PATCH iproute2-next 7/9] Add support for nexthop objects

2019-05-30 Thread David Ahern
On 5/30/19 11:45 AM, Stephen Hemminger wrote: > On Wed, 29 May 2019 20:17:44 -0700 > David Ahern wrote: > >> + >> +struct rtnl_handle rth_del = { .fd = -1 }; >> + > > can this be static? > oops, yes, it should be

Re: [PATCH iproute2-next 7/9] Add support for nexthop objects

2019-05-30 Thread Stephen Hemminger
On Wed, 29 May 2019 20:17:44 -0700 David Ahern wrote: > + > +static void print_nh_gateway(FILE *fp, const struct nhmsg *nhm, > + const struct rtattr *rta) > +{ > + const char *gateway = format_host_rta(nhm->nh_family, rta); > + > + if (is_json_context()) > +

Re: [PATCH iproute2-next 7/9] Add support for nexthop objects

2019-05-30 Thread David Ahern
On 5/30/19 11:45 AM, Stephen Hemminger wrote: > On Wed, 29 May 2019 20:17:44 -0700 > David Ahern wrote: > >> +static struct >> +{ > > kernel style is: > > static struct { > ... > The style I used is consistent with existing code -- e.g., ip/iproute.c. If you want the above, I can do that.

Re: [PATCH iproute2-next 7/9] Add support for nexthop objects

2019-05-30 Thread Stephen Hemminger
On Wed, 29 May 2019 20:17:44 -0700 David Ahern wrote: > + > +struct rtnl_handle rth_del = { .fd = -1 }; > + can this be static?

Re: [PATCH iproute2-next 7/9] Add support for nexthop objects

2019-05-30 Thread Stephen Hemminger
On Wed, 29 May 2019 20:17:44 -0700 David Ahern wrote: > +static struct > +{ kernel style is: static struct { ...

[PATCH iproute2-next 7/9] Add support for nexthop objects

2019-05-29 Thread David Ahern
From: David Ahern Add nexthop subcommand to ip. Implement basic commands for creating, deleting and dumping nexthop objects. Syntax follows 'nexthop' syntax from existing 'ip route' command. Signed-off-by: David Ahern --- ip/Makefile| 3 +- ip/ip.c| 3 +- ip/ip_common.h | 2 +