OSDN Git Service

Add SNMP code
[ultramonkey-l7/ultramonkey-l7-v3.git] / l7vsd / include / trapmessage.h
1 /*!
2  * @file  trapmessage.h
3  * @brief snmp trap message header.
4  *
5  * L7VSD: Linux Virtual Server for Layer7 Load Balancing
6  * Copyright (C) 2010  NTT COMWARE Corporation.
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  */
23
24 #ifndef __TRAPMESSAGE_H__
25 #define __TRAPMESSAGE_H__
26
27 #include "error_code.h"
28
29 namespace l7vs
30 {
31         //! snmp trap message struct
32         struct trapmessage {
33                 enum TRAP_TYPE_TAG {
34                         SERVICE_START = 0,
35                         SERVICE_STOP,
36                         VIRTUALSERVICE_ADD,
37                         VIRTUALSERVICE_CHANGE,
38                         VIRTUALSERVICE_REMOVE,
39                         REALSERVER_ADD,
40                         REALSERVER_CHANGE,
41                         REALSERVER_REMOVE,
42                         UPQOS_ALERT_ON,
43                         UPQOS_ALERT_OFF,
44                         DOWNQOS_ALERT_ON,
45                         DOWNQOS_ALERT_OFF,
46                         SESSIONPOOL_ALERT_ON,
47                         SESSIONPOOL_ALERT_OFF,
48                         DEBUG_LOG,
49                         INFO_LOG,
50                         WARN_LOG,
51                         ERROR_LOG,
52                         FATAL_LOG
53                 };
54
55                 std::string    message;
56                 TRAP_TYPE_TAG  type;
57         };
58
59         //! typedef snmp send trap func type
60         typedef boost::function<void(trapmessage&, error_code&)>
61         snmp_send_trap_func_type;
62 }
63
64 #endif //__TRAPMESSAGE_H__
65