HowItWorks.txt 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. HOWITWORKS - Monkey >= 0.5.x
  2. ============================
  3. Date : 20 Sept 2002
  4. Last Update : Initial version
  5. Note: I don't write or speak english very well :P .
  6. Here i hope to explain how monkey works. This isn't a set design, this
  7. design has been changing with time and will continue to change :) .
  8. Sections
  9. --------
  10. 1) Starting and setting
  11. 2) Accepting and processing new connections
  12. 3) comming soon...
  13. 1) Starting and setting
  14. -----------------------
  15. In this section i will explain what monkey does at the beginning.
  16. Starting monkey ->|
  17. |
  18. +----------------------+ <- file: monkey.c
  19. + Reading options + func: main();
  20. + from command line +
  21. +----------------------+
  22. |
  23. +----------------------+ <- file: monkey.c, config.c
  24. + Reading config files + func: main();
  25. +----------------------+ |->Monkey_Read_Config();
  26. |
  27. |
  28. +----------------------+ <- file: monkey.c, signals.c
  29. + Starting signals + func: main();
  30. +----------------------+ |->Init_Signals();
  31. |
  32. |
  33. +----------------------+ <- file: monkey.c
  34. + Setting socket + func: main();
  35. +----------------------+
  36. |
  37. +----------------------+ <- file: monkey.c
  38. + Setting threads + func: main();
  39. + properties +
  40. +----------------------+
  41. |
  42. +----------------------+ <- file: monkey.c, utils.c
  43. + Changing mode to + func: main();
  44. + daemon if it was + |->set_daemon();
  45. + specicated +
  46. +----------------------+
  47. |
  48. +----------------------+ <- file: monkey.c, logfile.c
  49. + Register PID + func: main();
  50. + of process + |->add_log_pid();
  51. +----------------------+
  52. |
  53. +----------------------+ <- file: monkey.c
  54. + Starting main loop + func: main();
  55. + and waiting for +
  56. + new connections +
  57. +----------------------+
  58. 2) Accepting and processing new connections
  59. ------------------------------------------
  60. When a new connection comes, monkey follows the next steps.
  61. +----------------------+ <- file: monkey.c, deny.c
  62. + Checking IP from + func: main();
  63. + remote machine to + |->Deny_Check();
  64. + know if this is +
  65. + not blocked in our +
  66. + monkey.deny file +
  67. +----------------------+
  68. |
  69. +----------------------+ <- file: monkeu.c
  70. + Checking how many + func: main();
  71. + request are being +
  72. + processed by monkey +
  73. +----------------------+
  74. |
  75. +----------------------+ <- file: monkey.c
  76. + Passing connection + func: main();
  77. + to a new thread + |->thread_init();
  78. +----------------------+
  79. |
  80. +----------------------+ <- file: monkey.c, request.c
  81. + Reciving request + func: thread_init();
  82. + and processing + |->Request_Main();
  83. +----------------------+