/*
 * Policy capability support functions
 */

#include <string.h>
#include <sepol/policydb/polcaps.h>

static const char * const polcap_names[] = {
	"network_peer_controls",	/* POLICYDB_CAP_NETPEER */
	"open_perms",			/* POLICYDB_CAP_OPENPERM */
	"extended_socket_class",	/* POLICYDB_CAP_EXTSOCKCLASS */
	"always_check_network",		/* POLICYDB_CAP_ALWAYSNETWORK */
	"cgroup_seclabel",		/* POLICYDB_CAP_SECLABEL */
	"nnp_nosuid_transition",	/* POLICYDB_CAP_NNP_NOSUID_TRANSITION */
	"genfs_seclabel_symlinks",	/* POLICYDB_CAP_GENFS_SECLABEL_SYMLINKS */
	"ioctl_skip_cloexec",		/* POLICYDB_CAP_IOCTL_SKIP_CLOEXEC */
	NULL
};

int sepol_polcap_getnum(const char *name)
{
	int capnum;

	for (capnum = 0; capnum <= POLICYDB_CAP_MAX; capnum++) {
		if (polcap_names[capnum] == NULL)
			continue;
		if (strcasecmp(polcap_names[capnum], name) == 0)
			return capnum;
	}
	return -1;
}

const char *sepol_polcap_getname(unsigned int capnum)
{
	if (capnum > POLICYDB_CAP_MAX)
		return NULL;

	return polcap_names[capnum];
}
