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 2006 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A/* protocols attributes filters */ 2N/A "(&(objectClass=ipProtocol)(ipProtocolNumber=%d))" 2N/A "(&(%%s)(ipProtocolNumber=%d))" 2N/A {
"ipip",
"IP-IP" },
2N/A {
"ipcomp",
"IPComp" },
2N/A {
"ipv6-route",
"IPv6-Route" },
2N/A {
"ipv6-frag",
"IPv6-Frag" },
2N/A {
"ipv6-icmp",
"IPv6-ICMP" },
2N/A {
"ipv6-nonxt",
"IPv6-NoNxt" },
2N/A {
"ipv6-opts",
"IPv6-Opts" },
2N/A * When the data is imported by ldapaddent, it does not save the aliase in the 2N/A * "cn" that is same as the canonical name but only different in case. 2N/A * So it needs to replicate the canonical name as an alias of upper case. 2N/A * But some protocol does have different aliases. 2N/A * For many ip* protocols, the aliases are mixed cased. Maybe it's case 2N/A * insensitive. But this fucntion tries to restore the aliases to the original 2N/A * form as much as possible. If the alias can't be found in the aliases table, 2N/A * it assumes the alias is all upper case. 2N/A * No aliase in the table. Return an all upper case aliase 2N/A /* Return an all upper case aliase */ 2N/A * _nss_ldap_protocols2str is the data marshaling method for the protocols 2N/A * getXbyY * (e.g., getbyname(), getbynumber(), getent()) backend processes. 2N/A * This method is called after a successful ldap search has been performed. 2N/A * This method will parse the ldap search values into a file format. 2N/A /* Get the canonical name */ 2N/A /* Append aliases */ 2N/A /* create an aliase from protocol name */ 2N/A /* Skip the canonical name */ 2N/A /* The front end marshaller doesn't need to copy trailing nulls */ 2N/A * getbyname gets struct protoent values by protocol name. This 2N/A * function constructs an ldap search filter using the protocol 2N/A * name invocation parameter and the getprotobyname search filter 2N/A * defined. Once the filter is constructed, we search for a matching 2N/A * entry and marshal the data results into *proto = (struct * 2N/A * protoent *)argp->buf.result. The function _nss_ldap_protocols2ent 2N/A * performs the data marshaling. 2N/A * getbynumber gets struct protoent values by protocol number. This 2N/A * function constructs an ldap search filter using the protocol 2N/A * name invocation parameter and the getprotobynumber search filter 2N/A * defined. Once the filter is constructed, we search for a matching 2N/A * entry and marshal the data results into *proto = (struct * 2N/A * protoent *)argp->buf.result. The function _nss_ldap_protocols2ent 2N/A * performs the data marshaling. 2N/A * _nss_ldap_protocols_constr is where life begins. This function calls 2N/A * the generic ldap constructor function to define and build the abstract 2N/A * data types required to support ldap operations.