summaryrefslogtreecommitdiff
path: root/source3/libsmb
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/libsmb
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/libsmb')
-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
13 files changed, 61 insertions, 0 deletions
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)
{