Lines Matching refs:entry

93 	struct name_entry *entry;  in smb_netbios_cache_getfirst()  local
102 entry = (struct name_entry *)item->hi_data; in smb_netbios_cache_getfirst()
103 (void) mutex_lock(&entry->mtx); in smb_netbios_cache_getfirst()
104 iter->nbc_entry = smb_netbios_name_dup(entry, 1); in smb_netbios_cache_getfirst()
105 (void) mutex_unlock(&entry->mtx); in smb_netbios_cache_getfirst()
116 struct name_entry *entry; in smb_netbios_cache_getnext() local
125 entry = (struct name_entry *)item->hi_data; in smb_netbios_cache_getnext()
126 (void) mutex_lock(&entry->mtx); in smb_netbios_cache_getnext()
127 iter->nbc_entry = smb_netbios_name_dup(entry, 1); in smb_netbios_cache_getnext()
128 (void) mutex_unlock(&entry->mtx); in smb_netbios_cache_getnext()
147 struct name_entry *entry = NULL; in smb_netbios_cache_lookup() local
164 entry = (struct name_entry *)item->hi_data; in smb_netbios_cache_lookup()
165 (void) mutex_lock(&entry->mtx); in smb_netbios_cache_lookup()
166 if ((entry->attributes & NAME_ATTR_CONFLICT) != 0) { in smb_netbios_cache_lookup()
167 (void) mutex_unlock(&entry->mtx); in smb_netbios_cache_lookup()
168 entry = NULL; in smb_netbios_cache_lookup()
173 return (entry); in smb_netbios_cache_lookup()
196 struct name_entry *entry = 0; in smb_netbios_cache_lookup_addr() local
208 entry = (struct name_entry *)item->hi_data; in smb_netbios_cache_lookup_addr()
209 (void) mutex_lock(&entry->mtx); in smb_netbios_cache_lookup_addr()
210 addr = &entry->addr_list; in smb_netbios_cache_lookup_addr()
215 return (entry); in smb_netbios_cache_lookup_addr()
218 } while (addr != &entry->addr_list); in smb_netbios_cache_lookup_addr()
219 (void) mutex_unlock(&entry->mtx); in smb_netbios_cache_lookup_addr()
229 struct name_entry *entry; in smb_netbios_cache_insert() local
246 entry = (struct name_entry *)item->hi_data; in smb_netbios_cache_insert()
247 (void) mutex_lock(&entry->mtx); in smb_netbios_cache_insert()
250 addr = &entry->addr_list; in smb_netbios_cache_insert()
253 entry->attributes |= in smb_netbios_cache_insert()
255 (void) mutex_unlock(&entry->mtx); in smb_netbios_cache_insert()
261 for (addr = entry->addr_list.forw; in smb_netbios_cache_insert()
262 addr != &entry->addr_list; addr = addr->forw) { in smb_netbios_cache_insert()
265 (void) mutex_unlock(&entry->mtx); in smb_netbios_cache_insert()
273 entry->attributes |= addr->attributes; in smb_netbios_cache_insert()
274 QUEUE_INSERT_TAIL(&entry->addr_list, addr); in smb_netbios_cache_insert()
280 (void) mutex_unlock(&entry->mtx); in smb_netbios_cache_insert()
285 if ((entry = malloc(sizeof (struct name_entry))) == NULL) { in smb_netbios_cache_insert()
290 *entry = *name; in smb_netbios_cache_insert()
291 entry->addr_list.forw = entry->addr_list.back = &entry->addr_list; in smb_netbios_cache_insert()
292 entry->attributes |= entry->addr_list.attributes; in smb_netbios_cache_insert()
293 (void) mutex_init(&entry->mtx, 0, 0); in smb_netbios_cache_insert()
294 if (ht_replace_item(smb_netbios_cache, key, entry) == 0) { in smb_netbios_cache_insert()
295 free(entry); in smb_netbios_cache_insert()
310 struct name_entry *entry; in smb_netbios_cache_delete() local
316 entry = (struct name_entry *)item->hi_data; in smb_netbios_cache_delete()
317 (void) mutex_lock(&entry->mtx); in smb_netbios_cache_delete()
319 (void) mutex_unlock(&entry->mtx); in smb_netbios_cache_delete()
332 struct name_entry entry; in smb_netbios_cache_insert_list() local
342 &entry); in smb_netbios_cache_insert_list()
343 (void) memcpy(entry.name, name->name, NETBIOS_NAME_SZ); in smb_netbios_cache_insert_list()
344 entry.addr_list.refresh_ttl = entry.addr_list.ttl = in smb_netbios_cache_insert_list()
346 (void) smb_netbios_cache_insert(&entry); in smb_netbios_cache_insert_list()
354 smb_netbios_cache_update_entry(struct name_entry *entry, in smb_netbios_cache_update_entry() argument
360 addr = &entry->addr_list; in smb_netbios_cache_update_entry()
363 if (IS_UNIQUE(entry->attributes)) { in smb_netbios_cache_update_entry()
367 } while (addr != &entry->addr_list); in smb_netbios_cache_update_entry()
377 } while (addr != &entry->addr_list); in smb_netbios_cache_update_entry()
571 struct name_entry *entry; in smb_netbios_cache_delete_locals() local
588 entry = (struct name_entry *)item->hi_data; in smb_netbios_cache_delete_locals()
589 (void) mutex_lock(&entry->mtx); in smb_netbios_cache_delete_locals()
591 if (IS_LOCAL(entry->attributes)) { in smb_netbios_cache_delete_locals()
593 delent = smb_netbios_name_dup(entry, 1); in smb_netbios_cache_delete_locals()
599 (void) mutex_unlock(&entry->mtx); in smb_netbios_cache_delete_locals()
605 smb_netbios_name_freeaddrs(struct name_entry *entry) in smb_netbios_name_freeaddrs() argument
609 if (entry == 0) in smb_netbios_name_freeaddrs()
612 while ((addr = entry->addr_list.forw) != &entry->addr_list) { in smb_netbios_name_freeaddrs()
666 smb_netbios_name_dump(FILE *fp, struct name_entry *entry) in smb_netbios_name_dump() argument
673 smb_strname(entry, buf, sizeof (buf)); in smb_netbios_name_dump()
674 type = (IS_UNIQUE(entry->attributes)) ? "UNIQUE" : "GROUP"; in smb_netbios_name_dump()
676 (void) fprintf(fp, "%s %-6s (0x%04x) ", buf, type, entry->attributes); in smb_netbios_name_dump()
678 addr = &entry->addr_list; in smb_netbios_name_dump()
689 } while (addr != &entry->addr_list); in smb_netbios_name_dump()
693 smb_netbios_name_logf(struct name_entry *entry) in smb_netbios_name_logf() argument
698 smb_strname(entry, namebuf, sizeof (namebuf)); in smb_netbios_name_logf()
699 syslog(LOG_DEBUG, "%s flags=0x%x\n", namebuf, entry->attributes); in smb_netbios_name_logf()
700 addr = &entry->addr_list; in smb_netbios_name_logf()
707 } while (addr && (addr != &entry->addr_list)); in smb_netbios_name_logf()
722 smb_netbios_name_dup(struct name_entry *entry, int alladdr) in smb_netbios_name_dup() argument
731 addr = entry->addr_list.forw; in smb_netbios_name_dup()
732 while (addr && (addr != &entry->addr_list)) { in smb_netbios_name_dup()
747 dup->attributes = entry->attributes; in smb_netbios_name_dup()
748 (void) memcpy(dup->name, entry->name, NETBIOS_NAME_SZ); in smb_netbios_name_dup()
749 (void) strlcpy((char *)dup->scope, (char *)entry->scope, in smb_netbios_name_dup()
751 dup->addr_list = entry->addr_list; in smb_netbios_name_dup()
761 addr = entry->addr_list.forw; in smb_netbios_name_dup()
762 while (addr && (addr != &entry->addr_list)) { in smb_netbios_name_dup()
773 smb_strname(struct name_entry *entry, char *buf, int bufsize) in smb_strname() argument
778 (void) snprintf(tmp, MAXHOSTNAMELEN, "%15.15s", entry->name); in smb_strname()
782 if (entry->scope[0] != '\0') { in smb_strname()
784 (void) strlcat(tmp, (char *)entry->scope, MAXHOSTNAMELEN); in smb_strname()
787 (void) snprintf(buf, bufsize, "%-16s <%02X>", tmp, entry->name[15]); in smb_strname()
793 struct name_entry *entry; in hash_callback() local
796 entry = (struct name_entry *)item->hi_data; in hash_callback()
797 smb_netbios_name_freeaddrs(entry); in hash_callback()
798 free(entry); in hash_callback()