[PATCH iproute2] tipc: add man pages

2015-10-02 Thread richard.alpe
From: Richard Alpe 

This patch adds man pages for the TIPC tool. There is one main page
and one page for each top level sub-command. These pages mainly aims
to help a user of the tipc tool. In addition to this they describe
a bit about what TIPC is and some of its features as a protocol.

Signed-off-by: Richard Alpe 
Reviewed-by: Erik Hugne 
Reviewed-by: Jon Maloy 
---
 man/man8/tipc-bearer.8| 230 ++
 man/man8/tipc-link.8  | 225 +
 man/man8/tipc-media.8 |  86 +
 man/man8/tipc-nametable.8 |  99 
 man/man8/tipc-node.8  |  71 ++
 man/man8/tipc-socket.8|  59 
 man/man8/tipc.8   |  99 
 7 files changed, 869 insertions(+)
 create mode 100644 man/man8/tipc-bearer.8
 create mode 100644 man/man8/tipc-link.8
 create mode 100644 man/man8/tipc-media.8
 create mode 100644 man/man8/tipc-nametable.8
 create mode 100644 man/man8/tipc-node.8
 create mode 100644 man/man8/tipc-socket.8
 create mode 100644 man/man8/tipc.8

diff --git a/man/man8/tipc-bearer.8 b/man/man8/tipc-bearer.8
new file mode 100644
index 000..f59c39d
--- /dev/null
+++ b/man/man8/tipc-bearer.8
@@ -0,0 +1,230 @@
+.TH TIPC-BEARER 8 "02 Jun 2015" "iproute2" "Linux"
+
+./ For consistency, please keep padding right aligned.
+./ For example '.B "foo " bar' and not '.B foo " bar"'
+
+.SH NAME
+tipc-bearer \- show or modify TIPC bearers
+
+.SH SYNOPSIS
+.ad l
+.in +8
+
+.ti -8
+.B tipc bearer enable
+.RB "[ " domain
+.IR DOMAIN " ]"
+.RB "[ " priority
+.IR PRIORITY " ]"
+.BR media
+.br
+.RB "{ { " eth " | " ib " } " device
+.IR "DEVICE" " }"
+.RB "|"
+.br
+.RB"{ " udp
+.B name
+.IR NAME
+.B localip
+.IR LOCALIP
+.RB "[ " localport
+.IR LOCALPORT " ]"
+.RB "[ " remoteip
+.IR REMOTEIP " ]"
+.RB "[ " remoteport
+.IR REMOTEPORT " ] }"
+.br
+
+.ti -8
+.B tipc bearer disable media
+.br
+.RB "{ { " eth " | " ib " } " device
+.IR DEVICE
+.RB "|"
+.br
+.RB "{ " udp
+.B name
+.IR NAME
+.B localip
+.IR LOCALIP " } }"
+.br
+
+.ti -8
+.B tipc bearer set
+.RB "{ " "priority "
+.IR PRIORITY
+.RB "| " tolerance
+.IR TOLERANCE
+.RB "| " window
+.IR WINDOW
+.RB "} " media
+.br
+.RB "{ { " eth " | " ib " } " device
+.IR "DEVICE" " }"
+.RB "|"
+.br
+.RB "{ " udp
+.B name
+.IR NAME
+.B localip
+.IR LOCALIP " } }"
+.br
+
+.ti -8
+.B tipc bearer get
+.RB "{ " "priority" " | " tolerance " | " window " } " media
+.br
+.RB "{ { " eth " | " ib " } " device
+.IR "DEVICE" " }"
+.RB "|"
+.br
+.RB "{ " udp
+.B name
+.IR NAME
+.B localip
+.IR LOCALIP " } }"
+.br
+
+.ti -8
+.B tipc bearer list
+.br
+
+.SH OPTIONS
+Options (flags) that can be passed anywhere in the command chain.
+.TP
+.BR "\-h" , " --help"
+Show help about last valid command. For example
+.B tipc bearer --help
+will show bearer help and
+.B tipc --help
+will show general help. The position of the option in the string is irrelevant.
+.SH DESCRIPTION
+
+.SS Bearer identification
+.TP
+.BI "media " MEDIA
+.br
+Specifies the TIPC media type for a particular bearer to operate on.
+Different media types have different ways of identifying a unique bearer.
+For example,
+.BR "ib " "and " eth
+identify a bearer with a
+.I DEVICE
+while
+.B udp
+identify a bearer with a
+.IR "LOCALIP " "and a " NAME
+
+.B ib
+- Infiniband
+.sp
+.B eth
+- Ethernet
+.sp
+.B udp
+- User Datagram Protocol (UDP)
+.sp
+
+.TP
+.BI "name " NAME
+.br
+Logical bearer identifier valid for bearers on
+.B udp
+media.
+
+.TP
+.BI "device " DEVICE
+.br
+Physical bearer device valid for bearers on
+.B eth
+and
+.B ib
+media.
+
+.SS Bearer properties
+
+.TP
+.B domain
+.br
+The addressing domain (region) in which a bearer will establish links and 
accept
+link establish requests.
+
+.TP
+.B priority
+.br
+Default link priority inherited by all links subsequently established over a
+bearer. A single bearer can only host one link to a particular node. This means
+the default link priority for a bearer typically affects which bearer to use
+when communicating with a particular node in an multi bearer setup. For more
+info about link priority see
+.BR tipc-link (8)
+
+.TP
+.B tolerance
+.br
+Default link tolerance inherited by all links subsequently established over a
+bearer. For more info about link tolerance see
+.BR tipc-link (8)
+
+.TP
+.B window
+.br
+Default link window inherited by all links subsequently established over a
+bearer. For more info about the link window size see
+.BR tipc-link (8)
+
+.SS UDP bearer options
+
+.TP
+.BI "localip " LOCALIP
+.br
+Specify a local IP v4/v6 address for a
+.B udp
+bearer.
+
+.TP
+.BI "localport " LOCALPORT
+.br
+Specify the local port for a
+.B udp
+bearer. The default port 6118 is used if no port is specified.
+
+.TP
+.BI "remoteip " REMOTEIP
+.br
+Specify a remote IP for a
+.B udp
+bearer. If no remote IP is specified a
+.B udp
+bearer runs in multicast mode and tries to auto-discover its neighbours.
+The multicast IP address

