Add smbc_getPort(), smbc_setPort(). Bump the .so minor number.
authorJeremy Allison <jra@samba.org>
Tue, 16 Apr 2013 21:53:09 +0000 (14:53 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 11 Jun 2013 17:50:41 +0000 (10:50 -0700)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
source3/include/libsmb_internal.h
source3/include/libsmbclient.h
source3/libsmb/ABI/smbclient-0.1.0.sigs
source3/libsmb/libsmb_context.c
source3/libsmb/libsmb_path.c
source3/libsmb/libsmb_setget.c
source3/libsmb/wscript

index bd06b53e6c0638aff88680072b00faae9b628e98..7ce37d264534a96d7e233f1c5934a71859e3ae54 100644 (file)
@@ -244,6 +244,7 @@ struct SMBC_internal_data {
         }               smb;
 
 #endif
+       uint16_t        port;
 };     
 
 /* Functions in libsmb_cache.c */
index 61ff6a3b3bdc627ba89cb546eb54fd93cceea39c..5846e9bf44f618dda1b541353d5a2187146bcc32 100644 (file)
@@ -76,6 +76,7 @@ extern "C" {
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/statvfs.h>
+#include <stdint.h>
 #include <fcntl.h>
 #include <utime.h>
 
@@ -507,6 +508,19 @@ void
 smbc_setTimeout(SMBCCTX *c, int timeout);
 
 
+/**
+ * Get the TCP port used to connect (0 means default).
+ */
+uint16_t
+smbc_getPort(SMBCCTX *c);
+
+/**
+ * Set the TCP port used to connect (0 means default).
+ */
+void
+smbc_setPort(SMBCCTX *c, uint16_t port);
+
+
 
 /***********************************
  * Getters and setters for OPTIONS *
index bbd7700aed7a6cb47bb489432554062f76dd0f48..3dea59c42f26e40cc3e3d3f495af6fd890ebfdde 100644 (file)
@@ -67,6 +67,7 @@ smbc_getOptionUseKerberos: smbc_bool (SMBCCTX *)
 smbc_getOptionUserData: void *(SMBCCTX *)
 smbc_getServerCacheData: struct smbc_server_cache *(SMBCCTX *)
 smbc_getTimeout: int (SMBCCTX *)
+smbc_getPort: uint16_t (SMBCCTX *)
 smbc_getUser: char *(SMBCCTX *)
 smbc_getWorkgroup: char *(SMBCCTX *)
 smbc_getdents: int (unsigned int, struct smbc_dirent *, int)
@@ -151,6 +152,7 @@ smbc_setOptionUseKerberos: void (SMBCCTX *, smbc_bool)
 smbc_setOptionUserData: void (SMBCCTX *, void *)
 smbc_setServerCacheData: void (SMBCCTX *, struct smbc_server_cache *)
 smbc_setTimeout: void (SMBCCTX *, int)
+smbc_setPort: void (SMBCCTX *, uint16_t)
 smbc_setUser: void (SMBCCTX *, char *)
 smbc_setWorkgroup: void (SMBCCTX *, char *)
 smbc_set_context: SMBCCTX *(SMBCCTX *)
index b529cbe7e3b852436a98a3879c21e5f2e9ab7b24..6eb2996287d00433a66259a0d5dc44a7f2059e61 100644 (file)
@@ -169,6 +169,7 @@ smbc_new_context(void)
 
         smbc_setDebug(context, 0);
         smbc_setTimeout(context, 20000);
+        smbc_setPort(context, 0);
 
         smbc_setOptionFullTimeNames(context, False);
         smbc_setOptionOpenShareMode(context, SMBC_SHAREMODE_DENY_NONE);
index b286691a21a0f3f7a0450c81f622000ffe877440..6208f029510f05f4168d169ebbc2f1cb7df877c3 100644 (file)
@@ -239,7 +239,7 @@ SMBC_parse_path(TALLOC_CTX *ctx,
 
        /* Ensure these returns are at least valid pointers. */
        *pp_server = talloc_strdup(ctx, "");
-       *p_port = 0;
+       *p_port = smbc_getPort(context);
        *pp_share = talloc_strdup(ctx, "");
        *pp_path = talloc_strdup(ctx, "");
        *pp_user = talloc_strdup(ctx, "");
index 60bbc8bc5efdb36888be3cae595f1a73935cc636..0bd5290f4b5d039c40bf7b596ff56f1079ee4bc9 100644 (file)
@@ -116,6 +116,25 @@ smbc_setTimeout(SMBCCTX *c, int timeout)
         c->timeout = timeout;
 }
 
+/**
+ * Get the TCP port used to connect.
+ */
+uint16_t
+smbc_getPort(SMBCCTX *c)
+{
+        return c->internal->port;
+}
+
+/**
+ * Set the TCP port used to connect.
+ */
+void
+smbc_setPort(SMBCCTX *c, uint16_t port)
+{
+        c->internal->port = port;
+}
+
+
 /** Get whether to log to standard error instead of standard output */
 smbc_bool
 smbc_getOptionDebugToStderr(SMBCCTX *c)
index c5444b09bb4da048b508ded4356d2d4a7a295b04..9750ed3a2059c2f23aeed34da7af12b86d391c42 100644 (file)
@@ -27,5 +27,5 @@ def build(bld):
                        public_headers='../include/libsmbclient.h',
                        abi_directory='ABI',
                        abi_match='smbc_*',
-                       vnum='0.2.0',
+                       vnum='0.2.1',
                        pc_files='smbclient.pc')