/* a list of open pipes */
struct pipe_state {
struct pipe_state *next, *prev;
- struct ipc_private *private;
+ struct ipc_private *ipriv;
const char *pipe_name;
struct ntvfs_handle *handle;
struct dcesrv_connection *dce_conn;
/*
find a open pipe give a file handle
*/
-static struct pipe_state *pipe_state_find(struct ipc_private *private, struct ntvfs_handle *handle)
+static struct pipe_state *pipe_state_find(struct ipc_private *ipriv, struct ntvfs_handle *handle)
{
struct pipe_state *s;
void *p;
- p = ntvfs_handle_get_backend_data(handle, private->ntvfs);
+ p = ntvfs_handle_get_backend_data(handle, ipriv->ntvfs);
if (!p) return NULL;
s = talloc_get_type(p, struct pipe_state);
/*
find a open pipe give a wire fnum
*/
-static struct pipe_state *pipe_state_find_key(struct ipc_private *private, struct ntvfs_request *req, const DATA_BLOB *key)
+static struct pipe_state *pipe_state_find_key(struct ipc_private *ipriv, struct ntvfs_request *req, const DATA_BLOB *key)
{
struct ntvfs_handle *h;
- h = ntvfs_handle_search_by_wire_key(private->ntvfs, req, key);
+ h = ntvfs_handle_search_by_wire_key(ipriv->ntvfs, req, key);
if (!h) return NULL;
- return pipe_state_find(private, h);
+ return pipe_state_find(ipriv, h);
}
struct ntvfs_request *req, const char *sharename)
{
NTSTATUS status;
- struct ipc_private *private;
+ struct ipc_private *ipriv;
ntvfs->ctx->fs_type = talloc_strdup(ntvfs->ctx, "IPC");
NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->fs_type);
NT_STATUS_HAVE_NO_MEMORY(ntvfs->ctx->dev_type);
/* prepare the private state for this connection */
- private = talloc(ntvfs, struct ipc_private);
- NT_STATUS_HAVE_NO_MEMORY(private);
+ ipriv = talloc(ntvfs, struct ipc_private);
+ NT_STATUS_HAVE_NO_MEMORY(ipriv);
- ntvfs->private_data = private;
+ ntvfs->private_data = ipriv;
- private->ntvfs = ntvfs;
- private->pipe_list = NULL;
+ ipriv->ntvfs = ntvfs;
+ ipriv->pipe_list = NULL;
/* setup the DCERPC server subsystem */
- status = dcesrv_init_ipc_context(private, ntvfs->ctx->lp_ctx, &private->dcesrv);
+ status = dcesrv_init_ipc_context(ipriv, ntvfs->ctx->lp_ctx, &ipriv->dcesrv);
NT_STATUS_NOT_OK_RETURN(status);
return NT_STATUS_OK;
*/
static int ipc_fd_destructor(struct pipe_state *p)
{
- DLIST_REMOVE(p->private->pipe_list, p);
- ntvfs_handle_remove_backend_data(p->handle, p->private->ntvfs);
+ DLIST_REMOVE(p->ipriv->pipe_list, p);
+ ntvfs_handle_remove_backend_data(p->handle, p->ipriv->ntvfs);
return 0;
}
static struct socket_address *ipc_get_my_addr(struct dcesrv_connection *dce_conn, TALLOC_CTX *mem_ctx)
{
- struct ipc_private *private = dce_conn->transport.private_data;
+ struct ipc_private *ipriv = dce_conn->transport.private_data;
- return ntvfs_get_my_addr(private->ntvfs, mem_ctx);
+ return ntvfs_get_my_addr(ipriv->ntvfs, mem_ctx);
}
static struct socket_address *ipc_get_peer_addr(struct dcesrv_connection *dce_conn, TALLOC_CTX *mem_ctx)
{
- struct ipc_private *private = dce_conn->transport.private_data;
+ struct ipc_private *ipriv = dce_conn->transport.private_data;
- return ntvfs_get_peer_addr(private->ntvfs, mem_ctx);
+ return ntvfs_get_peer_addr(ipriv->ntvfs, mem_ctx);
}
/*
struct pipe_state *p;
NTSTATUS status;
struct dcerpc_binding *ep_description;
- struct ipc_private *private = ntvfs->private_data;
+ struct ipc_private *ipriv = ntvfs->private_data;
struct ntvfs_handle *h;
status = ntvfs_handle_new(ntvfs, req, &h);
/* The session info is refcount-increased in the
* dcesrv_endpoint_search_connect() function
*/
- status = dcesrv_endpoint_search_connect(private->dcesrv,
+ status = dcesrv_endpoint_search_connect(ipriv->dcesrv,
p,
ep_description,
h->session_info,
&p->dce_conn);
NT_STATUS_NOT_OK_RETURN(status);
- p->dce_conn->transport.private_data = private;
+ p->dce_conn->transport.private_data = ipriv;
p->dce_conn->transport.report_output_data = NULL;
p->dce_conn->transport.get_my_addr = ipc_get_my_addr;
p->dce_conn->transport.get_peer_addr = ipc_get_peer_addr;
- DLIST_ADD(private->pipe_list, p);
+ DLIST_ADD(ipriv->pipe_list, p);
- p->private = private;
+ p->ipriv = ipriv;
talloc_set_destructor(p, ipc_fd_destructor);
- status = ntvfs_handle_set_backend_data(h, private->ntvfs, p);
+ status = ntvfs_handle_set_backend_data(h, ipriv->ntvfs, p);
NT_STATUS_NOT_OK_RETURN(status);
*ps = p;
static NTSTATUS ipc_read(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_read *rd)
{
- struct ipc_private *private = ntvfs->private_data;
+ struct ipc_private *ipriv = ntvfs->private_data;
DATA_BLOB data;
struct pipe_state *p;
NTSTATUS status = NT_STATUS_OK;
return ntvfs_map_read(ntvfs, req, rd);
}
- p = pipe_state_find(private, rd->readx.in.file.ntvfs);
+ p = pipe_state_find(ipriv, rd->readx.in.file.ntvfs);
if (!p) {
return NT_STATUS_INVALID_HANDLE;
}
static NTSTATUS ipc_write(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_write *wr)
{
- struct ipc_private *private = ntvfs->private_data;
+ struct ipc_private *ipriv = ntvfs->private_data;
DATA_BLOB data;
struct pipe_state *p;
NTSTATUS status;
data.data = discard_const_p(void, wr->writex.in.data);
data.length = wr->writex.in.count;
- p = pipe_state_find(private, wr->writex.in.file.ntvfs);
+ p = pipe_state_find(ipriv, wr->writex.in.file.ntvfs);
if (!p) {
return NT_STATUS_INVALID_HANDLE;
}
static NTSTATUS ipc_close(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_close *io)
{
- struct ipc_private *private = ntvfs->private_data;
+ struct ipc_private *ipriv = ntvfs->private_data;
struct pipe_state *p;
if (io->generic.level != RAW_CLOSE_CLOSE) {
return ntvfs_map_close(ntvfs, req, io);
}
- p = pipe_state_find(private, io->close.in.file.ntvfs);
+ p = pipe_state_find(ipriv, io->close.in.file.ntvfs);
if (!p) {
return NT_STATUS_INVALID_HANDLE;
}
static NTSTATUS ipc_exit(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req)
{
- struct ipc_private *private = ntvfs->private_data;
+ struct ipc_private *ipriv = ntvfs->private_data;
struct pipe_state *p, *next;
- for (p=private->pipe_list; p; p=next) {
+ for (p=ipriv->pipe_list; p; p=next) {
next = p->next;
if (p->handle->session_info == req->session_info &&
p->handle->smbpid == req->smbpid) {
static NTSTATUS ipc_logoff(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req)
{
- struct ipc_private *private = ntvfs->private_data;
+ struct ipc_private *ipriv = ntvfs->private_data;
struct pipe_state *p, *next;
- for (p=private->pipe_list; p; p=next) {
+ for (p=ipriv->pipe_list; p; p=next) {
next = p->next;
if (p->handle->session_info == req->session_info) {
talloc_free(p);
*/
static NTSTATUS ipc_async_setup(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req,
- void *private)
+ void *private_data)
{
return NT_STATUS_OK;
}
static NTSTATUS ipc_qfileinfo(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_fileinfo *info)
{
- struct ipc_private *private = ntvfs->private_data;
- struct pipe_state *p = pipe_state_find(private, info->generic.in.file.ntvfs);
+ struct ipc_private *ipriv = ntvfs->private_data;
+ struct pipe_state *p = pipe_state_find(ipriv, info->generic.in.file.ntvfs);
if (!p) {
return NT_STATUS_INVALID_HANDLE;
}
struct ntvfs_request *req, struct smb_trans2 *trans)
{
struct pipe_state *p;
- struct ipc_private *private = ntvfs->private_data;
+ struct ipc_private *ipriv = ntvfs->private_data;
NTSTATUS status;
DATA_BLOB fnum_key;
uint16_t fnum;
SSVAL(&fnum, 0, trans->in.setup[1]);
fnum_key = data_blob_const(&fnum, 2);
- p = pipe_state_find_key(private, req, &fnum_key);
+ p = pipe_state_find_key(ipriv, req, &fnum_key);
if (!p) {
return NT_STATUS_INVALID_HANDLE;
}
static NTSTATUS ipc_set_nm_pipe_state(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, struct smb_trans2 *trans)
{
- struct ipc_private *private = ntvfs->private_data;
+ struct ipc_private *ipriv = ntvfs->private_data;
struct pipe_state *p;
DATA_BLOB fnum_key;
/* the fnum is in setup[1] */
fnum_key = data_blob_const(&trans->in.setup[1], sizeof(trans->in.setup[1]));
- p = pipe_state_find_key(private, req, &fnum_key);
+ p = pipe_state_find_key(ipriv, req, &fnum_key);
if (!p) {
return NT_STATUS_INVALID_HANDLE;
}
struct ntvfs_request *req, union smb_ioctl *io)
{
struct pipe_state *p;
- struct ipc_private *private = ntvfs->private_data;
+ struct ipc_private *ipriv = ntvfs->private_data;
NTSTATUS status;
switch (io->smb2.in.function) {
return NT_STATUS_FS_DRIVER_REQUIRED;
}
- p = pipe_state_find(private, io->smb2.in.file.ntvfs);
+ p = pipe_state_find(ipriv, io->smb2.in.file.ntvfs);
if (!p) {
return NT_STATUS_INVALID_HANDLE;
}