s3:lib: split things into a conn_tdb.h
authorStefan Metzmacher <metze@samba.org>
Mon, 4 Jun 2012 13:32:28 +0000 (15:32 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 5 Jun 2012 17:28:35 +0000 (19:28 +0200)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Jun  5 19:28:35 CEST 2012 on sn-devel-104

12 files changed:
source3/include/proto.h
source3/include/smb.h
source3/lib/conn_tdb.c
source3/lib/conn_tdb.h [new file with mode: 0644]
source3/rpc_server/srvsvc/srv_srvsvc_nt.c
source3/smbd/connection.c
source3/smbd/server.c
source3/smbd/sesssetup.c
source3/utils/net_serverid.c
source3/utils/net_status.c
source3/utils/status.c
source3/web/statuspage.c

index b8a2409ab5a9c362083fff5360b5ce6b371f77b3..b5a66b52b488400d25ee0ddc39ef468094c7990d 100644 (file)
@@ -87,25 +87,6 @@ size_t align_string(const void *base_ptr, const char *p, int flags);
 size_t dos_PutUniCode(char *dst,const char *src, size_t len, bool null_terminate);
 int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src);
 
-/* The following definitions come from lib/conn_tdb.c  */
-
-struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx,
-                                         connection_struct *conn,
-                                         const char *name);
-int connections_traverse(int (*fn)(struct db_record *rec,
-                                  void *private_data),
-                        void *private_data);
-int connections_forall(int (*fn)(struct db_record *rec,
-                                const struct connections_key *key,
-                                const struct connections_data *data,
-                                void *private_data),
-                      void *private_data);
-int connections_forall_read(int (*fn)(const struct connections_key *key,
-                                     const struct connections_data *data,
-                                     void *private_data),
-                           void *private_data);
-bool connections_init(bool rw);
-
 /* The following definitions come from lib/dmallocmsg.c  */
 
 void register_dmalloc_msgs(struct messaging_context *msg_ctx);
index 245ff7be1119c845669299bc512fe29ec924c407..9a63d8252f7c0e46566cc057944cd21d1c2faa5d 100644 (file)
@@ -564,31 +564,6 @@ Offset  Data                       length.
 #define NT_HASH_LEN 16
 #define LM_HASH_LEN 16
 
-/* key and data in the connections database - used in smbstatus and smbd */
-struct connections_key {
-       struct server_id pid;
-       int cnum;
-       fstring name;
-};
-
-struct connections_data {
-       int magic;
-       struct server_id pid;
-       int cnum;
-       uid_t uid;
-       gid_t gid;
-       char servicename[FSTRING_LEN];
-       char addr[24];
-       char machine[FSTRING_LEN];
-       time_t start;
-
-       /*
-        * This field used to hold the msg_flags. For compatibility reasons,
-        * keep the data structure in the tdb file the same.
-        */
-       uint32 unused_compatitibility_field;
-};
-
 /* offsets into message for common items */
 #define smb_com                (NBT_HDR_SIZE+HDR_COM)
 #define smb_rcls       (NBT_HDR_SIZE+HDR_RCLS)
index 9b0a07a56c0a453afc486084010862b4674a9fbb..776f53ca79e6ee77e312078eb252d8f5ebf35ba5 100644 (file)
@@ -23,6 +23,7 @@
 #include "dbwrap/dbwrap.h"
 #include "dbwrap/dbwrap_open.h"
 #include "messages.h"
