Change return type from int to bool
Cleanup in time server
Mark some internal functions as static

Some functions were reordered to not need forward declarations.
Make error checking in key server more generic

If we need to support other messages that CHALLENGE in future, the doc
may not always equal to 8. Se we need to check that we have at least one
byte with dst and flags.
Fix sending of REQ_CHALLANGE and refactor key server to be more readable
Change format of debugging messages to more readable

- Allow adding custom prefix for printing macan frames
- Always use 2 digits for ECU-IDs in decoded frames
Fix compile error in Tasking compiler

It wants not only argument types, but also names should be the same in both
declaration and definition.
Make can callback process all queued frames instead of just the first one

This makes debugging logs (e.g. the output of 1signal) more understandable,
because multiple activities do not interleave.
Use separate CAN-ID for time signal instead of misusing crypt-frame CAN-ID

Before this change, when time server sent CHALLENGE message to the key
server, other nodes interpreted this message as authenticated time signal
(with failing authentication check).

Therefore it is necessary to have a separate CAN-ID for time signal.
Do not generate new challenge when waiting for a session key

Without this, we may ge messages like:

FAIL  #1:  macan/src/macan.c:232 receive_skey(): wrong challenge for 2
Return at the end of REQ_CHALLENGE and simplify SESS_KEY handling
Simplify time handling

Also convert all time-related variables to unsigned types, for which
wrapping is defined operation. Integer overflow is undefined operation and
compiler can optimize things in a wrong way.

See http://www.airs.com/blog/archives/120
Fix timestamp formating in print_frame()
Initialize MaCAN time before starting the event loop

Without this change, the first time frame was send at time 0 and the
second at 0.999. This caused the value 0 to be sent two times in a row
(because floor division is used).

Rationale: In general the time server's notion of time (MaCAN time) is
synchronized with event loop timing, but the origin (time 0) is not the
same. If MaCAN time starts later than event loop time, then due to
possible jitter in callback invocation, the time broadcast callback may
be invoked just before or slightly after the increment of MaCAN time.
By starting the MaCAN time before the event loop is entered, the event
loop guarantees that the callback is invoked always after the MaCAN time
increment.

Beware that the above guarantee may be violated, if the broadcast period
is too short or of the event loop is started about the whole number of
periods after time server initialization.
Remove is_time_read()

It is shorter to write the test directly.
Add skey_callback and improve time initialization

To establish authenticated communication faster (and to not see so many
warnings in logs), it is useful to perform some action just when a session
key is received.

Time server uses this to answer requests for authenticated time that were
sent before the key was ready. For that, the time server has to remember
the sent challenges in ctx->ts.auth_req.

Nodes use this for requesting authenticated time just after the time server
session key has been delivered to them.
Fix time synchronization and detect forged time messages
Print broken time frames correctly (as broken)
Remove time_broadcast_period

This parameter is not needed. There is no reason to send time with
different period than time_div.
Cleanup MaCAN initialization