16 { "Users" , userinfo },
17 { "Groups" , groupinfo },
18 { "Shares" , shareinfo },
19 { "Connection" , conninfo },
20 { "Sessions" , sessioninfo },
21 { "Dfsroot" , dfsrootinfo },
22 { "Dfscache" , dfscacheinfo },
23 { "Domains" , domaininfo },
24 { "Openfiles" , openfileinfo },
25 { "Workstations" , workstationinfo },
26 { "Filetable" , filetableinfo },
34 for(i = 0; i < nelem(Infdir); i++)
35 if(strcmp(Infdir[i].name, name) == 0)
47 dirgeninfo(int slot, Dir *d)
49 if(slot < 0 || slot > nelem(Infdir))
52 memset(d, 0, sizeof(Dir));
55 d->name = estrdup9p(Infdir[slot].name);
56 d->uid = estrdup9p("other");
57 d->muid = estrdup9p("other");
58 d->gid = estrdup9p("other");
62 d->qid = mkqid(Infdir[slot].name, 0, 1, Pinfo, slot);
75 if(path < 0 || path > nelem(Infdir))
77 if(Infdir[path].buf != nil)
80 if((*Infdir[path].func)(&f) == -1)
82 if((Infdir[path].buf = fmtstrflush(&f)) == nil)
84 if((Infdir[path].len = strlen(Infdir[path].buf)) <= 0)
90 readinfo(int path, char *buf, int len, int off)
92 if(path < 0 || path > nelem(Infdir))
94 if(off > Infdir[path].len)
96 if(len + off > Infdir[path].len)
97 len = Infdir[path].len - off;
98 memmove(buf, Infdir[path].buf + off, len);
105 if(path < 0 || path > nelem(Infdir))
107 free(Infdir[path].buf);
108 Infdir[path].buf = nil;