bind.c revision c0dd49bdd68c0d758a67d56f07826f3b45cfc664
/*
* 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 <sys/sysmacros.h>
/*
* XXX this probably still needs more work.. no INADDR_ANY, and rbtrees aren't
* particularly zippy.
*
* This is now called for every incoming frame so we arguably care much more
* about it than we used to.
*/
static struct rdsv3_sock *
struct rdsv3_sock *insert)
{
struct rdsv3_sock *rs;
}
return (rs);
}
/*
* Return the rdsv3_sock bound at the given local address.
*
* The rx path can race with rdsv3_release. We notice if rdsv3_release() has
* marked this socket and don't return a rs ref to the rx path.
*/
struct rdsv3_sock *
{
struct rdsv3_sock *rs;
else
return (rs);
}
/* returns -ve errno or +ve port */
static int
{
int ret = -EADDRINUSE;
if (*port != 0) {
} else {
sizeof (uint16_t));
}
do {
if (rover == 0)
rover++;
ret = 0;
break;
}
if (ret == 0) {
RDSV3_DPRINTF5("rdsv3_add_bound",
"rs %p binding to %u.%u.%u.%u:%x",
}
return (ret);
}
void
{
if (rs->rs_bound_addr) {
RDSV3_DPRINTF5("rdsv3_remove_bound",
"rs %p unbinding from %u.%u.%u.%u:%x",
rs->rs_bound_addr = 0;
}
}
/* ARGSUSED */
int
{
int ret;
return (EINVAL);
}
return (EINVAL);
}
/* We don't allow multiple binds */
if (rs->rs_bound_addr) {
return (EINVAL);
}
if (ret) {
return (ret);
}
return (EADDRNOTAVAIL);
}
return (0);
}