Lines Matching full:domain
2 * NetLabel Domain Hash Table
4 * This file manages the domain hash table that NetLabel uses to determine
5 * which network labeling protocol to use for a given domain. The NetLabel
54 /* Domain hash table */
65 * Domain Hash Table Helper Functions
69 * netlbl_domhsh_free_entry - Frees a domain hash table entry
104 kfree(ptr->domain); in netlbl_domhsh_free_entry()
109 * netlbl_domhsh_hash - Hashing function for the domain hash table
110 * @domain: the domain name to hash
113 * This is the hashing function for the domain hash table, it returns the
114 * correct bucket number for the domain. The caller is responsible for
139 * netlbl_domhsh_search - Search for a domain entry
140 * @domain: the domain
144 * Searches the domain hash table and returns a pointer to the hash table
151 static struct netlbl_dom_map *netlbl_domhsh_search(const char *domain, in netlbl_domhsh_search() argument
158 if (domain != NULL) { in netlbl_domhsh_search()
159 bkt = netlbl_domhsh_hash(domain); in netlbl_domhsh_search()
164 strcmp(iter->domain, domain) == 0) in netlbl_domhsh_search()
172 * netlbl_domhsh_search_def - Search for a domain entry
173 * @domain: the domain
177 * Searches the domain hash table and returns a pointer to the hash table
185 static struct netlbl_dom_map *netlbl_domhsh_search_def(const char *domain, in netlbl_domhsh_search_def() argument
190 entry = netlbl_domhsh_search(domain, family); in netlbl_domhsh_search_def()
235 entry->domain ? entry->domain : "(default)"); in netlbl_domhsh_audit_add()
280 * netlbl_domhsh_validate - Validate a new domain mapping entry
283 * This function validates the new domain mapping entry to ensure that it is
362 * Domain Hash Table Functions
366 * netlbl_domhsh_init - Init for the domain hash
370 * Initializes the domain hash table, should be called only by
405 * netlbl_domhsh_add - Adds a entry to the domain hash table
410 * Adds a new entry to the domain hash table and handles any updates to the
414 * existing entry for any address family with the same domain. Returns zero
440 if (entry->domain != NULL) in netlbl_domhsh_add()
441 entry_old = netlbl_domhsh_search(entry->domain, entry->family); in netlbl_domhsh_add()
443 entry_old = netlbl_domhsh_search_def(entry->domain, in netlbl_domhsh_add()
448 if (entry->domain != NULL) { in netlbl_domhsh_add()
449 u32 bkt = netlbl_domhsh_hash(entry->domain); in netlbl_domhsh_add()
514 * the selectors do not exist in the existing domain map */ in netlbl_domhsh_add()
566 * netlbl_domhsh_add_default - Adds the default entry to the domain hash table
571 * Adds a new default entry to the domain hash table and handles any updates
583 * netlbl_domhsh_remove_entry - Removes a given entry from the domain table
588 * Removes an entry from the domain hash table and handles any updates to the
629 entry->domain ? entry->domain : "(default)", in netlbl_domhsh_remove_entry()
663 * @domain: the domain
669 * Removes an individual address selector from a domain mapping and potentially
674 int netlbl_domhsh_remove_af4(const char *domain, in netlbl_domhsh_remove_af4() argument
689 if (domain) in netlbl_domhsh_remove_af4()
690 entry_map = netlbl_domhsh_search(domain, AF_INET); in netlbl_domhsh_remove_af4()
692 entry_map = netlbl_domhsh_search_def(domain, AF_INET); in netlbl_domhsh_remove_af4()
710 /* the domain mapping is empty so remove it from the mapping table */ in netlbl_domhsh_remove_af4()
732 * @domain: the domain
738 * Removes an individual address selector from a domain mapping and potentially
743 int netlbl_domhsh_remove_af6(const char *domain, in netlbl_domhsh_remove_af6() argument
756 if (domain) in netlbl_domhsh_remove_af6()
757 entry_map = netlbl_domhsh_search(domain, AF_INET6); in netlbl_domhsh_remove_af6()
759 entry_map = netlbl_domhsh_search_def(domain, AF_INET6); in netlbl_domhsh_remove_af6()
775 /* the domain mapping is empty so remove it from the mapping table */ in netlbl_domhsh_remove_af6()
796 * netlbl_domhsh_remove - Removes an entry from the domain hash table
797 * @domain: the domain to remove
802 * Removes an entry from the domain hash table and handles any updates to the
808 int netlbl_domhsh_remove(const char *domain, u16 family, in netlbl_domhsh_remove() argument
817 if (domain) in netlbl_domhsh_remove()
818 entry = netlbl_domhsh_search(domain, AF_INET); in netlbl_domhsh_remove()
820 entry = netlbl_domhsh_search_def(domain, AF_INET); in netlbl_domhsh_remove()
828 if (domain) in netlbl_domhsh_remove()
829 entry = netlbl_domhsh_search(domain, AF_INET6); in netlbl_domhsh_remove()
831 entry = netlbl_domhsh_search_def(domain, AF_INET6); in netlbl_domhsh_remove()
848 * Removes/resets the default entry corresponding to @family from the domain
860 * netlbl_domhsh_getentry - Get an entry from the domain hash table
861 * @domain: the domain name to search for
865 * Look through the domain hash table searching for an entry to match @domain,
871 struct netlbl_dom_map *netlbl_domhsh_getentry(const char *domain, u16 family) in netlbl_domhsh_getentry() argument
875 return netlbl_domhsh_search_def(domain, family); in netlbl_domhsh_getentry()
879 * netlbl_domhsh_getentry_af4 - Get an entry from the domain hash table
880 * @domain: the domain name to search for
884 * Look through the domain hash table searching for an entry to match @domain
889 struct netlbl_dommap_def *netlbl_domhsh_getentry_af4(const char *domain, in netlbl_domhsh_getentry_af4() argument
895 dom_iter = netlbl_domhsh_search_def(domain, AF_INET); in netlbl_domhsh_getentry_af4()
909 * netlbl_domhsh_getentry_af6 - Get an entry from the domain hash table
910 * @domain: the domain name to search for
914 * Look through the domain hash table searching for an entry to match @domain
919 struct netlbl_dommap_def *netlbl_domhsh_getentry_af6(const char *domain, in netlbl_domhsh_getentry_af6() argument
925 dom_iter = netlbl_domhsh_search_def(domain, AF_INET6); in netlbl_domhsh_getentry_af6()
939 * netlbl_domhsh_walk - Iterate through the domain mapping hash table
946 * Interate over the domain mapping hash table, skipping the first @skip_bkt