2 Unix SMB/Netbios implementation.
3 SMB client library implementation
4 Copyright (C) Andrew Tridgell 1998
5 Copyright (C) Richard Sharpe 2000, 2002
6 Copyright (C) John Terpstra 2000
7 Copyright (C) Tom Jansen (Ninja ISD) 2002
8 Copyright (C) Derrell Lipman 2003-2008
9 Copyright (C) Jeremy Allison 2007, 2008
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 3 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #define __LIBSMBCLIENT_INTERNAL__
27 #include "libsmbclient.h"
28 #include "libsmb_internal.h"
29 #include "lib/param/param.h"
32 /** Get the netbios name used for making connections */
34 smbc_getNetbiosName(SMBCCTX
*c
)
36 return c
->netbios_name
;
39 /** Set the netbios name used for making connections */
41 smbc_setNetbiosName(SMBCCTX
*c
, const char *netbios_name
)
43 SAFE_FREE(c
->netbios_name
);
45 c
->netbios_name
= SMB_STRDUP(netbios_name
);
49 /** Get the workgroup used for making connections */
51 smbc_getWorkgroup(SMBCCTX
*c
)
56 /** Set the workgroup used for making connections */
58 smbc_setWorkgroup(SMBCCTX
*c
, const char *workgroup
)
60 SAFE_FREE(c
->workgroup
);
62 c
->workgroup
= SMB_STRDUP(workgroup
);
66 /** Get the username used for making connections */
68 smbc_getUser(SMBCCTX
*c
)
73 /** Set the username used for making connections */
75 smbc_setUser(SMBCCTX
*c
, const char *user
)
79 c
->user
= SMB_STRDUP(user
);
83 /** Get the debug level */
85 smbc_getDebug(SMBCCTX
*c
)
90 /** Set the debug level */
92 smbc_setDebug(SMBCCTX
*c
, int debug
)
95 TALLOC_CTX
*frame
= talloc_stackframe();
96 snprintf(buf
, sizeof(buf
), "%d", debug
);
98 lpcfg_set_cmdline(c
->internal
->lp_ctx
, "log level", buf
);
102 /** set callback function which will be called for logging */
104 smbc_setLogCallback(SMBCCTX
*c
, void *private_ptr
,
105 smbc_debug_callback_fn fn
)
107 debug_set_callback(private_ptr
, fn
);
110 /** set configuration file */
111 int smbc_setConfiguration(SMBCCTX
*c
, const char *file
)
115 ok
= lp_load_client_no_reinit(file
);
117 DBG_WARNING("Could not load config file: %s\n", file
);
122 DBG_NOTICE("Configuration loaded successfully: %s\n", file
);
126 * Get the timeout used for waiting on connections and response data
130 smbc_getTimeout(SMBCCTX
*c
)
136 * Set the timeout used for waiting on connections and response data
140 smbc_setTimeout(SMBCCTX
*c
, int timeout
)
142 c
->timeout
= timeout
;
146 * Get the TCP port used to connect.
149 smbc_getPort(SMBCCTX
*c
)
151 return c
->internal
->port
;
155 * Set the TCP port used to connect.
158 smbc_setPort(SMBCCTX
*c
, uint16_t port
)
160 c
->internal
->port
= port
;
164 /** Get whether to log to standard error instead of standard output */
166 smbc_getOptionDebugToStderr(SMBCCTX
*c
)
169 TALLOC_CTX
*frame
= talloc_stackframe();
171 /* Because this is a global concept, it is better to check
172 * what is really set, rather than what we wanted set
173 * (particularly as you cannot go back to stdout). */
174 ret
= debug_get_output_is_stderr();
179 /** Set whether to log to standard error instead of standard output.
180 * This option is 'sticky' - once set to true, it cannot be set to
181 * false again, as it is global to the process, as once we have been
182 * told that it is not safe to safe to write to stdout, we shouldn't
183 * go back as we don't know it was this context that set it that way.
186 smbc_setOptionDebugToStderr(SMBCCTX
*c
, smbc_bool b
)
188 TALLOC_CTX
*frame
= talloc_stackframe();
191 * We do not have a unique per-thread debug state? For
192 * now, we'll just leave it up to the user. If any one
193 * context specifies debug to stderr then all will be (and
194 * will stay that way, as it is unsafe to flip back if
195 * stdout is in use for other things)
197 setup_logging("libsmbclient", DEBUG_STDERR
);
203 * Get whether to use new-style time attribute names, e.g. WRITE_TIME rather
204 * than the old-style names such as M_TIME. This allows also setting/getting
205 * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME
206 * was supposed to be CHANGE_TIME but was confused and sometimes referred to
210 smbc_getOptionFullTimeNames(SMBCCTX
*c
)
212 return c
->internal
->full_time_names
;
216 * Set whether to use new-style time attribute names, e.g. WRITE_TIME rather
217 * than the old-style names such as M_TIME. This allows also setting/getting
218 * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME
219 * was supposed to be CHANGE_TIME but was confused and sometimes referred to
223 smbc_setOptionFullTimeNames(SMBCCTX
*c
, smbc_bool b
)
225 c
->internal
->full_time_names
= b
;
229 * Get the share mode to use for files opened with SMBC_open_ctx(). The
230 * default is SMBC_SHAREMODE_DENY_NONE.
233 smbc_getOptionOpenShareMode(SMBCCTX
*c
)
235 return c
->internal
->share_mode
;
239 * Set the share mode to use for files opened with SMBC_open_ctx(). The
240 * default is SMBC_SHAREMODE_DENY_NONE.
243 smbc_setOptionOpenShareMode(SMBCCTX
*c
, smbc_share_mode share_mode
)
245 c
->internal
->share_mode
= share_mode
;
248 /** Retrieve a previously set user data handle */
250 smbc_getOptionUserData(SMBCCTX
*c
)
252 return c
->internal
->user_data
;
255 /** Save a user data handle */
257 smbc_setOptionUserData(SMBCCTX
*c
, void *user_data
)
259 c
->internal
->user_data
= user_data
;
262 /** Get the encoded value for encryption level. */
263 smbc_smb_encrypt_level
264 smbc_getOptionSmbEncryptionLevel(SMBCCTX
*c
)
266 return c
->internal
->smb_encryption_level
;
269 /** Set the encoded value for encryption level. */
271 smbc_setOptionSmbEncryptionLevel(SMBCCTX
*c
, smbc_smb_encrypt_level level
)
273 c
->internal
->smb_encryption_level
= level
;
277 * Get whether to treat file names as case-sensitive if we can't determine
278 * when connecting to the remote share whether the file system is case
279 * sensitive. This defaults to FALSE since it's most likely that if we can't
280 * retrieve the file system attributes, it's a very old file system that does
281 * not support case sensitivity.
284 smbc_getOptionCaseSensitive(SMBCCTX
*c
)
286 return c
->internal
->case_sensitive
;
290 * Set whether to treat file names as case-sensitive if we can't determine
291 * when connecting to the remote share whether the file system is case
292 * sensitive. This defaults to FALSE since it's most likely that if we can't
293 * retrieve the file system attributes, it's a very old file system that does
294 * not support case sensitivity.
297 smbc_setOptionCaseSensitive(SMBCCTX
*c
, smbc_bool b
)
299 c
->internal
->case_sensitive
= b
;
303 * Get from how many local master browsers should the list of workgroups be
304 * retrieved. It can take up to 12 minutes or longer after a server becomes a
305 * local master browser, for it to have the entire browse list (the list of
306 * workgroups/domains) from an entire network. Since a client never knows
307 * which local master browser will be found first, the one which is found
308 * first and used to retrieve a browse list may have an incomplete or empty
309 * browse list. By requesting the browse list from multiple local master
310 * browsers, a more complete list can be generated. For small networks (few
311 * workgroups), it is recommended that this value be set to 0, causing the
312 * browse lists from all found local master browsers to be retrieved and
313 * merged. For networks with many workgroups, a suitable value for this
314 * variable is probably somewhere around 3. (Default: 3).
317 smbc_getOptionBrowseMaxLmbCount(SMBCCTX
*c
)
319 return c
->options
.browse_max_lmb_count
;
323 * Set from how many local master browsers should the list of workgroups be
324 * retrieved. It can take up to 12 minutes or longer after a server becomes a
325 * local master browser, for it to have the entire browse list (the list of
326 * workgroups/domains) from an entire network. Since a client never knows
327 * which local master browser will be found first, the one which is found
328 * first and used to retrieve a browse list may have an incomplete or empty
329 * browse list. By requesting the browse list from multiple local master
330 * browsers, a more complete list can be generated. For small networks (few
331 * workgroups), it is recommended that this value be set to 0, causing the
332 * browse lists from all found local master browsers to be retrieved and
333 * merged. For networks with many workgroups, a suitable value for this
334 * variable is probably somewhere around 3. (Default: 3).
337 smbc_setOptionBrowseMaxLmbCount(SMBCCTX
*c
, int count
)
339 c
->options
.browse_max_lmb_count
= count
;
343 * Get whether to url-encode readdir entries.
345 * There is a difference in the desired return strings from
346 * smbc_readdir() depending upon whether the filenames are to
347 * be displayed to the user, or whether they are to be
348 * appended to the path name passed to smbc_opendir() to call
349 * a further smbc_ function (e.g. open the file with
350 * smbc_open()). In the former case, the filename should be
351 * in "human readable" form. In the latter case, the smbc_
352 * functions expect a URL which must be url-encoded. Those
353 * functions decode the URL. If, for example, smbc_readdir()
354 * returned a file name of "abc%20def.txt", passing a path
355 * with this file name attached to smbc_open() would cause
356 * smbc_open to attempt to open the file "abc def.txt" since
357 * the %20 is decoded into a space.
359 * Set this option to True if the names returned by
360 * smbc_readdir() should be url-encoded such that they can be
361 * passed back to another smbc_ call. Set it to False if the
362 * names returned by smbc_readdir() are to be presented to the
365 * For backwards compatibility, this option defaults to False.
368 smbc_getOptionUrlEncodeReaddirEntries(SMBCCTX
*c
)
370 return c
->options
.urlencode_readdir_entries
;
374 * Set whether to url-encode readdir entries.
376 * There is a difference in the desired return strings from
377 * smbc_readdir() depending upon whether the filenames are to
378 * be displayed to the user, or whether they are to be
379 * appended to the path name passed to smbc_opendir() to call
380 * a further smbc_ function (e.g. open the file with
381 * smbc_open()). In the former case, the filename should be
382 * in "human readable" form. In the latter case, the smbc_
383 * functions expect a URL which must be url-encoded. Those
384 * functions decode the URL. If, for example, smbc_readdir()
385 * returned a file name of "abc%20def.txt", passing a path
386 * with this file name attached to smbc_open() would cause
387 * smbc_open to attempt to open the file "abc def.txt" since
388 * the %20 is decoded into a space.
390 * Set this option to True if the names returned by
391 * smbc_readdir() should be url-encoded such that they can be
392 * passed back to another smbc_ call. Set it to False if the
393 * names returned by smbc_readdir() are to be presented to the
396 * For backwards compatibility, this option defaults to False.
399 smbc_setOptionUrlEncodeReaddirEntries(SMBCCTX
*c
, smbc_bool b
)
401 c
->options
.urlencode_readdir_entries
= b
;
405 * Get whether to use the same connection for all shares on a server.
407 * Some Windows versions appear to have a limit to the number
408 * of concurrent SESSIONs and/or TREE CONNECTions. In
409 * one-shot programs (i.e. the program runs and then quickly
410 * ends, thereby shutting down all connections), it is
411 * probably reasonable to establish a new connection for each
412 * share. In long-running applications, the limitation can be
413 * avoided by using only a single connection to each server,
414 * and issuing a new TREE CONNECT when the share is accessed.
417 smbc_getOptionOneSharePerServer(SMBCCTX
*c
)
419 return c
->options
.one_share_per_server
;
423 * Set whether to use the same connection for all shares on a server.
425 * Some Windows versions appear to have a limit to the number
426 * of concurrent SESSIONs and/or TREE CONNECTions. In
427 * one-shot programs (i.e. the program runs and then quickly
428 * ends, thereby shutting down all connections), it is
429 * probably reasonable to establish a new connection for each
430 * share. In long-running applications, the limitation can be
431 * avoided by using only a single connection to each server,
432 * and issuing a new TREE CONNECT when the share is accessed.
435 smbc_setOptionOneSharePerServer(SMBCCTX
*c
, smbc_bool b
)
437 c
->options
.one_share_per_server
= b
;
440 /** Get whether to enable use of kerberos */
442 smbc_getOptionUseKerberos(SMBCCTX
*c
)
444 return c
->flags
& SMB_CTX_FLAG_USE_KERBEROS
? True
: False
;
447 /** Set whether to enable use of kerberos */
449 smbc_setOptionUseKerberos(SMBCCTX
*c
, smbc_bool b
)
452 c
->flags
|= SMB_CTX_FLAG_USE_KERBEROS
;
454 c
->flags
&= ~SMB_CTX_FLAG_USE_KERBEROS
;
458 /** Get whether to fallback after kerberos */
460 smbc_getOptionFallbackAfterKerberos(SMBCCTX
*c
)
462 return c
->flags
& SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS
? True
: False
;
465 /** Set whether to fallback after kerberos */
467 smbc_setOptionFallbackAfterKerberos(SMBCCTX
*c
, smbc_bool b
)
470 c
->flags
|= SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS
;
472 c
->flags
&= ~SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS
;
476 /** Get whether to automatically select anonymous login */
478 smbc_getOptionNoAutoAnonymousLogin(SMBCCTX
*c
)
480 return c
->flags
& SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON
? True
: False
;
483 /** Set whether to automatically select anonymous login */
485 smbc_setOptionNoAutoAnonymousLogin(SMBCCTX
*c
, smbc_bool b
)
488 c
->flags
|= SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON
;
490 c
->flags
&= ~SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON
;
494 /** Get whether to enable use of the winbind ccache */
496 smbc_getOptionUseCCache(SMBCCTX
*c
)
498 return c
->flags
& SMB_CTX_FLAG_USE_CCACHE
? True
: False
;
501 /** Set whether to enable use of the winbind ccache */
503 smbc_setOptionUseCCache(SMBCCTX
*c
, smbc_bool b
)
506 c
->flags
|= SMB_CTX_FLAG_USE_CCACHE
;
508 c
->flags
&= ~SMB_CTX_FLAG_USE_CCACHE
;
512 /** Get indication whether the password supplied is the NT hash */
514 smbc_getOptionUseNTHash(SMBCCTX
*c
)
516 return (c
->flags
& SMB_CTX_FLAG_USE_NT_HASH
) != 0;
519 /** Set indication that the password supplied is the NT hash */
521 smbc_setOptionUseNTHash(SMBCCTX
*c
, smbc_bool b
)
524 c
->flags
|= SMB_CTX_FLAG_USE_NT_HASH
;
526 c
->flags
&= ~SMB_CTX_FLAG_USE_NT_HASH
;
531 smbc_setOptionProtocols(SMBCCTX
*c
,
532 const char *min_proto
,
533 const char *max_proto
)
537 if (min_proto
!= NULL
) {
538 ok
= lpcfg_set_cmdline(c
->internal
->lp_ctx
,
539 "client min protocol",
543 if (max_proto
!= NULL
) {
544 ok
&= lpcfg_set_cmdline(c
->internal
->lp_ctx
,
545 "client max protocol",
552 /** Get whether to enable POSIX extensions if available */
554 smbc_getOptionPosixExtensions(SMBCCTX
*c
)
556 return c
->internal
->posix_extensions
;
559 /** Set whether to enable POSIX extensions if available */
561 smbc_setOptionPosixExtensions(SMBCCTX
*c
, smbc_bool b
)
563 c
->internal
->posix_extensions
= b
;
566 /** Get the function for obtaining authentication data */
567 smbc_get_auth_data_fn
568 smbc_getFunctionAuthData(SMBCCTX
*c
)
570 smbc_get_auth_data_fn ret
;
571 TALLOC_CTX
*frame
= talloc_stackframe();
572 ret
= c
->callbacks
.auth_fn
;
577 /** Set the function for obtaining authentication data */
579 smbc_setFunctionAuthData(SMBCCTX
*c
, smbc_get_auth_data_fn fn
)
581 c
->internal
->auth_fn_with_context
= NULL
;
582 c
->callbacks
.auth_fn
= fn
;
585 /** Get the new-style authentication function which includes the context. */
586 smbc_get_auth_data_with_context_fn
587 smbc_getFunctionAuthDataWithContext(SMBCCTX
*c
)
589 return c
->internal
->auth_fn_with_context
;
592 /** Set the new-style authentication function which includes the context. */
594 smbc_setFunctionAuthDataWithContext(SMBCCTX
*c
,
595 smbc_get_auth_data_with_context_fn fn
)
597 c
->callbacks
.auth_fn
= NULL
;
598 c
->internal
->auth_fn_with_context
= fn
;
601 /** Get the function for checking if a server is still good */
603 smbc_getFunctionCheckServer(SMBCCTX
*c
)
605 return c
->callbacks
.check_server_fn
;
608 /** Set the function for checking if a server is still good */
610 smbc_setFunctionCheckServer(SMBCCTX
*c
, smbc_check_server_fn fn
)
612 c
->callbacks
.check_server_fn
= fn
;
615 /** Get the function for removing a server if unused */
616 smbc_remove_unused_server_fn
617 smbc_getFunctionRemoveUnusedServer(SMBCCTX
*c
)
619 return c
->callbacks
.remove_unused_server_fn
;
622 /** Set the function for removing a server if unused */
624 smbc_setFunctionRemoveUnusedServer(SMBCCTX
*c
,
625 smbc_remove_unused_server_fn fn
)
627 c
->callbacks
.remove_unused_server_fn
= fn
;
630 /** Get the function for adding a cached server */
631 smbc_add_cached_srv_fn
632 smbc_getFunctionAddCachedServer(SMBCCTX
*c
)
634 return c
->callbacks
.add_cached_srv_fn
;
637 /** Set the function for adding a cached server */
639 smbc_setFunctionAddCachedServer(SMBCCTX
*c
, smbc_add_cached_srv_fn fn
)
641 c
->callbacks
.add_cached_srv_fn
= fn
;
644 /** Get the function for server cache lookup */
645 smbc_get_cached_srv_fn
646 smbc_getFunctionGetCachedServer(SMBCCTX
*c
)
648 return c
->callbacks
.get_cached_srv_fn
;
651 /** Set the function for server cache lookup */
653 smbc_setFunctionGetCachedServer(SMBCCTX
*c
, smbc_get_cached_srv_fn fn
)
655 c
->callbacks
.get_cached_srv_fn
= fn
;
658 /** Get the function for server cache removal */
659 smbc_remove_cached_srv_fn
660 smbc_getFunctionRemoveCachedServer(SMBCCTX
*c
)
662 return c
->callbacks
.remove_cached_srv_fn
;
665 /** Set the function for server cache removal */
667 smbc_setFunctionRemoveCachedServer(SMBCCTX
*c
,
668 smbc_remove_cached_srv_fn fn
)
670 c
->callbacks
.remove_cached_srv_fn
= fn
;
674 * Get the function for server cache purging. This function tries to
675 * remove all cached servers (e.g. on disconnect)
678 smbc_getFunctionPurgeCachedServers(SMBCCTX
*c
)
680 return c
->callbacks
.purge_cached_fn
;
683 /** Set the function to store private data of the server cache */
684 void smbc_setServerCacheData(SMBCCTX
*c
, struct smbc_server_cache
* cache
)
686 c
->internal
->server_cache
= cache
;
689 /** Get the function to store private data of the server cache */
690 struct smbc_server_cache
* smbc_getServerCacheData(SMBCCTX
*c
)
692 return c
->internal
->server_cache
;
697 * Set the function for server cache purging. This function tries to
698 * remove all cached servers (e.g. on disconnect)
701 smbc_setFunctionPurgeCachedServers(SMBCCTX
*c
, smbc_purge_cached_fn fn
)
703 c
->callbacks
.purge_cached_fn
= fn
;
707 * Callable functions for files.
711 smbc_getFunctionOpen(SMBCCTX
*c
)
717 smbc_setFunctionOpen(SMBCCTX
*c
, smbc_open_fn fn
)
723 smbc_getFunctionCreat(SMBCCTX
*c
)
729 smbc_setFunctionCreat(SMBCCTX
*c
, smbc_creat_fn fn
)
735 smbc_getFunctionRead(SMBCCTX
*c
)
741 smbc_setFunctionRead(SMBCCTX
*c
, smbc_read_fn fn
)
747 smbc_getFunctionWrite(SMBCCTX
*c
)
753 smbc_setFunctionWrite(SMBCCTX
*c
, smbc_write_fn fn
)
759 smbc_getFunctionSplice(SMBCCTX
*c
)
761 return c
->internal
->smb
.splice_fn
;
765 smbc_setFunctionSplice(SMBCCTX
*c
, smbc_splice_fn fn
)
767 c
->internal
->smb
.splice_fn
= fn
;
771 smbc_getFunctionUnlink(SMBCCTX
*c
)
777 smbc_setFunctionUnlink(SMBCCTX
*c
, smbc_unlink_fn fn
)
783 smbc_getFunctionRename(SMBCCTX
*c
)
789 smbc_setFunctionRename(SMBCCTX
*c
, smbc_rename_fn fn
)
795 smbc_getFunctionLseek(SMBCCTX
*c
)
801 smbc_setFunctionLseek(SMBCCTX
*c
, smbc_lseek_fn fn
)
807 smbc_getFunctionStat(SMBCCTX
*c
)
813 smbc_setFunctionStat(SMBCCTX
*c
, smbc_stat_fn fn
)
819 smbc_getFunctionFstat(SMBCCTX
*c
)
825 smbc_setFunctionFstat(SMBCCTX
*c
, smbc_fstat_fn fn
)
831 smbc_getFunctionStatVFS(SMBCCTX
*c
)
833 return c
->internal
->posix_emu
.statvfs_fn
;
837 smbc_setFunctionStatVFS(SMBCCTX
*c
, smbc_statvfs_fn fn
)
839 c
->internal
->posix_emu
.statvfs_fn
= fn
;
843 smbc_getFunctionFstatVFS(SMBCCTX
*c
)
845 return c
->internal
->posix_emu
.fstatvfs_fn
;
849 smbc_setFunctionFstatVFS(SMBCCTX
*c
, smbc_fstatvfs_fn fn
)
851 c
->internal
->posix_emu
.fstatvfs_fn
= fn
;
855 smbc_getFunctionFtruncate(SMBCCTX
*c
)
857 return c
->internal
->posix_emu
.ftruncate_fn
;
861 smbc_setFunctionFtruncate(SMBCCTX
*c
, smbc_ftruncate_fn fn
)
863 c
->internal
->posix_emu
.ftruncate_fn
= fn
;
867 smbc_getFunctionClose(SMBCCTX
*c
)
873 smbc_setFunctionClose(SMBCCTX
*c
, smbc_close_fn fn
)
880 * Callable functions for directories.
884 smbc_getFunctionOpendir(SMBCCTX
*c
)
890 smbc_setFunctionOpendir(SMBCCTX
*c
, smbc_opendir_fn fn
)
896 smbc_getFunctionClosedir(SMBCCTX
*c
)
902 smbc_setFunctionClosedir(SMBCCTX
*c
, smbc_closedir_fn fn
)
908 smbc_getFunctionReaddir(SMBCCTX
*c
)
914 smbc_setFunctionReaddir(SMBCCTX
*c
, smbc_readdir_fn fn
)
919 smbc_readdirplus_fn
smbc_getFunctionReaddirPlus(SMBCCTX
*c
)
921 return c
->readdirplus
;
924 void smbc_setFunctionReaddirPlus(SMBCCTX
*c
, smbc_readdirplus_fn fn
)
929 smbc_readdirplus2_fn
smbc_getFunctionReaddirPlus2(SMBCCTX
*c
)
931 return c
->readdirplus2
;
934 void smbc_setFunctionReaddirPlus2(SMBCCTX
*c
, smbc_readdirplus2_fn fn
)
936 c
->readdirplus2
= fn
;
940 smbc_getFunctionGetdents(SMBCCTX
*c
)
946 smbc_setFunctionGetdents(SMBCCTX
*c
, smbc_getdents_fn fn
)
952 smbc_getFunctionMkdir(SMBCCTX
*c
)
958 smbc_setFunctionMkdir(SMBCCTX
*c
, smbc_mkdir_fn fn
)
964 smbc_getFunctionRmdir(SMBCCTX
*c
)
970 smbc_setFunctionRmdir(SMBCCTX
*c
, smbc_rmdir_fn fn
)
976 smbc_getFunctionTelldir(SMBCCTX
*c
)
982 smbc_setFunctionTelldir(SMBCCTX
*c
, smbc_telldir_fn fn
)
988 smbc_getFunctionLseekdir(SMBCCTX
*c
)
994 smbc_setFunctionLseekdir(SMBCCTX
*c
, smbc_lseekdir_fn fn
)
1000 smbc_getFunctionFstatdir(SMBCCTX
*c
)
1006 smbc_setFunctionFstatdir(SMBCCTX
*c
, smbc_fstatdir_fn fn
)
1012 smbc_getFunctionNotify(SMBCCTX
*c
)
1014 return c
->internal
->smb
.notify_fn
;
1018 smbc_setFunctionNotify(SMBCCTX
*c
, smbc_notify_fn fn
)
1020 c
->internal
->smb
.notify_fn
= fn
;
1025 * Callable functions applicable to both files and directories.
1029 smbc_getFunctionChmod(SMBCCTX
*c
)
1035 smbc_setFunctionChmod(SMBCCTX
*c
, smbc_chmod_fn fn
)
1041 smbc_getFunctionUtimes(SMBCCTX
*c
)
1047 smbc_setFunctionUtimes(SMBCCTX
*c
, smbc_utimes_fn fn
)
1053 smbc_getFunctionSetxattr(SMBCCTX
*c
)
1059 smbc_setFunctionSetxattr(SMBCCTX
*c
, smbc_setxattr_fn fn
)
1065 smbc_getFunctionGetxattr(SMBCCTX
*c
)
1071 smbc_setFunctionGetxattr(SMBCCTX
*c
, smbc_getxattr_fn fn
)
1077 smbc_getFunctionRemovexattr(SMBCCTX
*c
)
1079 return c
->removexattr
;
1083 smbc_setFunctionRemovexattr(SMBCCTX
*c
, smbc_removexattr_fn fn
)
1085 c
->removexattr
= fn
;
1089 smbc_getFunctionListxattr(SMBCCTX
*c
)
1091 return c
->listxattr
;
1095 smbc_setFunctionListxattr(SMBCCTX
*c
, smbc_listxattr_fn fn
)
1102 * Callable functions related to printing
1106 smbc_getFunctionPrintFile(SMBCCTX
*c
)
1108 return c
->print_file
;
1112 smbc_setFunctionPrintFile(SMBCCTX
*c
, smbc_print_file_fn fn
)
1117 smbc_open_print_job_fn
1118 smbc_getFunctionOpenPrintJob(SMBCCTX
*c
)
1120 return c
->open_print_job
;
1124 smbc_setFunctionOpenPrintJob(SMBCCTX
*c
,
1125 smbc_open_print_job_fn fn
)
1127 c
->open_print_job
= fn
;
1130 smbc_list_print_jobs_fn
1131 smbc_getFunctionListPrintJobs(SMBCCTX
*c
)
1133 return c
->list_print_jobs
;
1137 smbc_setFunctionListPrintJobs(SMBCCTX
*c
,
1138 smbc_list_print_jobs_fn fn
)
1140 c
->list_print_jobs
= fn
;
1143 smbc_unlink_print_job_fn
1144 smbc_getFunctionUnlinkPrintJob(SMBCCTX
*c
)
1146 return c
->unlink_print_job
;
1150 smbc_setFunctionUnlinkPrintJob(SMBCCTX
*c
,
1151 smbc_unlink_print_job_fn fn
)
1153 c
->unlink_print_job
= fn
;