summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-03-23 14:18:59 +0100
committerGünther Deschner <gd@samba.org>2011-03-30 01:13:09 +0200
commit2473c2fb1b9246e284b96cdf117bbb592a7c5309 (patch)
tree40bc0d34c2988f58880b85475acf96dd3e53d6ba /source3
parent2377039738ea6676b71d58db770ffcd594ca08b7 (diff)
downloadsamba-2473c2fb1b9246e284b96cdf117bbb592a7c5309.tar.gz
samba-2473c2fb1b9246e284b96cdf117bbb592a7c5309.tar.bz2
samba-2473c2fb1b9246e284b96cdf117bbb592a7c5309.zip
s3-libsmb: put namequery headers to nmblib.h
We might find a better name for it and merge other namequery related things as well here... Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c1
-rw-r--r--source3/include/includes.h1
-rw-r--r--source3/include/proto.h48
-rw-r--r--source3/libsmb/async_smb.c1
-rw-r--r--source3/libsmb/cliconnect.c1
-rw-r--r--source3/libsmb/clidfs.c1
-rw-r--r--source3/libsmb/clidgram.c1
-rw-r--r--source3/libsmb/clikrb5.c1
-rw-r--r--source3/libsmb/libsmb_dir.c1
-rw-r--r--source3/libsmb/libsmb_server.c1
-rw-r--r--source3/libsmb/namequery.c1
-rw-r--r--source3/libsmb/nmblib.c1
-rw-r--r--source3/libsmb/nmblib.h49
-rw-r--r--source3/libsmb/passchange.c1
-rw-r--r--source3/libsmb/smbsock_connect.c1
-rw-r--r--source3/libsmb/unexpected.c1
-rw-r--r--source3/nmbd/nmbd.h1
-rw-r--r--source3/smbd/reply.c1
-rw-r--r--source3/torture/locktest.c1
-rw-r--r--source3/torture/masktest.c1
-rw-r--r--source3/torture/torture.c1
-rw-r--r--source3/utils/net_time.c1
-rw-r--r--source3/utils/nmblookup.c1
-rw-r--r--source3/utils/smbcontrol.c1
-rw-r--r--source3/utils/smbfilter.c1
-rw-r--r--source3/winbindd/winbindd_wins.c1
26 files changed, 72 insertions, 49 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 29ef0e6679..1ad20da07a 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -34,6 +34,7 @@
#include "system/select.h"
#include "libsmb/clirap.h"
#include "trans2.h"
+#include "libsmb/nmblib.h"
#ifndef REGISTER
#define REGISTER 0
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 1d3e02f813..8180cadbfc 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -539,7 +539,6 @@ typedef char fstring[FSTRING_LEN];
#include "locking.h"
#include "smb_perfcount.h"
#include "smb.h"
-#include "nameserv.h"
#include "../lib/util/byteorder.h"
#include "auth.h"
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 0473ddf54e..12d5a93920 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -2325,30 +2325,6 @@ bool get_dc_name(const char *domain,
fstring srv_name,
struct sockaddr_storage *ss_out);
-/* The following definitions come from libsmb/nmblib.c */
-
-void debug_nmb_packet(struct packet_struct *p);
-void put_name(char *dest, const char *name, int pad, unsigned int name_type);
-char *nmb_namestr(const struct nmb_name *n);
-struct packet_struct *copy_packet(struct packet_struct *packet);
-void free_packet(struct packet_struct *packet);
-int packet_trn_id(struct packet_struct *p);
-struct packet_struct *parse_packet(char *buf,int length,
- enum packet_type packet_type,
- struct in_addr ip,
- int port);
-struct packet_struct *read_packet(int fd,enum packet_type packet_type);
-void make_nmb_name( struct nmb_name *n, const char *name, int type);
-bool nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
-int build_packet(char *buf, size_t buflen, struct packet_struct *p);
-bool send_packet(struct packet_struct *p);
-bool match_mailslot_name(struct packet_struct *p, const char *mailslot_name);
-int matching_len_bits(unsigned char *p1, unsigned char *p2, size_t len);
-void sort_query_replies(char *data, int n, struct in_addr ip);
-char *name_mangle(TALLOC_CTX *mem_ctx, const char *In, char name_type);
-int name_extract(unsigned char *buf,size_t buf_len, unsigned int ofs, fstring name);
-int name_len(unsigned char *s1, size_t buf_len);
-
/* The following definitions come from libsmb/nterr.c */
const char *nt_errstr(NTSTATUS nt_code);
@@ -2464,30 +2440,6 @@ bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain,
struct dom_sid **sids );
NTSTATUS change_trust_account_password( const char *domain, const char *remote_machine);
-/* The following definitions come from libsmb/unexpected.c */
-
-struct nb_packet_server;
-struct nb_packet_reader;
-
-NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- int max_clients,
- struct nb_packet_server **presult);
-void nb_packet_dispatch(struct nb_packet_server *server,
- struct packet_struct *p);
-struct tevent_req *nb_packet_reader_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- enum packet_type type,
- int trn_id,
- const char *mailslot_name);
-NTSTATUS nb_packet_reader_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
- struct nb_packet_reader **preader);
-struct tevent_req *nb_packet_read_send(TALLOC_CTX *mem_ctx,
- struct tevent_context *ev,
- struct nb_packet_reader *reader);
-NTSTATUS nb_packet_read_recv(struct tevent_req *req,
- struct packet_struct **ppacket);
-
/* The following definitions come from modules/vfs_default.c */
ssize_t vfswrap_llistxattr(struct vfs_handle_struct *handle, const char *path, char *list, size_t size);
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 9708e3ccd3..8af5aa1046 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -21,6 +21,7 @@
#include "../lib/async_req/async_sock.h"
#include "async_smb.h"
#include "smb_crypt.h"
+#include "libsmb/nmblib.h"
/*
* Read an smb packet asynchronously, discard keepalives
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 2fa9e8a2c5..b08d47df8d 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -27,6 +27,7 @@
#include "libads/kerberos_proto.h"
#include "krb5_env.h"
#include "async_smb.h"
+#include "libsmb/nmblib.h"
static const struct {
int prot;
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index c252b85f8e..810943eedc 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -23,6 +23,7 @@
#include "libsmb/clirap.h"
#include "msdfs.h"
#include "trans2.h"
+#include "libsmb/nmblib.h"
/********************************************************************
Important point.
diff --git a/source3/libsmb/clidgram.c b/source3/libsmb/clidgram.c
index d46aadc802..78f9ea0692 100644
--- a/source3/libsmb/clidgram.c
+++ b/source3/libsmb/clidgram.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "librpc/gen_ndr/messaging.h"
#include "libsmb/clidgram.h"
+#include "libsmb/nmblib.h"
/*
* cli_send_mailslot, send a mailslot for client code ...
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index 016500418e..5e1f704921 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -24,6 +24,7 @@
#include "smb_krb5.h"
#include "../librpc/gen_ndr/krb5pac.h"
#include "../lib/util/asn1.h"
+#include "libsmb/nmblib.h"
#ifndef KRB5_AUTHDATA_WIN2K_PAC
#define KRB5_AUTHDATA_WIN2K_PAC 128
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index d46f72a763..9939e25fb5 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -28,6 +28,7 @@
#include "libsmb_internal.h"
#include "rpc_client/cli_pipe.h"
#include "../librpc/gen_ndr/ndr_srvsvc_c.h"
+#include "libsmb/nmblib.h"
/*
* Routine to open a directory
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c
index c6b5dcbce5..961c9cde83 100644
--- a/source3/libsmb/libsmb_server.c
+++ b/source3/libsmb/libsmb_server.c
@@ -30,6 +30,7 @@
#include "rpc_client/cli_pipe.h"
#include "rpc_client/cli_lsarpc.h"
#include "libcli/security/security.h"
+#include "libsmb/nmblib.h"
/*
* Check a server for being alive and well.
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index 9bc6911942..3f14b14923 100644
--- a/source3/libsmb/namequery.c
+++ b/source3/libsmb/namequery.c
@@ -24,6 +24,7 @@
#include "../libcli/netlogon/netlogon.h"
#include "librpc/gen_ndr/messaging.h"
#include "lib/async_req/async_sock.h"
+#include "libsmb/nmblib.h"
/* nmbd.c sets this to True. */
bool global_in_nmbd = False;
diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index 778b9c0b95..dbf996ee5e 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "libsmb/nmblib.h"
static const struct opcode_names {
const char *nmb_opcode_name;
diff --git a/source3/libsmb/nmblib.h b/source3/libsmb/nmblib.h
new file mode 100644
index 0000000000..a6666a84c6
--- /dev/null
+++ b/source3/libsmb/nmblib.h
@@ -0,0 +1,49 @@
+/* The following definitions come from libsmb/unexpected.c */
+
+#include "nameserv.h"
+
+struct nb_packet_server;
+struct nb_packet_reader;
+
+NTSTATUS nb_packet_server_create(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ int max_clients,
+ struct nb_packet_server **presult);
+void nb_packet_dispatch(struct nb_packet_server *server,
+ struct packet_struct *p);
+struct tevent_req *nb_packet_reader_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ enum packet_type type,
+ int trn_id,
+ const char *mailslot_name);
+NTSTATUS nb_packet_reader_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+ struct nb_packet_reader **preader);
+struct tevent_req *nb_packet_read_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct nb_packet_reader *reader);
+NTSTATUS nb_packet_read_recv(struct tevent_req *req,
+ struct packet_struct **ppacket);
+
+/* The following definitions come from libsmb/nmblib.c */
+
+void debug_nmb_packet(struct packet_struct *p);
+void put_name(char *dest, const char *name, int pad, unsigned int name_type);
+char *nmb_namestr(const struct nmb_name *n);
+struct packet_struct *copy_packet(struct packet_struct *packet);
+void free_packet(struct packet_struct *packet);
+int packet_trn_id(struct packet_struct *p);
+struct packet_struct *parse_packet(char *buf,int length,
+ enum packet_type packet_type,
+ struct in_addr ip,
+ int port);
+struct packet_struct *read_packet(int fd,enum packet_type packet_type);
+void make_nmb_name( struct nmb_name *n, const char *name, int type);
+bool nmb_name_equal(struct nmb_name *n1, struct nmb_name *n2);
+int build_packet(char *buf, size_t buflen, struct packet_struct *p);
+bool send_packet(struct packet_struct *p);
+bool match_mailslot_name(struct packet_struct *p, const char *mailslot_name);
+int matching_len_bits(unsigned char *p1, unsigned char *p2, size_t len);
+void sort_query_replies(char *data, int n, struct in_addr ip);
+char *name_mangle(TALLOC_CTX *mem_ctx, const char *In, char name_type);
+int name_extract(unsigned char *buf,size_t buf_len, unsigned int ofs, fstring name);
+int name_len(unsigned char *s1, size_t buf_len);
diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c
index 289bf4bd8e..d37389a485 100644
--- a/source3/libsmb/passchange.c
+++ b/source3/libsmb/passchange.c
@@ -22,6 +22,7 @@
#include "rpc_client/cli_pipe.h"
#include "rpc_client/cli_samr.h"
#include "libsmb/clirap.h"
+#include "libsmb/nmblib.h"
/*************************************************************
Change a password on a remote machine using IPC calls.
diff --git a/source3/libsmb/smbsock_connect.c b/source3/libsmb/smbsock_connect.c
index 352de85fd2..fd8626f5ad 100644
--- a/source3/libsmb/smbsock_connect.c
+++ b/source3/libsmb/smbsock_connect.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "../lib/async_req/async_sock.h"
#include "async_smb.h"
+#include "libsmb/nmblib.h"
struct nb_connect_state {
struct tevent_context *ev;
diff --git a/source3/libsmb/unexpected.c b/source3/libsmb/unexpected.c
index faee5598e3..c5ad9ecb59 100644
--- a/source3/libsmb/unexpected.c
+++ b/source3/libsmb/unexpected.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "lib/async_req/async_sock.h"
+#include "libsmb/nmblib.h"
static const char *nmbd_socket_dir(void)
{
diff --git a/source3/nmbd/nmbd.h b/source3/nmbd/nmbd.h
index 6ccbd930fb..e100e7d693 100644
--- a/source3/nmbd/nmbd.h
+++ b/source3/nmbd/nmbd.h
@@ -2,4 +2,5 @@
#define SYNC_DNS 1
#endif
+#include "libsmb/nmblib.h"
#include "nmbd/nmbd_proto.h"
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 977b65675d..8a0f77989a 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -35,6 +35,7 @@
#include "rpc_client/init_spoolss.h"
#include "rpc_server/rpc_ncacn_np.h"
#include "libcli/security/security.h"
+#include "libsmb/nmblib.h"
/****************************************************************************
Ensure we check the path in *exactly* the same way as W2K for a findfirst/findnext
diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c
index c415f4c5d8..d52a8de460 100644
--- a/source3/torture/locktest.c
+++ b/source3/torture/locktest.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "locking/proto.h"
+#include "libsmb/nmblib.h"
static fstring password[2];
static fstring username[2];
diff --git a/source3/torture/masktest.c b/source3/torture/masktest.c
index bf7e6fbb3c..c8f346435a 100644
--- a/source3/torture/masktest.c
+++ b/source3/torture/masktest.c
@@ -20,6 +20,7 @@
#include "includes.h"
#include "system/filesys.h"
#include "trans2.h"
+#include "libsmb/nmblib.h"
static fstring password;
static fstring username;
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index bff57614fb..175c217944 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -33,6 +33,7 @@
#include "async_smb.h"
#include "libsmb/clirap.h"
#include "trans2.h"
+#include "libsmb/nmblib.h"
extern char *optarg;
extern int optind;
diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c
index fe9f999656..fdb46dbba5 100644
--- a/source3/utils/net_time.c
+++ b/source3/utils/net_time.c
@@ -18,6 +18,7 @@
*/
#include "includes.h"
#include "utils/net.h"
+#include "libsmb/nmblib.h"
/*
return the time on a server. This does not require any authentication
diff --git a/source3/utils/nmblookup.c b/source3/utils/nmblookup.c
index bd150df741..f8545401e6 100644
--- a/source3/utils/nmblookup.c
+++ b/source3/utils/nmblookup.c
@@ -21,6 +21,7 @@
#include "includes.h"
#include "popt_common.h"
+#include "libsmb/nmblib.h"
static bool give_flags = false;
static bool use_bcast = true;
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index 3ecd2d4531..4555954fd5 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -30,6 +30,7 @@
#include "librpc/gen_ndr/spoolss.h"
#include "nt_printing.h"
#include "printing/notify.h"
+#include "libsmb/nmblib.h"
#if HAVE_LIBUNWIND_H
#include <libunwind.h>
diff --git a/source3/utils/smbfilter.c b/source3/utils/smbfilter.c
index 9cdbb690c8..2982f6a6c3 100644
--- a/source3/utils/smbfilter.c
+++ b/source3/utils/smbfilter.c
@@ -21,6 +21,7 @@
#include "system/filesys.h"
#include "system/select.h"
#include "../lib/util/select.h"
+#include "libsmb/nmblib.h"
#define SECURITY_MASK 0
#define SECURITY_SET 0
diff --git a/source3/winbindd/winbindd_wins.c b/source3/winbindd/winbindd_wins.c
index adfe55247c..e1beb1d80b 100644
--- a/source3/winbindd/winbindd_wins.c
+++ b/source3/winbindd/winbindd_wins.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "winbindd.h"
+#include "libsmb/nmblib.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_WINBIND