OSDN Git Service

Add SNMP code
author6638678 <6638678@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Tue, 28 Sep 2010 02:01:30 +0000 (02:01 +0000)
committer6638678 <6638678@1ed66053-1c2d-0410-8867-f7571e6e31d3>
Tue, 28 Sep 2010 02:01:30 +0000 (02:01 +0000)
git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel-epoll-cond@10313 1ed66053-1c2d-0410-8867-f7571e6e31d3

l7vsd/include/trapmessage.h [new file with mode: 0644]

diff --git a/l7vsd/include/trapmessage.h b/l7vsd/include/trapmessage.h
new file mode 100644 (file)
index 0000000..4efa35d
--- /dev/null
@@ -0,0 +1,65 @@
+/*!
+ * @file  trapmessage.h
+ * @brief snmp trap message header.
+ *
+ * L7VSD: Linux Virtual Server for Layer7 Load Balancing
+ * Copyright (C) 2010  NTT COMWARE Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef __TRAPMESSAGE_H__
+#define __TRAPMESSAGE_H__
+
+#include "error_code.h"
+
+namespace l7vs
+{
+        //! snmp trap message struct
+        struct trapmessage {
+                enum TRAP_TYPE_TAG {
+                        SERVICE_START = 0,
+                        SERVICE_STOP,
+                        VIRTUALSERVICE_ADD,
+                        VIRTUALSERVICE_CHANGE,
+                        VIRTUALSERVICE_REMOVE,
+                        REALSERVER_ADD,
+                        REALSERVER_CHANGE,
+                        REALSERVER_REMOVE,
+                        UPQOS_ALERT_ON,
+                        UPQOS_ALERT_OFF,
+                        DOWNQOS_ALERT_ON,
+                        DOWNQOS_ALERT_OFF,
+                        SESSIONPOOL_ALERT_ON,
+                        SESSIONPOOL_ALERT_OFF,
+                        DEBUG_LOG,
+                        INFO_LOG,
+                        WARN_LOG,
+                        ERROR_LOG,
+                        FATAL_LOG
+                };
+
+                std::string    message;
+                TRAP_TYPE_TAG  type;
+        };
+
+        //! typedef snmp send trap func type
+        typedef boost::function<void(trapmessage&, error_code&)>
+        snmp_send_trap_func_type;
+}
+
+#endif //__TRAPMESSAGE_H__
+