drop.awk
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:0k
源码类别:

通讯编程

开发平台:

Visual C++

  1. BEGIN {
  2. fsDrops = 0;
  3. otherDrops = 0;
  4. }
  5. ($2 >= startTime && $2 <= endTime) {
  6. op = $1;
  7. time = $2;
  8. src = $9;
  9. dst = $10;
  10. if (match(src,"^0.") && $1 == "+") {
  11. numFs++;
  12. }
  13. if (numFs > 0 && op == "d") {
  14. if (match(src,"^0."))
  15. fsDrops++;
  16. else
  17. otherDrops++;
  18. }
  19. if (match(src,"^0.") && ($1 == "-" || $1 == "d"))
  20. numFs--;
  21. }
  22. END {
  23. print otherDrops, fsDrops;
  24. }