Commit graph

6 commits

Author SHA1 Message Date
Maximilian Wilhelm
a72d87df0b dict: lif_dict_find() + lif_dict_find_all() do not touch the dict, so mark it const.
Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-10-14 01:39:31 +02:00
Ariadne Conill
de20e5f8a9 lifecycle: handle executors in reverse order when taking an interface down 2020-08-24 11:04:48 -06:00
Ariadne Conill
81d0ebc3e8 remove unnecessary strcmp wrapper, use typecasting instead 2020-07-28 17:57:51 -04:00
Maximilian Wilhelm
f51c976b52 dict: Add lif_dict_add_once()
Add a function to add a key/value pair to the dict only if it doesn't exist
  within the dict already.

  As the dict is type agnostic this requires a comparator function to be given.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-07-28 22:44:22 +02:00
Maximilian Wilhelm
b1dfa609f9 dict: Add lif_dict_find_all().
As a dict can have multiple values for any given key we add a function to
  query all occurences of a given key and return them as a (new) list.

Signed-off-by: Maximilian Wilhelm <max@sdn.clinic>
2020-07-28 22:41:41 +02:00
Ariadne Conill
3f618d2a3b libifupdown: add a simple key-value dictionary based on linked lists 2020-07-18 03:11:43 -06:00