]> git.proxmox.com Git - mirror_iproute2.git/commit - tipc/link.c
tipc: add the ability to get UDP bearer options
authorRichard Alpe <richard.alpe@ericsson.com>
Tue, 30 Aug 2016 08:37:00 +0000 (10:37 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 1 Sep 2016 15:34:35 +0000 (08:34 -0700)
commited81deabf2bf3694d0624b7063c8a99f3e2bc7d9
tree083027ba365c07672cf2bc7b8db340a36c271477
parentf1f40cf77dbe80a397c4f16136c721cb9cfbaecd
tipc: add the ability to get UDP bearer options

In this patch we introduce the ability to get UDP specific bearer
options such as remoteip, remoteport, localip and localport.

After some discussions on tipc-discussion on how to handle media
specific options we agreed to pass them after the media.

For media generic bearer options we already do:
$ tipc bearer get OPTION media MEDIA name|device NAME|DEVICE

For the UDP media specific bearer options we introduce in this path:
$ tipc bearer get media udp name NAME OPTION
such as
$ tipc bearer get media udp name NAME remoteip

This allows bash-completion to tab complete only appropriate options,
it makes more logical sense and it scales better. Even though it might
look a little different to the user.

In order to use the existing option parsing framework to do this we
add a flag (OPT_KEY) to the option parsing function.

If the UDP bearer has multiple remoteip addresses associated with it
(replicast) we handle the TIPC_NLA_UDP_MULTI_REMOTEIP flag and send
a TIPC_NL_UDP_GET_REMOTEIP query transparently to the user.

Signed-off-by: Richard Alpe <richard.alpe@ericsson.com>
Reviewed-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
man/man8/tipc-bearer.8
tipc/bearer.c
tipc/cmdl.c
tipc/cmdl.h
tipc/link.c
tipc/media.c