/*
* 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 2013 Nexenta Systems, Inc. All rights reserved.
*/
#include <smbsrv/smb_kproto.h>
#include <smbsrv/smb_door.h>
#ifdef _FAKE_KERNEL
#error "See libfksmbsrv"
#endif /* _FAKE_KERNEL */
static int smb_kdoor_encode(smb_doorarg_t *);
static int smb_kdoor_decode(smb_doorarg_t *);
static void smb_kdoor_free(door_arg_t *);
void
{
}
void
{
}
/*
* Open the door. If the door is already open, close it first
* because the door-id has probably changed.
*/
int
{
int rc;
sv->sv_kdoor_ncall = 0;
}
return (rc);
}
/*
* Close the door.
*/
void
{
while (sv->sv_kdoor_ncall > 0)
}
}
/*
* Wrapper to handle door call reference counting.
*/
int
{
int rc;
return (-1);
}
return (-1);
return (-1);
}
}
sv->sv_kdoor_ncall++;
rc = -1;
else
}
} else {
}
}
if ((--sv->sv_kdoor_ncall) == 0)
return (rc);
}
/*
* Send the request half of the consumer's door call.
*/
static int
{
int rc;
if (smb_kdoor_encode(&da) != 0)
return (-1);
return (rc);
}
/*
* Get the response half for the consumer's door call.
*/
static int
{
int rc;
if (smb_kdoor_encode(&da) != 0)
return (-1);
return (rc);
}
/*
* We use a copy of the door arg because doorfs may change data_ptr
* and we want to detect that when freeing the door buffers. After
* this call, response data must be referenced via rbuf and rsize.
*/
static int
{
int i;
int rc;
for (i = 0; i < SMB_DOOR_CALL_RETRIES; ++i) {
if (smb_server_is_stopping(sv))
return (-1);
break;
return (-1);
}
return (-1);
return (0);
}
static int
{
char *buf;
xdr_destroy(&xdrs);
return (-1);
}
xdr_destroy(&xdrs);
return (-1);
}
}
xdr_destroy(&xdrs);
return (0);
}
/*
* Decode the response in rbuf and rsize.
*/
static int
{
return (-1);
}
xdr_destroy(&xdrs);
return (-1);
}
xdr_destroy(&xdrs);
return (-1);
}
xdr_destroy(&xdrs);
return (-1);
}
}
xdr_destroy(&xdrs);
return (0);
}
static void
{
}
static boolean_t
{
return (B_FALSE);
}
switch (hdr->dh_door_rc) {
case SMB_DOP_SUCCESS:
break;
/* SMB_DOP_EMPTYBUF is a "normal" error (silent). */
case SMB_DOP_EMPTYBUF:
return (B_FALSE);
default:
return (B_FALSE);
}
return (B_TRUE);
}
/*
* Free both the argument and result door buffers regardless of the status
* of the up-call. The doorfs allocates a new buffer if the result buffer
* passed by the client is too small.
*/
static void
{
}