/* Returns appropriately filled struct servers, or NULL if had a problem */ struct servers *replicas_lookup(int method, char *data) { struct servers *sp=NULL; switch(method) { case FSLOC_NONE: break; case FSLOC_REFER: sp = method_list(data); if (sp) sp->h_referral = 1; break; case FSLOC_REPLICA: sp = method_list(data); if (sp) sp->h_referral = 0; break; #ifdef DEBUG case FSLOC_STUB: sp = method_stub(data); break; #endif default: xlog(L_WARNING, "Unknown method = %i", method); } replicas_print(sp); return sp; }
void system_list_methods (HTTPRequest *http, json::Value &request, json::Value &response) { unsigned i = 0; json::Value method_list (json::arrayValue); json::rpc::method_map::iterator it; for (it = json::rpc::methods.begin(); it != json::rpc::methods.end(); ++it) { method_list[i] = json::Value (it->first); i++; } response["result"] = method_list; }
int Authentication::selectAuthenticationType( MyString method_order, int remote_methods ) { // the first one in the list that is also in the bitmask is the one // that we pick. so, iterate the list. StringList method_list( method_order.Value() ); char * tmp = NULL; method_list.rewind(); while ( (tmp = method_list.next()) ) { int that_bit = SecMan::getAuthBitmask( tmp ); if ( remote_methods & that_bit ) { // we have a match. return that_bit; } } return 0; }