On Fri, Aug 30, 2002 at 04:59:01PM -0400, [EMAIL PROTECTED] wrote: > Tim, > > > How about keeping basically the same API in namecache.c (i.e expiry > > based on time_t) but with an appropriate key prefix as you suggest? > > What I'd like to see is a lib/gencache.c module that provides a string > based cache. So all cache entries would have string keys and string > values. > > key: NBT/name#1c > value: 192.168.2.10 192.168.3.21 > > then namecache.c would just call routines in gencache.c to provide > convenient wrapper routines that convert to/from "struct in_addr"
Yes, that's close to what I have on my mind. > I also think we need management tools in net. eg: > > net cache list > net cache delete NBT/name#1c > net cache flush That's correct, but Jean Francois mentioned something about rewriting some tools. According to his concepts this would go to smbcontrol ie. 'local control' tool. > even better if 'net cache delete' could take wildcards (using > fnmatch()). So you can do: > > net cache delete NBT/* Sure, that's possible. That's why I implemented (with your help) tdb pattern searching function for. > the C API in gencache.c could be: > > BOOL gencache_add(const char *key, const char *value, time_t timeout); > BOOL gencache_del(const char *key); > BOOL gencache_get(const char *key, char **value, time_t *timeout); > void gencache_iterate(void (*fn)(const char *key, const char *value, time_t >timeout)); > > plus startup/shutdown functions: > > BOOL gencache_startup(void); > BOOL gencache_shutdown(void); > > sound ok? Yes. As for me and for now, it sounds ok. > mimir, do you feel like taking this on? I need it probably the most of you, right now :) The more, because this is solution of two issues of mine (waiting to be solved). I'll save the copy of this API draft, then, and just start working :) -- cheers, +------------------------------------------------------------+ |Rafal 'Mimir' Szczesniak <[EMAIL PROTECTED]> | |*BSD, GNU/Linux and Samba / |__________________________________________________________/