diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2019-01-05 22:06:45 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2019-01-05 22:06:45 +0100 |
commit | daa68c4b2de9814b8331e7b9079d5fc49bee35c1 (patch) | |
tree | 4f82de8a19abf7b6a0c9e6f511ac23995d9d5851 /src/device.c | |
parent | 9e059f898ae1b0528cdde553fd51c661901e283a (diff) | |
download | neco-daa68c4b2de9814b8331e7b9079d5fc49bee35c1.tar neco-daa68c4b2de9814b8331e7b9079d5fc49bee35c1.zip |
Add first parts of interface config handling
Diffstat (limited to 'src/device.c')
-rw-r--r-- | src/device.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c new file mode 100644 index 0000000..a773036 --- /dev/null +++ b/src/device.c @@ -0,0 +1,15 @@ +#include "device.h" +#include "util.h" + +#include <libubox/avl-cmp.h> + +AVL_TREE(device_types, avl_strcmp, false, NULL); + +void register_device_type(const char *name, device_type_t *device_type) { + NODE_NAME(device_type) = (char *)name; + avl_insert(&device_types, &device_type->node); +} + +const device_type_t * get_device_type(const char *name) { + return avl_find_element(&device_types, name, (device_type_t *)NULL, node); +} |