#include <iostream>
#include<stdio.h>
using namespace std;
typedef struct
{
unsigned short Opcode;
unsigned short Subfield;
unsigned short DestProcNum;
unsigned short SenderProcNum;
unsigned short Length;
unsigned char RackNum;
unsigned char SubRackNum;
unsigned char CardId;
unsigned char GuiId; //EMS=0, LCT=1, LCT+EMS=2, might be useful in sending trap and responses destination.
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.
unsigned char MajVersion; // To specify the version of header (structure of header can vary based on version); default value 0. (for future use)
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 */
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 */
unsigned char NeId;
unsigned char Rsrvd1;
unsigned char Rsrvd2;
unsigned char Rsrvd3;
unsigned char Rsrvd4;
unsigned char Rsrvd5;
unsigned short Date;
unsigned short Month;
unsigned short Year;
unsigned short Hour;
unsigned short Minute;
unsigned short Second;
} gCsccMsgHeader;
typedef struct
{
unsigned char mRackNum;
unsigned char mSubRackNum;
unsigned char mCardId;
unsigned char mCardType;
unsigned char mCardSubType;
unsigned char mIntfType;
unsigned char mIntfId;
unsigned char mParamType;
unsigned char mGuiId;
} PmConfigInfo;
/**
* @struct PmLibThreshInfo
* @brief thresholds per interface
*/
typedef struct
{
PmConfigInfo CardIntfInfo;
long long TimeStamp;
unsigned char mParamName[ 38 ] ; //name of parameter
float mParamValue[ 38 ] ; // value of parameter
} PmThreshInfo; //after changing struct to char -- size when MAX_CTRS=40 --> 46+(22×(3+8+36×(1+4)))=4248
/**
* @struct PmLibThreshRes
* @brief response for get thresholds for sync & per card sending
*/
typedef struct
{
gCsccMsgHeader mHdr;
long long mStartTime; //sent by EMS [for sync from this time onwards]
unsigned char mPcktType; //1:start,2:continue,3:end packet
unsigned char mNoOfValidReports; //number of valid reports in array below
PmThreshInfo mThresh[ 22 ] ;
} PmEmsThreshRes,PmEmsThreshTrap;
int main( ) {
// your code goes here
printf ( "size %d" ,sizeof ( PmEmsThreshRes) ) ;
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTxzdGRpby5oPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwp0eXBlZGVmIHN0cnVjdAp7CiAgICAgICAgdW5zaWduZWQgc2hvcnQgT3Bjb2RlOwogICAgICAgIHVuc2lnbmVkIHNob3J0IFN1YmZpZWxkOwogICAgICAgIHVuc2lnbmVkIHNob3J0IERlc3RQcm9jTnVtOwogICAgICAgIHVuc2lnbmVkIHNob3J0IFNlbmRlclByb2NOdW07CiAgICAgICAgdW5zaWduZWQgc2hvcnQgTGVuZ3RoOwogICAgICAgIHVuc2lnbmVkIGNoYXIgUmFja051bTsKICAgICAgICB1bnNpZ25lZCBjaGFyIFN1YlJhY2tOdW07CiAgICAgICAgdW5zaWduZWQgY2hhciBDYXJkSWQ7CiAgICAgICAgdW5zaWduZWQgY2hhciBHdWlJZDsvL0VNUz0wLCBMQ1Q9MSwgTENUK0VNUz0yLCBtaWdodCBiZSB1c2VmdWwgaW4gc2VuZGluZyB0cmFwIGFuZCByZXNwb25zZXMgZGVzdGluYXRpb24uCiAgICAgICAgdW5zaWduZWQgY2hhciBNZXNzYWdlVHlwZTsvLyBSZXNwb25zZSA9IDAsIFNldCA9IDEsIEdldCA9IDIsIFRyYXAgPTMsIGlmIHJlcXVpcmVkIGZvciBkaWZmZXJlbnQgaGFuZGxpbmcgYmFzZWQgb24gbWVzc2FnZS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