Move seeding to an __init function to avoid reseeding the PRNG multiple
times with the same seed when opening multiple handles in a short amount
of time.
While at it, switch from rand() to random() since it uses a better
PRNG in old libcs and non-Linux systems.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Similar to other objects, support a private data area for libdect handles
for applications dealing with multiple handles simultenously.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Proper error handling on failed dect_init() calls is currently not
possible since dect_close_handle() expects a fully initialized handle.
Kill dect_alloc_handle() and add a dect_open_handle() function that
performs all setup.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Add definitions for the various libdect subsystems, pass them to the
registered debugging handlers and add a handler to the example programs
to colorize debugging messages.
Still could use some cleanup, but causes too many clashes.
Signed-off-by: Patrick McHardy <kaber@trash.net>
Add auth support and beginning of MM procedure management.
Unfinished, but working well enough for an initial commit.
Signed-off-by: Patrick McHardy <kaber@trash.net>