Lines Matching full:domain
3 * NetLabel Domain Hash Table
5 * This file manages the domain hash table that NetLabel uses to determine
6 * which network labeling protocol to use for a given domain. The NetLabel
40 /* Domain hash table */
51 * Domain Hash Table Helper Functions
55 * netlbl_domhsh_free_entry - Frees a domain hash table entry
90 kfree(ptr->domain); in netlbl_domhsh_free_entry()
95 * netlbl_domhsh_hash - Hashing function for the domain hash table
96 * @key: the domain name to hash
99 * This is the hashing function for the domain hash table, it returns the
100 * correct bucket number for the domain. The caller is responsible for
125 * netlbl_domhsh_search - Search for a domain entry
126 * @domain: the domain
130 * Searches the domain hash table and returns a pointer to the hash table
137 static struct netlbl_dom_map *netlbl_domhsh_search(const char *domain, in netlbl_domhsh_search() argument
144 if (domain != NULL) { in netlbl_domhsh_search()
145 bkt = netlbl_domhsh_hash(domain); in netlbl_domhsh_search()
151 strcmp(iter->domain, domain) == 0) in netlbl_domhsh_search()
159 * netlbl_domhsh_search_def - Search for a domain entry
160 * @domain: the domain
164 * Searches the domain hash table and returns a pointer to the hash table
172 static struct netlbl_dom_map *netlbl_domhsh_search_def(const char *domain, in netlbl_domhsh_search_def() argument
177 entry = netlbl_domhsh_search(domain, family); in netlbl_domhsh_search_def()
222 entry->domain ? entry->domain : "(default)"); in netlbl_domhsh_audit_add()
267 * netlbl_domhsh_validate - Validate a new domain mapping entry
270 * This function validates the new domain mapping entry to ensure that it is
349 * Domain Hash Table Functions
353 * netlbl_domhsh_init - Init for the domain hash
357 * Initializes the domain hash table, should be called only by
392 * netlbl_domhsh_add - Adds a entry to the domain hash table
397 * Adds a new entry to the domain hash table and handles any updates to the
401 * existing entry for any address family with the same domain. Returns zero
427 if (entry->domain != NULL) in netlbl_domhsh_add()
428 entry_old = netlbl_domhsh_search(entry->domain, entry->family); in netlbl_domhsh_add()
430 entry_old = netlbl_domhsh_search_def(entry->domain, in netlbl_domhsh_add()
435 if (entry->domain != NULL) { in netlbl_domhsh_add()
436 u32 bkt = netlbl_domhsh_hash(entry->domain); in netlbl_domhsh_add()
501 * the selectors do not exist in the existing domain map */ in netlbl_domhsh_add()
553 * netlbl_domhsh_add_default - Adds the default entry to the domain hash table
558 * Adds a new default entry to the domain hash table and handles any updates
570 * netlbl_domhsh_remove_entry - Removes a given entry from the domain table
575 * Removes an entry from the domain hash table and handles any updates to the
616 entry->domain ? entry->domain : "(default)"); in netlbl_domhsh_remove_entry()
649 * @domain: the domain
655 * Removes an individual address selector from a domain mapping and potentially
660 int netlbl_domhsh_remove_af4(const char *domain, in netlbl_domhsh_remove_af4() argument
675 if (domain) in netlbl_domhsh_remove_af4()
676 entry_map = netlbl_domhsh_search(domain, AF_INET); in netlbl_domhsh_remove_af4()
678 entry_map = netlbl_domhsh_search_def(domain, AF_INET); in netlbl_domhsh_remove_af4()
696 /* the domain mapping is empty so remove it from the mapping table */ in netlbl_domhsh_remove_af4()
718 * @domain: the domain
724 * Removes an individual address selector from a domain mapping and potentially
729 int netlbl_domhsh_remove_af6(const char *domain, in netlbl_domhsh_remove_af6() argument
742 if (domain) in netlbl_domhsh_remove_af6()
743 entry_map = netlbl_domhsh_search(domain, AF_INET6); in netlbl_domhsh_remove_af6()
745 entry_map = netlbl_domhsh_search_def(domain, AF_INET6); in netlbl_domhsh_remove_af6()
761 /* the domain mapping is empty so remove it from the mapping table */ in netlbl_domhsh_remove_af6()
782 * netlbl_domhsh_remove - Removes an entry from the domain hash table
783 * @domain: the domain to remove
788 * Removes an entry from the domain hash table and handles any updates to the
794 int netlbl_domhsh_remove(const char *domain, u16 family, in netlbl_domhsh_remove() argument
803 if (domain) in netlbl_domhsh_remove()
804 entry = netlbl_domhsh_search(domain, AF_INET); in netlbl_domhsh_remove()
806 entry = netlbl_domhsh_search_def(domain, AF_INET); in netlbl_domhsh_remove()
814 if (domain) in netlbl_domhsh_remove()
815 entry = netlbl_domhsh_search(domain, AF_INET6); in netlbl_domhsh_remove()
817 entry = netlbl_domhsh_search_def(domain, AF_INET6); in netlbl_domhsh_remove()
834 * Removes/resets the default entry corresponding to @family from the domain
846 * netlbl_domhsh_getentry - Get an entry from the domain hash table
847 * @domain: the domain name to search for
851 * Look through the domain hash table searching for an entry to match @domain,
857 struct netlbl_dom_map *netlbl_domhsh_getentry(const char *domain, u16 family) in netlbl_domhsh_getentry() argument
861 return netlbl_domhsh_search_def(domain, family); in netlbl_domhsh_getentry()
865 * netlbl_domhsh_getentry_af4 - Get an entry from the domain hash table
866 * @domain: the domain name to search for
870 * Look through the domain hash table searching for an entry to match @domain
875 struct netlbl_dommap_def *netlbl_domhsh_getentry_af4(const char *domain, in netlbl_domhsh_getentry_af4() argument
881 dom_iter = netlbl_domhsh_search_def(domain, AF_INET); in netlbl_domhsh_getentry_af4()
895 * netlbl_domhsh_getentry_af6 - Get an entry from the domain hash table
896 * @domain: the domain name to search for
900 * Look through the domain hash table searching for an entry to match @domain
905 struct netlbl_dommap_def *netlbl_domhsh_getentry_af6(const char *domain, in netlbl_domhsh_getentry_af6() argument
911 dom_iter = netlbl_domhsh_search_def(domain, AF_INET6); in netlbl_domhsh_getentry_af6()
925 * netlbl_domhsh_walk - Iterate through the domain mapping hash table
932 * Interate over the domain mapping hash table, skipping the first @skip_bkt