smb_net.c revision 8622ec4569457733001d4982ef7f5b44427069be
/*
* 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 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/pathname.h>
#include <smbsrv/smb_vops.h>
#include <smbsrv/smb_kproto.h>
#include <smbsrv/smb_kstat.h>
/*
* smb_net_init
*
* This function initializes the resources necessary to access the
* network. It assumes it won't be called simultaneously by multiple
* threads.
*
* Return Value
*
* 0 Initialization successful
* ENOMEM Initialization failed
*/
void
smb_net_init(void)
{
if (smb_txr_cache != NULL)
return;
}
/*
* smb_net_fini
*
* This function releases the resources allocated by smb_net_init(). It
* assumes it won't be called simultaneously by multiple threads.
* This function can safely be called even if smb_net_init() hasn't been
* called previously.
*
* Return Value
*
* None
*/
void
smb_net_fini(void)
{
if (smb_txr_cache) {
}
}
/*
* SMB Network Socket API
*
* smb_soshutdown: Disconnect a socket created with smb_socreate
* smb_sodestroy: Release resources associated with a socket
* smb_sosend: Send the contents of a buffer on a socket
* smb_sorecv: Receive data into a buffer from a socket
* smb_iov_sosend: Send the contents of an iovec on a socket
* smb_iov_sorecv: Receive data into an iovec from a socket
*/
{
int err = 0;
CRED());
if (err != 0)
return (NULL);
else
return (sock);
}
/*
* smb_soshutdown will disconnect the socket and prevent subsequent PDU
* reception and transmission. The sonode still exists but its state
* gets modified to indicate it is no longer connected. Calls to
* smb_sorecv/smb_iov_sorecv will return so smb_soshutdown can be used
* regain control of a thread stuck in smb_sorecv.
*/
void
{
}
/*
* smb_sodestroy releases all resources associated with a socket previously
* created with smb_socreate. The socket must be shutdown using smb_soshutdown
* before the socket is destroyed with smb_sodestroy, otherwise undefined
* behavior will result.
*/
void
{
}
int
{
int err;
CRED())) != 0) {
return (err);
}
/* Successful receive */
}
/*
* smb_net_txl_constructor
*
* Transmit list constructor
*/
void
{
}
/*
* smb_net_txl_destructor
*
* Transmit list destructor
*/
void
{
}
/*
* smb_net_txr_alloc
*
* Transmit buffer allocator
*/
smb_net_txr_alloc(void)
{
return (txr);
}
/*
* smb_net_txr_free
*
* Transmit buffer deallocator
*/
void
{
}
/*
* smb_net_txr_send
*
* This routine puts the transmit buffer passed in on the wire. If another
* thread is already draining the transmit list, the transmit buffer is
* queued and the routine returns immediately.
*/
int
{
int rc = 0;
return (0);
}
continue;
if (rc == 0)
rc = -1;
}
break;
}
if (rc == 0)
continue;
}
break;
}
return (rc);
}