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; }
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; }