Lines Matching defs:tok
231 char *tok;
242 for (tok = strtok_r(list, sep, &last); tok != 0;
243 tok = strtok_r(NULL, sep, &last)) {
244 if (STR_EQ(tok, "EXCEPT")) /* EXCEPT: give up */
246 l = strlen(tok);
247 if (*tok == '[' && tok[l - 1] == ']') {
248 tok[l - 1] = '\0';
249 tok++;
251 if (match_fn(tok, request)) { /* YES: look for exceptions */
252 while ((tok = strtok_r(NULL, sep, &last)) && STR_NE(tok, "EXCEPT"))
254 return (tok == 0 || list_match(NULL, request, match_fn) == 0);
263 server_match(char *tok, struct request_info *request)
267 if ((host = split_at(tok + 1, '@')) == 0) { /* plain daemon */
268 return (string_match(tok, eval_daemon(request)));
270 return (string_match(tok, eval_daemon(request))
278 client_match(char *tok, struct request_info *request)
282 if ((host = split_at(tok + 1, '@')) == 0) { /* plain host */
283 return (host_match(tok, request->client));
286 && string_match(tok, eval_user(request)));
293 host_match(char *tok, struct host_info *host)
306 if (tok[0] == '@') { /* netgroup: look it up */
311 return (innetgr(tok + 1, eval_hostname(host), NULL, mydomain));
316 } else if (tok[0] == '/') { /* /file hack */
317 return (hostfile_match(tok, host));
318 } else if (STR_EQ(tok, "KNOWN")) { /* check address and name */
321 } else if (STR_EQ(tok, "LOCAL")) { /* local: no dots in name */
324 } else if (strncmp(tok, "{RBL}.", 6) == 0) { /* RBL lookup in domain */
325 return rbl_match(tok+6, eval_hostaddr(host));
326 } else if ((mask = split_at(tok, '/')) != 0) { /* net/mask */
327 return (masked_match(tok, mask, eval_hostaddr(host)));
329 return (string_match(tok, eval_hostaddr(host))
330 || (NOT_INADDR(tok) && string_match(tok, eval_hostname(host))));
339 char tok[512];
344 while (fscanf(fp, "%511s", tok) == 1 && !(match = host_match(tok, host)))
394 string_match(char *tok, char *string)
398 if (tok[0] == '.') { /* suffix */
399 n = strlen(string) - strlen(tok);
400 return (n > 0 && STR_EQ(tok, string + n));
401 } else if (STR_EQ(tok, "ALL")) { /* all: match any */
403 } else if (STR_EQ(tok, "KNOWN")) { /* not unknown */
405 } else if (tok[(n = strlen(tok)) - 1] == '.') { /* prefix */
406 return (STRN_EQ(tok, string, n));
408 return (STR_EQ(tok, string));