tipc: simplify endianness handling in topology subscriber
authorJon Maloy <jon.maloy@ericsson.com>
Thu, 15 Feb 2018 09:40:46 +0000 (10:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Feb 2018 20:26:33 +0000 (15:26 -0500)
commit8985ecc7c1e07c42acc1e44ac56fa224f8a5c62f
treeed564ee8b615b55e4569b38ea039e3eb89dccbe0
parent414574a0af36d329f560f542e650cc4a81cc1d69
tipc: simplify endianness handling in topology subscriber

Because of the requirement for total distribution transparency, users
send subscriptions and receive topology events in their own host format.
It is up to the topology server to determine this format and do the
correct conversions to and from its own host format when needed.

Until now, this has been handled in a rather non-transparent way inside
the topology server and subscriber code, leading to unnecessary
complexity when creating subscriptions and issuing events.

We now improve this situation by adding two new macros, tipc_sub_read()
and tipc_evt_write(). Both those functions calculate the need for
conversion internally before performing their respective operations.
Hence, all handling of such conversions become transparent to the rest
of the code.

Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/name_table.c
net/tipc/name_table.h
net/tipc/server.c
net/tipc/subscr.c
net/tipc/subscr.h