gethostent6.c revision 2
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A/* host attributes filters */ 2N/A/* probably some change in the ipHostNumber field */ 2N/A "(&(objectClass=ipHost)(|(cn=%s)(cn=%s)))" 2N/A "(&(%%s)(|(cn=%s)(cn=%s)))" 2N/A * _nss_ldap_hosts2str is the data marshaling method for the ipnodes getXbyY 2N/A * system call gethostbyname() and gethostbyaddr. 2N/A * This method is called after a successful search has been performed. 2N/A * This method will parse the search results into the file format. 2N/A * fe80::a00:20ff:fec4:f2b6 ipnodes_1 2N/A * getbyname gets a struct hostent by hostname. This function constructs 2N/A * an ldap search filter using the name invocation parameter and the 2N/A * gethostbyname search filter defined. Once the filter is constructed, 2N/A * we search for a matching entry and marshal the data results into 2N/A * struct hostent for the frontend process. Host name searches will be 2N/A /* get the domain we are in */ 2N/A /* Is this a request for a host.domain */ 2N/A /* separate host and domain. this function */ 2N/A /* will munge hname, so use argp->keyname */ 2N/A /* from here on for original string */ 2N/A /* if domain is a proper subset of realdomain */ 2N/A /* ie. domain = "foo" and realdomain */ 2N/A /* host.domain and host */ 2N/A /* yes, it is a proper domain */ 2N/A /* it is not a proper domain, so only try to look up */ 2N/A * getbyaddr gets a struct hostent by host address. This function 2N/A * constructs an ldap search filter using the host address invocation 2N/A * parameter and the gethostbyaddr search filter defined. Once the 2N/A * filter is constructed, we search for a matching entry and marshal 2N/A * the data results into struct hostent for the frontend process. 2N/A * _nss_ldap_hosts_constr is where life begins. This function calls the generic 2N/A * ldap constructor function to define and build the abstract data types 2N/A * required to support ldap operations.