rds_ioctl.c revision 8257fab973a69800a3a3309e8af21fc1876d2df9
/*
* 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
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#define AF_INET_OFFLOAD 30
#include <sys/pathname.h>
/*
* Just pass the ioctl to IP and the result to the caller.
*/
int
{
int err = 0;
&kvp) == 0) {
} else {
return (EPROTO);
}
} else {
return (EPROTO);
}
return (err);
}
static int
{
union DL_primitives *dl_prim;
int error;
return (ENOMEM);
}
return (error);
}
return (error);
}
switch (dl_prim->dl_primitive) {
case DL_INFO_ACK:
sizeof (dl_info_ack_t)) {
error = -1;
} else {
error = 0;
}
break;
default:
error = -1;
break;
}
return (error);
}
/*
* Return 0 if the interface is IB.
* Return error (>0) if any error is encountered during processing.
* Return -1 if the interface is not IB and no error.
*/
static int
rds_is_ib_interface(char *name)
{
char dev_path[MAXPATHLEN];
char devname[MAXNAMELEN];
int ret = 0;
int i;
/*
* ibd devices are only style 2 devices
* so we will open only style 2 devices
* by ignoring the ppa
*/
if (i < 0) {
/* Invalid interface name, no alphabet */
return (-1);
}
/*
* loopback interface is considered RDS capable
*/
return (0);
}
/* string overflow */
return (-1);
}
if (ret != 0) {
return (ret);
}
if (ret != 0) {
return (ret);
}
return (-1);
}
return (0);
}
void
{
char *addr;
int err = 0;
goto done;
}
case SIOCGIFNUM: {
/* Get number of interfaces. */
int num_ifs;
int n;
(char *)&num_ifs);
if (err != 0) {
break;
}
if (err != 0) {
break;
}
n = num_ifs;
if (err == 0) {
num_ifs++;
} else if (err > 0) {
num_ifs = 0;
break;
} else {
err = 0;
}
n--;
}
}
break;
case O_SIOCGIFCONF:
case SIOCGIFCONF: {
int ubuf_size;
int num_ifs;
(char *)&num_ifs);
if (err != 0) {
break;
}
if (err != 0) {
break;
}
break;
}
for (; num_ifs > 0 &&
if (err == 0) {
ptr++;
} else if (err > 0) {
break;
} else {
err = 0;
}
}
}
break;
case SIOCGIFMTU:
break;
case SIOCGIFFLAGS:
break;
case TI_GETMYNAME: {
int addrlen;
B_TRUE);
return;
}
break;
default:
err = EOPNOTSUPP;
break;
}
if (err == 0) {
mi_copyout(q, mp);
return;
}
done:
}
void
{
int copyin_size;
return;
}
case O_SIOCGIFCONF:
case SIOCGIFCONF:
else
break;
case SIOCGIFNUM:
copyin_size = sizeof (int);
break;
case SIOCGIFFLAGS:
case SIOCGIFMTU:
copyin_size = sizeof (struct ifreq);
break;
case TI_GETMYNAME:
break;
}
}
void
{
case O_SIOCGIFCONF:
case SIOCGIFCONF:
case SIOCGIFNUM:
case SIOCGIFMTU:
case SIOCGIFFLAGS:
case TI_GETMYNAME:
rds_ioctl_copyin_setup(q, mp);
break;
default:
break;
}
}
{
int numifs;
return (ret);
}
goto done;
}
struct sockaddr_in *sin;
break;
}
}
done:
return (ret);
}