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.

76 lines
1.7 KiB

  1. #ifndef PLOG_H
  2. #define PLOG_H
  3. #define PLOG_MAX_CALLS 20
  4. #define PLOG_MAX_PACKETS_CALL 20000
  5. #define PLOG_FILE_AUDIO "C:\\AuPacketLog"
  6. #define PLOG_FILE_VIDEO "C:\\VidPacketLog"
  7. #define PLOG_FILE_EXT ".txt"
  8. // number of packets until the missing packet
  9. // is declared "lost" instead of late
  10. #define PLOG_MAX_NOT_LATE 20
  11. struct CPacketLogEntry
  12. {
  13. DWORD dwSequenceNumber;
  14. DWORD dwTimeStamp;
  15. LARGE_INTEGER LL_ArrivalTime;
  16. DWORD dwSize;
  17. DWORD dwLosses;
  18. bool bLate; // is the packet late ?
  19. bool bMark; // is the M bit set in the RTP packet
  20. };
  21. class CCallLog
  22. {
  23. private:
  24. CPacketLogEntry *m_pLogEntry;
  25. int m_size; // max num of entries this list can hold
  26. int m_currentIndex;
  27. bool m_bValid;
  28. public:
  29. CCallLog(int size=PLOG_MAX_PACKETS_CALL);
  30. ~CCallLog();
  31. bool AddEntry(DWORD dwTimeStamp, DWORD dwSeqNum, LARGE_INTEGER LL_ArrivalTime, DWORD dwSize, bool fMark);
  32. bool Flush(HANDLE hFile);
  33. bool SizeCheck();
  34. CCallLog& operator=(const CCallLog&);
  35. CCallLog(const CCallLog&);
  36. bool PerformStats();
  37. };
  38. // PacketLog maintains a list of CPacketLogEntry's
  39. class CPacketLog
  40. {
  41. private:
  42. HANDLE m_hFile; // handle to disk file where logs are kept
  43. CCallLog *m_pCallLog; // pointer to CCallLog instance
  44. char m_szDiskFile[80]; // base name of the disk file
  45. int m_nExtension; // current file extension index number
  46. bool InitFile();
  47. public :
  48. CPacketLog(LPTSTR szDiskFile);
  49. CPacketLog(const CPacketLog&);
  50. CPacketLog& operator=(const CPacketLog&);
  51. ~CPacketLog();
  52. bool Flush();
  53. bool MarkCallStart();
  54. bool AddEntry(DWORD dwTimeStamp, DWORD dwSeqNum, LARGE_INTEGER LL_ArrivalTime, DWORD dwSize, bool fMark);
  55. };
  56. #endif