Make the pipe_names[] array static to cli_pipe.c
authorVolker Lendecke <vl@samba.org>
Sat, 19 Jul 2008 18:40:27 +0000 (20:40 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 19 Jul 2008 18:40:27 +0000 (20:40 +0200)
(This used to be commit ab7ab350591bf16717744a0c252d3a9d185bcb77)

source3/rpc_client/cli_pipe.c
source3/rpc_parse/parse_rpc.c

index 5e8bff311629fb3a297aae7c654f62f70051becd..169fe79406fe0fca10729befc182d5ef842f36e6 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_CLI
 
-extern struct pipe_id_info pipe_names[];
+/*******************************************************************
+interface/version dce/rpc pipe identification
+********************************************************************/
+
+static const struct ndr_syntax_id syntax_spoolss = {
+       {
+               0x12345678, 0x1234, 0xabcd,
+               { 0xef, 0x00 },
+               { 0x01, 0x23,
+                 0x45, 0x67, 0x89, 0xab }
+       }, 0x01
+};
+
+/*
+ * IMPORTANT!!  If you update this structure, make sure to
+ * update the index #defines in smb.h.
+ */
+
+static const struct pipe_id_info pipe_names [] =
+{
+       { PIPE_LSARPC,          &ndr_table_lsarpc.syntax_id,
+         PIPE_LSASS,           &ndr_transfer_syntax },
+       { PIPE_LSARPC,          &ndr_table_dssetup.syntax_id,
+         PIPE_LSASS,           &ndr_transfer_syntax },
+       { PIPE_SAMR,            &ndr_table_samr.syntax_id,
+         PIPE_LSASS,           &ndr_transfer_syntax },
+       { PIPE_NETLOGON,        &ndr_table_netlogon.syntax_id,
+         PIPE_LSASS,           &ndr_transfer_syntax },
+       { PIPE_SRVSVC,          &ndr_table_srvsvc.syntax_id,
+         PIPE_NTSVCS,          &ndr_transfer_syntax },
+       { PIPE_WKSSVC,          &ndr_table_wkssvc.syntax_id,
+         PIPE_NTSVCS,          &ndr_transfer_syntax },
+       { PIPE_WINREG,          &ndr_table_winreg.syntax_id,
+         PIPE_WINREG,          &ndr_transfer_syntax },
+       { PIPE_SPOOLSS,         &syntax_spoolss,
+         PIPE_SPOOLSS,         &ndr_transfer_syntax },
+       { PIPE_NETDFS,          &ndr_table_netdfs.syntax_id,
+         PIPE_NETDFS,          &ndr_transfer_syntax },
+       { PIPE_ECHO,            &ndr_table_rpcecho.syntax_id,
+         PIPE_ECHO,            &ndr_transfer_syntax },
+       { PIPE_SHUTDOWN,        &ndr_table_initshutdown.syntax_id,
+         PIPE_SHUTDOWN,        &ndr_transfer_syntax },
+       { PIPE_SVCCTL,          &ndr_table_svcctl.syntax_id,
+         PIPE_NTSVCS,          &ndr_transfer_syntax },
+       { PIPE_EVENTLOG,        &ndr_table_eventlog.syntax_id,
+         PIPE_EVENTLOG,        &ndr_transfer_syntax },
+       { PIPE_NTSVCS,          &ndr_table_ntsvcs.syntax_id,
+         PIPE_NTSVCS,          &ndr_transfer_syntax },
+       { PIPE_EPMAPPER,        &ndr_table_epmapper.syntax_id,
+         PIPE_EPMAPPER,        &ndr_transfer_syntax },
+       { PIPE_DRSUAPI,         &ndr_table_drsuapi.syntax_id,
+         PIPE_DRSUAPI,         &ndr_transfer_syntax },
+       { NULL, NULL, NULL, NULL }
+};
+
+/****************************************************************************
+ Return the pipe name from the index.
+ ****************************************************************************/
+
+const char *cli_get_pipe_name(int pipe_idx)
+{
+       return &pipe_names[pipe_idx].client_pipe[5];
+}
+
+/****************************************************************************
+ Return the pipe idx from the syntax.
+ ****************************************************************************/
+int cli_get_pipe_idx(const RPC_IFACE *syntax)
+{
+       int i;
+       for (i = 0; pipe_names[i].client_pipe; i++) {
+               if (ndr_syntax_id_equal(pipe_names[i].abstr_syntax, syntax)) {
+                       return i;
+               }
+       }
+
+       return -1;
+}
 
 /********************************************************************
  Map internal value to wire value.
index ac5483dfd1aa36e0c28039bf65101a20e40b86ac..14a4effbf036c2856c82ed7ca680093b967bde0f 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_PARSE
 
-/*******************************************************************
-interface/version dce/rpc pipe identification
-********************************************************************/
-
-const struct ndr_syntax_id syntax_spoolss = {
-       {
-               0x12345678, 0x1234, 0xabcd,
-               { 0xef, 0x00 },
-               { 0x01, 0x23,
-                 0x45, 0x67, 0x89, 0xab }
-       }, 0x01
-};
-
-/*
- * IMPORTANT!!  If you update this structure, make sure to
- * update the index #defines in smb.h.
- */
-
-const struct pipe_id_info pipe_names [] =
-{
-       { PIPE_LSARPC  , &ndr_table_lsarpc.syntax_id, PIPE_LSASS    , &ndr_transfer_syntax },
-       { PIPE_LSARPC  , &ndr_table_dssetup.syntax_id, PIPE_LSASS    , &ndr_transfer_syntax },
-       { PIPE_SAMR    , &ndr_table_samr.syntax_id, PIPE_LSASS    , &ndr_transfer_syntax },
-       { PIPE_NETLOGON, &ndr_table_netlogon.syntax_id, PIPE_LSASS    , &ndr_transfer_syntax },
-       { PIPE_SRVSVC  , &ndr_table_srvsvc.syntax_id, PIPE_NTSVCS   , &ndr_transfer_syntax },
-       { PIPE_WKSSVC  , &ndr_table_wkssvc.syntax_id, PIPE_NTSVCS   , &ndr_transfer_syntax },
-       { PIPE_WINREG  , &ndr_table_winreg.syntax_id, PIPE_WINREG   , &ndr_transfer_syntax },
-       { PIPE_SPOOLSS , &syntax_spoolss        , PIPE_SPOOLSS  , &ndr_transfer_syntax },
-       { PIPE_NETDFS  , &ndr_table_netdfs.syntax_id, PIPE_NETDFS   , &ndr_transfer_syntax },
-       { PIPE_ECHO    , &ndr_table_rpcecho.syntax_id, PIPE_ECHO     , &ndr_transfer_syntax },
-       { PIPE_SHUTDOWN, &ndr_table_initshutdown.syntax_id, PIPE_SHUTDOWN , &ndr_transfer_syntax },
-       { PIPE_SVCCTL  , &ndr_table_svcctl.syntax_id, PIPE_NTSVCS   , &ndr_transfer_syntax },
-       { PIPE_EVENTLOG, &ndr_table_eventlog.syntax_id, PIPE_EVENTLOG , &ndr_transfer_syntax },
-       { PIPE_NTSVCS  , &ndr_table_ntsvcs.syntax_id, PIPE_NTSVCS   , &ndr_transfer_syntax },
-       { PIPE_EPMAPPER  , &ndr_table_epmapper.syntax_id, PIPE_EPMAPPER   , &ndr_transfer_syntax },
-       { PIPE_DRSUAPI , &ndr_table_drsuapi.syntax_id, PIPE_DRSUAPI   , &ndr_transfer_syntax },
-       { NULL         , NULL                  , NULL          , NULL }
-};
-
-/****************************************************************************
- Return the pipe name from the index.
- ****************************************************************************/
-
-const char *cli_get_pipe_name(int pipe_idx)
-{
-       return &pipe_names[pipe_idx].client_pipe[5];
-}
-
-/****************************************************************************
- Return the pipe idx from the syntax.
- ****************************************************************************/
-int cli_get_pipe_idx(const RPC_IFACE *syntax)
-{
-       int i;
-       for (i = 0; pipe_names[i].client_pipe; i++) {
-               if (ndr_syntax_id_equal(pipe_names[i].abstr_syntax, syntax)) {
-                       return i;
-               }
-       }
-
-       return -1;
-}
-
 /*******************************************************************
  Inits an RPC_HDR structure.
 ********************************************************************/