- 论坛徽章:
- 0
|
m3yangxiao 发表于 2012-03-29 13:02 ![]()
回复 2# kwest
新版本已经融合到了 xt_DSCP.c 和 xt_dscp.c 里
- MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>");
- MODULE_DESCRIPTION("Xtables: DSCP/TOS field modification");
- MODULE_LICENSE("GPL");
- MODULE_ALIAS("ipt_DSCP");
- MODULE_ALIAS("ip6t_DSCP");
- MODULE_ALIAS("ipt_TOS");
- MODULE_ALIAS("ip6t_TOS");
复制代码 判断和处理的时候其实还是针对 IP 头的 tos 字段
- static unsigned int
- tos_tg(struct sk_buff *skb, const struct xt_action_param *par)
- {
- const struct xt_tos_target_info *info = par->targinfo;
- struct iphdr *iph = ip_hdr(skb);
- u_int8_t orig, nv;
- orig = ipv4_get_dsfield(iph);
- nv = (orig & ~info->tos_mask) ^ info->tos_value;
- if (orig != nv) {
- if (!skb_make_writable(skb, sizeof(struct iphdr)))
- return NF_DROP;
- iph = ip_hdr(skb);
- ipv4_change_dsfield(iph, 0, nv);
- }
- return XT_CONTINUE;
- }
复制代码 |
|