2 /**************************************************************************
3 ** (c) Copyright 2002, Andromeda Technology & Automation
4 ***************************************************************************
5 ** MODULE INFORMATION *
6 ***********************
7 ** FILE NAME : message.h
9 ** VERSION NUMBER : $Revision: 1.1 $
11 ** DESCRIPTION : Classes to for handling client messages
16 ***************************************************************************
17 ** ADMINISTRATIVE INFORMATION *
18 ********************************
19 ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
20 ** CREATION DATE : Sep 16, 2002
21 ** LAST UPDATE : Oct 05, 2002
23 **************************************************************************/
25 /*****************************
27 Revision 1.1 2002-10-05 10:25:49 arjen
28 Creation of gcm_input and a first approach to a web interface
30 *****************************/
32 /* static const char *RCSID = "$Id: message.h,v 1.1 2002-10-05 10:25:49 arjen Exp $"; */
36 #include <AXE/String.h>
42 ///////////////////////////////////////////////////////////////////////////
43 // NAME : message_buffer
53 // LAST MODIFIED : Sep 30, 2002
54 ///////////////////////////////////////////////////////////////////////////
62 list<String>::iterator next_line;
69 next_line = buffer.begin();
72 message_buffer(istream *in)
75 next_line = buffer.begin();
78 void from(istream *in)
83 friend bool operator >> (message_buffer &, String &);
87 next_line = buffer.begin();
92 if (next_line != buffer.end())
100 if (next_line != buffer.begin())
108 ///////////////////////////////////////////////////////////////////////////
109 // NAME : client_message
113 // METHODS : classify()
120 // LAST MODIFIED : Oct 05, 2002
121 ///////////////////////////////////////////////////////////////////////////
126 String hostname; // Where the message came from (FQDN)
127 UTC arrival; // When we got the message.
128 String service; // Service that created the message
130 bool mail_header; // Does the message contain a mail header ?
131 bool gpg_encrypted; // Is the message encrypted ?
133 double certainty; // How certain are we about the message
136 UNKNOWN, SYSLOG, ACCESSLOG, ERRORLOG
140 message_buffer input;
141 gnucomo_database database;
145 client_message(istream *in, gnucomo_database db);
147 double classify(String host, UTC arrival = Now(), String serv = "");