/** * Flush the whole cache * * @param argv ignored in this functionality * @return always returns 0 **/ static int net_cache_flush(int argc, const char **argv) { const char* pattern = "*"; gencache_iterate(delete_cache_entry, NULL, pattern); gencache_shutdown(); return 0; }
/** * List the contents of the cache * * @param argv ignored in this functionailty * @return always returns 0 **/ static int net_cache_list(int argc, const char **argv) { const char* pattern = "*"; gencache_iterate(print_cache_entry, NULL, pattern); gencache_shutdown(); return 0; }
void trustdom_cache_flush(void) { /* * iterate through each TDOM cache's entry and flush it * by flush_trustdom_name function */ gencache_iterate(flush_trustdom_name, NULL, trustdom_cache_key("*")); DEBUG(5, ("Trusted domains cache flushed\n")); }
/** * Search an entry/entries in the cache * * @param argv key pattern to match the entries to * @return 0 on success, otherwise failure **/ static int net_cache_search(int argc, const char **argv) { const char* pattern; if (argc < 1) { d_printf("Usage: net cache search <pattern>\n"); return -1; } pattern = argv[0]; gencache_iterate(print_cache_entry, NULL, pattern); return 0; }
/** * Flush the whole cache * * @param c A net_context structure * @param argv ignored in this functionality * @return always returns 0 **/ static int net_cache_flush(struct net_context *c, int argc, const char **argv) { const char* pattern = "*"; if (c->display_usage) { d_printf("Usage:\n" "net cache flush\n" " Delete all cache entries.\n"); return 0; } gencache_iterate(delete_cache_entry, NULL, pattern); gencache_shutdown(); return 0; }
/** * Search an entry/entries in the cache * * @param c A net_context structure * @param argv key pattern to match the entries to * @return 0 on success, otherwise failure **/ static int net_cache_search(struct net_context *c, int argc, const char **argv) { const char* pattern; if (argc < 1 || c->display_usage) { d_printf("Usage: net cache search <pattern>\n"); return -1; } pattern = argv[0]; gencache_iterate(print_cache_entry, NULL, pattern); return 0; }
void namecache_flush(void) { if (!gencache_init()) { return; } /* * iterate through each NBT cache's entry and flush it * by flush_netbios_name function */ gencache_iterate(flush_netbios_name, NULL, "NBT/*"); DEBUG(5, ("Namecache flushed\n")); }
/** * List the contents of the cache * * @param c A net_context structure * @param argv ignored in this functionailty * @return always returns 0 **/ static int net_cache_list(struct net_context *c, int argc, const char **argv) { const char* pattern = "*"; if (c->display_usage) { d_printf( "%s\n" "net cache list\n" " %s\n", _("Usage:"), _("List all cache entries.")); return 0; } gencache_iterate(print_cache_entry, NULL, pattern); return 0; }