Changeset 221
- Timestamp:
- 06/07/10 15:00:41 (15 years ago)
- Location:
- Evidence
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Evidence
- Property svn:ignore
-
old new 2 2 Config 3 3 DColl 4 Bridge 5 History
-
- Property svn:ignore
-
Evidence/Config.cc
r216 r221 48 48 49 49 void rpcHandler(); 50 50 void AddItem(string, string, string); 51 string RemoveSpaces(string &); 52 51 53 public: 52 54 EvidenceConfig(const char *); … … 168 170 169 171 stringstream In(FileContent), Out; 170 string Line; 171 struct Item New; 172 size_t Pos; 172 string Section, Item, Line, Data; 173 173 174 174 // First clean up and concatenate lines … … 178 178 // Replace all tabs by spaces 179 179 while (Line.find("\t") != string::npos) Line[Line.find("\t")] = ' '; 180 // Remove leading spaces181 while (!Line.empty() && isspace(Line[0])) Line.erase(0, 1);182 // Remove trailing spaces183 while (!Line.empty() && isspace(Line[Line.size()-1])) Line.erase(Line.size()-1);184 180 // Remove empty lines 185 if ( Line.empty()) continue;186 // Concatenate if line ends with ' +'187 if (Line[Line.size()-1] != ' +') Out << Line << endl;181 if (RemoveSpaces(Line).empty()) continue; 182 // Concatenate if line ends with '\' 183 if (Line[Line.size()-1] != '\\') Out << Line << endl; 188 184 else Out << Line.erase(Line.size()-1); 189 185 }; … … 194 190 // Interpret data 195 191 while (getline(In, Line).good()) { 196 // Remove multiple spaces 197 while (Line.find(" ") != string::npos) Line.erase(Line.find(" "), 1); 198 199 // Find second space character 200 Pos = Line.find(" ", Line.find(" ") + 1); 201 if(Pos == string::npos) continue; 202 203 // Extract configuration name and data 204 New.Name = string(Line, 0, Pos); 205 New.Data = string(Line, Pos+1); 206 207 // Add to configuration list 208 if (pthread_mutex_lock(&Mutex) != 0) Message(ERROR, "pthread_mutex_lock() failed in ConfigChanged()"); 209 List.push_back(New); 210 if (pthread_mutex_unlock(&Mutex) != 0) Message(ERROR, "pthread_mutex_unlock() failed in ConfigChanged()"); 211 }; 212 } 213 192 193 // Check if current line is section heading (contains only [xxx]) 194 if (Line.find('[')==0 && Line.find(']')==Line.size()-1) { 195 // Add previous item to list (if any) 196 AddItem(Section, Item, Data); 197 Item.clear(); 198 Data.clear(); 199 // Extract new section name 200 Section = Line.substr(1, Line.size()-2); 201 continue; 202 } 203 204 // Check if current line contains equal sign (defines new item name) 205 if((Line.find('=')) != string::npos) { 206 // Add previous item to list 207 AddItem(Section, Item, Data); 208 // Extract parameter name and data 209 Item = string(Line, 0, Line.find('=')-1); 210 Data = string(Line, Line.find('=')+1, string::npos); 211 } 212 else Data += ' ' + Line; // Concatenate lines 213 } 214 // Add last item 215 AddItem(Section, Item, Data); 216 } 217 218 // Add item to configuration list 219 void EvidenceConfig::AddItem(string Section, string Parameter, string Data) { 220 221 // Clean up strings 222 RemoveSpaces(Parameter); 223 RemoveSpaces(Data); 224 if (Section.empty() || Parameter.empty() || Data.empty()) return; 225 226 // Prepare new item of configuration list 227 struct Item New; 228 New.Name = Section + ' ' + Parameter; 229 New.Data = Data; 230 231 // Add to configuration list 232 if (pthread_mutex_lock(&Mutex) != 0) Message(ERROR, "pthread_mutex_lock() failed in ConfigChanged()"); 233 List.push_back(New); 234 if (pthread_mutex_unlock(&Mutex) != 0) Message(ERROR, "pthread_mutex_unlock() failed in ConfigChanged()"); 235 } 236 237 // Removes whitespace 238 string EvidenceConfig::RemoveSpaces(string &Text) { 239 240 // Remove leading spaces 241 while (!Text.empty() && isspace(Text[0])) Text.erase(0, 1); 242 // Remove trailing spaces 243 while (!Text.empty() && isspace(Text[Text.size()-1])) Text.erase(Text.size()-1); 244 // Remove multiple spaces 245 while (Text.find(" ") != string::npos) Text.erase(Text.find(" "), 1); 246 247 return Text; 248 } 214 249 215 250 // -
Evidence/DColl.cc
r216 r221 6 6 server and writes these to the data file at every update. 7 7 - One data file per day is generated. 8 - A history of events is kept within a ring buffer for each service. Each9 entry will be the result of a conversion to double of the text10 written to the data file. Only if the new value has changed by a11 minimum amout it will be added to the ring buffer. The history is12 available via an rpc call.13 - The history buffers are written to disk at program termination and14 are tired to be read when adding a service.15 8 - The command 'DColl/Log' writes the associated string to the log file 16 9 17 Oliver Grimm, May201010 Oliver Grimm, June 2010 18 11 19 12 \********************************************************************/ 20 13 21 14 #define SERVER_NAME "DColl" 22 23 #define MIN_HIST_SIZE 1024 // Minimum history buffer in bytes (> 3*sizeof(int) !)24 15 #define LOG_FILENAME "Evidence.log" 25 16 … … 29 20 #include <sstream> 30 21 #include <vector> 31 #include <iomanip>32 33 #include <math.h>34 #include <float.h>35 22 #include <sys/stat.h> 36 #include <ctype.h>37 #include <sys/types.h>38 23 #include <regex.h> 39 24 … … 43 28 // Class declaration 44 29 // 45 class DataHandler: public DimRpc, public DimClient, public DimBrowser, 46 public EvidenceServer { 30 class DataHandler: public DimClient, public EvidenceServer { 47 31 48 32 struct Item { 49 33 DimStampedInfo *DataItem; 50 char *Buffer; 51 unsigned int HistSize; 52 int Next; 53 double LastValue; 54 double MinAbsChange; 34 bool Exclude; 55 35 }; 56 36 vector<struct Item> List; 57 37 58 38 DimCommand *LogCommand; 39 DimInfo *ServerList; 59 40 60 41 FILE *DataFile; … … 69 50 int RollOver; 70 51 71 int RegExCount; 72 regex_t *RegEx; 73 double *MinChange; 74 unsigned int *HistSize; 52 vector<regex_t> RegEx; 75 53 76 54 void infoHandler(); 77 void rpcHandler();78 55 void commandHandler(); 79 56 void AddService(string); 80 57 void RemoveService(string); 81 58 off_t FileSize(FILE *); 82 FILE *OpenHistFile(string, const char *);83 59 84 60 public: … … 90 66 // Constructor 91 67 // 92 DataHandler::DataHandler(): DimRpc("ServiceHistory", "C", "C"),EvidenceServer(SERVER_NAME) {68 DataHandler::DataHandler(): EvidenceServer(SERVER_NAME) { 93 69 94 70 // Initialization to prevent freeing unallocated memory … … 113 89 Message(FATAL, "Could not open log file (%s)", strerror(errno)); 114 90 } 115 116 // Provide logging command117 LogCommand = new DimCommand("DColl/Log", (char *) "C", this);118 91 119 92 // Create services for file sizes and data file name … … 126 99 DataFilename = new DimService(SERVER_NAME "/CurrentFile", (char *) ""); 127 100 128 // Count how many minimum change regular expressions are present 129 char *Change = GetConfig("items"); 130 RegExCount = 0; 131 char *Token = strtok(Change, "\t "); 101 // Compile regular expressions 102 char *Exclude = GetConfig("exclude"); 103 char *Token = strtok(Exclude, "\t "); 104 regex_t R; 105 132 106 while (Token != NULL) { 133 RegExCount++; 107 int Ret = regcomp(&R, Token, REG_EXTENDED|REG_NOSUB); 108 if (Ret != 0) { 109 char Err[200]; 110 regerror(Ret, &R, Err, sizeof(Err)); 111 Message(ERROR, "Error compiling regular expression '%s' (%s)", Token, Err); 112 } 113 else RegEx.push_back(R); 114 134 115 Token = strtok(NULL, "\t "); 135 116 } 136 117 137 // Allocate memory for regular expressions, minimum change and history size 138 RegEx = new regex_t [RegExCount]; 139 MinChange = new double [RegExCount]; 140 HistSize = new unsigned int [RegExCount]; 141 142 // Compile regular expressions and extract minimum change and history size 143 int Pos = 0; 144 for (int i=0; i<RegExCount; i++) { 145 int Len = strlen(Change+Pos) + 1; 146 Token = strtok(Change + Pos, ": \t"); 147 148 int Ret = regcomp(&RegEx[i], Token, REG_EXTENDED|REG_NOSUB); 149 if (Ret != 0) { 150 char ErrMsg[200]; 151 regerror(Ret, &RegEx[i], ErrMsg, sizeof(ErrMsg)); 152 RegExCount--; 153 i--; 154 Message(ERROR, "Error compiling regular expression '%s' (%s)", Token, ErrMsg); 155 } 156 else { 157 if ((Token=strtok(NULL, ": \t")) != NULL) MinChange[i] = atof(Token); 158 else MinChange[i] = 0; 159 160 if ((Token=strtok(NULL, "")) != NULL) HistSize[i] = atoi(Token)*1024; 161 else HistSize[i] = 0; 162 } 163 Pos += Len; 164 } 165 166 // Subscribe to list of servers at DIS_DNS 167 AddService("DIS_DNS/SERVER_LIST"); 118 // Provide logging command 119 LogCommand = new DimCommand("DColl/Log", (char *) "C", this); 120 121 // Subsribe to top-level server list (not via AddService() due to thread issue) 122 ServerList = new DimInfo((char *) "DIS_DNS/SERVER_LIST", NO_LINK, this); 168 123 } 169 124 … … 174 129 175 130 // Delete all DIM subscriptions 131 delete ServerList; 176 132 while (List.size() != 0) RemoveService(List[0].DataItem->getName()); 177 133 … … 192 148 193 149 // Free memory for regular expressions handling 194 for (int i=0; i<RegExCount; i++) { 195 regfree(&RegEx[i]); 196 } 197 delete[] MinChange; 198 delete[] RegEx; 150 for (int i=0; i<RegEx.size(); i++) regfree(&RegEx[i]); 199 151 } 200 152 … … 206 158 void DataHandler::infoHandler() { 207 159 208 DimInfo *I nfo= getInfo();160 DimInfo *I = getInfo(); 209 161 210 162 // Check if service available 211 if (!ServiceOK(I nfo)) return;163 if (!ServiceOK(I)) return; 212 164 213 165 // … … 217 169 218 170 // If service is DIS_DNS/SERVER_LIST, subscribe to all SERVICE_LIST services 219 if (strcmp(I nfo->getName(), "DIS_DNS/SERVER_LIST") == 0) {220 char *Token = strtok(I nfo->getString(), "+-!@");171 if (strcmp(I->getName(), "DIS_DNS/SERVER_LIST") == 0) { 172 char *Token = strtok(I->getString(), "+-!@"); 221 173 while (Token != NULL) { 222 174 AddService(string(Token)+"/SERVICE_LIST"); // 'add' also for '-' and '!' … … 229 181 // If service is SERVICE_LIST of any server, scan all services. 230 182 // Subscribe to all services (but not to commands and RPCs) 231 if (strstr(I nfo->getName(), "/SERVICE_LIST") != NULL) {232 char *Name = strtok(I nfo->getString(), "+-!|");183 if (strstr(I->getName(), "/SERVICE_LIST") != NULL) { 184 char *Name = strtok(I->getString(), "+-!|"); 233 185 while (Name != NULL) { 234 186 // Check if item is a service … … 242 194 243 195 // 244 // ====== Part B: Handle opening data files ===196 // ====== Part B: Handle opening of data files === 245 197 // 246 198 … … 297 249 298 250 // Identify index of service 299 int Service; 300 for (Service=0; Service<List.size(); Service++) if (Info == List[Service].DataItem) break; 301 if (Service == List.size()) return; // Service not found 302 303 // If negative value for absolute change, do not write to file 304 if (List[Service].MinAbsChange >= 0) { 251 for (int Service=0; Service<List.size(); Service++) if (I == List[Service].DataItem) { 252 253 // Service excluded from writing? 254 if (List[Service].Exclude) return; 255 305 256 // Write data header 306 time_t RawTime = I nfo->getTimestamp();257 time_t RawTime = I->getTimestamp(); 307 258 struct tm *TM = localtime(&RawTime); 308 259 309 fprintf(DataFile, "%s %d %d %d %d %d %d %d % lu ", Info->getName(), TM->tm_year+1900, TM->tm_mon+1, TM->tm_mday, TM->tm_hour, TM->tm_min, TM->tm_sec, Info->getTimestampMillisecs(), Info->getTimestamp());260 fprintf(DataFile, "%s %d %d %d %d %d %d %d %d %lu ", I->getName(), I->getQuality(), TM->tm_year+1900, TM->tm_mon+1, TM->tm_mday, TM->tm_hour, TM->tm_min, TM->tm_sec, I->getTimestampMillisecs(), I->getTimestamp()); 310 261 311 262 // Translate data into ASCII 312 char *Text = EvidenceServer::ToString(I nfo);263 char *Text = EvidenceServer::ToString(I); 313 264 314 265 if (Text != NULL) { … … 343 294 } 344 295 } // Check for disk writing 345 346 //347 // ====== Part D: Handle history service ===348 //349 350 if (Info->getSize()==0 || Info->getTimestamp()==0) return;351 352 // Check if data should be added to history buffer353 if (strcmp(Info->getFormat(),"C") != 0 && strlen(Info->getFormat())==1) {354 // Calculate sum of all number in array355 char *Text = EvidenceServer::ToString(Info);356 char *Token = strtok(Text, " ");357 double Sum = 0;358 while (Token != NULL) {359 Sum += atof(Token);360 Token = strtok(NULL, " ");361 }362 free(Text);363 // Minimum change?364 if (fabs(Sum-List[Service].LastValue) < fabs(List[Service].MinAbsChange)) return;365 List[Service].LastValue = Sum;366 }367 368 // Check if data fits into buffer369 if (List[Service].HistSize < Info->getSize() + sizeof(int)+ 2*sizeof(EvidenceHistory::Item)) return;370 371 int Size = Info->getSize() + 2*sizeof(EvidenceHistory::Item), Next = List[Service].Next;372 void *WrapPos = NULL;373 char *Buffer = List[Service].Buffer;374 int Oldest = *(int *) Buffer;375 376 // Check if buffer wrap-around (write wrap mark after Oldest is adjusted)377 if (Next + Size >= List[Service].HistSize) {378 WrapPos = Buffer + Next;379 Next = 4;380 }381 382 // Adapt pointer to oldest entry383 while ((Oldest < Next + Size) &&384 (Oldest + *((int *) (Buffer + Oldest) + 1) + 2*sizeof(int) > Next)) {385 // Check for wrap-around386 if (memcmp(Buffer + Oldest, &EvidenceHistory::WrapMark, sizeof(EvidenceHistory::WrapMark)) == 0) {387 Oldest = 4;388 continue;389 }390 // Check if end marker reached, then only one event fits buffer391 if (memcmp(Buffer + Oldest, &EvidenceHistory::EndMark, sizeof(EvidenceHistory::EndMark)) == 0) {392 Oldest = Next;393 break;394 }395 // Move to next entry396 Oldest += *((int *) (Buffer + Oldest) + 1) + 2*sizeof(int);397 }398 // Update pointer in buffer399 *(int *) Buffer = Oldest;400 401 // Write wrap mark if necessary402 if (WrapPos != NULL) memcpy(WrapPos, &EvidenceHistory::WrapMark, sizeof(EvidenceHistory::WrapMark));403 404 // Copy data into ring buffer405 *((int *) (Buffer + Next)) = Info->getTimestamp();406 *((int *) (Buffer + Next + sizeof(int))) = Info->getSize();407 memcpy(Buffer + Next + 2*sizeof(int), Info->getData(), Info->getSize());408 409 // Adjust pointer for next entry and write end marker to buffer410 Next += Info->getSize() + sizeof(EvidenceHistory::Item);411 memcpy(Buffer + Next, &EvidenceHistory::EndMark, sizeof(EvidenceHistory::EndMark));412 413 List[Service].Next = Next;414 296 } 415 297 … … 454 336 455 337 // 456 // Implementation of history buffer distribution457 //458 void DataHandler::rpcHandler() {459 460 // Search for history buffer461 for (int i=0; i<List.size(); i++) {462 if (strcmp(List[i].DataItem->getName(), getString()) == 0) {463 setData((void *) List[i].Buffer, List[i].HistSize);464 return;465 }466 }467 468 // Try to open history file if not found in memory469 FILE *File = OpenHistFile(getString(), "rb");470 if (File == NULL) {471 setData(NULL, 0);472 return;473 }474 475 // Read history file476 off_t Size = FileSize(File);477 if (Size != -1) {478 char *Buffer = new char [Size-sizeof(int)];479 fseek(File, sizeof(int), SEEK_SET);480 fread(Buffer, sizeof(char), Size-sizeof(int), File);481 if (ferror(File) != 0) {482 Message(WARN, "Error reading history file '%s' in rpcHandler()", getString());483 setData(NULL, 0); // Default response484 }485 else setData((void *) Buffer, Size);486 delete[] Buffer;487 }488 489 if (fclose(File) != 0) Message(WARN, "Error closing history file '%s' in rpcHandler()", getString());490 }491 492 493 //494 338 // Add service to watch list 495 339 // 496 340 void DataHandler::AddService(string Name) { 341 342 struct Item New; 497 343 498 344 // Check if already subscribed to this service … … 500 346 if (Name == List[i].DataItem->getName()) return; 501 347 } 502 503 // Set minimum required change by comparing to regular expressions 504 struct Item New; 505 New.MinAbsChange = 0; 506 New.HistSize = 0; 507 for (int i=0; i<RegExCount; i++) { 508 if (regexec(&RegEx[i], Name.c_str(), (size_t) 0, NULL, 0) == 0) { 509 New.MinAbsChange = MinChange[i]; 510 if (HistSize[i] != 0) New.HistSize = HistSize[i]; 511 } 512 } 513 514 // At least 3*sizeof(int) 515 if (New.HistSize < MIN_HIST_SIZE) New.HistSize = MIN_HIST_SIZE; 516 517 // Create history service 518 New.Buffer = new char [New.HistSize]; 519 memset(New.Buffer, 0, New.HistSize); 520 *(int *) New.Buffer = 4; 521 New.Next = 4; 522 New.LastValue = DBL_MAX; 523 524 // Load history buffer from file if existing 525 FILE *File = OpenHistFile(Name, "rb"); 526 if (File != NULL) { 527 // Only load if current buffer size is equal or larger 528 if (FileSize(File) <= New.HistSize*sizeof(char)+sizeof(New.Next) && FileSize(File) != -1) { 529 fread(&New.Next, sizeof(New.Next), 1, File); 530 fread(New.Buffer, sizeof(char), New.HistSize, File); 531 if (ferror(File) != 0) Message(WARN, "Error reading history file '%s' in AddService()", Name.c_str()); 532 if (fclose(File) != 0) Message(WARN, "Error closing history file '%s' in AddService()", Name.c_str());; 533 } 348 349 // Should service be ignored? 350 New.Exclude = false; 351 for (int i=0; i<RegEx.size(); i++) { 352 if (regexec(&RegEx[i], Name.c_str(), (size_t) 0, NULL, 0) == 0) New.Exclude = true; 534 353 } 535 354 … … 537 356 New.DataItem = new DimStampedInfo(Name.c_str(), NO_LINK, this); 538 357 539 // Add item to list540 358 List.push_back(New); 541 359 } … … 550 368 vector<struct Item>::iterator E; 551 369 for (E=List.begin(); E<List.end(); ++E) if (Name == (*E).DataItem->getName()) { 552 // Delete subscription first so handler and not called anymore 553 delete (*E).DataItem; 554 555 // Save history buffer 556 FILE *File = OpenHistFile(Name, "wb"); 557 if (File != NULL) { 558 fwrite(&(*E).Next, sizeof((*E).Next), 1, File); 559 fwrite((*E).Buffer, sizeof(char), (*E).HistSize, File); 560 if (ferror(File) != 0) Message(WARN, "Error writing history file '%s' in RemoveService()", Name.c_str()); 561 if (fclose(File) != 0) Message(WARN, "Error closing history file '%s' in RemoveService()", Name.c_str());; 562 } 563 564 // Delete history service and free memory 565 delete[] (*E).Buffer; 370 delete (*E).DataItem; 566 371 List.erase(E); 567 372 } … … 579 384 return -1; 580 385 } 581 582 386 return FileStatus.st_size; 583 387 } 584 388 585 //586 // Open file for service history587 //588 FILE *DataHandler::OpenHistFile(string Service, const char *Mode) {589 590 string Dir = string(BaseDir) + "/Histories/";591 592 // Create directory if not yet existing593 if(mkdir(Dir.c_str(), S_IRWXU|S_IRWXG)==-1 && errno!=EEXIST) return NULL;594 595 // Replace all '/' by '_' in string and open file596 for (int i=0; i<Service.size(); i++) if (Service[i] == '/') Service[i] = '_';597 return fopen((Dir + Service).c_str(), Mode);598 }599 389 600 390 // … … 604 394 605 395 // Static ensures calling of destructor by exit() 606 static DataHandler Data ;396 static DataHandler DataInstance; 607 397 608 398 // Sleep until signal caught -
Evidence/Edd/Edd.cc
r216 r221 73 73 ShowAsTime = false; 74 74 setFrame(false); 75 setAttribute(Qt::WA_DeleteOnClose); 75 76 76 77 // Connect to DIM handler … … 1145 1146 1146 1147 QGridLayout *Layout = new QGridLayout(this); 1148 setAttribute(Qt::WA_DeleteOnClose); 1147 1149 1148 1150 // Status display … … 1171 1173 1172 1174 QGridLayout *Layout = new QGridLayout(this); 1175 setAttribute(Qt::WA_DeleteOnClose); 1173 1176 EddLineDisplay *Line; 1174 1177 … … 1203 1206 TP_Feedback::TP_Feedback() { 1204 1207 1208 setAttribute(Qt::WA_DeleteOnClose); 1205 1209 QGridLayout *Layout = new QGridLayout(this); 1206 1210 EddLineDisplay *Line; … … 1237 1241 void TP_Feedback::FeedbackDetails() { 1238 1242 1243 setAttribute(Qt::WA_DeleteOnClose); 1239 1244 EddLineDisplay *Line; 1240 1245 QWidget *Widget = new QWidget(); … … 1257 1262 TP_DAQ::TP_DAQ() { 1258 1263 1264 setAttribute(Qt::WA_DeleteOnClose); 1259 1265 QGridLayout *Layout = new QGridLayout(this); 1260 1266 … … 1403 1409 TP_Evidence::TP_Evidence() { 1404 1410 1411 setAttribute(Qt::WA_DeleteOnClose); 1405 1412 QGridLayout *Layout = new QGridLayout(this); 1406 1413 EddLineDisplay *Line; … … 1473 1480 setCentralWidget(Central); 1474 1481 setStatusBar(new QStatusBar(this)); 1475 setGeometry(100, 100, 800, 650);1476 1482 setWindowTitle("Edd - Evidence Data Display"); 1477 1483 1478 1484 // Arrangement in tabs 1479 1485 TabWidget = new QTabWidget(Central); 1486 TabWidget->setTabsClosable(true); 1487 connect(TabWidget, SIGNAL(tabCloseRequested(int)), SLOT(DetachTab(int))); 1480 1488 TabWidget->addTab(new TP_DAQ, "Event scope"); 1481 TabWidget->addTab(new TP_Bias, " &Bias");1482 TabWidget->addTab(new TP_Feedback, " &Feedback");1483 TabWidget->addTab(new TP_Environment, " &Environment");1489 TabWidget->addTab(new TP_Bias, "Bias"); 1490 TabWidget->addTab(new TP_Feedback, "Feedback"); 1491 TabWidget->addTab(new TP_Environment, "Environment"); 1484 1492 TabWidget->addTab(new TP_Evidence, "Evidence"); 1485 1493 … … 1494 1502 1495 1503 // Show main window 1504 resize(TabWidget->sizeHint()*1.1); 1496 1505 show(); 1497 1506 } … … 1540 1549 } 1541 1550 1551 // Open tab as separate window 1552 void GUI::DetachTab(int Tab) { 1553 1554 QWidget *W = NULL; 1555 QMainWindow *M = new QMainWindow; 1556 1557 M->setCentralWidget(new QWidget(M)); 1558 M->setStatusBar(new QStatusBar(M)); 1559 1560 switch(Tab) { 1561 case 0: W = new TP_DAQ; break; 1562 case 1: W = new TP_Bias; break; 1563 case 2: W = new TP_Feedback; break; 1564 case 3: W = new TP_Environment; break; 1565 case 4: W = new TP_Evidence; break; 1566 default: break; 1567 } 1568 1569 if (W == NULL) { 1570 delete M->centralWidget(); 1571 delete M; 1572 return; 1573 } 1574 1575 W->setParent(M); 1576 M->resize(size()); 1577 M->setWindowTitle("Edd - " + TabWidget->tabText(Tab)); 1578 M->show(); 1579 } 1580 1542 1581 // Quit application when clicking close button on window 1543 1582 void GUI::closeEvent(QCloseEvent *) { -
Evidence/Edd/Edd.h
r216 r221 374 374 void MenuAbout(); 375 375 void MenuNewHistory(); 376 void DetachTab(int); 376 377 }; 377 378 -
Evidence/Evidence.cc
r216 r221 174 174 // Terminate if not successful 175 175 if (!EvidenceServer::ServiceOK(&Config)) { 176 Message(FATAL, "Configuration server unreachable, can't get '%s'", Item.c_str()); 176 if (Default == NULL) Message(FATAL, "Configuration server unreachable, can't get '%s'", Item.c_str()); 177 Result = (char *) Default; 177 178 } 178 179 -
Evidence/Makefile
r152 r221 4 4 PROG2=DColl 5 5 PROG3=Alarm 6 PROG4=Bridge 7 PROG5=History 6 8 7 9 CPPFLAGS += -I$(DIMDIR)/dim/ 8 10 LDLIBS += -lpthread $(DIMDIR)/linux/libdim.a 9 11 10 all: $(PROG1) $(PROG2) $(PROG3) 12 all: $(PROG1) $(PROG2) $(PROG3) $(PROG4) $(PROG5) 11 13 12 14 $(PROG1): $(PROG1).o Evidence.o … … 16 18 $(PROG3): $(PROG3).o Evidence.o 17 19 20 $(PROG4): $(PROG4).o Evidence.o 21 22 $(PROG5): $(PROG5).o Evidence.o 23 18 24 clean: 19 25 @rm -f $(PROG1) $(PROG1).o 20 26 @rm -f $(PROG2) $(PROG2).o 21 27 @rm -f $(PROG3) $(PROG3).o 28 @rm -f $(PROG4) $(PROG4).o 29 @rm -f $(PROG5) $(PROG5).o 22 30 @rm -f Evidence.o -
Evidence/readme.txt
r216 r221 31 31 yet in memory, reading from history file is tried. Improved error handling of 32 32 history files. 33 28/5/2010 Changed name of 'State' service to 'Message' to better reflect its functionality. Added client information to log file entries. 33 28/5/2010 Changed name of 'State' service to 'Message' to better reflect its functionality. 34 Added client information to log file entries. 35 30/5/2010 Created Bridge server that repeats services from one DNS to another. 36 Service quality now also written to slow data file. 37 31/5/2010 Configuration file format now follows semi-standard INI format. 38 7/6/2010 Separated History service from DColl. 34 39 35 40 36 Preliminary firewall settings (rule 9 for DIM, rule 10for X11 over ssh)41 Preliminary firewall settings on eth-vme02 (rule 5 for DIM, rule 6 for X11 over ssh) 37 42 38 43 Chain INPUT (policy ACCEPT) 39 44 num target prot opt source destination 40 1 RH-Firewall-1-INPUT all -- anywhere anywhere45 1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0 41 46 42 47 Chain FORWARD (policy ACCEPT) 43 48 num target prot opt source destination 44 1 RH-Firewall-1-INPUT all -- anywhere anywhere49 1 RH-Firewall-1-INPUT all -- 0.0.0.0/0 0.0.0.0/0 45 50 46 51 Chain OUTPUT (policy ACCEPT) … … 49 54 Chain RH-Firewall-1-INPUT (2 references) 50 55 num target prot opt source destination 51 1 ACCEPT icmp -- anywhere anywhere icmp any 52 2 ACCEPT ipv6-crypt-- anywhere anywhere 53 3 ACCEPT ipv6-auth-- anywhere anywhere 54 4 ACCEPT udp -- anywhere 224.0.0.251 udp dpt:5353 55 5 ACCEPT udp -- anywhere anywhere udp dpt:ipp 56 6 ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED 57 7 ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh 58 8 ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:sieve 59 9 ACCEPT tcp -- anywhere anywhere state NEW tcp dpts:5100:x11 60 10 ACCEPT tcp -- anywhere anywhere state NEW tcp dpts:x11:6063 61 11 REJECT all -- anywhere anywhere reject-with icmp-host-prohibited 56 1 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 255 57 2 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 58 3 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22 59 4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:2000 60 5 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:5100:6000 state NEW 61 6 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:6000:6063 state NEW 62 7 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Note:
See TracChangeset
for help on using the changeset viewer.