ncsi-cmd: mctp: Add a simple IID allocator for NCSI commands

Currently, we just use a fixed IID of zero for NCSI commands. However,
DSP0222 has a requirement that the IID of a command should not match
that of a previously-issued command.

So, implement a straightforward per-EID IID allocator, which will
persist the current IID over invocations of ncsi-cmd. We keep state in
/run/ncsi-mctp-iids, with an IID byte per possible MCTP EID.

Tested: on first usage against a specific EID, commands are issued with
IID 1, and subsequent commands use an incremented IID.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Change-Id: Iafc942abe6253a2560997ee5392a04af4412dc2e
diff --git a/src/ncsi_util.hpp b/src/ncsi_util.hpp
index 27397c8..4235429 100644
--- a/src/ncsi_util.hpp
+++ b/src/ncsi_util.hpp
@@ -165,6 +165,8 @@
     int sd;
     int net;
     uint8_t eid;
+
+    std::optional<uint8_t> allocateIID();
 };
 
 } // namespace ncsi