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) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * Table of data type sizes indexed by dladm_datatype_t. 2N/A 0,
/* DLADM_TYPE_STR, use strnlen() */ 2N/A /* The door descriptor is opened if it isn't already */ 2N/A * Stale door descriptor is possible if dlmgmtd was re-started 2N/A * since last door_fd open so try re-opening door file. 2N/A * The size of the input rbuf is not big enough so that 2N/A * the door allocate the rbuf itself. In this case, return 2N/A * the required size to the caller. 2N/A * Allocate a new linkid with the given name for the given zone. 2N/A * Return the new linkid. 2N/A * Allocate a new linkid with the given name. Return the new linkid. 2N/A * Destroy the given link ID. 2N/A * Remap a given link ID to a new name. 2N/A * Make a given link ID active. 2N/A * Create a new link with the given name. Return the new link's handle 2N/A /* get LINKOVER property, this is a must prop */ 2N/A * returned status ignored, cause it is ok that the underline 2N/A * Get flow_desc and mac_resource, these props don't have to 2N/A * set. So NOTFOUND is ok. 2N/A/* get the flowconf who is next to the "flowname" flow */ 2N/A /* get LINKOVER property, this is a must prop */ 2N/A * Get flow_desc and mac_resource, these props don't have to 2N/A * set. So NOTFOUND is ok. 2N/A * An active physical link reported by the dlmgmtd daemon might not be active 2N/A * anymore as this link might be removed during system shutdown. Check its 2N/A * real status by calling dladm_phys_info(). 2N/A * No active status, this link was removed. Update its status 2N/A * in the daemon and delete all active linkprops. 2N/A * Note that the operation could fail. If it does, return 2N/A * failure now since otherwise dladm_set_linkprop() might 2N/A * call back to i_dladm_phys_status() recursively. 2N/A * Utility function to search for a zone ID in an array of zone IDs. 2N/A * Walk each entry in the data link configuration repository and 2N/A * call fn on the linkid and arg. Caller must supply one of the 2N/A * two callback fns. The first callback fn is called for each 2N/A * datalink along with the datalink ID argument, the second callback 2N/A * is called with datalink ID and the name of the datalink. 2N/A * Done with walking. If no next datalink is found, 2N/A * An active physical link reported by the dlmgmtd 2N/A * daemon might not be active anymore. Check its 2N/A * Skip to next link now if we are only looking 2N/A * If datalink is on loan to a NGZ then we have to call 2N/A * the callback twice, with and without a zonename prefix. 2N/A * First check if we should use the non-prefixed link 2N/A * name that is associated with the global zone. 2N/A * Next, check if we should use the prefixed link name 2N/A * that is loaned to the non-global zone. 2N/A * For all other datalinks first check if -z option was 2N/A * used the datalink is part of the given -z option 2N/A * Datalink walker function that requires the callback function to 2N/A * accept a datalink information structure. This walker should be 2N/A * used when printing out datalink names as datalinks in non-global 2N/A * zones are displayed in the global zone with a zonename prefix. 2N/A * Walk each physical device present on the system in order based on the 2N/A * relative locations of the physical devices, calling fn() and passing in 2N/A * argp. Walk is possible only for active config. DLADM_OPT_FORCE is 2N/A * supported but optional). Attributes are walked in order determined by 2N/A * their current relative physical locations. 2N/A * Done with walking. If no next device is found, 2N/A * "force" option is only needed for initial door call to 2N/A * refresh physical location data. 2N/A /* Device may have been removed */ 2N/A * Reinitialize physical links. 2N/A * check if given flow exists 2N/A * Walk each entry in the data link configuration repository and 2N/A * call fn on the linkid and arg. 2N/A * Get a handle of a copy of the link configuration (kept in the daemon) 2N/A * for the given link so it can be updated later by dladm_write_conf(). 2N/A * Get the handle of a local snapshot of the link configuration. Note that 2N/A * any operations with this handle are read-only, i.e., one can not update 2N/A * the configuration with this handle. 2N/A * Commit the given flow to the configuration repository so that it will 2N/A * persist across reboots. 2N/A * Return the underlying links for the link represented by the conf object. 2N/A * The caller MUST free the string that is returned. 2N/A * Determine which property is used to store the underlying links for 2N/A /* Then, retrieve the links from that property */ 2N/A * Commit the given link to the data link configuration repository so 2N/A * that it will persist across reboots. 2N/A * If the door call to write the configuration is successful, send a 2N/A * door call to nwamd to read in this newly created configuration. 2N/A /* find the links under this link for vnics, aggrs, etc. */ 2N/A * Given a flow name and an attribute name, get the attribute value from 2N/A * flow configuration repository. 2N/A * Given a dladm_conf_t, get the specific configuration field 2N/A * If the specified dladm_conf_t is a read-only snapshot of the configuration, 2N/A * get a specific link propertie from that snapshot (nvl), otherwise, get 2N/A * the link protperty from the dlmgmtd daemon using the given confid. 2N/A * Get next property attribute from data link configuration repository. 2N/A * If last_attr is "", return the first property. 2N/A * Get the link ID that is associated with the given name. 2N/A * An active physical link reported by the dlmgmtd daemon 2N/A * might not be active anymore. Check and set its real status. 2N/A * Get the link attributes including zoneid 2N/A * An active physical link reported by the dlmgmtd daemon 2N/A * might not be active anymore. Check and set its real status. 2N/A * Get the link name that is associated with the given id. 2N/A * Set the given attr with the given attrval for the given flow. 2N/A * Set the given attr with the given attrval for the given link. 2N/A * Unset the given attr the given link. 2N/A * Remove the flow and its entry from the data link configuration 2N/A * Remove the given link ID and its entry from the data link configuration 2N/A * If the door call to remove configuration is successful, send a door 2N/A * call to nwamd to remove the configuration. 2N/A /* no need to determine what links are underneath */ 2N/A * Free the contents of the link structure.