CgTypes::CgTypes(const CgComponent& state) : CgComponent(state), mBasicTypes(kIRNumTypeKinds, NULL) { // These types must agree with the shadeops in lib/ops/Ops.cpp. llvm::Type* floatTy = llvm::Type::getFloatTy(*GetContext()); mBasicTypes[kIRFloatTy] = floatTy; mBasicTypes[kIRBoolTy] = llvm::Type::getInt32Ty(*GetContext()); mBasicTypes[kIRVoidTy] = llvm::Type::getVoidTy(*GetContext()); // A triple is a struct containing a float[3] array. llvm::Type* tripleTy = GetClassType("OpVec3"); mBasicTypes[kIRPointTy] = tripleTy; mBasicTypes[kIRVectorTy] = tripleTy; mBasicTypes[kIRNormalTy] = tripleTy; mBasicTypes[kIRColorTy] = tripleTy; // A matrix is a struct containing an array of four 4-vectors. mBasicTypes[kIRMatrixTy] = GetClassType("OpMatrix4"); mBasicTypes[kIRStringTy] = llvm::PointerType::get(llvm::Type::getInt8Ty(*GetContext()), kDefaultAddressSpace); mBasicTypes[kIRShaderTy] = // LLVM requires the use of i8* instead of void*. llvm::PointerType::get(llvm::Type::getInt8Ty(*GetContext()), kDefaultAddressSpace); }
bool Iop::BuildYourselfFromPtsRow( void *pRow_ ){ IOPStatusRecord *pRow = (IOPStatusRecord *)pRow_; UnicodeString s; MicroController *pMicroController; LocalizedDateTime timestamp; m_id = DesignatorId( pRow->rid, (U16)GetClassType(), 0 ); m_slotNumber = pRow->Slot; SetYourSlotName(); m_redundantSlotNumber = pRow->RedundantSlot; m_internalState = pRow->eIOPCurrentState; m_manufacturer = UnicodeString( (StringClass)pRow->Manufacturer ); m_hardwareVersion = UnicodeString( (StringClass)pRow->ulHwRevision ); m_serialNumber = UnicodeString( (StringClass)pRow->SerialNumber ); // populate asset info m_assetInfo.ClearInfo(); timestamp = pRow->ulHwMfgDate * 1000; m_assetInfo.SetProductionDate( timestamp ); m_assetInfo.SetSerialNumber( m_serialNumber ); m_assetInfo.SetVersionNumber( m_hardwareVersion ); RemoveMicroControllers(); pMicroController = new MicroController( CTS_SSAPI_AVR_NAME, StringClass(pRow->ulAvrSwVersion), StringClass(pRow->ulAvrSwRevision) ); m_microControllerVector.Add( (CONTAINER_ELEMENT)pMicroController ); return OK; }
void ProcessRaidUtility::BuildYourselfFromPtsRow( RAID_ARRAY_UTILITY *pRow ) { m_id = DesignatorId( pRow->thisRID, (U16)GetClassType() ); m_priority = pRow->priority; m_state = pRow->status; m_percentComplete = pRow->percentComplete; }
void SoftwareDescriptor::BuildYourselfFromImageObject( Image &image ){ m_majorVersion = image.GetMajorVersion(); m_minorVersion = image.GetMinorVersion(); m_referenceCount = image.GetIopCount(); m_isDefault = image.IsDefault()? true : false; image.GetTimeCreated( &m_loadedOn ); m_id = DesignatorId( (RowId &)image.GetKey(), GetClassType() ); }
bool Resource::Load() { m_iRefCount++; if ( m_bReady ) { return false; } if ( GetClassType() != Base::Mesh_Terrain ) { if ( m_szPathName == L"" ) { return false; } char szFile[256]; wcstombs( szFile, m_szPathName.c_str(), 256 ); FILE * pFile = fopen( szFile, "rb" ); if ( pFile == NULL ) { return false; } DWORD dwSize = _filelength( _fileno( pFile ) ); m_kFileBuffer.Create( dwSize ); fread( m_kFileBuffer.GetPointer(), sizeof(char), dwSize, pFile ); } if ( ! Create() ) { return false; } if ( ! Cache() ) { return false; } m_bReady = true; return true; }
bool User::BuildYourselfFromPtsRow( UserAccessTableEntry *pRow ){ m_userName = UnicodeString( (char *)&pRow->userName ); m_password = UnicodeString( (char *)&pRow->password ); m_firstName = UnicodeString( (char *)&pRow->firstName ); m_lastName = UnicodeString( (char *)&pRow->lastName ); m_description = UnicodeString( (char *)&pRow->description ); m_email = UnicodeString( (char *)&pRow->email ); m_phoneNumber1 = UnicodeString( (char *)&pRow->phoneNumber1 ); m_phoneNumber2 = UnicodeString( (char *)&pRow->phoneNumber2 ); m_department = UnicodeString( (char *)&pRow->department ); m_id = DesignatorId( RowId(pRow->rid), (U16)GetClassType() ); m_language = pRow->language; m_securityPolicy= pRow->securityPolicy; m_numberOfInvalidLogins = pRow->numberOfInvalidLogins; return true; }
int OpAcidDb_Log(void *context, void *data) { char timestamp[TIMEBUF_SIZE]; Sid *sid = NULL; ClassType *class_type; UnifiedLogRecord *record = (UnifiedLogRecord *)data; OpAcidDb_Data *op_data = (OpAcidDb_Data *)context; u_int32_t acid_sig_id; Packet p; #if 0 /* this is broken */ /* skip tagged packets, since the db does not have a mechanism to * deal with them properly */ if(record->log.event.event_reference) { LogMessage("Skipping tagged packet %i\n", record->log.event.event_reference); return 0; } #endif RenderTimestamp(record->log.pkth.ts.tv_sec, timestamp, TIMEBUF_SIZE); sid = GetSid(record->log.event.sig_generator, record->log.event.sig_id); if(sid == NULL) sid = FakeSid(record->log.event.sig_generator, record->log.event.sig_id); class_type = GetClassType(record->log.event.classification); if((acid_sig_id = AcidDbGetSigId(op_data, sid, class_type, record->log.event.priority)) == 0) { FatalError("op_acid_db: Failed to retrieve ACID DB sig id\n"); } /* Insert data into the event table */ if(snprintf(sql_buffer, MAX_QUERY_SIZE, "INSERT INTO event(sid, cid, signature, timestamp) " "VALUES('%u', '%u', '%u', '%s')", op_data->sensor_id, op_data->event_id, acid_sig_id, timestamp) < MAX_QUERY_SIZE) { //LogMessage("SQL: %s\n", sql_buffer); Insert(op_data, sql_buffer, NULL); /* XXX: Error checking */ } /* decode the packet */ if(DecodePacket(&p, &record->log.pkth, record->pkt + 2) == 0) { if(p.iph) { /* Insert ip header information */ InsertIPData(op_data, &p); /* store layer 4 data for non fragmented packets */ if(!(p.pkt_flags & PKT_FRAG_FLAG)) { switch(p.iph->ip_proto) { case IPPROTO_ICMP: InsertICMPData(op_data, &p); break; case IPPROTO_TCP: InsertTCPData(op_data, &p); break; case IPPROTO_UDP: InsertUDPData(op_data, &p); break; } } /* Insert payload data */ if(op_data->detail) InsertPayloadData(op_data, &p); } } ++op_data->event_id; return 0; }
int OpAcidDb_Alert(void *context, void *data) { char timestamp[TIMEBUF_SIZE]; Sid *sid = NULL; ClassType *class_type = NULL; UnifiedAlertRecord *record = (UnifiedAlertRecord *)data; OpAcidDb_Data *op_data = (OpAcidDb_Data *)context; u_int32_t acid_sig_id; RenderTimestamp(record->ts.tv_sec, timestamp, TIMEBUF_SIZE); sid = GetSid(record->event.sig_generator, record->event.sig_id); if(sid == NULL) sid = FakeSid(record->event.sig_generator, record->event.sig_id); if(!(class_type = GetClassType(record->event.classification)) && record->event.classification != 0) { LogMessage("WARNING: No ClassType found for classification '%i'\n", record->event.classification); } if((acid_sig_id = AcidDbGetSigId(op_data, sid, class_type, record->event.priority)) == 0) { FatalError("op_acid_db: Failed to retrieve ACID DB sig id\n"); } /* Insert data into the event table */ if(snprintf(sql_buffer, MAX_QUERY_SIZE, "INSERT INTO event(sid, cid, signature, timestamp) " "VALUES('%u', '%u', '%u', '%s')", op_data->sensor_id, op_data->event_id, acid_sig_id, timestamp) < MAX_QUERY_SIZE) { //LogMessage("SQL: %s\n", sql_buffer); Insert(op_data, sql_buffer, NULL); /* XXX: Error checking */ } /* insert data into the ip header table */ if(snprintf(sql_buffer, MAX_QUERY_SIZE, "INSERT INTO iphdr(sid, cid, ip_src, ip_dst, ip_proto) " "VALUES('%u', '%u', '%u', '%u', '%u')", op_data->sensor_id, op_data->event_id, record->sip, record->dip, record->protocol) < MAX_QUERY_SIZE) { Insert(op_data, sql_buffer, NULL); /* XXX: Error checking */ } /* build the protocol specific header information */ switch(record->protocol) { case IPPROTO_TCP: if(snprintf(sql_buffer, MAX_QUERY_SIZE, "INSERT INTO tcphdr (sid, cid, tcp_sport, tcp_dport, " "tcp_flags) VALUES('%u', '%u', '%u', '%u', 0)", op_data->sensor_id, op_data->event_id, record->sp, record->dp) < MAX_QUERY_SIZE) { Insert(op_data, sql_buffer, NULL); /* XXX: Error checking */ } break; case IPPROTO_UDP: if(snprintf(sql_buffer, MAX_QUERY_SIZE, "INSERT INTO udphdr (sid, cid, udp_sport, udp_dport) " "VALUES('%u', '%u', '%u', '%u')", op_data->sensor_id, op_data->event_id, record->sp, record->dp) < MAX_QUERY_SIZE) { Insert(op_data, sql_buffer, NULL); /* XXX: Error checking */ } break; case IPPROTO_ICMP: if(snprintf(sql_buffer, MAX_QUERY_SIZE, "INSERT INTO icmphdr (sid, cid, icmp_type, icmp_code) " "VALUES('%u', '%u', '%u', '%u')", op_data->sensor_id, op_data->event_id, record->sp, record->dp) < MAX_QUERY_SIZE) { Insert(op_data, sql_buffer, NULL); /* XXX: Error Checking */ } break; } ++op_data->event_id; return 0; }
/* output function */ static int OpAlertSyslog2(void *context, void *data) { UnifiedAlertRecord *record; OpAlertSyslog2_Data *op_data; struct tm *tm; char src[16]; char dest[16]; ClassType *class_type = NULL; Sid *sid = NULL; int length; int rval; if(!data || !context) return -1; record = (UnifiedAlertRecord *)data; op_data = (OpAlertSyslog2_Data *)context; sid = GetSid(record->event.sig_generator, record->event.sig_id); class_type = GetClassType(record->event.classification); /* convert alert timestamp to struct tm using gmtime */ if(pv.localtime) tm = localtime(&record->ts.tv_sec); else tm = gmtime(&record->ts.tv_sec); memcpy(op_data->message_buffer + op_data->month_offset, month_values[tm->tm_mon], MONTH_LENGTH); strftime(op_data->message_buffer + op_data->timestamp_offset, TIMESTAMP_LENGTH + 1, "%e %H:%M:%S", tm); op_data->message_buffer[op_data->timestamp_offset + TIMESTAMP_LENGTH] = ' '; snprintf(src, 16, "%u.%u.%u.%u", (record->sip & 0xff000000) >> 24, (record->sip & 0x00ff0000) >> 16, (record->sip & 0x0000ff00) >> 8, record->sip & 0x000000ff); snprintf(dest, 16, "%u.%u.%u.%u", (record->dip & 0xff000000) >> 24, (record->dip & 0x00ff0000) >> 16, (record->dip & 0x0000ff00) >> 8, record->dip & 0x000000ff); switch(record->protocol) { case IPPROTO_TCP: case IPPROTO_UDP: length = snprintf(op_data->message_buffer + op_data->header_length, MESSAGE_LENGTH - op_data->header_length, "[%d:%d:%d] %s [Classification: %s] " "[Priority: %d] {%s} %s:%d -> %s:%d", record->event.sig_generator, record->event.sig_id, record->event.sig_rev, sid != NULL ? sid->msg : "ALERT", class_type != NULL ? class_type->name : "Unknown", record->event.priority, protocol_names[record->protocol], src, record->sp, dest, record->dp); break; case IPPROTO_ICMP: length = snprintf(op_data->message_buffer + op_data->header_length, MESSAGE_LENGTH - op_data->header_length, "[%d:%d:%d] %s [Classification: %s] " "[Priority: %d] {%s} %s -> %s", record->event.sig_generator, record->event.sig_id, record->event.sig_rev, sid != NULL ? sid->msg : "ALERT", class_type != NULL ? class_type->name : "Unknown", record->event.priority, protocol_names[record->protocol], src, dest); break; default: length = snprintf(op_data->message_buffer + op_data->header_length, MESSAGE_LENGTH - op_data->header_length, "[%d:%d:%d] %s [Classification: %s] " "[Priority: %d] {%s} %s -> %s", record->event.sig_generator, record->event.sig_id, record->event.sig_rev, sid != NULL ? sid->msg : "ALERT", class_type != NULL ? class_type->name : "Unknown", record->event.priority, protocol_names[record->protocol], src, dest); break; } if((rval = sendto(op_data->socket, op_data->message_buffer, op_data->header_length + length, 0, (struct sockaddr *)&op_data->sin, sizeof(op_data->sin))) == -1) LogMessage("%s: sendto error %u: %s\n", errno, strerror(errno)); return 0; }
int CEntityMng::ParseEntityToken( worldentity_t *entity , char *token ) { char parameter[10][32]; char param[32]; strcpy( param , token ); int numParms = 0; while( 1 ) { token = m_script->GetNextToken( false ); if( !token[ 0 ] ) break; strcpy( parameter[ numParms ] , token ); numParms++; } if ( !stricmp( param , "classname" ) ) { if( numParms < 1 ) return false; entity->classType = GetClassType( parameter[0] ); if( entity->classType == GTH_WORLD_ENTITY_TYPE_NONE ) return false; } else if( !stricmp( param , "itemname" ) ) { if( numParms < 1 ) return false; strcpy( entity->itemName , parameter[0] ); } else if( !stricmp( param , "origin" ) ) { if( numParms < 3 ) return false; entity->origin[0] = (float) atof( parameter[0] ); entity->origin[1] = (float) atof( parameter[1] ); entity->origin[2] = (float) atof( parameter[2] ); } else if( !stricmp( param , "angle" ) ) { if( numParms < 1 ) return false; entity->angles[YAW] = (float) atof( parameter[0] ); } else if( !stricmp( param , "angles" ) ) { if( numParms < 3 ) return false; entity->angles[PITCH] = (float) atof( parameter[0] ); entity->angles[YAW] = (float) atof( parameter[1] ); entity->angles[ROLL] = (float) atof( parameter[2] ); } else if( !stricmp( param , "spawnflags" ) ) { if( numParms < 1 ) return false; entity->spawnflags = atoi( parameter[0] ); } else if( !stricmp( param , "effectivedist" ) ) { if( numParms < 1 ) return false; entity->effectiveDist = (float) atof( parameter[0] ); } else if( !stricmp( param , "target" ) ) { if( numParms < 1 ) return false; entity->target = GetNewString( parameter[0] ); } else if( !stricmp( param , "targetname" ) ) { if( numParms < 1 ) return false; entity->targetName = GetNewString( parameter[0] ); } else if( !stricmp( param , "message" ) ) { if( numParms < 1 ) return false; entity->message = GetNewString( parameter[0] ); } else if( !stricmp( param , "sound" ) ) { if( numParms < 1 ) return false; entity->sound = GetNewString( parameter[0] ); entity->soundIdx = GetGameSampleID ( entity->sound ); } else if( !stricmp( param , "sound_range_x" ) ) { if( numParms < 1 ) return false; entity->soundRangeX = (float) atof( parameter[0] ); } else if( !stricmp( param , "sound_range_y" ) ) { if( numParms < 1 ) return false; entity->soundRangeY = (float) atof( parameter[0] ); } else if( !stricmp( param , "speed" ) ) { if( numParms < 1 ) return false; entity->speed = (float) atof( parameter[0] ); } else if( !stricmp( param , "wait" ) ) { if( numParms < 1 ) return false; entity->wait = (float) atof( parameter[0] ); } else if( !stricmp( param , "spawnid" ) ) { if( numParms < 1 ) return false; entity->spawnid = atoi( parameter[0] ); } return true; }
/* sguil only uses log */ int OpSguil_Log(void *context, void *data) { char timestamp[TIMEBUF_SIZE]; char syslogMessage[SYSLOG_BUF]; char eventInfo[SYSLOG_BUF]; //int MAX_INSERT_LEN = 1024; char insertColumns[MAX_QUERY_SIZE]; char insertValues[MAX_QUERY_SIZE]; char valuesTemp[MAX_QUERY_SIZE]; char ipInfo[38]; char portInfo[16]; char *esc_message; Sid *sid = NULL; ClassType *class_type; UnifiedLogRecord *record = (UnifiedLogRecord *)data; OpSguil_Data *op_data = (OpSguil_Data *)context; Packet p; bzero(syslogMessage, SYSLOG_BUF); bzero(insertColumns, MAX_QUERY_SIZE); bzero(insertValues, MAX_QUERY_SIZE); #if 0 /* this is broken */ /* skip tagged packets, since the db does not have a mechanism to * deal with them properly */ if(record->log.event.event_reference) { LogMessage("Skipping tagged packet %i\n", record->log.event.event_reference); return 0; } #endif RenderTimestamp(record->log.pkth.ts.tv_sec, timestamp, TIMEBUF_SIZE); //fprintf(stdout, "Timestamp: %lu\n", GetMilliseconds()); //fflush(stdout); sid = GetSid(record->log.event.sig_generator, record->log.event.sig_id); if(sid == NULL) sid = FakeSid(record->log.event.sig_generator, record->log.event.sig_id); class_type = GetClassType(record->log.event.classification); //sgBeginTransaction(op_data); /* XXX: Error checking */ /* Build the event insert. */ snprintf(insertColumns, MAX_QUERY_SIZE, "INSERT INTO event (status, sid, cid, signature_id, signature_rev, signature, timestamp, priority, class"); esc_message = malloc(strlen(sid->msg)*2+1); mysql_real_escape_string(op_data->mysql, esc_message, sid->msg, strlen(sid->msg)); if(class_type == NULL) { snprintf(valuesTemp, MAX_QUERY_SIZE, "VALUES ('0', '%u', '%u', '%d', '%d', '%s', '%s', '%u', 'unknown'", op_data->sensor_id, op_data->event_id, sid->sid, sid->rev, esc_message, timestamp, record->log.event.priority); snprintf(eventInfo, SYSLOG_BUF, "RTEvent |0|%u|unknown|%s|%s|%u|%u|%s", record->log.event.priority, pv.hostname, timestamp, op_data->sensor_id, op_data->event_id, sid->msg); } else { snprintf(valuesTemp, MAX_QUERY_SIZE, "VALUES ('0', '%u', '%u', '%d', '%d', '%s', '%s', '%u', '%s'", op_data->sensor_id, op_data->event_id, sid->sid, sid->rev, esc_message, timestamp, record->log.event.priority, class_type->type); snprintf(eventInfo, SYSLOG_BUF, "RTEvent |0|%u|%s|%s|%s|%u|%u|%s", record->log.event.priority, class_type->type, pv.hostname, timestamp, op_data->sensor_id, op_data->event_id, sid->msg); } free(esc_message); insertValues[0] = '\0'; strcat(insertValues, valuesTemp); syslogMessage[0] = '\0'; strcat(syslogMessage, eventInfo); /* decode the packet */ if(DecodePacket(&p, &record->log.pkth, record->pkt + 2) == 0) { if(p.iph) { /* Insert ip header information */ //InsertIPData(op_data, &p); strcat(insertColumns, ",src_ip, dst_ip, ip_proto, ip_ver, ip_hlen, ip_tos, ip_len, ip_id, ip_flags, ip_off, ip_ttl, ip_csum"); snprintf(valuesTemp, MAX_QUERY_SIZE, ",'%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u'", ntohl(p.iph->ip_src.s_addr), ntohl(p.iph->ip_dst.s_addr), p.iph->ip_proto, IP_VER(p.iph), IP_HLEN(p.iph), p.iph->ip_tos, ntohs(p.iph->ip_len), ntohs(p.iph->ip_id), #if defined(WORDS_BIGENDIAN) ((p.iph->ip_off & 0xE000) >> 13), htons(p.iph->ip_off & 0x1FFF), #else ((p.iph->ip_off & 0x00E0) >> 5), htons(p.iph->ip_off & 0xFF1F), #endif p.iph->ip_ttl, htons(p.iph->ip_csum) < MAX_QUERY_SIZE); strcat(insertValues, valuesTemp); /* SYSLOG - Changed to SguilSendEvent*/ snprintf(ipInfo, 38, "|%u.%u.%u.%u|%u.%u.%u.%u|%u", #if defined(WORDS_BIGENDIAN) (p.iph->ip_src.s_addr & 0xff000000) >> 24, (p.iph->ip_src.s_addr & 0x00ff0000) >> 16, (p.iph->ip_src.s_addr & 0x0000ff00) >> 8, (p.iph->ip_src.s_addr & 0x000000ff), (p.iph->ip_dst.s_addr & 0xff000000) >> 24, (p.iph->ip_dst.s_addr & 0x00ff0000) >> 16, (p.iph->ip_dst.s_addr & 0x0000ff00) >> 8, (p.iph->ip_dst.s_addr & 0x000000ff), #else (p.iph->ip_src.s_addr & 0x000000ff), (p.iph->ip_src.s_addr & 0x0000ff00) >> 8, (p.iph->ip_src.s_addr & 0x00ff0000) >> 16, (p.iph->ip_src.s_addr & 0xff000000) >> 24, (p.iph->ip_dst.s_addr & 0x000000ff), (p.iph->ip_dst.s_addr & 0x0000ff00) >> 8, (p.iph->ip_dst.s_addr & 0x00ff0000) >> 16, (p.iph->ip_dst.s_addr & 0xff000000) >> 24, #endif p.iph->ip_proto); strcat(syslogMessage, ipInfo); /* store layer 4 data for non fragmented packets */ if(!(p.pkt_flags & PKT_FRAG_FLAG)) { switch(p.iph->ip_proto) { case IPPROTO_ICMP: snprintf(portInfo, 16, "|||"); if(!p.icmph) break; strcat(insertColumns, ", icmp_type, icmp_code)"); snprintf(valuesTemp, MAX_QUERY_SIZE, ", '%u', '%u')", p.icmph->icmp_type, p.icmph->icmp_code); strcat(insertValues, valuesTemp); strcat(insertColumns, insertValues); sgInsert(op_data, insertColumns, NULL); sgInsertICMPData(op_data, &p); break; case IPPROTO_TCP: strcat(insertColumns, ", src_port, dst_port)"); snprintf(valuesTemp, MAX_QUERY_SIZE, ", '%u', '%u')", p.sp, p.dp); strcat(insertValues, valuesTemp); strcat(insertColumns, insertValues); sgInsert(op_data, insertColumns, NULL); sgInsertTCPData(op_data, &p); snprintf(portInfo, 16, "|%u|%u|", p.sp, p.dp); break; case IPPROTO_UDP: strcat(insertColumns, ", src_port, dst_port)"); snprintf(valuesTemp, MAX_QUERY_SIZE, ", '%u', '%u')", p.sp, p.dp); strcat(insertValues, valuesTemp); strcat(insertColumns, insertValues); sgInsert(op_data, insertColumns, NULL); sgInsertUDPData(op_data, &p); snprintf(portInfo, 16, "|%u|%u|", p.sp, p.dp); break; } strcat(syslogMessage, portInfo); } else { strcat(syslogMessage, "|||"); } /* Insert payload data */ sgInsertPayloadData(op_data, &p); } else {
LogMessage::LogMessage( ListenManager *pListenManager, Event *pEvent ) :ManagedObject( pListenManager, SSAPI_OBJECT_CLASS_TYPE_LOG_MESSAGE ){ U32 i, u32, paramCount; U8 u8; S8 s8; U16 u16; S16 s16; S32 s32; I64 s64; U64 u64; UnicodeString us; U32 cb = sizeof(Event); m_sequenceNumber = pEvent->GetSequenceNum(); m_timeStamp = pEvent->GetTimestamp(); m_ec = pEvent->GetEventCode(); m_slot = pEvent->GetSlot(); m_did = pEvent->GetDID(); m_vdn = pEvent->GetVDN(); m_pParmVector = new ValueSet; m_id = DesignatorId( RowId(), GetClassType(), m_sequenceNumber ); m_severity = pEvent->GetSeverity(); m_facility = pEvent->GetFacility(); paramCount = pEvent->GetParameterCount(); for( i = 0; i < pEvent->GetParameterCount(); i++ ){ switch( pEvent->GetParameterType(i) ){ case Event::CHAR_PARM: case Event::U8_PARM: memcpy( &u8, pEvent->GetPParameter(i), sizeof(u8) ); m_pParmVector->AddU8( u8, i ); break; case Event::S8_PARM: memcpy( &s8, pEvent->GetPParameter(i), pEvent->GetParameterSize(i) ); m_pParmVector->AddInt8( s8, i ); break; case Event::S16_PARM: memcpy( &s16, pEvent->GetPParameter(i), pEvent->GetParameterSize(i) ); m_pParmVector->AddInt16( s16, i ); break; case Event::U16_PARM: memcpy( &u16, pEvent->GetPParameter(i), pEvent->GetParameterSize(i) ); m_pParmVector->AddU16( u16, i ); break; case Event::S32_PARM: memcpy( &s32, pEvent->GetPParameter(i), pEvent->GetParameterSize(i) ); m_pParmVector->AddInt( s32, i ); break; case Event::U32_PARM: memcpy( &u32, pEvent->GetPParameter(i), pEvent->GetParameterSize(i) ); m_pParmVector->AddU32( u32, i ); break; case Event::S64_PARM: memcpy( &s64, pEvent->GetPParameter(i), pEvent->GetParameterSize(i) ); m_pParmVector->AddInt64( s64, i ); break; case Event::U64_PARM: memcpy( &u64, pEvent->GetPParameter(i), pEvent->GetParameterSize(i) ); m_pParmVector->AddU64( u64, i ); break; case Event::HEX_PARM: m_pParmVector->AddGenericValue( (char *)pEvent->GetPParameter(i), pEvent->GetParameterSize(i), i ); break; case Event::STR_PARM: us = StringClass( (char *)pEvent->GetPParameter(i) ); m_pParmVector->AddString( &us, i ); break; case Event::USTR_PARM: us = UnicodeString( (void *)pEvent->GetPParameter(i) ); m_pParmVector->AddString( &us, i ); break; default: ASSERT(0); break; } } }