|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
×
关于click: http://pdos.csail.mit.edu/click/
我写了一个简单的测试element(SimplePushElement)
源文件simplepushelement.cc和simplepushelement.hh放在/elements/local(./configure --enable-local)
然后进入click目录
make elemlist
make install
之后写了一个测试文件如下:
// test.click
// This configuration should print this line five times:
// ok: 40 | 45000028 00000000 401177c3 01000001 02000002 13691369
// Run it at user level with
// 'click test.click'
// Run it in the Linux kernel with
// 'click-install test.click'
// Messages are printed to the system log (run 'dmesg' to see them, or look
// in /var/log/messages), and to the file '/click/messages'.
InfiniteSource(DATA \, LIMIT 5, STOP true)
-> Strip(14)
-> Align(4, 0) // in case we're not on x86
-> CheckIPHeader(BADSRC 18.26.4.255 2.255.255.255 1.255.255.255)
-> SimplePushElement
-> Print(ok)
-> Discard;
测试:click test.click
结果SimplePushElement不能被识别,各位用过Click的朋友帮下忙 |
|