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

Function list_dyn_state

tools/ipfw/ipfw2.c:2680–2706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2678}
2679
2680static void
2681list_dyn_state(struct cmdline_opts *co, struct format_opts *fo,
2682 void *_arg, void *_state)
2683{
2684 uint16_t rulenum;
2685 uint8_t set;
2686 ipfw_dyn_rule *d;
2687 struct buf_pr *bp;
2688
2689 d = (ipfw_dyn_rule *)_state;
2690 bp = (struct buf_pr *)_arg;
2691
2692 bcopy(&d->rule, &rulenum, sizeof(rulenum));
2693 if (rulenum > fo->last)
2694 return;
2695 if (co->use_set) {
2696 bcopy((char *)&d->rule + sizeof(uint16_t),
2697 &set, sizeof(uint8_t));
2698 if (set != co->use_set - 1)
2699 return;
2700 }
2701 if (rulenum >= fo->first) {
2702 show_dyn_state(co, fo, bp, d);
2703 printf("%s\n", bp->buf);
2704 bp_flush(bp);
2705 }
2706}
2707
2708static int
2709list_dyn_range(struct cmdline_opts *co, struct format_opts *fo,

Callers

nothing calls this directly

Calls 3

show_dyn_stateFunction · 0.85
bp_flushFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected