+void Scan_Dir(tInterface **IfaceList, const char *Directory)
+{
+ int dp = open(Directory, OPENFLAG_READ);
+ char filename[FILENAME_MAX];
+
+ while( readdir(dp, filename) )
+ {
+ int pathlen = strlen(Directory) + 1 + strlen(filename) + 1;
+ char path[pathlen];
+ int fd;
+ t_sysFInfo info;
+
+ sprintf(path, "%s/%s", Directory, filename);
+ fd = open(path, 0);
+
+ if( ioctl(fd, 0, NULL) != 9 )
+ continue ;
+
+ finfo(fd, &info, 0);
+
+ if( info.flags & FILEFLAG_DIRECTORY )
+ {
+ Scan_Dir(IfaceList, path);
+ }
+ else
+ {
+ tInterface *new = malloc(sizeof(tInterface) + pathlen);
+ new->Adapter = (void*)(new + 1);
+ strcpy(new->Adapter, path);
+ new->Next = *IfaceList;
+ *IfaceList = new;
+ }
+ }
+ close(dp);
+}
+