Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
5.1 KiB

  1. #if (0)
  2. //------------------------------------------------------------------------------
  3. // Abbreviations:
  4. //------------------------------------------------------------------------------
  5. abbr: struct type description
  6. pite: PIF_TABLE_ENTRY: pointer to interface table entry
  7. pge: PGROUP_TABLE_ENTRY: pointer to group entry in group table.
  8. GI_entry: the group entry for an interface.
  9. pgie: PGI_ENTRY: pointer to group entry for an interface. It
  10. hangs from both pite and pge lists.
  11. ppge: PPROXY_GROUP_ENTRY: pointer to group joined on proxy interface.
  12. Hangs from pite & also listed in proxy hash table
  13. ptg: pointer to timer global.
  14. DCS: Dynamic critical section lock
  15. DRW: Dynamic read-write lock
  16. IF: Interface
  17. groups-if list list of all gi entries accessed through the
  18. ordered group list.
  19. if-groups list list of all gi entries accessed through the
  20. ordered interface list.
  21. //------------------------------------------------------------------------------
  22. // Optimizations that can be done:
  23. //------------------------------------------------------------------------------
  24. 1. Dynamically change the size of the interface, group, & proxy hash tables
  25. 2. Release InterfaceList locks early in AddInterface, DeleteInterface, etc.
  26. (in that case you have to set a flag saying being initialized, so that that
  27. interface is not enumerated)
  28. //------------------------------------------------------------------------------
  29. // Order of Locking:
  30. //------------------------------------------------------------------------------
  31. sockets-list CSLock protects the list of socket-event binding entries.
  32. (many sockets, ie igmprtr interfaces are bound to
  33. the same wait-event entry).
  34. Take write lock when the interface is being created,
  35. deleted, activated or protocol change.
  36. Take read lock when the input packet is being
  37. processed.
  38. IF-list CSLock protects the ordered interface list
  39. g_pIfTable->IFLists_CS
  40. IF-bucket DRWLock protects the interface entry.
  41. actually one lock for each interface hash bucket.
  42. A write lock is required when an interface is
  43. created, deleted, activated or its config is changed.
  44. g_pIfTable->[IFbucket].DRWLock
  45. Group-bucket DCSLock protects the group entry.
  46. actually one lock for each group hash bucket.
  47. Need this lock whenever accessing a group through
  48. group hash table, or when adding/removing a GIentry
  49. from a group list.
  50. g_pGroupTable->[groupBucket].DCSLock
  51. IF-groups-list DCSLock protects the list of gi_entries hanging from that IF.
  52. actually one lock for each interface hash bucket.
  53. can access/change a GI entry without this lock.
  54. however, this lock is required when a gi entry is
  55. created or delete.
  56. g_pIfTable->[IFbucket].DCSLock
  57. Group-list CSLock protects the list of ordered groups.
  58. Global lock CSLock protects
  59. g_CS
  60. Note: a problem arises when enumerating the groups-if list. I first take the
  61. group-list lock, find the next group entry, release the group-list lock,
  62. and then lock the group-bucket and access its fields.
  63. //------------------------------------------------------------------------------
  64. // Configuration
  65. //------------------------------------------------------------------------------
  66. 1. Proxy cannot be configured on a RasServer interface, ie interface of type
  67. LOCAL_WORKSTATION_DIAL.
  68. 2. When IgmpRouter is configured on a RasServer interface(LOCAL_WORKSTATION_DIAL)
  69. no igmp Group Specific packets are sent in response to leave packets. This
  70. is based on the fact that there is only one ras-client on the other end.
  71. 3. When igmp router is configured on an interface, it sends StartupQueryCount
  72. General queries on that inteface spaced at StartupQueryInterval. The next
  73. General query timer is set to random value in [0,GenQueryInterval]. This is
  74. so that when 'N' interfaces are configured with igmp router at startup,
  75. all of them do not send General Queries at the same time (my own feeble
  76. attempt to avoid synchronization of General Queries on different interfaces
  77. of a router).
  78. #endif // if (0)