[PATCH iproute2] tipc: fix bearer get/set help synopsis

2015-08-07 Thread richard.alpe
From: Richard Alpe 

One option is required for bearer set and bearer get.
---
 tipc/bearer.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tipc/bearer.c b/tipc/bearer.c
index 33295f9..30b54d9 100644
--- a/tipc/bearer.c
+++ b/tipc/bearer.c
@@ -412,7 +412,7 @@ static int cmd_bearer_disable(struct nlmsghdr *nlh, const 
struct cmd *cmd,
 
 static void cmd_bearer_set_help(struct cmdl *cmdl)
 {
-   fprintf(stderr, "Usage: %s bearer set [OPTIONS] media MEDIA ARGS...\n",
+   fprintf(stderr, "Usage: %s bearer set OPTION media MEDIA ARGS...\n",
cmdl->argv[0]);
_print_bearer_opts();
_print_bearer_media();
@@ -420,7 +420,7 @@ static void cmd_bearer_set_help(struct cmdl *cmdl)
 
 static void cmd_bearer_set_udp_help(struct cmdl *cmdl)
 {
-   fprintf(stderr, "Usage: %s bearer set [OPTIONS] media udp name 
NAME\n\n",
+   fprintf(stderr, "Usage: %s bearer set OPTION media udp name NAME\n\n",
cmdl->argv[0]);
_print_bearer_opts();
 }
@@ -528,7 +528,7 @@ static int cmd_bearer_set(struct nlmsghdr *nlh, const 
struct cmd *cmd,
 
 static void cmd_bearer_get_help(struct cmdl *cmdl)
 {
-   fprintf(stderr, "Usage: %s bearer get [OPTIONS] media MEDIA ARGS...\n",
+   fprintf(stderr, "Usage: %s bearer get OPTION media MEDIA ARGS...\n",
cmdl->argv[0]);
_print_bearer_opts();
_print_bearer_media();
@@ -536,7 +536,7 @@ static void cmd_bearer_get_help(struct cmdl *cmdl)
 
 static void cmd_bearer_get_udp_help(struct cmdl *cmdl)
 {
-   fprintf(stderr, "Usage: %s bearer get [OPTIONS] media udp name 
NAME\n\n",
+   fprintf(stderr, "Usage: %s bearer get OPTION media udp name NAME\n\n",
cmdl->argv[0]);
_print_bearer_opts();
 }
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next] tipc: don't sanity check non-existing TLV (NL compat)

2015-08-17 Thread richard.alpe
From: Richard Alpe 

A zero length payload means that no TLV (Type Length Value) data has
been passed. Prior to this patch a non-existing TLV could be sanity
checked with TLV_OK() resulting in random behavior where a user
sending an empty message occasionally got a incorrect "operation not
supported" message back.

Signed-off-by: Richard Alpe 
Reviewed-by: Erik Hugne 
---
 net/tipc/netlink_compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 53e0fee..1eadc95 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -1114,7 +1114,7 @@ static int tipc_nl_compat_recv(struct sk_buff *skb, 
struct genl_info *info)
}
 
len = nlmsg_attrlen(req_nlh, GENL_HDRLEN + TIPC_GENL_HDRLEN);
-   if (TLV_GET_LEN(msg.req) && !TLV_OK(msg.req, len)) {
+   if (len && !TLV_OK(msg.req, len)) {
msg.rep = tipc_get_err_tlv(TIPC_CFG_NOT_SUPPORTED);
err = -EOPNOTSUPP;
goto send;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html