+#include "lib/conn_tdb.h"
 
 static struct db_context *connections_db_ctx(bool rw)
 {
diff --git a/source3/lib/conn_tdb.h b/source3/lib/conn_tdb.h
new file mode 100644 (file)
index 0000000..ee4befe
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+   Unix SMB/CIFS implementation.
+   Low-level connections.tdb access functions
+   Copyright (C) Volker Lendecke 2007
+
+   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/>.
+*/
+
+/* key and data in the connections database - used in smbstatus and smbd */
+struct connections_key {
+       struct server_id pid;
+       int cnum;
+       fstring name;
+};
+
+struct connections_data {
+       int magic;
+       struct server_id pid;
+       int cnum;
+       uid_t uid;
+       gid_t gid;
+       char servicename[FSTRING_LEN];
+       char addr[24];
+       char machine[FSTRING_LEN];
+       time_t start;
+
+       /*
+        * This field used to hold the msg_flags. For compatibility reasons,
+        * keep the data structure in the tdb file the same.
+        */
+       uint32 unused_compatitibility_field;
+};
+
+/* The following definitions come from lib/conn_tdb.c  */
+
+struct db_record *connections_fetch_entry(TALLOC_CTX *mem_ctx,
+                                         connection_struct *conn,
+                                         const char *name);
+int connections_traverse(int (*fn)(struct db_record *rec,
+                                  void *private_data),
+                        void *private_data);
+int connections_forall(int (*fn)(struct db_record *rec,
+                                const struct connections_key *key,
+                                const struct connections_data *data,
+                                void *private_data),
+                      void *private_data);
+int connections_forall_read(int (*fn)(const struct connections_key *key,
+                                     const struct connections_data *data,
+                                     void *private_data),
+                           void *private_data);
+bool connections_init(bool rw);
index 38f272c55a4a434a91a351240b6bcaf79bb2d77d..d351468dce26dcb2d4b9b53e159e6b35f4d0e4e8 100644 (file)
@@ -37,6 +37,7 @@
 #include "smbd/globals.h"
 #include "auth.h"
 #include "messages.h"
+#include "lib/conn_tdb.h"
 
 extern const struct generic_mapping file_generic_mapping;
 
index 38615d5445ca9e6657ac80a76bf84e4cc8008e80..01eb9d79f7babd0f1ea1ce405d8b4af4b8cdf00e 100644 (file)
@@ -24,6 +24,7 @@
 #include "auth.h"
 #include "../lib/tsocket/tsocket.h"
 #include "messages.h"
+#include "lib/conn_tdb.h"
 
 /****************************************************************************
  Delete a connection record.
index f71235f19f4d08c72f1bf012eb7738275b06a00e..c1cc15e8c53ffd83906edb553159d6d5b5e63149 100644 (file)
@@ -42,6 +42,7 @@
 #include "lib/id_cache.h"
 #include "lib/param/param.h"
 #include "lib/background.h"
+#include "lib/conn_tdb.h"
 
 struct smbd_open_socket;
 struct smbd_child_pid;
index f9ba9769b59a3aa5968e4840ea3f9ba3857e8da8..c0d44500f33d3c026e0e93d93f7d24ca0ff285f2 100644 (file)
@@ -36,6 +36,7 @@
 #include "smbprofile.h"
 #include "../libcli/security/security.h"
 #include "auth/gensec/gensec.h"
+#include "lib/conn_tdb.h"
 
 /****************************************************************************
  Add the standard 'Samba' signature to the end of the session setup.
index 31322e27e745be479c6c4ff41a183e0788e1ee79..79be5477c5d6d9b53034da6c46de40dc6b6e660a 100644 (file)
@@ -22,6 +22,7 @@
 #include "dbwrap/dbwrap.h"
 #include "serverid.h"
 #include "session.h"
+#include "lib/conn_tdb.h"
 
 static int net_serverid_list_fn(const struct server_id *id,
                                uint32_t msg_flags, void *priv)
index d6027433a29c3708a4bc94ea5b64a525aa297f4d..2bb639138e9f46a75c5fe5fa5fc90b2336bd110c 100644 (file)
@@ -20,6 +20,7 @@
 #include "utils/net.h"
 #include "session.h"
 #include "messages.h"
+#include "lib/conn_tdb.h"
 
 int net_status_usage(struct net_context *c, int argc, const char **argv)
 {
index 95b279ea3b2595d0afcabf746ff99fd51863180d..66aec53f1791a8bddce29235ee32c2f84dc89ce5 100644 (file)
@@ -42,6 +42,7 @@
 #include "librpc/gen_ndr/open_files.h"
 #include "smbd/proto.h"
 #include "librpc/gen_ndr/notify.h"
+#include "lib/conn_tdb.h"
 
 #define SMB_MAXPIDS            2048
 static uid_t           Ucrit_uid = 0;               /* added by OH */
index 49fb32e4fd9ec02123205a9d204ec9494d13c9a9..4b3d3aea86726f0f66561c5c47849dedeff8e141 100644 (file)
@@ -22,6 +22,7 @@
 #include "libcli/security/security.h"
 #include "locking/proto.h"
 #include "librpc/gen_ndr/open_files.h"
+#include "lib/conn_tdb.h"
 
 #define _(x) lang_msg_rotate(talloc_tos(),x)