static void helper_save(const void *ip, const struct xt_entry_match *match) { struct xt_helper_info *info = (struct xt_helper_info *)match->data; printf("%s--helper ",info->invert ? "! " : ""); xtables_save_string(info->name); }
/* Saves the union ipt_matchinfo in parsable form to stdout. */ static void comment_save(const void *ip, const struct xt_entry_match *match) { struct xt_comment_info *commentinfo = (struct xt_comment_info *)match->data; commentinfo->comment[XT_MAX_COMMENT_LEN-1] = '\0'; printf("--comment "); xtables_save_string((const char *)commentinfo->comment); }
static void cgroup_save_v1(const void *ip, const struct xt_entry_match *match) { const struct xt_cgroup_info_v1 *info = (void *)match->data; if (info->has_path) { printf("%s --path", info->invert_path ? " !" : ""); xtables_save_string(info->path); } if (info->has_classid) printf("%s --cgroup %u", info->invert_classid ? " !" : "", info->classid); }
static void ULOG_save(const void *ip, const struct xt_entry_target *target) { const struct ipt_ulog_info *loginfo = (const struct ipt_ulog_info *) target->data; if (strcmp(loginfo->prefix, "") != 0) { fputs(" --ulog-prefix", stdout); xtables_save_string(loginfo->prefix); } if (loginfo->nl_group != ULOG_DEFAULT_NLGROUP) printf(" --ulog-nlgroup %d", ffs(loginfo->nl_group)); if (loginfo->copy_range) printf(" --ulog-cprange %u", (unsigned int)loginfo->copy_range); if (loginfo->qthreshold != ULOG_DEFAULT_QTHRESHOLD) printf(" --ulog-qthreshold %u", (unsigned int)loginfo->qthreshold); }