Lines Matching refs:name
17 * information: Portions Copyright [yyyy] [name of copyright owner]
46 static void smb_strname(struct name_entry *name, char *buf, int bufsize);
49 static void smb_netbios_cache_key(char *key, unsigned char *name,
60 syslog(LOG_ERR, "nbns: cannot create name cache");
138 * Searches the name cache for the given entry, if found
143 smb_netbios_cache_lookup(struct name_entry *name)
150 if (NETBIOS_NAME_IS_STAR(name->name)) {
156 smb_encode_netbios_name(hostname, 0x00, NULL, name);
161 smb_netbios_cache_key(key, name->name, name->scope);
177 smb_netbios_cache_unlock_entry(struct name_entry *name)
179 if (name)
180 (void) mutex_unlock(&name->mtx);
186 * lookup the given 'name' in the cache and then checks
188 * 'name' is supposed to contain only one address.
194 smb_netbios_cache_lookup_addr(struct name_entry *name)
203 smb_netbios_cache_key(key, name->name, name->scope);
207 name_addr = &name->addr_list;
227 smb_netbios_cache_insert(struct name_entry *name)
236 /* No point in adding a name with IP address 255.255.255.255 */
237 if (name->addr_list.sin.sin_addr.s_addr == 0xffffffff)
241 smb_netbios_cache_key(key, name->name, name->scope);
249 name_addr = &name->addr_list;
272 *addr = name->addr_list;
273 name->addr_list.forw = name->addr_list.back =
274 &name->addr_list;
292 *entry = *name;
308 smb_netbios_cache_delete(struct name_entry *name)
315 smb_netbios_cache_key(key, name->name, name->scope);
329 * Insert a name with multiple addresses
332 smb_netbios_cache_insert_list(struct name_entry *name)
337 addr = &name->addr_list;
339 smb_init_name_struct(NETBIOS_EMPTY_NAME, 0, name->scope,
342 name->attributes,
345 (void) memcpy(entry.name, name->name, NETBIOS_NAME_SZ);
350 } while (addr != &name->addr_list);
357 struct name_entry *name)
363 name_addr = &name->addr_list;
386 * Scan the name cache and gather status for
394 struct name_entry *name;
418 name = (struct name_entry *)item->hi_data;
419 (void) mutex_lock(&name->mtx);
421 if (IS_LOCAL(name->attributes) &&
422 (strcasecmp((char *)scope, (char *)name->scope) == 0)) {
423 bcopy(name->name, scan, NETBIOS_NAME_SZ);
425 *scan++ = PUBLIC_BITS(name->attributes) >> 8;
426 *scan++ = PUBLIC_BITS(name->attributes);
430 (void) mutex_unlock(&name->mtx);
441 struct name_entry *name;
454 name = (struct name_entry *)item->hi_data;
455 (void) mutex_lock(&name->mtx);
457 addr = &name->addr_list;
467 } while (addr != &name->addr_list);
469 (void) mutex_unlock(&name->mtx);
475 * Returns TRUE when given name is added to the refresh queue
481 struct name_entry *name;
484 name = (struct name_entry *)item->hi_data;
486 if (IS_LOCAL(name->attributes)) {
487 if (IS_UNIQUE(name->attributes)) {
488 refent = smb_netbios_name_dup(name, 1);
493 /* next name */
498 refent = smb_netbios_name_dup(name, 0);
503 /* next name */
513 * Scans the name cache and add all local unique names
523 struct name_entry *name;
533 do { /* name loop */
540 name = (struct name_entry *)item->hi_data;
541 (void) mutex_lock(&name->mtx);
543 addr = &name->addr_list;
554 } while (addr != &name->addr_list);
556 (void) mutex_unlock(&name->mtx);
564 * Scans the name cache and add all local names to
640 struct name_entry *name;
657 name = (struct name_entry *)item->hi_data;
658 (void) mutex_lock(&name->mtx);
659 smb_netbios_name_dump(fp, name);
660 (void) mutex_unlock(&name->mtx);
715 * Duplicate the given name entry. If 'alladdr' is 0 only
750 (void) memcpy(dup->name, entry->name, NETBIOS_NAME_SZ);
780 (void) snprintf(tmp, MAXHOSTNAMELEN, "%15.15s", entry->name);
789 (void) snprintf(buf, bufsize, "%-16s <%02X>", tmp, entry->name[15]);
821 smb_netbios_cache_key(char *key, unsigned char *name, unsigned char *scope)
824 (void) memcpy(key, name, NETBIOS_NAME_SZ);