/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <inet/ipclassifier.h>
#include <inet/proto_set.h>
#include <sys/pathname.h>
static int ip_helper_stream_close(queue_t *, int);
};
};
};
/*
* set the q_ptr of the 'q' to the conn_t pointer passed in
*/
static void
{
/*
* This operation is allowed only on helper streams with kcred
*/
return;
}
}
void
{
} else {
/* We only handle ioctl related messages here */
ip_wput_nondata(q, mp);
}
}
/* ARGSUSED3 */
int
{
ip_minfop->ip_minfo_dev = 0;
/*
* Clone the device, allocate minor device number
*/
if (ip_minor_arena_la != NULL)
if (ip_minfop->ip_minfo_dev == 0) {
/*
* numbers in the large arena are exhausted
* Try small arena.
* Or this is a 32 bit system, 32 bit systems do not have
* ip_minor_arena_la
*/
if (ip_minfop->ip_minfo_dev == 0) {
return (EBUSY);
}
} else {
}
q->q_qinfo = &ip_helper_stream_rinit;
qprocson(q);
return (0);
}
/* ARGSUSED1 */
static int
{
qprocsoff(q);
return (0);
}
/*
* Public interface for creating an IP stream with shared conn_t
* Handles multiple callers in parallel by using conn_lock.
* Note that we allocate the helper stream without any locks, which means
* we might need to free it if we had two threads doing this concurrently
* for the conn_t.
*/
int
{
int error;
int ret;
/* Already allocated */
return (0);
}
error = 0;
/*
* open ip device via the layered interface.
* pass in kcred as some threads do not have the
* secpolicy_spec_open() will fail the open
*/
if (error != 0) {
return (error);
}
/* Make sure we are the only one */
/* Some other thread won - discard this stream */
return (0);
}
/*
* Share connp with the helper stream. We hold conn_lock across this
* operation.
*/
if (error != 0) {
/*
* Passing in a zero flag indicates that an error
* occured and stream was not shared
*/
}
return (error);
}
/*
* Public interface for freeing IP helper stream
* Caller must ensure no concurrent use of the conn_t, which is normally
* done by calling this from the close routine when the conn_t is quiesced.
*/
void
{
return;
}