NTSTATUS cli_get_nt_error(struct cli_state *cli);
void cli_set_nt_error(struct cli_state *cli, NTSTATUS status);
void cli_reset_error(struct cli_state *cli);
+bool cli_state_is_connected(struct cli_state *cli);
/* The following definitions come from libsmb/clifile.c */
SSVAL(cli->inbuf,smb_err,0);
}
}
+
+bool cli_state_is_connected(struct cli_state *cli)
+{
+ if (cli == NULL) {
+ return false;
+ }
+
+ if (!cli->initialised) {
+ return false;
+ }
+
+ if (cli->fd == -1) {
+ return false;
+ }
+
+ return true;
+}
+