/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <net/if_types.h>
#include <sys/pathname.h>
extern char cmlog[];
int ibcm_printip = 0;
/*
* Function:
* ibcm_ip_print
* Input:
* label Arbitrary qualifying string
* ipa Pointer to IP Address to print
*/
void
{
} else {
}
}
{
int ret = 0;
int len;
KM_SLEEP);
"returned: %d", ret);
if (ret == 0) {
}
if (sgid)
if (dgid)
/*
* If the user supplied a address, then verify we got
* for the same address.
*/
IP_ADDR_LEN : sizeof (in6_addr_t);
"srcaddr mismatch");
/* Clean-up old data, and reset the done flag */
if (ret == 0) {
}
if (sgid)
if (saddrp)
sizeof (ibt_ip_addr_t));
"ibcm_arp_get_ibaddr: "
"SGID: %llX:%llX DGID: %llX:%llX",
} else if (ret == 0) {
if (wqnp)
sizeof (ibcm_arp_prwqn_t));
}
goto arp_ibaddr_done;
}
}
if (saddrp)
} else if (ret == 0) {
/*
* We come here only when lookup has returned empty (failed)
* via callback routine.
* i.e. ib_s->status is non-zero, while ret is zero.
*/
if (wqnp)
}
if (ret)
return (IBT_FAILURE);
else
return (IBT_SUCCESS);
}
void
{
if (ibds->ibcm_arp_ip) {
sizeof (ibcm_arp_ip_t));
ibds->ibcm_arp_ibd_alloc = 0;
ibds->ibcm_arp_ibd_cnt = 0;
}
}
static void
{
int nparts;
(nparts == 0)) {
"IB Part List - %d", nparts);
ibds->ibcm_arp_ibd_alloc = 0;
ibds->ibcm_arp_ibd_cnt = 0;
return;
}
nparts);
ibds->ibcm_arp_ibd_cnt = 0;
while (nparts--) {
ibds->ibcm_arp_ibd_cnt++;
"port_gid %llX \n attr-port_guid %llX",
attr->pa_port_guid);
}
attr++;
}
}
/*
* Issue an ioctl down to IP. There are several similar versions of this
* function (e.g., rpcib_do_ip_ioctl()); clearly a utility routine is needed.
*/
static int
{
int err = 0;
return (EPROTO);
return (EPROTO);
}
return (err);
}
/*
* Issue an SIOCGLIFCONF down to IP and return the result in `lifcp'.
* lifcp->lifc_buf is dynamically allocated to be *bufsizep bytes.
*/
static int
{
int err;
if (err != 0)
return (err);
/*
* Pad the interface count to account for additional interfaces that
* may have been configured between the SIOCGLIFNUM and SIOCGLIFCONF.
*/
if (err != 0) {
return (err);
}
return (0);
}
static ibcm_arp_ip_t *
{
int i;
/*
* If at first we don't succeed, try again, just in case it is in
* hiding. The first call requires the datalink management daemon
* (the authorative source of information about name to id mapping)
* to be present and answering upcalls, the second does not.
*/
"get linkid from linkname (%s)", linkname);
return (NULL);
}
}
for (i = 0; i < ibds->ibcm_arp_ibd_cnt; i++) {
return (&ibds->ibcm_arp_ip[i]);
}
"linkname (%s)", linkname);
return (NULL);
}
/*
* Fill in `ibds' with IP addresses tied to IFT_IB IP interfaces. Returns
* B_TRUE if at least one address was filled in.
*/
static boolean_t
{
int err;
return (B_FALSE);
family_loc, nifs);
continue;
/* Get ZoneId. */
ifzoneid = 0;
&lifr_copy);
if (err != 0) {
err);
} else {
}
/* Get IfIndex. */
&lifr_copy);
if (err != 0) {
err);
} else
/* Get Interface flags. */
&lifr_copy);
if (err != 0) {
err);
} else {
ifflags);
}
if (err != 0) {
"err = %d", err);
}
sizeof (struct lifgroupinfo), &lifgr);
if (err != 0) {
"Failed: err = %d", err);
} else {
" %s, m4ifname : %s, m6ifname : %s",
"gi_nv4 %d, gi_nv6 %d, gi_mactype %d",
}
}
continue;
case AF_INET:
sizeof (struct sockaddr_in));
naddr++;
break;
case AF_INET6:
sizeof (struct sockaddr_in6));
naddr++;
break;
}
}
return (naddr > 0);
}
{
#ifdef DEBUG
int i;
#endif
if (ibdp->ibcm_arp_ibd_cnt == 0)
return (IBT_SRC_IP_NOT_FOUND);
/* Get the IP addresses of active ports. */
"ibd instance: IBT_SRC_IP_NOT_FOUND");
return (IBT_SRC_IP_NOT_FOUND);
}
#ifdef DEBUG
for (i = 0; i < ibdp->ibcm_arp_ibd_cnt; i++) {
"PKey 0x%lX \n HCAGUID 0x%llX SGID %llX:%llX",
sizeof (my_buf)));
} else {
}
}
#endif
return (IBT_SUCCESS);
}