Callback function types
[Libsmbclient]

Callback functions [詳細]

型定義

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)
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)
typedef void(*) smbc_list_print_job_fn (struct print_job_info *i)
 Print job info callback function type.
typedef int(*) smbc_check_server_fn (SMBCCTX *c, SMBCSRV *srv)
 Check if a server is still good
typedef int(*) smbc_remove_unused_server_fn (SMBCCTX *c, SMBCSRV *srv)
 Remove a server if unused
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
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
typedef int(*) smbc_remove_cached_srv_fn (SMBCCTX *c, SMBCSRV *srv)
 Check if a server is still good
typedef int(*) smbc_purge_cached_fn (SMBCCTX *c)
 Try to remove all servers from the cache system and disconnect

関数

int smbc_remove_unused_server (SMBCCTX *context, SMBCSRV *srv)
 Remove a server from the cached server list it's unused.

説明

Callback functions


型定義

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

引数:
srv Server being authenticated to
shr Share being authenticated to
wg Pointer to buffer containing a "hint" for the workgroup to be authenticated. Should be filled in with the correct workgroup if the hint is wrong.
wglen The size of the workgroup buffer in bytes
un Pointer 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.
unlen The size of the username buffer in bytes
pw Pointer to buffer containing to which password copied
pwlen The size of the password buffer in bytes

libsmbclient.h249 行で定義されています。

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

引数:
c Pointer to the smb context
srv Server being authenticated to
shr Share being authenticated to
wg Pointer to buffer containing a "hint" for the workgroup to be authenticated. Should be filled in with the correct workgroup if the hint is wrong.
wglen The size of the workgroup buffer in bytes
un Pointer 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.
unlen The size of the username buffer in bytes
pw Pointer to buffer containing to which password copied
pwlen The size of the password buffer in bytes

libsmbclient.h285 行で定義されています。

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

Print job info callback function type.

引数:
i pointer to print job information structure

libsmbclient.h299 行で定義されています。

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

Check if a server is still good

引数:
c pointer to smb context
srv pointer to server to check
戻り値:
0 when connection is good. 1 on error.

libsmbclient.h312 行で定義されています。

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

Remove a server if unused

引数:
c pointer to smb context
srv pointer to server to remove
戻り値:
0 on success. 1 on failure.

libsmbclient.h324 行で定義されています。

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

引数:
c pointer to smb context
srv pointer to server to add
server server name
share share name
workgroup workgroup used to connect
username username used to connect
戻り値:
0 on success. 1 on failure.

libsmbclient.h345 行で定義されています。

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

引数:
c pointer to smb context
server server name to match
share share name to match
workgroup workgroup to match
username username to match
戻り値:
pointer to SMBCSRV on success. NULL on failure.

libsmbclient.h365 行で定義されています。

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

Check if a server is still good

引数:
c pointer to smb context
srv pointer to server to remove
戻り値:
0 when found and removed. 1 on failure.

libsmbclient.h379 行で定義されています。

typedef int(*) smbc_purge_cached_fn(SMBCCTX *c)

Try to remove all servers from the cache system and disconnect

引数:
c pointer to smb context
戻り値:
0 when found and removed. 1 on failure.

libsmbclient.h390 行で定義されています。


関数

int smbc_remove_unused_server ( SMBCCTX context,
SMBCSRV srv 
)

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

引数:
context pointer to smb context
srv pointer to server to remove
戻り値:
On success, 0 is returned. 1 is returned if the server could not be removed. Also useable outside libsmbclient.

libsmbclient.c517 行で定義されています。

参照先 smbc_internal_data::_filessmbc_internal_data::_initializedsmbc_internal_data::_servers_SMBCCTX::callbacks_SMBCSRV::clicli_shutdown()_SMBCCTX::internal_SMBCFILE::next_SMBCCTX::_smbc_callbacks::remove_cached_srv_fn_SMBCFILE::srv.

参照元 smbc_new_context()smbc_purge_cached().

00519 {
00520         SMBCFILE * file;
00521 
00522         /* are we being fooled ? */
00523         if (!context || !context->internal ||
00524             !context->internal->_initialized || !srv) return 1;
00525 
00526         
00527         /* Check all open files/directories for a relation with this server */
00528         for (file = context->internal->_files; file; file=file->next) {
00529                 if (file->srv == srv) {
00530                         /* Still used */
00531                         DEBUG(3, ("smbc_remove_usused_server: "
00532                                   "%p still used by %p.\n", 
00533                                   srv, file));
00534                         return 1;
00535                 }
00536         }
00537 
00538         DLIST_REMOVE(context->internal->_servers, srv);
00539 
00540         cli_shutdown(srv->cli);
00541         srv->cli = NULL;
00542 
00543         DEBUG(3, ("smbc_remove_usused_server: %p removed.\n", srv));
00544 
00545         (context->callbacks.remove_cached_srv_fn)(context, srv);
00546 
00547         SAFE_FREE(srv);
00548         
00549         return 0;
00550 }


Sambaに対してSat Aug 29 21:24:39 2009に生成されました。  doxygen 1.4.7