s3-libsmb: put namequery headers to nmblib.h
authorGünther Deschner <gd@samba.org>
Wed, 23 Mar 2011 13:18:59 +0000 (14:18 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 29 Mar 2011 23:13:09 +0000 (01:13 +0200)
We might find a better name for it and merge other namequery related things as
well here...

Guenther

26 files changed:
source3/client/client.c
source3/include/includes.h
source3/include/proto.h
source3/libsmb/async_smb.c
source3/libsmb/cliconnect.c
source3/libsmb/clidfs.c
source3/libsmb/clidgram.c
source3/libsmb/clikrb5.c
source3/libsmb/libsmb_dir.c
source3/libsmb/libsmb_server.c
source3/libsmb/namequery.c
source3/libsmb/nmblib.c
source3/libsmb/nmblib.h [new file with mode: 0644]
source3/libsmb/passchange.c
source3/libsmb/smbsock_connect.c
source3/libsmb/unexpected.c
source3/nmbd/nmbd.h
source3/smbd/reply.c
source3/torture/locktest.c
source3/torture/masktest.c
source3/torture/torture.c
source3/utils/net_time.c
source3/utils/nmblookup.c
source3/utils/smbcontrol.c
source3/utils/smbfilter.c
source3/winbindd/winbindd_wins.c

index 29ef0e6679346b442876b7d3954bbc5f7068a8fe..1ad20da07aedda854de96098ffd9545cd1887c10 100644 (file)
@@ -34,6 +34,7 @@
 #include "system/select.h"
 #include "libsmb/clirap.h"
 #include "trans2.h"
+#include "libsmb/nmblib.h"
 
 #ifndef REGISTER
 #define REGISTER 0
index 1d3e02f813e9d11123c2640f8571fca4ee4f1370..8180cadbfcc944236ce14d8b8ccbc901a75fa121 100644 (file)
@@ -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"
index 0473ddf54efbb9520b69002d1b9a03945bbc969f..12d5a93920f47a459149c36c1f018dd8488c6b08 100644 (file)
@@ -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);
index 9708e3ccd3061defae3120ed3cbae4a6457b130d..8af5aa10461cbf05d3979da5082d52c79f53f6d6 100644 (file)
@@ -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
index 2fa9e8a2c5018ff192d00105d5af699c2d832bfd..b08d47df8d7b9e8ff19449207e97549e52e9b760 100644 (file)
@@ -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;
index c252b85f8e0efc29c6a409b7f3cd71b79f005354..810943eedc8f71c63ef4af10712445c9842e62b0 100644 (file)
@@ -23,6 +23,7 @@
 #include "libsmb/clirap.h"
 #include "msdfs.h"
 #include "trans2.h"
+#include "libsmb/nmblib.h"
 
 /********************************************************************
  Important point.
index d46aadc8029dccf88760f6f84384d9c4c5eba362..78f9ea0692cd543035c0a018416256e0b358cfa4 100644 (file)
@@ -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 ...
index 016500418ed7a13350f55bcd4c47ea7d08466b6e..5e1f70492112e872534036bc72457befb368b164 100644 (file)
@@ -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
index d46f72a763e44eafd82a085af426f37d9b6737fc..9939e25fb54447f14f4209b1daf9d790bceb82d7 100644 (file)
@@ -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
index c6b5dcbce527aec3f521e1310df6a5bb39a1e929..961c9cde83e06ad70de026aac767f158f4cde59c 100644 (file)
@@ -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.
index 9bc691194239cc6d956beb76eef952af254caea3..3f14b1492338c4b5fa7770fd675191a280e6ed9e 100644 (file)
@@ -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;
index 778b9c0b953b9bfc0d0eabd3d6e8bfaa73c7ca85..dbf996ee5e731977dc17d8ad6d8438f3b306e93e 100644 (file)
@@ -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 (file)
index 0000000..a6666a8
--- /dev/null
@@ -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);
index 289bf4bd8e3f161e54dd9972efe404cd87ccb2e5..d37389a4858b4a6efa3e1ae645bffeff611f77b4 100644 (file)
@@ -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.
index 352de85fd2c417496f075b3d7b32cc04a7711075..fd8626f5ad283e638c977cc3cf03136b77ce6dc5 100644 (file)
@@ -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;
index faee5598e32c01d2516628de8ae15b7abb5b0e0c..c5ad9ecb595282841e32f5291897b4c12b1504be 100644 (file)
@@ -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)
 {
index 6ccbd930fbda94d781e8bbb4f6f85df352279722..e100e7d693244904ccd6e7ed1ea52c3b882272c2 100644 (file)
@@ -2,4 +2,5 @@
 #define SYNC_DNS 1
 #endif
 
+#include "libsmb/nmblib.h"
 #include "nmbd/nmbd_proto.h"
index 977b65675db69f6855c069e307d969ad966430bb..8a0f77989a1939fc0e43f975ce46087a1fb6b958 100644 (file)
@@ -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
index c415f4c5d8564fa79e7552b9abfeabedecd233aa..d52a8de4605351a3ca29d97caee6e408c223b8f1 100644 (file)
@@ -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];
index bf7e6fbb3c105ca9cdc4903191bf1d2ea149b23d..c8f346435af8312c9f44d9b0660178567b1a2ebb 100644 (file)
@@ -20,6 +20,7 @@
 #include "includes.h"
 #include "system/filesys.h"
 #include "trans2.h"
+#include "libsmb/nmblib.h"
 
 static fstring password;
 static fstring username;
index bff57614fbd244dbf75e4d9b1e4862a878c2507a..175c2179444f5a299fcda3638c25b502d00e004e 100644 (file)
@@ -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;
index fe9f99965622860f2109e1d5f5d25ccaa90bcef6..fdb46dbba50175de3d2874934bf98417ca707685 100644 (file)
@@ -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
index bd150df74131c82ef1417316b279e030e9323d20..f8545401e6a468a335526912cf00e940b6da1b61 100644 (file)
@@ -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;
index 3ecd2d4531b569022026e30090a59721cd1675b5..4555954fd5d5673ed8e4287d9cfe2d37e22333b6 100644 (file)
@@ -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>
index 9cdbb690c84c2e1fac6ae1dfe3650b1cf179ce72..2982f6a6c37fe39a4321426148b7e59abebd6aeb 100644 (file)
@@ -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
index adfe55247c7d740379500acc65c9179e20b73eca..e1beb1d80bf6fa89f89e8cfbc81b247f9700358f 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "includes.h"
 #include "winbindd.h"
+#include "libsmb/nmblib.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND