Commit graph

4 commits

Author SHA1 Message Date
Olivier Dugeon f4157b4f6e lib: Fix comparison function in link_state.c
ls_node_same, ls_attributes_same and ls_prefix_same are not producing expected
result due to a wrong usage of memcmp. In addition, if respective structures
are not initialized with 0, there is a risk that the comparison failed.

This patch correct usage of memcmp and expand comparison to each invidual
parameters of the respective structure for safer result.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-10-29 10:16:12 +02:00
Olivier Dugeon b0c0b43348 lib: Update Link State Database
Add new status for Vertex, Edge and Subnet to manage their
respective states in the data base.

Add new functions:
 - to register/unregister server and client
 - to show content of the Database (VTY and Json output)
 - to update and compare subnets
 - to clean vertex and ted from ORPHAN elements
 - to convert message or stream into a Link State Element and update
   Link State Database accordingly to message event

Change Edge and Vertex key computation by using the host order systematically.
This impact mostly key based on IPv4 addresses where `ntohl()` function must
be used when searching a Vertex or Edge by key.

Update the documentation accordingly

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-03-23 15:39:29 +01:00
David Lamparter 960b9a5383 *: require semicolon after DEFINE_<typesafe...>
Again, see previous commits.

Signed-off-by: David Lamparter <equinox@diac24.net>
2021-03-17 06:18:39 +01:00
Olivier Dugeon bbd85e2038 lib: Add Link State Database
Define new models for Link State Database a.k.a TED
and functions to manipulate the new database as well as exchange Link State
information through ZAPI Opaque message.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2021-01-04 18:19:26 +01:00