namecache redesign
Christopher R. Hertel
crh at ubiqx.mn.org
Sat Aug 31 10:16:00 GMT 2002
I'll just mention that the caching code in the ubiqx subdirectory is fully
capable of handling all of this stuff.
:)
Chris -)-----
tridge at samba.org 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"
>
> I also think we need management tools in net. eg:
>
> net cache list
> net cache delete NBT/name#1c
> net cache flush
>
> even better if 'net cache delete' could take wildcards (using
> fnmatch()). So you can do:
>
> net cache delete NBT/*
>
> 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?
>
> mimir, do you feel like taking this on?
--
Samba Team -- http://www.samba.org/ -)----- Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/ -)----- ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/ -)----- crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/ -)----- crh at ubiqx.org
More information about the samba-technical
mailing list