summaryrefslogtreecommitdiff
path: root/src/discover.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/discover.c')
-rw-r--r--src/discover.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/discover.c b/src/discover.c
index 1d8259a..53eef73 100644
--- a/src/discover.c
+++ b/src/discover.c
@@ -1,8 +1,31 @@
-#include "osm/discover.h"
+#include "osm/utils.h"
-Vector osm_discover_onboard(char *sock_fd)
+#include <stdio.h>
+#include <dirent.h>
+#include <stddef.h>
+#include <errno.h>
+
+Vector osm_discover_onboard(char *sock_dir)
{
- Vector out = {0};
+ Vector out = vect_init(sizeof(char));
+
+ DIR *d = opendir(sock_dir);
+ if (d)
+ {
+ struct dirent *dir;
+ while((dir = readdir(d)) != NULL)
+ {
+ if (dir->d_type == DT_SOCK)
+ {
+ }
+ }
+ errno = 0;
+ closedir(d);
+ }
+ else
+ {
+ perror("opendir");
+ }
return out;
}