***********************
** FILE NAME : message.h
** SYSTEM NAME :
-** VERSION NUMBER : $Revision: 1.6 $
+** VERSION NUMBER : $Revision: 1.7 $
**
** DESCRIPTION : Classes to for handling client messages
**
********************************
** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
** CREATION DATE : Sep 16, 2002
-** LAST UPDATE : Apr 28, 2003
+** LAST UPDATE : Aug 06, 2003
** MODIFICATIONS :
**************************************************************************/
/*****************************
$Log: message.h,v $
- Revision 1.6 2003-04-29 09:16:44 arjen
+ Revision 1.7 2003-08-11 16:56:16 arjen
+ Different kinds of log files are parsed by a collection of objects
+ of different classes, derived from the base class line_cooker
+ Depending on the message content or the message_type element in
+ XML, one of these objects is selected.
+
+ Logrunner is integrated with gcm_input. Although its functionality
+ is still limited, a connection between logrunner and gcm_input
+ is beginning to form.
+
+ Revision 1.6 2003/04/29 09:16:44 arjen
Read XML input,
Only cooked log entries for now.
*****************************/
-/* static const char *RCSID = "$Id: message.h,v 1.6 2003-04-29 09:16:44 arjen Exp $"; */
+/* static const char *RCSID = "$Id: message.h,v 1.7 2003-08-11 16:56:16 arjen Exp $"; */
#include <iostream>
#include <list>
#include <libxml/parser.h>
+#include "line_cooker.h"
#include "database.h"
/*
//
// RELATIONS :
// SEE ALSO :
-// LAST MODIFIED : Apr 28, 2003
+// LAST MODIFIED : Aug 06, 2003
///////////////////////////////////////////////////////////////////////////
*/
UTC arrival; // When we got the message.
String service; // Service that created the message
+ std::list<line_cooker *> kitchen; // The collection of line cookers
+ line_cooker * pan; // The one we cook this log with
+
bool mail_header; // Does the message contain a mail header ?
bool gpg_encrypted; // Is the message encrypted ?
double certainty; // How certain are we about the message
enum
{
- UNKNOWN, SYSLOG, SYSLOG_IRIX, ACCESSLOG, ERRORLOG, RPMLIST,
- XML
+ UNKNOWN, RPMLIST, XML, COOKER_OBJECT
} classification;
client_message(std::istream *in, gnucomo_database db);
+ void add_cooker(line_cooker *lc)
+ {
+ kitchen.push_back(lc);
+ }
+
double classify(String host, UTC arrival = Now(), String serv = "");
int enter();
};