} smb;
#endif
+ uint16_t port;
};
/* Functions in libsmb_cache.c */
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
+#include <stdint.h>
#include <fcntl.h>
#include <utime.h>
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 *
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)
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 *)
smbc_setDebug(context, 0);
smbc_setTimeout(context, 20000);
+ smbc_setPort(context, 0);
smbc_setOptionFullTimeNames(context, False);
smbc_setOptionOpenShareMode(context, SMBC_SHAREMODE_DENY_NONE);
/* 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, "");
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)
public_headers='../include/libsmbclient.h',
abi_directory='ABI',
abi_match='smbc_*',
- vnum='0.2.0',
+ vnum='0.2.1',
pc_files='smbclient.pc')