亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
樓主: ShadowStar
打印 上一主題 下一主題

[網(wǎng)絡管理] IPP2P模塊修改版,最新0.99.16 [復制鏈接]

論壇徽章:
0
71 [報告]
發(fā)表于 2007-11-25 19:46 |只看該作者
又出來新的版本了?不錯啊,又要新的一輪測試了!

論壇徽章:
0
72 [報告]
發(fā)表于 2007-11-26 13:43 |只看該作者
樓主,請問怎樣能將drop掉的包再進行分析?就是我想知道是哪個ip地址在使用p2p軟件,能夠?qū)崿F(xiàn)嗎?

論壇徽章:
0
73 [報告]
發(fā)表于 2007-11-26 15:05 |只看該作者
終于編譯通過了

對源代碼進行了修改,現(xiàn)把修改的部分貼上

  1. diff -dru ipp2p-0.99.6-r1/Makefile ipp2p-0.99.6-r1.new/Makefile
  2. --- ipp2p-0.99.6-r1/Makefile    2007-11-23 18:16:57.000000000 +0800
  3. +++ ipp2p-0.99.6-r1.new/Makefile        2007-11-26 13:20:47.000000000 +0800
  4. @@ -2,7 +2,7 @@
  5. obj-m := ipt_ipp2p.o

  6. else
  7. -KERNEL_SRC = /usr/src/linux
  8. +KERNEL_SRC = ../linux-2.6.22.8
  9. #KERNEL_SRC ?= $(firstword $(wildcard /lib/modules/$(shell uname -r)/build /usr/src/linux))
  10. ifeq ($(KERNEL_SRC),)
  11. $(error You need to define KERNEL_SRC)
  12. @@ -28,7 +28,7 @@
  13. ifndef $(IPTABLES_SRC)
  14. IPTVER = \
  15.         $(shell $(IPTABLES_BIN) --version | $(SED) -e 's/^iptables v//')
  16. -IPTABLES_SRC = $(wildcard /usr/src/iptables-$(IPTVER))
  17. +IPTABLES_SRC = $(wildcard ../iptables-$(IPTVER))
  18. #IPTABLES_SRC = /var/tmp/portage/net-firewall/iptables-1.3.8-r1/work/iptables-1.3.8
  19. endif

  20. @@ -46,7 +46,7 @@

  21. IPTABLES_OPTION = -DIPTABLES_VERSION=\"$(IPTABLES_VERSION)\"
  22. CC = gcc
  23. -CFLAGS = -O3 -Wall
  24. +CFLAGS = -O2 -Wall


  25. all: modules libipt_ipp2p.so
  26. diff -dru ipp2p-0.99.6-r1/libipt_ipp2p.c ipp2p-0.99.6-r1.new/libipt_ipp2p.c
  27. --- ipp2p-0.99.6-r1/libipt_ipp2p.c      2007-11-21 14:19:05.000000000 +0800
  28. +++ ipp2p-0.99.6-r1.new/libipt_ipp2p.c  2007-11-26 14:20:15.000000000 +0800
  29. @@ -67,23 +67,24 @@


  30. static void
  31. -init(struct ipt_entry_match *m, unsigned int *nfcache)
  32. +init(struct ipt_entry_match *m)
  33. {
  34.      struct ipt_p2p_info *info = (struct ipt_p2p_info *)m->data;

  35. -    *nfcache |= NFC_UNKNOWN;
  36. +//    *nfcache |= NFC_UNKNOWN;

  37.      /*init the module with default values*/
  38.      info->cmd = 0;
  39.      info->debug = 0;

  40. +    memset(info, 0, sizeof(struct ipt_p2p_info));
  41. +
  42. }

  43. static int
  44. parse(int c, char **argv, int invert, unsigned int *flags,
  45. -       const struct ipt_entry *entry,
  46. -       unsigned int *nfcache,
  47. +       const void *entry,
  48.         struct ipt_entry_match **match)
  49. {
  50.      struct ipt_p2p_info *info = (struct ipt_p2p_info *)(*match)->data;
  51. @@ -341,7 +342,7 @@


  52. static void
  53. -print(const struct ipt_ip *ip,
  54. +print(const void *ip,
  55.          const struct ipt_entry_match *match,
  56.         int numeric)
  57. {
  58. @@ -375,7 +376,7 @@


  59. static void
  60. -save(const struct ipt_ip *ip, const struct ipt_entry_match *match)
  61. +save(const void *ip, const struct ipt_entry_match *match)
  62. {
  63.      struct ipt_p2p_info *info = (struct ipt_p2p_info *)match->data;

復制代碼



配置文件部分的差異可以不考慮,主要是那些函數(shù)定義部分的參數(shù),我是參考set模塊改寫的,現(xiàn)在能夠正常編譯并運行

論壇徽章:
0
74 [報告]
發(fā)表于 2007-11-26 16:43 |只看該作者

回復 #1 ShadowStar 的帖子

內(nèi)核:
2.6.22 源碼 /usr/src/linux-2.6.22
iptables:
1.3.8 源碼 /usr/src/iptables-1.3.8

步驟:
改Makefile
1、KERNEL_SRC= /usr/src/linux-2.6.22
2、IPTABLES_SRC = /usr/src/iptables-1.3.8
3、$(CC) -shared -o libipt_ipp2p.so libipt_ipp2p.o 改為 ld -shared -o libipt_ipp2p.so libipt_ipp2p.o
4、make
5、cp libipt_ipp2p.so /lib/iptables
6、cp ipt_ipp2p.ko /lib/modules/2.6.22/kernel/net/ipv4/netfilter
7、depmod -a
8、service iptables stop
9、rmmod ipt_ipp2p
10、service iptables start

運行iptables -m ipp2p --help
提示
iptables v1.3.8: Couldn't load match `ipp2p'
請問是為什么?需要重啟機器么?

論壇徽章:
0
75 [報告]
發(fā)表于 2007-11-26 17:38 |只看該作者
原帖由 zhy0414 于 2007-11-26 13:43 發(fā)表
樓主,請問怎樣能將drop掉的包再進行分析?就是我想知道是哪個ip地址在使用p2p軟件,能夠?qū)崿F(xiàn)嗎?


可以在mangle表進行LOG

論壇徽章:
0
76 [報告]
發(fā)表于 2007-11-26 17:39 |只看該作者
原帖由 springwind426 于 2007-11-26 15:05 發(fā)表
終于編譯通過了

對源代碼進行了修改,現(xiàn)把修改的部分貼上

diff -dru ipp2p-0.99.6-r1/Makefile ipp2p-0.99.6-r1.new/Makefile
--- ipp2p-0.99.6-r1/Makefile    2007-11-23 18:16:57.000000000 +0800
+ ...


非常感謝

論壇徽章:
0
77 [報告]
發(fā)表于 2007-11-26 17:41 |只看該作者
原帖由 getCookieID 于 2007-11-26 16:43 發(fā)表
內(nèi)核:
2.6.22 源碼 /usr/src/linux-2.6.22
iptables:
1.3.8 源碼 /usr/src/iptables-1.3.8

步驟:
改Makefile
1、KERNEL_SRC= /usr/src/linux-2.6.22
2、IPTABLES_SRC = /usr/src/iptables-1.3.8
3 ...


第3步,對于1.3.8版的iptables,不要修改Makefile中的
  1. $(CC) -shared -o libipt_ipp2p.so libipt_ipp2p.o 改為 ld -shared -o libipt_ipp2p.so libipt_ipp2p.o
復制代碼

論壇徽章:
0
78 [報告]
發(fā)表于 2007-11-26 19:53 |只看該作者

  1.      /*init the module with default values*/
  2.      info->cmd = 0;
  3.      info->debug = 0;

  4. +    memset(info, 0, sizeof(struct ipt_p2p_info));
  5. +
  6. }
復制代碼

這個似乎沒有必要

論壇徽章:
0
79 [報告]
發(fā)表于 2007-11-26 21:40 |只看該作者
原帖由 ShadowStar 于 2007-11-26 17:38 發(fā)表


可以在mangle表進行LOG



mangle表可以給ip包打標記,怎嗎能記錄下來源地址?

論壇徽章:
0
80 [報告]
發(fā)表于 2007-11-26 23:55 |只看該作者
原帖由 zhy0414 于 2007-11-26 21:40 發(fā)表



mangle表可以給ip包打標記,怎嗎能記錄下來源地址?

可以
# iptables -t mangle -I PREROUTING -p udp --dport 53 -j LOG
# tail -4 /var/log/messages
[quote]
Nov 26 23:54:33 PT_LINUX kernel: IN=HOME OUT= PHYSIN=ath0 MAC=00:14:78:71:0f:23:00:1b:77:37:54:10:08:00 SRC=172.17.39.103 DST=202.106.46.151 LEN=57 TOS=0x00 PREC=0x00 TTL=128 ID=48145 PROTO=UDP SPT=4286 DPT=53 LEN=37
Nov 26 23:54:57 PT_LINUX kernel: IN=HOME OUT= PHYSIN=ath0 MAC=00:14:78:71:0f:23:00:1b:77:37:54:10:08:00 SRC=172.17.39.103 DST=202.106.46.151 LEN=70 TOS=0x00 PREC=0x00 TTL=128 ID=48292 PROTO=UDP SPT=4286 DPT=53 LEN=50
Nov 26 23:55:03 PT_LINUX kernel: IN=HOME OUT= PHYSIN=eth1 MAC=00:14:78:71:0f:23:00:0a:e6:a9:64:a2:08:00 SRC=172.17.39.108 DST=202.106.0.20 LEN=59 TOS=0x00 PREC=0x00 TTL=128 ID=11185 PROTO=UDP SPT=1029 DPT=53 LEN=39
Nov 26 23:55:09 PT_LINUX kernel: IN=HOME OUT= PHYSIN=ath0 MAC=00:14:78:71:0f:23:00:1b:77:37:54:10:08:00 SRC=172.17.39.103 DST=202.106.46.151 LEN=80 TOS=0x00 PREC=0x00 TTL=128 ID=48357 PROTO=UDP SPT=4286 DPT=53 LEN=60

[/quote]
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP