summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-06-04 15:32:28 +0200
committerStefan Metzmacher <metze@samba.org>2012-06-05 19:28:35 +0200
commit8693a4fff95f2fa1f9c3b93429101c3b3d22218f (patch)
tree79558b09e4d1a3cd3d11164ed3e5729ed5436674 /source3
parent5a122931ede833484d9c47d7a9b5434e85b5c8d7 (diff)
downloadsamba-8693a4fff95f2fa1f9c3b93429101c3b3d22218f.tar.gz
samba-8693a4fff95f2fa1f9c3b93429101c3b3d22218f.tar.xz
samba-8693a4fff95f2fa1f9c3b93429101c3b3d22218f.zip
s3:lib: split things into a conn_tdb.h
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Jun 5 19:28:35 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h19
-rw-r--r--source3/include/smb.h25
-rw-r--r--source3/lib/conn_tdb.c1
-rw-r--r--source3/lib/conn_tdb.h62
-rw-r--r--source3/rpc_server/srvsvc/srv_srvsvc_nt.c1
-rw-r--r--source3/smbd/connection.c1
-rw-r--r--source3/smbd/server.c1
-rw-r--r--source3/smbd/sesssetup.c1
-rw-r--r--source3/utils/net_serverid.c1
-rw-r--r--source3/utils/net_status.c1
-rw-r--r--source3/utils/status.c1
-rw-r--r--source3/web/statuspage.c1
12 files changed, 71 insertions, 44 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index b8a2409ab5a..b5a66b52b48 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -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);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 245ff7be111..9a63d8252f7 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -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)
diff --git a/source3/lib/conn_tdb.c b/source3/lib/conn_tdb.c
index 9b0a07a56c0..776f53ca79e 100644
--- a/source3/lib/conn_tdb.c
+++ b/source3/lib/conn_tdb.c
@@ -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
index 00000000000..ee4befed168
--- /dev/null
+++ b/source3/lib/conn_tdb.h
@@ -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);
diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
index 38f272c55a4..d351468dce2 100644
--- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
@@ -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;
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index 38615d5445c..01eb9d79f7b 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -24,6 +24,7 @@
#include "auth.h"
#include "../lib/tsocket/tsocket.h"
#include "messages.h"
+#include "lib/conn_tdb.h"
/****************************************************************************
Delete a connection record.
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index f71235f19f4..c1cc15e8c53 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -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;
diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c
index f9ba9769b59..c0d44500f33 100644
--- a/source3/smbd/sesssetup.c
+++ b/source3/smbd/sesssetup.c
@@ -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.
diff --git a/source3/utils/net_serverid.c b/source3/utils/net_serverid.c
index 31322e27e74..79be5477c5d 100644
--- a/source3/utils/net_serverid.c
+++ b/source3/utils/net_serverid.c
@@ -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)
diff --git a/source3/utils/net_status.c b/source3/utils/net_status.c
index d6027433a29..2bb639138e9 100644
--- a/source3/utils/net_status.c
+++ b/source3/utils/net_status.c
@@ -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)
{
diff --git a/source3/utils/status.c b/source3/utils/status.c
index 95b279ea3b2..66aec53f179 100644
--- a/source3/utils/status.c
+++ b/source3/utils/status.c
@@ -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 */
diff --git a/source3/web/statuspage.c b/source3/web/statuspage.c
index 49fb32e4fd9..4b3d3aea867 100644
--- a/source3/web/statuspage.c
+++ b/source3/web/statuspage.c
@@ -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)