s3-rpc_server: Move the context functions to own file.
authorAndreas Schneider <asn@samba.org>
Tue, 31 May 2011 08:28:39 +0000 (10:28 +0200)
committerAndreas Schneider <asn@samba.org>
Wed, 1 Jun 2011 10:02:15 +0000 (12:02 +0200)
source3/Makefile.in
source3/rpc_server/rpc_contexts.c [new file with mode: 0644]
source3/rpc_server/rpc_contexts.h [new file with mode: 0644]
source3/rpc_server/srv_pipe.c
source3/rpc_server/wscript_build

index c768a402d4837b96e8b6d5e3603575131798cde9..f95fbeb4617370c7d8999ae4bab5549c97e95715 100644 (file)
@@ -727,7 +727,8 @@ NPA_TSTREAM_OBJ = ../libcli/named_pipe_auth/npa_tstream.o \
                  ../auth/auth_sam_reply.o librpc/gen_ndr/ndr_auth.o ../librpc/ndr/ndr_auth.o
 
 RPC_NCACN_NP = rpc_server/srv_pipe_register.o rpc_server/rpc_ncacn_np.o \
-              rpc_server/rpc_handles.o rpc_server/srv_access_check.o
+              rpc_server/rpc_handles.o rpc_server/rpc_contexts.o \
+              rpc_server/srv_access_check.o
 
 RPC_SERVICE = rpc_server/rpc_server.o
 
diff --git a/source3/rpc_server/rpc_contexts.c b/source3/rpc_server/rpc_contexts.c
new file mode 100644 (file)
index 0000000..bb5c0ea
--- /dev/null
@@ -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 (file)
index 0000000..8463414
--- /dev/null
@@ -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_*/
index a6e43b65ec07c529965c7f3cd0fd293ca1478bc2..1af8cdac071c5a3d5d4e6df836976a2f29fa26f4 100644 (file)
@@ -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);
 
index eba52a1b2586a3bd2a8d2fc2ff0b031c3eecb3bd..0e557a4bb755873ce883a17fd26d73ac7fc1d99e 100644 (file)
@@ -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',