fork download
  1. #include <iostream>
  2. #include<stdio.h>
  3. using namespace std;
  4. typedef struct
  5. {
  6. unsigned short Opcode;
  7. unsigned short Subfield;
  8. unsigned short DestProcNum;
  9. unsigned short SenderProcNum;
  10. unsigned short Length;
  11. unsigned char RackNum;
  12. unsigned char SubRackNum;
  13. unsigned char CardId;
  14. unsigned char GuiId;//EMS=0, LCT=1, LCT+EMS=2, might be useful in sending trap and responses destination.
  15. unsigned char MessageType;// Response = 0, Set = 1, Get = 2, Trap =3, if required for different handling based on message type as it was earlier identified that message will be sent to TPN/TPC in case of SET but only to CSCC in case of GET.
  16. unsigned char MajVersion;// To specify the version of header (structure of header can vary based on version); default value 0. (for future use)
  17. unsigned char CardType;//DWDM_TPN = 1,DWDM_TPC = 2,DWDM_CSCC = 3,DWDM_WSS= 4,DWDM_AMP = 5/* DWDM Amplifier Card */,DWDM_PROT = 6/* DWDM Protection Card */,DWDM_OCM = 7/* DWDM OCM Card */,DWDM_SUP = 8/* DWDM Supervisory Card */,DWDM_VOIP = 9/* DWDM VOIP Card */
  18. unsigned char CardSubType;// For TPN --> TPN_CGM_PMCS = 1/* TPN - 100G MUXPONDER by PMC Sierra */,TPN_XLGM_AMCC = 2/* TPN - 40G MUXPONDER by AMCC */, TPN_XLGM_CORTINA = 3/* TPN - 40G MUXPONDER by CORTINA */
  19. unsigned char NeId;
  20. unsigned char Rsrvd1;
  21. unsigned char Rsrvd2;
  22. unsigned char Rsrvd3;
  23. unsigned char Rsrvd4;
  24. unsigned char Rsrvd5;
  25. unsigned short Date;
  26. unsigned short Month;
  27. unsigned short Year;
  28. unsigned short Hour;
  29. unsigned short Minute;
  30. unsigned short Second;
  31. } gCsccMsgHeader;
  32.  
  33. typedef struct
  34. {
  35. unsigned char mRackNum;
  36. unsigned char mSubRackNum;
  37. unsigned char mCardId;
  38. unsigned char mCardType;
  39. unsigned char mCardSubType;
  40. unsigned char mIntfType;
  41. unsigned char mIntfId;
  42. unsigned char mParamType;
  43. unsigned char mGuiId;
  44. }PmConfigInfo;
  45. /**
  46.  * @struct PmLibThreshInfo
  47.  * @brief thresholds per interface
  48. */
  49. typedef struct
  50. {
  51. PmConfigInfo CardIntfInfo;
  52. long long TimeStamp;
  53. unsigned char mParamName[38]; //name of parameter
  54. float mParamValue[38]; // value of parameter
  55. }PmThreshInfo;//after changing struct to char -- size when MAX_CTRS=40 --> 46+(22×(3+8+36×(1+4)))=4248
  56.  
  57. /**
  58.  * @struct PmLibThreshRes
  59.  * @brief response for get thresholds for sync & per card sending
  60. */
  61. typedef struct
  62. {
  63. gCsccMsgHeader mHdr;
  64. long long mStartTime;//sent by EMS [for sync from this time onwards]
  65. unsigned char mPcktType;//1:start,2:continue,3:end packet
  66. unsigned char mNoOfValidReports;//number of valid reports in array below
  67. PmThreshInfo mThresh[22];
  68. }PmEmsThreshRes,PmEmsThreshTrap;
  69. int main() {
  70. // your code goes here
  71.  
  72. printf("size %d",sizeof(PmEmsThreshRes));
  73.  
  74.  
  75. return 0;
  76. }
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
size 4808