A rewrite of the error handling in the libsmb client code. I've separated
authorTim Potter <tpot@samba.org>
Fri, 10 Aug 2001 06:00:33 +0000 (06:00 +0000)
committerTim Potter <tpot@samba.org>
Fri, 10 Aug 2001 06:00:33 +0000 (06:00 +0000)
commit6dbdb0d813f3c7ab20b38baa1223b0b479aadec9
treeacac8a9b4aadfc20e22bb0ab342d160d5d2856d1
parent00703d306f14a5977df75cb04ee34ae8628ed40e
A rewrite of the error handling in the libsmb client code.  I've separated
out the error handling into a bunch of separate functions rather than all
being handled in one big function.

Fetch error codes from the last received packet:

    void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *num);
    uint32 cli_nt_error(struct cli_state *);

Convert errors to UNIX errno values:

    int cli_errno_from_dos(uint8 eclass, uint32 num);
    int cli_errno_from_nt(uint32 status);
    int cli_errno(struct cli_state *cli);

Detect different kinds of errors:

    BOOL cli_is_dos_error(struct cli_state *cli);
    BOOL cli_is_nt_error(struct cli_state *cli);
    BOOL cli_is_error(struct cli_state *cli);

This also means we now support CAP_STATUS32 as we can decode and understand
NT errors instead of just DOS errors.  Yay!

Ported a whole bunch of files in libsmb to use this new API instead of the
just the DOS error.
13 files changed:
source/libsmb/cliconnect.c
source/libsmb/clientgen.c
source/libsmb/clierror.c
source/libsmb/clifile.c
source/libsmb/clilist.c
source/libsmb/climessage.c
source/libsmb/clirap.c
source/libsmb/clireadwrite.c
source/libsmb/clitrans.c
source/libsmb/libsmbclient.c
source/libsmb/nterr.c
source/libsmb/smbencrypt.c
source/libsmb/smberr.c