5088N/A * The contents of this file are subject to the terms of the 5088N/A * Common Development and Distribution License (the "License"). 5088N/A * You may not use this file except in compliance with the License. 5088N/A * See the License for the specific language governing permissions 5088N/A * and limitations under the License. 5088N/A * When distributing Covered Code, include this CDDL HEADER in each 5088N/A * If applicable, add the following below this CDDL HEADER, with the 5088N/A * fields enclosed by brackets "[]" replaced with your own identifying 5088N/A * information: Portions Copyright [yyyy] [name of copyright owner] 5503N/A * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. 5088N/A * Given a token with a logical unit spec, return the logical unit converted 5088N/A * Returns: 0 for success, nonzero if an error occurred. errno is set if 5088N/A /* Lun must be all digits */ 5088N/A * Given a single token ending with a ppa spec, return the ppa spec converted 5088N/A * Returns: 0 for success, nonzero if an error occurred. errno is set if 5088N/A * If the device name does not end with a digit or the device 5088N/A * name is a sequence of numbers or a PPA contains a leading 5088N/A /* max value of PPA is 4294967294, which is (UINT_MAX - 1) */ 5088N/A * Given a `linkname' of the form drv(ppa), parse it into `driver' and `ppa'. 5088N/A * If the `dsize' for the `driver' is not atleast MAXLINKNAMELEN then part of 5088N/A * the driver name will be copied to `driver'. 5088N/A * This function also validates driver name and PPA and therefore callers can 5088N/A * call this function with `driver' and `ppa' set to NULL, to just verify the 5088N/A /* strip the ppa off of the linkname, if present */ 5088N/A * Now check for the validity of the device name. The legal characters 5088N/A * in a device name are: alphanumeric (a-z, A-Z, 0-9), underscore 5088N/A * ('_'), hyphen ('-'), and period ('.'). The first character 5088N/A * of the device name cannot be a digit and should be an alphabetic 5088N/A * Given an IP interface name, which is either a 5088N/A * - datalink name (which is driver name plus PPA), for e.g. bge0 or 5088N/A * - datalink name plus a logical interface identifier (delimited by ':'), 5088N/A * the following function validates its form and decomposes the contents into 5088N/A * Returns _B_TRUE for success, otherwise _B_FALSE is returned. 5088N/A * Issues the ioctl SIOCSLIFNAME to kernel. 5088N/A /* We should have already validated the interface name. */ 5088N/A * Wrapper for sending a non-transparent I_STR ioctl(). 5088N/A * Returns: Result from ioctl(). 5088N/A * Issues the ioctl SIOCSLIFNAME to kernel on the given ARP stream fd. 5088N/A * Tell ARP the name and unit number for this interface. 5088N/A * Note that arp has no support for transparent ioctls. 5088N/A * Open "/dev/udp{,6}" for use as a multiplexor to PLINK the interface stream 5088N/A * you PLINK a driver under itself, and "/dev/ip" is typically the driver at 5088N/A * the bottom of the stream for tunneling interfaces. 5088N/A * Pop off all undesired modules (note that the user may have 5088N/A * configured autopush to add modules above udp), and push the 5088N/A * arp module onto the resulting stream. This is used to make 5088N/A * IP+ARP be able to atomically track the muxid for the I_PLINKed 5088N/A * STREAMS, thus it isn't related to ARP running the ARP protocol. 5088N/A * Returns the flags value for the logical interface in `lifname' 5088N/A * in the buffer pointed to by `flags'. 5088N/A * For a given interface name, checks if IP interface exists. 5088N/A * We used /dev/udp or udp6 to set up the mux. So we have to use 5088N/A * the same now for PUNLINK also. 5088N/A * We don't have a good way of knowing whether the arp stream is 5088N/A * plumbed. We can't rely on IFF_NOARP because someone could 5088N/A * have turned it off later using "ifconfig xxx -arp". 5088N/A * Some plumbing utilities set the muxid to 5088N/A * -1 or some invalid value to signify that 5088N/A * there is no arp stream. Set the muxid to 0 5088N/A * before trying to unplumb the IP stream. 5088N/A * IP does not allow the IP stream to be 5088N/A * unplumbed if it sees a non-null arp muxid, 5088N/A * for consistency of IP-ARP streams. 5088N/A * Some error occurred, and we need to restore 5088N/A * everything back to what it was. 5088N/A * Plumbs the interface `ifname'. 5088N/A * We use DLPI_NOATTACH because the ip module will do the attach 5088N/A * itself for DLPI style-2 devices. 5088N/A /* Get the full set of existing flags for this stream */ 5088N/A /* Check if arp is not needed */ 5088N/A * PLINK the interface stream so that the application can exit 5088N/A * without tearing down the stream. 5088N/A * This interface does use ARP, so set up a separate stream 5088N/A * from the interface to ARP. 5088N/A * We use DLPI_NOATTACH because the arp module will do the attach 5088N/A * itself for DLPI style-2 devices. 5088N/A * PLINK the IP and ARP streams so that we can exit 5088N/A * without tearing down the stream. 5088N/A "failed Datalink_getInfo(%s): %s",
5088N/A "failed Physical_getInfo(%s): %s",
5088N/A "failed Datalink_getProperties(%s, %s): %s",
5088N/A "failed Datalink_setPropertiess(%s, %s): %s",
5088N/A /* linkname is 'const char *' and ddlv_sval is 'char *' */ 5088N/A "failed DatalinkManager_createVNIC(%s): %s",
6998N/A * Try setting implicit VNIC's mac-addr-type as "fixed", if it fails then try 6998N/A * with "auto" else bail out. This procedure is to ensure vnic migration 6998N/A * succeeds specifically on LDOM's vnet (ensuring it works on other uplinks too) 6998N/A /* If it fails with "fixed" as mac-addr-type, try with "auto" */ 6998N/A "failed Datalink_setProperties" 5088N/A "failed DatalinkManager_deleteVNIC(%s): %s",
5088N/A "failed DatalinkManager_createEtherstub(%s): %s",
5088N/A "failed DatalinkManager_deleteEtherstub(%s): %s",
6536N/A * when "f" is filled in by the parse_vlan() function, VLAN_CFI bit is 6536N/A * set blindly. Unset this bit now since we don't set this bit in 6536N/A * Solaris for VLAN packets. 5088N/A /* min-rate and priority not currently used */ 6554N/A "%sset-ether%cether_src%c%s%cether_dst%c%s",
5728N/A "%sdst%c%s%cprotocol%c%s%ctos%c0x%x%choplimit%c%d",
5728N/A "%sdst%c%s%clabel%c0x%x%cprotocol%c%s%ctos%c0x%x%choplimit%c%d",
5728N/A "%sdst%c%s%ctun_id%c0x%"PRIx64"%ctos%c0x%x%choplimit%c%d",
5088N/A /* if actions_len == 0, then the action is drop */ 5088N/A /* These only make sense in the context of a datapath. */ 5088N/A "failed Datalink_addFlow(%s, %s): %s",
5088N/A "failed Flow_setProperties(%s): %s",
5088N/A * XXX For now, log DDLSTATUS_NOT_FOUND as debug until 5088N/A * we can determine how to handle the RAD caching 5088N/A "failed Flow_getInfo(%s): %s",
5728N/A * The property value is in the format of "ether_src-xxx" 5088N/A /* Only ethernet address is supported */ 5088N/A * The property value is in the format of "src:xxx" "dst:xxx" 5088N/A * "protocol:xxx" "tos:xxx" "hoplimit:xxx" 5088N/A * The property value is in the format of "src:xxx" "dst:xxx" 5088N/A * "label:0xxxxx" "protocol:xxx" "tos:xxx" "hoplimit:xxx" 5728N/A /* The property value is in the format of "sport-xxx" "dport-xxx" */ 5088N/A /* Check if hostname resolves to multiple addresses */ 5088N/A /* maps to more than one address */ 5088N/A * The property value is in the format of "src:xxx" "dst:xxx" 5088N/A * "tun_id:0x%x" "tos:0x%x" "hoplimit:xxx" 5088N/A * XXX For now, log DDLSTATUS_NOT_FOUND as debug until 5088N/A * we can determine how to handle the RAD caching 5088N/A "failed Flow_getInfo(%s): %s",
5088N/A "failed Datalink_getProperties(%s, %s): %s",
5088N/A * XXX For now, log DDLSTATUS_NOT_FOUND as 5088N/A * debug until we can determine how to handle 5088N/A "failed Flow_getInfo(%s): %s",
5088N/A /* See whether this flow is created over of enabled link */ 5088N/A "failed Datalink_getProperties(%s, %s): %s",
7235N/A "flowinfo2action failed for %s: %d",
5088N/A * This is a copy of dlparse_zonelinkname() function in libinetutil. libinetutil 5088N/A * is not a public interface, therefore we make a copy here. 5088N/A * Given a linkname that can be specified using a zonename prefix retrieve 5088N/A * the optional linkname and/or zone ID value. If no zonename prefix was 5088N/A * specified we set the optional linkname and set optional zone ID return 5088N/A /* If there are no other strings, return given name as linkname */ 5088N/A /* First token is the zonename. Check zone and link lengths */ 5088N/A * If there are more '/' separated strings in the input 5088N/A * name then we return failure. We only support a single 6016N/A * Sets *n_cores to the total number of cores on this system, or 0 if the 6016N/A * number cannot be determined. 6016N/A "Core count may be inaccurate.",
6016N/A "kstat2_map_get failed (%s). " 6016N/A "Core count may be inaccurate.",
6016N/A "Core count may be inaccurate.");
6016N/A "failed (%s). Core count may be inaccurate.",