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"
31 /** Get the netbios name used for making connections */
33 smbc_getNetbiosName(SMBCCTX
*c
)
35 return c
->netbios_name
;
38 /** Set the netbios name used for making connections */
40 smbc_setNetbiosName(SMBCCTX
*c
, char * netbios_name
)
42 SAFE_FREE(c
->netbios_name
);
44 c
->netbios_name
= SMB_STRDUP(netbios_name
);
48 /** Get the workgroup used for making connections */
50 smbc_getWorkgroup(SMBCCTX
*c
)
55 /** Set the workgroup used for making connections */
57 smbc_setWorkgroup(SMBCCTX
*c
, char * workgroup
)
59 SAFE_FREE(c
->workgroup
);
61 c
->workgroup
= SMB_STRDUP(workgroup
);
65 /** Get the username used for making connections */
67 smbc_getUser(SMBCCTX
*c
)
72 /** Set the username used for making connections */
74 smbc_setUser(SMBCCTX
*c
, char * user
)
78 c
->user
= SMB_STRDUP(user
);
82 /** Get the debug level */
84 smbc_getDebug(SMBCCTX
*c
)
89 /** Set the debug level */
91 smbc_setDebug(SMBCCTX
*c
, int debug
)
94 TALLOC_CTX
*frame
= talloc_stackframe();
95 snprintf(buf
, sizeof(buf
), "%d", debug
);
97 lp_set_cmdline("log level", buf
);
102 * Get the timeout used for waiting on connections and response data
106 smbc_getTimeout(SMBCCTX
*c
)
112 * Set the timeout used for waiting on connections and response data
116 smbc_setTimeout(SMBCCTX
*c
, int timeout
)
118 c
->timeout
= timeout
;
122 * Get the TCP port used to connect.
125 smbc_getPort(SMBCCTX
*c
)
127 return c
->internal
->port
;
131 * Set the TCP port used to connect.
134 smbc_setPort(SMBCCTX
*c
, uint16_t port
)
136 c
->internal
->port
= port
;
140 /** Get whether to log to standard error instead of standard output */
142 smbc_getOptionDebugToStderr(SMBCCTX
*c
)
145 TALLOC_CTX
*frame
= talloc_stackframe();
147 /* Because this is a global concept, it is better to check
148 * what is really set, rather than what we wanted set
149 * (particularly as you cannot go back to stdout). */
150 ret
= debug_get_output_is_stderr();
155 /** Set whether to log to standard error instead of standard output.
156 * This option is 'sticky' - once set to true, it cannot be set to
157 * false again, as it is global to the process, as once we have been
158 * told that it is not safe to safe to write to stdout, we shouldn't
159 * go back as we don't know it was this context that set it that way.
162 smbc_setOptionDebugToStderr(SMBCCTX
*c
, smbc_bool b
)
164 TALLOC_CTX
*frame
= talloc_stackframe();
167 * We do not have a unique per-thread debug state? For
168 * now, we'll just leave it up to the user. If any one
169 * context spefies debug to stderr then all will be (and
170 * will stay that way, as it is unsafe to flip back if
171 * stdout is in use for other things)
173 setup_logging("libsmbclient", DEBUG_STDERR
);
179 * Get whether to use new-style time attribute names, e.g. WRITE_TIME rather
180 * than the old-style names such as M_TIME. This allows also setting/getting
181 * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME
182 * was supposed to be CHANGE_TIME but was confused and sometimes referred to
186 smbc_getOptionFullTimeNames(SMBCCTX
*c
)
188 return c
->internal
->full_time_names
;
192 * Set whether to use new-style time attribute names, e.g. WRITE_TIME rather
193 * than the old-style names such as M_TIME. This allows also setting/getting
194 * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME
195 * was supposed to be CHANGE_TIME but was confused and sometimes referred to
199 smbc_setOptionFullTimeNames(SMBCCTX
*c
, smbc_bool b
)
201 c
->internal
->full_time_names
= b
;
205 * Get the share mode to use for files opened with SMBC_open_ctx(). The
206 * default is SMBC_SHAREMODE_DENY_NONE.
209 smbc_getOptionOpenShareMode(SMBCCTX
*c
)
211 return c
->internal
->share_mode
;
215 * Set the share mode to use for files opened with SMBC_open_ctx(). The
216 * default is SMBC_SHAREMODE_DENY_NONE.
219 smbc_setOptionOpenShareMode(SMBCCTX
*c
, smbc_share_mode share_mode
)
221 c
->internal
->share_mode
= share_mode
;
224 /** Retrieve a previously set user data handle */
226 smbc_getOptionUserData(SMBCCTX
*c
)
228 return c
->internal
->user_data
;
231 /** Save a user data handle */
233 smbc_setOptionUserData(SMBCCTX
*c
, void *user_data
)
235 c
->internal
->user_data
= user_data
;
238 /** Get the encoded value for encryption level. */
239 smbc_smb_encrypt_level
240 smbc_getOptionSmbEncryptionLevel(SMBCCTX
*c
)
242 return c
->internal
->smb_encryption_level
;
245 /** Set the encoded value for encryption level. */
247 smbc_setOptionSmbEncryptionLevel(SMBCCTX
*c
, smbc_smb_encrypt_level level
)
249 c
->internal
->smb_encryption_level
= level
;
253 * Get whether to treat file names as case-sensitive if we can't determine
254 * when connecting to the remote share whether the file system is case
255 * sensitive. This defaults to FALSE since it's most likely that if we can't
256 * retrieve the file system attributes, it's a very old file system that does
257 * not support case sensitivity.
260 smbc_getOptionCaseSensitive(SMBCCTX
*c
)
262 return c
->internal
->case_sensitive
;
266 * Set whether to treat file names as case-sensitive if we can't determine
267 * when connecting to the remote share whether the file system is case
268 * sensitive. This defaults to FALSE since it's most likely that if we can't
269 * retrieve the file system attributes, it's a very old file system that does
270 * not support case sensitivity.
273 smbc_setOptionCaseSensitive(SMBCCTX
*c
, smbc_bool b
)
275 c
->internal
->case_sensitive
= b
;
279 * Get from how many local master browsers should the list of workgroups be
280 * retrieved. It can take up to 12 minutes or longer after a server becomes a
281 * local master browser, for it to have the entire browse list (the list of
282 * workgroups/domains) from an entire network. Since a client never knows
283 * which local master browser will be found first, the one which is found
284 * first and used to retrieve a browse list may have an incomplete or empty
285 * browse list. By requesting the browse list from multiple local master
286 * browsers, a more complete list can be generated. For small networks (few
287 * workgroups), it is recommended that this value be set to 0, causing the
288 * browse lists from all found local master browsers to be retrieved and
289 * merged. For networks with many workgroups, a suitable value for this
290 * variable is probably somewhere around 3. (Default: 3).
293 smbc_getOptionBrowseMaxLmbCount(SMBCCTX
*c
)
295 return c
->options
.browse_max_lmb_count
;
299 * Set from how many local master browsers should the list of workgroups be
300 * retrieved. It can take up to 12 minutes or longer after a server becomes a
301 * local master browser, for it to have the entire browse list (the list of
302 * workgroups/domains) from an entire network. Since a client never knows
303 * which local master browser will be found first, the one which is found
304 * first and used to retrieve a browse list may have an incomplete or empty
305 * browse list. By requesting the browse list from multiple local master
306 * browsers, a more complete list can be generated. For small networks (few
307 * workgroups), it is recommended that this value be set to 0, causing the
308 * browse lists from all found local master browsers to be retrieved and
309 * merged. For networks with many workgroups, a suitable value for this
310 * variable is probably somewhere around 3. (Default: 3).
313 smbc_setOptionBrowseMaxLmbCount(SMBCCTX
*c
, int count
)
315 c
->options
.browse_max_lmb_count
= count
;
319 * Get whether to url-encode readdir entries.
321 * There is a difference in the desired return strings from
322 * smbc_readdir() depending upon whether the filenames are to
323 * be displayed to the user, or whether they are to be
324 * appended to the path name passed to smbc_opendir() to call
325 * a further smbc_ function (e.g. open the file with
326 * smbc_open()). In the former case, the filename should be
327 * in "human readable" form. In the latter case, the smbc_
328 * functions expect a URL which must be url-encoded. Those
329 * functions decode the URL. If, for example, smbc_readdir()
330 * returned a file name of "abc%20def.txt", passing a path
331 * with this file name attached to smbc_open() would cause
332 * smbc_open to attempt to open the file "abc def.txt" since
333 * the %20 is decoded into a space.
335 * Set this option to True if the names returned by
336 * smbc_readdir() should be url-encoded such that they can be
337 * passed back to another smbc_ call. Set it to False if the
338 * names returned by smbc_readdir() are to be presented to the
341 * For backwards compatibility, this option defaults to False.
344 smbc_getOptionUrlEncodeReaddirEntries(SMBCCTX
*c
)
346 return c
->options
.urlencode_readdir_entries
;
350 * Set whether to url-encode readdir entries.
352 * There is a difference in the desired return strings from
353 * smbc_readdir() depending upon whether the filenames are to
354 * be displayed to the user, or whether they are to be
355 * appended to the path name passed to smbc_opendir() to call
356 * a further smbc_ function (e.g. open the file with
357 * smbc_open()). In the former case, the filename should be
358 * in "human readable" form. In the latter case, the smbc_
359 * functions expect a URL which must be url-encoded. Those
360 * functions decode the URL. If, for example, smbc_readdir()
361 * returned a file name of "abc%20def.txt", passing a path
362 * with this file name attached to smbc_open() would cause
363 * smbc_open to attempt to open the file "abc def.txt" since
364 * the %20 is decoded into a space.
366 * Set this option to True if the names returned by
367 * smbc_readdir() should be url-encoded such that they can be
368 * passed back to another smbc_ call. Set it to False if the
369 * names returned by smbc_readdir() are to be presented to the
372 * For backwards compatibility, this option defaults to False.
375 smbc_setOptionUrlEncodeReaddirEntries(SMBCCTX
*c
, smbc_bool b
)
377 c
->options
.urlencode_readdir_entries
= b
;
381 * Get whether to use the same connection for all shares on a server.
383 * Some Windows versions appear to have a limit to the number
384 * of concurrent SESSIONs and/or TREE CONNECTions. In
385 * one-shot programs (i.e. the program runs and then quickly
386 * ends, thereby shutting down all connections), it is
387 * probably reasonable to establish a new connection for each
388 * share. In long-running applications, the limitation can be
389 * avoided by using only a single connection to each server,
390 * and issuing a new TREE CONNECT when the share is accessed.
393 smbc_getOptionOneSharePerServer(SMBCCTX
*c
)
395 return c
->options
.one_share_per_server
;
399 * Set whether to use the same connection for all shares on a server.
401 * Some Windows versions appear to have a limit to the number
402 * of concurrent SESSIONs and/or TREE CONNECTions. In
403 * one-shot programs (i.e. the program runs and then quickly
404 * ends, thereby shutting down all connections), it is
405 * probably reasonable to establish a new connection for each
406 * share. In long-running applications, the limitation can be
407 * avoided by using only a single connection to each server,
408 * and issuing a new TREE CONNECT when the share is accessed.
411 smbc_setOptionOneSharePerServer(SMBCCTX
*c
, smbc_bool b
)
413 c
->options
.one_share_per_server
= b
;
416 /** Get whether to enable use of kerberos */
418 smbc_getOptionUseKerberos(SMBCCTX
*c
)
420 return c
->flags
& SMB_CTX_FLAG_USE_KERBEROS
? True
: False
;
423 /** Set whether to enable use of kerberos */
425 smbc_setOptionUseKerberos(SMBCCTX
*c
, smbc_bool b
)
428 c
->flags
|= SMB_CTX_FLAG_USE_KERBEROS
;
430 c
->flags
&= ~SMB_CTX_FLAG_USE_KERBEROS
;
434 /** Get whether to fallback after kerberos */
436 smbc_getOptionFallbackAfterKerberos(SMBCCTX
*c
)
438 return c
->flags
& SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS
? True
: False
;
441 /** Set whether to fallback after kerberos */
443 smbc_setOptionFallbackAfterKerberos(SMBCCTX
*c
, smbc_bool b
)
446 c
->flags
|= SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS
;
448 c
->flags
&= ~SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS
;
452 /** Get whether to automatically select anonymous login */
454 smbc_getOptionNoAutoAnonymousLogin(SMBCCTX
*c
)
456 return c
->flags
& SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON
? True
: False
;
459 /** Set whether to automatically select anonymous login */
461 smbc_setOptionNoAutoAnonymousLogin(SMBCCTX
*c
, smbc_bool b
)
464 c
->flags
|= SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON
;
466 c
->flags
&= ~SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON
;
470 /** Get whether to enable use of the winbind ccache */
472 smbc_getOptionUseCCache(SMBCCTX
*c
)
474 return c
->flags
& SMB_CTX_FLAG_USE_CCACHE
? True
: False
;
477 /** Set whether to enable use of the winbind ccache */
479 smbc_setOptionUseCCache(SMBCCTX
*c
, smbc_bool b
)
482 c
->flags
|= SMB_CTX_FLAG_USE_CCACHE
;
484 c
->flags
&= ~SMB_CTX_FLAG_USE_CCACHE
;
488 /** Get indication whether the password supplied is the NT hash */
490 smbc_getOptionUseNTHash(SMBCCTX
*c
)
492 return (c
->flags
& SMB_CTX_FLAG_USE_NT_HASH
) != 0;
495 /** Set indication that the password supplied is the NT hash */
497 smbc_setOptionUseNTHash(SMBCCTX
*c
, smbc_bool b
)
500 c
->flags
|= SMB_CTX_FLAG_USE_NT_HASH
;
502 c
->flags
&= ~SMB_CTX_FLAG_USE_NT_HASH
;
506 /** Get the function for obtaining authentication data */
507 smbc_get_auth_data_fn
508 smbc_getFunctionAuthData(SMBCCTX
*c
)
510 smbc_get_auth_data_fn ret
;
511 TALLOC_CTX
*frame
= talloc_stackframe();
512 ret
= c
->callbacks
.auth_fn
;
517 /** Set the function for obtaining authentication data */
519 smbc_setFunctionAuthData(SMBCCTX
*c
, smbc_get_auth_data_fn fn
)
521 c
->internal
->auth_fn_with_context
= NULL
;
522 c
->callbacks
.auth_fn
= fn
;
525 /** Get the new-style authentication function which includes the context. */
526 smbc_get_auth_data_with_context_fn
527 smbc_getFunctionAuthDataWithContext(SMBCCTX
*c
)
529 return c
->internal
->auth_fn_with_context
;
532 /** Set the new-style authentication function which includes the context. */
534 smbc_setFunctionAuthDataWithContext(SMBCCTX
*c
,
535 smbc_get_auth_data_with_context_fn fn
)
537 c
->callbacks
.auth_fn
= NULL
;
538 c
->internal
->auth_fn_with_context
= fn
;
541 /** Get the function for checking if a server is still good */
543 smbc_getFunctionCheckServer(SMBCCTX
*c
)
545 return c
->callbacks
.check_server_fn
;
548 /** Set the function for checking if a server is still good */
550 smbc_setFunctionCheckServer(SMBCCTX
*c
, smbc_check_server_fn fn
)
552 c
->callbacks
.check_server_fn
= fn
;
555 /** Get the function for removing a server if unused */
556 smbc_remove_unused_server_fn
557 smbc_getFunctionRemoveUnusedServer(SMBCCTX
*c
)
559 return c
->callbacks
.remove_unused_server_fn
;
562 /** Set the function for removing a server if unused */
564 smbc_setFunctionRemoveUnusedServer(SMBCCTX
*c
,
565 smbc_remove_unused_server_fn fn
)
567 c
->callbacks
.remove_unused_server_fn
= fn
;
570 /** Get the function for adding a cached server */
571 smbc_add_cached_srv_fn
572 smbc_getFunctionAddCachedServer(SMBCCTX
*c
)
574 return c
->callbacks
.add_cached_srv_fn
;
577 /** Set the function for adding a cached server */
579 smbc_setFunctionAddCachedServer(SMBCCTX
*c
, smbc_add_cached_srv_fn fn
)
581 c
->callbacks
.add_cached_srv_fn
= fn
;
584 /** Get the function for server cache lookup */
585 smbc_get_cached_srv_fn
586 smbc_getFunctionGetCachedServer(SMBCCTX
*c
)
588 return c
->callbacks
.get_cached_srv_fn
;
591 /** Set the function for server cache lookup */
593 smbc_setFunctionGetCachedServer(SMBCCTX
*c
, smbc_get_cached_srv_fn fn
)
595 c
->callbacks
.get_cached_srv_fn
= fn
;
598 /** Get the function for server cache removal */
599 smbc_remove_cached_srv_fn
600 smbc_getFunctionRemoveCachedServer(SMBCCTX
*c
)
602 return c
->callbacks
.remove_cached_srv_fn
;
605 /** Set the function for server cache removal */
607 smbc_setFunctionRemoveCachedServer(SMBCCTX
*c
,
608 smbc_remove_cached_srv_fn fn
)
610 c
->callbacks
.remove_cached_srv_fn
= fn
;
614 * Get the function for server cache purging. This function tries to
615 * remove all cached servers (e.g. on disconnect)
618 smbc_getFunctionPurgeCachedServers(SMBCCTX
*c
)
620 return c
->callbacks
.purge_cached_fn
;
623 /** Set the function to store private data of the server cache */
624 void smbc_setServerCacheData(SMBCCTX
*c
, struct smbc_server_cache
* cache
)
626 c
->internal
->server_cache
= cache
;
629 /** Get the function to store private data of the server cache */
630 struct smbc_server_cache
* smbc_getServerCacheData(SMBCCTX
*c
)
632 return c
->internal
->server_cache
;
637 * Set the function for server cache purging. This function tries to
638 * remove all cached servers (e.g. on disconnect)
641 smbc_setFunctionPurgeCachedServers(SMBCCTX
*c
, smbc_purge_cached_fn fn
)
643 c
->callbacks
.purge_cached_fn
= fn
;
647 * Callable functions for files.
651 smbc_getFunctionOpen(SMBCCTX
*c
)
657 smbc_setFunctionOpen(SMBCCTX
*c
, smbc_open_fn fn
)
663 smbc_getFunctionCreat(SMBCCTX
*c
)
669 smbc_setFunctionCreat(SMBCCTX
*c
, smbc_creat_fn fn
)
675 smbc_getFunctionRead(SMBCCTX
*c
)
681 smbc_setFunctionRead(SMBCCTX
*c
, smbc_read_fn fn
)
687 smbc_getFunctionWrite(SMBCCTX
*c
)
693 smbc_setFunctionWrite(SMBCCTX
*c
, smbc_write_fn fn
)
699 smbc_getFunctionSplice(SMBCCTX
*c
)
701 return c
->internal
->smb
.splice_fn
;
705 smbc_setFunctionSplice(SMBCCTX
*c
, smbc_splice_fn fn
)
707 c
->internal
->smb
.splice_fn
= fn
;
711 smbc_getFunctionUnlink(SMBCCTX
*c
)
717 smbc_setFunctionUnlink(SMBCCTX
*c
, smbc_unlink_fn fn
)
723 smbc_getFunctionRename(SMBCCTX
*c
)
729 smbc_setFunctionRename(SMBCCTX
*c
, smbc_rename_fn fn
)
735 smbc_getFunctionLseek(SMBCCTX
*c
)
741 smbc_setFunctionLseek(SMBCCTX
*c
, smbc_lseek_fn fn
)
747 smbc_getFunctionStat(SMBCCTX
*c
)
753 smbc_setFunctionStat(SMBCCTX
*c
, smbc_stat_fn fn
)
759 smbc_getFunctionFstat(SMBCCTX
*c
)
765 smbc_setFunctionFstat(SMBCCTX
*c
, smbc_fstat_fn fn
)
771 smbc_getFunctionStatVFS(SMBCCTX
*c
)
773 return c
->internal
->posix_emu
.statvfs_fn
;
777 smbc_setFunctionStatVFS(SMBCCTX
*c
, smbc_statvfs_fn fn
)
779 c
->internal
->posix_emu
.statvfs_fn
= fn
;
783 smbc_getFunctionFstatVFS(SMBCCTX
*c
)
785 return c
->internal
->posix_emu
.fstatvfs_fn
;
789 smbc_setFunctionFstatVFS(SMBCCTX
*c
, smbc_fstatvfs_fn fn
)
791 c
->internal
->posix_emu
.fstatvfs_fn
= fn
;
795 smbc_getFunctionFtruncate(SMBCCTX
*c
)
797 return c
->internal
->posix_emu
.ftruncate_fn
;
801 smbc_setFunctionFtruncate(SMBCCTX
*c
, smbc_ftruncate_fn fn
)
803 c
->internal
->posix_emu
.ftruncate_fn
= fn
;
807 smbc_getFunctionClose(SMBCCTX
*c
)
813 smbc_setFunctionClose(SMBCCTX
*c
, smbc_close_fn fn
)
820 * Callable functions for directories.
824 smbc_getFunctionOpendir(SMBCCTX
*c
)
830 smbc_setFunctionOpendir(SMBCCTX
*c
, smbc_opendir_fn fn
)
836 smbc_getFunctionClosedir(SMBCCTX
*c
)
842 smbc_setFunctionClosedir(SMBCCTX
*c
, smbc_closedir_fn fn
)
848 smbc_getFunctionReaddir(SMBCCTX
*c
)
854 smbc_setFunctionReaddir(SMBCCTX
*c
, smbc_readdir_fn fn
)
860 smbc_getFunctionGetdents(SMBCCTX
*c
)
866 smbc_setFunctionGetdents(SMBCCTX
*c
, smbc_getdents_fn fn
)
872 smbc_getFunctionMkdir(SMBCCTX
*c
)
878 smbc_setFunctionMkdir(SMBCCTX
*c
, smbc_mkdir_fn fn
)
884 smbc_getFunctionRmdir(SMBCCTX
*c
)
890 smbc_setFunctionRmdir(SMBCCTX
*c
, smbc_rmdir_fn fn
)
896 smbc_getFunctionTelldir(SMBCCTX
*c
)
902 smbc_setFunctionTelldir(SMBCCTX
*c
, smbc_telldir_fn fn
)
908 smbc_getFunctionLseekdir(SMBCCTX
*c
)
914 smbc_setFunctionLseekdir(SMBCCTX
*c
, smbc_lseekdir_fn fn
)
920 smbc_getFunctionFstatdir(SMBCCTX
*c
)
926 smbc_setFunctionFstatdir(SMBCCTX
*c
, smbc_fstatdir_fn fn
)
932 smbc_getFunctionNotify(SMBCCTX
*c
)
934 return c
->internal
->smb
.notify_fn
;
938 smbc_setFunctionNotify(SMBCCTX
*c
, smbc_notify_fn fn
)
940 c
->internal
->smb
.notify_fn
= fn
;
945 * Callable functions applicable to both files and directories.
949 smbc_getFunctionChmod(SMBCCTX
*c
)
955 smbc_setFunctionChmod(SMBCCTX
*c
, smbc_chmod_fn fn
)
961 smbc_getFunctionUtimes(SMBCCTX
*c
)
967 smbc_setFunctionUtimes(SMBCCTX
*c
, smbc_utimes_fn fn
)
973 smbc_getFunctionSetxattr(SMBCCTX
*c
)
979 smbc_setFunctionSetxattr(SMBCCTX
*c
, smbc_setxattr_fn fn
)
985 smbc_getFunctionGetxattr(SMBCCTX
*c
)
991 smbc_setFunctionGetxattr(SMBCCTX
*c
, smbc_getxattr_fn fn
)
997 smbc_getFunctionRemovexattr(SMBCCTX
*c
)
999 return c
->removexattr
;
1003 smbc_setFunctionRemovexattr(SMBCCTX
*c
, smbc_removexattr_fn fn
)
1005 c
->removexattr
= fn
;
1009 smbc_getFunctionListxattr(SMBCCTX
*c
)
1011 return c
->listxattr
;
1015 smbc_setFunctionListxattr(SMBCCTX
*c
, smbc_listxattr_fn fn
)
1022 * Callable functions related to printing
1026 smbc_getFunctionPrintFile(SMBCCTX
*c
)
1028 return c
->print_file
;
1032 smbc_setFunctionPrintFile(SMBCCTX
*c
, smbc_print_file_fn fn
)
1037 smbc_open_print_job_fn
1038 smbc_getFunctionOpenPrintJob(SMBCCTX
*c
)
1040 return c
->open_print_job
;
1044 smbc_setFunctionOpenPrintJob(SMBCCTX
*c
,
1045 smbc_open_print_job_fn fn
)
1047 c
->open_print_job
= fn
;
1050 smbc_list_print_jobs_fn
1051 smbc_getFunctionListPrintJobs(SMBCCTX
*c
)
1053 return c
->list_print_jobs
;
1057 smbc_setFunctionListPrintJobs(SMBCCTX
*c
,
1058 smbc_list_print_jobs_fn fn
)
1060 c
->list_print_jobs
= fn
;
1063 smbc_unlink_print_job_fn
1064 smbc_getFunctionUnlinkPrintJob(SMBCCTX
*c
)
1066 return c
->unlink_print_job
;
1070 smbc_setFunctionUnlinkPrintJob(SMBCCTX
*c
,
1071 smbc_unlink_print_job_fn fn
)
1073 c
->unlink_print_job
= fn
;