Addition of developer and user modes to debugcli
In order to be able to protect the interface so that mistyped argument do not endanger MaxScale yet still allow the developer access a router option has been added that gives the debugcli two modes.
This commit is contained in:
@ -1606,3 +1606,31 @@ DCB_CALLBACK *cb, *nextcb;
|
||||
}
|
||||
spinlock_release(&dcb->cb_lock);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the passed DCB to ensure it is in the list of allDCBS
|
||||
*
|
||||
* @param DCB The DCB to check
|
||||
* @return 1 if the DCB is in the list, otherwise 0
|
||||
*/
|
||||
int
|
||||
dcb_isvalid(DCB *dcb)
|
||||
{
|
||||
DCB *ptr;
|
||||
int rval = 0;
|
||||
|
||||
spinlock_acquire(&dcbspin);
|
||||
ptr = allDCBs;
|
||||
while (ptr)
|
||||
{
|
||||
if (ptr == dcb)
|
||||
{
|
||||
rval = 1;
|
||||
break;
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
spinlock_release(&dcbspin);
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
@ -197,3 +197,26 @@ MONITOR *ptr;
|
||||
}
|
||||
spinlock_release(&monLock);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a monitor by name
|
||||
*
|
||||
* @param name The name of the monitor
|
||||
* @return Pointer to the monitor or NULL
|
||||
*/
|
||||
MONITOR *
|
||||
monitor_find(char *name)
|
||||
{
|
||||
MONITOR *ptr;
|
||||
|
||||
spinlock_acquire(&monLock);
|
||||
ptr = allMonitors;
|
||||
while (ptr)
|
||||
{
|
||||
if (!strcmp(ptr->name, name))
|
||||
break;
|
||||
ptr = ptr->next;
|
||||
}
|
||||
spinlock_release(&monLock);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
* 25/02/14 Massimiliano Pinto Added: service refresh limit feature
|
||||
* 28/02/14 Massimiliano Pinto users_alloc moved from service_alloc to serviceStartPort (generic hashable for services)
|
||||
* 07/05/14 Massimiliano Pinto Added: version_string initialized to NULL
|
||||
* 23/05/14 Mark Riddoch Addition of service validation call
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
@ -114,6 +115,33 @@ SERVICE *service;
|
||||
return service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if a service pointer is valid
|
||||
*
|
||||
* @param service The poitner to check
|
||||
* @return 1 if the service is in the list of all services
|
||||
*/
|
||||
int
|
||||
service_isvalid(SERVICE *service)
|
||||
{
|
||||
SERVICE *ptr;
|
||||
int rval = 0;
|
||||
|
||||
spinlock_acquire(&service_spin);
|
||||
ptr = allServices;
|
||||
while (ptr)
|
||||
{
|
||||
if (ptr == service)
|
||||
{
|
||||
rval = 1;
|
||||
break;
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
spinlock_release(&service_spin);
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start an individual port/protocol pair
|
||||
*
|
||||
|
||||
@ -269,6 +269,34 @@ return_succp :
|
||||
return succp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if a session is valid, i.e. in the list of all sessions
|
||||
*
|
||||
* @param session Session to check
|
||||
* @return 1 if the session is valid otherwise 0
|
||||
*/
|
||||
int
|
||||
session_isvalid(SESSION *session)
|
||||
{
|
||||
SESSION *ptr;
|
||||
int rval = 0;
|
||||
|
||||
spinlock_acquire(&session_spin);
|
||||
ptr = allSessions;
|
||||
while (ptr)
|
||||
{
|
||||
if (ptr == session)
|
||||
{
|
||||
rval = 1;
|
||||
break;
|
||||
}
|
||||
ptr = ptr->next;
|
||||
}
|
||||
spinlock_release(&session_spin);
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print details of an individual session
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user