206
206
/**@ingroup callback
207
* Authentication callback function type.
207
* Authentication callback function type (traditional method)
209
209
* Type for the the authentication function called by the library to
210
210
* obtain authentication credentals
237
237
char *wg, int wglen,
238
238
char *un, int unlen,
239
239
char *pw, int pwlen);
241
* Authentication callback function type (method that includes context)
243
* Type for the the authentication function called by the library to
244
* obtain authentication credentals
246
* @param c Pointer to the smb context
248
* @param srv Server being authenticated to
250
* @param shr Share being authenticated to
252
* @param wg Pointer to buffer containing a "hint" for the
253
* workgroup to be authenticated. Should be filled in
254
* with the correct workgroup if the hint is wrong.
256
* @param wglen The size of the workgroup buffer in bytes
258
* @param un Pointer to buffer containing a "hint" for the
259
* user name to be use for authentication. Should be
260
* filled in with the correct workgroup if the hint is
263
* @param unlen The size of the username buffer in bytes
265
* @param pw Pointer to buffer containing to which password
268
* @param pwlen The size of the password buffer in bytes
271
typedef void (*smbc_get_auth_data_with_context_fn)(SMBCCTX *c,
276
char *pw, int pwlen);
242
279
/**@ingroup callback
422
459
int (*unlink_print_job)(SMBCCTX *c, const char *fname, int id);
426
* These callbacks _always_ have to be initialized because they will not be checked
427
* at dereference for increased speed.
464
* These callbacks _always_ have to be initialized because they will
465
* not be checked at dereference for increased speed.
429
467
struct _smbc_callbacks {
430
468
/** authentication function callback: called upon auth requests
432
smbc_get_auth_data_fn auth_fn;
470
smbc_get_auth_data_fn auth_fn;
434
472
/** check if a server is still good
620
* Each time the context structure is changed, we have binary backward
621
* compatibility issues. Instead of modifying the public portions of the
622
* context structure to add new options, instead, we put them in the internal
623
* portion of the context structure and provide a set function for these new
626
* @param context A pointer to a SMBCCTX obtained from smbc_new_context()
629
* The name of the option for which the value is to be set
631
* @param option_value
632
* The new value of the option being set
636
smbc_option_set(SMBCCTX *context,
640
* Retrieve the current value of an option
642
* @param context A pointer to a SMBCCTX obtained from smbc_new_context()
645
* The name of the option for which the value is to be
648
* @return The value of the specified option.
651
smbc_option_get(SMBCCTX *context,
582
655
* Initialize a SBMCCTX (a context).
584
657
* Must be called before using any SMBCCTX API function
586
659
* @param context A pointer to a SMBCCTX obtained from smbc_new_context()
588
* @return A pointer to the given SMBCCTX on success, NULL on error with errno set:
661
* @return A pointer to the given SMBCCTX on success,
662
* NULL on error with errno set:
589
663
* - EBADF NULL context given
590
664
* - ENOMEM Out of memory
591
665
* - ENOENT The smb.conf file would not load
593
667
* @see smbc_new_context()
595
* @note my_context = smbc_init_context(smbc_new_context()) is perfectly safe,
596
* but it might leak memory on smbc_context_init() failure. Avoid this.
597
* You'll have to call smbc_free_context() yourself on failure.
669
* @note my_context = smbc_init_context(smbc_new_context())
670
* is perfectly safe, but it might leak memory on
671
* smbc_context_init() failure. Avoid this.
672
* You'll have to call smbc_free_context() yourself
600
676
SMBCCTX * smbc_init_context(SMBCCTX * context);