libsmbclient
Typedefs | Functions
Callback function types
Libsmbclient

Typedefs

typedef void(* smbc_get_auth_data_fn )(const char *srv, const char *shr, char *wg, int wglen, char *un, int unlen, char *pw, int pwlen)
typedef void(* smbc_get_auth_data_with_context_fn )(SMBCCTX *c, const char *srv, const char *shr, char *wg, int wglen, char *un, int unlen, char *pw, int pwlen)
typedef void(* smbc_list_print_job_fn )(struct print_job_info *i)
typedef int(* smbc_check_server_fn )(SMBCCTX *c, SMBCSRV *srv)
typedef int(* smbc_remove_unused_server_fn )(SMBCCTX *c, SMBCSRV *srv)
typedef int(* smbc_add_cached_srv_fn )(SMBCCTX *c, SMBCSRV *srv, const char *server, const char *share, const char *workgroup, const char *username)
typedef SMBCSRV *(* smbc_get_cached_srv_fn )(SMBCCTX *c, const char *server, const char *share, const char *workgroup, const char *username)
typedef int(* smbc_remove_cached_srv_fn )(SMBCCTX *c, SMBCSRV *srv)
typedef int(* smbc_purge_cached_fn )(SMBCCTX *c)

Functions

int smbc_remove_unused_server (SMBCCTX *context, SMBCSRV *srv)

Detailed Description

Callback functions


Typedef Documentation

typedef int(* smbc_add_cached_srv_fn)(SMBCCTX *c, SMBCSRV *srv, const char *server, const char *share, const char *workgroup, const char *username)

Add a server to the cache system

Parameters:
cpointer to smb context
srvpointer to server to add
serverserver name
shareshare name
workgroupworkgroup used to connect
usernameusername used to connect
Returns:
0 on success. 1 on failure.

Definition at line 415 of file libsmbclient.h.

typedef int(* smbc_check_server_fn)(SMBCCTX *c, SMBCSRV *srv)

Check if a server is still good

Parameters:
cpointer to smb context
srvpointer to server to check
Returns:
0 when connection is good. 1 on error.

Definition at line 382 of file libsmbclient.h.

typedef void(* smbc_get_auth_data_fn)(const char *srv, const char *shr, char *wg, int wglen, char *un, int unlen, char *pw, int pwlen)

Authentication callback function type (traditional method)

Type for the the authentication function called by the library to obtain authentication credentals

For kerberos support the function should just be called without prompting the user for credentials. Which means a simple 'return' should work. Take a look at examples/libsmbclient/get_auth_data_fn.h and examples/libsmbclient/testbrowse.c.

Parameters:
srvServer being authenticated to
shrShare being authenticated to
wgPointer to buffer containing a "hint" for the workgroup to be authenticated. Should be filled in with the correct workgroup if the hint is wrong.
wglenThe size of the workgroup buffer in bytes
unPointer to buffer containing a "hint" for the user name to be use for authentication. Should be filled in with the correct workgroup if the hint is wrong.
unlenThe size of the username buffer in bytes
pwPointer to buffer containing to which password copied
pwlenThe size of the password buffer in bytes

Definition at line 314 of file libsmbclient.h.

typedef void(* smbc_get_auth_data_with_context_fn)(SMBCCTX *c, const char *srv, const char *shr, char *wg, int wglen, char *un, int unlen, char *pw, int pwlen)

Authentication callback function type (method that includes context)

Type for the the authentication function called by the library to obtain authentication credentals

For kerberos support the function should just be called without prompting the user for credentials. Which means a simple 'return' should work. Take a look at examples/libsmbclient/get_auth_data_fn.h and examples/libsmbclient/testbrowse.c.

Parameters:
cPointer to the smb context
srvServer being authenticated to
shrShare being authenticated to
wgPointer to buffer containing a "hint" for the workgroup to be authenticated. Should be filled in with the correct workgroup if the hint is wrong.
wglenThe size of the workgroup buffer in bytes
unPointer to buffer containing a "hint" for the user name to be use for authentication. Should be filled in with the correct workgroup if the hint is wrong.
unlenThe size of the username buffer in bytes
pwPointer to buffer containing to which password copied
pwlenThe size of the password buffer in bytes

Definition at line 355 of file libsmbclient.h.

typedef SMBCSRV*(* smbc_get_cached_srv_fn)(SMBCCTX *c, const char *server, const char *share, const char *workgroup, const char *username)

Look up a server in the cache system

Parameters:
cpointer to smb context
serverserver name to match
shareshare name to match
workgroupworkgroup to match
usernameusername to match
Returns:
pointer to SMBCSRV on success. NULL on failure.

Definition at line 435 of file libsmbclient.h.

typedef void(* smbc_list_print_job_fn)(struct print_job_info *i)

Print job info callback function type.

Parameters:
ipointer to print job information structure

Definition at line 369 of file libsmbclient.h.

typedef int(* smbc_purge_cached_fn)(SMBCCTX *c)

Try to remove all servers from the cache system and disconnect

Parameters:
cpointer to smb context
Returns:
0 when found and removed. 1 on failure.

Definition at line 460 of file libsmbclient.h.

typedef int(* smbc_remove_cached_srv_fn)(SMBCCTX *c, SMBCSRV *srv)

Check if a server is still good

Parameters:
cpointer to smb context
srvpointer to server to remove
Returns:
0 when found and removed. 1 on failure.

Definition at line 449 of file libsmbclient.h.

typedef int(* smbc_remove_unused_server_fn)(SMBCCTX *c, SMBCSRV *srv)

Remove a server if unused

Parameters:
cpointer to smb context
srvpointer to server to remove
Returns:
0 on success. 1 on failure.

Definition at line 394 of file libsmbclient.h.


Function Documentation

int smbc_remove_unused_server ( SMBCCTX context,
SMBCSRV srv 
)

Remove a server from the cached server list it's unused.

Parameters:
contextpointer to smb context
srvpointer to server to remove
Returns:
On success, 0 is returned. 1 is returned if the server could not be removed. Also useable outside libsmbclient.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines