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.

87 lines
3.4 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // CounterMap.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // This file describes the mapping of IAS Events to InfoBase counters.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 09/09/1997 Original version.
  16. // 09/08/1997 Conform to latest rev. of ietf draft.
  17. // 04/23/1999 Include iasevent.h
  18. //
  19. ///////////////////////////////////////////////////////////////////////////////
  20. #ifndef _COUNTERMAP_H_
  21. #define _COUNTERMAP_H_
  22. #include <iasradius.h>
  23. //////////
  24. // Enum for representing the type of counter to be incremented.
  25. //////////
  26. enum RadiusCounterType
  27. {
  28. SERVER_COUNTER,
  29. CLIENT_COUNTER
  30. };
  31. //////////
  32. // Struct used for mapping an event (category, ID) tuple to a counter.
  33. //////////
  34. struct RadiusCounterMap
  35. {
  36. long event;
  37. union
  38. {
  39. RadiusClientCounter clientCounter;
  40. RadiusServerCounter serverCounter;
  41. };
  42. RadiusCounterType type;
  43. };
  44. //////////
  45. // Array defining all events that will increment counters.
  46. //////////
  47. static RadiusCounterMap theCounterMap[] =
  48. {
  49. {IAS_EVENT_RADIUS_AUTH_ACCESS_REQUEST, radiusAuthServAccessRequests, CLIENT_COUNTER},
  50. {IAS_EVENT_RADIUS_AUTH_DUP_ACCESS_REQUEST, radiusAuthServDupAccessRequests, CLIENT_COUNTER},
  51. {IAS_EVENT_RADIUS_AUTH_ACCESS_ACCEPT, radiusAuthServAccessAccepts, CLIENT_COUNTER},
  52. {IAS_EVENT_RADIUS_AUTH_ACCESS_REJECT, radiusAuthServAccessRejects, CLIENT_COUNTER},
  53. {IAS_EVENT_RADIUS_AUTH_ACCESS_CHALLENGE, radiusAuthServAccessChallenges, CLIENT_COUNTER},
  54. {IAS_EVENT_RADIUS_AUTH_MALFORMED_PACKET, radiusAuthServMalformedAccessRequests, CLIENT_COUNTER},
  55. {IAS_EVENT_RADIUS_AUTH_BAD_AUTHENTICATOR, radiusAuthServBadAuthenticators, CLIENT_COUNTER},
  56. {IAS_EVENT_RADIUS_AUTH_DROPPED_PACKET, radiusAuthServPacketsDropped, CLIENT_COUNTER},
  57. {IAS_EVENT_RADIUS_AUTH_UNKNOWN_TYPE, radiusAuthServUnknownType, CLIENT_COUNTER},
  58. {IAS_EVENT_RADIUS_ACCT_DROPPED_PACKET, radiusAccServPacketsDropped, CLIENT_COUNTER},
  59. {IAS_EVENT_RADIUS_ACCT_REQUEST, radiusAccServRequests, CLIENT_COUNTER},
  60. {IAS_EVENT_RADIUS_ACCT_DUP_REQUEST, radiusAccServDupRequests, CLIENT_COUNTER},
  61. {IAS_EVENT_RADIUS_ACCT_RESPONSE, radiusAccServResponses, CLIENT_COUNTER},
  62. {IAS_EVENT_RADIUS_ACCT_BAD_AUTHENTICATOR, radiusAccServBadAuthenticators, CLIENT_COUNTER},
  63. {IAS_EVENT_RADIUS_ACCT_MALFORMED_PACKET, radiusAccServMalformedRequests, CLIENT_COUNTER},
  64. {IAS_EVENT_RADIUS_ACCT_NO_RECORD, radiusAccServNoRecord, CLIENT_COUNTER},
  65. {IAS_EVENT_RADIUS_ACCT_UNKNOWN_TYPE, radiusAccServUnknownType, CLIENT_COUNTER},
  66. {IAS_EVENT_RADIUS_AUTH_INVALID_CLIENT, (RadiusClientCounter)radiusAuthServTotalInvalidRequests, SERVER_COUNTER},
  67. {IAS_EVENT_RADIUS_ACCT_INVALID_CLIENT, (RadiusClientCounter)radiusAccServTotalInvalidRequests, SERVER_COUNTER}
  68. };
  69. //////////
  70. // Comparsion function used for sorting and searching the counter map.
  71. //////////
  72. int __cdecl counterMapCompare(const void* elem1, const void* elem2)
  73. {
  74. return (int)(*((long*)elem1) - *((long*)elem2));
  75. }
  76. #endif // _COUNTERMAP_H_