src/dumpstats.c
static struct proxy *expect_frontend_admin(struct session *s, struct stream_interface *si, const char *arg)
{
	struct proxy *px;

	if (s->listener->bind_conf->level < ACCESS_LVL_ADMIN) {
		si->applet.ctx.cli.msg = stats_permission_denied_msg;
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}

	if (!*arg) {
		si->applet.ctx.cli.msg = "A frontend name is expected.\n";
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}

	px = findproxy(arg, PR_CAP_FE);
	if (!px) {
		si->applet.ctx.cli.msg = "No such frontend.\n";
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}
	return px;
}
/* Expects to find a frontend named <arg> and returns it, otherwise displays various
 * adequate error messages and returns NULL. This function also expects the session
 * level to be admin.
 */
Expects to find a frontend named  and returns it, otherwise displays various
adequate error messages and returns NULL. This function also expects the session
level to be admin.
Expects to find a frontend named and returns it otherwise displays various adequate error messages and returns NULL . This function also expects the session level to be admin .
static struct proxy *expect_frontend_admin(struct session *s, struct stream_interface *si, const char *arg)
{
	struct proxy *px;
	if (s->listener->bind_conf->level < ACCESS_LVL_ADMIN) {
		si->applet.ctx.cli.msg = stats_permission_denied_msg;
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}
	if (!*arg) {
		si->applet.ctx.cli.msg = "A frontend name is expected.\n";
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}
	px = findproxy(arg, PR_CAP_FE);
	if (!px) {
		si->applet.ctx.cli.msg = "No such frontend.\n";
		si->applet.st0 = STAT_CLI_PRINT;
		return NULL;
	}
	return px;
}
static struct proxy * expect_frontend_admin ( struct session * s , struct stream_interface * si , const char * arg ) { struct proxy * px ; if ( s -> listener -> bind_conf -> level < ACCESS_LVL_ADMIN ) { si -> applet . ctx . cli . msg = stats_permission_denied_msg ; si -> applet . st0 = STAT_CLI_PRINT ; return NULL ; } if ( ! * arg ) { si -> applet . ctx . cli . msg = " \n " ; si -> applet . st0 = STAT_CLI_PRINT ; return NULL ; } px = findproxy ( arg , PR_CAP_FE ) ; if ( ! px ) { si -> applet . ctx . cli . msg = " \n " ; si -> applet . st0 = STAT_CLI_PRINT ; return NULL ; } return px ; }
Expects to find a frontend named <arg> and returns it, otherwise displays various
 adequate error messages and returns NULL.
Expects to find a frontend named <arg > and returns it otherwise displays various adequate error messages and returns NULL .