You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
(10) |
Apr
(25) |
May
(48) |
Jun
(6) |
Jul
(12) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
---|
From: <mar...@us...> - 2008-03-19 23:16:54
|
Revision: 75 http://openamt.svn.sourceforge.net/openamt/?rev=75&view=rev Author: marcin_obara Date: 2008-03-19 16:16:18 -0700 (Wed, 19 Mar 2008) Log Message: ----------- fixed event handling and logging Modified Paths: -------------- uns/branches/uns-5.0/AMTStatus/AMTStatusColl.cpp uns/branches/uns-5.0/AMTStatus/ATStatus.cpp uns/branches/uns-5.0/AMTStatus/ATStatus.h uns/branches/uns-5.0/AMTStatus/EventNode.h uns/branches/uns-5.0/UNSSoapServer.cpp uns/branches/uns-5.0/UNSSoapServer.h uns/branches/uns-5.0/UserNotificationServiceLinux.cpp uns/branches/uns-5.0/UserNotificationThread.cpp uns/branches/uns-5.0/UserNotificationThread.h Modified: uns/branches/uns-5.0/AMTStatus/AMTStatusColl.cpp =================================================================== --- uns/branches/uns-5.0/AMTStatus/AMTStatusColl.cpp 2008-03-19 23:03:46 UTC (rev 74) +++ uns/branches/uns-5.0/AMTStatus/AMTStatusColl.cpp 2008-03-19 23:16:18 UTC (rev 75) @@ -97,12 +97,11 @@ return 0; } - updateBaseData(newAMTStatusData); - if ((AMTSTATE_NOT_DETECTED == m_baseAMTStatusData.amtState) || (AMTSTATE_NOT_DETECTED == newAMTStatusData.amtState) || (NULL == events) ) { + updateBaseData(newAMTStatusData); return 1; } @@ -199,6 +198,8 @@ } } + updateBaseData(newAMTStatusData); + return diffs; } Modified: uns/branches/uns-5.0/AMTStatus/ATStatus.cpp =================================================================== --- uns/branches/uns-5.0/AMTStatus/ATStatus.cpp 2008-03-19 23:03:46 UTC (rev 74) +++ uns/branches/uns-5.0/AMTStatus/ATStatus.cpp 2008-03-19 23:16:18 UTC (rev 75) @@ -73,6 +73,7 @@ memset(&m_tpmStatusData, 0, sizeof(TPMStatusData)); m_tpmEvents.clear(); #endif + m_asyncEvents.clear(); } void ATStatus::Deinit() @@ -200,12 +201,17 @@ memcpy(&m_amtStatusData, &amtData, sizeof(AMTStatusData)); if (1 < m_AMTStatusColl.Collate(m_amtStatusData, &m_amtEvents)) { - //log eEvents + //filter duplicate async events + filterAsyncEvents(m_amtEvents); + //log Events std::list<ATEvents::EventNode>::const_iterator iter = m_amtEvents.begin(); std::list<ATEvents::EventNode>::const_iterator end = m_amtEvents.end(); for (; iter != end; iter++) { logEvent(*iter); } + //add async events to AMT events + m_amtEvents.insert(m_amtEvents.begin(), m_asyncEvents.begin(), m_asyncEvents.end()); + m_asyncEvents.clear(); //alter events history if (0 > m_eventHistory.AddEvents(m_amtEvents)) { if (bLogging && m_pLogger) { @@ -241,7 +247,7 @@ memcpy(&m_tpmStatusData, &tpmData, sizeof(TPMStatusData)); if (1 < m_TPMStatusColl.Collate(m_tpmStatusData, &m_tpmEvents)) { - //log eEvents + //log Events std::list<ATEvents::EventNode>::const_iterator iter = m_tpmEvents.begin(); std::list<ATEvents::EventNode>::const_iterator end = m_tpmEvents.end(); for (; iter != end; iter++) { @@ -287,6 +293,8 @@ m_IPCiATStatus.PutTPMStatusData(m_tpmStatusData); m_IPCiATStatus.AddEvents(m_tpmEvents); #endif + m_IPCiATStatus.AddEvents(m_asyncEvents); + return true; } @@ -430,3 +438,36 @@ } } +bool ATStatus::AsyncEvent(ATEvents::EventNode event) +{ + Lock lock(m_dataSetSemaphore); + + m_asyncEvents.push_back(event); + return true; +} + + +void ATStatus::filterAsyncEvents(std::list<ATEvents::EventNode> &events) +{ + std::list<ATEvents::EventNode>::iterator iter0 = events.begin(); + std::list<ATEvents::EventNode>::iterator end0 = events.end(); + + while (iter0 != events.end()) { + bool edel = false; + std::list<ATEvents::EventNode>::const_iterator iter1 = m_asyncEvents.begin(); + std::list<ATEvents::EventNode>::const_iterator end1 = m_asyncEvents.end(); + for (; iter1 != end1; iter1++) { + if (iter0->m_id == iter1->m_id) { + edel = true; + break; + } + } + if (edel) { + iter0 = events.erase(iter0); + continue; + } + iter0++; + } +} + + Modified: uns/branches/uns-5.0/AMTStatus/ATStatus.h =================================================================== --- uns/branches/uns-5.0/AMTStatus/ATStatus.h 2008-03-19 23:03:46 UTC (rev 74) +++ uns/branches/uns-5.0/AMTStatus/ATStatus.h 2008-03-19 23:16:18 UTC (rev 75) @@ -77,6 +77,7 @@ bool IsTpmSku(); bool IsTpmEnabled(); #endif + bool AsyncEvent(ATEvents::EventNode event); private: void clearData(); @@ -84,6 +85,7 @@ IPCiATStatus::Enablement enablementFromData() const; void logEvent(const ATEvents::EventNode &event); bool readSkuInfo(); + void filterAsyncEvents(std::list<ATEvents::EventNode> &events); FWULCommand m_fwulCommand; MEFWCAPS_SKU m_skuBits; @@ -107,6 +109,7 @@ TPMStatusColl m_TPMStatusColl; std::list<ATEvents::EventNode> m_tpmEvents; #endif + std::list<ATEvents::EventNode> m_asyncEvents; }; #endif //_AT_STATUS_PROXY_H Modified: uns/branches/uns-5.0/AMTStatus/EventNode.h =================================================================== --- uns/branches/uns-5.0/AMTStatus/EventNode.h 2008-03-19 23:03:46 UTC (rev 74) +++ uns/branches/uns-5.0/AMTStatus/EventNode.h 2008-03-19 23:16:18 UTC (rev 75) @@ -58,6 +58,8 @@ static const unsigned char SD_STARTED = 7; static const unsigned char SD_FINISHED = 8; static const unsigned char REMOTE_REBOOT = 9; + static const unsigned char AMT_ENABLED = 10; + static const unsigned char AMT_DISABLED = 11; #ifdef WITH_TPM static const unsigned char TPM_OPERATIONAL = 20; static const unsigned char TPM_NOT_DETECTED = 21; Modified: uns/branches/uns-5.0/UNSSoapServer.cpp =================================================================== --- uns/branches/uns-5.0/UNSSoapServer.cpp 2008-03-19 23:03:46 UTC (rev 74) +++ uns/branches/uns-5.0/UNSSoapServer.cpp 2008-03-19 23:16:18 UTC (rev 75) @@ -64,6 +64,7 @@ } UNSEventLogger *UNSSoapServer::m_Logger = NULL; +ATStatus *UNSSoapServer::m_piATStatus = NULL; std::string UNSSoapServer::m_userid = "user"; std::string UNSSoapServer::m_passwd = "user"; static char UNS_AUTH_REALM[] = "Intel AMT UNS"; @@ -205,7 +206,7 @@ //***************************************************************************** // Name : UNSSoapServer::SetCredentials -// Description : Set the m_stop flag and stop the server. +// Description : Set credentails. //***************************************************************************** void UNSSoapServer::SetCredentials(const std::string userid, const std::string passwd) @@ -216,13 +217,22 @@ //***************************************************************************** // Name : UNSSoapServer::SetLogger -// Description : Set the m_stop flag and stop the server. +// Description : Set a pointer to Logger object. //***************************************************************************** void UNSSoapServer::SetLogger(UNSEventLogger *logger) { m_Logger = logger; } +//***************************************************************************** +// Name : UNSSoapServer::SetATStatus +// Description : Set a pointer to ATStatus object. +//***************************************************************************** +void UNSSoapServer::SetATStatus(ATStatus *pATStatus) +{ + m_piATStatus = pATStatus; +} + void UNSSoapServer::printEvent(emi__EventLogRecordType *event) { _DEBUG_PRINTF("EventSensorType\t\t: 0x02%x\n" , event->EventSensorType); @@ -268,12 +278,18 @@ // Copy the data vector to a local vector. EventType event; - if (GetEventType((*itr)->EventData->Byte, event)) { - m_Logger->LogInfoEventAmt(event.category , event.id); - _DEBUG_PRINTF("Received legal alert: 0x%x 0x%lx\n",event.category, event.id); + unsigned char evid; + if (GetEventType((*itr)->EventData->Byte, event, evid)) { + if (m_Logger) { + m_Logger->LogInfoEventAmt(event.category, event.id); + } + if (m_piATStatus && (evid != 0)) { + m_piATStatus->AsyncEvent(ATEvents::EventNode(evid, time(NULL))); + } + _DEBUG_PRINTF("Received legal alert: 0x%x 0x%lx\n", event.category, event.id); } else { - _DEBUG_PRINTF("Unknown event: 0x%x 0x%lx\n",event.category, event.id); + _DEBUG_PRINTF("Unknown event: 0x%x 0x%lx\n", event.category, event.id); res = false; // Log some kind of error message. } @@ -320,11 +336,13 @@ // Description : Return the event category and ID according to the event data. // Params : data - a vector of 8 bytes //***************************************************************************** -bool UNSSoapServer::GetEventType(std::vector<unsigned char> &data, EventType &event) +bool UNSSoapServer::GetEventType(std::vector<unsigned char> &data, EventType &event, unsigned char &evid) { unsigned char reason = data[1]; unsigned char code = data[2]; + evid = 0; + switch (reason) { case UNS_REASON_CIRCUIT_BREAKER: @@ -383,18 +401,22 @@ { case UNS_CODE_REMOTE_SOL_STARTED: event.id = REMOTE_SOL_STARTED; + evid = ATEvents::EventNode::SOL_STARTED; break; case UNS_CODE_REMOTE_SOL_ENDED: event.id = REMOTE_SOL_ENDED; + evid = ATEvents::EventNode::SOL_FINISHED; break; case UNS_CODE_REMOTE_IDER_STARTED: event.id = REMOTE_IDER_STARTED; + evid = ATEvents::EventNode::IDER_STARTED; break; case UNS_CODE_REMOTE_IDER_ENDED: event.id = REMOTE_IDER_ENDED; + evid = ATEvents::EventNode::IDER_FINISHED; break; default: Modified: uns/branches/uns-5.0/UNSSoapServer.h =================================================================== --- uns/branches/uns-5.0/UNSSoapServer.h 2008-03-19 23:03:46 UTC (rev 74) +++ uns/branches/uns-5.0/UNSSoapServer.h 2008-03-19 23:16:18 UTC (rev 75) @@ -50,6 +50,8 @@ #include <map> #include "UNSEventLogger.h" #include "UNSStatus.h" +#include "ATStatus.h" +#include "EventNode.h" #define BACKLOG (100) // Max. request backlog @@ -107,6 +109,8 @@ // Set a pointer to a logger class. void SetLogger(UNSEventLogger *logger); + // Set a pointer to ATStatus object + void SetATStatus(ATStatus *pATStatus); // Set userid and passwd void SetCredentials(const std::string userid, const std::string passwd); // Bind host. @@ -127,17 +131,19 @@ private: static void printEvent(emi__EventLogRecordType *event); static bool IsEventLegal(emi__EventLogRecordType *event); - static bool GetEventType(std::vector<unsigned char> &data, EventType &event); + static bool GetEventType(std::vector<unsigned char> &data, EventType &event, unsigned char &evid); // Data members - struct soap *m_soap; // Pointer to soap runtime environment - SOAP_SOCKET m_socket; // Master socket. - unsigned short m_port; // Port of the service. - bool m_init; // Flag - is initialized. + struct soap *m_soap; // Pointer to soap runtime environment + SOAP_SOCKET m_socket; // Master socket. + unsigned short m_port; // Port of the service. + bool m_init; // Flag - is initialized. + static UNSEventLogger *m_Logger; // Event Logger. + static ATStatus *m_piATStatus; // Pointer to ATStatus object + public: // public static data members. - static UNSEventLogger *m_Logger; // Event Logger. static std::string m_userid; // User id for basic authentication. static std::string m_passwd; // Password for basic authentication. Modified: uns/branches/uns-5.0/UserNotificationServiceLinux.cpp =================================================================== --- uns/branches/uns-5.0/UserNotificationServiceLinux.cpp 2008-03-19 23:03:46 UTC (rev 74) +++ uns/branches/uns-5.0/UserNotificationServiceLinux.cpp 2008-03-19 23:16:18 UTC (rev 75) @@ -83,6 +83,7 @@ //***************************************************************************** UserNotificationService::~UserNotificationService(void) { + m_UserNotificationThread.SetATStatus(NULL); DeinitLogger(); } @@ -222,6 +223,7 @@ } } #endif + m_UserNotificationThread.SetATStatus(&m_ATStatus); } m_init = true; Modified: uns/branches/uns-5.0/UserNotificationThread.cpp =================================================================== --- uns/branches/uns-5.0/UserNotificationThread.cpp 2008-03-19 23:03:46 UTC (rev 74) +++ uns/branches/uns-5.0/UserNotificationThread.cpp 2008-03-19 23:16:18 UTC (rev 75) @@ -113,6 +113,15 @@ } //***************************************************************************** +// Name : UserNotificationThread::SetATStatus +// Description : Set a pointer to ATStatus class +//***************************************************************************** +void UserNotificationThread::SetATStatus(ATStatus *pATStatus) +{ + m_server.SetATStatus(pATStatus); +} + +//***************************************************************************** // Name : UserNotificationThread::SetParamsAMTEnabled // Description : Set a pointer to AMTEnabled bool and to its related semaphore //***************************************************************************** Modified: uns/branches/uns-5.0/UserNotificationThread.h =================================================================== --- uns/branches/uns-5.0/UserNotificationThread.h 2008-03-19 23:03:46 UTC (rev 74) +++ uns/branches/uns-5.0/UserNotificationThread.h 2008-03-19 23:16:18 UTC (rev 75) @@ -72,6 +72,8 @@ // Set a pointer to the Logger. void SetLogger(UNSEventLogger *pLogger); + // Set a pointer to ATStatus class + void SetATStatus(ATStatus *pATStatus); // Set pointers to AMT enable indicator void SetParamsAMTEnabled(Semaphore *semAMTEnabled, bool *amtEnabled); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mar...@us...> - 2008-03-19 23:04:58
|
Revision: 74 http://openamt.svn.sourceforge.net/openamt/?rev=74&view=rev Author: marcin_obara Date: 2008-03-19 16:03:46 -0700 (Wed, 19 Mar 2008) Log Message: ----------- log listen error only one time per port Modified Paths: -------------- lms/branches/lms-5.0/src/Protocol.cpp lms/branches/lms-5.0/src/Protocol.h Modified: lms/branches/lms-5.0/src/Protocol.cpp =================================================================== --- lms/branches/lms-5.0/src/Protocol.cpp 2008-03-18 18:31:55 UTC (rev 73) +++ lms/branches/lms-5.0/src/Protocol.cpp 2008-03-19 23:03:46 UTC (rev 74) @@ -90,6 +90,7 @@ memset(_AMTFQDN, 0, sizeof(_AMTFQDN)); oldProtocolMode = false; _deinitReq = false; + _listenFailReported.clear(); } Protocol::~Protocol() @@ -99,6 +100,7 @@ } DeinitFull(); DestroySockets(); + _listenFailReported.clear(); } bool Protocol::Init(EventLogCallback cb, void *param) @@ -1056,6 +1058,7 @@ { Lock l(_portsLock); SOCKET serverSocket = INVALID_SOCKET; + listenPortSet::iterator lpi; if (_checkListen(tcpFwdReqMsg->Address, tcpFwdReqMsg->Port, serverSocket)) { *status = 1; @@ -1072,6 +1075,8 @@ return; } + lpi = _listenFailReported.find(tcpFwdReqMsg->Port); + if (serverSocket == INVALID_SOCKET) { int error; serverSocket = _listenPort(tcpFwdReqMsg->Port, error); @@ -1082,7 +1087,10 @@ _stprintf_s(message, 1024, TEXT("LMS Service cannot listen at port %d.\n"), tcpFwdReqMsg->Port); - _eventLog(_eventLogParam, message, EVENTLOG_ERROR_TYPE); + if (lpi == _listenFailReported.end()) { + _eventLog(_eventLogParam, message, EVENTLOG_ERROR_TYPE); + _listenFailReported.insert(tcpFwdReqMsg->Port); + } PRINT(message); // Send Failure replay to LME _lme.TcpForwardReplyFailure(); @@ -1109,6 +1117,9 @@ (cb == _isLocalCallback) ? PortForwardRequest::LISTENING : PortForwardRequest::PENDING_REQUEST); + if (lpi != _listenFailReported.end()) { + _listenFailReported.erase(lpi); + } _signalSelect(); } Modified: lms/branches/lms-5.0/src/Protocol.h =================================================================== --- lms/branches/lms-5.0/src/Protocol.h 2008-03-18 18:31:55 UTC (rev 73) +++ lms/branches/lms-5.0/src/Protocol.h 2008-03-19 23:03:46 UTC (rev 74) @@ -33,6 +33,7 @@ #include <map> #include <vector> +#include <set> #include <string> #include "types.h" #include "LMS_if.h" @@ -182,6 +183,9 @@ bool _deinitReq; Semaphore _deinitLock; + + typedef std::set<unsigned int> listenPortSet; + listenPortSet _listenFailReported; }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <na...@us...> - 2008-03-18 15:12:19
|
Revision: 72 http://openamt.svn.sourceforge.net/openamt/?rev=72&view=rev Author: nashif Date: 2008-03-18 08:10:38 -0700 (Tue, 18 Mar 2008) Log Message: ----------- revert Modified Paths: -------------- heci/trunk/Makefile Modified: heci/trunk/Makefile =================================================================== --- heci/trunk/Makefile 2008-03-18 14:58:38 UTC (rev 71) +++ heci/trunk/Makefile 2008-03-18 15:10:38 UTC (rev 72) @@ -3,8 +3,5 @@ all: cd src && make -install: - cd src && make install - $(TARGETS): cd src && make $@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |