Lines Matching refs:tok

204     char   *tok;
213 for (tok = strtok(list, sep); tok != 0; tok = strtok((char *) 0, sep)) {
214 if (STR_EQ(tok, "EXCEPT")) /* EXCEPT: give up */
216 if (match_fn(tok, request)) { /* YES: look for exceptions */
217 while ((tok = strtok((char *) 0, sep)) && STR_NE(tok, "EXCEPT"))
219 return (tok == 0 || list_match((char *) 0, request, match_fn) == 0);
227 static int server_match(tok, request)
228 char *tok;
233 if ((host = split_at(tok + 1, '@')) == 0) { /* plain daemon */
234 return (string_match(tok, eval_daemon(request)));
236 return (string_match(tok, eval_daemon(request))
243 static int client_match(tok, request)
244 char *tok;
249 if ((host = split_at(tok + 1, '@')) == 0) { /* plain host */
250 return (host_match(tok, request->client));
253 && string_match(tok, eval_user(request)));
259 static int host_match(tok, host)
260 char *tok;
274 if (tok[0] == '@') { /* netgroup: look it up */
279 return (innetgr(tok + 1, eval_hostname(host), (char *) 0, mydomain));
284 } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */
287 } else if (STR_EQ(tok, "LOCAL")) { /* local: no dots in name */
291 } else if (tok[0] == '[') { /* IPv6 address */
314 if (cbr = strchr(tok, ']'))
321 if (slash = strchr(tok, '/')) {
335 if (cbr == NULL || inet_pton(AF_INET6, tok+1, &in6) != 1) {
352 } else if ((mask = split_at(tok, '/')) != 0) { /* net/mask */
353 return (masked_match(tok, mask, eval_hostaddr(host)));
355 return (string_match(tok, eval_hostaddr(host))
356 || (NOT_INADDR(tok) && string_match(tok, eval_hostname(host))));
362 static int string_match(tok, string)
363 char *tok;
368 if (tok[0] == '.') { /* suffix */
369 n = strlen(string) - strlen(tok);
370 return (n > 0 && STR_EQ(tok, string + n));
371 } else if (STR_EQ(tok, "ALL")) { /* all: match any */
373 } else if (STR_EQ(tok, "KNOWN")) { /* not unknown */
375 } else if (tok[(n = strlen(tok)) - 1] == '.') { /* prefix */
376 return (STRN_EQ(tok, string, n));
378 return (STR_EQ(tok, string));