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

Function pf_match

freebsd/netpfil/pf/pf.c:2853–2877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2851}
2852
2853static int
2854pf_match(u_int8_t op, u_int32_t a1, u_int32_t a2, u_int32_t p)
2855{
2856 switch (op) {
2857 case PF_OP_IRG:
2858 return ((p > a1) && (p < a2));
2859 case PF_OP_XRG:
2860 return ((p < a1) || (p > a2));
2861 case PF_OP_RRG:
2862 return ((p >= a1) && (p <= a2));
2863 case PF_OP_EQ:
2864 return (p == a1);
2865 case PF_OP_NE:
2866 return (p != a1);
2867 case PF_OP_LT:
2868 return (p < a1);
2869 case PF_OP_LE:
2870 return (p <= a1);
2871 case PF_OP_GT:
2872 return (p > a1);
2873 case PF_OP_GE:
2874 return (p >= a1);
2875 }
2876 return (0); /* never reached */
2877}
2878
2879int
2880pf_match_port(u_int8_t op, u_int16_t a1, u_int16_t a2, u_int16_t p)

Callers 3

pf_match_portFunction · 0.85
pf_match_uidFunction · 0.85
pf_match_gidFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected