• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révisionccf60d672ff0aeb73c8e836da47f019df76c7858 (tree)
l'heure2010-09-30 10:19:56
Auteur0809216 <0809216@1ed6...>
Commiter0809216

Message de Log

Merge

git-svn-id: http://10.144.169.20/repos/um/branches/l7vsd-3.x-ramiel-epoll-cond@10319 1ed66053-1c2d-0410-8867-f7571e6e31d3

Change Summary

  • delete: doc/mibs/Makefile
  • delete: snmpagent/Makefile.am
  • delete: snmpagent/Makefile.in
  • delete: snmpagent/MessengerClient.cpp
  • delete: snmpagent/MessengerClient.h
  • delete: snmpagent/QueueContainer.h
  • delete: snmpagent/ULTRAMONKEY-L7-MIB.txt
  • delete: snmpagent/UML7MIB.txt
  • delete: snmpagent/UltraMonkeyL7.c
  • delete: snmpagent/UltraMonkeyL7.h
  • delete: snmpagent/dispatch_message.cpp
  • delete: snmpagent/dispatch_message.h
  • delete: snmpagent/dispatcher.cpp
  • delete: snmpagent/dispatcher.h
  • delete: snmpagent/interproccom.cpp
  • delete: snmpagent/interproccom.h
  • delete: snmpagent/l7ag_parameter.h
  • delete: snmpagent/l7ag_socket.cpp
  • delete: snmpagent/l7ag_socket.h
  • delete: snmpagent/l7snmpagent.cpp
  • delete: snmpagent/lockedqueue.h
  • delete: snmpagent/message.h
  • delete: snmpagent/mibs.memo
  • delete: snmpagent/netsnmp_bridge.c
  • delete: snmpagent/netsnmp_bridge.h
  • delete: snmpagent/netsnmpbridge.c
  • delete: snmpagent/netsnmpbridge.h
  • delete: snmpagent/proc_message.h
  • delete: snmpagent/proc_mibcollectmessage.cpp
  • delete: snmpagent/proc_mibcollectmessage.h
  • delete: snmpagent/proc_settingrequest.cpp
  • delete: snmpagent/proc_settingrequest.h
  • delete: snmpagent/proc_trapsendrequest.cpp
  • delete: snmpagent/proc_trapsendrequest.h
  • delete: snmpagent/processcheck.cpp
  • delete: snmpagent/queue_sendtrap.cpp
  • delete: snmpagent/queue_sendtrap.h
  • delete: snmpagent/store_mibdata.cpp
  • delete: snmpagent/store_mibdata.h
  • delete: snmpagent/subagent.cpp
  • delete: snmpagent/subagent.h
  • delete: snmpagent/tag_threadstat.h
  • delete: snmpagent/tag_trapid.h
  • delete: snmpagent/trapdata.h
  • delete: snmpagent/watch_l7vsd.cpp
  • delete: snmpagent/watch_l7vsd.h

Modification

--- a/doc/mibs/Makefile
+++ /dev/null
@@ -1,362 +0,0 @@
1-# Makefile.in generated by automake 1.11.1 from Makefile.am.
2-# doc/mibs/Makefile. Generated from Makefile.in by configure.
3-
4-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6-# Inc.
7-# This Makefile.in is free software; the Free Software Foundation
8-# gives unlimited permission to copy and/or distribute it,
9-# with or without modifications, as long as this notice is preserved.
10-
11-# This program is distributed in the hope that it will be useful,
12-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14-# PARTICULAR PURPOSE.
15-
16-
17-
18-pkgdatadir = $(datadir)/l7vsd
19-pkgincludedir = $(includedir)/l7vsd
20-pkglibdir = $(libdir)/l7vsd
21-pkglibexecdir = $(libexecdir)/l7vsd
22-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
23-install_sh_DATA = $(install_sh) -c -m 644
24-install_sh_PROGRAM = $(install_sh) -c
25-install_sh_SCRIPT = $(install_sh) -c
26-INSTALL_HEADER = $(INSTALL_DATA)
27-transform = $(program_transform_name)
28-NORMAL_INSTALL = :
29-PRE_INSTALL = :
30-POST_INSTALL = :
31-NORMAL_UNINSTALL = :
32-PRE_UNINSTALL = :
33-POST_UNINSTALL = :
34-build_triplet = x86_64-unknown-linux-gnu
35-host_triplet = x86_64-unknown-linux-gnu
36-subdir = doc/mibs
37-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
38-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
39-am__aclocal_m4_deps = $(top_srcdir)/configure.in
40-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
41- $(ACLOCAL_M4)
42-mkinstalldirs = $(install_sh) -d
43-CONFIG_HEADER = $(top_builddir)/config.h
44-CONFIG_CLEAN_FILES =
45-CONFIG_CLEAN_VPATH_FILES =
46-SOURCES =
47-DIST_SOURCES =
48-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
49-ACLOCAL = ${SHELL} /home/hibari/marge/l7vsd-3.x-ramiel-epoll-cond/missing --run aclocal-1.11
50-AMTAR = ${SHELL} /home/hibari/marge/l7vsd-3.x-ramiel-epoll-cond/missing --run tar
51-AR = ar
52-AUTOCONF = ${SHELL} /home/hibari/marge/l7vsd-3.x-ramiel-epoll-cond/missing --run autoconf
53-AUTOHEADER = ${SHELL} /home/hibari/marge/l7vsd-3.x-ramiel-epoll-cond/missing --run autoheader
54-AUTOMAKE = ${SHELL} /home/hibari/marge/l7vsd-3.x-ramiel-epoll-cond/missing --run automake-1.11
55-AWK = gawk
56-CC = g++
57-CCDEPMODE = depmode=gcc3
58-CFLAGS = -g -O2
59-CPP = gcc -E
60-CPPFLAGS =
61-CXX = g++
62-CXXCPP = g++ -E
63-CXXDEPMODE = depmode=gcc3
64-CXXFLAGS = -g -O2
65-CYGPATH_W = echo
66-DEFS = -DHAVE_CONFIG_H
67-DEPDIR = .deps
68-DSYMUTIL =
69-DUMPBIN =
70-ECHO_C =
71-ECHO_N = -n
72-ECHO_T =
73-EGREP = /bin/grep -E
74-EXEEXT =
75-FGREP = /bin/grep -F
76-GREP = /bin/grep
77-INSTALL = /usr/bin/install -c
78-INSTALL_DATA = ${INSTALL} -m 644
79-INSTALL_PROGRAM = ${INSTALL}
80-INSTALL_SCRIPT = ${INSTALL}
81-INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
82-LD = /usr/bin/ld -m elf_x86_64
83-LDFLAGS =
84-LIBOBJS =
85-LIBS = -ldl
86-LIBTOOL = $(SHELL) $(top_builddir)/libtool
87-LIPO =
88-LN_S = ln -s
89-LTLIBOBJS =
90-MAKEINFO = ${SHELL} /home/hibari/marge/l7vsd-3.x-ramiel-epoll-cond/missing --run makeinfo
91-MANDIR =
92-MKDIR_P = /bin/mkdir -p
93-NM = /usr/bin/nm -B
94-NMEDIT =
95-OBJDUMP = objdump
96-OBJEXT = o
97-OTOOL =
98-OTOOL64 =
99-PACKAGE = l7vsd
100-PACKAGE_BUGREPORT =
101-PACKAGE_NAME =
102-PACKAGE_STRING =
103-PACKAGE_TARNAME =
104-PACKAGE_VERSION =
105-PATH_SEPARATOR = :
106-RANLIB = ranlib
107-SED = /bin/sed
108-SET_MAKE =
109-SHELL = /bin/sh
110-STRIP = strip
111-VERSION = 3.0.0
112-abs_builddir = /home/hibari/marge/l7vsd-3.x-ramiel-epoll-cond/doc/mibs
113-abs_srcdir = /home/hibari/marge/l7vsd-3.x-ramiel-epoll-cond/doc/mibs
114-abs_top_builddir = /home/hibari/marge/l7vsd-3.x-ramiel-epoll-cond
115-abs_top_srcdir = /home/hibari/marge/l7vsd-3.x-ramiel-epoll-cond
116-ac_ct_CC = gcc
117-ac_ct_CXX = g++
118-ac_ct_DUMPBIN =
119-am__include = include
120-am__leading_dot = .
121-am__quote =
122-am__tar = ${AMTAR} chof - "$$tardir"
123-am__untar = ${AMTAR} xf -
124-bindir = ${exec_prefix}/bin
125-build = x86_64-unknown-linux-gnu
126-build_alias =
127-build_cpu = x86_64
128-build_os = linux-gnu
129-build_vendor = unknown
130-builddir = .
131-datadir = ${datarootdir}
132-datarootdir = ${prefix}/share
133-docdir = ${datarootdir}/doc/${PACKAGE}
134-dvidir = ${docdir}
135-exec_prefix = /usr
136-external_agent_libs = -Wl,-E -Wl,-rpath,/usr/lib64/perl5/CORE
137-host = x86_64-unknown-linux-gnu
138-host_alias =
139-host_cpu = x86_64
140-host_os = linux-gnu
141-host_vendor = unknown
142-htmldir = ${docdir}
143-includedir = ${prefix}/include
144-infodir = ${datarootdir}/info
145-install_sh = ${SHELL} /home/hibari/marge/l7vsd-3.x-ramiel-epoll-cond/install-sh
146-l7vs_config = /etc/l7vs/l7vs.cf
147-l7vs_max_buffer_size = 4096
148-l7vs_moddir = /usr/lib64/l7vs
149-l7vsadm_sockdir = /var/run/l7vs
150-libdir = /usr/lib64
151-libexecdir = ${exec_prefix}/libexec
152-localedir = ${datarootdir}/locale
153-localstatedir = ${prefix}/var
154-lt_ECHO = echo
155-mandir = ${datarootdir}/man
156-mkdir_p = /bin/mkdir -p
157-oldincludedir = /usr/include
158-pdfdir = ${docdir}
159-prefix = /usr/local
160-program_transform_name = s,x,x,
161-psdir = ${docdir}
162-sbindir = ${exec_prefix}/sbin
163-sharedstatedir = ${prefix}/com
164-srcdir = .
165-sysconfdir = ${prefix}/etc
166-target_alias =
167-top_build_prefix = ../../
168-top_builddir = ../..
169-top_srcdir = ../..
170-ultramonkeyl7_version = ultramonkeyl7-3.0.0
171-AUTOMAKE_OPTIONS = foreign
172-L7VS_SNMP_MIBSDIR = /usr/share/snmp/mibs
173-all: all-am
174-
175-.SUFFIXES:
176-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
177- @for dep in $?; do \
178- case '$(am__configure_deps)' in \
179- *$$dep*) \
180- ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
181- && { if test -f $@; then exit 0; else break; fi; }; \
182- exit 1;; \
183- esac; \
184- done; \
185- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/mibs/Makefile'; \
186- $(am__cd) $(top_srcdir) && \
187- $(AUTOMAKE) --foreign doc/mibs/Makefile
188-.PRECIOUS: Makefile
189-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
190- @case '$?' in \
191- *config.status*) \
192- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
193- *) \
194- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
195- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
196- esac;
197-
198-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
199- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
200-
201-$(top_srcdir)/configure: $(am__configure_deps)
202- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
203-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
204- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
205-$(am__aclocal_m4_deps):
206-
207-mostlyclean-libtool:
208- -rm -f *.lo
209-
210-clean-libtool:
211- -rm -rf .libs _libs
212-tags: TAGS
213-TAGS:
214-
215-ctags: CTAGS
216-CTAGS:
217-
218-
219-distdir: $(DISTFILES)
220- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
221- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
222- list='$(DISTFILES)'; \
223- dist_files=`for file in $$list; do echo $$file; done | \
224- sed -e "s|^$$srcdirstrip/||;t" \
225- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
226- case $$dist_files in \
227- */*) $(MKDIR_P) `echo "$$dist_files" | \
228- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
229- sort -u` ;; \
230- esac; \
231- for file in $$dist_files; do \
232- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
233- if test -d $$d/$$file; then \
234- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
235- if test -d "$(distdir)/$$file"; then \
236- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
237- fi; \
238- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
239- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
240- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
241- fi; \
242- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
243- else \
244- test -f "$(distdir)/$$file" \
245- || cp -p $$d/$$file "$(distdir)/$$file" \
246- || exit 1; \
247- fi; \
248- done
249-check-am: all-am
250-check: check-am
251-all-am: Makefile
252-installdirs:
253-install-exec: install-exec-am
254-install-data: install-data-am
255-uninstall: uninstall-am
256-
257-install-am: all-am
258- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
259-
260-installcheck: installcheck-am
261-install-strip:
262- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
263- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
264- `test -z '$(STRIP)' || \
265- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
266-mostlyclean-generic:
267-
268-clean-generic:
269-
270-distclean-generic:
271- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
272- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
273-
274-maintainer-clean-generic:
275- @echo "This command is intended for maintainers to use"
276- @echo "it deletes files that may require special tools to rebuild."
277-clean: clean-am
278-
279-clean-am: clean-generic clean-libtool mostlyclean-am
280-
281-distclean: distclean-am
282- -rm -f Makefile
283-distclean-am: clean-am distclean-generic
284-
285-dvi: dvi-am
286-
287-dvi-am:
288-
289-html: html-am
290-
291-html-am:
292-
293-info: info-am
294-
295-info-am:
296-
297-install-data-am:
298-
299-install-dvi: install-dvi-am
300-
301-install-dvi-am:
302-
303-install-exec-am:
304-
305-install-html: install-html-am
306-
307-install-html-am:
308-
309-install-info: install-info-am
310-
311-install-info-am:
312-
313-install-man:
314-
315-install-pdf: install-pdf-am
316-
317-install-pdf-am:
318-
319-install-ps: install-ps-am
320-
321-install-ps-am:
322-
323-installcheck-am:
324-
325-maintainer-clean: maintainer-clean-am
326- -rm -f Makefile
327-maintainer-clean-am: distclean-am maintainer-clean-generic
328-
329-mostlyclean: mostlyclean-am
330-
331-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
332-
333-pdf: pdf-am
334-
335-pdf-am:
336-
337-ps: ps-am
338-
339-ps-am:
340-
341-uninstall-am:
342-
343-.MAKE: install-am install-strip
344-
345-.PHONY: all all-am check check-am clean clean-generic clean-libtool \
346- distclean distclean-generic distclean-libtool distdir dvi \
347- dvi-am html html-am info info-am install install-am \
348- install-data install-data-am install-dvi install-dvi-am \
349- install-exec install-exec-am install-html install-html-am \
350- install-info install-info-am install-man install-pdf \
351- install-pdf-am install-ps install-ps-am install-strip \
352- installcheck installcheck-am installdirs maintainer-clean \
353- maintainer-clean-generic mostlyclean mostlyclean-generic \
354- mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am
355-
356-
357-install:
358- $(INSTALL) -b -m 644 -D ./ULTRAMONKEY-L7-MIB.txt $(L7VS_SNMP_MIBSDIR)/ULTRAMONKEY-L7-MIB.txt
359-
360-# Tell versions [3.59,3.63) of GNU make to not export all variables.
361-# Otherwise a system limit (for SysV at least) may be exceeded.
362-.NOEXPORT:
--- a/snmpagent/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
1-AUTOMAKE_OPTIONS = foreign
2-bin_PROGRAMS = l7snmpagent
3-SNMPAGENT_OPTS = @snmpagent_libs@
4-
5-l7snmpagent_SOURCES = \
6- ../logger/logger_wrapper.h \
7- ../parameter/parameter_wrapper.h \
8- lockedqueue.h \
9- QueueContainer.h \
10- MessengerClient.h \
11- dispatcher.h \
12- store_mibdata.h \
13- netsnmp_bridge.h \
14- subagent.h \
15- tag_threadstat.h \
16- MessengerClient.cpp \
17- dispatcher.cpp \
18- store_mibdata.cpp \
19- netsnmp_bridge.c \
20- subagent.cpp \
21- l7snmpagent.cpp
22-
23-l7snmpagent_CPPFLAGS = \
24- -O2 -Wall -Werror -g -pthread \
25- -I../include -I../logger -I../parameter \
26- -I/usr/include/ucd-snmp -DLOGGER_PROCESS_SNM
27-
28-l7snmpagent_LDADD = \
29- ../logger/libsnmpagent_logger.a \
30- ../parameter/libsnmpagent_parameter.a \
31- -llog4cxx \
32- -lboost_thread-gcc41-mt \
33- $(SNMPAGENT_OPTS) \
34- -lrt
--- a/snmpagent/Makefile.in
+++ /dev/null
@@ -1,607 +0,0 @@
1-# Makefile.in generated by automake 1.9.6 from Makefile.am.
2-# @configure_input@
3-
4-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5-# 2003, 2004, 2005 Free Software Foundation, Inc.
6-# This Makefile.in is free software; the Free Software Foundation
7-# gives unlimited permission to copy and/or distribute it,
8-# with or without modifications, as long as this notice is preserved.
9-
10-# This program is distributed in the hope that it will be useful,
11-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13-# PARTICULAR PURPOSE.
14-
15-@SET_MAKE@
16-
17-srcdir = @srcdir@
18-top_srcdir = @top_srcdir@
19-VPATH = @srcdir@
20-pkgdatadir = $(datadir)/@PACKAGE@
21-pkglibdir = $(libdir)/@PACKAGE@
22-pkgincludedir = $(includedir)/@PACKAGE@
23-top_builddir = ..
24-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
25-INSTALL = @INSTALL@
26-install_sh_DATA = $(install_sh) -c -m 644
27-install_sh_PROGRAM = $(install_sh) -c
28-install_sh_SCRIPT = $(install_sh) -c
29-INSTALL_HEADER = $(INSTALL_DATA)
30-transform = $(program_transform_name)
31-NORMAL_INSTALL = :
32-PRE_INSTALL = :
33-POST_INSTALL = :
34-NORMAL_UNINSTALL = :
35-PRE_UNINSTALL = :
36-POST_UNINSTALL = :
37-build_triplet = @build@
38-host_triplet = @host@
39-bin_PROGRAMS = l7snmpagent$(EXEEXT)
40-subdir = snmpagent
41-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
42-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
43-am__aclocal_m4_deps = $(top_srcdir)/configure.in
44-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
45- $(ACLOCAL_M4)
46-mkinstalldirs = $(install_sh) -d
47-CONFIG_HEADER = $(top_builddir)/config.h
48-CONFIG_CLEAN_FILES =
49-am__installdirs = "$(DESTDIR)$(bindir)"
50-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
51-PROGRAMS = $(bin_PROGRAMS)
52-am_l7snmpagent_OBJECTS = l7snmpagent-MessengerClient.$(OBJEXT) \
53- l7snmpagent-dispatcher.$(OBJEXT) \
54- l7snmpagent-store_mibdata.$(OBJEXT) \
55- l7snmpagent-netsnmp_bridge.$(OBJEXT) \
56- l7snmpagent-subagent.$(OBJEXT) \
57- l7snmpagent-l7snmpagent.$(OBJEXT)
58-l7snmpagent_OBJECTS = $(am_l7snmpagent_OBJECTS)
59-am__DEPENDENCIES_1 =
60-l7snmpagent_DEPENDENCIES = ../logger/libsnmpagent_logger.a \
61- ../parameter/libsnmpagent_parameter.a $(am__DEPENDENCIES_1)
62-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
63-depcomp = $(SHELL) $(top_srcdir)/depcomp
64-am__depfiles_maybe = depfiles
65-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
66- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
67-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
68- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
69- $(AM_CFLAGS) $(CFLAGS)
70-CCLD = $(CC)
71-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
72- $(AM_LDFLAGS) $(LDFLAGS) -o $@
73-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
74- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
75-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
76- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
77- $(AM_CXXFLAGS) $(CXXFLAGS)
78-CXXLD = $(CXX)
79-CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
80- $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
81-SOURCES = $(l7snmpagent_SOURCES)
82-DIST_SOURCES = $(l7snmpagent_SOURCES)
83-ETAGS = etags
84-CTAGS = ctags
85-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
86-ACLOCAL = @ACLOCAL@
87-AMDEP_FALSE = @AMDEP_FALSE@
88-AMDEP_TRUE = @AMDEP_TRUE@
89-AMTAR = @AMTAR@
90-AR = @AR@
91-AUTOCONF = @AUTOCONF@
92-AUTOHEADER = @AUTOHEADER@
93-AUTOMAKE = @AUTOMAKE@
94-AWK = @AWK@
95-CC = @CC@
96-CCDEPMODE = @CCDEPMODE@
97-CFLAGS = @CFLAGS@
98-CPP = @CPP@
99-CPPFLAGS = @CPPFLAGS@
100-CXX = @CXX@
101-CXXCPP = @CXXCPP@
102-CXXDEPMODE = @CXXDEPMODE@
103-CXXFLAGS = @CXXFLAGS@
104-CYGPATH_W = @CYGPATH_W@
105-DEFS = @DEFS@
106-DEPDIR = @DEPDIR@
107-ECHO = @ECHO@
108-ECHO_C = @ECHO_C@
109-ECHO_N = @ECHO_N@
110-ECHO_T = @ECHO_T@
111-EGREP = @EGREP@
112-EXEEXT = @EXEEXT@
113-F77 = @F77@
114-FFLAGS = @FFLAGS@
115-INSTALL_DATA = @INSTALL_DATA@
116-INSTALL_PROGRAM = @INSTALL_PROGRAM@
117-INSTALL_SCRIPT = @INSTALL_SCRIPT@
118-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
119-LDFLAGS = @LDFLAGS@
120-LIBOBJS = @LIBOBJS@
121-LIBS = @LIBS@
122-LIBTOOL = @LIBTOOL@
123-LN_S = @LN_S@
124-LTLIBOBJS = @LTLIBOBJS@
125-MAKEINFO = @MAKEINFO@
126-MANDIR = @MANDIR@
127-OBJEXT = @OBJEXT@
128-PACKAGE = @PACKAGE@
129-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
130-PACKAGE_NAME = @PACKAGE_NAME@
131-PACKAGE_STRING = @PACKAGE_STRING@
132-PACKAGE_TARNAME = @PACKAGE_TARNAME@
133-PACKAGE_VERSION = @PACKAGE_VERSION@
134-PATH_SEPARATOR = @PATH_SEPARATOR@
135-RANLIB = @RANLIB@
136-SED = @SED@
137-SET_MAKE = @SET_MAKE@
138-SHELL = @SHELL@
139-STRIP = @STRIP@
140-VERSION = @VERSION@
141-ac_ct_AR = @ac_ct_AR@
142-ac_ct_CC = @ac_ct_CC@
143-ac_ct_CXX = @ac_ct_CXX@
144-ac_ct_F77 = @ac_ct_F77@
145-ac_ct_RANLIB = @ac_ct_RANLIB@
146-ac_ct_STRIP = @ac_ct_STRIP@
147-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
148-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
149-am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
150-am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
151-am__include = @am__include@
152-am__leading_dot = @am__leading_dot@
153-am__quote = @am__quote@
154-am__tar = @am__tar@
155-am__untar = @am__untar@
156-bindir = @bindir@
157-build = @build@
158-build_alias = @build_alias@
159-build_cpu = @build_cpu@
160-build_os = @build_os@
161-build_vendor = @build_vendor@
162-datadir = @datadir@
163-exec_prefix = @exec_prefix@
164-host = @host@
165-host_alias = @host_alias@
166-host_cpu = @host_cpu@
167-host_os = @host_os@
168-host_vendor = @host_vendor@
169-includedir = @includedir@
170-infodir = @infodir@
171-install_sh = @install_sh@
172-l7vs_config = @l7vs_config@
173-l7vs_max_buffer_size = @l7vs_max_buffer_size@
174-l7vs_moddir = @l7vs_moddir@
175-l7vsadm_sockdir = @l7vsadm_sockdir@
176-libdir = @libdir@
177-libexecdir = @libexecdir@
178-localstatedir = @localstatedir@
179-mandir = @mandir@
180-mkdir_p = @mkdir_p@
181-oldincludedir = @oldincludedir@
182-prefix = @prefix@
183-program_transform_name = @program_transform_name@
184-sbindir = @sbindir@
185-sharedstatedir = @sharedstatedir@
186-snmpagent_libs = @snmpagent_libs@
187-sysconfdir = @sysconfdir@
188-target_alias = @target_alias@
189-ultramonkeyl7_version = @ultramonkeyl7_version@
190-AUTOMAKE_OPTIONS = foreign
191-SNMPAGENT_OPTS = @snmpagent_libs@
192-l7snmpagent_SOURCES = \
193- ../logger/logger_wrapper.h \
194- ../parameter/parameter_wrapper.h \
195- lockedqueue.h \
196- QueueContainer.h \
197- MessengerClient.h \
198- dispatcher.h \
199- store_mibdata.h \
200- netsnmp_bridge.h \
201- subagent.h \
202- tag_threadstat.h \
203- MessengerClient.cpp \
204- dispatcher.cpp \
205- store_mibdata.cpp \
206- netsnmp_bridge.c \
207- subagent.cpp \
208- l7snmpagent.cpp
209-
210-l7snmpagent_CPPFLAGS = \
211- -O2 -Wall -Werror -g -pthread \
212- -I../include -I../logger -I../parameter \
213- -I/usr/include/ucd-snmp -DLOGGER_PROCESS_SNM
214-
215-l7snmpagent_LDADD = \
216- ../logger/libsnmpagent_logger.a \
217- ../parameter/libsnmpagent_parameter.a \
218- -llog4cxx \
219- -lboost_thread-gcc41-mt \
220- $(SNMPAGENT_OPTS) \
221- -lrt
222-
223-all: all-am
224-
225-.SUFFIXES:
226-.SUFFIXES: .c .cpp .lo .o .obj
227-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
228- @for dep in $?; do \
229- case '$(am__configure_deps)' in \
230- *$$dep*) \
231- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
232- && exit 0; \
233- exit 1;; \
234- esac; \
235- done; \
236- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign snmpagent/Makefile'; \
237- cd $(top_srcdir) && \
238- $(AUTOMAKE) --foreign snmpagent/Makefile
239-.PRECIOUS: Makefile
240-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
241- @case '$?' in \
242- *config.status*) \
243- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
244- *) \
245- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
246- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
247- esac;
248-
249-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
250- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
251-
252-$(top_srcdir)/configure: $(am__configure_deps)
253- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
254-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
255- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
256-install-binPROGRAMS: $(bin_PROGRAMS)
257- @$(NORMAL_INSTALL)
258- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
259- @list='$(bin_PROGRAMS)'; for p in $$list; do \
260- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
261- if test -f $$p \
262- || test -f $$p1 \
263- ; then \
264- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
265- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
266- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
267- else :; fi; \
268- done
269-
270-uninstall-binPROGRAMS:
271- @$(NORMAL_UNINSTALL)
272- @list='$(bin_PROGRAMS)'; for p in $$list; do \
273- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
274- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
275- rm -f "$(DESTDIR)$(bindir)/$$f"; \
276- done
277-
278-clean-binPROGRAMS:
279- @list='$(bin_PROGRAMS)'; for p in $$list; do \
280- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
281- echo " rm -f $$p $$f"; \
282- rm -f $$p $$f ; \
283- done
284-l7snmpagent$(EXEEXT): $(l7snmpagent_OBJECTS) $(l7snmpagent_DEPENDENCIES)
285- @rm -f l7snmpagent$(EXEEXT)
286- $(CXXLINK) $(l7snmpagent_LDFLAGS) $(l7snmpagent_OBJECTS) $(l7snmpagent_LDADD) $(LIBS)
287-
288-mostlyclean-compile:
289- -rm -f *.$(OBJEXT)
290-
291-distclean-compile:
292- -rm -f *.tab.c
293-
294-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/l7snmpagent-MessengerClient.Po@am__quote@
295-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/l7snmpagent-dispatcher.Po@am__quote@
296-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/l7snmpagent-l7snmpagent.Po@am__quote@
297-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/l7snmpagent-netsnmp_bridge.Po@am__quote@
298-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/l7snmpagent-store_mibdata.Po@am__quote@
299-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/l7snmpagent-subagent.Po@am__quote@
300-
301-.c.o:
302-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
303-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
304-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
305-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
306-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
307-
308-.c.obj:
309-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
310-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
311-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
312-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
313-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
314-
315-.c.lo:
316-@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
317-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
318-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
319-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
320-@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
321-
322-l7snmpagent-netsnmp_bridge.o: netsnmp_bridge.c
323-@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT l7snmpagent-netsnmp_bridge.o -MD -MP -MF "$(DEPDIR)/l7snmpagent-netsnmp_bridge.Tpo" -c -o l7snmpagent-netsnmp_bridge.o `test -f 'netsnmp_bridge.c' || echo '$(srcdir)/'`netsnmp_bridge.c; \
324-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-netsnmp_bridge.Tpo" "$(DEPDIR)/l7snmpagent-netsnmp_bridge.Po"; else rm -f "$(DEPDIR)/l7snmpagent-netsnmp_bridge.Tpo"; exit 1; fi
325-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='netsnmp_bridge.c' object='l7snmpagent-netsnmp_bridge.o' libtool=no @AMDEPBACKSLASH@
326-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
327-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o l7snmpagent-netsnmp_bridge.o `test -f 'netsnmp_bridge.c' || echo '$(srcdir)/'`netsnmp_bridge.c
328-
329-l7snmpagent-netsnmp_bridge.obj: netsnmp_bridge.c
330-@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT l7snmpagent-netsnmp_bridge.obj -MD -MP -MF "$(DEPDIR)/l7snmpagent-netsnmp_bridge.Tpo" -c -o l7snmpagent-netsnmp_bridge.obj `if test -f 'netsnmp_bridge.c'; then $(CYGPATH_W) 'netsnmp_bridge.c'; else $(CYGPATH_W) '$(srcdir)/netsnmp_bridge.c'; fi`; \
331-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-netsnmp_bridge.Tpo" "$(DEPDIR)/l7snmpagent-netsnmp_bridge.Po"; else rm -f "$(DEPDIR)/l7snmpagent-netsnmp_bridge.Tpo"; exit 1; fi
332-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='netsnmp_bridge.c' object='l7snmpagent-netsnmp_bridge.obj' libtool=no @AMDEPBACKSLASH@
333-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
334-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o l7snmpagent-netsnmp_bridge.obj `if test -f 'netsnmp_bridge.c'; then $(CYGPATH_W) 'netsnmp_bridge.c'; else $(CYGPATH_W) '$(srcdir)/netsnmp_bridge.c'; fi`
335-
336-.cpp.o:
337-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
338-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
339-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
340-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
341-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
342-
343-.cpp.obj:
344-@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
345-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
346-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
347-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
348-@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
349-
350-.cpp.lo:
351-@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
352-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
353-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
354-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
355-@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
356-
357-l7snmpagent-MessengerClient.o: MessengerClient.cpp
358-@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT l7snmpagent-MessengerClient.o -MD -MP -MF "$(DEPDIR)/l7snmpagent-MessengerClient.Tpo" -c -o l7snmpagent-MessengerClient.o `test -f 'MessengerClient.cpp' || echo '$(srcdir)/'`MessengerClient.cpp; \
359-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-MessengerClient.Tpo" "$(DEPDIR)/l7snmpagent-MessengerClient.Po"; else rm -f "$(DEPDIR)/l7snmpagent-MessengerClient.Tpo"; exit 1; fi
360-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='MessengerClient.cpp' object='l7snmpagent-MessengerClient.o' libtool=no @AMDEPBACKSLASH@
361-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
362-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o l7snmpagent-MessengerClient.o `test -f 'MessengerClient.cpp' || echo '$(srcdir)/'`MessengerClient.cpp
363-
364-l7snmpagent-MessengerClient.obj: MessengerClient.cpp
365-@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT l7snmpagent-MessengerClient.obj -MD -MP -MF "$(DEPDIR)/l7snmpagent-MessengerClient.Tpo" -c -o l7snmpagent-MessengerClient.obj `if test -f 'MessengerClient.cpp'; then $(CYGPATH_W) 'MessengerClient.cpp'; else $(CYGPATH_W) '$(srcdir)/MessengerClient.cpp'; fi`; \
366-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-MessengerClient.Tpo" "$(DEPDIR)/l7snmpagent-MessengerClient.Po"; else rm -f "$(DEPDIR)/l7snmpagent-MessengerClient.Tpo"; exit 1; fi
367-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='MessengerClient.cpp' object='l7snmpagent-MessengerClient.obj' libtool=no @AMDEPBACKSLASH@
368-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
369-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o l7snmpagent-MessengerClient.obj `if test -f 'MessengerClient.cpp'; then $(CYGPATH_W) 'MessengerClient.cpp'; else $(CYGPATH_W) '$(srcdir)/MessengerClient.cpp'; fi`
370-
371-l7snmpagent-dispatcher.o: dispatcher.cpp
372-@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT l7snmpagent-dispatcher.o -MD -MP -MF "$(DEPDIR)/l7snmpagent-dispatcher.Tpo" -c -o l7snmpagent-dispatcher.o `test -f 'dispatcher.cpp' || echo '$(srcdir)/'`dispatcher.cpp; \
373-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-dispatcher.Tpo" "$(DEPDIR)/l7snmpagent-dispatcher.Po"; else rm -f "$(DEPDIR)/l7snmpagent-dispatcher.Tpo"; exit 1; fi
374-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dispatcher.cpp' object='l7snmpagent-dispatcher.o' libtool=no @AMDEPBACKSLASH@
375-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
376-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o l7snmpagent-dispatcher.o `test -f 'dispatcher.cpp' || echo '$(srcdir)/'`dispatcher.cpp
377-
378-l7snmpagent-dispatcher.obj: dispatcher.cpp
379-@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT l7snmpagent-dispatcher.obj -MD -MP -MF "$(DEPDIR)/l7snmpagent-dispatcher.Tpo" -c -o l7snmpagent-dispatcher.obj `if test -f 'dispatcher.cpp'; then $(CYGPATH_W) 'dispatcher.cpp'; else $(CYGPATH_W) '$(srcdir)/dispatcher.cpp'; fi`; \
380-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-dispatcher.Tpo" "$(DEPDIR)/l7snmpagent-dispatcher.Po"; else rm -f "$(DEPDIR)/l7snmpagent-dispatcher.Tpo"; exit 1; fi
381-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='dispatcher.cpp' object='l7snmpagent-dispatcher.obj' libtool=no @AMDEPBACKSLASH@
382-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
383-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o l7snmpagent-dispatcher.obj `if test -f 'dispatcher.cpp'; then $(CYGPATH_W) 'dispatcher.cpp'; else $(CYGPATH_W) '$(srcdir)/dispatcher.cpp'; fi`
384-
385-l7snmpagent-store_mibdata.o: store_mibdata.cpp
386-@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT l7snmpagent-store_mibdata.o -MD -MP -MF "$(DEPDIR)/l7snmpagent-store_mibdata.Tpo" -c -o l7snmpagent-store_mibdata.o `test -f 'store_mibdata.cpp' || echo '$(srcdir)/'`store_mibdata.cpp; \
387-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-store_mibdata.Tpo" "$(DEPDIR)/l7snmpagent-store_mibdata.Po"; else rm -f "$(DEPDIR)/l7snmpagent-store_mibdata.Tpo"; exit 1; fi
388-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='store_mibdata.cpp' object='l7snmpagent-store_mibdata.o' libtool=no @AMDEPBACKSLASH@
389-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
390-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o l7snmpagent-store_mibdata.o `test -f 'store_mibdata.cpp' || echo '$(srcdir)/'`store_mibdata.cpp
391-
392-l7snmpagent-store_mibdata.obj: store_mibdata.cpp
393-@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT l7snmpagent-store_mibdata.obj -MD -MP -MF "$(DEPDIR)/l7snmpagent-store_mibdata.Tpo" -c -o l7snmpagent-store_mibdata.obj `if test -f 'store_mibdata.cpp'; then $(CYGPATH_W) 'store_mibdata.cpp'; else $(CYGPATH_W) '$(srcdir)/store_mibdata.cpp'; fi`; \
394-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-store_mibdata.Tpo" "$(DEPDIR)/l7snmpagent-store_mibdata.Po"; else rm -f "$(DEPDIR)/l7snmpagent-store_mibdata.Tpo"; exit 1; fi
395-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='store_mibdata.cpp' object='l7snmpagent-store_mibdata.obj' libtool=no @AMDEPBACKSLASH@
396-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
397-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o l7snmpagent-store_mibdata.obj `if test -f 'store_mibdata.cpp'; then $(CYGPATH_W) 'store_mibdata.cpp'; else $(CYGPATH_W) '$(srcdir)/store_mibdata.cpp'; fi`
398-
399-l7snmpagent-subagent.o: subagent.cpp
400-@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT l7snmpagent-subagent.o -MD -MP -MF "$(DEPDIR)/l7snmpagent-subagent.Tpo" -c -o l7snmpagent-subagent.o `test -f 'subagent.cpp' || echo '$(srcdir)/'`subagent.cpp; \
401-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-subagent.Tpo" "$(DEPDIR)/l7snmpagent-subagent.Po"; else rm -f "$(DEPDIR)/l7snmpagent-subagent.Tpo"; exit 1; fi
402-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='subagent.cpp' object='l7snmpagent-subagent.o' libtool=no @AMDEPBACKSLASH@
403-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
404-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o l7snmpagent-subagent.o `test -f 'subagent.cpp' || echo '$(srcdir)/'`subagent.cpp
405-
406-l7snmpagent-subagent.obj: subagent.cpp
407-@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT l7snmpagent-subagent.obj -MD -MP -MF "$(DEPDIR)/l7snmpagent-subagent.Tpo" -c -o l7snmpagent-subagent.obj `if test -f 'subagent.cpp'; then $(CYGPATH_W) 'subagent.cpp'; else $(CYGPATH_W) '$(srcdir)/subagent.cpp'; fi`; \
408-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-subagent.Tpo" "$(DEPDIR)/l7snmpagent-subagent.Po"; else rm -f "$(DEPDIR)/l7snmpagent-subagent.Tpo"; exit 1; fi
409-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='subagent.cpp' object='l7snmpagent-subagent.obj' libtool=no @AMDEPBACKSLASH@
410-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
411-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o l7snmpagent-subagent.obj `if test -f 'subagent.cpp'; then $(CYGPATH_W) 'subagent.cpp'; else $(CYGPATH_W) '$(srcdir)/subagent.cpp'; fi`
412-
413-l7snmpagent-l7snmpagent.o: l7snmpagent.cpp
414-@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT l7snmpagent-l7snmpagent.o -MD -MP -MF "$(DEPDIR)/l7snmpagent-l7snmpagent.Tpo" -c -o l7snmpagent-l7snmpagent.o `test -f 'l7snmpagent.cpp' || echo '$(srcdir)/'`l7snmpagent.cpp; \
415-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-l7snmpagent.Tpo" "$(DEPDIR)/l7snmpagent-l7snmpagent.Po"; else rm -f "$(DEPDIR)/l7snmpagent-l7snmpagent.Tpo"; exit 1; fi
416-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='l7snmpagent.cpp' object='l7snmpagent-l7snmpagent.o' libtool=no @AMDEPBACKSLASH@
417-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
418-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o l7snmpagent-l7snmpagent.o `test -f 'l7snmpagent.cpp' || echo '$(srcdir)/'`l7snmpagent.cpp
419-
420-l7snmpagent-l7snmpagent.obj: l7snmpagent.cpp
421-@am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT l7snmpagent-l7snmpagent.obj -MD -MP -MF "$(DEPDIR)/l7snmpagent-l7snmpagent.Tpo" -c -o l7snmpagent-l7snmpagent.obj `if test -f 'l7snmpagent.cpp'; then $(CYGPATH_W) 'l7snmpagent.cpp'; else $(CYGPATH_W) '$(srcdir)/l7snmpagent.cpp'; fi`; \
422-@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/l7snmpagent-l7snmpagent.Tpo" "$(DEPDIR)/l7snmpagent-l7snmpagent.Po"; else rm -f "$(DEPDIR)/l7snmpagent-l7snmpagent.Tpo"; exit 1; fi
423-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='l7snmpagent.cpp' object='l7snmpagent-l7snmpagent.obj' libtool=no @AMDEPBACKSLASH@
424-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
425-@am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(l7snmpagent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o l7snmpagent-l7snmpagent.obj `if test -f 'l7snmpagent.cpp'; then $(CYGPATH_W) 'l7snmpagent.cpp'; else $(CYGPATH_W) '$(srcdir)/l7snmpagent.cpp'; fi`
426-
427-mostlyclean-libtool:
428- -rm -f *.lo
429-
430-clean-libtool:
431- -rm -rf .libs _libs
432-
433-distclean-libtool:
434- -rm -f libtool
435-uninstall-info-am:
436-
437-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
438- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
439- unique=`for i in $$list; do \
440- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
441- done | \
442- $(AWK) ' { files[$$0] = 1; } \
443- END { for (i in files) print i; }'`; \
444- mkid -fID $$unique
445-tags: TAGS
446-
447-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
448- $(TAGS_FILES) $(LISP)
449- tags=; \
450- here=`pwd`; \
451- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
452- unique=`for i in $$list; do \
453- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
454- done | \
455- $(AWK) ' { files[$$0] = 1; } \
456- END { for (i in files) print i; }'`; \
457- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
458- test -n "$$unique" || unique=$$empty_fix; \
459- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
460- $$tags $$unique; \
461- fi
462-ctags: CTAGS
463-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
464- $(TAGS_FILES) $(LISP)
465- tags=; \
466- here=`pwd`; \
467- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
468- unique=`for i in $$list; do \
469- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
470- done | \
471- $(AWK) ' { files[$$0] = 1; } \
472- END { for (i in files) print i; }'`; \
473- test -z "$(CTAGS_ARGS)$$tags$$unique" \
474- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
475- $$tags $$unique
476-
477-GTAGS:
478- here=`$(am__cd) $(top_builddir) && pwd` \
479- && cd $(top_srcdir) \
480- && gtags -i $(GTAGS_ARGS) $$here
481-
482-distclean-tags:
483- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
484-
485-distdir: $(DISTFILES)
486- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
487- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
488- list='$(DISTFILES)'; for file in $$list; do \
489- case $$file in \
490- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
491- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
492- esac; \
493- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
494- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
495- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
496- dir="/$$dir"; \
497- $(mkdir_p) "$(distdir)$$dir"; \
498- else \
499- dir=''; \
500- fi; \
501- if test -d $$d/$$file; then \
502- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
503- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
504- fi; \
505- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
506- else \
507- test -f $(distdir)/$$file \
508- || cp -p $$d/$$file $(distdir)/$$file \
509- || exit 1; \
510- fi; \
511- done
512-check-am: all-am
513-check: check-am
514-all-am: Makefile $(PROGRAMS)
515-installdirs:
516- for dir in "$(DESTDIR)$(bindir)"; do \
517- test -z "$$dir" || $(mkdir_p) "$$dir"; \
518- done
519-install: install-am
520-install-exec: install-exec-am
521-install-data: install-data-am
522-uninstall: uninstall-am
523-
524-install-am: all-am
525- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
526-
527-installcheck: installcheck-am
528-install-strip:
529- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
530- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
531- `test -z '$(STRIP)' || \
532- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
533-mostlyclean-generic:
534-
535-clean-generic:
536-
537-distclean-generic:
538- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
539-
540-maintainer-clean-generic:
541- @echo "This command is intended for maintainers to use"
542- @echo "it deletes files that may require special tools to rebuild."
543-clean: clean-am
544-
545-clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
546-
547-distclean: distclean-am
548- -rm -rf ./$(DEPDIR)
549- -rm -f Makefile
550-distclean-am: clean-am distclean-compile distclean-generic \
551- distclean-libtool distclean-tags
552-
553-dvi: dvi-am
554-
555-dvi-am:
556-
557-html: html-am
558-
559-info: info-am
560-
561-info-am:
562-
563-install-data-am:
564-
565-install-exec-am: install-binPROGRAMS
566-
567-install-info: install-info-am
568-
569-install-man:
570-
571-installcheck-am:
572-
573-maintainer-clean: maintainer-clean-am
574- -rm -rf ./$(DEPDIR)
575- -rm -f Makefile
576-maintainer-clean-am: distclean-am maintainer-clean-generic
577-
578-mostlyclean: mostlyclean-am
579-
580-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
581- mostlyclean-libtool
582-
583-pdf: pdf-am
584-
585-pdf-am:
586-
587-ps: ps-am
588-
589-ps-am:
590-
591-uninstall-am: uninstall-binPROGRAMS uninstall-info-am
592-
593-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
594- clean-generic clean-libtool ctags distclean distclean-compile \
595- distclean-generic distclean-libtool distclean-tags distdir dvi \
596- dvi-am html html-am info info-am install install-am \
597- install-binPROGRAMS install-data install-data-am install-exec \
598- install-exec-am install-info install-info-am install-man \
599- install-strip installcheck installcheck-am installdirs \
600- maintainer-clean maintainer-clean-generic mostlyclean \
601- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
602- pdf pdf-am ps ps-am tags uninstall uninstall-am \
603- uninstall-binPROGRAMS uninstall-info-am
604-
605-# Tell versions [3.59,3.63) of GNU make to not export all variables.
606-# Otherwise a system limit (for SysV at least) may be exceeded.
607-.NOEXPORT:
--- a/snmpagent/MessengerClient.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
1-#include <netdb.h>
2-#include <sys/types.h>
3-#include <sys/socket.h>
4-#include <unistd.h>
5-#include <sys/time.h>
6-#include <errno.h>
7-#include <fcntl.h>
8-#include <cstring>
9-
10-#include "MessengerClient.h"
11-
12-#define READBUFSIZE (512)
13-#define SLEEPNANOTIME (1000000)
14-
15-void*
16-MessengerClient::run(void *inClass)
17-{
18- MessengerClient *msgClPtr = static_cast<MessengerClient *>(inClass);
19- char buffer[READBUFSIZE];
20- struct timespec req;
21-
22- while (!msgClPtr->endflg) { // async read
23- req.tv_sec = 0;
24- req.tv_nsec = SLEEPNANOTIME;
25- int ret = nanosleep(&req, NULL);
26- if (ret == -1) {
27- break; // nanosleep failed
28- }
29-
30- if (msgClPtr->connect()) {
31- ssize_t recvsize = recv(msgClPtr->socketfd, &buffer, READBUFSIZE, 0);
32- if (recvsize == -1) {
33- if (EAGAIN != errno) {
34- // TODO error
35- msgClPtr->close();
36- msgClPtr->ipcstat = DISCONNECT;
37- continue;
38- }
39- } else if (recvsize == 0) {
40- continue;
41- } else {
42- char *ptr = new char[recvsize];
43- ::memcpy(ptr , buffer, recvsize);
44- QueueContainer container;
45- container.reset(recvsize, ptr);
46- msgClPtr->messengerQueue->push(container);
47- }
48- }
49- }
50- msgClPtr->threadid = 0;
51- msgClPtr->endflg = false;
52-
53- return NULL;
54-}
55-
56-void
57-MessengerClient::setEndpoint(const char *targethost, const char *targetport)
58-{
59- host = targethost;
60- port = targetport;
61-}
62-
63-bool
64-MessengerClient::connect()
65-{
66- struct addrinfo hints;
67- struct addrinfo *res = NULL;
68-
69- if (!host || !port) {
70- ipcstat = DISCONNECT;
71- return false;
72- }
73- if (ipcstat == CONNECT) return true;
74-
75- ::memset(&hints, 0, sizeof(hints));
76- hints.ai_family = AF_UNSPEC;
77- hints.ai_socktype = SOCK_STREAM;
78-
79- int err = getaddrinfo(host, port, &hints, &res);
80- if (err != 0) {
81- // TODO insert error log
82- //char buff[255];
83- //::sprintf( buff, "%s", gai_strerror(err) );
84- freeaddrinfo(res);
85- ipcstat = DISCONNECT;
86- return false;
87- }
88-
89- for (addrinfo *ai = res; ai; ai = ai->ai_next) {
90- socketfd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
91- if (socketfd < 0) {
92- // TODO error log
93- freeaddrinfo(res);
94- ipcstat = DISCONNECT;
95- return false;
96- }
97- /*
98- int sockflg = fcntl(socketfd, F_GETFD);
99- sockflg |= O_NONBLOCK;
100- int ret = fcntl(socketfd, F_SETFD, sockflg);
101- if (ret < 0) {
102- // TODO error log
103- ::close( socketfd );
104- socketfd = -1;
105- continue;
106- }
107- */
108-
109- // TODO must check timeout
110- if (::connect(socketfd, ai->ai_addr, ai->ai_addrlen) < 0) {
111- // TODO error log
112- ::close(socketfd);
113- socketfd = -1;
114- ipcstat = DISCONNECT;
115- continue;
116- }
117- break;
118- }
119-
120- freeaddrinfo(res);
121-
122- if (socketfd < 0) {
123- ipcstat = DISCONNECT;
124- return false;
125- }
126-
127- ipcstat = CONNECT;
128- return true;
129-}
130-
131-void
132-MessengerClient::close()
133-{
134- if (socketfd >= 0)
135- ::close(socketfd);
136- socketfd = -1;
137- ipcstat = DISCONNECT;
138-}
139-
140-int
141-MessengerClient::send(size_t insize, const void *data)
142-{
143- if (socketfd < 0)
144- return -1;
145- return ::send(socketfd, data, insize, MSG_NOSIGNAL);
146-}
147-
148-void
149-MessengerClient::start()
150-{
151- pthread_create(&threadid, NULL, run, this);
152-}
153-
154-void
155-MessengerClient::stop()
156-{
157- endflg = true;
158-}
--- a/snmpagent/MessengerClient.h
+++ /dev/null
@@ -1,51 +0,0 @@
1-#ifndef MESSENGERCLIENT_H
2-#define MESSENGERCLIENT_H
3-
4-#include <pthread.h>
5-#include "lockedqueue.h"
6-#include "QueueContainer.h"
7-
8-enum IPC_STATUS_TAG {
9- UNKNOWN = 0,
10- DISCONNECT,
11- CONNECT
12-};
13-
14-typedef lockedqueue< QueueContainer > MessengerQueue;
15-
16-class MessengerClient
17-{
18-
19-protected:
20- const char *host;
21- const char *port;
22- bool endflg;
23- int socketfd;
24- pthread_t threadid;
25- IPC_STATUS_TAG ipcstat;
26- MessengerQueue *messengerQueue;
27-
28- MessengerClient(MessengerClient &) {}
29- MessengerClient &operator=(MessengerClient &) {
30- return *this;
31- }
32- static void *run(void *);
33-
34-public:
35- MessengerClient(MessengerQueue *inqueue)
36- : endflg(false),
37- socketfd(-1),
38- threadid(0),
39- ipcstat(UNKNOWN),
40- messengerQueue(inqueue) {}
41- ~MessengerClient() {};
42-
43- void setEndpoint(const char *, const char *);
44- bool connect();
45- void close();
46- int send(size_t , const void *);
47- void start();
48- void stop();
49-};
50-
51-#endif //MESSENGERCLIENT_H
--- a/snmpagent/QueueContainer.h
+++ /dev/null
@@ -1,42 +0,0 @@
1-#ifndef QUEUECONTAINER_H
2-#define QUEUECONTAINER_H
3-#include <boost/shared_array.hpp>
4-
5-class QueueContainer
6-{
7-
8-public:
9- typedef boost::shared_array<char> dataPtr;
10-
11-protected:
12- size_t size_;
13- dataPtr data_;
14-
15-public:
16- QueueContainer() {
17- size_ = 0;
18- }
19- QueueContainer(size_t insize, char *inptr) {
20- size_ = insize;
21- data_.reset(inptr);
22- }
23- QueueContainer(const QueueContainer &inqueue) {
24- size_ = inqueue.size_;
25- data_ = inqueue.data_;
26- }
27- ~QueueContainer() {}
28-
29- QueueContainer *reset(size_t insize, char *inptr) {
30- size_ = insize;
31- data_.reset(inptr);
32- return this;
33- }
34-
35- size_t size() {
36- return size_;
37- }
38- dataPtr data() {
39- return data_;
40- }
41-};
42-#endif // QUEUECONTAINER_H
--- a/snmpagent/ULTRAMONKEY-L7-MIB.txt
+++ /dev/null
@@ -1,775 +0,0 @@
1-ULTRAMONKEY-L7-MIB DEFINITIONS ::= BEGIN
2-IMPORTS
3- MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE, enterprises,
4- FROM SNMPv2-SMI
5- DisplayString
6- FROM SNMPv2-TC
7- InetAddress, InetPortNumber
8- FROM INET-ADDRESS-MIB
9-;
10-
11-ultramonkey-l7 MODULE-IDENTITY
12- LAST-UPDATED "0810040000Z"
13- ORGANIZATION "NTT COMWARE"
14- CONTACT-INFO
15- "UltraMonkey-L7 Community
16- URL: http://sourceforge.jp/projects/ultramonkey-l7/"
17- DESCRIPTION
18- "A MIB module for UltraMonkey-L7"
19- ::= { enterprises 60000 }
20-
21-um7Traps OBJECT IDENTIFIER ::= { ultramonkey-l7 0 }
22-um7Objects OBJECT IDENTIFIER ::= { ultramonkey-l7 1 }
23-
24--- Current Data Group
25-
26-um7CurrentDataGroup OBJECT IDENTIFIER ::= { um7Objects 1 }
27-
28- um7VirtualServiceTable OBJECT-TYPE
29- SYNTAX SEQUENCE OF Um7VirtualServiceEntry
30- MAX-ACCESS not-accessible
31- STATUS current
32- DESCRIPTION
33- "The table of Virtual Service data."
34- ::= { um7CurrentDataGroup 1 }
35-
36- um7VirtualServiceEntry OBJECT-TYPE
37- SYNTAX Um7VirtualServiceEntry
38- MAX-ACCESS not-accessible
39- STATUS current
40- DESCRIPTION
41- "The information about one Virtual Service data."
42- INDEX { um7VSIndex }
43- ::= { um7VirtualServiceTable 1 }
44-
45- Um7VirtualServiceEntry ::= SEQUENCE {
46- um7VSIndex INTEGER (1..127),
47- um7VSProtocol INTEGER { tcp(1), udp(2) },
48- um7VSIPAddress InetAddress,
49- um7VSPortNumber InetPortNumber,
50- um7VSScheduleModule DisplayString,
51- um7VSProtocolModule DisplayString,
52- um7VSProtoModOption DisplayString,
53- um7VSReschedule INTEGER { on(1), off(2) },
54- um7VSSorryIpAddress InetAddress,
55- um7VSSorryPortNumber InetPortNumber,
56- um7VSSorryThreshold INTEGER (0..2147483647),
57- um7VSSorryForceFlag INTEGER { on(1), off(2) },
58- um7VSQoSThresholdUp INTEGER (0..18446744073709551615),
59- um7VSQoSThresholdDown INTEGER (0..18446744073709551615),
60- um7VSThroughputUp INTEGER (0..18446744073709551615),
61- um7VSThroughputDown INTEGER (0..18446744073709551615)
62- }
63-
64- um7VSIndex OBJECT-TYPE
65- SYNTAX INTEGER (1..127)
66- MAX-ACCESS not-accessible
67- STATUS current
68- DESCRIPTION
69- "The data index of Virtual Service."
70- ::= { um7VirtualServiceEntry 1 }
71-
72- um7VSProtocol OBJECT-TYPE
73- SYNTAX INTEGER {
74- tcp(1),
75- udp(2)
76- }
77- MAX-ACCESS read-only
78- STATUS current
79- DESCRIPTION
80- "Protocol id of Virtual Service."
81- ::= { um7VirtualServiceEntry 2 }
82-
83- um7VSIPAddress OBJECT-TYPE
84- SYNTAX InetAddress
85- MAX-ACCESS read-only
86- STATUS current
87- DESCRIPTION
88- "IP address of Virtual Service."
89- ::= { um7VirtualServiceEntry 3 }
90-
91- um7VSPortNumber OBJECT-TYPE
92- SYNTAX InetPortNumber
93- MAX-ACCESS read-only
94- STATUS current
95- DESCRIPTION
96- "Port number of Virtual Service."
97- ::= { um7VirtualServiceEntry 4 }
98-
99- um7VSScheduleModule OBJECT-TYPE
100- SYNTAX DisplayString
101- MAX-ACCESS read-only
102- STATUS current
103- DESCRIPTION
104- "Schedule module of Virtual Service."
105- ::= { um7VirtualServiceEntry 5 }
106-
107- um7VSProtocolModule OBJECT-TYPE
108- SYNTAX DisplayString
109- MAX-ACCESS read-only
110- STATUS current
111- DESCRIPTION
112- "Protocol module of Virtual Service."
113- ::= { um7VirtualServiceEntry 6 }
114-
115- um7VSProtocolModuleOption OBJECT-TYPE
116- SYNTAX DisplayString
117- MAX-ACCESS read-only
118- STATUS current
119- DESCRIPTION
120- "Protocol module option of Virtual Service."
121- ::= { um7VirtualServiceEntry 7 }
122-
123- um7VSReschedule OBJECT-TYPE
124- SYNTAX INTEGER {
125- on(1),
126- off(2)
127- }
128- MAX-ACCESS read-only
129- STATUS current
130- DESCRIPTION
131- "Protocol module reschedule flag of Virtual Service."
132- ::= { um7VirtualServiceEntry 8 }
133-
134- um7VSSorryIpAddress OBJECT-TYPE
135- SYNTAX InetAddress
136- MAX-ACCESS read-only
137- STATUS current
138- DESCRIPTION
139- "IP address of sorry server."
140- ::= { um7VirtualServiceEntry 9 }
141-
142- um7VSSorryPortNumber OBJECT-TYPE
143- SYNTAX InetPortNumber
144- MAX-ACCESS read-only
145- STATUS current
146- DESCRIPTION
147- "Port number of sorry server."
148- ::= { um7VirtualServiceEntry 10 }
149-
150- um7VSSorryThreshold OBJECT-TYPE
151- SYNTAX INTEGER (0..2147483647)
152- UNITS "Connections"
153- MAX-ACCESS read-only
154- STATUS current
155- DESCRIPTION
156- "Connection threshold of sorry server."
157- ::= { um7VirtualServiceEntry 11 }
158-
159- um7VSSorryForceFlag OBJECT-TYPE
160- SYNTAX INTEGER {
161- on(1),
162- off(2)
163- }
164- MAX-ACCESS read-only
165- STATUS current
166- DESCRIPTION
167- "Force flag of sorry server."
168- ::= { um7VirtualServiceEntry 12 }
169-
170- um7VSQoSThresholdUp OBJECT-TYPE
171- SYNTAX INTEGER (0..18446744073709551615)
172- UNITS "bps"
173- MAX-ACCESS read-only
174- STATUS current
175- DESCRIPTION
176- "QoS threshold of up stream."
177- ::= { um7VirtualServiceEntry 13 }
178-
179- um7VSQoSThresholdDown OBJECT-TYPE
180- SYNTAX INTEGER (0..18446744073709551615)
181- UNITS "bps"
182- MAX-ACCESS read-only
183- STATUS current
184- DESCRIPTION
185- "QoS threshold of down stream."
186- ::= { um7VirtualServiceEntry 14 }
187-
188- um7VSThroughputUp OBJECT-TYPE
189- SYNTAX INTEGER (0..18446744073709551615)
190- UNITS "bps"
191- MAX-ACCESS read-only
192- STATUS current
193- DESCRIPTION
194- "Current throughput of up stream."
195- ::= { um7VirtualServiceEntry 15 }
196-
197- um7VSThroughputDown OBJECT-TYPE
198- SYNTAX INTEGER (0..18446744073709551615)
199- UNITS "bps"
200- MAX-ACCESS read-only
201- STATUS current
202- DESCRIPTION
203- "Current throughput of down stream."
204- ::= { um7VirtualServiceEntry 16 }
205-
206- um7RealServerTable OBJECT-TYPE
207- SYNTAX SEQUENCE OF Um7RealServerEntry
208- MAX-ACCESS not-accessible
209- STATUS current
210- DESCRIPTION
211- "The table of Real Server data."
212- ::= { um7CurrentDataGroup 2 }
213-
214- um7RealServerEntry OBJECT-TYPE
215- SYNTAX Um7RealServerEntry
216- MAX-ACCESS not-accessible
217- STATUS current
218- DESCRIPTION
219- "The information about one Real Server data."
220- INDEX { um7RSIndex }
221- ::= { um7RealServerTable 1 }
222-
223- Um7RealServerEntry ::= SEQUENCE {
224- um7RSIndex INTEGER (1..65535)
225- um7RSVirtualServiceIndex INTEGER (1..127)
226- um7RSIPAddress InetAddress
227- um7RSPortNumber InetPortNumber
228- um7RSForwardMode INTEGER { masq(1) }
229- um7RSWeight INTEGER (0..2147483647)
230- um7RSActiveConn INTEGER (0..2147483647)
231- um7RSInactiveConn INTEGER (0..2147483647)
232- }
233-
234- um7RSIndex OBJECT-TYPE
235- SYNTAX INTEGER (1..65535)
236- MAX-ACCESS not-accessible
237- STATUS current
238- DESCRIPTION
239- "The data index of Real Server."
240- ::= { um7RealServerEntry 1 }
241-
242- um7RSVirtualServiceIndex OBJECT-TYPE
243- SYNTAX INTEGER(1..127)
244- MAX-ACCESS read-only
245- STATUS current
246- DESCRIPTION
247- "Virtual Service index of Real Server."
248- ::= { um7RealServerEntry 2 }
249-
250- um7RSIPAddress OBJECT-TYPE
251- SYNTAX InetAddress
252- MAX-ACCESS read-only
253- STATUS current
254- DESCRIPTION
255- "IP address of Real Server."
256- ::= { um7RealServerEntry 3 }
257-
258- um7RSPortNumber OBJECT-TYPE
259- SYNTAX InetPortNumber
260- MAX-ACCESS read-only
261- STATUS current
262- DESCRIPTION
263- "Port number of Real Server."
264- ::= { um7RealServerEntry 4 }
265-
266- um7RSForwardMode OBJECT-TYPE
267- SYNTAX INTEGER { masq(1) }
268- MAX-ACCESS read-only
269- STATUS current
270- DESCRIPTION
271- "Forward mode of Real Server."
272- ::= { um7RealServerEntry 5 }
273-
274- um7RSWeight OBJECT-TYPE
275- SYNTAX INTEGER (0..2147483647)
276- MAX-ACCESS read-only
277- STATUS current
278- DESCRIPTION
279- "Weight of Real Server."
280- ::= { um7RealServerEntry 6 }
281-
282- um7RSActiveConn OBJECT-TYPE
283- SYNTAX INTEGER (0..2147483647)
284- MAX-ACCESS read-only
285- STATUS current
286- DESCRIPTION
287- "Active connections of Real Server."
288- ::= { um7RealServerEntry 7 }
289-
290- um7RSInactiveConn OBJECT-TYPE
291- SYNTAX INTEGER (0..2147483647)
292- MAX-ACCESS read-only
293- STATUS current
294- DESCRIPTION
295- "Inactive connections of Real Server."
296- ::= { um7RealServerEntry 8 }
297-
298-um7LogLevel OBJECT IDENTIFIER ::= { um7CurrentDataGroup 3 }
299-um7LogLevelL7vsd OBJECT IDENTIFIER ::= { um7LogLevel 1 }
300-um7LogLevelL7vsadm OBJECT IDENTIFIER ::= { um7LogLevel 2 }
301-um7LogLevelSnmpAgent OBJECT IDENTIFIER ::= { um7LogLevel 3 }
302-
303-Um7LogLevel ::= INTEGER {
304- unknown(0),
305- debug(1),
306- info(2),
307- warn(3),
308- error(4),
309- fatal(5)
310-}
311-
312- um7LogVsdNetwork OBJECT-TYPE
313- SYNTAX Um7LogLevel
314- MAX-ACCESS read-only
315- STATUS current
316- DESCRIPTION
317- "Log Level of l7vsd network."
318- ::= { um7LogLevelL7vsd 1 }
319-
320- um7LogVsdNetworkBandwidth OBJECT-TYPE
321- SYNTAX Um7LogLevel
322- MAX-ACCESS read-only
323- STATUS current
324- DESCRIPTION
325- "Log Level of l7vsd network bandwidth."
326- ::= { um7LogLevelL7vsd 2 }
327-
328- um7LogVsdNetworkNumConnection OBJECT-TYPE
329- SYNTAX Um7LogLevel
330- MAX-ACCESS read-only
331- STATUS current
332- DESCRIPTION
333- "Log Level of l7vsd network num connection."
334- ::= { um7LogLevelL7vsd 3 }
335-
336- um7LogVsdNetworkQoS OBJECT-TYPE
337- SYNTAX Um7LogLevel
338- MAX-ACCESS read-only
339- STATUS current
340- DESCRIPTION
341- "Log Level of l7vsd network QoS."
342- ::= { um7LogLevelL7vsd 4 }
343-
344- um7LogVsdVirtualService OBJECT-TYPE
345- SYNTAX Um7LogLevel
346- MAX-ACCESS read-only
347- STATUS current
348- DESCRIPTION
349- "Log Level of l7vsd Virtual Service."
350- ::= { um7LogLevelL7vsd 5 }
351-
352- um7LogVsdRealServer OBJECT-TYPE
353- SYNTAX Um7LogLevel
354- MAX-ACCESS read-only
355- STATUS current
356- DESCRIPTION
357- "Log Level of l7vsd Real Server."
358- ::= { um7LogLevelL7vsd 6 }
359-
360- um7LogVsdRealServerBalancing OBJECT-TYPE
361- SYNTAX Um7LogLevel
362- MAX-ACCESS read-only
363- STATUS current
364- DESCRIPTION
365- "Log Level of l7vsd Real Server balancing."
366- ::= { um7LogLevelL7vsd 7 }
367-
368- um7LogVsdSorryServer OBJECT-TYPE
369- SYNTAX Um7LogLevel
370- MAX-ACCESS read-only
371- STATUS current
372- DESCRIPTION
373- "Log Level of l7vsd Sorry Server."
374- ::= { um7LogLevelL7vsd 8 }
375-
376- um7LogVsdReplication OBJECT-TYPE
377- SYNTAX Um7LogLevel
378- MAX-ACCESS read-only
379- STATUS current
380- DESCRIPTION
381- "Log Level of l7vsd replication."
382- ::= { um7LogLevelL7vsd 9 }
383-
384- um7LogVsdStartStop OBJECT-TYPE
385- SYNTAX Um7LogLevel
386- MAX-ACCESS read-only
387- STATUS current
388- DESCRIPTION
389- "Log Level of l7vsd start stop."
390- ::= { um7LogLevelL7vsd 10 }
391-
392- um7LogVsdSystem OBJECT-TYPE
393- SYNTAX Um7LogLevel
394- MAX-ACCESS read-only
395- STATUS current
396- DESCRIPTION
397- "Log Level of l7vsd system."
398- ::= { um7LogLevelL7vsd 11 }
399-
400- um7LogVsdSystemMemory OBJECT-TYPE
401- SYNTAX Um7LogLevel
402- MAX-ACCESS read-only
403- STATUS current
404- DESCRIPTION
405- "Log Level of l7vsd system memory."
406- ::= { um7LogLevelL7vsd 12 }
407-
408- um7LogVsdSystemSocket OBJECT-TYPE
409- SYNTAX Um7LogLevel
410- MAX-ACCESS read-only
411- STATUS current
412- DESCRIPTION
413- "Log Level of l7vsd system socket."
414- ::= { um7LogLevelL7vsd 13 }
415-
416- um7LogVsdSystemSignal OBJECT-TYPE
417- SYNTAX Um7LogLevel
418- MAX-ACCESS read-only
419- STATUS current
420- DESCRIPTION
421- "Log Level of l7vsd system signal."
422- ::= { um7LogLevelL7vsd 14 }
423-
424- um7LogVsdEnvironment OBJECT-TYPE
425- SYNTAX Um7LogLevel
426- MAX-ACCESS read-only
427- STATUS current
428- DESCRIPTION
429- "Log Level of l7vsd environment."
430- ::= { um7LogLevelL7vsd 15 }
431-
432- um7LogVsdEnvironmentParameter OBJECT-TYPE
433- SYNTAX Um7LogLevel
434- MAX-ACCESS read-only
435- STATUS current
436- DESCRIPTION
437- "Log Level of l7vsd environment parameter."
438- ::= { um7LogLevelL7vsd 16 }
439-
440- um7LogVsdLogger OBJECT-TYPE
441- SYNTAX Um7LogLevel
442- MAX-ACCESS read-only
443- STATUS current
444- DESCRIPTION
445- "Log Level of l7vsd logger."
446- ::= { um7LogLevelL7vsd 17 }
447-
448- um7LogVsdParameter OBJECT-TYPE
449- SYNTAX Um7LogLevel
450- MAX-ACCESS read-only
451- STATUS current
452- DESCRIPTION
453- "Log Level of l7vsd parameter."
454- ::= { um7LogLevelL7vsd 18 }
455-
456- um7LogVsdEvent OBJECT-TYPE
457- SYNTAX Um7LogLevel
458- MAX-ACCESS read-only
459- STATUS current
460- DESCRIPTION
461- "Log Level of l7vsd event."
462- ::= { um7LogLevelL7vsd 19 }
463-
464- um7LogVsdSchedule OBJECT-TYPE
465- SYNTAX Um7LogLevel
466- MAX-ACCESS read-only
467- STATUS current
468- DESCRIPTION
469- "Log Level of l7vsd schedule."
470- ::= { um7LogLevelL7vsd 20 }
471-
472- um7LogVsdProgram OBJECT-TYPE
473- SYNTAX Um7LogLevel
474- MAX-ACCESS read-only
475- STATUS current
476- DESCRIPTION
477- "Log Level of l7vsd program."
478- ::= { um7LogLevelL7vsd 21 }
479-
480- um7LogVsdProtocol OBJECT-TYPE
481- SYNTAX Um7LogLevel
482- MAX-ACCESS read-only
483- STATUS current
484- DESCRIPTION
485- "Log Level of l7vsd protocol."
486- ::= { um7LogLevelL7vsd 22 }
487-
488- um7LogVsdModule OBJECT-TYPE
489- SYNTAX Um7LogLevel
490- MAX-ACCESS read-only
491- STATUS current
492- DESCRIPTION
493- "Log Level of l7vsd module."
494- ::= { um7LogLevelL7vsd 23 }
495-
496- um7LogVsadmParse OBJECT-TYPE
497- SYNTAX Um7LogLevel
498- MAX-ACCESS read-only
499- STATUS current
500- DESCRIPTION
501- "Log Level of l7vsadm parse."
502- ::= { um7LogLevelL7vsadm 1 }
503-
504- um7LogVsadmOperate OBJECT-TYPE
505- SYNTAX Um7LogLevel
506- MAX-ACCESS read-only
507- STATUS current
508- DESCRIPTION
509- "Log Level of l7vsadm operate."
510- ::= { um7LogLevelL7vsadm 2 }
511-
512- um7LogVsadmCommunicate OBJECT-TYPE
513- SYNTAX Um7LogLevel
514- MAX-ACCESS read-only
515- STATUS current
516- DESCRIPTION
517- "Log Level of l7vsadm communicate."
518- ::= { um7LogLevelL7vsadm 3 }
519-
520- um7LogVsadmConfigResult OBJECT-TYPE
521- SYNTAX Um7LogLevel
522- MAX-ACCESS read-only
523- STATUS current
524- DESCRIPTION
525- "Log Level of l7vsadm config result."
526- ::= { um7LogLevelL7vsadm 4 }
527-
528- um7LogVsadmCommon OBJECT-TYPE
529- SYNTAX Um7LogLevel
530- MAX-ACCESS read-only
531- STATUS current
532- DESCRIPTION
533- "Log Level of l7vsadm common."
534- ::= { um7LogLevelL7vsadm 5 }
535-
536- um7LogVsadmLogger OBJECT-TYPE
537- SYNTAX Um7LogLevel
538- MAX-ACCESS read-only
539- STATUS current
540- DESCRIPTION
541- "Log Level of l7vsadm logger."
542- ::= { um7LogLevelL7vsadm 6 }
543-
544- um7LogVsadmParameter OBJECT-TYPE
545- SYNTAX Um7LogLevel
546- MAX-ACCESS read-only
547- STATUS current
548- DESCRIPTION
549- "Log Level of l7vsadm parameter."
550- ::= { um7LogLevelL7vsadm 7 }
551-
552- um7LogVsadmProtocol OBJECT-TYPE
553- SYNTAX Um7LogLevel
554- MAX-ACCESS read-only
555- STATUS current
556- DESCRIPTION
557- "Log Level of l7vsadm protocol."
558- ::= { um7LogLevelL7vsadm 8 }
559-
560- um7LogVsadmModule OBJECT-TYPE
561- SYNTAX Um7LogLevel
562- MAX-ACCESS read-only
563- STATUS current
564- DESCRIPTION
565- "Log Level of l7vsadm module."
566- ::= { um7LogLevelL7vsadm 9 }
567-
568- um7LogSnmpStartStop OBJECT-TYPE
569- SYNTAX Um7LogLevel
570- MAX-ACCESS read-only
571- STATUS current
572- DESCRIPTION
573- "Log Level of l7snmpagent start stop."
574- ::= { um7LogLevelSnmpAgent 1 }
575-
576- um7LogSnmpManagerReceive OBJECT-TYPE
577- SYNTAX Um7LogLevel
578- MAX-ACCESS read-only
579- STATUS current
580- DESCRIPTION
581- "Log Level of l7snmpagent manager-receive."
582- ::= { um7LogLevelSnmpAgent 2 }
583-
584- um7LogSnmpManagerSend OBJECT-TYPE
585- SYNTAX Um7LogLevel
586- MAX-ACCESS read-only
587- STATUS current
588- DESCRIPTION
589- "Log Level of l7snmpagent manager-send."
590- ::= { um7LogLevelSnmpAgent 3 }
591-
592- um7LogSnmpL7vsdReceive OBJECT-TYPE
593- SYNTAX Um7LogLevel
594- MAX-ACCESS read-only
595- STATUS current
596- DESCRIPTION
597- "Log Level of l7snmpagent l7vsd-receive"
598- ::= { um7LogLevelSnmpAgent 4 }
599-
600- um7LogSnmpL7vsdSend OBJECT-TYPE
601- SYNTAX Um7LogLevel
602- MAX-ACCESS read-only
603- STATUS current
604- DESCRIPTION
605- "Log Level of l7snmpagent l7vsd-send"
606- ::= { um7LogLevelSnmpAgent 5 }
607-
608- um7LogSnmpLogger OBJECT-TYPE
609- SYNTAX Um7LogLevel
610- MAX-ACCESS read-only
611- STATUS current
612- DESCRIPTION
613- "Log Level of l7snmpagent logger"
614- ::= { um7LogLevelSnmpAgent 6 }
615-
616- um7LogSnmpParameter OBJECT-TYPE
617- SYNTAX Um7LogLevel
618- MAX-ACCESS read-only
619- STATUS current
620- DESCRIPTION
621- "Log Level of l7snmpagent parameter"
622- ::= { um7LogLevelSnmpAgent 7 }
623-
624-um7Status OBJECT IDENTIFIER ::= { um7CurrentDataGroup 4 }
625-
626- um7StatMessage OBJECT-TYPE
627- SYNTAX DisplayString
628- MAX-ACCESS read-only
629- STATUS current
630- DESCRIPTION
631- "Status message of l7vsd."
632- ::= { um7Status 1 }
633-
634- um7StatReplication OBJECT-TYPE
635- SYNTAX INTEGER {
636- out(1),
637- single(2),
638- master(3),
639- slave(4),
640- masterstop(5),
641- slavestop(6)
642- }
643- MAX-ACCESS read-only
644- STATUS current
645- DESCRIPTION
646- "Status of replication."
647- ::= { um7Status 2 }
648-
649- um7StatSnmpAgent OBJECT-TYPE
650- SYNTAX INTEGER {
651- unknown(0),
652- disconnect(1),
653- connect(2)
654- }
655- MAX-ACCESS read-only
656- STATUS current
657- DESCRIPTION
658- "Status of l7snmpagent."
659- ::= { um7Status 3 }
660-
661--- Traps
662-
663- um7StateAlert NOTIFICATION-TYPE
664- OBJECTS { um7StatSnmpAgent, um7StatReplication }
665- STATUS current
666- DESCRIPTION
667- "Trap of process status change."
668- ::= { um7Traps 1 }
669-
670- um7VirtualServiceAlert NOTIFICATION-TYPE
671- OBJECTS { um7VirtualServiceTable, um7RealServerTable }
672- STATUS current
673- DESCRIPTION
674- "Trap of Virtual Service change."
675- ::= { um7Traps 2 }
676-
677- um7ReplicationAlert NOTIFICATION-TYPE
678- OBJECTS { um7StatMessage }
679- STATUS current
680- DESCRIPTION
681- "Trap of replication command execution."
682- ::= { um7Traps 3 }
683-
684- um7LogLevelAlert NOTIFICATION-TYPE
685- OBJECTS { um7LogLevel }
686- STATUS current
687- DESCRIPTION
688- "Trap of log level change."
689- ::= { um7Traps 4 }
690-
691- um7QoSAlarmOn NOTIFICATION-TYPE
692- OBJECTS { um7VSQoSThresholdUp, um7VSQoSThresholdDown, um7VSThroughputUp, um7VSThroughputDown }
693- STATUS current
694- DESCRIPTION
695- "Trap of throughput over QoS threshold."
696- ::= { um7Traps 5 }
697-
698- um7QoSAlarmOff NOTIFICATION-TYPE
699- OBJECTS { um7VSQoSThresholdUp, um7VSQoSThresholdDown, um7VSThroughputUp, um7VSThroughputDown }
700- STATUS current
701- DESCRIPTION
702- "Trap of throughput under QoS threshold."
703- ::= { um7Traps 6 }
704-
705- um7MessageAlert NOTIFICATION-TYPE
706- OBJECTS { um7StatMessage }
707- STATUS current
708- DESCRIPTION
709- "Trap of some message."
710- ::= { um7Traps 7 }
711-
712-
713--- conformance information
714-
715-um7MIBConformance OBJECT IDENTIFIER ::= { ultramonkey-l7 2 }
716-um7MIBCompliances OBJECT IDENTIFIER ::= { um7MIBConformance 1 }
717-um7MIBGroups OBJECT IDENTIFIER ::= { um7MIBConformance 2 }
718-
719-
720--- compliance statements
721-
722-um7MIBCompliance MODULE-COMPLIANCE
723- STATUS current
724- DESCRIPTION
725- "The compliance statement for UltraMonkey-L7."
726- MODULE -- this module
727-
728- MANDATORY-GROUPS { um7MIBGroup, um7TrapGroup }
729- ::= { um7MIBCompliances 1 }
730-
731--- units of conformance
732-
733-um7MIBGroup OBJECT-GROUP
734- OBJECTS { um7VSIndex, um7VSProtocol, um7VSIPAddress,
735- um7VSPortNumber, um7VSScheduleModule, um7VSProtocolModule,
736- um7VSProtocolModuleOption, um7VSReschedule, um7VSSorryIpAddress,
737- um7VSSorryThreshold, um7VSSorryForceFlag, um7VSQoSThresholdUp,
738- um7VSQoSThresholdDown, um7VSThroughputUp, um7VSThroughputDown,
739- um7RSIndex, um7RSVirtualServiceIndex, um7RSIPAddress,
740- um7RSPortNumber, um7RSForwardMode, um7RSWeight,
741- um7RSActiveConn, um7RSInactiveConn, um7LogVsdNetwork,
742- um7LogVsdNetworkBandwidth, um7LogVsdNetworkNumConnection,
743- um7LogVsdNetworkQoS, um7LogVsdVirtualService,
744- um7LogVsdRealServer, um7LogVsdRealServerBalancing,
745- um7LogVsdSorryServer, um7LogVsdReplication,
746- um7LogVsdStartStop, um7LogVsdSystem, um7LogVsdSystemMemory,
747- um7LogVsdSystemSocket, um7LogVsdSystemSignal,
748- um7LogVsdEnvironment, um7LogVsdEnvironmentParameter,
749- um7LogVsdLogger, um7LogVsdParameter, um7LogVsdEvent,
750- um7LogVsdSchedule, um7LogVsdProgram, um7LogVsdProtocol,
751- um7LogVsdModule, um7LogVsadmParse, um7LogVsadmOperate,
752- um7LogVsadmCommunicate, um7LogVsadmConfigResult,
753- um7LogVsadmCommon, um7LogVsadmLogger, um7LogVsadmParameter,
754- um7LogVsadmProtocol, um7LogVsadmModule, um7LogSnmpStartStop,
755- um7LogSnmpManagerReceive, um7LogSnmpManagerSend,
756- um7LogSnmpL7vsdReceive, um7LogSnmpL7vsdSend,
757- um7LogSnmpLogger, um7LogSnmpParameter, um7StatSnmpAgent,
758- um7StatReplication }
759- STATUS current
760- DESCRIPTION
761- "The MIB group of objects providing for management of UltraMonkey-L7."
762- ::= { um7MIBGroups 1 }
763-
764-um7TrapGroup NOTIFICATION-GROUP
765- NOTIFICATIONS { um7StateAlert, um7VirtualServiceAlert,
766- um7ReplicationAlert, um7LogLevelAlert,
767- um7QoSAlarmOn, um7QoSAlarmOff,
768- um7MessageAlert }
769- STATUS current
770- DESCRIPTION
771- "The notifications group for UltraMonkey-L7."
772- ::= { um7MIBGroups 2 }
773-
774-END
775-
--- a/snmpagent/UML7MIB.txt
+++ /dev/null
@@ -1,85 +0,0 @@
1-UML7-MIB DEFINITIONS ::= BEGIN
2-IMPORTS
3- OBJECT-TYPE, MODULE-IDENTITY, enterprises FROM SNMPv2-SMI
4-
5- TEXTUAL-CONVENTION, DisplayString FROM SNMPv2-TC;
6-
7-UltraMonkeyL7 MODULE-IDENTITY
8- LAST-UPDATED "200801150000Z"
9- ORGANIZATION "UltraMonkey-L7"
10- CONTACT-INFO "email: ultramonkey-l7-users@lists.sourceforge.jp"
11- DESCRIPTION "Defines the MIBs that would be used for L7VS SNMP and for process monitoring of UltraMonkey-L7."
12- ::= { enterprises 60000 }
13-
14-l7vsd MODULE-IDENTITY
15- LAST-UPDATED "200801020000Z"
16- ORGANIZATION "L7VS"
17- CONTACT-INFO "Email: ultramonkey-l7-users@lists.sourceforge.jp"
18- DESCRIPTION "L7VS MIB"
19- ::= { UltraMonkeyL7 1 }
20-
21-l7vsTraps OBJECT IDENTIFIER ::= { l7vsd 0 }
22-l7vsInfo OBJECT IDENTIFIER ::= { l7vsd 1 }
23-
24-l7vsError NOTIFICATION-TYPE
25- SYNTAX DisplayString
26- MAX-ACCESS read-only
27- STATUS current
28- DESCRIPTION
29- "L7VS Error Status"
30- ::= { l7vsTraps 1 }
31-
32-
33-NumberVS OBJECT-TYPE
34- SYNTAX INTEGER
35- MAX-ACCESS read-only
36- STATUS current
37- DESCRIPTION
38- "This value is number of VirtualService."
39- ::= { l7vsInfo 1 }
40-
41-TableVS OBJECT-TYPE
42- SYNTAX SEQUENCE OF ENTRYVS
43- MAX-ACCESS not-accessible
44- STATUS current
45- ::= { l7vsInfo 2 }
46-
47-EntryVS OBJECT-TYPE
48- SYNTAX ENTRYVS
49- MAX-ACCESS not-accessible
50- STATUS current
51- INDEX { IndexVS }
52- ::= { TableVS 1 }
53-
54-ENTRYVS ::= SEQUENCE {
55- IndexVS INTEGER(0..500)
56- Addr DisplayString
57- Port INTEGER(0..70000)
58- ScheduleModuleName DisplayString
59-}
60-
61-IndexVS OBJECT-TYPE
62- SYNTAX INTEGER(0..500)
63- MAX-ACCESS read-only
64- STATUS current
65- ::= { EntryVS 1 }
66-
67-Addr OBJECT-TYPE
68- SYNTAX DisplayString
69- MAX-ACCESS read-only
70- STATUS current
71- ::= { EntryVS 2 }
72-
73-Port OBJECT-TYPE
74- SYNTAX INTEGER(0..70000)
75- MAX-ACCESS read-only
76- STATUS current
77- ::= { EntryVS 3 }
78-
79-ScheduleModuleName OBJECT-TYPE
80- SYNTAX DisplayString
81- MAX-ACCESS read-only
82- STATUS current
83- ::= { EntryVS 4 }
84-
85-END
--- a/snmpagent/UltraMonkeyL7.c
+++ /dev/null
@@ -1,40 +0,0 @@
1-/*
2- * Note: this file originally auto-generated by mib2c using
3- * : mib2c.notify.conf,v 5.3 2004/04/15 12:29:19 dts12 Exp $
4- */
5-
6-#include <net-snmp/net-snmp-config.h>
7-#include <net-snmp/net-snmp-includes.h>
8-#include <net-snmp/agent/net-snmp-agent-includes.h>
9-#include "UltraMonkeyL7.h"
10-
11-static oid snmptrap_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
12-
13-int
14-send_l7vsError_trap(void)
15-{
16- netsnmp_variable_list *var_list = NULL;
17- oid l7vsError_oid[] = { 1, 3, 6, 1, 4, 1, 60000, 1, 0, 1 };
18-
19- /*
20- * Set the snmpTrapOid.0 value
21- */
22- snmp_varlist_add_variable(&var_list,
23- snmptrap_oid, OID_LENGTH(snmptrap_oid),
24- ASN_OBJECT_ID,
25- l7vsError_oid, sizeof(l7vsError_oid));
26-
27-
28- /*
29- * Add any extra (optional) objects here
30- */
31-
32- /*
33- * Send the trap to the list of configured destinations
34- * and clean up
35- */
36- send_v2trap(var_list);
37- snmp_free_varbind(var_list);
38-
39- return SNMP_ERR_NOERROR;
40-}
--- a/snmpagent/UltraMonkeyL7.h
+++ /dev/null
@@ -1,13 +0,0 @@
1-/*
2- * Note: this file originally auto-generated by mib2c using
3- * : mib2c.notify.conf,v 5.3 2004/04/15 12:29:19 dts12 Exp $
4- */
5-#ifndef ULTRAMONKEYL7_H
6-#define ULTRAMONKEYL7_H
7-
8-/*
9- * function declarations
10- */
11-int send_l7vsError_trap(void);
12-
13-#endif /* ULTRAMONKEYL7_H */
--- a/snmpagent/dispatch_message.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
1-
2-#include "dispatch_message.h"
3-
4-
5-l7ag_dispatch_message::l7ag_dispatch_message()
6-{
7-
8-
9-}
10-
11-
12-l7ag_dispatch_message::~l7ag_dispatch_message()
13-{
14-
15-
16-}
17-
18-
19-void l7ag_dispatch_message::add_message(std::string in_msg)
20-{
21-
22-
23-}
24-
25-
26-void l7ag_dispatch_message::do_dispatch()
27-{
28-
29-
30-}
31-
--- a/snmpagent/dispatch_message.h
+++ /dev/null
@@ -1,25 +0,0 @@
1-#ifndef __L7AG_DISPATCH_MESSAGE_H__
2-#define __L7AG_DISPATCH_MESSAGE_H__
3-
4-#include <string>
5-
6-#include "proc_mibcollectmessage.h"
7-#include "proc_trapsendrequest.h"
8-#include "proc_settingrequest.h"
9-
10-
11-class l7ag_dispatch_message
12-{
13-protected:
14-
15-private:
16- std::string message;
17-public:
18- l7ag_dispatch_message();
19- ~l7ag_dispatch_message();
20-
21- void add_message(std::string in_msg);
22- void do_dispatch();
23-};
24-
25-#endif //__L7AG_DISPATCH_MESSAGE_H__
--- a/snmpagent/dispatcher.cpp
+++ /dev/null
@@ -1,304 +0,0 @@
1-//
2-//! @file dispaatcher.cpp
3-//! @brief snmpagent - l7vsd message dispatcher
4-//
5-// Copyright (C) 2008 NTT COMWARE Corporation.
6-//
7-// Distributed under the Boost Software License, Version 1.0. (See accompanying
8-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9-//
10-#include <sys/time.h>
11-#include "dispatcher.h"
12-#include "store_mibdata.h"
13-
14-#define SLEEPNANOTIME (1000000)
15-#define DISPATCH_LOOP_COUNT (10)
16-
17-/*!
18- *
19- */
20-l7ag_dispatcher::l7ag_dispatcher()
21-{
22- stop_flag = false;
23- msg_size = 0;
24- msg = NULL;
25- message_que = NULL;
26- trap_que = NULL;
27-}
28-
29-/*!
30- *
31- */
32-l7ag_dispatcher::l7ag_dispatcher(MessageQueue *msgque, TrapQueue *trapque)
33-{
34- stop_flag = false;
35- msg_size = 0;
36- msg = NULL;
37- message_que = msgque;
38- trap_que = trapque;
39-}
40-
41-/*!
42- *
43- */
44-l7ag_dispatcher::~l7ag_dispatcher()
45-{
46- if (NULL != msg)free(msg);
47-}
48-
49-/*!
50- *
51- */
52-void*
53-l7ag_dispatcher::run(void *args)
54-{
55- l7ag_dispatcher *dispatcher = static_cast<l7ag_dispatcher *>(args);
56-
57- struct timespec req;
58- req.tv_sec = 0;
59- req.tv_nsec = SLEEPNANOTIME;
60-
61- while (!dispatcher->stop_flag) {
62- int ret = nanosleep(&req, NULL);
63- if (ret == -1) {
64- break; // nanosleep failed
65- }
66- if (!dispatcher->message_que->empty()) {
67- //まず、取得するための領域確保
68- if (NULL == dispatcher->msg) {
69- dispatcher->msg_size = dispatcher->message_que->front().size();
70- dispatcher->msg = static_cast<char *>(malloc((sizeof(char) * dispatcher->msg_size)));
71- memcpy(dispatcher->msg, dispatcher->message_que->front().data().get(), dispatcher->msg_size);
72- } else {
73- dispatcher->msg_pos = dispatcher->msg_size;
74- dispatcher->msg_size = dispatcher->msg_size + dispatcher->message_que->front().size();
75- dispatcher->msg = static_cast<char *>(realloc(dispatcher->msg, (sizeof(char) * dispatcher->msg_size)));
76- //キューから取得(前に取得しているデータに追加取得)
77- memcpy(&dispatcher->msg[dispatcher->msg_pos], dispatcher->message_que->front().data().get(), dispatcher->message_que->front().size());
78- }
79- //popする
80- dispatcher->message_que->pop();
81- //ヘッダのサイズ参照
82- l7ag_message_header *header;
83- header = (l7ag_message_header *)dispatcher->msg;
84- if (header->size <= dispatcher->msg_size) {
85- //データサイズが十分ならディスパッチ
86- dispatcher->dispatch_message();
87- //ディスパッチしたら、あまりデータを前に詰める
88- //いったんバックアップ
89- size_t next_size = dispatcher->msg_size - header->size;
90- char *msg_bak = static_cast<char *>(malloc(sizeof(char) * next_size));
91- memcpy(msg_bak, &dispatcher->msg[header->size], next_size);
92- //領域のサイズ変更
93- dispatcher->msg = static_cast<char *>(realloc(dispatcher->msg, sizeof(char) * next_size));
94- //リストアする
95- memcpy(dispatcher->msg, msg_bak, next_size);
96- dispatcher->msg_size = next_size;
97- free(msg_bak);
98- }
99- //データサイズが足りなければ次回持ち越し
100- } else {
101- // TODO 複数のキューでたまる速度が遅かった場合消える?
102- if (NULL != dispatcher->msg) {
103- free(dispatcher->msg);
104- dispatcher->msg = NULL;
105- }
106- }
107- }
108-
109- dispatcher->stop_flag = false;
110-
111- return NULL;
112-}
113-
114-/*!
115- *
116- */
117-bool
118-l7ag_dispatcher::start()
119-{
120- bool retbool = true;
121- if (0 != pthread_create(&dispatch_thread, NULL, run, this)) {
122- retbool = false;
123- }
124- return retbool;
125-}
126-
127-/*!
128- *
129- */
130-bool
131-l7ag_dispatcher::stop()
132-{
133- bool retbool = true;
134-// void* thread_return = NULL;
135-
136- stop_flag = true;
137- //join
138-// if ( 0 != pthread_join( dispatch_thread, &thread_return ) ) {
139- if (0 != pthread_join(dispatch_thread, NULL)) {
140- //join error
141- retbool = false;
142- }
143- return retbool;
144-}
145-
146-/*!
147- * ディスパッチ入口
148- */
149-void
150-l7ag_dispatcher::dispatch_message()
151-{
152- if (dispatch_functions.empty()) {
153- init_dispatcher_function_map();
154- }
155-
156- char *p_message = msg;
157- l7ag_message_header *msg_header = reinterpret_cast<l7ag_message_header *>(msg);
158- if (msg_header->magic[0] != 0x4d || msg_header->magic[1] != 0x47) return;
159-
160- //まず最初のpayload_headerにポインタをずらず
161- p_message = p_message + sizeof(l7ag_message_header);
162-
163- for (unsigned long long i = 0; i < msg_header->payload_count; ++i) {
164- //payload_headerとpayloadは1:1
165- //payload_headerのmessage_idでディスパッチ先を決める
166- l7ag_payload_header *payload_header = reinterpret_cast<l7ag_payload_header *>(p_message);
167- if (payload_header->magic[0] != 0x50 || payload_header->magic[1] != 0x59) return;
168- //payloadにポインタをずらす
169- char *payload = p_message + sizeof(l7ag_payload_header);
170-
171- std::map< int, boost::function<void(void *)> >::iterator it = dispatch_functions.find(payload_header->message_id);
172- if (dispatch_functions.end() != it) {
173- it->second(payload);
174- }
175- //次のデータにポインタをずらす
176- p_message = p_message + payload_header->payload_datasize;
177- }
178-}
179-
180-/*!
181- * 設定コマンド
182- */
183-void
184-l7ag_dispatcher::process_setting_command(void *p_data)
185-{
186- l7ag_settingcommand_message *command = (l7ag_settingcommand_message *)p_data;
187- //コマンド種別をみる
188- if (COMMAND_LOGLEVEL_CHANGE == command->command_id) {
189- //ログレベル変更
190- l7ag_changeloglevel_parameter *param = reinterpret_cast<l7ag_changeloglevel_parameter *>(&command->data[0]);
191- change_loglevel(param->log_category, param->log_level);
192- } else if (COMMAND_SETTINGFILE_RELOAD == command->command_id) {
193- //設定ファイル再読み込み
194- reload_configure();
195- }
196-}
197-
198-/*!
199- * Trap送信リクエスト
200- */
201-void
202-l7ag_dispatcher::process_trap_request(void *p_data)
203-{
204- l7ag_traprequest_message *command = (l7ag_traprequest_message *)p_data;
205- trapdata trap_req;
206- //OIDを取得
207- char *data_oid = static_cast<char *>(calloc((OIDDATASIZE + 1), sizeof(char)));
208- memcpy(data_oid, command->oid, OIDDATASIZE);
209- trap_req.oid = data_oid;
210- //messageを取得
211- char *data_msg = static_cast<char *>(calloc((TRAPREQUESTMESSAGESIZE + 1), sizeof(char)));
212- memcpy(data_msg, command->message, TRAPREQUESTMESSAGESIZE);
213- trap_req.message = data_msg;
214- trap_que->push(trap_req);
215-}
216-
217-/*!
218- * MIBデータ収集結果(VirtualService)
219- */
220-void
221-l7ag_dispatcher::process_mib_collect_response_vs(void *p_data)
222-{
223- bool writeflag = false;
224- l7ag_mibdata_payload_vs *command = (l7ag_mibdata_payload_vs *)p_data;
225- if (command->magic[0] != 0x56 || command->magic[1] != 0x53) return;
226- if (command->vs_count > 0) {
227- int vscount = l7ag_store_mibdata::getInstance().getVSdatacount();
228- for (int i = 0; i < vscount; ++i) {
229- if (l7ag_store_mibdata::getInstance().getVSmibdata(i)->index == command->index) {
230- l7ag_store_mibdata::getInstance().updateVSmibdata(i, command);
231- writeflag = true;
232- }
233- }
234- if (!writeflag) {
235- l7ag_store_mibdata::getInstance().addVSmibdata(command);
236- }
237- if (command->index == command->vs_count) {
238- // delete other index
239- l7ag_store_mibdata::getInstance().updateVSmibdata(command->vs_count, NULL);
240- }
241- } else {
242- l7ag_store_mibdata::getInstance().clearVSmibdata();
243- }
244-}
245-
246-/*!
247- * MIBデータ収集結果(RealServer)
248- */
249-void
250-l7ag_dispatcher::process_mib_collect_response_rs(void *p_data)
251-{
252- bool writeflag = false;
253- l7ag_mibdata_payload_rs *command = (l7ag_mibdata_payload_rs *)p_data;
254- if (command->magic[0] != 0x52 || command->magic[1] != 0x53) return;
255- if (command->rs_count > 0) {
256- int rscount = l7ag_store_mibdata::getInstance().getRSdatacount();
257- for (int i = 0; i < rscount; ++i) {
258- if (l7ag_store_mibdata::getInstance().getRSmibdata(i)->index == command->index) {
259- l7ag_store_mibdata::getInstance().updateRSmibdata(i, command);
260- writeflag = true;
261- }
262- }
263- if (!writeflag) {
264- l7ag_store_mibdata::getInstance().addRSmibdata(command);
265- }
266- if (command->index == command->rs_count) {
267- // delete other index
268- l7ag_store_mibdata::getInstance().updateRSmibdata(command->rs_count, NULL);
269- }
270- } else {
271- l7ag_store_mibdata::getInstance().clearRSmibdata();
272- }
273-}
274-
275-/*!
276- *
277- */
278-void
279-l7ag_dispatcher::change_loglevel(unsigned long long category, unsigned long long loglevel)
280-{
281- l7vs::Logger logger;
282- logger.setLogLevel(static_cast<l7vs::LOG_CATEGORY_TAG>(category), static_cast<l7vs::LOG_LEVEL_TAG>(loglevel));
283-}
284-
285-/*!
286- *
287- */
288-void
289-l7ag_dispatcher::reload_configure()
290-{
291- l7vs::Parameter parameter;
292- parameter.read_file(l7vs::PARAM_COMP_SNMPAGENT);
293-}
294-
295-void
296-l7ag_dispatcher::init_dispatcher_function_map()
297-{
298- dispatch_functions.clear();
299-
300- dispatch_functions[MESSAGE_ID_COMMANDREQUEST] = boost::bind(&l7ag_dispatcher::process_setting_command, this, _1);
301- dispatch_functions[MESSAGE_ID_TRAPREQUEST] = boost::bind(&l7ag_dispatcher::process_trap_request, this, _1);
302- dispatch_functions[MESSAGE_ID_MIBCOLLECTRESPONSE_VS] = boost::bind(&l7ag_dispatcher::process_mib_collect_response_vs, this, _1);
303- dispatch_functions[MESSAGE_ID_MIBCOLLECTRESPONSE_RS] = boost::bind(&l7ag_dispatcher::process_mib_collect_response_rs, this, _1);
304-}
--- a/snmpagent/dispatcher.h
+++ /dev/null
@@ -1,80 +0,0 @@
1-//
2-//! @file dispatcher.h
3-//! @brief snmpagent dispatch header
4-//
5-// Copyright (C) 2008 NTT COMWARE Corporation.
6-//
7-// Distributed under the Boost Software License, Version 1.0. (See accompanying
8-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9-//
10-
11-#ifndef L7AG_DISPATCHER_H
12-#define L7AG_DISPATCHER_H
13-
14-#include <map>
15-#include <string>
16-#include "lockedqueue.h"
17-#include "QueueContainer.h"
18-#include "trapdata.h"
19-#include "parameter.h"
20-#include "logger.h"
21-#include "message.h"
22-#include <boost/function.hpp>
23-#include <boost/bind.hpp>
24-
25-//! messagequeue typedef
26-typedef lockedqueue<QueueContainer> MessageQueue;
27-//! lockqueue typedef
28-typedef lockedqueue<trapdata> TrapQueue;
29-
30-//
31-//! @class l7ag_dispatcher
32-//! @brief message dispatch class
33-class l7ag_dispatcher
34-{
35-
36-private:
37- bool stop_flag; //! stopping flag
38- pthread_t dispatch_thread; //! dispatch thread id
39-
40- MessageQueue *message_que; //! message queue object pointer
41- TrapQueue *trap_que; //! trap queue object pointer
42-
43- size_t msg_size; //! message size
44- char *msg; //! message pointer
45- size_t msg_pos; //! message posision
46-
47- std::map< int, boost::function<void (void *)> > dispatch_functions;
48-
49- l7ag_dispatcher();
50-
51-protected:
52- static void *run(void *);
53-
54- void dispatch_message();
55- void process_setting_command(void *);
56- void process_trap_request(void *);
57- void process_mib_collect_response_vs(void *);
58- void process_mib_collect_response_rs(void *);
59-
60- void change_loglevel(unsigned long long , unsigned long long);
61- void reload_configure();
62- void init_dispatcher_function_map();
63-
64-public:
65- l7ag_dispatcher(MessageQueue *, TrapQueue *);
66- ~l7ag_dispatcher();
67-
68- bool start();
69- bool stop();
70-
71- MessageQueue *get_MessageQueue() {
72- return message_que;
73- }
74- TrapQueue *get_TrapQueue() {
75- return trap_que;
76- }
77-};
78-
79-#endif //__L7AG_DISPATCHER_H__
80-
--- a/snmpagent/interproccom.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
1-
2-#include "interproccom.h"
3-#include "subagent.h"
4-
5-
6-#define SCOPED_LOCK(m) \
7- pthread_mutex_lock(&m); /* エラー処理は略 */ \
8- void u_(pthread_mutex_t** m_) { pthread_mutex_unlock(*m_); } \
9- __attribute__((__cleanup__(u_))) pthread_mutex_t* scoped_lock_ = &m
10-
11-
12-/*!
13- *
14- */
15-l7ag_interproccommunicate::l7ag_interproccommunicate()
16-{
17- status = STOP;
18- stop_flag = false;
19-
20- pthread_mutex_init(&mutex_sbuf, NULL);
21- pthread_mutex_init(&mutex_rbuf, NULL);
22-}
23-
24-
25-/*!
26- *
27- */
28-l7ag_interproccommunicate::l7ag_interproccommunicate(l7ag_subagent *p_subagent)
29-{
30- status = STOP;
31- stop_flag = false;
32-
33- pthread_mutex_init(&mutex_sbuf, NULL);
34- pthread_mutex_init(&mutex_rbuf, NULL);
35-
36- set_parent(p_subagent);
37-}
38-
39-
40-/*!
41- *
42- */
43-l7ag_interproccommunicate::~l7ag_interproccommunicate()
44-{
45-
46-
47-}
48-
49-
50-/*!
51- *
52- */
53-void
54-l7ag_interproccommunicate::start_thread()
55-{
56-
57-
58-}
59-
60-
61-/*!
62- *
63- */
64-void
65-l7ag_interproccommunicate::send_mibdatacollect(std::string oid)
66-{
67- //make request message
68-
69-}
70-
71-
72-/*!
73- *
74- */
75-void
76-l7ag_interproccommunicate::set_parent(l7ag_subagent *p_subagent)
77-{
78- parent = p_subagent;
79-}
80-
81-
82-/*!
83- *
84- */
85-void *
86-l7ag_interproccommunicate::do_communicate(void *args)
87-{
88- l7ag_interproccommunicate *proccom = (l7ag_interproccommunicate *)args;
89- //initialize
90-
91- while (1) {
92- //recv
93- //send
94- //stop
95- if (proccom->getStopFlag()) {
96- //
97- }
98- }
99- //finalize
100-}
101-
102-
103-/*!
104- *
105- */
106-void
107-l7ag_interproccommunicate::setRequestMessage()
108-{
109-}
110-
--- a/snmpagent/interproccom.h
+++ /dev/null
@@ -1,50 +0,0 @@
1-#ifndef __INTERPROCCOM_H__
2-#define __INTERPROCCOM_H__
3-
4-#include <string>
5-#include <pthread.h>
6-
7-#include "l7ag_socket.h"
8-#include "tag_threadstat.h"
9-#include "dispatch_message.h"
10-#include "store_mibdata.h"
11-
12-class l7ag_subagent;
13-
14-class l7ag_interproccommunicate : public l7ag_socket
15-{
16-private:
17- l7ag_subagent *parent;
18- THREAD_STAT_TAG status;
19- bool stop_flag;
20-
21- pthread_mutex_t mutex_sbuf;
22- pthread_mutex_t mutex_rbuf;
23- char *buffer_send;
24- char *buffer_recv;
25-
26-protected:
27- l7ag_interproccommunicate();
28-
29- static void *do_communicate(void *args);
30-
31-public:
32- l7ag_interproccommunicate(l7ag_subagent *p_subagent);
33- ~l7ag_interproccommunicate();
34-
35- void set_parent(l7ag_subagent *p_subagent);
36-
37- void start_thread();
38- void stop_thread() {
39- stop_flag = true;
40- }
41-
42- void send_mibdatacollect(std::string oid);
43- bool getStopFlag() {
44- return stop_flag;
45- }
46- void setRequestMessage();
47-};
48-
49-#endif //__INTERPROCCOM_H__
50-
--- a/snmpagent/l7ag_parameter.h
+++ /dev/null
@@ -1,19 +0,0 @@
1-#ifndef __L7AG_PARAMETER_H__
2-#define __L7AG_PARAMETER_H__
3-
4-#include <string>
5-#include <map>
6-
7-#include "logger.h"
8-
9-struct l7ag_parameter {
10- std::string nic;
11- std::string address;
12- int portno;
13- int interval;
14- int status; // TODO remove status
15- std::map<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG> loglevel;
16-};
17-
18-#endif //__L7AG_PARAMETER_H__
19-
--- a/snmpagent/l7ag_socket.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
1-#include "l7ag_socket.h"
2-
3-
4-/*!
5- *
6- */
7-void l7ag_socket::connect()
8-{
9- //socket
10- //connect
11-}
12-
13-/*!
14- *
15- */
16-void l7ag_socket::disconnect()
17-{
18- //close
19-}
20-
21-/*!
22- *
23- */
24-void l7ag_socket::send()
25-{
26- //send
27-}
28-
29-/*!
30- *
31- */
32-void l7ag_socket::recv()
33-{
34- //recv
35-}
36-
37-
--- a/snmpagent/l7ag_socket.h
+++ /dev/null
@@ -1,18 +0,0 @@
1-#ifndef __L7AG_SOCKET_H__
2-#define __L7AG_SOCKET_H__
3-
4-class l7ag_socket
5-{
6-private:
7- int sockfd;
8-public:
9- l7ag_socket() {};
10- virtual ~l7ag_socket() {};
11-
12- void connect();
13- void disconnect();
14- void send();
15- void recv();
16-};
17-
18-#endif //__L7AG_SOCKET_H__
--- a/snmpagent/l7snmpagent.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
1-#include <signal.h>
2-#include <sstream>
3-#include <string>
4-
5-#include "logger.h"
6-#include "parameter.h"
7-#include "subagent.h"
8-
9-using namespace l7vs;
10-
11-l7ag_subagent *subagent;
12-
13-/*!
14- * sig handler
15- */
16-static void
17-handler_sig_exit(int sig)
18-{
19- subagent->stop();
20-}
21-
22-/*!
23- * setup signal handler
24- */
25-static int
26-set_sighandler(int sig, void (*handler)(int))
27-{
28- struct sigaction act;
29- int ret;
30-
31- ret = sigaction(sig, NULL, &act);
32- if (ret < 0) {
33- return ret;
34- }
35- act.sa_flags &= ~SA_RESETHAND;
36- act.sa_handler = handler;
37- ret = sigaction(sig, &act, NULL);
38- if (ret < 0) {
39- return ret;
40- }
41- return 0;
42-}
43-
44-/*!
45- *esetup all signal handlers
46- */
47-static int
48-set_sighandlers()
49-{
50- l7vs::Logger logger;
51- if (LOG_LV_DEBUG == logger.getLogLevel(l7vs::LOG_CAT_SNMPAGENT_START_STOP)) {
52- std::string debugstr("in_function set_sighandler()");
53- logger.putLogDebug(l7vs::LOG_CAT_SNMPAGENT_START_STOP, 0, debugstr, __FILE__, __LINE__);
54- }
55-
56- int ret;
57-
58-#define SET_SIGHANDLER(sig, handler) \
59- do { \
60- ret = set_sighandler((sig), (handler)); \
61- if (ret < 0) { \
62- if (LOG_LV_DEBUG == logger.getLogLevel(l7vs::LOG_CAT_SNMPAGENT_SYSTEM_SIGNAL)) { \
63- std::ostringstream str; \
64- str << "out_function: static int set_sighandlers(void) return_value: " << ret; \
65- logger.putLogDebug(l7vs::LOG_CAT_SNMPAGENT_SYSTEM_SIGNAL, 0, str.str(), __FILE__, __LINE__ ); \
66- } \
67- return ret; \
68- } \
69- } while (0)
70-
71- SET_SIGHANDLER(SIGHUP, handler_sig_exit);
72- SET_SIGHANDLER(SIGINT, handler_sig_exit);
73- SET_SIGHANDLER(SIGQUIT, handler_sig_exit);
74- SET_SIGHANDLER(SIGTERM, handler_sig_exit);
75- SET_SIGHANDLER(SIGUSR1, SIG_IGN);
76- SET_SIGHANDLER(SIGUSR2, SIG_IGN);
77- SET_SIGHANDLER(SIGALRM, SIG_IGN);
78- SET_SIGHANDLER(SIGCHLD, SIG_IGN);
79-
80-#undef SET_SIGHANDLER
81-
82- if (LOG_LV_DEBUG == logger.getLogLevel(l7vs::LOG_CAT_SNMPAGENT_START_STOP)) {
83- std::string debugstr("out_function set_sighandler()");
84- logger.putLogDebug(l7vs::LOG_CAT_SNMPAGENT_START_STOP, 0, debugstr, __FILE__, __LINE__);
85- }
86- return 0;
87-}
88-
89-/*!
90- * l7snmpagent main
91- * @param[in] argc number of argument
92- * @param[in] argv array of argument
93- */
94-int
95-main(int argc, char *argv[])
96-{
97- l7vs::Logger logger;
98- logger.putLogInfo(l7vs::LOG_CAT_SNMPAGENT_START_STOP, 0, "start l7snmpagent", __FILE__, __LINE__);
99-
100- if (LOG_LV_DEBUG == logger.getLogLevel(l7vs::LOG_CAT_SNMPAGENT_START_STOP)) {
101- std::string debugstr;
102- // TODO set debugstr
103- logger.putLogDebug(l7vs::LOG_CAT_SNMPAGENT_START_STOP, 0, debugstr, __FILE__, __LINE__);
104- }
105-
106- set_sighandlers();
107-
108- // TODO whats this comment?
109-// parameter_register_function_pointer();
110-
111- subagent = new l7ag_subagent();
112-
113- // start subagent
114- if (!subagent->start()) {
115- // TODO error log
116- }
117-
118- logger.putLogInfo(l7vs::LOG_CAT_SNMPAGENT_START_STOP, 0, "stop l7snmpagent", __FILE__, __LINE__);
119-
120- delete subagent;
121- subagent = NULL;
122- return 0;
123-}
124-
125-// TODO remove unit test code!!!
126-int
127-l7snmp_main(int argc, char *argv[])
128-{
129- return main(argc, argv);
130-}
--- a/snmpagent/lockedqueue.h
+++ /dev/null
@@ -1,62 +0,0 @@
1-#ifndef __LOCKEDQUEUE_H__
2-#define __LOCKEDQUEUE_H__
3-
4-#include <queue>
5-#include <deque>
6-#include <pthread.h>
7-
8-template < typename T, typename _Seq = std::deque<T> >
9-class lockedqueue;
10-
11-template<typename T, typename _Seq>
12-class lockedqueue
13-{
14- typedef typename _Seq::value_type value_type;
15- typedef typename _Seq::reference reference;
16- typedef typename _Seq::size_type size_type;
17-
18-private:
19- pthread_mutex_t mtx;
20- std::queue<T, _Seq> que;
21-
22-protected:
23-
24-public:
25- lockedqueue() {
26- pthread_mutex_init(&mtx, NULL);
27- }
28- ~lockedqueue() {}
29-
30- bool
31- empty() const {
32- return que.empty();
33- }
34-
35- size_type
36- size() const {
37- return que.size();
38- }
39-
40- reference
41- front() {
42- return que.front();
43- }
44-
45- void
46- push(const value_type &_data) {
47- pthread_mutex_lock(&mtx);
48- que.push(_data);
49- pthread_mutex_unlock(&mtx);
50- }
51-
52- void
53- pop() {
54- pthread_mutex_lock(&mtx);
55- que.pop();
56- pthread_mutex_unlock(&mtx);
57- }
58-
59-};
60-
61-#endif//__LOCKEDQUEUE_H__
62-
--- a/snmpagent/message.h
+++ /dev/null
@@ -1,193 +0,0 @@
1-//
2-//! @file massage.h
3-//! @brief snmpagent - l7vsd message header
4-//
5-// Copyright (C) 2008 NTT COMWARE Corporation.
6-//
7-// Distributed under the Boost Software License, Version 1.0. (See accompanying
8-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9-//
10-
11-#ifndef MESSAGE_H
12-#define MESSAGE_H
13-
14-#define PADDINGSIZE (1)
15-
16-#define OIDDATASIZE (128) // must 64 multiple number for structure byte offset
17-#define COMMANDDATASIZE (256)
18-#define TRAPREQUESTMESSAGESIZE (64) // must 64 multiple number for structure byte offset
19-#define MIBREQUESTDATASIZE (64) // must 64 multiple number for structure byte offset
20-#define L7VS_MODNAME_LEN (256) // l7vs.h remove this numeric. define this,
21-#define L7VS_PROTOMOD_OPT_LEN (512) // l7vs.h remove this numeric, define this,
22-
23-//message id definitions(l7vsd to subagent)
24-#define MESSAGE_ID_COMMANDREQUEST (0)
25-#define MESSAGE_ID_TRAPREQUEST (1)
26-#define MESSAGE_ID_MIBCOLLECTRESPONSE_VS (2)
27-#define MESSAGE_ID_MIBCOLLECTRESPONSE_RS (3)
28-
29-//message id definitions(subagent to l7vsd)
30-#define MESSAGE_ID_MIBCOLLECTREQUEST (100)
31-
32-//setting command definitions
33-#define COMMAND_LOGLEVEL_CHANGE (0x1)
34-#define COMMAND_SETTINGFILE_RELOAD (0x2)
35-
36-#define MIBDATA_CATEGORY_VS (1)
37-#define MIBDATA_CATEGORY_RS (2)
38-
39-#define MAGIC_NUMBER_LENGTH (2)
40-#define MAGIC_MESSAGE_HEADER "MG" // 0x4D 0x47
41-#define MAGIC_PAYLOAD_HEADER "PY" // 0x50 0x59
42-#define MAGIC_SETTING_COMMAND "ST" // 0x53 0x54
43-#define MAGIC_CHANGE_LOGLEVEL "LL" // 0x4c 0x4c
44-#define MAGIC_TRAP_REQUEST "TR" // 0x54 0x52
45-#define MAGIC_VIRTUAL_SERVICE "VS" // 0x56 0x53
46-#define MAGIC_REAL_SERVER "RS" // 0x52 0x53
47-#define MAGIC_MIB_REQUEST "RQ" // 0x52 0x51
48-
49-
50-struct l7ag_message_header {
51- char magic[MAGIC_NUMBER_LENGTH]; //! Magic number
52- unsigned long long version; //! Version
53- unsigned long long time; //! Created time
54- unsigned long long size; //! Message size
55- unsigned long long payload_count; //! Payload count
56-};
57-
58-/*!
59- *
60- */
61-struct l7ag_payload_header {
62- char magic[MAGIC_NUMBER_LENGTH]; //! Magic number
63- unsigned long long message_id;
64- unsigned long long payload_datasize;
65-};
66-
67-/*
68- * log level setting
69- */
70-struct l7ag_settingcommand_message {
71- char magic[MAGIC_NUMBER_LENGTH]; //! Magic number
72- unsigned long long command_id; //! 0 when change log level, 1 when reload config
73- unsigned char data[COMMANDDATASIZE]; //! command parameter (set category when change log level)
74-};
75-
76-/*!
77- * command parameter of change log level
78- */
79-struct l7ag_changeloglevel_parameter {
80- char magic[MAGIC_NUMBER_LENGTH]; //! Magic number
81- unsigned long long log_category;
82- unsigned long long log_level;
83-};
84-
85-/*!
86- * Request message of Trap
87- */
88-struct l7ag_traprequest_message {
89- char magic[MAGIC_NUMBER_LENGTH]; //! Magic number
90- char oid[OIDDATASIZE]; //! OID (must "1.3.6.1.4.1.60000.1.0.2")
91- char message[TRAPREQUESTMESSAGESIZE]; //! Errno
92-};
93-
94-/*!
95- * Message for collect MIB data (VirtualService)
96- */
97-struct l7ag_mibdata_payload_vs {
98- char magic[MAGIC_NUMBER_LENGTH]; //! Magic number
99- int index; //! VirtualService index
100- uint8_t protocol; //! Protocol
101- uint32_t ipAddress; //! IP
102- uint16_t portNumber; //! Port
103- char scheduleModule[L7VS_MODNAME_LEN]; //! schedule module
104- char protocolModule[L7VS_MODNAME_LEN]; //! protocol module
105- char protocolModuleOption[L7VS_PROTOMOD_OPT_LEN]; //! protomod option
106- int reschedule; //! reschedule flag
107- uint32_t sorryIpAddress; //! sorry IP
108- uint16_t sorryPortNumber; //! sorry port
109- int sorryThreshold; //! sorry threshold
110- int sorryForceFlag; //! sorry flag
111- unsigned long long QoSThresholdUp; //! QoS Threashold value for up stream
112- unsigned long long QoSThresholdDown; //! QoS Threashold value for down stream
113- unsigned long long throughputUp; //! Throughput for up stream
114- unsigned long long throughputDown; //! Throughput for down stream
115- int vs_count; //! VirtualService count
116-
117- bool operator==(const l7ag_mibdata_payload_vs &in_data) {
118- if (index == in_data.index) {
119- return true;
120- } else {
121- return false;
122- }
123- }
124- l7ag_mibdata_payload_vs &operator=(const l7ag_mibdata_payload_vs &in_data) {
125- index = in_data.index;
126- protocol = in_data.protocol;
127- ipAddress = in_data.ipAddress;
128- strncpy(scheduleModule, in_data.scheduleModule, L7VS_MODNAME_LEN);
129- strncpy(protocolModule, in_data.protocolModule, L7VS_MODNAME_LEN);
130- strncpy(protocolModuleOption, in_data.protocolModuleOption, L7VS_PROTOMOD_OPT_LEN);
131- reschedule = in_data.reschedule;
132- sorryIpAddress = in_data.sorryIpAddress;
133- sorryPortNumber = in_data.sorryPortNumber;
134- sorryThreshold = in_data.sorryThreshold;
135- sorryForceFlag = in_data.sorryForceFlag;
136- QoSThresholdUp = in_data.QoSThresholdUp;
137- QoSThresholdDown = in_data.QoSThresholdDown;
138- throughputUp = in_data.throughputUp;
139- throughputDown = in_data.throughputDown;
140- vs_count = in_data.vs_count;
141-
142- return *this;
143- }
144-};
145-
146-
147-/*!
148- * Message for collect MIB data (RealServer)
149- */
150-struct l7ag_mibdata_payload_rs {
151- char magic[MAGIC_NUMBER_LENGTH]; //! Magic number
152- int index; //! RealServer index
153- int virtualServiceIndex; //! Relation VirtualService index
154- uint32_t ipAddress; //! IP
155- uint16_t portNumber; //! Port
156- int forwardMode; //! forward mode
157- unsigned long long weight; //! weight
158- unsigned long long activeConn; //! active connection
159- unsigned long long inactiveConn; //! inactive connection
160- int rs_count;
161-
162- bool operator==(const l7ag_mibdata_payload_rs &in_data) {
163- if (index == in_data.index) {
164- return true;
165- } else {
166- return false;
167- }
168- }
169- l7ag_mibdata_payload_rs &operator=(const l7ag_mibdata_payload_rs &in_data) {
170- index = in_data.index;
171- virtualServiceIndex = in_data.virtualServiceIndex;
172- ipAddress = in_data.ipAddress;
173- portNumber = in_data.portNumber;
174- forwardMode = in_data.forwardMode;
175- weight = in_data.weight;
176- activeConn = in_data.activeConn;
177- inactiveConn = in_data.inactiveConn;
178- rs_count = in_data.rs_count;
179-
180- return *this;
181- }
182-};
183-
184-/*!
185- * Request message of collect MIB data
186- */
187-struct l7ag_mibrequest_message {
188- char magic[MAGIC_NUMBER_LENGTH]; //! Magic number
189- unsigned char oid[OIDDATASIZE]; //! OID. Get all data when set oid to 0
190- unsigned char data[MIBREQUESTDATASIZE]; //! Expansion
191-};
192-
193-#endif //MESSAGE_H
--- a/snmpagent/mibs.memo
+++ /dev/null
@@ -1,96 +0,0 @@
1-# UltraMonkey-L7 mib data memo (TSV)
2-# (cf. $ env MIBS=ALL snmptranslate -IR -Tp ultramonkey-l7)
3-enterprises.ultramonkey-l7(.1.3.6.1.4.1.xxxxx)
4-0 um7Traps
5- 1 um7StateAlert
6- 2 um7VirtualServiceAlert
7- 3 um7ReplicationAlert
8- 4 um7LogLevelAlert
9- 5 um7QoSAlarmOn
10- 6 um7QoSAlarmOff
11- 7 um7MessageAlert
12-1 um7Objects
13- 1 um7CurrentDataGroup
14- 1 um7VirtualServiceTable SEQUENCE OF Um7VirtualServiceEntry not-accessible -
15- 1 um7VirtualServiceEntry Um7VirtualServiceEntry INDEX { um7VSIndex } not-accessible -
16- 1 um7VSIndex INTEGER (1..127) read-only -
17- 2 um7VSProtocol INTEGER { tcp(1), udp(2) } read-only -
18- 3 um7VSIPAddress InetAddress read-only -
19- 4 um7VSPortNumber InetPortNumber read-only -
20- 5 um7VSScheduleModule OCTET STRING (SIZE (0..15)) read-only -
21- 6 um7VSProtocolModule OCTET STRING (SIZE (0..15)) read-only -
22- 7 um7VSProtocolModuleOption OCTET STRING (SIZE (0..511)) read-only -
23- 8 um7VSReschedule INTEGER { on(1), off(2) } read-only -
24- 9 um7VSSorryIpAddress InetAddress read-only -
25- 10 um7VSSorryPortNumber InetPortNumber read-only -
26- 11 um7VSSorryThreshold INTEGER (0..2147483647) read-only Connections
27- 12 um7VSSorryForceFlag INTEGER { on(1), off(2) } read-only -
28- 13 um7VSQoSThresholdUp INTEGER (0..18446744073709551615) read-only bps
29- 14 um7VSQoSThresholdDown INTEGER (0..18446744073709551615) read-only bps
30- 15 um7VSThroughputUp INTEGER (0..18446744073709551615) read-only bps
31- 16 um7VSThroughputDown INTEGER (0..18446744073709551615) read-only bps
32- 2 um7RealServerTable SEQUENCE OF Um7RealServerEntry not-accessible -
33- 1 um7RealServerEntry Um7RealServerEntry INDEX { Counter32 } not-accessible -
34- 1 um7RSIndex INTEGER (1..65535) read-only -
35- 2 um7RSVirtualServiceIndex INTEGER (1..127) read-only -
36- 3 um7RSIPAddress InetAddress read-only -
37- 4 um7RSPortNumber InetPortNumber read-only -
38- 5 um7RSForwardMode INTEGER { masq(1) } read-only -
39- 6 um7RSWeight INTEGER (0..2147483647) read-only -
40- 7 um7RSActiveConn INTEGER (0..2147483647) read-only Connections
41- 8 um7RSInactiveConn INTEGER (0..2147483647) read-only Connections
42- 3 um7LogLevel
43- 1 um7LogLevelL7vsd
44- 1 um7LogVsdNetwork INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
45- 2 um7LogVsdNetworkBandwidth INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
46- 3 um7LogVsdNetworkNumConnection INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
47- 4 um7LogVsdNetworkQoS INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
48- 5 um7LogVsdVirtualService INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
49- 6 um7LogVsdRealServer INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
50- 7 um7LogVsdRealServerBalancing INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
51- 8 um7LogVsdSorryServer INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
52- 9 um7LogVsdReplication INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
53- 10 um7LogVsdStartStop INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
54- 11 um7LogVsdSystem INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
55- 12 um7LogVsdSystemMemory INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
56- 13 um7LogVsdSystemSocket INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
57- 14 um7LogVsdSystemSignal INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
58- 15 um7LogVsdEnvironment INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
59- 16 um7LogVsdEnvironmentParameter INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
60- 17 um7LogVsdLogger INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
61- 18 um7LogVsdParameter INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
62- 19 um7LogVsdEvent INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
63- 20 um7LogVsdSchedule INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
64- 21 um7LogVsdProgram INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
65- 22 um7LogVsdProtocol INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
66- 23 um7LogVsdModule INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
67- 2 um7LogLevelL7vsadm
68- 1 um7LogVsadmParse INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
69- 2 um7LogVsadmOperate INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
70- 3 um7LogVsadmCommunicate INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
71- 4 um7LogVsadmConfigResult INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
72- 5 um7LogVsadmCommon INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
73- 6 um7LogVsadmLogger INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
74- 7 um7LogVsadmParameter INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
75- 8 um7LogVsadmProtocol INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
76- 9 um7LogVsadmModule INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
77- 3 um7LogLevelSnmpAgent
78- 1 um7LogSnmpStartStop INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
79- 2 um7LogSnmpManagerReceive INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
80- 3 um7LogSnmpManagerSend INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
81- 4 um7LogSnmpL7vsdReceive INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
82- 5 um7LogSnmpL7vsdSend INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
83- 6 um7LogSnmpLogger INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
84- 7 um7LogSnmpParameter INTEGER { unknown(0), debug(1), info(2), warn(3), error(4), fatal(5) } read-only -
85- 4 um7Status
86- 1 um7StatMessage DisplayString read-only -
87- 2 um7StatReplication INTEGER { out(1), single(2), master(3), slave(4), masterstop(5), slavestop(6) } read-only -
88- 3 um7StatSnmpAgent INTEGER { unknown(0), disconnect(1), connect(2) } read-only -
89-2 um7MIBConformance
90- 1 um7MIBCompliances
91- 1 um7MIBCompliance
92- 2 um7MIBGroups
93- 1 um7MIBGroup
94- 2 um7TrapGroup
95-
96-# vi:se noet ts=3:
--- a/snmpagent/netsnmp_bridge.c
+++ /dev/null
@@ -1,1964 +0,0 @@
1-/*
2- * Note: this file originally auto-generated by mib2c using
3- * : mib2c.scalar.conf,v 1.9 2005/01/07 09:37:18 dts12 Exp $
4- * : mib2c.create-dataset.conf,v 5.4 2004/02/02 19:06:53 rstory Exp $
5- * : mib2c.notify.conf,v 5.3 2004/04/15 12:29:19 dts12 Exp $
6- */
7-
8-#include "netsnmp_bridge.h"
9-
10-static oid snmptrap_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
11-static unsigned int callback_id = 0;
12-
13-static netsnmp_table_data_set *vs_table_set = NULL;
14-static netsnmp_table_data_set *rs_table_set = NULL;
15-
16-/** Initializes the ultramonkey-l7 module */
17-void
18-init_netsnmp_bridge(void *clientarg)
19-{
20- static oid um7LogVsdNetwork_oid[] =
21- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 1 };
22- static oid um7LogVsdNetworkBandwidth_oid[] =
23- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 2 };
24- static oid um7LogVsdNetworkNumConnection_oid[] =
25- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 3 };
26- static oid um7LogVsdNetworkQoS_oid[] =
27- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 4 };
28- static oid um7LogVsdVirtualService_oid[] =
29- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 5 };
30- static oid um7LogVsdRealServer_oid[] =
31- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 6 };
32- static oid um7LogVsdRealServerBalancing_oid[] =
33- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 7 };
34- static oid um7LogVsdSorryServer_oid[] =
35- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 8 };
36- static oid um7LogVsdReplication_oid[] =
37- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 9 };
38- static oid um7LogVsdStartStop_oid[] =
39- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 10 };
40- static oid um7LogVsdSystem_oid[] =
41- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 11 };
42- static oid um7LogVsdSystemMemory_oid[] =
43- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 12 };
44- static oid um7LogVsdSystemSocket_oid[] =
45- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 13 };
46- static oid um7LogVsdSystemSignal_oid[] =
47- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 14 };
48- static oid um7LogVsdEnvironment_oid[] =
49- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 15 };
50- static oid um7LogVsdEnvironmentParameter_oid[] =
51- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 16 };
52- static oid um7LogVsdLogger_oid[] =
53- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 17 };
54- static oid um7LogVsdParameter_oid[] =
55- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 18 };
56- static oid um7LogVsdEvent_oid[] =
57- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 19 };
58- static oid um7LogVsdSchedule_oid[] =
59- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 20 };
60- static oid um7LogVsdProgram_oid[] =
61- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 21 };
62- static oid um7LogVsdProtocol_oid[] =
63- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 22 };
64- static oid um7LogVsdModule_oid[] =
65- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 1, 23 };
66- static oid um7LogVsadmParse_oid[] =
67- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 2, 1 };
68- static oid um7LogVsadmOperate_oid[] =
69- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 2, 2 };
70- static oid um7LogVsadmCommunicate_oid[] =
71- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 2, 3 };
72- static oid um7LogVsadmConfigResult_oid[] =
73- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 2, 4 };
74- static oid um7LogVsadmCommon_oid[] =
75- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 2, 5 };
76- static oid um7LogVsadmLogger_oid[] =
77- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 2, 6 };
78- static oid um7LogVsadmParameter_oid[] =
79- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 2, 7 };
80- static oid um7LogVsadmProtocol_oid[] =
81- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 2, 8 };
82- static oid um7LogVsadmModule_oid[] =
83- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 2, 9 };
84- static oid um7LogSnmpStartStop_oid[] =
85- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 3, 1 };
86- static oid um7LogSnmpManagerReceive_oid[] =
87- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 3, 2 };
88- static oid um7LogSnmpManagerSend_oid[] =
89- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 3, 3 };
90- static oid um7LogSnmpL7vsdReceive_oid[] =
91- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 3, 4 };
92- static oid um7LogSnmpL7vsdSend_oid[] =
93- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 3, 5 };
94- static oid um7LogSnmpLogger_oid[] =
95- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 3, 6 };
96- static oid um7LogSnmpParameter_oid[] =
97- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, 3, 7 };
98- static oid um7StatMessage_oid[] =
99- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 4, 1 };
100- static oid um7StatReplication_oid[] =
101- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 4, 2 };
102- static oid um7StatSnmpAgent_oid[] =
103- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 4, 3 };
104-
105- DEBUGMSGTL(("ultramonkey-l7", "Initializing\n"));
106-
107- netsnmp_register_scalar(netsnmp_create_handler_registration
108- ("um7LogVsdNetwork", handle_um7LogVsdNetwork,
109- um7LogVsdNetwork_oid,
110- OID_LENGTH(um7LogVsdNetwork_oid),
111- HANDLER_CAN_RONLY));
112- netsnmp_register_scalar(netsnmp_create_handler_registration
113- ("um7LogVsdNetworkBandwidth",
114- handle_um7LogVsdNetworkBandwidth,
115- um7LogVsdNetworkBandwidth_oid,
116- OID_LENGTH(um7LogVsdNetworkBandwidth_oid),
117- HANDLER_CAN_RONLY));
118- netsnmp_register_scalar(netsnmp_create_handler_registration
119- ("um7LogVsdNetworkNumConnection",
120- handle_um7LogVsdNetworkNumConnection,
121- um7LogVsdNetworkNumConnection_oid,
122- OID_LENGTH(um7LogVsdNetworkNumConnection_oid),
123- HANDLER_CAN_RONLY));
124- netsnmp_register_scalar(netsnmp_create_handler_registration
125- ("um7LogVsdNetworkQoS",
126- handle_um7LogVsdNetworkQoS,
127- um7LogVsdNetworkQoS_oid,
128- OID_LENGTH(um7LogVsdNetworkQoS_oid),
129- HANDLER_CAN_RONLY));
130- netsnmp_register_scalar(netsnmp_create_handler_registration
131- ("um7LogVsdVirtualService",
132- handle_um7LogVsdVirtualService,
133- um7LogVsdVirtualService_oid,
134- OID_LENGTH(um7LogVsdVirtualService_oid),
135- HANDLER_CAN_RONLY));
136- netsnmp_register_scalar(netsnmp_create_handler_registration
137- ("um7LogVsdRealServer",
138- handle_um7LogVsdRealServer,
139- um7LogVsdRealServer_oid,
140- OID_LENGTH(um7LogVsdRealServer_oid),
141- HANDLER_CAN_RONLY));
142- netsnmp_register_scalar(netsnmp_create_handler_registration
143- ("um7LogVsdRealServerBalancing",
144- handle_um7LogVsdRealServerBalancing,
145- um7LogVsdRealServerBalancing_oid,
146- OID_LENGTH(um7LogVsdRealServerBalancing_oid),
147- HANDLER_CAN_RONLY));
148- netsnmp_register_scalar(netsnmp_create_handler_registration
149- ("um7LogVsdSorryServer",
150- handle_um7LogVsdSorryServer,
151- um7LogVsdSorryServer_oid,
152- OID_LENGTH(um7LogVsdSorryServer_oid),
153- HANDLER_CAN_RONLY));
154- netsnmp_register_scalar(netsnmp_create_handler_registration
155- ("um7LogVsdReplication",
156- handle_um7LogVsdReplication,
157- um7LogVsdReplication_oid,
158- OID_LENGTH(um7LogVsdReplication_oid),
159- HANDLER_CAN_RONLY));
160- netsnmp_register_scalar(netsnmp_create_handler_registration
161- ("um7LogVsdStartStop",
162- handle_um7LogVsdStartStop,
163- um7LogVsdStartStop_oid,
164- OID_LENGTH(um7LogVsdStartStop_oid),
165- HANDLER_CAN_RONLY));
166- netsnmp_register_scalar(netsnmp_create_handler_registration
167- ("um7LogVsdSystem", handle_um7LogVsdSystem,
168- um7LogVsdSystem_oid,
169- OID_LENGTH(um7LogVsdSystem_oid),
170- HANDLER_CAN_RONLY));
171- netsnmp_register_scalar(netsnmp_create_handler_registration
172- ("um7LogVsdSystemMemory",
173- handle_um7LogVsdSystemMemory,
174- um7LogVsdSystemMemory_oid,
175- OID_LENGTH(um7LogVsdSystemMemory_oid),
176- HANDLER_CAN_RONLY));
177- netsnmp_register_scalar(netsnmp_create_handler_registration
178- ("um7LogVsdSystemSocket",
179- handle_um7LogVsdSystemSocket,
180- um7LogVsdSystemSocket_oid,
181- OID_LENGTH(um7LogVsdSystemSocket_oid),
182- HANDLER_CAN_RONLY));
183- netsnmp_register_scalar(netsnmp_create_handler_registration
184- ("um7LogVsdSystemSignal",
185- handle_um7LogVsdSystemSignal,
186- um7LogVsdSystemSignal_oid,
187- OID_LENGTH(um7LogVsdSystemSignal_oid),
188- HANDLER_CAN_RONLY));
189- netsnmp_register_scalar(netsnmp_create_handler_registration
190- ("um7LogVsdEnvironment",
191- handle_um7LogVsdEnvironment,
192- um7LogVsdEnvironment_oid,
193- OID_LENGTH(um7LogVsdEnvironment_oid),
194- HANDLER_CAN_RONLY));
195- netsnmp_register_scalar(netsnmp_create_handler_registration
196- ("um7LogVsdEnvironmentParameter",
197- handle_um7LogVsdEnvironmentParameter,
198- um7LogVsdEnvironmentParameter_oid,
199- OID_LENGTH(um7LogVsdEnvironmentParameter_oid),
200- HANDLER_CAN_RONLY));
201- netsnmp_register_scalar(netsnmp_create_handler_registration
202- ("um7LogVsdLogger", handle_um7LogVsdLogger,
203- um7LogVsdLogger_oid,
204- OID_LENGTH(um7LogVsdLogger_oid),
205- HANDLER_CAN_RONLY));
206- netsnmp_register_scalar(netsnmp_create_handler_registration
207- ("um7LogVsdParameter",
208- handle_um7LogVsdParameter,
209- um7LogVsdParameter_oid,
210- OID_LENGTH(um7LogVsdParameter_oid),
211- HANDLER_CAN_RONLY));
212- netsnmp_register_scalar(netsnmp_create_handler_registration
213- ("um7LogVsdEvent", handle_um7LogVsdEvent,
214- um7LogVsdEvent_oid,
215- OID_LENGTH(um7LogVsdEvent_oid),
216- HANDLER_CAN_RONLY));
217- netsnmp_register_scalar(netsnmp_create_handler_registration
218- ("um7LogVsdSchedule", handle_um7LogVsdSchedule,
219- um7LogVsdSchedule_oid,
220- OID_LENGTH(um7LogVsdSchedule_oid),
221- HANDLER_CAN_RONLY));
222- netsnmp_register_scalar(netsnmp_create_handler_registration
223- ("um7LogVsdProgram", handle_um7LogVsdProgram,
224- um7LogVsdProgram_oid,
225- OID_LENGTH(um7LogVsdProgram_oid),
226- HANDLER_CAN_RONLY));
227- netsnmp_register_scalar(netsnmp_create_handler_registration
228- ("um7LogVsdProtocol", handle_um7LogVsdProtocol,
229- um7LogVsdProtocol_oid,
230- OID_LENGTH(um7LogVsdProtocol_oid),
231- HANDLER_CAN_RONLY));
232- netsnmp_register_scalar(netsnmp_create_handler_registration
233- ("um7LogVsdModule", handle_um7LogVsdModule,
234- um7LogVsdModule_oid,
235- OID_LENGTH(um7LogVsdModule_oid),
236- HANDLER_CAN_RONLY));
237- netsnmp_register_scalar(netsnmp_create_handler_registration
238- ("um7LogVsadmParse", handle_um7LogVsadmParse,
239- um7LogVsadmParse_oid,
240- OID_LENGTH(um7LogVsadmParse_oid),
241- HANDLER_CAN_RONLY));
242- netsnmp_register_scalar(netsnmp_create_handler_registration
243- ("um7LogVsadmOperate",
244- handle_um7LogVsadmOperate,
245- um7LogVsadmOperate_oid,
246- OID_LENGTH(um7LogVsadmOperate_oid),
247- HANDLER_CAN_RONLY));
248- netsnmp_register_scalar(netsnmp_create_handler_registration
249- ("um7LogVsadmCommunicate",
250- handle_um7LogVsadmCommunicate,
251- um7LogVsadmCommunicate_oid,
252- OID_LENGTH(um7LogVsadmCommunicate_oid),
253- HANDLER_CAN_RONLY));
254- netsnmp_register_scalar(netsnmp_create_handler_registration
255- ("um7LogVsadmConfigResult",
256- handle_um7LogVsadmConfigResult,
257- um7LogVsadmConfigResult_oid,
258- OID_LENGTH(um7LogVsadmConfigResult_oid),
259- HANDLER_CAN_RONLY));
260- netsnmp_register_scalar(netsnmp_create_handler_registration
261- ("um7LogVsadmCommon", handle_um7LogVsadmCommon,
262- um7LogVsadmCommon_oid,
263- OID_LENGTH(um7LogVsadmCommon_oid),
264- HANDLER_CAN_RONLY));
265- netsnmp_register_scalar(netsnmp_create_handler_registration
266- ("um7LogVsadmLogger", handle_um7LogVsadmLogger,
267- um7LogVsadmLogger_oid,
268- OID_LENGTH(um7LogVsadmLogger_oid),
269- HANDLER_CAN_RONLY));
270- netsnmp_register_scalar(netsnmp_create_handler_registration
271- ("um7LogVsadmParameter",
272- handle_um7LogVsadmParameter,
273- um7LogVsadmParameter_oid,
274- OID_LENGTH(um7LogVsadmParameter_oid),
275- HANDLER_CAN_RONLY));
276- netsnmp_register_scalar(netsnmp_create_handler_registration
277- ("um7LogVsadmProtocol",
278- handle_um7LogVsadmProtocol,
279- um7LogVsadmProtocol_oid,
280- OID_LENGTH(um7LogVsadmProtocol_oid),
281- HANDLER_CAN_RONLY));
282- netsnmp_register_scalar(netsnmp_create_handler_registration
283- ("um7LogVsadmModule", handle_um7LogVsadmModule,
284- um7LogVsadmModule_oid,
285- OID_LENGTH(um7LogVsadmModule_oid),
286- HANDLER_CAN_RONLY));
287- netsnmp_register_scalar(netsnmp_create_handler_registration
288- ("um7LogSnmpStartStop",
289- handle_um7LogSnmpStartStop,
290- um7LogSnmpStartStop_oid,
291- OID_LENGTH(um7LogSnmpStartStop_oid),
292- HANDLER_CAN_RONLY));
293- netsnmp_register_scalar(netsnmp_create_handler_registration
294- ("um7LogSnmpManagerReceive",
295- handle_um7LogSnmpManagerReceive,
296- um7LogSnmpManagerReceive_oid,
297- OID_LENGTH(um7LogSnmpManagerReceive_oid),
298- HANDLER_CAN_RONLY));
299- netsnmp_register_scalar(netsnmp_create_handler_registration
300- ("um7LogSnmpManagerSend",
301- handle_um7LogSnmpManagerSend,
302- um7LogSnmpManagerSend_oid,
303- OID_LENGTH(um7LogSnmpManagerSend_oid),
304- HANDLER_CAN_RONLY));
305- netsnmp_register_scalar(netsnmp_create_handler_registration
306- ("um7LogSnmpL7vsdReceive",
307- handle_um7LogSnmpL7vsdReceive,
308- um7LogSnmpL7vsdReceive_oid,
309- OID_LENGTH(um7LogSnmpL7vsdReceive_oid),
310- HANDLER_CAN_RONLY));
311- netsnmp_register_scalar(netsnmp_create_handler_registration
312- ("um7LogSnmpL7vsdSend",
313- handle_um7LogSnmpL7vsdSend,
314- um7LogSnmpL7vsdSend_oid,
315- OID_LENGTH(um7LogSnmpL7vsdSend_oid),
316- HANDLER_CAN_RONLY));
317- netsnmp_register_scalar(netsnmp_create_handler_registration
318- ("um7LogSnmpLogger", handle_um7LogSnmpLogger,
319- um7LogSnmpLogger_oid,
320- OID_LENGTH(um7LogSnmpLogger_oid),
321- HANDLER_CAN_RONLY));
322- netsnmp_register_scalar(netsnmp_create_handler_registration
323- ("um7LogSnmpParameter",
324- handle_um7LogSnmpParameter,
325- um7LogSnmpParameter_oid,
326- OID_LENGTH(um7LogSnmpParameter_oid),
327- HANDLER_CAN_RONLY));
328- netsnmp_register_scalar(netsnmp_create_handler_registration
329- ("um7StatMessage", handle_um7StatMessage,
330- um7StatMessage_oid,
331- OID_LENGTH(um7StatMessage_oid),
332- HANDLER_CAN_RONLY));
333- netsnmp_register_scalar(netsnmp_create_handler_registration
334- ("um7StatReplication",
335- handle_um7StatReplication,
336- um7StatReplication_oid,
337- OID_LENGTH(um7StatReplication_oid),
338- HANDLER_CAN_RONLY));
339- netsnmp_register_scalar(netsnmp_create_handler_registration
340- ("um7StatSnmpAgent", handle_um7StatSnmpAgent,
341- um7StatSnmpAgent_oid,
342- OID_LENGTH(um7StatSnmpAgent_oid),
343- HANDLER_CAN_RONLY));
344-
345- /*
346- * here we initialize all the tables we're planning on supporting
347- */
348- initialize_table_um7VirtualServiceTable();
349- initialize_table_um7RealServerTable();
350-
351- // request mib collection every 1 sec.
352- callback_id = snmp_alarm_register(REPEAT_SEC, SA_REPEAT, getL7vsdData, clientarg);
353- if (callback_id == 0) {
354- // TODO error
355- }
356-}
357-
358-int
359-handle_um7LogVsdNetwork(netsnmp_mib_handler *handler,
360-netsnmp_handler_registration *reginfo,
361-netsnmp_agent_request_info *reqinfo,
362-netsnmp_request_info *requests)
363-{
364- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
365-
366- switch (reqinfo->mode) {
367- case MODE_GET:
368- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
369- (u_char *) &log->network,
370- sizeof(l7vs::LOG_LEVEL_TAG));
371- break;
372-
373- default:
374- snmp_log(LOG_ERR, "unknown mode (%d) in handle_um7LogVsdNetwork\n",
375- reqinfo->mode);
376- return SNMP_ERR_GENERR;
377- }
378-
379- return SNMP_ERR_NOERROR;
380-}
381-
382-int
383-handle_um7LogVsdNetworkBandwidth(netsnmp_mib_handler *handler,
384-netsnmp_handler_registration *reginfo,
385-netsnmp_agent_request_info *reqinfo,
386-netsnmp_request_info *requests)
387-{
388- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
389-
390- switch (reqinfo->mode) {
391- case MODE_GET:
392- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
393- (u_char *) &log->networkBandwidth,
394- sizeof(l7vs::LOG_LEVEL_TAG));
395- break;
396-
397- default:
398- snmp_log(LOG_ERR,
399- "unknown mode (%d) in handle_um7LogVsdNetworkBandwidth\n",
400- reqinfo->mode);
401- return SNMP_ERR_GENERR;
402- }
403-
404- return SNMP_ERR_NOERROR;
405-}
406-
407-int
408-handle_um7LogVsdNetworkNumConnection(netsnmp_mib_handler *handler,
409-netsnmp_handler_registration *reginfo,
410-netsnmp_agent_request_info *reqinfo,
411-netsnmp_request_info *requests)
412-{
413- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
414-
415- switch (reqinfo->mode) {
416- case MODE_GET:
417- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
418- (u_char *) &log->networkNumConnection,
419- sizeof(l7vs::LOG_LEVEL_TAG));
420- break;
421-
422- default:
423- snmp_log(LOG_ERR,
424- "unknown mode (%d) in handle_um7LogVsdNetworkNumConnection\n",
425- reqinfo->mode);
426- return SNMP_ERR_GENERR;
427- }
428-
429- return SNMP_ERR_NOERROR;
430-}
431-
432-int
433-handle_um7LogVsdNetworkQoS(netsnmp_mib_handler *handler,
434-netsnmp_handler_registration *reginfo,
435-netsnmp_agent_request_info *reqinfo,
436-netsnmp_request_info *requests)
437-{
438- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
439-
440- switch (reqinfo->mode) {
441- case MODE_GET:
442- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
443- (u_char *) &log->networkQoS,
444- sizeof(l7vs::LOG_LEVEL_TAG));
445- break;
446-
447- default:
448- snmp_log(LOG_ERR,
449- "unknown mode (%d) in handle_um7LogVsdNetworkQoS\n",
450- reqinfo->mode);
451- return SNMP_ERR_GENERR;
452- }
453-
454- return SNMP_ERR_NOERROR;
455-}
456-
457-int
458-handle_um7LogVsdVirtualService(netsnmp_mib_handler *handler,
459-netsnmp_handler_registration *reginfo,
460-netsnmp_agent_request_info *reqinfo,
461-netsnmp_request_info *requests)
462-{
463- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
464-
465- switch (reqinfo->mode) {
466- case MODE_GET:
467- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
468- (u_char *) &log->virtualService,
469- sizeof(l7vs::LOG_LEVEL_TAG));
470- break;
471-
472- default:
473- snmp_log(LOG_ERR,
474- "unknown mode (%d) in handle_um7LogVsdVirtualService\n",
475- reqinfo->mode);
476- return SNMP_ERR_GENERR;
477- }
478-
479- return SNMP_ERR_NOERROR;
480-}
481-
482-int
483-handle_um7LogVsdRealServer(netsnmp_mib_handler *handler,
484-netsnmp_handler_registration *reginfo,
485-netsnmp_agent_request_info *reqinfo,
486-netsnmp_request_info *requests)
487-{
488- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
489-
490- switch (reqinfo->mode) {
491- case MODE_GET:
492- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
493- (u_char *) &log->realServer,
494- sizeof(l7vs::LOG_LEVEL_TAG));
495- break;
496-
497- default:
498- snmp_log(LOG_ERR,
499- "unknown mode (%d) in handle_um7LogVsdRealServer\n",
500- reqinfo->mode);
501- return SNMP_ERR_GENERR;
502- }
503-
504- return SNMP_ERR_NOERROR;
505-}
506-
507-int
508-handle_um7LogVsdRealServerBalancing(netsnmp_mib_handler *handler,
509-netsnmp_handler_registration *reginfo,
510-netsnmp_agent_request_info *reqinfo,
511-netsnmp_request_info *requests)
512-{
513- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
514-
515- switch (reqinfo->mode) {
516- case MODE_GET:
517- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
518- (u_char *) &log->realServerBalancing,
519- sizeof(l7vs::LOG_LEVEL_TAG));
520- break;
521-
522- default:
523- snmp_log(LOG_ERR,
524- "unknown mode (%d) in handle_um7LogVsdRealServerBalancing\n",
525- reqinfo->mode);
526- return SNMP_ERR_GENERR;
527- }
528-
529- return SNMP_ERR_NOERROR;
530-}
531-
532-int
533-handle_um7LogVsdSorryServer(netsnmp_mib_handler *handler,
534-netsnmp_handler_registration *reginfo,
535-netsnmp_agent_request_info *reqinfo,
536-netsnmp_request_info *requests)
537-{
538- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
539-
540- switch (reqinfo->mode) {
541- case MODE_GET:
542- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
543- (u_char *) &log->sorryServer,
544- sizeof(l7vs::LOG_LEVEL_TAG));
545- break;
546-
547- default:
548- snmp_log(LOG_ERR,
549- "unknown mode (%d) in handle_um7LogVsdSorryServer\n",
550- reqinfo->mode);
551- return SNMP_ERR_GENERR;
552- }
553-
554- return SNMP_ERR_NOERROR;
555-}
556-
557-int
558-handle_um7LogVsdReplication(netsnmp_mib_handler *handler,
559-netsnmp_handler_registration *reginfo,
560-netsnmp_agent_request_info *reqinfo,
561-netsnmp_request_info *requests)
562-{
563- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
564-
565- switch (reqinfo->mode) {
566- case MODE_GET:
567- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
568- (u_char *) &log->replication,
569- sizeof(l7vs::LOG_LEVEL_TAG));
570- break;
571-
572- default:
573- snmp_log(LOG_ERR,
574- "unknown mode (%d) in handle_um7LogVsdReplication\n",
575- reqinfo->mode);
576- return SNMP_ERR_GENERR;
577- }
578-
579- return SNMP_ERR_NOERROR;
580-}
581-
582-int
583-handle_um7LogVsdStartStop(netsnmp_mib_handler *handler,
584-netsnmp_handler_registration *reginfo,
585-netsnmp_agent_request_info *reqinfo,
586-netsnmp_request_info *requests)
587-{
588- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
589-
590- switch (reqinfo->mode) {
591- case MODE_GET:
592- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
593- (u_char *) &log->startStop,
594- sizeof(l7vs::LOG_LEVEL_TAG));
595- break;
596-
597- default:
598- snmp_log(LOG_ERR,
599- "unknown mode (%d) in handle_um7LogVsdStartStop\n",
600- reqinfo->mode);
601- return SNMP_ERR_GENERR;
602- }
603-
604- return SNMP_ERR_NOERROR;
605-}
606-
607-int
608-handle_um7LogVsdSystem(netsnmp_mib_handler *handler,
609-netsnmp_handler_registration *reginfo,
610-netsnmp_agent_request_info *reqinfo,
611-netsnmp_request_info *requests)
612-{
613- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
614-
615- switch (reqinfo->mode) {
616- case MODE_GET:
617- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
618- (u_char *) &log->system,
619- sizeof(l7vs::LOG_LEVEL_TAG));
620- break;
621-
622- default:
623- snmp_log(LOG_ERR, "unknown mode (%d) in handle_um7LogVsdSystem\n",
624- reqinfo->mode);
625- return SNMP_ERR_GENERR;
626- }
627-
628- return SNMP_ERR_NOERROR;
629-}
630-
631-int
632-handle_um7LogVsdSystemMemory(netsnmp_mib_handler *handler,
633-netsnmp_handler_registration *reginfo,
634-netsnmp_agent_request_info *reqinfo,
635-netsnmp_request_info *requests)
636-{
637- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
638-
639- switch (reqinfo->mode) {
640- case MODE_GET:
641- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
642- (u_char *) &log->systemMemory,
643- sizeof(l7vs::LOG_LEVEL_TAG));
644- break;
645-
646- default:
647- snmp_log(LOG_ERR,
648- "unknown mode (%d) in handle_um7LogVsdSystemMemory\n",
649- reqinfo->mode);
650- return SNMP_ERR_GENERR;
651- }
652-
653- return SNMP_ERR_NOERROR;
654-}
655-
656-int
657-handle_um7LogVsdSystemSocket(netsnmp_mib_handler *handler,
658-netsnmp_handler_registration *reginfo,
659-netsnmp_agent_request_info *reqinfo,
660-netsnmp_request_info *requests)
661-{
662- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
663-
664- switch (reqinfo->mode) {
665- case MODE_GET:
666- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
667- (u_char *) &log->systemSocket,
668- sizeof(l7vs::LOG_LEVEL_TAG));
669- break;
670-
671- default:
672- snmp_log(LOG_ERR,
673- "unknown mode (%d) in handle_um7LogVsdSystemSocket\n",
674- reqinfo->mode);
675- return SNMP_ERR_GENERR;
676- }
677-
678- return SNMP_ERR_NOERROR;
679-}
680-
681-int
682-handle_um7LogVsdSystemSignal(netsnmp_mib_handler *handler,
683-netsnmp_handler_registration *reginfo,
684-netsnmp_agent_request_info *reqinfo,
685-netsnmp_request_info *requests)
686-{
687- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
688-
689- switch (reqinfo->mode) {
690- case MODE_GET:
691- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
692- (u_char *) &log->systemSignal,
693- sizeof(l7vs::LOG_LEVEL_TAG));
694- break;
695-
696- default:
697- snmp_log(LOG_ERR,
698- "unknown mode (%d) in handle_um7LogVsdSystemSignal\n",
699- reqinfo->mode);
700- return SNMP_ERR_GENERR;
701- }
702-
703- return SNMP_ERR_NOERROR;
704-}
705-
706-int
707-handle_um7LogVsdEnvironment(netsnmp_mib_handler *handler,
708-netsnmp_handler_registration *reginfo,
709-netsnmp_agent_request_info *reqinfo,
710-netsnmp_request_info *requests)
711-{
712- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
713-
714- switch (reqinfo->mode) {
715- case MODE_GET:
716- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
717- (u_char *) &log->environment,
718- sizeof(l7vs::LOG_LEVEL_TAG));
719- break;
720-
721- default:
722- snmp_log(LOG_ERR,
723- "unknown mode (%d) in handle_um7LogVsdEnvironment\n",
724- reqinfo->mode);
725- return SNMP_ERR_GENERR;
726- }
727-
728- return SNMP_ERR_NOERROR;
729-}
730-
731-int
732-handle_um7LogVsdEnvironmentParameter(netsnmp_mib_handler *handler,
733-netsnmp_handler_registration *reginfo,
734-netsnmp_agent_request_info *reqinfo,
735-netsnmp_request_info *requests)
736-{
737- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
738-
739- switch (reqinfo->mode) {
740- case MODE_GET:
741- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
742- (u_char *) &log->environmentParameter,
743- sizeof(l7vs::LOG_LEVEL_TAG));
744- break;
745-
746- default:
747- snmp_log(LOG_ERR,
748- "unknown mode (%d) in handle_um7LogVsdEnvironmentParameter\n",
749- reqinfo->mode);
750- return SNMP_ERR_GENERR;
751- }
752-
753- return SNMP_ERR_NOERROR;
754-}
755-
756-int
757-handle_um7LogVsdLogger(netsnmp_mib_handler *handler,
758-netsnmp_handler_registration *reginfo,
759-netsnmp_agent_request_info *reqinfo,
760-netsnmp_request_info *requests)
761-{
762- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
763-
764- switch (reqinfo->mode) {
765- case MODE_GET:
766- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
767- (u_char *) &log->logger,
768- sizeof(l7vs::LOG_LEVEL_TAG));
769- break;
770-
771- default:
772- snmp_log(LOG_ERR, "unknown mode (%d) in handle_um7LogVsdLogger\n",
773- reqinfo->mode);
774- return SNMP_ERR_GENERR;
775- }
776-
777- return SNMP_ERR_NOERROR;
778-}
779-
780-int
781-handle_um7LogVsdParameter(netsnmp_mib_handler *handler,
782-netsnmp_handler_registration *reginfo,
783-netsnmp_agent_request_info *reqinfo,
784-netsnmp_request_info *requests)
785-{
786- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
787-
788- switch (reqinfo->mode) {
789- case MODE_GET:
790- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
791- (u_char *) &log->parameter,
792- sizeof(l7vs::LOG_LEVEL_TAG));
793- break;
794-
795- default:
796- snmp_log(LOG_ERR,
797- "unknown mode (%d) in handle_um7LogVsdParameter\n",
798- reqinfo->mode);
799- return SNMP_ERR_GENERR;
800- }
801-
802- return SNMP_ERR_NOERROR;
803-}
804-
805-int
806-handle_um7LogVsdEvent(netsnmp_mib_handler *handler,
807-netsnmp_handler_registration *reginfo,
808-netsnmp_agent_request_info *reqinfo,
809-netsnmp_request_info *requests)
810-{
811- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
812-
813- switch (reqinfo->mode) {
814- case MODE_GET:
815- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
816- (u_char *) &log->event,
817- sizeof(l7vs::LOG_LEVEL_TAG));
818- break;
819-
820- default:
821- snmp_log(LOG_ERR, "unknown mode (%d) in handle_um7LogVsdEvent\n",
822- reqinfo->mode);
823- return SNMP_ERR_GENERR;
824- }
825-
826- return SNMP_ERR_NOERROR;
827-}
828-
829-int
830-handle_um7LogVsdSchedule(netsnmp_mib_handler *handler,
831-netsnmp_handler_registration *reginfo,
832-netsnmp_agent_request_info *reqinfo,
833-netsnmp_request_info *requests)
834-{
835- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
836-
837- switch (reqinfo->mode) {
838- case MODE_GET:
839- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
840- (u_char *) &log->schedule,
841- sizeof(l7vs::LOG_LEVEL_TAG));
842- break;
843-
844- default:
845- snmp_log(LOG_ERR,
846- "unknown mode (%d) in handle_um7LogVsdSchedule\n",
847- reqinfo->mode);
848- return SNMP_ERR_GENERR;
849- }
850-
851- return SNMP_ERR_NOERROR;
852-}
853-
854-int
855-handle_um7LogVsdProgram(netsnmp_mib_handler *handler,
856-netsnmp_handler_registration *reginfo,
857-netsnmp_agent_request_info *reqinfo,
858-netsnmp_request_info *requests)
859-{
860- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
861-
862- switch (reqinfo->mode) {
863- case MODE_GET:
864- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
865- (u_char *) &log->program,
866- sizeof(l7vs::LOG_LEVEL_TAG));
867- break;
868-
869- default:
870- snmp_log(LOG_ERR, "unknown mode (%d) in handle_um7LogVsdProgram\n",
871- reqinfo->mode);
872- return SNMP_ERR_GENERR;
873- }
874-
875- return SNMP_ERR_NOERROR;
876-}
877-
878-int
879-handle_um7LogVsdProtocol(netsnmp_mib_handler *handler,
880-netsnmp_handler_registration *reginfo,
881-netsnmp_agent_request_info *reqinfo,
882-netsnmp_request_info *requests)
883-{
884- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
885-
886- switch (reqinfo->mode) {
887- case MODE_GET:
888- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
889- (u_char *) &log->protocol,
890- sizeof(l7vs::LOG_LEVEL_TAG));
891- break;
892-
893- default:
894- snmp_log(LOG_ERR,
895- "unknown mode (%d) in handle_um7LogVsdProtocol\n",
896- reqinfo->mode);
897- return SNMP_ERR_GENERR;
898- }
899-
900- return SNMP_ERR_NOERROR;
901-}
902-
903-int
904-handle_um7LogVsdModule(netsnmp_mib_handler *handler,
905-netsnmp_handler_registration *reginfo,
906-netsnmp_agent_request_info *reqinfo,
907-netsnmp_request_info *requests)
908-{
909- struct l7vsd_log_level *log = l7ag_store_mibdata::getInstance().getVsdLogmibdata();
910-
911- switch (reqinfo->mode) {
912- case MODE_GET:
913- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
914- (u_char *) &log->module,
915- sizeof(l7vs::LOG_LEVEL_TAG));
916- break;
917-
918- default:
919- snmp_log(LOG_ERR, "unknown mode (%d) in handle_um7LogVsdModule\n",
920- reqinfo->mode);
921- return SNMP_ERR_GENERR;
922- }
923-
924- return SNMP_ERR_NOERROR;
925-}
926-
927-int
928-handle_um7LogVsadmParse(netsnmp_mib_handler *handler,
929-netsnmp_handler_registration *reginfo,
930-netsnmp_agent_request_info *reqinfo,
931-netsnmp_request_info *requests)
932-{
933- struct l7vsadm_log_level *log = l7ag_store_mibdata::getInstance().getVsadmLogmibdata();
934-
935- switch (reqinfo->mode) {
936- case MODE_GET:
937- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
938- (u_char *) &log->parse,
939- sizeof(l7vs::LOG_LEVEL_TAG));
940- break;
941-
942- default:
943- snmp_log(LOG_ERR, "unknown mode (%d) in handle_um7LogVsadmParse\n",
944- reqinfo->mode);
945- return SNMP_ERR_GENERR;
946- }
947-
948- return SNMP_ERR_NOERROR;
949-}
950-
951-int
952-handle_um7LogVsadmOperate(netsnmp_mib_handler *handler,
953-netsnmp_handler_registration *reginfo,
954-netsnmp_agent_request_info *reqinfo,
955-netsnmp_request_info *requests)
956-{
957- struct l7vsadm_log_level *log = l7ag_store_mibdata::getInstance().getVsadmLogmibdata();
958-
959- switch (reqinfo->mode) {
960- case MODE_GET:
961- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
962- (u_char *) &log->operate,
963- sizeof(l7vs::LOG_LEVEL_TAG));
964- break;
965-
966- default:
967- snmp_log(LOG_ERR,
968- "unknown mode (%d) in handle_um7LogVsadmOperate\n",
969- reqinfo->mode);
970- return SNMP_ERR_GENERR;
971- }
972-
973- return SNMP_ERR_NOERROR;
974-}
975-
976-int
977-handle_um7LogVsadmCommunicate(netsnmp_mib_handler *handler,
978-netsnmp_handler_registration *reginfo,
979-netsnmp_agent_request_info *reqinfo,
980-netsnmp_request_info *requests)
981-{
982- struct l7vsadm_log_level *log = l7ag_store_mibdata::getInstance().getVsadmLogmibdata();
983-
984- switch (reqinfo->mode) {
985- case MODE_GET:
986- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
987- (u_char *) &log->communicate,
988- sizeof(l7vs::LOG_LEVEL_TAG));
989- break;
990-
991- default:
992- snmp_log(LOG_ERR,
993- "unknown mode (%d) in handle_um7LogVsadmCommunicate\n",
994- reqinfo->mode);
995- return SNMP_ERR_GENERR;
996- }
997-
998- return SNMP_ERR_NOERROR;
999-}
1000-
1001-int
1002-handle_um7LogVsadmConfigResult(netsnmp_mib_handler *handler,
1003-netsnmp_handler_registration *reginfo,
1004-netsnmp_agent_request_info *reqinfo,
1005-netsnmp_request_info *requests)
1006-{
1007- struct l7vsadm_log_level *log = l7ag_store_mibdata::getInstance().getVsadmLogmibdata();
1008-
1009- switch (reqinfo->mode) {
1010- case MODE_GET:
1011- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1012- (u_char *) &log->configResult,
1013- sizeof(l7vs::LOG_LEVEL_TAG));
1014- break;
1015-
1016- default:
1017- snmp_log(LOG_ERR,
1018- "unknown mode (%d) in handle_um7LogVsadmConfigResult\n",
1019- reqinfo->mode);
1020- return SNMP_ERR_GENERR;
1021- }
1022-
1023- return SNMP_ERR_NOERROR;
1024-}
1025-
1026-int
1027-handle_um7LogVsadmCommon(netsnmp_mib_handler *handler,
1028-netsnmp_handler_registration *reginfo,
1029-netsnmp_agent_request_info *reqinfo,
1030-netsnmp_request_info *requests)
1031-{
1032- struct l7vsadm_log_level *log = l7ag_store_mibdata::getInstance().getVsadmLogmibdata();
1033-
1034- switch (reqinfo->mode) {
1035- case MODE_GET:
1036- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1037- (u_char *) &log->common,
1038- sizeof(l7vs::LOG_LEVEL_TAG));
1039- break;
1040-
1041- default:
1042- snmp_log(LOG_ERR,
1043- "unknown mode (%d) in handle_um7LogVsadmCommon\n",
1044- reqinfo->mode);
1045- return SNMP_ERR_GENERR;
1046- }
1047-
1048- return SNMP_ERR_NOERROR;
1049-}
1050-
1051-int
1052-handle_um7LogVsadmLogger(netsnmp_mib_handler *handler,
1053-netsnmp_handler_registration *reginfo,
1054-netsnmp_agent_request_info *reqinfo,
1055-netsnmp_request_info *requests)
1056-{
1057- struct l7vsadm_log_level *log = l7ag_store_mibdata::getInstance().getVsadmLogmibdata();
1058-
1059- switch (reqinfo->mode) {
1060- case MODE_GET:
1061- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1062- (u_char *) &log->logger,
1063- sizeof(l7vs::LOG_LEVEL_TAG));
1064- break;
1065-
1066- default:
1067- snmp_log(LOG_ERR,
1068- "unknown mode (%d) in handle_um7LogVsadmLogger\n",
1069- reqinfo->mode);
1070- return SNMP_ERR_GENERR;
1071- }
1072-
1073- return SNMP_ERR_NOERROR;
1074-}
1075-
1076-int
1077-handle_um7LogVsadmParameter(netsnmp_mib_handler *handler,
1078-netsnmp_handler_registration *reginfo,
1079-netsnmp_agent_request_info *reqinfo,
1080-netsnmp_request_info *requests)
1081-{
1082- struct l7vsadm_log_level *log = l7ag_store_mibdata::getInstance().getVsadmLogmibdata();
1083-
1084- switch (reqinfo->mode) {
1085- case MODE_GET:
1086- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1087- (u_char *) &log->parameter,
1088- sizeof(l7vs::LOG_LEVEL_TAG));
1089- break;
1090-
1091- default:
1092- snmp_log(LOG_ERR,
1093- "unknown mode (%d) in handle_um7LogVsadmParameter\n",
1094- reqinfo->mode);
1095- return SNMP_ERR_GENERR;
1096- }
1097-
1098- return SNMP_ERR_NOERROR;
1099-}
1100-
1101-int
1102-handle_um7LogVsadmProtocol(netsnmp_mib_handler *handler,
1103-netsnmp_handler_registration *reginfo,
1104-netsnmp_agent_request_info *reqinfo,
1105-netsnmp_request_info *requests)
1106-{
1107- struct l7vsadm_log_level *log = l7ag_store_mibdata::getInstance().getVsadmLogmibdata();
1108-
1109- switch (reqinfo->mode) {
1110- case MODE_GET:
1111- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1112- (u_char *) &log->protocol,
1113- sizeof(l7vs::LOG_LEVEL_TAG));
1114- break;
1115-
1116- default:
1117- snmp_log(LOG_ERR,
1118- "unknown mode (%d) in handle_um7LogVsadmProtocol\n",
1119- reqinfo->mode);
1120- return SNMP_ERR_GENERR;
1121- }
1122-
1123- return SNMP_ERR_NOERROR;
1124-}
1125-
1126-int
1127-handle_um7LogVsadmModule(netsnmp_mib_handler *handler,
1128-netsnmp_handler_registration *reginfo,
1129-netsnmp_agent_request_info *reqinfo,
1130-netsnmp_request_info *requests)
1131-{
1132- struct l7vsadm_log_level *log = l7ag_store_mibdata::getInstance().getVsadmLogmibdata();
1133-
1134- switch (reqinfo->mode) {
1135- case MODE_GET:
1136- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1137- (u_char *) &log->module,
1138- sizeof(l7vs::LOG_LEVEL_TAG));
1139- break;
1140-
1141- default:
1142- snmp_log(LOG_ERR,
1143- "unknown mode (%d) in handle_um7LogVsadmModule\n",
1144- reqinfo->mode);
1145- return SNMP_ERR_GENERR;
1146- }
1147-
1148- return SNMP_ERR_NOERROR;
1149-}
1150-
1151-int
1152-handle_um7LogSnmpStartStop(netsnmp_mib_handler *handler,
1153-netsnmp_handler_registration *reginfo,
1154-netsnmp_agent_request_info *reqinfo,
1155-netsnmp_request_info *requests)
1156-{
1157- struct l7snmpagent_log_level *log = l7ag_store_mibdata::getInstance().getAgentLogmibdata();
1158-
1159- switch (reqinfo->mode) {
1160- case MODE_GET:
1161- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1162- (u_char *) &log->startStop,
1163- sizeof(l7vs::LOG_LEVEL_TAG));
1164- break;
1165-
1166- default:
1167- snmp_log(LOG_ERR,
1168- "unknown mode (%d) in handle_um7LogSnmpStartStop\n",
1169- reqinfo->mode);
1170- return SNMP_ERR_GENERR;
1171- }
1172-
1173- return SNMP_ERR_NOERROR;
1174-}
1175-
1176-int
1177-handle_um7LogSnmpManagerReceive(netsnmp_mib_handler *handler,
1178-netsnmp_handler_registration *reginfo,
1179-netsnmp_agent_request_info *reqinfo,
1180-netsnmp_request_info *requests)
1181-{
1182- struct l7snmpagent_log_level *log = l7ag_store_mibdata::getInstance().getAgentLogmibdata();
1183-
1184- switch (reqinfo->mode) {
1185- case MODE_GET:
1186- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1187- (u_char *) &log->managerReceive,
1188- sizeof(l7vs::LOG_LEVEL_TAG));
1189- break;
1190-
1191- default:
1192- snmp_log(LOG_ERR,
1193- "unknown mode (%d) in handle_um7LogSnmpManagerReceive\n",
1194- reqinfo->mode);
1195- return SNMP_ERR_GENERR;
1196- }
1197-
1198- return SNMP_ERR_NOERROR;
1199-}
1200-
1201-int
1202-handle_um7LogSnmpManagerSend(netsnmp_mib_handler *handler,
1203-netsnmp_handler_registration *reginfo,
1204-netsnmp_agent_request_info *reqinfo,
1205-netsnmp_request_info *requests)
1206-{
1207- struct l7snmpagent_log_level *log = l7ag_store_mibdata::getInstance().getAgentLogmibdata();
1208-
1209- switch (reqinfo->mode) {
1210- case MODE_GET:
1211- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1212- (u_char *) &log->managerSend,
1213- sizeof(l7vs::LOG_LEVEL_TAG));
1214- break;
1215-
1216- default:
1217- snmp_log(LOG_ERR,
1218- "unknown mode (%d) in handle_um7LogSnmpManagerSend\n",
1219- reqinfo->mode);
1220- return SNMP_ERR_GENERR;
1221- }
1222-
1223- return SNMP_ERR_NOERROR;
1224-}
1225-
1226-int
1227-handle_um7LogSnmpL7vsdReceive(netsnmp_mib_handler *handler,
1228-netsnmp_handler_registration *reginfo,
1229-netsnmp_agent_request_info *reqinfo,
1230-netsnmp_request_info *requests)
1231-{
1232- struct l7snmpagent_log_level *log = l7ag_store_mibdata::getInstance().getAgentLogmibdata();
1233-
1234- switch (reqinfo->mode) {
1235- case MODE_GET:
1236- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1237- (u_char *) &log->l7vsdReceive,
1238- sizeof(l7vs::LOG_LEVEL_TAG));
1239- break;
1240-
1241- default:
1242- snmp_log(LOG_ERR,
1243- "unknown mode (%d) in handle_um7LogSnmpL7vsdReceive\n",
1244- reqinfo->mode);
1245- return SNMP_ERR_GENERR;
1246- }
1247-
1248- return SNMP_ERR_NOERROR;
1249-}
1250-
1251-int
1252-handle_um7LogSnmpL7vsdSend(netsnmp_mib_handler *handler,
1253-netsnmp_handler_registration *reginfo,
1254-netsnmp_agent_request_info *reqinfo,
1255-netsnmp_request_info *requests)
1256-{
1257- struct l7snmpagent_log_level *log = l7ag_store_mibdata::getInstance().getAgentLogmibdata();
1258-
1259- switch (reqinfo->mode) {
1260- case MODE_GET:
1261- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1262- (u_char *) &log->l7vsdSend,
1263- sizeof(l7vs::LOG_LEVEL_TAG));
1264- break;
1265-
1266- default:
1267- snmp_log(LOG_ERR,
1268- "unknown mode (%d) in handle_um7LogSnmpL7vsdSend\n",
1269- reqinfo->mode);
1270- return SNMP_ERR_GENERR;
1271- }
1272-
1273- return SNMP_ERR_NOERROR;
1274-}
1275-
1276-int
1277-handle_um7LogSnmpLogger(netsnmp_mib_handler *handler,
1278-netsnmp_handler_registration *reginfo,
1279-netsnmp_agent_request_info *reqinfo,
1280-netsnmp_request_info *requests)
1281-{
1282- struct l7snmpagent_log_level *log = l7ag_store_mibdata::getInstance().getAgentLogmibdata();
1283-
1284- switch (reqinfo->mode) {
1285- case MODE_GET:
1286- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1287- (u_char *) &log->logger,
1288- sizeof(l7vs::LOG_LEVEL_TAG));
1289- break;
1290-
1291- default:
1292- snmp_log(LOG_ERR, "unknown mode (%d) in handle_um7LogSnmpLogger\n",
1293- reqinfo->mode);
1294- return SNMP_ERR_GENERR;
1295- }
1296-
1297- return SNMP_ERR_NOERROR;
1298-}
1299-
1300-int
1301-handle_um7LogSnmpParameter(netsnmp_mib_handler *handler,
1302-netsnmp_handler_registration *reginfo,
1303-netsnmp_agent_request_info *reqinfo,
1304-netsnmp_request_info *requests)
1305-{
1306- struct l7snmpagent_log_level *log = l7ag_store_mibdata::getInstance().getAgentLogmibdata();
1307-
1308- switch (reqinfo->mode) {
1309- case MODE_GET:
1310- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1311- (u_char *) &log->parameter,
1312- sizeof(l7vs::LOG_LEVEL_TAG));
1313- break;
1314-
1315- default:
1316- snmp_log(LOG_ERR,
1317- "unknown mode (%d) in handle_um7LogSnmpParameter\n",
1318- reqinfo->mode);
1319- return SNMP_ERR_GENERR;
1320- }
1321-
1322- return SNMP_ERR_NOERROR;
1323-}
1324-
1325-int
1326-handle_um7StatMessage(netsnmp_mib_handler *handler,
1327-netsnmp_handler_registration *reginfo,
1328-netsnmp_agent_request_info *reqinfo,
1329-netsnmp_request_info *requests)
1330-{
1331- struct l7_status *stat = l7ag_store_mibdata::getInstance().getStatmibdata();
1332-
1333- switch (reqinfo->mode) {
1334- case MODE_GET:
1335- snmp_set_var_typed_value(requests->requestvb, ASN_OCTET_STR,
1336- (u_char *) &stat->message,
1337- strnlen(stat->message, DISPLAYSTRING_LEN));
1338- break;
1339-
1340- default:
1341- snmp_log(LOG_ERR, "unknown mode (%d) in handle_um7StatMessage\n",
1342- reqinfo->mode);
1343- return SNMP_ERR_GENERR;
1344- }
1345-
1346- return SNMP_ERR_NOERROR;
1347-}
1348-
1349-int
1350-handle_um7StatReplication(netsnmp_mib_handler *handler,
1351-netsnmp_handler_registration *reginfo,
1352-netsnmp_agent_request_info *reqinfo,
1353-netsnmp_request_info *requests)
1354-{
1355-// struct l7_status* stat = l7ag_store_mibdata::getInstance().getStatmibdata();
1356-
1357- switch (reqinfo->mode) {
1358- case MODE_GET:
1359- /* snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1360- (u_char *) &stat->replication,
1361- sizeof(REPLICATION_MODE_TAG) );*/
1362- break;
1363-
1364- default:
1365- snmp_log(LOG_ERR,
1366- "unknown mode (%d) in handle_um7StatReplication\n",
1367- reqinfo->mode);
1368- return SNMP_ERR_GENERR;
1369- }
1370-
1371- return SNMP_ERR_NOERROR;
1372-}
1373-
1374-int
1375-handle_um7StatSnmpAgent(netsnmp_mib_handler *handler,
1376-netsnmp_handler_registration *reginfo,
1377-netsnmp_agent_request_info *reqinfo,
1378-netsnmp_request_info *requests)
1379-{
1380- struct l7_status *stat = l7ag_store_mibdata::getInstance().getStatmibdata();
1381-
1382- switch (reqinfo->mode) {
1383- case MODE_GET:
1384- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
1385- (u_char *) &stat->snmpAgent,
1386- sizeof(IPC_STATUS_TAG));
1387- break;
1388-
1389- default:
1390- snmp_log(LOG_ERR, "unknown mode (%d) in handle_um7StatSnmpAgent\n",
1391- reqinfo->mode);
1392- return SNMP_ERR_GENERR;
1393- }
1394-
1395- return SNMP_ERR_NOERROR;
1396-}
1397-
1398-/** Initialize the um7VirtualServiceTable table by defining its contents and how it's structured */
1399-void
1400-initialize_table_um7VirtualServiceTable()
1401-{
1402- static oid um7VirtualServiceTable_oid[] =
1403- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 1 };
1404- size_t um7VirtualServiceTable_oid_len =
1405- OID_LENGTH(um7VirtualServiceTable_oid);
1406-
1407- /*
1408- * create the table structure itself
1409- */
1410- vs_table_set = netsnmp_create_table_data_set("um7VirtualServiceTable");
1411- l7ag_store_mibdata::getInstance().setVsTableSet(vs_table_set);
1412-
1413- /*
1414- * comment this out or delete if you don't support creation of new rows
1415- */
1416-// vs_table_set->allow_creation = 1;
1417-
1418- /***************************************************
1419- * Adding indexes
1420- */
1421- DEBUGMSGTL(("initialize_table_um7VirtualServiceTable",
1422- "adding indexes to table um7VirtualServiceTable\n"));
1423- netsnmp_table_set_add_indexes(vs_table_set, ASN_INTEGER, /* index: um7VSIndex */
1424- 0);
1425-
1426- DEBUGMSGTL(("initialize_table_um7VirtualServiceTable",
1427- "adding column types to table um7VirtualServiceTable\n"));
1428- netsnmp_table_set_multi_add_default_row(vs_table_set,
1429- COLUMN_UM7VSINDEX, ASN_INTEGER,
1430- 0, NULL, 0,
1431- COLUMN_UM7VSPROTOCOL,
1432- ASN_INTEGER, 0, NULL, 0,
1433- COLUMN_UM7VSIPADDRESS,
1434- ASN_OCTET_STR, 0, NULL, 0,
1435- COLUMN_UM7VSPORTNUMBER,
1436- ASN_UNSIGNED, 0, NULL, 0,
1437- COLUMN_UM7VSSCHEDULEMODULE,
1438- ASN_OCTET_STR, 0, NULL, 0,
1439- COLUMN_UM7VSPROTOCOLMODULE,
1440- ASN_OCTET_STR, 0, NULL, 0,
1441- COLUMN_UM7VSPROTOCOLMODULEOPTION,
1442- ASN_OCTET_STR, 0, NULL, 0,
1443- COLUMN_UM7VSRESCHEDULE,
1444- ASN_INTEGER, 0, NULL, 0,
1445- COLUMN_UM7VSSORRYIPADDRESS,
1446- ASN_OCTET_STR, 0, NULL, 0,
1447- COLUMN_UM7VSSORRYPORTNUMBER,
1448- ASN_UNSIGNED, 0, NULL, 0,
1449- COLUMN_UM7VSSORRYTHRESHOLD,
1450- ASN_INTEGER, 0, NULL, 0,
1451- COLUMN_UM7VSSORRYFORCEFLAG,
1452- ASN_INTEGER, 0, NULL, 0,
1453- COLUMN_UM7VSQOSTHRESHOLDUP,
1454- ASN_INTEGER, 0, NULL, 0,
1455- COLUMN_UM7VSQOSTHRESHOLDDOWN,
1456- ASN_INTEGER, 0, NULL, 0,
1457- COLUMN_UM7VSTHROUGHPUTUP,
1458- ASN_INTEGER, 0, NULL, 0,
1459- COLUMN_UM7VSTHROUGHPUTDOWN,
1460- ASN_INTEGER, 0, NULL, 0, 0);
1461-
1462- /*
1463- * registering the table with the master agent
1464- */
1465- /*
1466- * note: if you don't need a subhandler to deal with any aspects
1467- * of the request, change um7VirtualServiceTable_handler to "NULL"
1468- */
1469- netsnmp_register_table_data_set(netsnmp_create_handler_registration
1470- ("um7VirtualServiceTable",
1471- um7VirtualServiceTable_handler,
1472- um7VirtualServiceTable_oid,
1473- um7VirtualServiceTable_oid_len,
1474- HANDLER_CAN_RWRITE), vs_table_set, NULL);
1475-}
1476-
1477-/** Initialize the um7RealServerTable table by defining its contents and how it's structured */
1478-void
1479-initialize_table_um7RealServerTable()
1480-{
1481- static oid um7RealServerTable_oid[] =
1482- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 2 };
1483- size_t um7RealServerTable_oid_len =
1484- OID_LENGTH(um7RealServerTable_oid);
1485-
1486- /*
1487- * create the table structure itself
1488- */
1489- rs_table_set = netsnmp_create_table_data_set("um7RealServerTable");
1490- l7ag_store_mibdata::getInstance().setRsTableSet(rs_table_set);
1491-
1492- /*
1493- * comment this out or delete if you don't support creation of new rows
1494- */
1495-// rs_table_set->allow_creation = 1;
1496-
1497- /***************************************************
1498- * Adding indexes
1499- */
1500- DEBUGMSGTL(("initialize_table_um7RealServerTable",
1501- "adding indexes to table um7RealServerTable\n"));
1502- netsnmp_table_set_add_indexes(rs_table_set, ASN_INTEGER, /* index: um7RSIndex */
1503- 0);
1504-
1505- DEBUGMSGTL(("initialize_table_um7RealServerTable",
1506- "adding column types to table um7RealServerTable\n"));
1507- netsnmp_table_set_multi_add_default_row(rs_table_set,
1508- COLUMN_UM7RSINDEX, ASN_INTEGER,
1509- 0, NULL, 0,
1510- COLUMN_UM7RSVIRTUALSERVICEINDEX,
1511- ASN_INTEGER, 0, NULL, 0,
1512- COLUMN_UM7RSIPADDRESS,
1513- ASN_OCTET_STR, 0, NULL, 0,
1514- COLUMN_UM7RSPORTNUMBER,
1515- ASN_UNSIGNED, 0, NULL, 0,
1516- COLUMN_UM7RSFORWARDMODE,
1517- ASN_INTEGER, 0, NULL, 0,
1518- COLUMN_UM7RSWEIGHT,
1519- ASN_INTEGER, 0, NULL, 0,
1520- COLUMN_UM7RSACTIVECONN,
1521- ASN_INTEGER, 0, NULL, 0,
1522- COLUMN_UM7RSINACTIVECONN,
1523- ASN_INTEGER, 0, NULL, 0, 0);
1524-
1525- /*
1526- * registering the table with the master agent
1527- */
1528- /*
1529- * note: if you don't need a subhandler to deal with any aspects
1530- * of the request, change um7RealServerTable_handler to "NULL"
1531- */
1532- netsnmp_register_table_data_set(netsnmp_create_handler_registration
1533- ("um7RealServerTable",
1534- um7RealServerTable_handler,
1535- um7RealServerTable_oid,
1536- um7RealServerTable_oid_len,
1537- HANDLER_CAN_RWRITE), rs_table_set, NULL);
1538-}
1539-
1540-/** handles requests for the um7VirtualServiceTable table, if anything else needs to be done */
1541-int
1542-um7VirtualServiceTable_handler(netsnmp_mib_handler *handler,
1543-netsnmp_handler_registration *reginfo,
1544-netsnmp_agent_request_info *reqinfo,
1545-netsnmp_request_info *requests)
1546-{
1547- /*
1548- * perform anything here that you need to do. The requests have
1549- * already been processed by the master table_dataset handler, but
1550- * this gives you chance to act on the request in some other way
1551- * if need be.
1552- */
1553- return SNMP_ERR_NOERROR;
1554-}
1555-
1556-/** handles requests for the um7RealServerTable table, if anything else needs to be done */
1557-int
1558-um7RealServerTable_handler(netsnmp_mib_handler *handler,
1559-netsnmp_handler_registration *reginfo,
1560-netsnmp_agent_request_info *reqinfo,
1561-netsnmp_request_info *requests)
1562-{
1563- /*
1564- * perform anything here that you need to do. The requests have
1565- * already been processed by the master table_dataset handler, but
1566- * this gives you chance to act on the request in some other way
1567- * if need be.
1568- */
1569- return SNMP_ERR_NOERROR;
1570-}
1571-
1572-int
1573-send_um7StateAlert_trap()
1574-{
1575- netsnmp_variable_list *var_list = NULL;
1576- oid um7StateAlert_oid[] =
1577- { 1, 3, 6, 1, 4, 1, 60000, 0, 1 };
1578- /* oid um7StatReplication_oid[] =
1579- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 4, 2, 0 };*/
1580- oid um7StatSnmpAgent_oid[] =
1581- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 4, 3, 0 };
1582-
1583- /*
1584- * Set the snmpTrapOid.0 value
1585- */
1586- snmp_varlist_add_variable(&var_list,
1587- snmptrap_oid, OID_LENGTH(snmptrap_oid),
1588- ASN_OBJECT_ID,
1589- (u_char *) um7StateAlert_oid,
1590- sizeof(um7StateAlert_oid));
1591-
1592- struct l7_status *stat = l7ag_store_mibdata::getInstance().getStatmibdata();
1593- /* snmp_varlist_add_variable(&var_list,
1594- um7StatReplication_oid,
1595- OID_LENGTH(um7StatReplication_oid),
1596- ASN_INTEGER, (u_char*) &stat->replication,
1597- sizeof(REPLICATION_MODE_TAG));*/
1598- snmp_varlist_add_variable(&var_list,
1599- um7StatSnmpAgent_oid,
1600- OID_LENGTH(um7StatSnmpAgent_oid),
1601- ASN_INTEGER, (u_char *) &stat->snmpAgent,
1602- sizeof(IPC_STATUS_TAG));
1603-
1604- /*
1605- * Add any extra (optional) objects here
1606- */
1607-
1608- /*
1609- * Send the trap to the list of configured destinations
1610- * and clean up
1611- */
1612- send_v2trap(var_list);
1613- snmp_free_varbind(var_list);
1614-
1615- return SNMP_ERR_NOERROR;
1616-}
1617-
1618-int
1619-send_um7VirtualServiceAlert_trap()
1620-{
1621- netsnmp_variable_list *var_list = NULL;
1622- oid um7VirtualServiceAlert_oid[] =
1623- { 1, 3, 6, 1, 4, 1, 60000, 0, 2 };
1624-// oid um7VirtualServiceTable_oid[] =
1625-// { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 1, 0 };
1626-// oid um7RealServerTable_oid[] =
1627-// { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 2, 0 };
1628-
1629- /*
1630- * Set the snmpTrapOid.0 value
1631- */
1632- snmp_varlist_add_variable(&var_list,
1633- snmptrap_oid, OID_LENGTH(snmptrap_oid),
1634- ASN_OBJECT_ID,
1635- (u_char *) um7VirtualServiceAlert_oid,
1636- sizeof(um7VirtualServiceAlert_oid));
1637-
1638- /*
1639- * Add any objects from the trap definition
1640- */
1641- /*
1642- snmp_varlist_add_variable(&var_list,
1643- um7VirtualServiceTable_oid,
1644- OID_LENGTH(um7VirtualServiceTable_oid),,
1645- // Set an appropriate value for um7VirtualServiceTable
1646- NULL, 0);
1647- snmp_varlist_add_variable(&var_list,
1648- um7RealServerTable_oid,
1649- OID_LENGTH(um7RealServerTable_oid),,
1650- // Set an appropriate value for um7RealServerTable
1651- NULL, 0);
1652- */
1653-
1654- /*
1655- * Add any extra (optional) objects here
1656- */
1657-
1658- /*
1659- * Send the trap to the list of configured destinations
1660- * and clean up
1661- */
1662- send_v2trap(var_list);
1663- snmp_free_varbind(var_list);
1664-
1665- return SNMP_ERR_NOERROR;
1666-}
1667-
1668-int
1669-send_um7ReplicationAlert_trap()
1670-{
1671- netsnmp_variable_list *var_list = NULL;
1672- oid um7ReplicationAlert_oid[] =
1673- { 1, 3, 6, 1, 4, 1, 60000, 0, 3 };
1674- oid um7StatMessage_oid[] =
1675- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 4, 1, 0 };
1676-
1677- /*
1678- * Set the snmpTrapOid.0 value
1679- */
1680- snmp_varlist_add_variable(&var_list,
1681- snmptrap_oid, OID_LENGTH(snmptrap_oid),
1682- ASN_OBJECT_ID,
1683- (u_char *) um7ReplicationAlert_oid,
1684- sizeof(um7ReplicationAlert_oid));
1685-
1686- struct l7_status *stat = l7ag_store_mibdata::getInstance().getStatmibdata();
1687- snmp_varlist_add_variable(&var_list,
1688- um7StatMessage_oid,
1689- OID_LENGTH(um7StatMessage_oid),
1690- ASN_OCTET_STR,
1691- (u_char *) &stat->message,
1692- strnlen(stat->message, DISPLAYSTRING_LEN));
1693-
1694- /*
1695- * Add any extra (optional) objects here
1696- */
1697-
1698- /*
1699- * Send the trap to the list of configured destinations
1700- * and clean up
1701- */
1702- send_v2trap(var_list);
1703- snmp_free_varbind(var_list);
1704-
1705- return SNMP_ERR_NOERROR;
1706-}
1707-
1708-int
1709-send_um7LogLevelAlert_trap()
1710-{
1711- netsnmp_variable_list *var_list = NULL;
1712- oid um7LogLevelAlert_oid[] =
1713- { 1, 3, 6, 1, 4, 1, 60000, 0, 4 };
1714-// oid um7LogLevel_oid[] =
1715-// { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3, /* insert index here */ };
1716-
1717- /*
1718- * Set the snmpTrapOid.0 value
1719- */
1720- snmp_varlist_add_variable(&var_list,
1721- snmptrap_oid, OID_LENGTH(snmptrap_oid),
1722- ASN_OBJECT_ID,
1723- (u_char *) um7LogLevelAlert_oid,
1724- sizeof(um7LogLevelAlert_oid));
1725-
1726- /*
1727- * Add any objects from the trap definition
1728- */
1729- /*
1730- snmp_varlist_add_variable(&var_list,
1731- um7LogLevel_oid,
1732- OID_LENGTH(um7LogLevel_oid),,
1733- // Set an appropriate value for um7LogLevel
1734- NULL, 0);
1735- */
1736-
1737- /*
1738- * Add any extra (optional) objects here
1739- */
1740-
1741- /*
1742- * Send the trap to the list of configured destinations
1743- * and clean up
1744- */
1745- send_v2trap(var_list);
1746- snmp_free_varbind(var_list);
1747-
1748- return SNMP_ERR_NOERROR;
1749-}
1750-
1751-int
1752-send_um7QoSAlarmOn_trap(size_t index)
1753-{
1754- netsnmp_variable_list *var_list = NULL;
1755- oid um7QoSAlarmOn_oid[] =
1756- { 1, 3, 6, 1, 4, 1, 60000, 0, 5 };
1757- oid um7VSQoSThresholdUp_oid[] =
1758- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 1, 1, 13, index };
1759- oid um7VSQoSThresholdDown_oid[] =
1760- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 1, 1, 14, index };
1761- oid um7VSThroughputUp_oid[] =
1762- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 1, 1, 15, index };
1763- oid um7VSThroughputDown_oid[] =
1764- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 1, 1, 16, index };
1765-
1766- /*
1767- * Set the snmpTrapOid.0 value
1768- */
1769- snmp_varlist_add_variable(&var_list,
1770- snmptrap_oid, OID_LENGTH(snmptrap_oid),
1771- ASN_OBJECT_ID,
1772- (u_char *) um7QoSAlarmOn_oid,
1773- sizeof(um7QoSAlarmOn_oid));
1774-
1775- vsdata *vs = l7ag_store_mibdata::getInstance().getVSmibdata(index);
1776- if (vs) {
1777- snmp_varlist_add_variable(&var_list,
1778- um7VSQoSThresholdUp_oid,
1779- OID_LENGTH(um7VSQoSThresholdUp_oid),
1780- ASN_INTEGER,
1781- (u_char *) &vs->QoSThresholdUp,
1782- sizeof(unsigned long long));
1783- snmp_varlist_add_variable(&var_list,
1784- um7VSQoSThresholdDown_oid,
1785- OID_LENGTH(um7VSQoSThresholdDown_oid),
1786- ASN_INTEGER,
1787- (u_char *) &vs->QoSThresholdDown,
1788- sizeof(unsigned long long));
1789- snmp_varlist_add_variable(&var_list,
1790- um7VSThroughputUp_oid,
1791- OID_LENGTH(um7VSThroughputUp_oid),
1792- ASN_INTEGER,
1793- (u_char *) &vs->throughputUp,
1794- sizeof(unsigned long long));
1795- snmp_varlist_add_variable(&var_list,
1796- um7VSThroughputDown_oid,
1797- OID_LENGTH(um7VSThroughputDown_oid),
1798- ASN_INTEGER,
1799- (u_char *) &vs->throughputDown,
1800- sizeof(unsigned long long));
1801- }
1802-
1803- /*
1804- * Add any extra (optional) objects here
1805- */
1806-
1807- /*
1808- * Send the trap to the list of configured destinations
1809- * and clean up
1810- */
1811- send_v2trap(var_list);
1812- snmp_free_varbind(var_list);
1813-
1814- return SNMP_ERR_NOERROR;
1815-}
1816-
1817-int
1818-send_um7QoSAlarmOff_trap(size_t index)
1819-{
1820- netsnmp_variable_list *var_list = NULL;
1821- oid um7QoSAlarmOff_oid[] =
1822- { 1, 3, 6, 1, 4, 1, 60000, 0, 6 };
1823- oid um7VSQoSThresholdUp_oid[] =
1824- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 1, 1, 13, index };
1825- oid um7VSQoSThresholdDown_oid[] =
1826- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 1, 1, 14, index };
1827- oid um7VSThroughputUp_oid[] =
1828- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 1, 1, 15, index };
1829- oid um7VSThroughputDown_oid[] =
1830- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 1, 1, 16, index };
1831-
1832- /*
1833- * Set the snmpTrapOid.0 value
1834- */
1835- snmp_varlist_add_variable(&var_list,
1836- snmptrap_oid, OID_LENGTH(snmptrap_oid),
1837- ASN_OBJECT_ID,
1838- (u_char *) um7QoSAlarmOff_oid,
1839- sizeof(um7QoSAlarmOff_oid));
1840-
1841- vsdata *vs = l7ag_store_mibdata::getInstance().getVSmibdata(index);
1842- if (vs) {
1843- snmp_varlist_add_variable(&var_list,
1844- um7VSQoSThresholdUp_oid,
1845- OID_LENGTH(um7VSQoSThresholdUp_oid),
1846- ASN_INTEGER,
1847- (u_char *) &vs->QoSThresholdUp,
1848- sizeof(unsigned long long));
1849- snmp_varlist_add_variable(&var_list,
1850- um7VSQoSThresholdDown_oid,
1851- OID_LENGTH(um7VSQoSThresholdDown_oid),
1852- ASN_INTEGER,
1853- (u_char *) &vs->QoSThresholdDown,
1854- sizeof(unsigned long long));
1855- snmp_varlist_add_variable(&var_list,
1856- um7VSThroughputUp_oid,
1857- OID_LENGTH(um7VSThroughputUp_oid),
1858- ASN_INTEGER,
1859- (u_char *) &vs->throughputUp,
1860- sizeof(unsigned long long));
1861- snmp_varlist_add_variable(&var_list,
1862- um7VSThroughputDown_oid,
1863- OID_LENGTH(um7VSThroughputDown_oid),
1864- ASN_INTEGER,
1865- (u_char *) &vs->throughputDown,
1866- sizeof(unsigned long long));
1867- }
1868-
1869- /*
1870- * Add any extra (optional) objects here
1871- */
1872-
1873- /*
1874- * Send the trap to the list of configured destinations
1875- * and clean up
1876- */
1877- send_v2trap(var_list);
1878- snmp_free_varbind(var_list);
1879-
1880- return SNMP_ERR_NOERROR;
1881-}
1882-
1883-int
1884-send_um7MessageAlert_trap()
1885-{
1886- netsnmp_variable_list *var_list = NULL;
1887- oid um7MessageAlert_oid[] =
1888- { 1, 3, 6, 1, 4, 1, 60000, 0, 7 };
1889- oid um7StatMessage_oid[] =
1890- { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 4, 1, 0 };
1891-
1892- /*
1893- * Set the snmpTrapOid.0 value
1894- */
1895- snmp_varlist_add_variable(&var_list,
1896- snmptrap_oid, OID_LENGTH(snmptrap_oid),
1897- ASN_OBJECT_ID,
1898- (u_char *) um7MessageAlert_oid,
1899- sizeof(um7MessageAlert_oid));
1900-
1901- struct l7_status *stat = l7ag_store_mibdata::getInstance().getStatmibdata();
1902- snmp_varlist_add_variable(&var_list,
1903- um7StatMessage_oid,
1904- OID_LENGTH(um7StatMessage_oid),
1905- ASN_OCTET_STR,
1906- (u_char *) &stat->message,
1907- strnlen(stat->message, DISPLAYSTRING_LEN));
1908-
1909- /*
1910- * Add any extra (optional) objects here
1911- */
1912-
1913- /*
1914- * Send the trap to the list of configured destinations
1915- * and clean up
1916- */
1917- send_v2trap(var_list);
1918- snmp_free_varbind(var_list);
1919-
1920- return SNMP_ERR_NOERROR;
1921-}
1922-
1923-// get all mib data from l7vsd
1924-// called every REPEAT_SEC sec.
1925-void
1926-getL7vsdData(unsigned int clientreg, void *clientarg)
1927-{
1928- if (!clientarg) return;
1929- MessengerClient *message = (MessengerClient *) clientarg;
1930-
1931- long long buf_size = sizeof(struct l7ag_message_header)
1932- + sizeof(struct l7ag_payload_header)
1933- + sizeof(struct l7ag_mibrequest_message);
1934- char *sendbuf = (char *) calloc(1, buf_size);
1935-
1936- struct l7ag_message_header *msg_head = (struct l7ag_message_header *) sendbuf;
1937- msg_head->magic[0] = 0x4d; // M
1938- msg_head->magic[1] = 0x47; // G
1939- msg_head->version = 1;
1940- msg_head->size = buf_size;
1941- msg_head->payload_count = 1;
1942-// TODO set time msg_head->time = 1;
1943-
1944- struct l7ag_payload_header *payload = (struct l7ag_payload_header *)(msg_head + 1);
1945- payload->magic[0] = 0x50; // P
1946- payload->magic[1] = 0x59; // Y
1947- payload->message_id = MESSAGE_ID_MIBCOLLECTREQUEST;
1948- payload->payload_datasize = sizeof(struct l7ag_payload_header)
1949- + sizeof(struct l7ag_mibrequest_message);
1950-
1951- struct l7ag_mibrequest_message *request = (struct l7ag_mibrequest_message *)(payload + 1);
1952- memset(request, 0, sizeof(struct l7ag_mibrequest_message));
1953- request->magic[0] = 0x52; // R
1954- request->magic[1] = 0x51; // Q
1955-
1956- if (message->connect()) {
1957- int ret = message->send(buf_size, sendbuf);
1958- if (ret != buf_size) {
1959- // TODO error
1960- message->close();
1961- }
1962- }
1963-}
1964-
--- a/snmpagent/netsnmp_bridge.h
+++ /dev/null
@@ -1,113 +0,0 @@
1-/*
2- * Note: this file originally auto-generated by mib2c using
3- * : mib2c.scalar.conf,v 1.9 2005/01/07 09:37:18 dts12 Exp $
4- * : mib2c.create-dataset.conf,v 5.4 2004/02/02 19:06:53 rstory Exp $
5- * : mib2c.notify.conf,v 5.3 2004/04/15 12:29:19 dts12 Exp $
6- */
7-#ifndef NETSNMP_BRIDGE_H
8-#define NETSNMP_BRIDGE_H
9-
10-#include <net-snmp/net-snmp-config.h>
11-#include <net-snmp/net-snmp-includes.h>
12-#include <net-snmp/agent/net-snmp-agent-includes.h>
13-#include <string.h>
14-
15-#include "MessengerClient.h"
16-#include "store_mibdata.h"
17-#include "message.h"
18-#include "../logger/logger_enum.h"
19-
20-#define REPEAT_SEC 3
21-
22-/*
23- * column number definitions for table um7VirtualServiceTable
24- */
25-#define COLUMN_UM7VSINDEX 1
26-#define COLUMN_UM7VSPROTOCOL 2
27-#define COLUMN_UM7VSIPADDRESS 3
28-#define COLUMN_UM7VSPORTNUMBER 4
29-#define COLUMN_UM7VSSCHEDULEMODULE 5
30-#define COLUMN_UM7VSPROTOCOLMODULE 6
31-#define COLUMN_UM7VSPROTOCOLMODULEOPTION 7
32-#define COLUMN_UM7VSRESCHEDULE 8
33-#define COLUMN_UM7VSSORRYIPADDRESS 9
34-#define COLUMN_UM7VSSORRYPORTNUMBER 10
35-#define COLUMN_UM7VSSORRYTHRESHOLD 11
36-#define COLUMN_UM7VSSORRYFORCEFLAG 12
37-#define COLUMN_UM7VSQOSTHRESHOLDUP 13
38-#define COLUMN_UM7VSQOSTHRESHOLDDOWN 14
39-#define COLUMN_UM7VSTHROUGHPUTUP 15
40-#define COLUMN_UM7VSTHROUGHPUTDOWN 16
41-
42-/*
43- * column number definitions for table um7RealServerTable
44- */
45-#define COLUMN_UM7RSINDEX 1
46-#define COLUMN_UM7RSVIRTUALSERVICEINDEX 2
47-#define COLUMN_UM7RSIPADDRESS 3
48-#define COLUMN_UM7RSPORTNUMBER 4
49-#define COLUMN_UM7RSFORWARDMODE 5
50-#define COLUMN_UM7RSWEIGHT 6
51-#define COLUMN_UM7RSACTIVECONN 7
52-#define COLUMN_UM7RSINACTIVECONN 8
53-
54-/*
55- * function declarations
56- */
57-void init_netsnmp_bridge(void *);
58-void initialize_table_um7VirtualServiceTable();
59-void initialize_table_um7RealServerTable();
60-void getL7vsdData(unsigned int, void *);
61-int send_um7StateAlert_trap();
62-int send_um7VirtualServiceAlert_trap();
63-int send_um7ReplicationAlert_trap();
64-int send_um7LogLevelAlert_trap();
65-int send_um7QoSAlarmOn_trap();
66-int send_um7QoSAlarmOff_trap();
67-int send_um7MessageAlert_trap();
68-Netsnmp_Node_Handler handle_um7LogVsdNetwork;
69-Netsnmp_Node_Handler handle_um7LogVsdNetworkBandwidth;
70-Netsnmp_Node_Handler handle_um7LogVsdNetworkNumConnection;
71-Netsnmp_Node_Handler handle_um7LogVsdNetworkQoS;
72-Netsnmp_Node_Handler handle_um7LogVsdVirtualService;
73-Netsnmp_Node_Handler handle_um7LogVsdRealServer;
74-Netsnmp_Node_Handler handle_um7LogVsdRealServerBalancing;
75-Netsnmp_Node_Handler handle_um7LogVsdSorryServer;
76-Netsnmp_Node_Handler handle_um7LogVsdReplication;
77-Netsnmp_Node_Handler handle_um7LogVsdStartStop;
78-Netsnmp_Node_Handler handle_um7LogVsdSystem;
79-Netsnmp_Node_Handler handle_um7LogVsdSystemMemory;
80-Netsnmp_Node_Handler handle_um7LogVsdSystemSocket;
81-Netsnmp_Node_Handler handle_um7LogVsdSystemSignal;
82-Netsnmp_Node_Handler handle_um7LogVsdEnvironment;
83-Netsnmp_Node_Handler handle_um7LogVsdEnvironmentParameter;
84-Netsnmp_Node_Handler handle_um7LogVsdLogger;
85-Netsnmp_Node_Handler handle_um7LogVsdParameter;
86-Netsnmp_Node_Handler handle_um7LogVsdEvent;
87-Netsnmp_Node_Handler handle_um7LogVsdSchedule;
88-Netsnmp_Node_Handler handle_um7LogVsdProgram;
89-Netsnmp_Node_Handler handle_um7LogVsdProtocol;
90-Netsnmp_Node_Handler handle_um7LogVsdModule;
91-Netsnmp_Node_Handler handle_um7LogVsadmParse;
92-Netsnmp_Node_Handler handle_um7LogVsadmOperate;
93-Netsnmp_Node_Handler handle_um7LogVsadmCommunicate;
94-Netsnmp_Node_Handler handle_um7LogVsadmConfigResult;
95-Netsnmp_Node_Handler handle_um7LogVsadmCommon;
96-Netsnmp_Node_Handler handle_um7LogVsadmLogger;
97-Netsnmp_Node_Handler handle_um7LogVsadmParameter;
98-Netsnmp_Node_Handler handle_um7LogVsadmProtocol;
99-Netsnmp_Node_Handler handle_um7LogVsadmModule;
100-Netsnmp_Node_Handler handle_um7LogSnmpStartStop;
101-Netsnmp_Node_Handler handle_um7LogSnmpManagerReceive;
102-Netsnmp_Node_Handler handle_um7LogSnmpManagerSend;
103-Netsnmp_Node_Handler handle_um7LogSnmpL7vsdReceive;
104-Netsnmp_Node_Handler handle_um7LogSnmpL7vsdSend;
105-Netsnmp_Node_Handler handle_um7LogSnmpLogger;
106-Netsnmp_Node_Handler handle_um7LogSnmpParameter;
107-Netsnmp_Node_Handler handle_um7StatMessage;
108-Netsnmp_Node_Handler handle_um7StatSnmpAgent;
109-Netsnmp_Node_Handler handle_um7StatReplication;
110-Netsnmp_Node_Handler um7VirtualServiceTable_handler;
111-Netsnmp_Node_Handler um7RealServerTable_handler;
112-
113-#endif /* NETSNMP_BRIDGE_H */
--- a/snmpagent/netsnmpbridge.c
+++ /dev/null
@@ -1,469 +0,0 @@
1-/*
2- * Note: this file originally auto-generated by mib2c using
3- * : mib2c.iterate.conf 15999 2007-03-25 22:32:02Z dts12 $
4- */
5-
6-#include <string>
7-#include <sstream>
8-
9-#include "netsnmpbridge.h"
10-#include "store_mibdata.h"
11-
12-#define REPEAT_TIME (1)
13-
14-std::vector<vsdata>::iterator vs_iterator;
15-std::vector<rsdata>::iterator rs_iterator;
16-
17-//trap functions
18-static oid snmptrap_oid[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
19-
20-//trap value
21-std::string trap_message;
22-
23-//collect mib callback id
24-static unsigned int reg_id = 0;
25-
26-void
27-set_l7vsError_trap_value(const std::string &in_str)
28-{
29- trap_message = in_str;
30-}
31-
32-int
33-send_l7vsError_trap(void)
34-{
35- netsnmp_variable_list *var_list = NULL;
36- oid l7vsError_oid[] = { 1, 3, 6, 1, 4, 1, 60000, 1, 0, 1 };
37- /*
38- * Set the snmpTrapOid.0 value
39- */
40- snmp_varlist_add_variable(&var_list,
41- snmptrap_oid, OID_LENGTH(snmptrap_oid),
42- ASN_OBJECT_ID,
43- (u_char *)l7vsError_oid, sizeof(l7vsError_oid));
44- /*
45- * Add any extra (optional) objects here
46- */
47- snmp_varlist_add_variable(&var_list,
48- snmptrap_oid, OID_LENGTH(snmptrap_oid),
49- ASN_OCTET_STR,
50- (u_char *)trap_message.c_str(), trap_message.length());
51- /*
52- * Send the trap to the list of configured destinations
53- * and clean up
54- */
55- send_v2trap(var_list);
56- snmp_free_varbind(var_list);
57- return SNMP_ERR_NOERROR;
58-}
59-
60-
61-/** Initializes the UltraMonkeyL7 module */
62-void
63-init_UltraMonkeyL7(MessengerClient *message)
64-{
65- static oid VSCount_oid[] = { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 1 };
66- static oid RSCount_oid[] = { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 3 };
67-
68-// DEBUGMSGTL(("UltraMonkeyL7", "Initializing\n"));
69-
70- netsnmp_register_scalar(netsnmp_create_handler_registration
71- ("VSCount", handle_VSCount, VSCount_oid,
72- OID_LENGTH(VSCount_oid), HANDLER_CAN_RONLY));
73- netsnmp_register_scalar(netsnmp_create_handler_registration
74- ("RSCount", handle_RSCount, RSCount_oid,
75- OID_LENGTH(RSCount_oid), HANDLER_CAN_RONLY));
76-
77- /*
78- * here we initialize all the tables we're planning on supporting
79- */
80- initialize_table_VSTable();
81- initialize_table_RSTable();
82-
83- reg_id = snmp_alarm_register(REPEAT_TIME, SA_REPEAT, collect_mib, message);
84- if (reg_id == 0) {
85- // TODO error
86- }
87-}
88-
89-// scaler values
90-int
91-handle_VSCount(netsnmp_mib_handler *handler,
92- netsnmp_handler_registration *reginfo,
93- netsnmp_agent_request_info *reqinfo,
94- netsnmp_request_info *requests)
95-{
96- snmp_log(LOG_INFO, "handle_vscount\n"); // TODO remove
97- switch (reqinfo->mode) {
98- case MODE_GET: {
99- std::size_t vs_count = l7ag_store_mibdata::getInstance().getVSdatacount();
100- snmp_log(LOG_INFO, "vs_count %d\n", vs_count); // TODO remove
101- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
102- (u_char *) &vs_count,
103- sizeof(std::size_t));
104- break;
105- }
106- default:
107- /*
108- * we should never get here, so this is a really bad error
109- */
110- snmp_log(LOG_ERR, "unknown mode (%d) in handle_VSCount\n",
111- reqinfo->mode);
112- return SNMP_ERR_GENERR;
113- }
114-
115- return SNMP_ERR_NOERROR;
116-}
117-
118-int
119-handle_RSCount(netsnmp_mib_handler *handler,
120- netsnmp_handler_registration *reginfo,
121- netsnmp_agent_request_info *reqinfo,
122- netsnmp_request_info *requests)
123-{
124- snmp_log(LOG_INFO, "handle_rscount\n");
125- switch (reqinfo->mode) {
126- case MODE_GET: {
127- std::size_t rs_count = l7ag_store_mibdata::getInstance().getRSdatacount();
128- snmp_set_var_typed_value(requests->requestvb, ASN_INTEGER,
129- (u_char *) &rs_count,
130- sizeof(std::size_t));
131- snmp_log(LOG_INFO, "rs_count %d\n", rs_count);
132- break;
133- }
134- default:
135- /*
136- * we should never get here, so this is a really bad error
137- */
138- snmp_log(LOG_ERR, "unknown mode (%d) in handle_RSCount\n",
139- reqinfo->mode);
140- return SNMP_ERR_GENERR;
141- }
142-
143- return SNMP_ERR_NOERROR;
144-}
145-
146-// TODO what is this comment???
147-// Determine the first/last column names
148-
149-/**
150- * Initialize the VSTable table by defining its contents and how it's structured
151- */
152-void
153-initialize_table_VSTable(void)
154-{
155- static oid VSTable_oid[] = { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 2 };
156- size_t VSTable_oid_len = OID_LENGTH(VSTable_oid);
157- netsnmp_handler_registration *reg;
158- netsnmp_iterator_info *iinfo;
159- netsnmp_table_registration_info *table_info;
160-
161- reg = netsnmp_create_handler_registration("VSTable", VSTable_handler,
162- VSTable_oid, VSTable_oid_len,
163- HANDLER_CAN_RONLY);
164-
165- table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
166- netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: IndexVS */
167- 0);
168- table_info->min_column = COLUMN_INDEXVS;
169- table_info->max_column = COLUMN_RSCOUNTVS;
170-
171- iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
172- iinfo->get_first_data_point = VSTable_get_first_data_point;
173- iinfo->get_next_data_point = VSTable_get_next_data_point;
174- iinfo->table_reginfo = table_info;
175-
176- netsnmp_register_table_iterator(reg, iinfo);
177-
178- /*
179- * Initialise the contents of the table here
180- */
181-}
182-
183-/*
184- * Example iterator hook routines - using 'get_next' to do most of the work
185- */
186-netsnmp_variable_list*
187-VSTable_get_first_data_point(void **my_loop_context,
188- void **my_data_context,
189- netsnmp_variable_list *put_index_data,
190- netsnmp_iterator_info *mydata)
191-{
192- *my_loop_context = l7ag_store_mibdata::getInstance().getVS_first_data_point(); //store_mibdataのデータの先頭を取得
193- vs_iterator = l7ag_store_mibdata::getInstance().getVS_first_data_iterator();
194- return VSTable_get_next_data_point(my_loop_context, my_data_context,
195- put_index_data, mydata);
196-}
197-
198-netsnmp_variable_list*
199-VSTable_get_next_data_point(void **my_loop_context,
200- void **my_data_context,
201- netsnmp_variable_list *put_index_data,
202- netsnmp_iterator_info *mydata)
203-{
204- struct vsdata *entry = (struct vsdata *) * my_loop_context;
205- netsnmp_variable_list *idx = put_index_data;
206-
207- if (entry) {
208- snmp_set_var_typed_integer(idx, ASN_INTEGER, entry->index);
209- idx = idx->next_variable;
210- *my_data_context = (void *) l7ag_store_mibdata::getInstance().getVS_data_point(vs_iterator); //ここはstore_mibdataからvectorのiteratorからデータのポインタを取得
211- vs_iterator++;
212- *my_loop_context = (void *) l7ag_store_mibdata::getInstance().getVS_data_point(vs_iterator); //vectorのiteratorから次のデータのポインタを取得
213- return put_index_data;
214- } else {
215- return NULL;
216- }
217-}
218-
219-
220-/** handles requests for the VSTable table */
221-int
222-VSTable_handler(netsnmp_mib_handler *handler,
223- netsnmp_handler_registration *reginfo,
224- netsnmp_agent_request_info *reqinfo,
225- netsnmp_request_info *requests)
226-{
227-
228- netsnmp_request_info *request;
229- netsnmp_table_request_info *table_info;
230- struct vsdata *table_entry;
231-
232- switch (reqinfo->mode) {
233- /*
234- * Read-support (also covers GetNext requests)
235- */
236- case MODE_GET:
237- for (request = requests; request; request = request->next) {
238- table_entry = (struct vsdata *)
239- netsnmp_extract_iterator_context(request);
240- table_info = netsnmp_extract_table_info(request);
241-
242- switch (table_info->colnum) {
243- case COLUMN_INDEXVS:
244- if (!table_entry) {
245- netsnmp_set_request_error(reqinfo, request,
246- SNMP_NOSUCHINSTANCE);
247- continue;
248- }
249- snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
250- table_entry->index);
251- break;
252- case COLUMN_QOSTHREASHOLDUP:
253- if (!table_entry) {
254- netsnmp_set_request_error(reqinfo, request,
255- SNMP_NOSUCHINSTANCE);
256- continue;
257- }
258- snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
259- table_entry->QoSThreasholdUp);
260- break;
261- case COLUMN_QOSTHREASHOLDDOWN:
262- if (!table_entry) {
263- netsnmp_set_request_error(reqinfo, request,
264- SNMP_NOSUCHINSTANCE);
265- continue;
266- }
267- snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
268- table_entry->QoSThreasholdDown);
269- break;
270- /*
271- case COLUMN_RSCOUNTVS:
272- if (!table_entry) {
273- netsnmp_set_request_error(reqinfo, request,
274- SNMP_NOSUCHINSTANCE);
275- continue;
276- }
277- snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
278- table_entry->RSCountatVS);
279- break;
280- */
281- default:
282- netsnmp_set_request_error(reqinfo, request,
283- SNMP_NOSUCHOBJECT);
284- break;
285- }
286- }
287- break;
288-
289- }
290- return SNMP_ERR_NOERROR;
291-}
292-
293-// Determine the first/last column names
294-
295-/** Initialize the RSTable table by defining its contents and how it's structured */
296-void
297-initialize_table_RSTable(void)
298-{
299- static oid RSTable_oid[] = { 1, 3, 6, 1, 4, 1, 60000, 1, 1, 4 };
300- size_t RSTable_oid_len = OID_LENGTH(RSTable_oid);
301- netsnmp_handler_registration *reg;
302- netsnmp_iterator_info *iinfo;
303- netsnmp_table_registration_info *table_info;
304-
305- reg = netsnmp_create_handler_registration("RSTable", RSTable_handler,
306- RSTable_oid, RSTable_oid_len,
307- HANDLER_CAN_RONLY);
308-
309- table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
310- netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, /* index: IndexRS */
311- 0);
312- table_info->min_column = COLUMN_INDEXRS;
313- table_info->max_column = COLUMN_INACTIVECONN;
314-
315- iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
316- iinfo->get_first_data_point = RSTable_get_first_data_point;
317- iinfo->get_next_data_point = RSTable_get_next_data_point;
318- iinfo->table_reginfo = table_info;
319-
320- netsnmp_register_table_iterator(reg, iinfo);
321-
322- /*
323- * Initialise the contents of the table here
324- */
325-}
326-
327-/*
328- * Example iterator hook routines - using 'get_next' to do most of the work
329- */
330-netsnmp_variable_list *
331-RSTable_get_first_data_point(void **my_loop_context,
332- void **my_data_context,
333- netsnmp_variable_list *put_index_data,
334- netsnmp_iterator_info *mydata)
335-{
336- *my_loop_context = l7ag_store_mibdata::getInstance().getRS_first_data_point();
337- rs_iterator = l7ag_store_mibdata::getInstance().getRS_first_data_iterator();
338- return RSTable_get_next_data_point(my_loop_context, my_data_context,
339- put_index_data, mydata);
340-}
341-
342-netsnmp_variable_list *
343-RSTable_get_next_data_point(void **my_loop_context,
344- void **my_data_context,
345- netsnmp_variable_list *put_index_data,
346- netsnmp_iterator_info *mydata)
347-{
348- struct rsdata *entry = (struct rsdata *) * my_loop_context;
349- netsnmp_variable_list *idx = put_index_data;
350-
351- if (entry) {
352- snmp_set_var_typed_integer(idx, ASN_INTEGER, entry->index);
353- idx = idx->next_variable;
354- *my_data_context = (void *) l7ag_store_mibdata::getInstance().getRS_data_point(rs_iterator);
355- *my_loop_context = (void *) l7ag_store_mibdata::getInstance().getRS_data_point(rs_iterator);
356- return put_index_data;
357- } else {
358- return NULL;
359- }
360-}
361-
362-
363-/** handles requests for the RSTable table */
364-int
365-RSTable_handler(netsnmp_mib_handler *handler,
366- netsnmp_handler_registration *reginfo,
367- netsnmp_agent_request_info *reqinfo,
368- netsnmp_request_info *requests)
369-{
370-
371- netsnmp_request_info *request;
372- netsnmp_table_request_info *table_info;
373- struct rsdata *table_entry;
374-
375- switch (reqinfo->mode) {
376- /*
377- * Read-support (also covers GetNext requests)
378- */
379- case MODE_GET:
380- for (request = requests; request; request = request->next) {
381- table_entry = (struct rsdata *)
382- netsnmp_extract_iterator_context(request);
383- table_info = netsnmp_extract_table_info(request);
384-
385- switch (table_info->colnum) {
386- case COLUMN_INDEXRS:
387- if (!table_entry) {
388- netsnmp_set_request_error(reqinfo, request,
389- SNMP_NOSUCHINSTANCE);
390- continue;
391- }
392- snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
393- table_entry->index);
394- break;
395- case COLUMN_VSINDEX:
396- if (!table_entry) {
397- netsnmp_set_request_error(reqinfo, request,
398- SNMP_NOSUCHINSTANCE);
399- continue;
400- }
401- snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
402- table_entry->virtualServiceIndex);
403- break;
404- case COLUMN_WEIGHT:
405- if (!table_entry) {
406- netsnmp_set_request_error(reqinfo, request,
407- SNMP_NOSUCHINSTANCE);
408- continue;
409- }
410- snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
411- table_entry->weight);
412- break;
413- case COLUMN_ACTIVECONN:
414- if (!table_entry) {
415- netsnmp_set_request_error(reqinfo, request,
416- SNMP_NOSUCHINSTANCE);
417- continue;
418- }
419- snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
420- table_entry->activeConn);
421- break;
422- case COLUMN_INACTIVECONN:
423- if (!table_entry) {
424- netsnmp_set_request_error(reqinfo, request,
425- SNMP_NOSUCHINSTANCE);
426- continue;
427- }
428- snmp_set_var_typed_integer(request->requestvb, ASN_INTEGER,
429- table_entry->inactiveConn);
430- break;
431- default:
432- netsnmp_set_request_error(reqinfo, request,
433- SNMP_NOSUCHOBJECT);
434- break;
435- }
436- }
437- break;
438-
439- }
440- return SNMP_ERR_NOERROR;
441-}
442-
443-void
444-collect_mib(unsigned int clientreg, void *clientarg)
445-{
446- snmp_log(LOG_INFO, "called\n"); // TODO remove
447- MessengerClient *message = (MessengerClient *) clientarg;
448- snmp_log(LOG_INFO, "%d\n", message->socketfd); // TODO remove
449- unsigned long long int buf_size = sizeof(struct l7ag_message_header)
450- + sizeof(struct l7ag_payload_header)
451- + sizeof(struct l7ag_mibrequest_message);
452- char *sendbuf = (char *) calloc(1, buf_size);
453- struct l7ag_message_header *msg_head = (struct l7ag_message_header *) sendbuf;
454- memcpy(msg_head->magic, "MSG", 4); // TODO remove
455- msg_head->version = 1;
456- msg_head->size = buf_size;
457- msg_head->payload_count = 1;
458-// TODO set time msg_head->time = 1;
459- struct l7ag_payload_header *payload = (struct l7ag_payload_header *)(msg_head + 1);
460- memcpy(payload->magic, "PAY", 4); // TODO remove
461- payload->message_id = MESSAGE_ID_MIBCOLLECTREQUEST;
462- payload->payload_datasize = sizeof(struct l7ag_payload_header) + sizeof(struct l7ag_mibrequest_message);
463- struct l7ag_mibrequest_message *request = (struct l7ag_mibrequest_message *)(payload + 1);
464- memset(request, 0, sizeof(struct l7ag_mibrequest_message));
465- memcpy(request->magic, "REQ", 4); // TODO remove
466-
467- int ret = message->send(buf_size, sendbuf);
468- snmp_log(LOG_INFO, "ret %d\n", ret); // TODO remove
469-}
--- a/snmpagent/netsnmpbridge.h
+++ /dev/null
@@ -1,54 +0,0 @@
1-/*
2- * Note: this file originally auto-generated by mib2c using
3- * : mib2c.iterate.conf 15999 2007-03-25 22:32:02Z dts12 $
4- */
5-#ifndef NETSNMPBRIDGE_H
6-#define NETSNMPBRIDGE_H
7-
8-#include <net-snmp/net-snmp-config.h>
9-#include <net-snmp/net-snmp-includes.h>
10-#include <net-snmp/agent/net-snmp-agent-includes.h>
11-
12-#include "MessengerClient.h"
13-
14-/*
15- * function declarations
16- */
17-void init_UltraMonkeyL7(MessengerClient *);
18-Netsnmp_Node_Handler handle_VSCount;
19-Netsnmp_Node_Handler handle_RSCount;
20-
21-void initialize_table_VSTable(void);
22-Netsnmp_Node_Handler VSTable_handler;
23-Netsnmp_First_Data_Point VSTable_get_first_data_point;
24-Netsnmp_Next_Data_Point VSTable_get_next_data_point;
25-
26-void initialize_table_RSTable(void);
27-Netsnmp_Node_Handler RSTable_handler;
28-Netsnmp_First_Data_Point RSTable_get_first_data_point;
29-Netsnmp_Next_Data_Point RSTable_get_next_data_point;
30-
31-// trap functions
32-void set_l7vsError_trap_value(const std::string &);
33-int send_l7vsError_trap(void);
34-
35-void collect_mib(unsigned int, void *);
36-
37-/*
38- * column number definitions for table VSTable
39- */
40-#define COLUMN_INDEXVS 1
41-#define COLUMN_QOSTHREASHOLDUP 2
42-#define COLUMN_QOSTHREASHOLDDOWN 3
43-#define COLUMN_RSCOUNTVS 4
44-
45-/*
46- * column number definitions for table RSTable
47- */
48-#define COLUMN_INDEXRS 1
49-#define COLUMN_VSINDEX 2
50-#define COLUMN_WEIGHT 3
51-#define COLUMN_ACTIVECONN 4
52-#define COLUMN_INACTIVECONN 5
53-
54-#endif /* NETSNMPBRIDGE_H */
--- a/snmpagent/proc_message.h
+++ /dev/null
@@ -1,17 +0,0 @@
1-#ifndef __PROC_MESSAGE_H__
2-#define __PROC_MESSAGE_H__
3-
4-
5-class proc_message
6-{
7-private:
8-
9-public:
10- proc_message() {};
11- virtual ~proc_message() {};
12-
13- virtual void do_process() = 0;
14-};
15-
16-
17-#endif //__PROC_MESSAGE_H__
--- a/snmpagent/proc_mibcollectmessage.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
1-
2-#include "proc_mibcollectmessage.h"
3-
4-
5-proc_mibcollectmessage::proc_mibcollectmessage()
6-{
7-
8-
9-}
10-
11-
12-proc_mibcollectmessage::~proc_mibcollectmessage()
13-{
14-
15-
16-}
17-
18-
19-void proc_mibcollectmessage::do_process()
20-{
21-
22-
23-}
24-
--- a/snmpagent/proc_mibcollectmessage.h
+++ /dev/null
@@ -1,17 +0,0 @@
1-#ifndef __PROC_MIBCOLLECTMESSAGE_H__
2-#define __PROC_MIBCOLLECTMESSAGE_H__
3-
4-#include "proc_message.h"
5-
6-class proc_mibcollectmessage : public proc_message
7-{
8-private:
9-
10-public:
11- proc_mibcollectmessage();
12- ~proc_mibcollectmessage();
13-
14- void do_process();
15-};
16-
17-#endif //__PROC_MIBCOLLECTMESSAGE_H__
--- a/snmpagent/proc_settingrequest.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
1-
2-#include "proc_settingrequest.h"
3-
4-
5-proc_settingrequest::proc_settingrequest()
6-{
7-
8-
9-}
10-
11-
12-proc_settingrequest::~proc_settingrequest()
13-{
14-
15-
16-}
17-
18-
19-void proc_settingrequest::do_process()
20-{
21-
22-
23-}
24-
--- a/snmpagent/proc_settingrequest.h
+++ /dev/null
@@ -1,18 +0,0 @@
1-#ifndef __PROC_SETTINGREQUEST_H__
2-#define __PROC_SETTINGREQUEST_H__
3-
4-#include "proc_message.h"
5-
6-class proc_settingrequest : public proc_message
7-{
8-private:
9-
10-public:
11- proc_settingrequest();
12- ~proc_settingrequest();
13-
14- void do_process();
15-};
16-
17-#endif //__PROC_SETTINGREQUEST_H__
18-
--- a/snmpagent/proc_trapsendrequest.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
1-
2-#include "proc_trapsendrequest.h"
3-
4-
5-proc_trapsendrequest::proc_trapsendrequest()
6-{
7-
8-
9-}
10-
11-
12-proc_trapsendrequest::~proc_trapsendrequest()
13-{
14-
15-
16-}
17-
18-
19-void proc_trapsendrequest::do_process()
20-{
21-
22-
23-}
24-
--- a/snmpagent/proc_trapsendrequest.h
+++ /dev/null
@@ -1,17 +0,0 @@
1-#ifndef __PROC_TRAPSENDREQUEST_H__
2-#define __PROC_TRAPSENDREQUEST_H__
3-
4-#include "proc_message.h"
5-
6-class proc_trapsendrequest : public proc_message
7-{
8-private:
9-
10-public:
11- proc_trapsendrequest();
12- ~proc_trapsendrequest();
13-
14- void do_process();
15-};
16-
17-#endif //__PROC_TRAPSENDREQUEST_H__
--- a/snmpagent/processcheck.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
1-#include <iostream>
2-#include <string>
3-#include <fstream>
4-#include <sys/types.h>
5-#include <dirent.h>
6-
7-#define BASEPATH "/proc/"
8-
9-bool findProcess(std::string &processname)
10-{
11- bool retflg = false;
12-
13- DIR *dp = opendir(BASEPATH);
14- if (!dp) {
15- return false; //don't open /proc
16- }
17-
18- struct dirent *dent = readdir(dp);
19- while (dent) {
20- if (dent->d_type == DT_DIR) {
21- std::string dirname = dent->d_name;
22- if (0x2F < dent->d_name[0] && 0x3A > dent->d_name[0]) {
23- std::string filename = BASEPATH;
24- filename += dent->d_name;
25- filename += "/status";
26- std::string strbuff;
27- std::ifstream ifs(filename.c_str());
28- std::getline(ifs, strbuff);
29- if (strbuff.find(processname) != std::string::npos) {
30- retflg = true;
31- break;
32- }
33- }
34- }
35- dent = readdir(dp);
36- }
37- closedir(dp);
38- return retflg;
39-}
--- a/snmpagent/queue_sendtrap.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
1-
2-#include "queue_sendtrap.h"
3-
4-
5-l7ag_queuesendtrap::l7ag_queuesendtrap()
6-{
7-
8-
9-
10-}
11-
12-
13-l7ag_queuesendtrap::~l7ag_queuesendtrap()
14-{
15-
16-
17-}
18-
19-
20-void l7ag_queuesendtrap::get_queuedata()
21-{
22-
23-
24-}
25-
26-
27-void l7ag_queuesendtrap::make_queuedata(std::string oid, std::string trapmessage)
28-{
29-
30-
31-}
32-
33-
34-void l7ag_queuesendtrap::set_queuedata()
35-{
36-
37-
38-}
39-
--- a/snmpagent/queue_sendtrap.h
+++ /dev/null
@@ -1,19 +0,0 @@
1-#ifndef __QUEUE_SENDTRAP_H__
2-#define __QUEUE_SENDTRAP_H__
3-
4-#include <string>
5-
6-class l7ag_queuesendtrap
7-{
8-private:
9- void set_queuedata();
10-
11-public:
12- l7ag_queuesendtrap();
13- ~l7ag_queuesendtrap();
14-
15- void get_queuedata();
16- void make_queuedata(std::string oid, std::string trapmessage);
17-};
18-
19-#endif //__QUEUE_SENDTRAP_H__
--- a/snmpagent/store_mibdata.cpp
+++ /dev/null
@@ -1,553 +0,0 @@
1-//
2-//! @file store_mibdata.cpp
3-//! @brief net-snmp mibdata stored source
4-//
5-// Copyright (C) 2008 NTT COMWARE Corporation.
6-//
7-// Distributed under the Boost Software License, Version 1.0. (See accompanying
8-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9-//
10-
11-#include "store_mibdata.h"
12-
13-vsdata *l7ag_store_mibdata::getVS_first_data_point()
14-{
15- return &vsdatalist.front();
16-}
17-
18-std::vector<vsdata>::iterator l7ag_store_mibdata::getVS_first_data_iterator()
19-{
20- return vsdatalist.begin();
21-}
22-
23-vsdata *l7ag_store_mibdata::getVS_data_point(std::vector<vsdata>::iterator in_it)
24-{
25- if (vsdatalist.end() == in_it) {
26- return NULL;
27- }
28- for (unsigned int i = 0; i < vsdatalist.size(); i++) {
29- if (vsdatalist[i].index == in_it->index) {
30- return &vsdatalist[i];
31- }
32- }
33- return NULL;
34-}
35-
36-std::size_t l7ag_store_mibdata::getVSdatacount()
37-{
38- return vsdatalist.size();
39-}
40-
41-vsdata *l7ag_store_mibdata::getVSmibdata(std::size_t n)
42-{
43- if (vsdatalist.size() <= n) {
44- return NULL;
45- }
46- return &vsdatalist[n];
47-}
48-
49-vsdata *l7ag_store_mibdata::updateVSmibdata(std::size_t n, l7ag_mibdata_payload_vs *in_data)
50-{
51- oid index[1];
52- netsnmp_table_row *row;
53-
54- if (vsdatalist.size() <= n) {
55- return NULL;
56- }
57- if (in_data == NULL) {
58- for (size_t i = vsdatalist.size(); i > n; i--) {
59- index[0] = i;
60- row = netsnmp_table_data_get_from_oid(vs_table_set->table, index, 1);
61- netsnmp_table_dataset_remove_and_delete_row(vs_table_set, row);
62- vsdatalist.pop_back();
63- }
64- return NULL;
65- }
66-
67- vsdatalist[n].index = in_data->index;
68- switch (in_data->protocol) {
69- case IPPROTO_TCP:
70- vsdatalist[n].protocol = 1;
71- break;
72- case IPPROTO_UDP:
73- vsdatalist[n].protocol = 2;
74- break;
75- default:
76- vsdatalist[n].protocol = 0;
77- break;
78- }
79- struct in_addr vip_in = { in_data->ipAddress };
80- char *vip = inet_ntoa(vip_in);
81- strncpy(vsdatalist[n].ipAddress, vip, L7VS_IPADDR_LEN);
82- vsdatalist[n].portNumber = ntohs(in_data->portNumber);
83- strncpy(vsdatalist[n].scheduleModule, in_data->scheduleModule, L7VS_MODNAME_LEN);
84- strncpy(vsdatalist[n].protocolModule, in_data->protocolModule, L7VS_MODNAME_LEN);
85- strncpy(vsdatalist[n].protocolModuleOption, in_data->protocolModuleOption, L7VS_PROTOMOD_OPT_LEN);
86- switch (in_data->reschedule) {
87- case 0:
88- vsdatalist[n].reschedule = 2;
89- break;
90- case 1:
91- vsdatalist[n].reschedule = 1;
92- break;
93- default:
94- vsdatalist[n].reschedule = 0;
95- break;
96- }
97- struct in_addr sorry_in = { in_data->sorryIpAddress };
98- char *sorry = inet_ntoa(sorry_in);
99- strncpy(vsdatalist[n].sorryIpAddress, sorry, L7VS_IPADDR_LEN);
100- vsdatalist[n].sorryPortNumber = ntohs(in_data->sorryPortNumber);
101- vsdatalist[n].sorryThreshold = in_data->sorryThreshold;
102- switch (in_data->sorryForceFlag) {
103- case 0:
104- vsdatalist[n].sorryForceFlag = 2;
105- break;
106- case 1:
107- vsdatalist[n].sorryForceFlag = 1;
108- break;
109- default:
110- vsdatalist[n].sorryForceFlag = 0;
111- break;
112- }
113- vsdatalist[n].QoSThresholdUp = in_data->QoSThresholdUp * 8;
114- vsdatalist[n].QoSThresholdDown = in_data->QoSThresholdDown * 8;
115- vsdatalist[n].throughputUp = in_data->throughputUp * 8;
116- vsdatalist[n].throughputDown = in_data->throughputDown * 8;
117-
118- if (vs_table_set == NULL) {
119- return false;
120- }
121- index[0] = vsdatalist[n].index;
122- row = netsnmp_table_data_get_from_oid(vs_table_set->table, index, 1);
123- if (row == NULL) {
124-// row = netsnmp_table_data_set_create_row_from_defaults(vs_table_set->default_row);
125- row = netsnmp_create_table_data_row();
126- if (row == NULL) return false;
127- netsnmp_table_row_add_index(row, ASN_INTEGER, (char *)&vsdatalist[n].index, sizeof(unsigned short));
128- netsnmp_table_dataset_add_row(vs_table_set, row);
129- }
130-
131- netsnmp_set_row_column(row, COLUMN_UM7VSINDEX, ASN_INTEGER, (char *) &vsdatalist[n].index, sizeof(unsigned short));
132- netsnmp_set_row_column(row, COLUMN_UM7VSPROTOCOL, ASN_INTEGER, (char *) &vsdatalist[n].protocol, sizeof(unsigned char));
133- netsnmp_set_row_column(row, COLUMN_UM7VSIPADDRESS, ASN_OCTET_STR, vsdatalist[n].ipAddress, strnlen(vsdatalist[n].ipAddress, L7VS_IPADDR_LEN));
134- netsnmp_set_row_column(row, COLUMN_UM7VSPORTNUMBER, ASN_UNSIGNED, (char *) &vsdatalist[n].portNumber, sizeof(unsigned short));
135- netsnmp_set_row_column(row, COLUMN_UM7VSSCHEDULEMODULE, ASN_OCTET_STR, (char *) &vsdatalist[n].scheduleModule, L7VS_MODNAME_LEN);
136- netsnmp_set_row_column(row, COLUMN_UM7VSPROTOCOLMODULE, ASN_OCTET_STR, (char *) &vsdatalist[n].protocolModule, L7VS_MODNAME_LEN);
137- netsnmp_set_row_column(row, COLUMN_UM7VSPROTOCOLMODULEOPTION, ASN_OCTET_STR, (char *) &vsdatalist[n].protocolModuleOption, L7VS_PROTOMOD_OPT_LEN);
138- netsnmp_set_row_column(row, COLUMN_UM7VSRESCHEDULE, ASN_INTEGER, (char *) &vsdatalist[n].reschedule, sizeof(unsigned char));
139- netsnmp_set_row_column(row, COLUMN_UM7VSSORRYIPADDRESS, ASN_OCTET_STR, vsdatalist[n].sorryIpAddress, strnlen(vsdatalist[n].sorryIpAddress, L7VS_IPADDR_LEN));
140- netsnmp_set_row_column(row, COLUMN_UM7VSSORRYPORTNUMBER, ASN_UNSIGNED, (char *) &vsdatalist[n].sorryPortNumber, sizeof(unsigned short));
141- netsnmp_set_row_column(row, COLUMN_UM7VSSORRYTHRESHOLD, ASN_INTEGER, (char *) &vsdatalist[n].sorryThreshold, sizeof(unsigned int));
142- netsnmp_set_row_column(row, COLUMN_UM7VSSORRYFORCEFLAG, ASN_INTEGER, (char *) &vsdatalist[n].sorryForceFlag, sizeof(unsigned char));
143- netsnmp_set_row_column(row, COLUMN_UM7VSQOSTHRESHOLDUP, ASN_INTEGER, (char *) &vsdatalist[n].QoSThresholdUp, sizeof(unsigned long long));
144- netsnmp_set_row_column(row, COLUMN_UM7VSQOSTHRESHOLDDOWN, ASN_INTEGER, (char *) &vsdatalist[n].QoSThresholdDown, sizeof(unsigned long long));
145- netsnmp_set_row_column(row, COLUMN_UM7VSTHROUGHPUTUP, ASN_INTEGER, (char *) &vsdatalist[n].throughputUp, sizeof(unsigned long long));
146- netsnmp_set_row_column(row, COLUMN_UM7VSTHROUGHPUTDOWN, ASN_INTEGER, (char *) &vsdatalist[n].throughputDown, sizeof(unsigned long long));
147-
148- return &vsdatalist[n];
149-}
150-
151-bool l7ag_store_mibdata::addVSmibdata(l7ag_mibdata_payload_vs *in_data)
152-{
153- oid index[1];
154- netsnmp_table_row *row;
155- vsdata data;
156-
157- if (NULL == in_data) {
158- return false;
159- }
160-
161- data.index = in_data->index;
162- switch (in_data->protocol) {
163- case IPPROTO_TCP:
164- data.protocol = 1;
165- break;
166- case IPPROTO_UDP:
167- data.protocol = 2;
168- break;
169- default:
170- data.protocol = 0;
171- break;
172- }
173- struct in_addr vip_in = { in_data->ipAddress };
174- char *vip = inet_ntoa(vip_in);
175- strncpy(data.ipAddress, vip, L7VS_IPADDR_LEN);
176- data.portNumber = ntohs(in_data->portNumber);
177- strncpy(data.scheduleModule, in_data->scheduleModule, L7VS_MODNAME_LEN);
178- strncpy(data.protocolModule, in_data->protocolModule, L7VS_MODNAME_LEN);
179- strncpy(data.protocolModuleOption, in_data->protocolModuleOption, L7VS_PROTOMOD_OPT_LEN);
180- switch (in_data->reschedule) {
181- case 0:
182- data.reschedule = 2;
183- break;
184- case 1:
185- data.reschedule = 1;
186- break;
187- default:
188- data.reschedule = 0;
189- break;
190- }
191- struct in_addr sorry_in = { in_data->sorryIpAddress };
192- char *sorry = inet_ntoa(sorry_in);
193- strncpy(data.sorryIpAddress, sorry, L7VS_IPADDR_LEN);
194- data.sorryPortNumber = ntohs(in_data->sorryPortNumber);
195- data.sorryThreshold = in_data->sorryThreshold;
196- switch (in_data->sorryForceFlag) {
197- case 0:
198- data.sorryForceFlag = 2;
199- break;
200- case 1:
201- data.sorryForceFlag = 1;
202- break;
203- default:
204- data.sorryForceFlag = 0;
205- break;
206- }
207- data.QoSThresholdUp = in_data->QoSThresholdUp * 8;
208- data.QoSThresholdDown = in_data->QoSThresholdDown * 8;
209- data.throughputUp = in_data->throughputUp * 8;
210- data.throughputDown = in_data->throughputDown * 8;
211- vsdatalist.push_back(data);
212-
213- if (vs_table_set == NULL) {
214- return false;
215- }
216- index[0] = data.index;
217- row = netsnmp_table_data_get_from_oid(vs_table_set->table, index, 1);
218- if (row == NULL) {
219-// row = netsnmp_table_data_set_create_row_from_defaults(vs_table_set->default_row);
220- row = netsnmp_create_table_data_row();
221- if (row == NULL) return false;
222- netsnmp_table_row_add_index(row, ASN_INTEGER, (char *)&data.index, sizeof(unsigned short));
223- netsnmp_table_dataset_add_row(vs_table_set, row);
224- }
225-
226- netsnmp_set_row_column(row, COLUMN_UM7VSINDEX, ASN_INTEGER, (char *) &data.index, sizeof(unsigned short));
227- netsnmp_set_row_column(row, COLUMN_UM7VSPROTOCOL, ASN_INTEGER, (char *) &data.protocol, sizeof(unsigned char));
228- netsnmp_set_row_column(row, COLUMN_UM7VSIPADDRESS, ASN_OCTET_STR, data.ipAddress, strnlen(data.ipAddress, L7VS_IPADDR_LEN));
229- netsnmp_set_row_column(row, COLUMN_UM7VSPORTNUMBER, ASN_UNSIGNED, (char *) &data.portNumber, sizeof(unsigned short));
230- netsnmp_set_row_column(row, COLUMN_UM7VSSCHEDULEMODULE, ASN_OCTET_STR, (char *) &data.scheduleModule, L7VS_MODNAME_LEN);
231- netsnmp_set_row_column(row, COLUMN_UM7VSPROTOCOLMODULE, ASN_OCTET_STR, (char *) &data.protocolModule, L7VS_MODNAME_LEN);
232- netsnmp_set_row_column(row, COLUMN_UM7VSPROTOCOLMODULEOPTION, ASN_OCTET_STR, (char *) &data.protocolModuleOption, L7VS_PROTOMOD_OPT_LEN);
233- netsnmp_set_row_column(row, COLUMN_UM7VSRESCHEDULE, ASN_INTEGER, (char *) &data.reschedule, sizeof(unsigned char));
234- netsnmp_set_row_column(row, COLUMN_UM7VSSORRYIPADDRESS, ASN_OCTET_STR, data.sorryIpAddress, strnlen(data.sorryIpAddress, L7VS_IPADDR_LEN));
235- netsnmp_set_row_column(row, COLUMN_UM7VSSORRYPORTNUMBER, ASN_UNSIGNED, (char *) &data.sorryPortNumber, sizeof(unsigned short));
236- netsnmp_set_row_column(row, COLUMN_UM7VSSORRYTHRESHOLD, ASN_INTEGER, (char *) &data.sorryThreshold, sizeof(unsigned int));
237- netsnmp_set_row_column(row, COLUMN_UM7VSSORRYFORCEFLAG, ASN_INTEGER, (char *) &data.sorryForceFlag, sizeof(unsigned char));
238- netsnmp_set_row_column(row, COLUMN_UM7VSQOSTHRESHOLDUP, ASN_INTEGER, (char *) &data.QoSThresholdUp, sizeof(unsigned long long));
239- netsnmp_set_row_column(row, COLUMN_UM7VSQOSTHRESHOLDDOWN, ASN_INTEGER, (char *) &data.QoSThresholdDown, sizeof(unsigned long long));
240- netsnmp_set_row_column(row, COLUMN_UM7VSTHROUGHPUTUP, ASN_INTEGER, (char *) &data.throughputUp, sizeof(unsigned long long));
241- netsnmp_set_row_column(row, COLUMN_UM7VSTHROUGHPUTDOWN, ASN_INTEGER, (char *) &data.throughputDown, sizeof(unsigned long long));
242-
243- return true;
244-}
245-
246-void l7ag_store_mibdata::clearVSmibdata()
247-{
248- oid index[1];
249- netsnmp_table_row *row;
250- for (size_t i = 1; i <= vsdatalist.size(); i++) {
251- index[0] = i;
252- row = netsnmp_table_data_get_from_oid(vs_table_set->table, index, 1);
253- netsnmp_table_dataset_remove_and_delete_row(vs_table_set, row);
254- }
255- vsdatalist.clear();
256-}
257-
258-rsdata *l7ag_store_mibdata::getRS_first_data_point()
259-{
260- return &rsdatalist.front();
261-}
262-
263-rsdata *l7ag_store_mibdata::getRS_data_point(std::vector<rsdata>::iterator in_it)
264-{
265- if (rsdatalist.end() == in_it) {
266- return NULL;
267- }
268- for (size_t i = 0; i < rsdatalist.size(); i++) {
269- if (rsdatalist[i].index == in_it->index) {
270- return &rsdatalist[i];
271- }
272- }
273-
274- return NULL;
275-}
276-
277-std::vector<rsdata>::iterator l7ag_store_mibdata::getRS_first_data_iterator()
278-{
279- return rsdatalist.begin();
280-}
281-
282-std::size_t l7ag_store_mibdata::getRSdatacount()
283-{
284- return rsdatalist.size();
285-}
286-
287-rsdata *l7ag_store_mibdata::getRSmibdata(std::size_t n)
288-{
289- if (rsdatalist.size() <= n) {
290- return NULL;
291- }
292- return &rsdatalist[n];
293-}
294-
295-rsdata *l7ag_store_mibdata::updateRSmibdata(std::size_t n, l7ag_mibdata_payload_rs *in_data)
296-{
297- oid index[1];
298- netsnmp_table_row *row;
299-
300- if (rsdatalist.size() <= n) {
301- return NULL;
302- }
303- if (in_data == NULL) {
304- for (size_t i = rsdatalist.size(); i > n; i--) {
305- index[0] = i;
306- row = netsnmp_table_data_get_from_oid(rs_table_set->table, index, 1);
307- netsnmp_table_dataset_remove_and_delete_row(rs_table_set, row);
308- rsdatalist.pop_back();
309- }
310- return NULL;
311- }
312-
313- rsdatalist[n].index = in_data->index;
314- rsdatalist[n].virtualServiceIndex = in_data->virtualServiceIndex;
315- struct in_addr in = { in_data->ipAddress };
316- char *ip = inet_ntoa(in);
317- strncpy(rsdatalist[n].ipAddress, ip, L7VS_IPADDR_LEN);
318- rsdatalist[n].portNumber = ntohs(in_data->portNumber);
319- rsdatalist[n].forwardMode = in_data->forwardMode;
320- rsdatalist[n].weight = in_data->weight;
321- rsdatalist[n].activeConn = in_data->activeConn;
322- rsdatalist[n].inactiveConn = in_data->inactiveConn;
323-
324- if (rs_table_set == NULL) {
325- return false;
326- }
327- index[0] = rsdatalist[n].index;
328- row = netsnmp_table_data_get_from_oid(rs_table_set->table, index, 1);
329- if (row == NULL) {
330-// row = netsnmp_table_data_set_create_row_from_defaults(rs_table_set->default_row);
331- row = netsnmp_create_table_data_row();
332- if (row == NULL) return false;
333- netsnmp_table_row_add_index(row, ASN_INTEGER, (char *)&rsdatalist[n].index, sizeof(unsigned short));
334- netsnmp_table_dataset_add_row(rs_table_set, row);
335- }
336-
337- netsnmp_set_row_column(row, COLUMN_UM7RSINDEX, ASN_INTEGER, (char *) &rsdatalist[n].index, sizeof(unsigned short));
338- netsnmp_set_row_column(row, COLUMN_UM7RSVIRTUALSERVICEINDEX, ASN_INTEGER, (char *) &rsdatalist[n].virtualServiceIndex, sizeof(unsigned short));
339- netsnmp_set_row_column(row, COLUMN_UM7RSIPADDRESS, ASN_OCTET_STR, rsdatalist[n].ipAddress, strnlen(rsdatalist[n].ipAddress, L7VS_IPADDR_LEN));
340- netsnmp_set_row_column(row, COLUMN_UM7RSPORTNUMBER, ASN_UNSIGNED, (char *) &rsdatalist[n].portNumber, sizeof(unsigned short));
341- netsnmp_set_row_column(row, COLUMN_UM7RSFORWARDMODE, ASN_INTEGER, (char *) &rsdatalist[n].forwardMode, sizeof(unsigned short));
342- netsnmp_set_row_column(row, COLUMN_UM7RSWEIGHT, ASN_INTEGER, (char *) &rsdatalist[n].weight, sizeof(unsigned int));
343- netsnmp_set_row_column(row, COLUMN_UM7RSACTIVECONN, ASN_INTEGER, (char *) &rsdatalist[n].activeConn, sizeof(unsigned int));
344- netsnmp_set_row_column(row, COLUMN_UM7RSINACTIVECONN, ASN_INTEGER, (char *) &rsdatalist[n].inactiveConn, sizeof(unsigned int));
345-
346- return &rsdatalist[n];
347-}
348-
349-bool l7ag_store_mibdata::addRSmibdata(l7ag_mibdata_payload_rs *in_data)
350-{
351- oid index[1];
352- netsnmp_table_row *row;
353- rsdata data;
354-
355- if (NULL == in_data) {
356- return false;
357- }
358-
359- data.index = in_data->index;
360- data.virtualServiceIndex = in_data->virtualServiceIndex;
361- struct in_addr in = { in_data->ipAddress };
362- char *ip = inet_ntoa(in);
363- strncpy(data.ipAddress, ip, L7VS_IPADDR_LEN);
364- data.portNumber = ntohs(in_data->portNumber);
365- data.forwardMode = in_data->forwardMode;
366- data.weight = in_data->weight;
367- data.activeConn = in_data->activeConn;
368- data.inactiveConn = in_data->inactiveConn;
369-
370- rsdatalist.push_back(data);
371-
372- if (rs_table_set == NULL) {
373- return false;
374- }
375- index[0] = data.index;
376- row = netsnmp_table_data_get_from_oid(rs_table_set->table, index, 1);
377- if (row == NULL) {
378-// row = netsnmp_table_data_set_create_row_from_defaults(rs_table_set->default_row);
379- row = netsnmp_create_table_data_row();
380- if (row == NULL) return false;
381- netsnmp_table_row_add_index(row, ASN_INTEGER, (char *)&data.index, sizeof(unsigned short));
382- netsnmp_table_dataset_add_row(rs_table_set, row);
383- }
384-
385- netsnmp_set_row_column(row, COLUMN_UM7RSINDEX, ASN_INTEGER, (char *) &data.index, sizeof(unsigned short));
386- netsnmp_set_row_column(row, COLUMN_UM7RSVIRTUALSERVICEINDEX, ASN_INTEGER, (char *) &data.virtualServiceIndex, sizeof(unsigned short));
387- netsnmp_set_row_column(row, COLUMN_UM7RSIPADDRESS, ASN_OCTET_STR, data.ipAddress, strnlen(data.ipAddress, L7VS_IPADDR_LEN));
388- netsnmp_set_row_column(row, COLUMN_UM7RSPORTNUMBER, ASN_UNSIGNED, (char *) &data.portNumber, sizeof(unsigned short));
389- netsnmp_set_row_column(row, COLUMN_UM7RSFORWARDMODE, ASN_INTEGER, (char *) &data.forwardMode, sizeof(unsigned short));
390- netsnmp_set_row_column(row, COLUMN_UM7RSWEIGHT, ASN_INTEGER, (char *) &data.weight, sizeof(unsigned int));
391- netsnmp_set_row_column(row, COLUMN_UM7RSACTIVECONN, ASN_INTEGER, (char *) &data.activeConn, sizeof(unsigned int));
392- netsnmp_set_row_column(row, COLUMN_UM7RSINACTIVECONN, ASN_INTEGER, (char *) &data.inactiveConn, sizeof(unsigned int));
393-
394- return true;
395-}
396-
397-void l7ag_store_mibdata::clearRSmibdata()
398-{
399- oid index[1];
400- netsnmp_table_row *row;
401- for (size_t i = 1; i <= rsdatalist.size(); i++) {
402- index[0] = i;
403- row = netsnmp_table_data_get_from_oid(rs_table_set->table, index, 1);
404- netsnmp_table_dataset_remove_and_delete_row(rs_table_set, row);
405- }
406- rsdatalist.clear();
407-}
408-
409-l7vsd_log_level *l7ag_store_mibdata::getVsdLogmibdata()
410-{
411- return &vsd_log;
412-}
413-
414-l7vsadm_log_level *l7ag_store_mibdata::getVsadmLogmibdata()
415-{
416- return &adm_log;
417-}
418-
419-l7snmpagent_log_level *l7ag_store_mibdata::getAgentLogmibdata()
420-{
421- return &snmp_log;
422-}
423-
424-l7_status *l7ag_store_mibdata::getStatmibdata()
425-{
426- return &status;
427-}
428-
429-void l7ag_store_mibdata::clearVsdLogmibdata()
430-{
431- vsd_log.network = l7vs::LOG_LV_NONE;
432- vsd_log.networkBandwidth = l7vs::LOG_LV_NONE;
433- vsd_log.networkNumConnection = l7vs::LOG_LV_NONE;
434- vsd_log.networkQoS = l7vs::LOG_LV_NONE;
435- vsd_log.virtualService = l7vs::LOG_LV_NONE;
436- vsd_log.realServer = l7vs::LOG_LV_NONE;
437- vsd_log.realServerBalancing = l7vs::LOG_LV_NONE;
438- vsd_log.sorryServer = l7vs::LOG_LV_NONE;
439- vsd_log.replication = l7vs::LOG_LV_NONE;
440- vsd_log.startStop = l7vs::LOG_LV_NONE;
441- vsd_log.system = l7vs::LOG_LV_NONE;
442- vsd_log.systemMemory = l7vs::LOG_LV_NONE;
443- vsd_log.systemSocket = l7vs::LOG_LV_NONE;
444- vsd_log.systemSignal = l7vs::LOG_LV_NONE;
445- vsd_log.environment = l7vs::LOG_LV_NONE;
446- vsd_log.environmentParameter = l7vs::LOG_LV_NONE;
447- vsd_log.logger = l7vs::LOG_LV_NONE;
448- vsd_log.parameter = l7vs::LOG_LV_NONE;
449- vsd_log.event = l7vs::LOG_LV_NONE;
450- vsd_log.schedule = l7vs::LOG_LV_NONE;
451- vsd_log.program = l7vs::LOG_LV_NONE;
452- vsd_log.protocol = l7vs::LOG_LV_NONE;
453- vsd_log.module = l7vs::LOG_LV_NONE;
454-}
455-
456-void l7ag_store_mibdata::clearVsadmLogmibdata()
457-{
458- adm_log.parse = l7vs::LOG_LV_NONE;
459- adm_log.operate = l7vs::LOG_LV_NONE;
460- adm_log.communicate = l7vs::LOG_LV_NONE;
461- adm_log.configResult = l7vs::LOG_LV_NONE;
462- adm_log.common = l7vs::LOG_LV_NONE;
463- adm_log.logger = l7vs::LOG_LV_NONE;
464- adm_log.parameter = l7vs::LOG_LV_NONE;
465- adm_log.protocol = l7vs::LOG_LV_NONE;
466- adm_log.module = l7vs::LOG_LV_NONE;
467-}
468-
469-void l7ag_store_mibdata::clearAgentLogmibdata()
470-{
471- snmp_log.startStop = l7vs::LOG_LV_NONE;
472- snmp_log.managerReceive = l7vs::LOG_LV_NONE;
473- snmp_log.managerSend = l7vs::LOG_LV_NONE;
474- snmp_log.l7vsdReceive = l7vs::LOG_LV_NONE;
475- snmp_log.l7vsdSend = l7vs::LOG_LV_NONE;
476- snmp_log.logger = l7vs::LOG_LV_NONE;
477- snmp_log.parameter = l7vs::LOG_LV_NONE;
478-}
479-
480-void l7ag_store_mibdata::clearStatmibdata()
481-{
482- memset(&status.message, 0, DISPLAYSTRING_LEN);
483- status.snmpAgent = UNKNOWN;
484-// status.replication = l7vs::replication::REPLICATION_OUT;
485-}
486-
487-void l7ag_store_mibdata::setVsdLogmibdata(l7vsd_log_level log)
488-{
489- vsd_log.network = log.network;
490- vsd_log.networkBandwidth = log.networkBandwidth;
491- vsd_log.networkNumConnection = log.networkNumConnection;
492- vsd_log.networkQoS = log.networkQoS;
493- vsd_log.virtualService = log.virtualService;
494- vsd_log.realServer = log.realServer;
495- vsd_log.realServerBalancing = log.realServerBalancing;
496- vsd_log.sorryServer = log.sorryServer;
497- vsd_log.replication = log.replication;
498- vsd_log.startStop = log.startStop;
499- vsd_log.system = log.system;
500- vsd_log.systemMemory = log.systemMemory;
501- vsd_log.systemSocket = log.systemSocket;
502- vsd_log.systemSignal = log.systemSignal;
503- vsd_log.environment = log.environment;
504- vsd_log.environmentParameter = log.environmentParameter;
505- vsd_log.logger = log.logger;
506- vsd_log.parameter = log.parameter;
507- vsd_log.event = log.event;
508- vsd_log.schedule = log.schedule;
509- vsd_log.program = log.program;
510- vsd_log.protocol = log.protocol;
511- vsd_log.module = log.module;
512-}
513-
514-void l7ag_store_mibdata::setVsadmLogmibdata(l7vsadm_log_level log)
515-{
516- adm_log.parse = log.parse;
517- adm_log.operate = log.operate;
518- adm_log.communicate = log.communicate;
519- adm_log.configResult = log.configResult;
520- adm_log.common = log.common;
521- adm_log.logger = log.logger;
522- adm_log.parameter = log.parameter;
523- adm_log.protocol = log.protocol;
524- adm_log.module = log.module;
525-}
526-
527-void l7ag_store_mibdata::setAgentLogmibdata(l7snmpagent_log_level log)
528-{
529- snmp_log.startStop = log.startStop;
530- snmp_log.managerReceive = log.managerReceive;
531- snmp_log.managerSend = log.managerSend;
532- snmp_log.l7vsdReceive = log.l7vsdReceive;
533- snmp_log.l7vsdSend = log.l7vsdSend;
534- snmp_log.logger = log.logger;
535- snmp_log.parameter = log.parameter;
536-}
537-
538-void l7ag_store_mibdata::setStatmibdata(l7_status stat)
539-{
540- memcpy(&status.message, &stat.message, strnlen(stat.message, DISPLAYSTRING_LEN));
541- status.snmpAgent = stat.snmpAgent;
542-// status.replication = stat.replication;
543-}
544-
545-void l7ag_store_mibdata::setVsTableSet(netsnmp_table_data_set *table_set)
546-{
547- vs_table_set = table_set;
548-}
549-
550-void l7ag_store_mibdata::setRsTableSet(netsnmp_table_data_set *table_set)
551-{
552- rs_table_set = table_set;
553-}
--- a/snmpagent/store_mibdata.h
+++ /dev/null
@@ -1,173 +0,0 @@
1-//
2-//! @file store_mibdata.h
3-//! @brief net-snmp mibdata stored header
4-//
5-// Copyright (C) 2008 NTT COMWARE Corporation.
6-//
7-// Distributed under the Boost Software License, Version 1.0. (See accompanying
8-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9-//
10-
11-#ifndef STORE_MIBDATA_H
12-#define STORE_MIBDATA_H
13-
14-#include <string>
15-#include <map>
16-#include <vector>
17-#include <netinet/in.h>
18-#include <sys/socket.h>
19-#include <arpa/inet.h>
20-#include "message.h"
21-#include "netsnmp_bridge.h"
22-#include "logger_enum.h"
23-#include "MessengerClient.h"
24-
25-#define DISPLAYSTRING_LEN (256) // RFC2579
26-#define L7VS_IPADDR_LEN (128)
27-
28-struct vsdata {
29- unsigned short index;
30- unsigned char protocol;
31- char ipAddress[L7VS_IPADDR_LEN];
32- unsigned short portNumber;
33- char scheduleModule[L7VS_MODNAME_LEN];
34- char protocolModule[L7VS_MODNAME_LEN];
35- char protocolModuleOption[L7VS_PROTOMOD_OPT_LEN];
36- unsigned char reschedule;
37- char sorryIpAddress[L7VS_IPADDR_LEN];
38- unsigned short sorryPortNumber;
39- unsigned int sorryThreshold;
40- unsigned char sorryForceFlag;
41- unsigned long long QoSThresholdUp;
42- unsigned long long QoSThresholdDown;
43- unsigned long long throughputUp;
44- unsigned long long throughputDown;
45-};
46-
47-struct rsdata {
48- unsigned short index;
49- unsigned short virtualServiceIndex;
50- char ipAddress[L7VS_IPADDR_LEN];
51- unsigned short portNumber;
52- unsigned short forwardMode;
53- unsigned int weight;
54- unsigned int activeConn;
55- unsigned int inactiveConn;
56-};
57-
58-struct l7vsd_log_level {
59- l7vs::LOG_LEVEL_TAG network;
60- l7vs::LOG_LEVEL_TAG networkBandwidth;
61- l7vs::LOG_LEVEL_TAG networkNumConnection;
62- l7vs::LOG_LEVEL_TAG networkQoS;
63- l7vs::LOG_LEVEL_TAG virtualService;
64- l7vs::LOG_LEVEL_TAG realServer;
65- l7vs::LOG_LEVEL_TAG realServerBalancing;
66- l7vs::LOG_LEVEL_TAG sorryServer;
67- l7vs::LOG_LEVEL_TAG replication;
68- l7vs::LOG_LEVEL_TAG startStop;
69- l7vs::LOG_LEVEL_TAG system;
70- l7vs::LOG_LEVEL_TAG systemMemory;
71- l7vs::LOG_LEVEL_TAG systemSocket;
72- l7vs::LOG_LEVEL_TAG systemSignal;
73- l7vs::LOG_LEVEL_TAG environment;
74- l7vs::LOG_LEVEL_TAG environmentParameter;
75- l7vs::LOG_LEVEL_TAG logger;
76- l7vs::LOG_LEVEL_TAG parameter;
77- l7vs::LOG_LEVEL_TAG event;
78- l7vs::LOG_LEVEL_TAG schedule;
79- l7vs::LOG_LEVEL_TAG program;
80- l7vs::LOG_LEVEL_TAG protocol;
81- l7vs::LOG_LEVEL_TAG module;
82-};
83-
84-struct l7vsadm_log_level {
85- l7vs::LOG_LEVEL_TAG parse;
86- l7vs::LOG_LEVEL_TAG operate;
87- l7vs::LOG_LEVEL_TAG communicate;
88- l7vs::LOG_LEVEL_TAG configResult;
89- l7vs::LOG_LEVEL_TAG common;
90- l7vs::LOG_LEVEL_TAG logger;
91- l7vs::LOG_LEVEL_TAG parameter;
92- l7vs::LOG_LEVEL_TAG protocol;
93- l7vs::LOG_LEVEL_TAG module;
94-};
95-
96-struct l7snmpagent_log_level {
97- l7vs::LOG_LEVEL_TAG startStop;
98- l7vs::LOG_LEVEL_TAG managerReceive;
99- l7vs::LOG_LEVEL_TAG managerSend;
100- l7vs::LOG_LEVEL_TAG l7vsdReceive;
101- l7vs::LOG_LEVEL_TAG l7vsdSend;
102- l7vs::LOG_LEVEL_TAG logger;
103- l7vs::LOG_LEVEL_TAG parameter;
104-};
105-
106-struct l7_status {
107- char message[DISPLAYSTRING_LEN];
108- IPC_STATUS_TAG snmpAgent;
109-// REPLICATION_MODE_TAG replication;
110-};
111-
112-class l7ag_store_mibdata
113-{
114-protected:
115- std::vector<vsdata> vsdatalist;
116- std::vector<rsdata> rsdatalist;
117- l7vsd_log_level vsd_log;
118- l7vsadm_log_level adm_log;
119- l7snmpagent_log_level snmp_log;
120- l7_status status;
121- netsnmp_table_data_set *vs_table_set;
122- netsnmp_table_data_set *rs_table_set;
123-private:
124- l7ag_store_mibdata() {};
125- l7ag_store_mibdata(const l7ag_store_mibdata &) {};
126- l7ag_store_mibdata &operator=(const l7ag_store_mibdata &in_data) {
127- vsdatalist = in_data.vsdatalist;
128- rsdatalist = in_data.rsdatalist;
129- return *this;
130- };
131-public:
132- static l7ag_store_mibdata &getInstance() {
133- static l7ag_store_mibdata instance;
134- return instance;
135- }
136-
137- vsdata *getVS_first_data_point();
138- rsdata *getRS_first_data_point();
139- vsdata *getVS_data_point(std::vector<vsdata>::iterator);
140- rsdata *getRS_data_point(std::vector<rsdata>::iterator);
141- std::vector<vsdata>::iterator getVS_first_data_iterator();
142- std::vector<rsdata>::iterator getRS_first_data_iterator();
143-
144- vsdata *getVSmibdata(std::size_t);
145- rsdata *getRSmibdata(std::size_t);
146- l7vsd_log_level *getVsdLogmibdata();
147- l7vsadm_log_level *getVsadmLogmibdata();
148- l7snmpagent_log_level *getAgentLogmibdata();
149- l7_status *getStatmibdata();
150-
151- std::size_t getVSdatacount();
152- std::size_t getRSdatacount();
153-
154- bool addVSmibdata(struct l7ag_mibdata_payload_vs *);
155- bool addRSmibdata(struct l7ag_mibdata_payload_rs *);
156- vsdata *updateVSmibdata(std::size_t, l7ag_mibdata_payload_vs *);
157- rsdata *updateRSmibdata(std::size_t, l7ag_mibdata_payload_rs *);
158-
159- void clearVSmibdata();
160- void clearRSmibdata();
161- void clearVsdLogmibdata();
162- void clearVsadmLogmibdata();
163- void clearAgentLogmibdata();
164- void clearStatmibdata();
165- void setVsdLogmibdata(l7vsd_log_level);
166- void setVsadmLogmibdata(l7vsadm_log_level);
167- void setAgentLogmibdata(l7snmpagent_log_level);
168- void setStatmibdata(l7_status);
169- void setVsTableSet(netsnmp_table_data_set *);
170- void setRsTableSet(netsnmp_table_data_set *);
171-};
172-
173-#endif //__STORE_MIBDATA_H__
--- a/snmpagent/subagent.cpp
+++ /dev/null
@@ -1,244 +0,0 @@
1-#include <sstream>
2-#include <sys/time.h>
3-
4-#include "error_code.h"
5-#include "parameter.h"
6-#include "subagent.h"
7-#include "netsnmp_bridge.h"
8-
9-#define NIC_DEFAULT "eth0"
10-#define ADDR_DEFAULT "127.0.0.1"
11-#define PORT_DEFAULT (60162)
12-#define INTERVAL_DEFAULT (1000)
13-#define SLEEPNANOTIME (1000000)
14-
15-
16-/*!
17- * l7ag_subagent class constructor
18- */
19-l7ag_subagent::l7ag_subagent()
20-{
21- stop_flag = false;
22- stat = STOP;
23-
24- dispatcher = new l7ag_dispatcher(&msg_queue, &trap_queue);
25- messenger = new MessengerClient(&msg_queue);
26-
27- loglevelmap_init();
28-}
29-
30-/*!
31- * l7ag_subagent class destructor
32- */
33-l7ag_subagent::~l7ag_subagent()
34-{
35- delete messenger;
36- delete dispatcher;
37-}
38-
39-/*!
40- * main loop
41- */
42-bool
43-l7ag_subagent::start()
44-{
45- struct timespec req;
46- req.tv_sec = 0;
47- req.tv_nsec = SLEEPNANOTIME;
48-
49- // initialize
50- reload_config();
51-
52- // convert int to string
53- std::stringstream ss;
54- std::string port;
55- ss << snmpparam.portno;
56- ss >> port;
57-
58- messenger->setEndpoint(snmpparam.address.c_str(), port.c_str());
59-
60- // start IPC thread
61- messenger->start();
62-
63- // start dispatcher thread
64- dispatcher->start();
65-
66- netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_ROLE, 1);
67- init_agent("l7snmpagent");
68- init_netsnmp_bridge(messenger);
69- init_snmp("l7snmpagent");
70-
71- //loop
72- while (1) {
73- agent_check_and_process(0); // non-blocking
74- if (stop_flag) {
75- //他スレッドの終了指示
76- messenger->stop();
77- dispatcher->stop();
78- break;
79- }
80- //Trapキューチェック
81- //Trapキューにデータがある場合
82- if (!dispatcher->get_TrapQueue()->empty()) {
83- //Trap値設定
84- struct l7_status *stat = l7ag_store_mibdata::getInstance().getStatmibdata();
85- strncpy(stat->message, dispatcher->get_TrapQueue()->front().message.c_str(), DISPLAYSTRING_LEN);
86- l7ag_store_mibdata::getInstance().setStatmibdata(*stat);
87- //Trap送信
88- send_um7MessageAlert_trap();
89- dispatcher->get_TrapQueue()->pop();
90- }
91-
92- int ret = nanosleep(&req, NULL);
93- if (ret == -1) {
94- break; // nanosleep failed
95- }
96- }
97- //finalize
98-
99- //completed
100- return true;
101-}
102-
103-/*!
104- * stop main loop
105- */
106-void
107-l7ag_subagent::stop()
108-{
109- stop_flag = true;
110-}
111-
112-void
113-l7ag_subagent::reload_config()
114-{
115- l7vs::Parameter param;
116- l7vs::error_code err;
117- //パラメータの読み込み
118- //NIC
119- snmpparam.nic = param.get_string(l7vs::PARAM_COMP_SNMPAGENT, "nic", err);
120- if (err) {
121- snmpparam.nic = NIC_DEFAULT;
122- }
123- //EndPoint
124- snmpparam.address = param.get_string(l7vs::PARAM_COMP_SNMPAGENT, "ip_addr", err);
125- if (err) {
126- snmpparam.address = ADDR_DEFAULT;
127- }
128- snmpparam.portno = param.get_int(l7vs::PARAM_COMP_SNMPAGENT, "port", err);
129- if (err) {
130- snmpparam.portno = PORT_DEFAULT;
131- }
132- //RequestInterval
133- snmpparam.interval = param.get_int(l7vs::PARAM_COMP_SNMPAGENT, "interval", err);
134- if (err) {
135- snmpparam.interval = INTERVAL_DEFAULT;
136- }
137- //status
138- snmpparam.status = param.get_int(l7vs::PARAM_COMP_SNMPAGENT, "status", err);
139- if (err) {
140- snmpparam.status = 0;
141- }
142-
143- //loglevel設定
144- load_loglevel();
145-}
146-
147-void
148-l7ag_subagent::load_loglevel()
149-{
150- l7vs::Parameter param;
151- l7vs::error_code err;
152- std::string tmpstr;
153- //log level 取得
154- snmpparam.loglevel.clear();
155-
156- tmpstr = param.get_string(l7vs::PARAM_COMP_LOGGER, "snmpagent_start_stop", err);
157- if (!err) {
158- snmpparam.loglevel.insert(
159- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_START_STOP,
160- levelstring_map[tmpstr]));
161- } else {
162- snmpparam.loglevel.insert(
163- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_START_STOP,
164- l7vs::LOG_LV_INFO));
165- }
166-
167- tmpstr = param.get_string(l7vs::PARAM_COMP_LOGGER, "snmpagent_manager_receive", err);
168- if (!err) {
169- snmpparam.loglevel.insert(
170- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_MANAGER_RECEIVE,
171- levelstring_map[tmpstr]));
172- } else {
173- snmpparam.loglevel.insert(
174- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_MANAGER_RECEIVE,
175- l7vs::LOG_LV_INFO));
176- }
177-
178- tmpstr = param.get_string(l7vs::PARAM_COMP_LOGGER, "snmpagent_manager_send", err);
179- if (!err) {
180- snmpparam.loglevel.insert(
181- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_MANAGER_SEND,
182- levelstring_map[tmpstr]));
183- } else {
184- snmpparam.loglevel.insert(
185- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_MANAGER_SEND,
186- l7vs::LOG_LV_INFO));
187- }
188-
189- tmpstr = param.get_string(l7vs::PARAM_COMP_LOGGER, "snmpagent_l7vsd_receive", err);
190- if (!err) {
191- snmpparam.loglevel.insert(
192- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_L7VSD_RECEIVE,
193- levelstring_map[tmpstr]));
194- } else {
195- snmpparam.loglevel.insert(
196- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_L7VSD_RECEIVE,
197- l7vs::LOG_LV_INFO));
198- }
199-
200- tmpstr = param.get_string(l7vs::PARAM_COMP_LOGGER, "snmpagent_l7vsd_send", err);
201- if (!err) {
202- snmpparam.loglevel.insert(
203- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_L7VSD_SEND,
204- levelstring_map[tmpstr]));
205- } else {
206- snmpparam.loglevel.insert(
207- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_L7VSD_SEND,
208- l7vs::LOG_LV_INFO));
209- }
210-
211- tmpstr = param.get_string(l7vs::PARAM_COMP_LOGGER, "snmpagent_logger", err);
212- if (!err) {
213- snmpparam.loglevel.insert(
214- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_LOGGER,
215- levelstring_map[tmpstr]));
216- } else {
217- snmpparam.loglevel.insert(
218- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_LOGGER,
219- l7vs::LOG_LV_INFO));
220- }
221-
222- tmpstr = param.get_string(l7vs::PARAM_COMP_LOGGER, "snmpagent_parameter", err);
223- if (!err) {
224- snmpparam.loglevel.insert(
225- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_PARAMETER,
226- levelstring_map[tmpstr]));
227- } else {
228- snmpparam.loglevel.insert(
229- std::pair<l7vs::LOG_CATEGORY_TAG, l7vs::LOG_LEVEL_TAG>(l7vs::LOG_CAT_SNMPAGENT_PARAMETER,
230- l7vs::LOG_LV_INFO));
231- }
232-}
233-
234-void
235-l7ag_subagent::loglevelmap_init()
236-{
237- //loglevelのテーブル作成
238- levelstring_map.clear();
239- levelstring_map.insert(std::pair<std::string, l7vs::LOG_LEVEL_TAG>("debug", l7vs::LOG_LV_DEBUG));
240- levelstring_map.insert(std::pair<std::string, l7vs::LOG_LEVEL_TAG>("info", l7vs::LOG_LV_INFO));
241- levelstring_map.insert(std::pair<std::string, l7vs::LOG_LEVEL_TAG>("warn", l7vs::LOG_LV_WARN));
242- levelstring_map.insert(std::pair<std::string, l7vs::LOG_LEVEL_TAG>("error", l7vs::LOG_LV_ERROR));
243- levelstring_map.insert(std::pair<std::string, l7vs::LOG_LEVEL_TAG>("fatal", l7vs::LOG_LV_FATAL));
244-}
--- a/snmpagent/subagent.h
+++ /dev/null
@@ -1,44 +0,0 @@
1-#ifndef __SUBAGENT_H__
2-#define __SUBAGENT_H__
3-
4-#include "l7ag_parameter.h"
5-#include "lockedqueue.h"
6-#include "QueueContainer.h"
7-#include "tag_threadstat.h" // TODO no need? set only STOP. no read.
8-#include "store_mibdata.h"
9-#include "MessengerClient.h"
10-#include "trapdata.h"
11-#include "dispatcher.h"
12-
13-class l7ag_subagent
14-{
15-private:
16- l7ag_parameter snmpparam;
17- std::map<std::string, l7vs::LOG_LEVEL_TAG> levelstring_map;
18-
19- bool stop_flag;
20- THREAD_STAT_TAG stat; // TODO no need? set only STOP. no read.
21-
22- MessageQueue msg_queue;
23- TrapQueue trap_queue;
24-
25- MessengerClient *messenger; // IPC class
26- l7ag_dispatcher *dispatcher; // Dispatch class
27-
28- void reload_config();
29- void load_loglevel();
30- void loglevelmap_init();
31-
32-public:
33- l7ag_subagent();
34- ~l7ag_subagent();
35-
36- bool start();
37- void stop();
38-
39- l7ag_parameter *get_parameter() {
40- return &snmpparam;
41- }
42-};
43-
44-#endif //__SUBAGENT_H__
--- a/snmpagent/tag_threadstat.h
+++ /dev/null
@@ -1,11 +0,0 @@
1-#ifndef __THREADSTAT_TAG_H__
2-#define __THREADSTAT_TAG_H__
3-
4-enum THREAD_STAT_TAG {
5- STOP,
6- INITIALIZING,
7- RUNNING,
8- FINALIZING,
9-};
10-
11-#endif //__THREADSTAT_TAG_H__
--- a/snmpagent/tag_trapid.h
+++ /dev/null
@@ -1,6 +0,0 @@
1-#ifndef __TRAPID_TAG_H__
2-#define __TRAPID_TAG_H__
3-
4-enum TRAPID_TAG { id_error };
5-
6-#endif //__TRAPID_TAG_H__
--- a/snmpagent/trapdata.h
+++ /dev/null
@@ -1,11 +0,0 @@
1-#ifndef __TRAPDATA_H__
2-#define __TRAPDATA_H__
3-
4-#include <string>
5-
6-struct trapdata {
7- std::string oid;
8- std::string message;
9-};
10-
11-#endif//__TRAPDATA_H__
--- a/snmpagent/watch_l7vsd.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
1-
2-#include "watch_l7vsd.h"
3-
4-/*!
5- *
6- */
7-l7ag_watch_l7vsd::l7ag_watch_l7vsd()
8-{
9-
10-
11-}
12-
13-/*!
14- *
15- */
16-l7ag_watch_l7vsd::l7ag_watch_l7vsd(l7ag_queuesendtrap *p_queueclass)
17-{
18- set_TrapQueueClass(p_queueclass);
19-}
20-
21-/*!
22- *
23- */
24-l7ag_watch_l7vsd::~l7ag_watch_l7vsd()
25-{
26-
27-
28-}
29-
30-/*!
31- *
32- */
33-void l7ag_watch_l7vsd::start_thread()
34-{
35-
36-
37-}
38-
39-/*!
40- *
41- */
42-void l7ag_watch_l7vsd::stop_thread()
43-{
44-
45-
46-}
47-
48-/*!
49- *
50- */
51-THREAD_STAT_TAG l7ag_watch_l7vsd::get_threadstatus()
52-{
53-
54-
55-}
56-
57-/*!
58- *
59- */
60-void *l7ag_watch_l7vsd::watch(void *args)
61-{
62-
63-
64-}
65-
--- a/snmpagent/watch_l7vsd.h
+++ /dev/null
@@ -1,31 +0,0 @@
1-#ifndef __WATCH_L7VSD_H__
2-#define __WATCH_L7VSD_H__
3-
4-#include <string>
5-#include "tag_threadstat.h"
6-
7-class l7ag_queuesendtrap;
8-class l7ag_watch_l7vsd
9-{
10-private:
11- l7ag_queuesendtrap *queueclass;
12-
13-protected:
14- l7ag_watch_l7vsd();
15-
16- static void *watch(void *args);
17-
18-public:
19- l7ag_watch_l7vsd(l7ag_queuesendtrap *p_queueclass);
20- ~l7ag_watch_l7vsd();
21-
22- void set_TrapQueueClass(l7ag_queuesendtrap *p_queueclass) {
23- queueclass = p_queueclass;
24- }
25-
26- void start_thread();
27- void stop_thread();
28- THREAD_STAT_TAG get_threadstatus();
29-};
30-
31-#endif //__WATCH_L7VSD_H__