int authenticate_daemon(MonitorItem* item, JCR *jcr) { switch (item->type()) { case R_DIRECTOR: return authenticate_director(jcr); case R_CLIENT: return authenticate_file_daemon(jcr, (CLIENTRES*)item->resource()); case R_STORAGE: return authenticate_storage_daemon(jcr, (STORERES*)item->resource()); default: printf(_("Error, currentitem is not a Client or a Storage..\n")); return FALSE; } return false; }
static int authenticate_daemon(monitoritem* item) { DIRRES *d; CLIENT *f; STORE *s; switch (item->type) { case R_DIRECTOR: d = (DIRRES *)item->resource; return authenticate_director(item->D_sock, d->hdr.name, d->password); break; case R_CLIENT: f = (CLIENT *)item->resource; return authenticate_file_daemon(item->D_sock, f->hdr.name, f->password); break; case R_STORAGE: s = (STORE *)item->resource; return authenticate_storage_daemon(item->D_sock, s->hdr.name, s->password); break; default: printf("Error, currentitem is not a Client or a Storage..\n"); return FALSE; } }