diff options
author | Andreas Schneider <asn@samba.org> | 2011-05-31 10:28:39 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2011-06-01 12:02:15 +0200 |
commit | 34a600a27f5b288a9185b6d32c7252b9f5a81a09 (patch) | |
tree | e89da69cde8bb4bea5a6afa334e299efa764c03b /source3/rpc_server | |
parent | e39e09ffb5baa527b03454c905ccd1292fa9c93f (diff) | |
download | samba-34a600a27f5b288a9185b6d32c7252b9f5a81a09.tar.gz samba-34a600a27f5b288a9185b6d32c7252b9f5a81a09.tar.bz2 samba-34a600a27f5b288a9185b6d32c7252b9f5a81a09.zip |
s3-rpc_server: Move the context functions to own file.
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/rpc_contexts.c | 40 | ||||
-rw-r--r-- | source3/rpc_server/rpc_contexts.h | 28 | ||||
-rw-r--r-- | source3/rpc_server/srv_pipe.c | 21 | ||||
-rw-r--r-- | source3/rpc_server/wscript_build | 2 |
4 files changed, 70 insertions, 21 deletions
diff --git a/source3/rpc_server/rpc_contexts.c b/source3/rpc_server/rpc_contexts.c new file mode 100644 index 0000000000..bb5c0eaf6c --- /dev/null +++ b/source3/rpc_server/rpc_contexts.c @@ -0,0 +1,40 @@ +/* + * Unix SMB/CIFS implementation. + * RPC Pipe client / server routines + * Almost completely rewritten by (C) Jeremy Allison 2005 - 2010 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#include "includes.h" +#include "ntdomain.h" + +#include "rpc_contexts.h" + +struct pipe_rpc_fns *find_pipe_fns_by_context(struct pipe_rpc_fns *list, + uint32_t context_id) +{ + struct pipe_rpc_fns *fns = NULL; + + if ( !list ) { + DEBUG(0,("find_pipe_fns_by_context: ERROR! No context list for pipe!\n")); + return NULL; + } + + for (fns=list; fns; fns=fns->next ) { + if ( fns->context_id == context_id ) + return fns; + } + return NULL; +} diff --git a/source3/rpc_server/rpc_contexts.h b/source3/rpc_server/rpc_contexts.h new file mode 100644 index 0000000000..8463414bbb --- /dev/null +++ b/source3/rpc_server/rpc_contexts.h @@ -0,0 +1,28 @@ +/* + * Unix SMB/CIFS implementation. + * RPC Pipe client / server routines + * Almost completely rewritten by (C) Jeremy Allison 2005 - 2010 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef _RPC_SERVER_RPC_CONTEXTS_H_ +#define _RPC_SERVER_RPC_CONTEXTS_H_ + +struct pipe_rpc_fns; + +struct pipe_rpc_fns *find_pipe_fns_by_context(struct pipe_rpc_fns *list, + uint32_t context_id); + +#endif /* _RPC_SERVER_RPC_CONTEXTS_H_*/ diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index a6e43b65ec..1af8cdac07 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -42,6 +42,7 @@ #include "auth.h" #include "ntdomain.h" #include "rpc_server/srv_pipe.h" +#include "rpc_server/rpc_contexts.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV @@ -1509,26 +1510,6 @@ static bool api_pipe_alter_context(struct pipes_struct *p, return setup_bind_nak(p, pkt); } -/**************************************************************************** - Find the set of RPC functions associated with this context_id -****************************************************************************/ - -static PIPE_RPC_FNS* find_pipe_fns_by_context( PIPE_RPC_FNS *list, uint32 context_id ) -{ - PIPE_RPC_FNS *fns = NULL; - - if ( !list ) { - DEBUG(0,("find_pipe_fns_by_context: ERROR! No context list for pipe!\n")); - return NULL; - } - - for (fns=list; fns; fns=fns->next ) { - if ( fns->context_id == context_id ) - return fns; - } - return NULL; -} - static bool api_rpcTNP(struct pipes_struct *p, struct ncacn_packet *pkt, const struct api_struct *api_rpc_cmds, int n_cmds); diff --git a/source3/rpc_server/wscript_build b/source3/rpc_server/wscript_build index eba52a1b25..0e557a4bb7 100644 --- a/source3/rpc_server/wscript_build +++ b/source3/rpc_server/wscript_build @@ -26,7 +26,7 @@ bld.SAMBA3_SUBSYSTEM('rpc', vars=locals()) bld.SAMBA3_SUBSYSTEM('RPC_NCACN_NP', - source='rpc_ncacn_np.c rpc_handles.c', + source='rpc_ncacn_np.c rpc_handles.c rpc_contexts.c', deps='auth_sam_reply RPC_PIPE_REGISTER AUTH_COMMON npa_tstream') bld.SAMBA3_SUBSYSTEM('RPC_SERVICE', |