mirror_iproute2/tipc
Tuong Lien 24bee3bf97 tipc: add new commands to set TIPC AEAD key
Two new commands are added as part of 'tipc node' command:

 $tipc node set key KEY [algname ALGNAME] [nodeid NODEID]
 $tipc node flush key

which enable user to set and remove AEAD keys in kernel TIPC (requires
the kernel option - 'TIPC_CRYPTO').

For the 'set key' command, the given 'nodeid' parameter decides the
mode to be applied to the key, particularly:

- If NODEID is empty, the key is a 'cluster' key which will be used for
all message encryption/decryption from/to the node (i.e. both TX & RX).
The same key will be set in the other nodes.

- If NODEID is own node, the key is used for message encryption (TX)
from the node. Whereas, if NODEID is a peer node, the key is for
message decryption (RX) from that peer node. This is the 'per-node-key'
mode that each nodes in the cluster has its specific (TX) key.

Acked-by: Ying Xue <ying.xue@windriver.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Tuong Lien <tuong.t.lien@dektech.com.au>
Signed-off-by: David Ahern <dsahern@gmail.com>
2019-11-25 23:14:11 +00:00
..
.gitignore tipc: add new TIPC configuration tool 2015-05-21 14:41:41 -07:00
bearer.c tipc: support interface name when activating UDP bearer 2019-06-28 16:03:16 -07:00
bearer.h tipc: refractor bearer to facilitate link monitor 2016-09-20 09:13:09 -07:00
cmdl.c tipc: make cmd_find static 2018-11-19 11:42:44 -08:00
cmdl.h tipc: make cmd_find static 2018-11-19 11:42:44 -08:00
link.c tipc: add link broadcast get 2019-03-26 16:09:16 -07:00
link.h tipc: add new TIPC configuration tool 2015-05-21 14:41:41 -07:00
Makefile iproute2: Installation errors without libmnl 2018-12-04 14:27:08 -08:00
media.c tipc: Add support to set and get MTU for UDP bearer 2018-05-09 20:53:32 -07:00
media.h tipc: add new TIPC configuration tool 2015-05-21 14:41:41 -07:00
misc.c tipc: add new commands to set TIPC AEAD key 2019-11-25 23:14:11 +00:00
misc.h tipc: add new commands to set TIPC AEAD key 2019-11-25 23:14:11 +00:00
msg.c tipc: change family attribute from u32 to u16 2017-11-16 15:58:48 -08:00
msg.h tipc: add new TIPC configuration tool 2015-05-21 14:41:41 -07:00
nametable.c tipc: fix misalignment printout in non-JSON output 2018-12-07 09:24:01 -08:00
nametable.h tipc: add new TIPC configuration tool 2015-05-21 14:41:41 -07:00
node.c tipc: add new commands to set TIPC AEAD key 2019-11-25 23:14:11 +00:00
node.h tipc: add new TIPC configuration tool 2015-05-21 14:41:41 -07:00
peer.c tipc: fixed node and name table listings 2018-05-18 09:12:24 -07:00
peer.h tipc: add peer remove functionality 2016-08-29 10:33:24 -07:00
README tipc: add new TIPC configuration tool 2015-05-21 14:41:41 -07:00
socket.c tipc: change node address printout formats 2018-03-28 20:41:15 -07:00
socket.h tipc: add new TIPC configuration tool 2015-05-21 14:41:41 -07:00
tipc.c tipc: JSON support for showing nametable 2018-06-13 20:45:38 -07:00

DESIGN DECISIONS
----------------

HELP
~~~~
--help or -h is used for help. We do not reserve the bare word "help", which
for example the ip command does. Reserving a bare word like help quickly
becomes cumbersome to handle in the code. It might be simple to handle
when it's passed early in the command chain like "ip addr help". But when
the user tries to pass "help" further down this requires manual checks and
special treatment. For example, at the time of writing this tool, it's
possible to create a vlan named "help" with the ip tool, but it's impossible
to remove it, the command just shows help. This is an effect of treating
bare words specially.

Help texts are not dynamically generated. That is, we do not pass datastructures
like command list or option lists and print them dynamically. This is
intentional. There is always that exception and when it comes to help texts
these exceptions are normally neglected at the expence of usability.

KEY-VALUE
~~~~~~~~~
All options are key-values. There are both drawbacks and benefits to this.
The main drawback is that it becomes more to write for the user and
information might seem redundant. The main benefits is scalability and code
simplification. Consistency is important.

Consider this.
1. tipc link set priority PRIO link LINK
2. tipc link set LINK priority PRIO

Link might seem redundant in (1). However, if the command should live for many
years and be able to evolve example (2) limits the set command to only work on a
single link with no ability to extend. As an example, lets say we introduce
grouping on the kernel side.

1. tipc link set priority PRIO group GROUP
2. tipc link set ??? priority PRIO group GROUP

2. breaks, we can't extend the command to cover a group.

PARSING
~~~~~~~
Commands are single words. As an example, all words in "tipc link list" are
commands. Options are key-values that can be given in any order. In
"tipc link set priority PRIO link LINK" "tipc link set" are commands while
priority and link are options. Meaning that they can be given like
"tipc link set link LINK priority PRIO".

Abbreviation matching works for both command and options. Meaning that
"tipc link set priority PRIO link LINK" could be given as
"tipc l s p PRIO l LINK" and "tipc link list" as "tipc l l".

MEMORY
~~~~~~
The tool strives to avoid allocating memory on the heap. Most (if not all)
memory allocations are on the stack.

RETURNING
~~~~~~~~~
The tool could throw exit() deep down in functions but doing so always seems
to limit the program in the long run. So we output the error and return an
appropriate error code upon failure.