本文整理汇总了C++中XT_ALIGN函数的典型用法代码示例。如果您正苦于以下问题:C++ XT_ALIGN函数的具体用法?C++ XT_ALIGN怎么用?C++ XT_ALIGN使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了XT_ALIGN函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: printf
printf(" %s %u", op[info->mode], info->hop_limit);
}
static const struct option hl_opts[] = {
{.name = "hl", .has_arg = true, .val = '2'},
{.name = "hl-eq", .has_arg = true, .val = '2'},
{.name = "hl-lt", .has_arg = true, .val = '3'},
{.name = "hl-gt", .has_arg = true, .val = '4'},
XT_GETOPT_TABLEEND,
};
static struct xtables_match hl_mt6_reg = {
.name = "hl",
.version = XTABLES_VERSION,
.family = NFPROTO_IPV6,
.size = XT_ALIGN(sizeof(struct ip6t_hl_info)),
.userspacesize = XT_ALIGN(sizeof(struct ip6t_hl_info)),
.help = hl_help,
.parse = hl_parse,
.final_check = hl_check,
.print = hl_print,
.save = hl_save,
.extra_opts = hl_opts,
};
void _init(void)
{
xtables_register_match(&hl_mt6_reg);
}
开发者ID:wertarbyte,项目名称:iptables,代码行数:30,代码来源:libip6t_hl.c
示例2: print_addresses
(rtinfo->invflags & IP6T_RT_INV_LEN) ? "! " : "",
rtinfo->hdrlen);
}
if (rtinfo->flags & IP6T_RT_RES) printf("--rt-0-res ");
if (rtinfo->flags & IP6T_RT_FST) printf("--rt-0-addrs ");
print_addresses(rtinfo->addrnr, (struct in6_addr *)rtinfo->addrs);
if (rtinfo->flags & IP6T_RT_FST_NSTRICT) printf("--rt-0-not-strict ");
}
static struct xtables_match rt_mt6_reg = {
.name = "rt",
.version = XTABLES_VERSION,
.family = NFPROTO_IPV6,
.size = XT_ALIGN(sizeof(struct ip6t_rt)),
.userspacesize = XT_ALIGN(sizeof(struct ip6t_rt)),
.help = rt_help,
.init = rt_init,
.parse = rt_parse,
.print = rt_print,
.save = rt_save,
.extra_opts = rt_opts,
};
void
_init(void)
{
xtables_register_match(&rt_mt6_reg);
}
开发者ID:wfs3006,项目名称:droidwall,代码行数:30,代码来源:libip6t_rt.c
示例3: printf
printf("DSCP set ");
print_dscp(dinfo->dscp, numeric);
}
static void DSCP_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_DSCP_info *dinfo =
(const struct xt_DSCP_info *)target->data;
printf("--set-dscp 0x%02x ", dinfo->dscp);
}
static struct xtables_target dscp_target = {
.family = NFPROTO_UNSPEC,
.name = "DSCP",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_DSCP_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_DSCP_info)),
.help = DSCP_help,
.parse = DSCP_parse,
.final_check = DSCP_check,
.print = DSCP_print,
.save = DSCP_save,
.extra_opts = DSCP_opts,
};
void _init(void)
{
xtables_register_target(&dscp_target);
}
开发者ID:Einheri,项目名称:wl500g,代码行数:30,代码来源:libxt_DSCP.c
示例4: printf
printf(" !");
/* special hack for 'any' case */
if (icmp->type == 0xFF) {
printf(" --icmp-type any");
} else {
printf(" --icmp-type %u", icmp->type);
if (icmp->code[0] != 0 || icmp->code[1] != 0xFF)
printf("/%u", icmp->code[0]);
}
}
static struct xtables_match icmp_mt_reg = {
.name = "icmp",
.version = XTABLES_VERSION,
.family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct ipt_icmp)),
.userspacesize = XT_ALIGN(sizeof(struct ipt_icmp)),
.help = icmp_help,
.init = icmp_init,
.print = icmp_print,
.save = icmp_save,
.x6_parse = icmp_parse,
.x6_options = icmp_opts,
};
void _init(void)
{
xtables_register_match(&icmp_mt_reg);
}
开发者ID:0omega,项目名称:platform_external_iptables,代码行数:30,代码来源:libipt_icmp.c
示例5: printf
!= espinfo->spis[1])
printf("%u:%u",
espinfo->spis[0],
espinfo->spis[1]);
else
printf("%u",
espinfo->spis[0]);
}
}
static struct xtables_match esp_match = {
.family = NFPROTO_UNSPEC,
.name = "esp",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_esp)),
.userspacesize = XT_ALIGN(sizeof(struct xt_esp)),
.help = esp_help,
.init = esp_init,
.parse = esp_parse,
.print = esp_print,
.save = esp_save,
.extra_opts = esp_opts,
};
void
_init(void)
{
xtables_register_match(&esp_match);
}
开发者ID:wertarbyte,项目名称:iptables,代码行数:30,代码来源:libxt_esp.c
示例6: gradm_mt_save
static void gradm_mt_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_gradm_mtinfo *info = (const void *)match->data;
if (info->invflags)
printf(" --disabled ");
else
printf(" --enabled ");
}
static struct xtables_match gradm_mt_reg = {
.family = NFPROTO_UNSPEC,
.name = "gradm",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_gradm_mtinfo)),
.userspacesize = XT_ALIGN(sizeof(struct xt_gradm_mtinfo)),
.help = gradm_mt_help,
.init = gradm_mt_init,
.parse = gradm_mt_parse,
.final_check = gradm_mt_check,
.print = gradm_mt_print,
.save = gradm_mt_save,
.extra_opts = gradm_mt_opts,
};
static __attribute__((constructor)) void gradm_mt_ldr(void)
{
xtables_register_match(&gradm_mt_reg);
}
开发者ID:jfenderico,项目名称:xtables-addons,代码行数:29,代码来源:libxt_gradm.c
示例7: print_flags
unsigned int i;
print_flags("--", info);
for (i = 0; i < info->len; i++) {
print_entry("--", &info->pol[i], false, NFPROTO_IPV6);
if (i + 1 < info->len)
printf("--next ");
}
}
static struct xtables_match policy_mt_reg[] = {
{
.name = "policy",
.version = XTABLES_VERSION,
.family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct xt_policy_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_policy_info)),
.help = policy_help,
.parse = policy4_parse,
.final_check = policy_check,
.print = policy4_print,
.save = policy4_save,
.extra_opts = policy_opts,
},
{
.name = "policy",
.version = XTABLES_VERSION,
.family = NFPROTO_IPV6,
.size = XT_ALIGN(sizeof(struct xt_policy_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_policy_info)),
.help = policy_help,
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-ef_fw-20-20-8,代码行数:31,代码来源:libxt_policy.c
示例8: printf
if (info->bypass)
printf("--queue-bypass ");
}
static void NFQUEUE_init_v1(struct xt_entry_target *t)
{
struct xt_NFQ_info_v1 *tinfo = (void *)t->data;
tinfo->queues_total = 1;
}
static struct xtables_target nfqueue_targets[] = {
{
.family = NFPROTO_UNSPEC,
.name = "NFQUEUE",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_NFQ_info)),
.help = NFQUEUE_help,
.print = NFQUEUE_print,
.save = NFQUEUE_save,
.x6_parse = NFQUEUE_parse,
.x6_options = NFQUEUE_opts
},{
.family = NFPROTO_UNSPEC,
.revision = 1,
.name = "NFQUEUE",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_NFQ_info_v1)),
.userspacesize = XT_ALIGN(sizeof(struct xt_NFQ_info_v1)),
.help = NFQUEUE_help_v1,
.init = NFQUEUE_init_v1,
开发者ID:0omega,项目名称:platform_external_iptables,代码行数:31,代码来源:libxt_NFQUEUE.c
示例9: XT_ALIGN
/* Shared library add-on to iptables to add TRACE target support. */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <getopt.h>
#include <xtables.h>
#include <linux/netfilter/x_tables.h>
static struct xtables_target trace_target = {
.family = NFPROTO_UNSPEC,
.name = "TRACE",
.version = XTABLES_VERSION,
.size = XT_ALIGN(0),
.userspacesize = XT_ALIGN(0),
};
void libxt_TRACE_init(void)
{
xtables_register_target(&trace_target);
}
开发者ID:2856571872,项目名称:droidwall,代码行数:21,代码来源:libxt_TRACE.c
示例10: if
else if (reject->with == IPT_TCP_RESET)
xt_xlate_add(xl, "reject with %s",
reject_table_xlate[i].name);
else
xt_xlate_add(xl, "reject with icmp type %s",
reject_table_xlate[i].name);
return 1;
}
static struct xtables_target reject_tg_reg = {
.name = "REJECT",
.version = XTABLES_VERSION,
.family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct ipt_reject_info)),
.userspacesize = XT_ALIGN(sizeof(struct ipt_reject_info)),
.help = REJECT_help,
.init = REJECT_init,
.print = REJECT_print,
.save = REJECT_save,
.x6_parse = REJECT_parse,
.x6_options = REJECT_opts,
.xlate = REJECT_xlate,
};
void _init(void)
{
xtables_register_target(&reject_tg_reg);
}
开发者ID:MIPS,项目名称:external-iptables,代码行数:30,代码来源:libipt_REJECT.c
示例11: xtables_error
xtables_error(PARAMETER_PROBLEM, "quota: unexpected '!'");
if (!parse_quota(optarg, &info->quota))
xtables_error(PARAMETER_PROBLEM,
"bad quota: '%s'", optarg);
break;
default:
return 0;
}
return 1;
}
static struct xtables_match quota_match = {
.family = NFPROTO_UNSPEC,
.name = "quota",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof (struct xt_quota_info)),
.userspacesize = offsetof(struct xt_quota_info, quota),
.help = quota_help,
.parse = quota_parse,
.print = quota_print,
.save = quota_save,
.extra_opts = quota_opts,
};
void
_init(void)
{
xtables_register_match("a_match);
}
开发者ID:ahnan4arch,项目名称:lvs-snat,代码行数:30,代码来源:libxt_quota.c
示例12: xt_xlate_add
if (info->invert)
op = XT_OP_NEQ;
xt_xlate_add(xl, "mark");
print_mark_xlate(xl, info->mark, info->mask, op);
return 1;
}
static struct xtables_match mark_mt_reg[] = {
{
.family = NFPROTO_UNSPEC,
.name = "mark",
.revision = 0,
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_mark_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_info)),
.help = mark_mt_help,
.print = mark_print,
.save = mark_save,
.x6_parse = mark_parse,
.x6_options = mark_mt_opts,
.xlate = mark_xlate,
},
{
.version = XTABLES_VERSION,
.name = "mark",
.revision = 1,
.family = NFPROTO_UNSPEC,
.size = XT_ALIGN(sizeof(struct xt_mark_mtinfo1)),
.userspacesize = XT_ALIGN(sizeof(struct xt_mark_mtinfo1)),
开发者ID:PKRoma,项目名称:iptables,代码行数:31,代码来源:libxt_mark.c
示例13: nf_log_packet
if (info->bitmask & EBT_LOG_NFLOG)
nf_log_packet(NFPROTO_BRIDGE, par->hooknum, skb, par->in,
par->out, &li, "%s", info->prefix);
else
ebt_log_packet(NFPROTO_BRIDGE, par->hooknum, skb, par->in,
par->out, &li, info->prefix);
return EBT_CONTINUE;
}
static struct xt_target ebt_log_tg_reg __read_mostly = {
.name = "log",
.revision = 0,
.family = NFPROTO_BRIDGE,
.target = ebt_log_tg,
.checkentry = ebt_log_tg_check,
.targetsize = XT_ALIGN(sizeof(struct ebt_log_info)),
.me = THIS_MODULE,
};
static const struct nf_logger ebt_log_logger = {
.name = "ebt_log",
.logfn = &ebt_log_packet,
.me = THIS_MODULE,
};
static int __init ebt_log_init(void)
{
int ret;
ret = xt_register_target(&ebt_log_tg_reg);
if (ret < 0)
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:31,代码来源:ebt_log.c
示例14: printf
if (einfo->flags & XT_DCCP_TYPE) {
printf("--dccp-type ");
print_types(einfo->typemask, einfo->invflags & XT_DCCP_TYPE,0);
}
if (einfo->flags & XT_DCCP_OPTION) {
printf("--dccp-option %s%u ",
einfo->typemask & XT_DCCP_OPTION ? "! " : "",
einfo->option);
}
}
static struct xtables_match dccp_match = {
.name = "dccp",
.family = NFPROTO_UNSPEC,
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_dccp_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_dccp_info)),
.help = dccp_help,
.init = dccp_init,
.parse = dccp_parse,
.print = dccp_print,
.save = dccp_save,
.extra_opts = dccp_opts,
};
void INIT_FUNC(void)
{
xtables_register_match(&dccp_match);
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-ef_fw-20-20-8,代码行数:30,代码来源:libxt_dccp.c
示例15: printf
printf("fill ");
}
static void CHECKSUM_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_CHECKSUM_info *einfo =
(const struct xt_CHECKSUM_info *)target->data;
if (einfo->operation & XT_CHECKSUM_OP_FILL)
printf("--checksum-fill ");
}
static struct xtables_target checksum_tg_reg = {
.name = "CHECKSUM",
.version = XTABLES_VERSION,
.family = NFPROTO_UNSPEC,
.size = XT_ALIGN(sizeof(struct xt_CHECKSUM_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_CHECKSUM_info)),
.help = CHECKSUM_help,
.parse = CHECKSUM_parse,
.final_check = CHECKSUM_check,
.print = CHECKSUM_print,
.save = CHECKSUM_save,
.extra_opts = CHECKSUM_opts,
};
void libxt_CHECKSUM_init(void)
{
xtables_register_target(&checksum_tg_reg);
}
开发者ID:2856571872,项目名称:droidwall,代码行数:30,代码来源:libxt_CHECKSUM.c
示例16: tcpmss_save
static void tcpmss_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_tcpmss_match_info *info = (void *)match->data;
printf("%s--mss ", info->invert ? "! " : "");
if (info->mss_min == info->mss_max)
printf("%u ", info->mss_min);
else
printf("%u:%u ", info->mss_min, info->mss_max);
}
static struct xtables_match tcpmss_match = {
.family = NFPROTO_UNSPEC,
.name = "tcpmss",
.version = XTABLES_VERSION,
.size = XT_ALIGN(sizeof(struct xt_tcpmss_match_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_tcpmss_match_info)),
.help = tcpmss_help,
.parse = tcpmss_parse,
.final_check = tcpmss_check,
.print = tcpmss_print,
.save = tcpmss_save,
.extra_opts = tcpmss_opts,
};
void INIT_FUNC(void)
{
xtables_register_match(&tcpmss_match);
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-ef_fw-20-20-8,代码行数:29,代码来源:libxt_tcpmss.c
示例17: owner_mt_save
static void owner_mt_save(const void *ip, const struct xt_entry_match *match)
{
const struct xt_owner_match_info *info = (void *)match->data;
owner_mt_print_item(info, "--socket-exists", XT_OWNER_SOCKET, true);
owner_mt_print_item(info, "--uid-owner", XT_OWNER_UID, true);
owner_mt_print_item(info, "--gid-owner", XT_OWNER_GID, true);
}
static struct xtables_match owner_mt_reg[] = {
{
.version = XTABLES_VERSION,
.name = "owner",
.revision = 0,
.family = NFPROTO_IPV4,
.size = XT_ALIGN(sizeof(struct ipt_owner_info)),
.userspacesize = XT_ALIGN(sizeof(struct ipt_owner_info)),
.help = owner_mt_help_v0,
.x6_parse = owner_mt_parse_v0,
.x6_fcheck = owner_mt_check,
.print = owner_mt_print_v0,
.save = owner_mt_save_v0,
.x6_options = owner_mt_opts_v0,
},
{
.version = XTABLES_VERSION,
.name = "owner",
.revision = 0,
.family = NFPROTO_IPV6,
.size = XT_ALIGN(sizeof(struct ip6t_owner_info)),
.userspacesize = XT_ALIGN(sizeof(struct ip6t_owner_info)),
开发者ID:0omega,项目名称:platform_external_iptables,代码行数:31,代码来源:libxt_owner.c
示例18: XT_ALIGN
if (tmp < -NUM_STANDARD_TARGETS || tmp >= 0)
return false;
tmp = info->target & ~EBT_VERDICT_BITS;
if (tmp != MARK_SET_VALUE && tmp != MARK_OR_VALUE &&
tmp != MARK_AND_VALUE && tmp != MARK_XOR_VALUE)
return false;
return true;
}
static struct xt_target ebt_mark_tg_reg __read_mostly = {
.name = "mark",
.revision = 0,
.family = NFPROTO_BRIDGE,
.target = ebt_mark_tg,
.checkentry = ebt_mark_tg_check,
.targetsize = XT_ALIGN(sizeof(struct ebt_mark_t_info)),
.me = THIS_MODULE,
};
static int __init ebt_mark_init(void)
{
return xt_register_target(&ebt_mark_tg_reg);
}
static void __exit ebt_mark_fini(void)
{
xt_unregister_target(&ebt_mark_tg_reg);
}
module_init(ebt_mark_init);
module_exit(ebt_mark_fini);
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:31,代码来源:ebt_mark.c
示例19: CONNSECMARK_save
static void
CONNSECMARK_save(const void *ip, const struct xt_entry_target *target)
{
const struct xt_connsecmark_target_info *info =
(struct xt_connsecmark_target_info*)target->data;
printf("--");
print_connsecmark(info);
}
static struct xtables_target connsecmark_target = {
.family = NFPROTO_UNSPEC,
.name = "CONNSECMARK",
.version = XTABLES_VERSION,
.revision = 0,
.size = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)),
.userspacesize = XT_ALIGN(sizeof(struct xt_connsecmark_target_info)),
.parse = CONNSECMARK_parse,
.help = CONNSECMARK_help,
.final_check = CONNSECMARK_check,
.print = CONNSECMARK_print,
.save = CONNSECMARK_save,
.extra_opts = CONNSECMARK_opts,
};
void INIT_FUNC(void)
{
xtables_register_target(&connsecmark_target);
}
开发者ID:jameshilliard,项目名称:actiontec_opensrc_mi424wr-rev-ef_fw-20-20-8,代码行数:29,代码来源:libxt_CONNSECMARK.c
示例20: printf
printf("! ");
print_port_range(info->sport);
}
if (info->bitmask & EBT_IP_DPORT) {
printf("--ip-dport ");
if (info->invflags & EBT_IP_DPORT)
printf("! ");
print_port_range(info->dport);
}
}
static struct xtables_match brip_match = {
.name = "ip",
.revision = 0,
.version = XTABLES_VERSION,
.family = NFPROTO_BRIDGE,
.size = XT_ALIGN(sizeof(struct ebt_ip_info)),
.userspacesize = XT_ALIGN(sizeof(struct ebt_ip_info)),
.init = brip_init,
.help = brip_print_help,
.parse = brip_parse,
.final_check = brip_final_check,
.print = brip_print,
.extra_opts = brip_opts,
};
void _init(void)
{
xtables_register_match(&brip_match);
}
开发者ID:AmVPN,项目名称:iptables,代码行数:30,代码来源:libebt_ip.c
注:本文中的XT_ALIGN函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论