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.

81 lines
2.7 KiB

  1. /********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990-2000 **/
  4. /********************************************************************/
  5. /* :ts=4 */
  6. #pragma once
  7. extern CACHE_ALIGN IPSNMPInfo IPSInfo;
  8. extern ICMPStats ICMPInStats;
  9. extern ICMPStats ICMPOutStats;
  10. typedef struct CACHE_ALIGN IPInternalPerCpuStats {
  11. ulong ics_inreceives;
  12. ulong ics_indelivers;
  13. } IPInternalPerCpuStats;
  14. #define IPS_MAX_PROCESSOR_BUCKETS 8
  15. extern IPInternalPerCpuStats IPPerCpuStats[IPS_MAX_PROCESSOR_BUCKETS];
  16. __forceinline
  17. void IPSIncrementInReceiveCount(void)
  18. {
  19. #if !MILLEN
  20. const ulong Index = KeGetCurrentProcessorNumber() % IPS_MAX_PROCESSOR_BUCKETS;
  21. IPPerCpuStats[Index].ics_inreceives++;
  22. #else
  23. IPSInfo.ipsi_inreceives++;
  24. #endif
  25. }
  26. __forceinline
  27. void IPSIncrementInDeliverCount(void)
  28. {
  29. #if !MILLEN
  30. const ulong Index = KeGetCurrentProcessorNumber() % IPS_MAX_PROCESSOR_BUCKETS;
  31. IPPerCpuStats[Index].ics_indelivers++;
  32. #else
  33. IPSInfo.ipsi_indelivers++;
  34. #endif
  35. }
  36. __inline
  37. void IPSGetTotalCounts(IPInternalPerCpuStats* Stats)
  38. {
  39. ulong Index;
  40. const ulong MaxIndex = MIN(KeNumberProcessors, IPS_MAX_PROCESSOR_BUCKETS);
  41. RtlZeroMemory(Stats, sizeof(IPInternalPerCpuStats));
  42. for (Index = 0; Index < MaxIndex; Index++) {
  43. Stats->ics_inreceives += IPPerCpuStats[Index].ics_inreceives;
  44. Stats->ics_indelivers += IPPerCpuStats[Index].ics_indelivers;
  45. }
  46. }
  47. typedef struct RouteEntryContext {
  48. uint rec_index;
  49. struct RouteTableEntry *rec_rte;
  50. } RouteEntryContext;
  51. extern long IPQueryInfo(struct TDIObjectID *ID, PNDIS_BUFFER Buffer,
  52. uint *Size, void *Context);
  53. extern long IPSetInfo(struct TDIObjectID *ID, void *Buffer, uint Size);
  54. extern long IPGetEList(struct TDIEntityID *Buffer, uint *Count);
  55. extern ulong IPSetNdisRequest(IPAddr Addr, NDIS_OID OID, uint On,
  56. uint IfIndex);
  57. extern ulong IPAbsorbRtrAlert(IPAddr Addr, uchar Protocol, uint IfIndex);
  58. extern BOOLEAN IsRtrAlertPacket(IPHeader UNALIGNED *Header);
  59. extern NTSTATUS IPWakeupPattern(uint InterfaceContext,
  60. PNET_PM_WAKEUP_PATTERN_DESC PtrnDesc,
  61. BOOLEAN AddPattern);
  62. extern long IPGetInterfaceFriendlyName(uint InterfaceContext,
  63. PWCHAR Name, uint Size);
  64. extern long IPQuerySetOffload(Interface* IF, IFOffloadCapability* IFOC);