Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
hask committed Nov 20, 2011
1 parent 475238d commit 1bed4b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions txt/netprog.txt
Expand Up @@ -109,6 +109,10 @@ nfq:
has mac-frame upper limit, drop the pack which is too large, i.e. 5k+

pcap:
libpcap在Linux上利用PACKET_SOCKET接口从链路层获取原始套结字数据包。原始套结字可以在用户空间被用来从IP头中获取所有的数据包
当内核的网络堆栈收到一个数据包时,要对其进行一定的校验以便确定是否有packet套结字对它感兴趣。
如果有的话,这个数据包就被分发给对它感兴趣的套结字。如果没有的话,这个数据包继续流向TCP层,UDP层,或者其它的真正目的地。
对于SOCKET_RAW型的套结字也是这样的情形。SOCKET_RAW非常类似于SOCKET_PACKET型的套结字,区别就在于SOCKET_RAW不提供链路层的头信息
can't drop pack, coz just a copy from kernel
only 1 thread, can't use multi
can get src-mac & dst-mac
Expand Down
2 changes: 2 additions & 0 deletions txt/python.txt
Expand Up @@ -3,6 +3,8 @@ http://hgoldfish.mysmth.net/2008/07/09/%E5%BA%94%E7%94%A8python%E7%BC%96%E5%86%9

round 四舍五入

outputs = os.popen(cmd).readlines()/.read()

变量的查找作用域优先级变为:局部、外部、全局和内建。
作用域由def、class、lambda等语句产生,if、try、for等语句并不会产生新的作用域。

Expand Down

0 comments on commit 1bed4b4

Please sign in to comment.