summaryrefslogtreecommitdiffstats
path: root/src/device.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/device.h')
-rw-r--r--src/device.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/device.h b/src/device.h
new file mode 100644
index 0000000..f437021
--- /dev/null
+++ b/src/device.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include "config-ini.h"
+
+#include <libubox/avl.h>
+
+extern struct avl_tree device_types;
+
+typedef struct _device_type device_type_t;
+
+typedef struct _device {
+ struct avl_node node;
+ const device_type_t *type;
+} device_t;
+
+struct _device_type {
+ struct avl_node node;
+ device_t * (*process_config)(const char *name, const ini_file_t *config);
+ void (*free_device)(device_t *device);
+};
+
+void register_device_type(const char *name, device_type_t *device_type);
+const device_type_t * get_device_type(const char *name);