Ejemplo n.º 1
0
static svc_t *find_inetd_svc(char *path, char *service, char *proto)
{
	svc_t *svc;

	for (svc = svc_inetd_iterator(1); svc; svc = svc_inetd_iterator(0)) {
		if (strncmp(path, svc->cmd, strlen(svc->cmd)))
			continue;

		if (inetd_match(&svc->inetd, service, proto)) {
			_d("Found a matching inetd svc for %s %s %s", path, service, proto);
			return svc;
		}
	}

	return NULL;
}
Ejemplo n.º 2
0
svc_t *svc_find_inetd(char *path, char *service, char *proto, char *port)
{
	svc_t *svc;

	for (svc = svc_iterator(1); svc; svc = svc_iterator(0)) {
		if (svc->type != SVC_CMD_INETD)
			continue;

		if (strncmp(path, svc->cmd, strlen(svc->cmd)))
			continue;

		if (inetd_match(&svc->inetd, service, proto, port)) {
			_d("Found a matching svc for %s", path);
			return svc;
		}
	}

	return NULL;
}