MCPcopy Create free account
hub / github.com/F-Stack/f-stack / match_token

Function match_token

tools/ipfw/ipfw2.c:675–685  ·  view source on GitHub ↗

* match_token takes a table and a string, returns the value associated * with the string (-1 in case of failure). */

Source from the content-addressed store, hash-verified

673 * with the string (-1 in case of failure).
674 */
675int
676match_token(struct _s_x *table, const char *string)
677{
678 struct _s_x *pt;
679 uint i = strlen(string);
680
681 for (pt = table ; i && pt->s != NULL ; pt++)
682 if (strlen(pt->s) == i && !bcmp(string, pt->s, i))
683 return pt->x;
684 return (-1);
685}
686
687/**
688 * match_token_relaxed takes a table and a string, returns the value associated

Callers 15

table_createFunction · 0.85
tentry_fill_valueFunction · 0.85
fill_unreach6_codeFunction · 0.85
fill_ext6hdrFunction · 0.85
process_extra_parmsFunction · 0.85
ipfw_config_pipeFunction · 0.85
ipfw_config_natFunction · 0.85
fill_flagsFunction · 0.85
strtoportFunction · 0.85
fill_dscpFunction · 0.85
fill_reject_codeFunction · 0.85
print_action_instructionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected