You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-12-24 14:20:59 +03:00
merge develop branch
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -98,3 +98,8 @@ utils/loggingcpp/messageids.h
|
||||
CPackConfig.cmake
|
||||
CPackSourceConfig.cmake
|
||||
build/columnstore.community.spec
|
||||
*.rpm
|
||||
install_manifest_libs.txt
|
||||
install_manifest_platform.txt
|
||||
install_manifest_storage-engine.txt
|
||||
_CPack_Packages
|
||||
|
||||
@@ -29,11 +29,33 @@ MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}")
|
||||
# custom packaging steps.
|
||||
OPTION(COMMUNITY_BUILD "Set to true if this is a community build" ON)
|
||||
|
||||
SET(CMAKE_BUILD_TYPE RELWITHDEBINFO CACHE STRING
|
||||
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel")
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
SET(CMAKE_BUILD_TYPE RELWITHDEBINFO CACHE STRING
|
||||
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel" FORCE)
|
||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
#set( CMAKE_VERBOSE_MAKEFILE on )
|
||||
|
||||
# use, i.e. don't skip the full RPATH for the build tree
|
||||
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||
|
||||
# when building, don't use the install RPATH already
|
||||
# (but later on when installing)
|
||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
|
||||
# add the automatically determined parts of the RPATH
|
||||
# which point to directories outside the build tree to the install RPATH
|
||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
|
||||
|
||||
# the RPATH to be used when installing, but only if it's not a system directory
|
||||
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
|
||||
IF("${isSystemDir}" STREQUAL "-1")
|
||||
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
ENDIF("${isSystemDir}" STREQUAL "-1")
|
||||
|
||||
SET (PACKAGE columnstore)
|
||||
SET (VERSION 1.0.2)
|
||||
SET (PACKAGE_NAME columnstore)
|
||||
@@ -48,6 +70,8 @@ SET (INSTALL_ENGINE "/usr/local/mariadb/columnstore")
|
||||
|
||||
INCLUDE (configureEngine.cmake)
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/releasenum.in ${CMAKE_CURRENT_BINARY_DIR}/build/releasenum @ONLY IMMEDIATE)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/build/releasenum DESTINATION ${INSTALL_ENGINE} COMPONENT platform)
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
|
||||
INCLUDE(bison.cmake)
|
||||
@@ -66,6 +90,12 @@ if (NOT LIBXML2_FOUND)
|
||||
MESSAGE(FATAL_ERROR "Could not find a usable libxml2 development environment!")
|
||||
endif()
|
||||
|
||||
INCLUDE (FindJeMalloc.cmake)
|
||||
if (NOT JEMALLOC_FOUND)
|
||||
message(NOTICE "jemalloc not found! Compiling with standard malloc")
|
||||
SET(JEMALLOC_LIBRARIES "")
|
||||
endif()
|
||||
|
||||
FIND_PROGRAM(AWK_EXECUTABLE awk DOC "path to the awk executable")
|
||||
if(NOT AWK_EXECUTABLE)
|
||||
message(FATAL_ERROR "awk not found!")
|
||||
@@ -95,18 +125,30 @@ SET (ENGINE_SHAREDIR "${INSTALL_ENGINE}/share")
|
||||
SET (ENGINE_POSTDIR "${INSTALL_ENGINE}/post")
|
||||
SET (ENGINE_LOCALDIR "${INSTALL_ENGINE}/local")
|
||||
SET (ENGINE_MYSQLDIR "${INSTALL_ENGINE}/mysql")
|
||||
SET (ENGINE_MIBDIR "${INSTALL_ENGINE}/share/snmp/mibs")
|
||||
SET (ENGINE_TOOLSDIR "${INSTALL_ENGINE}/tools")
|
||||
|
||||
SET (ENGINE_NETSNMP_LIBS "-L${CMAKE_CURRENT_SOURCE_DIR}/net-snmp/net-snmp/snmplib/.libs -L${CMAKE_CURRENT_SOURCE_DIR}/net-snmp/net-snmp/agent/helpers/.libs -L${CMAKE_CURRENT_SOURCE_DIR}/net-snmp/net-snmp/agent/.libs/ -L${CMAKE_CURRENT_SOURCE_DIR}/net-snmp/net-snmp/apps/.libs/ -lnetsnmpmibs -lnetsnmpagent -lnetsnmp -lnetsnmpmibs -lnetsnmphelpers")
|
||||
SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot ${Boost_LIBRARIES} xml2 pthread rt)
|
||||
SET (ENGINE_OAM_LIBS oamcpp snmpmanager ${ENGINE_NETSNMP_LIBS})
|
||||
SET (ENGINE_COMMON_LIBS messageqcpp loggingcpp configcpp idbboot ${Boost_LIBRARIES} xml2 pthread rt ${JEMALLOC_LIBRARIES})
|
||||
SET (ENGINE_OAM_LIBS oamcpp alarmmanager)
|
||||
SET (ENGINE_BRM_LIBS brm idbdatafile cacheutils rwlock ${ENGINE_OAM_LIBS} ${ENGINE_COMMON_LIBS})
|
||||
SET (ENGINE_EXEC_LIBS joblist execplan windowfunction joiner rowgroup funcexp udfsdk dataconvert common compress mysqlcl_idb querystats querytele thrift threadpool ${ENGINE_BRM_LIBS})
|
||||
SET (ENGINE_WRITE_LIBS ddlpackageproc ddlpackage dmlpackageproc dmlpackage writeengine writeengineclient idbdatafile cacheutils ${ENGINE_EXEC_LIBS})
|
||||
|
||||
SET (ENGINE_COMMON_LDFLAGS "")
|
||||
|
||||
IF (SERVER_BUILD_INCLUDE_DIR)
|
||||
SET (SERVER_BUILD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${SERVER_BUILD_INCLUDE_DIR})
|
||||
ELSE()
|
||||
SET (SERVER_BUILD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/../include)
|
||||
ENDIF()
|
||||
|
||||
IF (SERVER_SOURCE_ROOT_DIR)
|
||||
SET (SERVER_SOURCE_ROOT_DIR ${CMAKE_BINARY_DIR}/${SERVER_SOURCE_ROOT_DIR})
|
||||
ELSE()
|
||||
SET (SERVER_SOURCE_ROOT_DIR ${CMAKE_BINARY_DIR}/..)
|
||||
ENDIF()
|
||||
|
||||
MESSAGE("SERVER_BUILD_INCLUDE_DIR = ${SERVER_BUILD_INCLUDE_DIR}")
|
||||
MESSAGE("SERVER_SOURCE_ROOT_DIR = ${SERVER_SOURCE_ROOT_DIR}")
|
||||
|
||||
#SET (ENGINE_UTILS_BOOSTIDB_INCLUDE "{CMAKE_CURRENT_SOURCE_DIR}/utils/boost_idb")
|
||||
SET (ENGINE_UTILS_XML_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/libxml")
|
||||
@@ -122,7 +164,7 @@ SET (ENGINE_UTILS_COMMON_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/common"
|
||||
SET (ENGINE_UTILS_DATACONVERT_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/dataconvert")
|
||||
SET (ENGINE_UTILS_RWLOCK_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/rwlock")
|
||||
SET (ENGINE_UTILS_FUNCEXP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/funcexp")
|
||||
SET (ENGINE_SNMPD_SNMPMANAGER_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/snmpd/snmpmanager")
|
||||
SET (ENGINE_OAMAPPS_ALARMMANAGER_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/oamapps/alarmmanager")
|
||||
SET (ENGINE_UTILS_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils")
|
||||
SET (ENGINE_OAM_OAMCPP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/oam/oamcpp")
|
||||
SET (ENGINE_DBCON_DDLPKGPROC_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/dbcon/ddlpackageproc")
|
||||
@@ -145,34 +187,16 @@ SET (ENGINE_UTILS_BATCHLDR_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/batchlo
|
||||
SET (ENGINE_UTILS_DDLCLEANUP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/ddlcleanup")
|
||||
SET (ENGINE_UTILS_QUERYSTATS_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/utils/querystats")
|
||||
SET (ENGINE_WE_CONFIGCPP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/writeengine/xml")
|
||||
SET (ENGINE_SERVER_SQL_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/../../../sql")
|
||||
SET (ENGINE_SERVER_SQL2_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/../sql")
|
||||
SET (ENGINE_SERVER_INCLUDE_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/../../../include")
|
||||
SET (ENGINE_SERVER_INCLUDE_INCLUDE2 "${CMAKE_CURRENT_SOURCE_DIR}/../include")
|
||||
SET (ENGINE_SERVER_PCRE_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/../../../pcre")
|
||||
SET (ENGINE_SERVER_PCRE_INCLUDE2 "${CMAKE_CURRENT_SOURCE_DIR}/../pcre")
|
||||
SET (ENGINE_NETSNMP_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/net-snmp/net-snmp")
|
||||
SET (ENGINE_NETSNMP_INCLUDE2 "${CMAKE_CURRENT_SOURCE_DIR}/net-snmp/net-snmp/include")
|
||||
SET (ENGINE_SERVER_SQL_INCLUDE "${SERVER_SOURCE_ROOT_DIR}/sql")
|
||||
SET (ENGINE_SERVER_INCLUDE_INCLUDE "${SERVER_SOURCE_ROOT_DIR}/include")
|
||||
SET (ENGINE_SERVER_PCRE_INCLUDE "${SERVER_SOURCE_ROOT_DIR}/pcre")
|
||||
|
||||
SET (ENGINE_DEFAULT_INCLUDES "." "../" "../..")
|
||||
SET (ENGINE_DEFAULT_INCLUDES "." "../" "../../" ${SERVER_BUILD_INCLUDE_DIR})
|
||||
|
||||
SET (ENGINE_COMMON_INCLUDES ${ENGINE_DEFAULT_INCLUDES} ${Boost_INCLUDE_DIR} ${ENGINE_UTILS_XML_INCLUDE} ${ENGINE_UTILS_MESSAGEQCPP_INCLUDE} ${ENGINE_WE_SHARED_INCLUDE} ${ENGINE_UTILS_IDBDATAFILE_INCLUDE} ${ENGINE_UTILS_LOGGINGCPP_INCLUDE} ${ENGINE_UTILS_CONFIGCPP_INCLUDE} ${ENGINE_UTILS_COMPRESS_INCLUDE} ${ENGINE_VERSIONING_BRM_INCLUDE} ${ENGINE_UTILS_ROWGROUP_INCLUDE} ${ENGINE_UTILS_COMMON_INCLUDE} ${ENGINE_UTILS_DATACONVERT_INCLUDE} ${ENGINE_UTILS_RWLOCK_INCLUDE} ${ENGINE_UTILS_FUNCEXP_INCLUDE} ${ENGINE_SNMPD_SNMPMANAGER_INCLUDE} ${ENGINE_UTILS_INCLUDE} ${ENGINE_OAM_OAMCPP_INCLUDE} ${ENGINE_DBCON_DDLPKGPROC_INCLUDE} ${ENGINE_DBCON_DDLPKG_INCLUDE} ${ENGINE_DBCON_EXECPLAN_INCLUDE} ${ENGINE_UTILS_STARTUP_INCLUDE} ${ENGINE_DBCON_JOBLIST_INCLUDE} ${ENGINE_WE_WRAPPER_INCLUDE} ${ENGINE_WE_SERVER_INCLUDE} ${ENGINE_DBCON_DMLPKG_INCLUDE} ${ENGINE_WE_CLIENT_INCLUDE} ${ENGINE_DBCON_DMLPKGPROC_INCLUDE} ${ENGINE_UTILS_CACHEUTILS_INCLUDE} ${ENGINE_UTILS_MYSQLCL_INCLUDE} ${ENGINE_UTILS_QUERYTELE_INCLUDE} ${ENGINE_UTILS_THRIFT_INCLUDE} ${ENGINE_UTILS_JOINER_INCLUDE} ${ENGINE_UTILS_THREADPOOL_INCLUDE} ${ENGINE_UTILS_BATCHLDR_INCLUDE} ${ENGINE_UTILS_DDLCLEANUP_INCLUDE} ${ENGINE_UTILS_QUERYSTATS_INCLUDE} ${ENGINE_WE_CONFIGCPP_INCLUDE} ${ENGINE_SERVER_SQL_INCLUDE} ${ENGINE_SERVER_INCLUDE_INCLUDE} ${ENGINE_SERVER_PCRE_INCLUDE} ${ENGINE_SERVER_SQL2_INCLUDE} ${ENGINE_SERVER_INCLUDE_INCLUDE2} ${ENGINE_SERVER_PCRE_INCLUDE2} ${ENGINE_NETSNMP_INCLUDE} ${ENGINE_NETSNMP_INCLUDE2})
|
||||
|
||||
|
||||
INCLUDE (ExternalProject)
|
||||
ExternalProject_Add(
|
||||
libnetsnmpmibs
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/net-snmp/net-snmp
|
||||
CONFIGURE_COMMAND ./configure --prefix=${INSTALL_ENGINE} --with-mib-modules=disman/event-mib --with-cc=gcc --with-logfile=${INSTALL_ENGINE}/log/snmpd.log --with-sys-location=Unknown --with-sys-contact=root@localhost.localdomain --with-default-snmp-version=3 --with-persistent-directory=${INSTALL_ENGINE}/var/net-snmp --without-openssl --with-ldflags=-Wl,-rpath\ -Wl,${INSTALL_ENGINE}/lib
|
||||
BUILD_COMMAND make
|
||||
INSTALL_COMMAND ""
|
||||
BUILD_IN_SOURCE 1
|
||||
)
|
||||
INSTALL ( CODE "EXECUTE_PROCESS(COMMAND make install WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/net-snmp/net-snmp)")
|
||||
SET (ENGINE_COMMON_INCLUDES ${ENGINE_DEFAULT_INCLUDES} ${Boost_INCLUDE_DIR} ${ENGINE_UTILS_XML_INCLUDE} ${ENGINE_UTILS_MESSAGEQCPP_INCLUDE} ${ENGINE_WE_SHARED_INCLUDE} ${ENGINE_UTILS_IDBDATAFILE_INCLUDE} ${ENGINE_UTILS_LOGGINGCPP_INCLUDE} ${ENGINE_UTILS_CONFIGCPP_INCLUDE} ${ENGINE_UTILS_COMPRESS_INCLUDE} ${ENGINE_VERSIONING_BRM_INCLUDE} ${ENGINE_UTILS_ROWGROUP_INCLUDE} ${ENGINE_UTILS_COMMON_INCLUDE} ${ENGINE_UTILS_DATACONVERT_INCLUDE} ${ENGINE_UTILS_RWLOCK_INCLUDE} ${ENGINE_UTILS_FUNCEXP_INCLUDE} ${ENGINE_OAMAPPS_ALARMMANAGER_INCLUDE} ${ENGINE_UTILS_INCLUDE} ${ENGINE_OAM_OAMCPP_INCLUDE} ${ENGINE_DBCON_DDLPKGPROC_INCLUDE} ${ENGINE_DBCON_DDLPKG_INCLUDE} ${ENGINE_DBCON_EXECPLAN_INCLUDE} ${ENGINE_UTILS_STARTUP_INCLUDE} ${ENGINE_DBCON_JOBLIST_INCLUDE} ${ENGINE_WE_WRAPPER_INCLUDE} ${ENGINE_WE_SERVER_INCLUDE} ${ENGINE_DBCON_DMLPKG_INCLUDE} ${ENGINE_WE_CLIENT_INCLUDE} ${ENGINE_DBCON_DMLPKGPROC_INCLUDE} ${ENGINE_UTILS_CACHEUTILS_INCLUDE} ${ENGINE_UTILS_MYSQLCL_INCLUDE} ${ENGINE_UTILS_QUERYTELE_INCLUDE} ${ENGINE_UTILS_THRIFT_INCLUDE} ${ENGINE_UTILS_JOINER_INCLUDE} ${ENGINE_UTILS_THREADPOOL_INCLUDE} ${ENGINE_UTILS_BATCHLDR_INCLUDE} ${ENGINE_UTILS_DDLCLEANUP_INCLUDE} ${ENGINE_UTILS_QUERYSTATS_INCLUDE} ${ENGINE_WE_CONFIGCPP_INCLUDE} ${ENGINE_SERVER_SQL_INCLUDE} ${ENGINE_SERVER_INCLUDE_INCLUDE} ${ENGINE_SERVER_PCRE_INCLUDE})
|
||||
|
||||
ADD_SUBDIRECTORY(utils)
|
||||
ADD_SUBDIRECTORY(oam/oamcpp)
|
||||
ADD_SUBDIRECTORY(snmpd)
|
||||
ADD_SUBDIRECTORY(dbcon/execplan)
|
||||
ADD_SUBDIRECTORY(dbcon/joblist)
|
||||
ADD_SUBDIRECTORY(versioning)
|
||||
@@ -199,5 +223,4 @@ ADD_SUBDIRECTORY(writeengine/server)
|
||||
ADD_SUBDIRECTORY(writeengine/bulk)
|
||||
ADD_SUBDIRECTORY(writeengine/splitter)
|
||||
|
||||
INSTALL(FILES utils/jemalloc/libjemalloc.so.3.3.0 DESTINATION ${ENGINE_LIBDIR})
|
||||
|
||||
INCLUDE(cpackEngineRPM.cmake)
|
||||
|
||||
128
CODING STANDARDS.md
Normal file
128
CODING STANDARDS.md
Normal file
@@ -0,0 +1,128 @@
|
||||
# Coding Standards
|
||||
|
||||
This is a working document that is subject to change over time. It is intended to be applied to new code going forward rather than instantly applying to the entire codebase immediately.
|
||||
|
||||
## Language
|
||||
|
||||
We currently use C++ with Boost extensions. Due to the requirement of supporting older platforms such as CentOS 6 we cannot yet support C++11.
|
||||
|
||||
## Coding Style
|
||||
|
||||
Everyone has a preferred coding style, there is no real correct style. What is important is that we stick to one style throughout the code.
|
||||
|
||||
We should use a variant of the [Allman coding style](http://en.wikipedia.org/wiki/Indent_style#Allman_style). The variation is to use 4 spaces instead of tabs. The exception to the rule is Makefiles where space indentation can break them.
|
||||
|
||||
Allman style specifies that braces associated with a statement should be on the following line with the same indentation and the statements inside the braces are next level indented. The closing braces are also on a new line at the same indentation as the original statement.
|
||||
|
||||
### Switch Statements
|
||||
|
||||
Should be indented as follows:
|
||||
|
||||
```c++
|
||||
switch(intValue)
|
||||
{
|
||||
case 1:
|
||||
// Do something
|
||||
break;
|
||||
case 2:
|
||||
// Do something else
|
||||
break;
|
||||
default:
|
||||
// Something went wrong
|
||||
break;
|
||||
}
|
||||
```
|
||||
|
||||
### Modeline Headers
|
||||
|
||||
The following was generated using the online [Editor Modeline Generator](https://www.wireshark.org/tools/modelines.html), it should be added to the very top of all code files. Most editors will understand one of these:
|
||||
|
||||
```c++
|
||||
/* c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil
|
||||
* vi: set shiftwidth=4 tabstop=4 expandtab:
|
||||
* :indentSize=4:tabSize=4:noTabs=true:
|
||||
*/
|
||||
```
|
||||
|
||||
## Types
|
||||
|
||||
Despite being linked to MariaDB we should use std types where possible. For example:
|
||||
|
||||
* Use `bool`, not `my_bool`
|
||||
* Use `true` and `false`, not the `TRUE` and `FALSE` macros
|
||||
* `ulong` → `uint32_t`
|
||||
* `ulonglong` → `uint64_t`
|
||||
* `long int` → `int32_t`
|
||||
|
||||
## Pointers
|
||||
|
||||
Use `NULL` when referring to the null pointer, not `0`.
|
||||
|
||||
## Naming Style
|
||||
|
||||
We should use CamelCase everywhere. For types and class definitions these should have an upper case first character. Otherwise they should have a lower case first character.
|
||||
|
||||
Do not typedef structs. This is redundant for the compilers we use.
|
||||
|
||||
Use `column` instead of `field` and `schema` instead of `database`.
|
||||
|
||||
Variables passed around between multiple functions should have consistent naming.
|
||||
|
||||
## Includes
|
||||
|
||||
Use triangle braces for API includes, this means accessing MariaDB's headers from the engine or system includes. Use double-quotes for local includes.
|
||||
|
||||
Use header file `#ifndef` guards instead if `#pragma once`.
|
||||
|
||||
## Lengths
|
||||
|
||||
These are soft maximum lengths we should try and follow for ease of reading code, but are not hard rules:
|
||||
|
||||
* Line length: 80 chars
|
||||
* Function length: 200 lines
|
||||
|
||||
## Braces
|
||||
|
||||
Be generous with braces for `if` statements. It makes your logic easier to parse by humans, if there are several depths of braces use multiple lines to make it more readable.
|
||||
|
||||
With `if` statements that have one statement the absence of curly braces containing the statement is allowed. But please be careful when editing such code.
|
||||
|
||||
When you use a for loop to iterate across something and do not actually do anything in the for loop (for instance, if you just want to walk an array or list of pointers): do this:
|
||||
|
||||
```c++
|
||||
for () {};
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```c++
|
||||
for () {/* Do nothing */};
|
||||
```
|
||||
|
||||
DO NOT do this:
|
||||
|
||||
```c++
|
||||
for ();
|
||||
```
|
||||
|
||||
Why? When you have an empty body. It gives a hint that you really did want just the for to loop.
|
||||
|
||||
## Ignoring Return Types
|
||||
|
||||
Generally, return types of a function should not be ignored, however, if you do ignore the return, do:
|
||||
|
||||
```c++
|
||||
(void)func();
|
||||
```
|
||||
|
||||
This indicates explicitly that you are ignoring the return and *know* that you are ignoring the return.
|
||||
|
||||
## ENUMs
|
||||
|
||||
ENUM identifiers should be in all caps and use a prefix that makes it obvious that it belongs to a given ENUM specifier. The ENUM specifier should also be in all caps.
|
||||
|
||||
Use ENUM instead of `#define` where applicable. This aids debugging.
|
||||
|
||||
## Class Files
|
||||
|
||||
Ideally every class should have its own C++ and header file. The file name should match the class name.
|
||||
17
CONTRIBUTING.md
Normal file
17
CONTRIBUTING.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Contributing to ColumnStore
|
||||
|
||||
## Bugs
|
||||
|
||||
Bugs are tracked via Jira, to file a bug please go to https://jira.mariadb.org/browse/MCOL
|
||||
|
||||
`MCOL` is the bug type for ColumnStore.
|
||||
|
||||
## Branches
|
||||
|
||||
Please use the standard GitHub fork and pull request method to submit any code contributions to us. They will be evaluated by our engineers as soon as possible.
|
||||
|
||||
All pull requests should be made to the `develop` branch of the project trees.
|
||||
|
||||
## Coding Standards
|
||||
|
||||
Please see the [Coding Standards](CODING STANDARDS.md) for information on how to layout code for this project.
|
||||
44
FindJeMalloc.cmake
Normal file
44
FindJeMalloc.cmake
Normal file
@@ -0,0 +1,44 @@
|
||||
# - Try to find jemalloc headers and libraries.
|
||||
#
|
||||
# Usage of this module as follows:
|
||||
#
|
||||
# find_package(JeMalloc)
|
||||
#
|
||||
# Variables used by this module, they can change the default behaviour and need
|
||||
# to be set before calling find_package:
|
||||
#
|
||||
# JEMALLOC_ROOT_DIR Set this variable to the root installation of
|
||||
# jemalloc if the module has problems finding
|
||||
# the proper installation path.
|
||||
#
|
||||
# Variables defined by this module:
|
||||
#
|
||||
# JEMALLOC_FOUND System has jemalloc libs/headers
|
||||
# JEMALLOC_LIBRARIES The jemalloc library/libraries
|
||||
# JEMALLOC_INCLUDE_DIR The location of jemalloc headers
|
||||
|
||||
find_path(JEMALLOC_ROOT_DIR
|
||||
NAMES include/jemalloc/jemalloc.h
|
||||
)
|
||||
|
||||
find_library(JEMALLOC_LIBRARIES
|
||||
NAMES jemalloc
|
||||
HINTS ${JEMALLOC_ROOT_DIR}/lib
|
||||
)
|
||||
|
||||
find_path(JEMALLOC_INCLUDE_DIR
|
||||
NAMES jemalloc/jemalloc.h
|
||||
HINTS ${JEMALLOC_ROOT_DIR}/include
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(JeMalloc DEFAULT_MSG
|
||||
JEMALLOC_LIBRARIES
|
||||
JEMALLOC_INCLUDE_DIR
|
||||
)
|
||||
|
||||
mark_as_advanced(
|
||||
JEMALLOC_ROOT_DIR
|
||||
JEMALLOC_LIBRARIES
|
||||
JEMALLOC_INCLUDE_DIR
|
||||
)
|
||||
8
README
8
README
@@ -1,9 +1,9 @@
|
||||
This is MariaDB ColumnStore 1.0.2
|
||||
MariaDB ColumnStore 1.0.2 is the development version of MariaDB ColumnStore.
|
||||
It is built by porting InfiniDB 4.6.2 on MariaDB 10.1.14 and adding entirely
|
||||
This is MariaDB ColumnStore 1.0.4
|
||||
MariaDB ColumnStore 1.0.4 is the development version of MariaDB ColumnStore.
|
||||
It is built by porting InfiniDB 4.6.2 on MariaDB 10.1.18 and adding entirely
|
||||
new features not found anywhere else.
|
||||
|
||||
MariaDB ColumnStore 1.0.2 is an Alpha release. This is the first MariaDB
|
||||
MariaDB ColumnStore 1.0.4 is an Beta release. This is the first MariaDB
|
||||
ColumnStore release, not all features planned for the MariaDB ColumnStore 1.0
|
||||
series are included in this release.
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#MariaDB ColumnStore Storage/Execution engine 1.0.2
|
||||
MariaDB ColumnStore 1.0.2 is the development version of MariaDB ColumnStore.
|
||||
It is built by porting InfiniDB 4.6.2 on MariaDB 10.1.14 and adding entirely
|
||||
#MariaDB ColumnStore Storage/Execution engine 1.0.4
|
||||
MariaDB ColumnStore 1.0.4 is the development version of MariaDB ColumnStore.
|
||||
It is built by porting InfiniDB 4.6.2 on MariaDB 10.1.18 and adding entirely
|
||||
new features not found anywhere else.
|
||||
|
||||
#MariaDB ColumnStore 1.0.2 is an Alpha release.
|
||||
#MariaDB ColumnStore 1.0.4 is an Beta release.
|
||||
This is the first MariaDB ColumnStore release, not all features planned for the MariaDB ColumnStore 1.0
|
||||
series are included in this release.
|
||||
|
||||
|
||||
@@ -284,12 +284,9 @@ rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/%{name}-%{version}.%{release}
|
||||
/usr/local/mariadb/columnstore/lib/libmysqlcl_idb.so.1.0.0
|
||||
/usr/local/mariadb/columnstore/lib/libquerystats.so.1.0.0
|
||||
/usr/local/mariadb/columnstore/lib/libwriteengineredistribute.so.1.0.0
|
||||
/usr/local/mariadb/columnstore/lib/libjemalloc.so.3.3.0
|
||||
/usr/local/mariadb/columnstore/lib/libidbdatafile.so.1.0.0
|
||||
#/usr/local/mariadb/columnstore/lib/hdfs-20.so
|
||||
#/usr/local/mariadb/columnstore/lib/hdfs-12.so
|
||||
#/usr/local/mariadb/columnstore/lib/libgcc_s.so.1
|
||||
#/usr/local/mariadb/columnstore/lib/libstdc++.so.6.0.14
|
||||
/usr/local/mariadb/columnstore/lib/libthrift.so.1.0.0
|
||||
/usr/local/mariadb/columnstore/lib/libquerytele.so.1.0.0
|
||||
|
||||
|
||||
@@ -328,7 +328,6 @@ rm -rf $RPM_BUILD_ROOT $RPM_BUILD_DIR/%{name}-%{version}.%{release}
|
||||
/usr/local/mariadb/columnstore/lib/libmysqlcl_idb.so.1.0.0
|
||||
/usr/local/mariadb/columnstore/lib/libquerystats.so.1.0.0
|
||||
/usr/local/mariadb/columnstore/lib/libwriteengineredistribute.so.1.0.0
|
||||
/usr/local/mariadb/columnstore/lib/libjemalloc.so.3.3.0
|
||||
/usr/local/mariadb/columnstore/lib/libidbdatafile.so.1.0.0
|
||||
/usr/local/mariadb/columnstore/lib/hdfs-20.so
|
||||
/usr/local/mariadb/columnstore/lib/hdfs-12.so
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -65,12 +65,6 @@ find ${prefix}/Calpont -type f | xargs chmod +r
|
||||
|
||||
mkdir -p ${prefix}/Calpont/data1/systemFiles/dbrm
|
||||
|
||||
if [ ! -e ${prefix}/Calpont/lib/libjemalloc.so ]; then
|
||||
pushd ${prefix}/Calpont/lib >/dev/null
|
||||
ln -s libjemalloc.so.1 libjemalloc.so
|
||||
popd >/dev/null
|
||||
fi
|
||||
|
||||
if [ ! -f ${prefix}/Calpont/etc/Columnstore.xml.rpmsave ]; then
|
||||
cp ${prefix}/Calpont/etc/Columnstore.xml.singleserver ${prefix}/Calpont/etc/Columnstore.xml.rpmsave
|
||||
fi
|
||||
|
||||
11
build/postInstall_libs.sh
Normal file
11
build/postInstall_libs.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
rpmmode=install
|
||||
if [ "$1" -eq "$1" 2> /dev/null ]; then
|
||||
if [ $1 -ne 1 ]; then
|
||||
rpmmode=upgrade
|
||||
fi
|
||||
fi
|
||||
|
||||
prefix=/usr/local
|
||||
|
||||
echo "MariaDB ColumnStore RPM install completed"
|
||||
|
||||
12
build/postInstall_platform.sh
Normal file
12
build/postInstall_platform.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
rpmmode=install
|
||||
if [ "$1" -eq "$1" 2> /dev/null ]; then
|
||||
if [ $1 -ne 1 ]; then
|
||||
rpmmode=upgrade
|
||||
fi
|
||||
fi
|
||||
|
||||
prefix=/usr/local
|
||||
|
||||
test -x /usr/local/mariadb/columnstore/bin/post-install && /usr/local/mariadb/columnstore/bin/post-install --prefix=$prefix --rpmmode=$rpmmode
|
||||
|
||||
echo "MariaDB ColumnStore RPM install completed"
|
||||
12
build/postInstall_storage_engine.sh
Normal file
12
build/postInstall_storage_engine.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
rpmmode=install
|
||||
if [ "$1" -eq "$1" 2> /dev/null ]; then
|
||||
if [ $1 -ne 1 ]; then
|
||||
rpmmode=upgrade
|
||||
fi
|
||||
fi
|
||||
|
||||
prefix=/usr/local
|
||||
|
||||
echo "MariaDB ColumnStore RPM install completed"
|
||||
|
||||
|
||||
11
build/preUn_libs.sh
Normal file
11
build/preUn_libs.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
rpmmode=upgrade
|
||||
if [ "$1" -eq "$1" 2> /dev/null ]; then
|
||||
if [ $1 -ne 1 ]; then
|
||||
rpmmode=erase
|
||||
fi
|
||||
else
|
||||
rpmmode=erase
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
15
build/preUn_platform.sh
Normal file
15
build/preUn_platform.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
rpmmode=upgrade
|
||||
if [ "$1" -eq "$1" 2> /dev/null ]; then
|
||||
if [ $1 -ne 1 ]; then
|
||||
rpmmode=erase
|
||||
fi
|
||||
else
|
||||
rpmmode=erase
|
||||
fi
|
||||
|
||||
if [ $rpmmode = erase ]; then
|
||||
test -x /usr/local/mariadb/columnstore/bin/pre-uninstall && /usr/local/mariadb/columnstore/bin/pre-uninstall
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
11
build/preUn_storage_engine.sh
Normal file
11
build/preUn_storage_engine.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
rpmmode=upgrade
|
||||
if [ "$1" -eq "$1" 2> /dev/null ]; then
|
||||
if [ $1 -ne 1 ]; then
|
||||
rpmmode=erase
|
||||
fi
|
||||
else
|
||||
rpmmode=erase
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
version=1.0.3
|
||||
version=1.0.4
|
||||
release=1
|
||||
|
||||
|
||||
2
build/releasenum.in
Normal file
2
build/releasenum.in
Normal file
@@ -0,0 +1,2 @@
|
||||
version=@CPACK_RPM_PACKAGE_VERSION@
|
||||
release=@CPACK_RPM_PACKAGE_RELEASE@
|
||||
@@ -130,7 +130,6 @@ if [ $? -ne 0 -o ! -x $prefix/Calpont/bin/PrimProc ]; then
|
||||
fi
|
||||
|
||||
cp dbcon/mysql/my.cnf $prefix/Calpont/mysql
|
||||
cp utils/jemalloc/libjemalloc.so.3.3.0 $prefix/Calpont/lib/libjemalloc.so
|
||||
|
||||
echo "InfiniDB binaries and libs are in $prefix/Calpont"
|
||||
|
||||
|
||||
334
cpackEngineRPM.cmake
Normal file
334
cpackEngineRPM.cmake
Normal file
@@ -0,0 +1,334 @@
|
||||
IF(RPM)
|
||||
|
||||
SET(CMAKE_INSTALL_PREFIX ${INSTALL_ENGINE})
|
||||
|
||||
SET(CPACK_GENERATOR "RPM")
|
||||
SET(CPACK_RPM_PACKAGE_DEBUG 1)
|
||||
SET(CPACK_PACKAGING_INSTALL_PREFIX ${INSTALL_ENGINE})
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
|
||||
|
||||
SET(CPACK_RPM_COMPONENT_INSTALL ON)
|
||||
|
||||
SET(CPACK_COMPONENTS_ALL platform libs storage-engine)
|
||||
|
||||
SET(CPACK_PACKAGE_NAME "mariadb-columnstore")
|
||||
SET(ENGINE_ARCH "x86_64")
|
||||
|
||||
IF (NOT CPACK_RPM_PACKAGE_VERSION)
|
||||
SET (CPACK_RPM_PACKAGE_VERSION "1.0.0")
|
||||
ENDIF()
|
||||
IF (NOT CPACK_RPM_PACKAGE_RELEASE)
|
||||
SET (CPACK_RPM_PACKAGE_RELEASE "0")
|
||||
ENDIF()
|
||||
|
||||
SET(CPACK_RPM_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
|
||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${ENGINE_ARCH}-${RPM}")
|
||||
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MariaDB Columnstore: a very fast and robust SQL database server")
|
||||
SET(CPACK_PACKAGE_URL "http://mariadb.org")
|
||||
|
||||
SET(CPACK_PACKAGE_SUMMARY "MariaDB-Columnstore software")
|
||||
SET(CPACK_PACKAGE_VENDOR "MariaDB Corporation Ab")
|
||||
SET(CPACK_PACKAGE_LICENSE "Copyright (c) 2016 MariaDB Corporation Ab., all rights reserved; redistributable under the terms of the GPL, see the file COPYING for details.")
|
||||
|
||||
|
||||
SET(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
|
||||
SET(CPACK_RPM_PACKAGE_RELOCATABLE FALSE)
|
||||
SET(CPACK_PACKAGE_RELOCATABLE FALSE)
|
||||
SET(CPACK_RPM_PACKAGE_GROUP "Applications/Databases")
|
||||
SET(CPACK_RPM_PACKAGE_URL ${CPACK_PACKAGE_URL})
|
||||
SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_SUMMARY})
|
||||
SET(CPACK_RPM_PACKAGE_VENDOR ${CPACK_PACKAGE_VENDOR})
|
||||
SET(CPACK_RPM_PACKAGE_LICENSE ${CPACK_PACKAGE_LICENSE})
|
||||
|
||||
SET(CPACK_RPM_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}
|
||||
|
||||
It is GPL v2 licensed, which means you can use the it free of charge under the
|
||||
conditions of the GNU General Public License Version 2 (http://www.gnu.org/licenses/).
|
||||
|
||||
MariaDB documentation can be found at https://mariadb.com/kb
|
||||
MariaDB bug reports should be submitted through https://jira.mariadb.org
|
||||
|
||||
")
|
||||
|
||||
SET(CPACK_RPM_platform_PACKAGE_DESCRIPTION "MariaDB-Columnstore binary files")
|
||||
SET(CPACK_RPM_platform_PACKAGE_SUMMARY "MariaDB-Columnstore software binaries")
|
||||
SET(CPACK_RPM_platform_PACKAGE_GROUP "Applications")
|
||||
|
||||
SET(CPACK_RPM_libs_PACKAGE_DESCRIPTION "MariaDB-Columnstore libraries")
|
||||
SET(CPACK_RPM_libs_PACKAGE_SUMMARY "MariaDB-Columnstore software libraries")
|
||||
|
||||
SET(CPACK_RPM_storage-engine_PACKAGE_DESCRIPTION "MariaDB Columnstore connector binary files")
|
||||
SET(CPACK_RPM_storage-engine_PACKAGE_SUMMARY "MariaDB-Columnstore software MariaDB connector")
|
||||
SET(CPACK_RPM_storage-engine_PACKAGE_GROUP "Applications")
|
||||
|
||||
# "set/append array" - append a set of strings, separated by a space
|
||||
MACRO(SETA var)
|
||||
FOREACH(v ${ARGN})
|
||||
SET(${var} "${${var}} ${v}")
|
||||
ENDFOREACH()
|
||||
ENDMACRO(SETA)
|
||||
|
||||
SETA(CPACK_RPM_libs_PACKAGE_PROVIDES "mariadb-columnstore-libs")
|
||||
SETA(CPACK_RPM_platform_PACKAGE_PROVIDES "mariadb-columnstore-platform")
|
||||
SETA(CPACK_RPM_storage-engine_PACKAGE_PROVIDES "mariadb-columnstore-storage-engine")
|
||||
|
||||
# Boost is a source build in CentOS 6 so don't require it as a package
|
||||
SET(REDHAT_VERSION_NUMBER OFF)
|
||||
IF (EXISTS "/etc/redhat-release")
|
||||
file (READ "/etc/redhat-release" REDHAT_VERSION)
|
||||
string(REGEX MATCH "release ([0-9]+)" CENTOS "${REDHAT_VERSION}")
|
||||
set(REDHAT_VERSION_NUMBER "${CMAKE_MATCH_1}")
|
||||
ENDIF ()
|
||||
if (${REDHAT_VERSION_NUMBER} EQUAL 6)
|
||||
SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "mariadb-columnstore-libs")
|
||||
# Disable auto require as this will also try to pull Boost via RPM
|
||||
SET(CPACK_RPM_PACKAGE_AUTOREQPROV " no")
|
||||
else ()
|
||||
SETA(CPACK_RPM_platform_PACKAGE_REQUIRES "expect" "boost >= 1.53.0" "mariadb-columnstore-libs")
|
||||
endif()
|
||||
|
||||
SETA(CPACK_RPM_storage-engine_PACKAGE_REQUIRES "mariadb-columnstore-libs")
|
||||
|
||||
SET(CPACK_RPM_platform_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_platform.sh)
|
||||
SET(CPACK_RPM_libs_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_libs.sh)
|
||||
SET(CPACK_RPM_storage-engine_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_storage_engine.sh)
|
||||
|
||||
SET(CPACK_RPM_platform_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preUn_platform.sh)
|
||||
SET(CPACK_RPM_libs_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preUn_libs.sh)
|
||||
SET(CPACK_RPM_storage-engine_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preUn_storage_engine.sh)
|
||||
|
||||
SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}
|
||||
%define ignore \#
|
||||
")
|
||||
|
||||
SET(ignored
|
||||
"%ignore /usr"
|
||||
"%ignore /usr/local"
|
||||
)
|
||||
|
||||
#SET(CPACK_RPM_SPEC_MORE_DEFINE "
|
||||
#%define _prefix ${CMAKE_INSTALL_PREFIX}
|
||||
#")
|
||||
|
||||
SET(CPACK_RPM_platform_USER_FILELIST
|
||||
"/usr/local/mariadb/columnstore/bin/DDLProc"
|
||||
"/usr/local/mariadb/columnstore/bin/ExeMgr"
|
||||
"/usr/local/mariadb/columnstore/bin/ProcMgr"
|
||||
"/usr/local/mariadb/columnstore/bin/ProcMon"
|
||||
"/usr/local/mariadb/columnstore/bin/DMLProc"
|
||||
"/usr/local/mariadb/columnstore/bin/WriteEngineServer"
|
||||
"/usr/local/mariadb/columnstore/bin/cpimport"
|
||||
"/usr/local/mariadb/columnstore/bin/post-install"
|
||||
"/usr/local/mariadb/columnstore/bin/post-mysql-install"
|
||||
"/usr/local/mariadb/columnstore/bin/post-mysqld-install"
|
||||
"/usr/local/mariadb/columnstore/bin/pre-uninstall"
|
||||
"/usr/local/mariadb/columnstore/bin/PrimProc"
|
||||
"/usr/local/mariadb/columnstore/bin/DecomSvr"
|
||||
"/usr/local/mariadb/columnstore/bin/upgrade-columnstore.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/run.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstore"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstoreSyslog"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstoreSyslog7"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstoreSyslog-ng"
|
||||
"/usr/local/mariadb/columnstore/bin/syslogSetup.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/cplogger"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstore.def"
|
||||
"/usr/local/mariadb/columnstore/bin/dbbuilder"
|
||||
"/usr/local/mariadb/columnstore/bin/cpimport.bin"
|
||||
"/usr/local/mariadb/columnstore/bin/load_brm"
|
||||
"/usr/local/mariadb/columnstore/bin/save_brm"
|
||||
"/usr/local/mariadb/columnstore/bin/dbrmctl"
|
||||
"/usr/local/mariadb/columnstore/bin/controllernode"
|
||||
"/usr/local/mariadb/columnstore/bin/reset_locks"
|
||||
"/usr/local/mariadb/columnstore/bin/workernode"
|
||||
"/usr/local/mariadb/columnstore/bin/colxml"
|
||||
"/usr/local/mariadb/columnstore/bin/clearShm"
|
||||
"/usr/local/mariadb/columnstore/bin/viewtablelock"
|
||||
"/usr/local/mariadb/columnstore/bin/cleartablelock"
|
||||
"/usr/local/mariadb/columnstore/bin/mcsadmin"
|
||||
"/usr/local/mariadb/columnstore/bin/remote_command.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/postConfigure"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstoreLogRotate"
|
||||
"/usr/local/mariadb/columnstore/bin/transactionLog"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstoreDBWrite"
|
||||
"/usr/local/mariadb/columnstore/bin/transactionLogArchiver.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/installer"
|
||||
"/usr/local/mariadb/columnstore/bin/module_installer.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/user_installer.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/performance_installer.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/startupTests.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/os_check.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/remote_scp_put.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/remotessh.exp"
|
||||
"/usr/local/mariadb/columnstore/bin/ServerMonitor"
|
||||
"/usr/local/mariadb/columnstore/bin/master-rep-columnstore.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/slave-rep-columnstore.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/rsync.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstoreSupport"
|
||||
"/usr/local/mariadb/columnstore/bin/hardwareReport.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/softwareReport.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/configReport.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/logReport.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/bulklogReport.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/resourceReport.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/hadoopReport.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/alarmReport.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/amazonInstaller"
|
||||
"/usr/local/mariadb/columnstore/bin/remote_command_verify.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/disable-rep-columnstore.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstore.service"
|
||||
"/usr/local/mariadb/columnstore/etc/MessageFile.txt"
|
||||
"/usr/local/mariadb/columnstore/etc/ErrorMessage.txt"
|
||||
"/usr/local/mariadb/columnstore/local/module"
|
||||
"/usr/local/mariadb/columnstore/releasenum"
|
||||
"/usr/local/mariadb/columnstore/bin/rollback"
|
||||
"/usr/local/mariadb/columnstore/bin/editem"
|
||||
"/usr/local/mariadb/columnstore/bin/getConfig"
|
||||
"/usr/local/mariadb/columnstore/bin/setConfig"
|
||||
"/usr/local/mariadb/columnstore/bin/setenv-hdfs-12"
|
||||
"/usr/local/mariadb/columnstore/bin/setenv-hdfs-20"
|
||||
"/usr/local/mariadb/columnstore/bin/configxml.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/remote_scp_get.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstoreAlias"
|
||||
"/usr/local/mariadb/columnstore/bin/autoConfigure"
|
||||
"/usr/local/mariadb/columnstore/bin/ddlcleanup"
|
||||
"/usr/local/mariadb/columnstore/bin/idbmeminfo"
|
||||
"/usr/local/mariadb/columnstore/bin/IDBInstanceCmds.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/IDBVolumeCmds.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/binary_installer.sh"
|
||||
"/usr/local/mariadb/columnstore/bin/myCnf-include-args.text"
|
||||
"/usr/local/mariadb/columnstore/bin/myCnf-exclude-args.text"
|
||||
"/usr/local/mariadb/columnstore/bin/mycnfUpgrade"
|
||||
"/usr/local/mariadb/columnstore/bin/getMySQLpw"
|
||||
"/usr/local/mariadb/columnstore/bin/columnstore.conf"
|
||||
"/usr/local/mariadb/columnstore/post/functions"
|
||||
"/usr/local/mariadb/columnstore/post/test-001.sh"
|
||||
"/usr/local/mariadb/columnstore/post/test-002.sh"
|
||||
"/usr/local/mariadb/columnstore/post/test-003.sh"
|
||||
"/usr/local/mariadb/columnstore/post/test-004.sh"
|
||||
${ignored})
|
||||
|
||||
SET(CPACK_RPM_libs_USER_FILELIST
|
||||
"/usr/local/mariadb/columnstore/lib/libconfigcpp.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libconfigcpp.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libconfigcpp.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libddlpackageproc.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libddlpackageproc.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libddlpackageproc.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libddlpackage.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libddlpackage.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libddlpackage.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libdmlpackageproc.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libdmlpackageproc.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libdmlpackageproc.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libdmlpackage.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libdmlpackage.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libdmlpackage.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libexecplan.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libexecplan.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libexecplan.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libfuncexp.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libfuncexp.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libfuncexp.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libudfsdk.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libudfsdk.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libudfsdk.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libjoblist.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libjoblist.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libjoblist.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libjoiner.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libjoiner.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libjoiner.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libloggingcpp.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libloggingcpp.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libloggingcpp.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libmessageqcpp.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libmessageqcpp.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libmessageqcpp.so"
|
||||
"/usr/local/mariadb/columnstore/lib/liboamcpp.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/liboamcpp.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/liboamcpp.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libalarmmanager.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libalarmmanager.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libalarmmanager.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libthreadpool.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libthreadpool.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libthreadpool.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libwindowfunction.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libwindowfunction.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libwindowfunction.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libwriteengine.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libwriteengine.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libwriteengine.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libwriteengineclient.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libwriteengineclient.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libwriteengineclient.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libbrm.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libbrm.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libbrm.so"
|
||||
"/usr/local/mariadb/columnstore/lib/librwlock.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/librwlock.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/librwlock.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libdataconvert.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libdataconvert.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libdataconvert.so"
|
||||
"/usr/local/mariadb/columnstore/lib/librowgroup.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/librowgroup.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/librowgroup.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libcacheutils.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libcacheutils.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libcacheutils.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libcommon.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libcommon.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libcommon.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libcompress.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libcompress.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libcompress.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libddlcleanuputil.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libddlcleanuputil.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libddlcleanuputil.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libbatchloader.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libbatchloader.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libbatchloader.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libmysqlcl_idb.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libmysqlcl_idb.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libmysqlcl_idb.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libquerystats.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libquerystats.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libquerystats.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libwriteengineredistribute.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libwriteengineredistribute.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libwriteengineredistribute.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libidbdatafile.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libidbdatafile.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libidbdatafile.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libthrift.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libthrift.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libthrift.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libquerytele.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libquerytele.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libquerytele.so"
|
||||
${ignored})
|
||||
|
||||
SET(CPACK_RPM_storage-engine_USER_FILELIST
|
||||
"/usr/local/mariadb/columnstore/lib/libcalmysql.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libcalmysql.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libcalmysql.so"
|
||||
"/usr/local/mariadb/columnstore/lib/libudf_mysql.so.1.0.0"
|
||||
"/usr/local/mariadb/columnstore/lib/libudf_mysql.so.1"
|
||||
"/usr/local/mariadb/columnstore/lib/libudf_mysql.so"
|
||||
"/usr/local/mariadb/columnstore/mysql/mysql-Columnstore"
|
||||
"/usr/local/mariadb/columnstore/mysql/install_calpont_mysql.sh"
|
||||
"/usr/local/mariadb/columnstore/mysql/syscatalog_mysql.sql"
|
||||
"/usr/local/mariadb/columnstore/mysql/dumpcat_mysql.sql"
|
||||
"/usr/local/mariadb/columnstore/mysql/dumpcat.pl"
|
||||
"/usr/local/mariadb/columnstore/mysql/calsetuserpriority.sql"
|
||||
"/usr/local/mariadb/columnstore/mysql/calremoveuserpriority.sql"
|
||||
"/usr/local/mariadb/columnstore/mysql/calshowprocesslist.sql"
|
||||
${ignored})
|
||||
|
||||
|
||||
INCLUDE (CPack)
|
||||
|
||||
ENDIF()
|
||||
@@ -2,7 +2,7 @@
|
||||
include_directories( ${ENGINE_COMMON_INCLUDES} )
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT ddl-gram.cpp ddl-scan.cpp
|
||||
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/ddl-gram.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ddl-scan.cpp
|
||||
COMMAND ./ddl-gram.sh ${BISON_EXECUTABLE}
|
||||
COMMAND ./ddl-scan.sh ${LEX_EXECUTABLE}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
@@ -32,9 +32,9 @@ set(ddlpackage_LIB_SRCS
|
||||
|
||||
add_library(ddlpackage SHARED ${ddlpackage_LIB_SRCS})
|
||||
|
||||
add_dependencies(ddlpackage ddl-gram.cpp ddl-scan.cpp)
|
||||
add_dependencies(ddlpackage ${CMAKE_CURRENT_SOURCE_DIR}/ddl-gram.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ddl-scan.cpp)
|
||||
|
||||
set_target_properties(ddlpackage PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
|
||||
install(TARGETS ddlpackage DESTINATION ${ENGINE_LIBDIR})
|
||||
install(TARGETS ddlpackage DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ void scanner_init(const char* str, yyscan_t yyscanner)
|
||||
memcpy(pScanData->scanbuf, str, slen);
|
||||
pScanData->scanbuf[slen] = pScanData->scanbuf[slen + 1] = YY_END_OF_BUFFER_CHAR;
|
||||
pScanData->scanbufhandle = (void*)yy_scan_buffer(pScanData->scanbuf, slen + 2, yyscanner);
|
||||
std::cout << "scanner_init " << (uint64_t)pScanData->scanbufhandle << std::endl;
|
||||
//std::cout << "scanner_init " << (uint64_t)pScanData->scanbufhandle << std::endl;
|
||||
|
||||
BEGIN(INITIAL);
|
||||
|
||||
@@ -224,7 +224,7 @@ void scanner_finish(yyscan_t yyscanner)
|
||||
{
|
||||
char* str;
|
||||
scan_data* pScanData = (scan_data*)ddlget_extra(yyscanner);
|
||||
std::cout << "scanner_finish " << (uint64_t)pScanData->scanbufhandle << std::endl;
|
||||
//std::cout << "scanner_finish " << (uint64_t)pScanData->scanbufhandle << std::endl;
|
||||
yy_delete_buffer((YY_BUFFER_STATE)pScanData->scanbufhandle, yyscanner);
|
||||
free(pScanData->scanbuf);
|
||||
unsigned int i;
|
||||
|
||||
@@ -14,9 +14,9 @@ set(ddlpackageproc_LIB_SRCS
|
||||
|
||||
add_library(ddlpackageproc SHARED ${ddlpackageproc_LIB_SRCS})
|
||||
|
||||
add_dependencies(ddlpackageproc libnetsnmpmibs)
|
||||
target_link_libraries(ddlpackageproc ${NETSNMP_LIBRARIES})
|
||||
|
||||
set_target_properties(ddlpackageproc PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
|
||||
install(TARGETS ddlpackageproc DESTINATION ${ENGINE_LIBDIR})
|
||||
install(TARGETS ddlpackageproc DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
include_directories( ${ENGINE_COMMON_INCLUDES} )
|
||||
|
||||
ADD_CUSTOM_COMMAND(
|
||||
OUTPUT dml-gram.cpp dml-scan.cpp
|
||||
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/dml-gram.cpp ${CMAKE_CURRENT_SOURCE_DIR}/dml-scan.cpp
|
||||
COMMAND ./dml-gram.sh ${BISON_EXECUTABLE}
|
||||
COMMAND ./dml-scan.sh ${LEX_EXECUTABLE}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
@@ -32,9 +32,9 @@ set(dmlpackage_LIB_SRCS
|
||||
|
||||
add_library(dmlpackage SHARED ${dmlpackage_LIB_SRCS})
|
||||
|
||||
add_dependencies(dmlpackage dml-gram.cpp dml-scan.cpp)
|
||||
add_dependencies(dmlpackage ${CMAKE_CURRENT_SOURCE_DIR}/dml-gram.cpp ${CMAKE_CURRENT_SOURCE_DIR}/dml-scan.cpp)
|
||||
|
||||
set_target_properties(dmlpackage PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
|
||||
install(TARGETS dmlpackage DESTINATION ${ENGINE_LIBDIR})
|
||||
install(TARGETS dmlpackage DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
|
||||
|
||||
|
||||
@@ -15,10 +15,10 @@ set(dmlpackageproc_LIB_SRCS
|
||||
|
||||
add_library(dmlpackageproc SHARED ${dmlpackageproc_LIB_SRCS})
|
||||
|
||||
add_dependencies(dmlpackageproc libnetsnmpmibs)
|
||||
target_link_libraries(dmlpackageproc ${NETSNMP_LIBRARIES})
|
||||
|
||||
set_target_properties(dmlpackageproc PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
|
||||
install(TARGETS dmlpackageproc DESTINATION ${ENGINE_LIBDIR})
|
||||
install(TARGETS dmlpackageproc DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 2014 InfiniDB, Inc.
|
||||
* Copyright (C) 2016 MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
@@ -35,8 +36,8 @@
|
||||
#include "we_messages.h"
|
||||
#include "we_ddlcommandclient.h"
|
||||
#include "oamcache.h"
|
||||
#include "snmpglobal.h"
|
||||
#include "snmpmanager.h"
|
||||
#include "alarmglobal.h"
|
||||
#include "alarmmanager.h"
|
||||
#include "liboamcpp.h"
|
||||
using namespace std;
|
||||
using namespace WriteEngine;
|
||||
|
||||
@@ -45,9 +45,9 @@ set(execplan_LIB_SRCS
|
||||
|
||||
add_library(execplan SHARED ${execplan_LIB_SRCS})
|
||||
|
||||
add_dependencies(execplan libnetsnmpmibs)
|
||||
target_link_libraries(execplan ${NETSNMP_LIBRARIES})
|
||||
|
||||
set_target_properties(execplan PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
|
||||
install(TARGETS execplan DESTINATION ${ENGINE_LIBDIR})
|
||||
install(TARGETS execplan DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "calpontsystemcatalog.h"
|
||||
#include "exceptclasses.h"
|
||||
#include "dataconvert.h"
|
||||
|
||||
namespace messageqcpp {
|
||||
class ByteStream;
|
||||
}
|
||||
@@ -483,8 +482,24 @@ inline const std::string& TreeNode::getStrVal()
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(tmp, 312, "%e", fResult.floatVal);
|
||||
fResult.strVal = tmp;
|
||||
// MCOL-299 Print scientific with 5 mantissa and no + sign for exponent
|
||||
int exponent = (int)floor(log10( fabs(fResult.floatVal))); // This will round down the exponent
|
||||
double base = fResult.floatVal * pow(10, -1.0*exponent);
|
||||
if (std::isnan(exponent) || std::isnan(base))
|
||||
{
|
||||
snprintf(tmp, 312, "%f", fResult.floatVal);
|
||||
fResult.strVal = removeTrailing0(tmp, 312);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(tmp, 312, "%.5f", base);
|
||||
fResult.strVal = removeTrailing0(tmp, 312);
|
||||
snprintf(tmp, 312, "e%02d", exponent);
|
||||
fResult.strVal += tmp;
|
||||
}
|
||||
|
||||
// snprintf(tmp, 312, "%e.5", fResult.floatVal);
|
||||
// fResult.strVal = tmp;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -499,8 +514,23 @@ inline const std::string& TreeNode::getStrVal()
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(tmp, 312, "%e", fResult.doubleVal);
|
||||
fResult.strVal = tmp;
|
||||
// MCOL-299 Print scientific with 9 mantissa and no + sign for exponent
|
||||
int exponent = (int)floor(log10( fabs(fResult.doubleVal))); // This will round down the exponent
|
||||
double base = fResult.doubleVal * pow(10, -1.0*exponent);
|
||||
if (std::isnan(exponent) || std::isnan(base))
|
||||
{
|
||||
snprintf(tmp, 312, "%f", fResult.doubleVal);
|
||||
fResult.strVal = removeTrailing0(tmp, 312);
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(tmp, 312, "%.9f", base);
|
||||
fResult.strVal = removeTrailing0(tmp, 312);
|
||||
snprintf(tmp, 312, "e%02d", exponent);
|
||||
fResult.strVal += tmp;
|
||||
}
|
||||
// snprintf(tmp, 312, "%e", fResult.doubleVal);
|
||||
// fResult.strVal = tmp;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -61,10 +61,10 @@ set(joblist_LIB_SRCS
|
||||
|
||||
add_library(joblist SHARED ${joblist_LIB_SRCS})
|
||||
|
||||
add_dependencies(joblist libnetsnmpmibs)
|
||||
target_link_libraries(joblist ${NETSNMP_LIBRARIES})
|
||||
|
||||
set_target_properties(joblist PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
|
||||
install(TARGETS joblist DESTINATION ${ENGINE_LIBDIR})
|
||||
install(TARGETS joblist DESTINATION ${ENGINE_LIBDIR} COMPONENT libs)
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 2014 InfiniDB, Inc.
|
||||
* Copyright (C) 2016 MariaDB Corporation.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
@@ -58,8 +59,8 @@ using namespace config;
|
||||
using namespace logging;
|
||||
|
||||
#include "liboamcpp.h"
|
||||
#include "snmpmanager.h"
|
||||
using namespace snmpmanager;
|
||||
#include "alarmmanager.h"
|
||||
using namespace alarmmanager;
|
||||
using namespace oam;
|
||||
|
||||
#include "jobstep.h"
|
||||
@@ -371,7 +372,7 @@ Error:
|
||||
//cout << "PMCOUNT=" << pmCount << endl;
|
||||
|
||||
// send alarm & log it
|
||||
SNMPManager alarmMgr;
|
||||
ALARMManager alarmMgr;
|
||||
string alarmItem = client->addr2String();
|
||||
alarmItem.append(" PrimProc");
|
||||
alarmMgr.sendAlarmReport(alarmItem.c_str(), oam::CONN_FAILURE, SET);
|
||||
@@ -895,7 +896,7 @@ int DistributedEngineComm::writeToClient(size_t index, const ByteStream& bs, uin
|
||||
}
|
||||
|
||||
// send alarm
|
||||
SNMPManager alarmMgr;
|
||||
ALARMManager alarmMgr;
|
||||
string alarmItem("UNKNOWN");
|
||||
if (index < fPmConnections.size())
|
||||
{
|
||||
|
||||
@@ -202,6 +202,7 @@
|
||||
<F N="batchprimitiveprocessor-jl.cpp"/>
|
||||
<F N="columncommand-jl.cpp"/>
|
||||
<F N="command-jl.cpp"/>
|
||||
<F N="crossenginestep.cpp"/>
|
||||
<F N="dictstep-jl.cpp"/>
|
||||
<F N="diskjoinstep.cpp"/>
|
||||
<F N="distributedenginecomm.cpp"/>
|
||||
@@ -257,6 +258,7 @@
|
||||
<F N="columncommand-jl.h"/>
|
||||
<F N="command-jl.h"/>
|
||||
<F N="constantdatalist.h"/>
|
||||
<F N="crossenginestep.h"/>
|
||||
<F N="datalist.h"/>
|
||||
<F N="datalistimpl.h"/>
|
||||
<F N="dictstep-jl.h"/>
|
||||
|
||||
@@ -348,10 +348,18 @@ void TupleAggregateStep::doThreadedSecondPhaseAggregate(uint32_t threadID)
|
||||
{
|
||||
if (!bucketDone[c] && fAgg_mutex[c]->try_lock())
|
||||
{
|
||||
if (multiDist)
|
||||
dynamic_cast<RowAggregationMultiDistinct*>(fAggregators[c].get())->doDistinctAggregation_rowVec(rowBucketVecs[c]);
|
||||
else
|
||||
dynamic_cast<RowAggregationDistinct*>(fAggregators[c].get())->doDistinctAggregation_rowVec(rowBucketVecs[c][0]);
|
||||
try
|
||||
{
|
||||
if (multiDist)
|
||||
dynamic_cast<RowAggregationMultiDistinct*>(fAggregators[c].get())->doDistinctAggregation_rowVec(rowBucketVecs[c]);
|
||||
else
|
||||
dynamic_cast<RowAggregationDistinct*>(fAggregators[c].get())->doDistinctAggregation_rowVec(rowBucketVecs[c][0]);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
fAgg_mutex[c]->unlock();
|
||||
throw;
|
||||
}
|
||||
fAgg_mutex[c]->unlock();
|
||||
bucketDone[c] = true;
|
||||
rowBucketVecs[c][0].clear();
|
||||
@@ -4301,11 +4309,19 @@ void TupleAggregateStep::threadedAggregateRowGroups(uint32_t threadID)
|
||||
{
|
||||
if (!fEndOfResult && !bucketDone[c] && fAgg_mutex[c]->try_lock())
|
||||
{
|
||||
didWork = true;
|
||||
if (multiDist)
|
||||
dynamic_cast<RowAggregationMultiDistinct*>(fAggregators[c].get())->addRowGroup(&fRowGroupIns[threadID], rowBucketVecs[c]);
|
||||
else
|
||||
fAggregators[c]->addRowGroup(&fRowGroupIns[threadID], rowBucketVecs[c][0]);
|
||||
try
|
||||
{
|
||||
didWork = true;
|
||||
if (multiDist)
|
||||
dynamic_cast<RowAggregationMultiDistinct*>(fAggregators[c].get())->addRowGroup(&fRowGroupIns[threadID], rowBucketVecs[c]);
|
||||
else
|
||||
fAggregators[c]->addRowGroup(&fRowGroupIns[threadID], rowBucketVecs[c][0]);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
fAgg_mutex[c]->unlock();
|
||||
throw;
|
||||
}
|
||||
fAgg_mutex[c]->unlock();
|
||||
rowBucketVecs[c][0].clear();
|
||||
bucketDone[c] = true;
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
|
||||
include_directories( ${ENGINE_COMMON_INCLUDES}
|
||||
/usr/include/libxml2
|
||||
../../../mysql/include
|
||||
../../../mysql/sql
|
||||
../../../mysql/regex )
|
||||
/usr/include/libxml2 )
|
||||
|
||||
|
||||
SET ( libcalmysql_SRCS
|
||||
@@ -28,22 +25,20 @@ set_source_files_properties(ha_calpont.cpp PROPERTIES COMPILE_FLAGS "-fno-rtti -
|
||||
|
||||
add_library(calmysql SHARED ${libcalmysql_SRCS})
|
||||
|
||||
add_dependencies(calmysql libnetsnmpmibs)
|
||||
|
||||
target_link_libraries(calmysql ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} threadpool)
|
||||
target_link_libraries(calmysql ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool)
|
||||
|
||||
set_target_properties(calmysql PROPERTIES VERSION 1.0.0 SOVERSION 1)
|
||||
|
||||
install(TARGETS calmysql DESTINATION ${ENGINE_LIBDIR})
|
||||
install(TARGETS calmysql DESTINATION ${ENGINE_LIBDIR} COMPONENT storage-engine)
|
||||
install(FILES syscatalog_mysql.sql
|
||||
dumpcat_mysql.sql
|
||||
calsetuserpriority.sql
|
||||
calremoveuserpriority.sql
|
||||
calshowprocesslist.sql
|
||||
my.cnf
|
||||
DESTINATION ${ENGINE_MYSQLDIR})
|
||||
DESTINATION ${ENGINE_MYSQLDIR} COMPONENT storage-engine)
|
||||
install(PROGRAMS install_calpont_mysql.sh mysql-Columnstore dumpcat.pl
|
||||
DESTINATION ${ENGINE_MYSQLDIR})
|
||||
DESTINATION ${ENGINE_MYSQLDIR} COMPONENT storage-engine)
|
||||
|
||||
|
||||
#AM_CPPFLAGS = $(idb_common_includes) $(idb_cppflags)
|
||||
|
||||
@@ -774,7 +774,10 @@ int ha_calpont_impl_write_batch_row_(uchar *buf, TABLE* table, cal_impl_if::cal_
|
||||
if (nullVal && (ci.columnTypes[colpos].constraintType != CalpontSystemCatalog::NOTNULL_CONSTRAINT))
|
||||
{
|
||||
fprintf(ci.filePtr, "%c", ci.delimiter);
|
||||
buf += 8;
|
||||
if (table->field[colpos]->real_type() == MYSQL_TYPE_DATETIME2)
|
||||
buf += table->field[colpos]->pack_length();
|
||||
else
|
||||
buf += 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/** @file */
|
||||
|
||||
//#define DEBUG_WALK_COND
|
||||
#include <my_config.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
@@ -222,7 +222,7 @@ void debug_walk(const Item *item, void *arg)
|
||||
{
|
||||
Item_string* isp = (Item_string*)item;
|
||||
String val, *str = isp->val_str(&val);
|
||||
cout << "STRING_ITEM: >" << str->ptr() << '<' << endl;
|
||||
cout << "STRING_ITEM: >" << str->c_ptr() << '<' << endl;
|
||||
break;
|
||||
}
|
||||
case Item::REAL_ITEM:
|
||||
@@ -523,36 +523,39 @@ void debug_walk(const Item *item, void *arg)
|
||||
case Item::CACHE_ITEM:
|
||||
{
|
||||
Item_cache* isp = (Item_cache*)item;
|
||||
String val, *str = NULL;
|
||||
// MCOL-46 isp->val_str() can cause a call to execute a subquery. We're not set up
|
||||
// to execute yet.
|
||||
// String val, *str = NULL;
|
||||
switch (item->result_type())
|
||||
{
|
||||
case STRING_RESULT:
|
||||
str = isp->val_str(&val);
|
||||
// str = isp->val_str(&val);
|
||||
cout << "CACHE_STRING_ITEM";
|
||||
break;
|
||||
case REAL_RESULT:
|
||||
str = isp->val_str(&val);
|
||||
// str = isp->val_str(&val);
|
||||
cout << "CACHE_REAL_ITEM";
|
||||
break;
|
||||
case INT_RESULT:
|
||||
str = isp->val_str(&val);
|
||||
// str = isp->val_str(&val);
|
||||
cout << "CACHE_INT_ITEM";
|
||||
break;
|
||||
case ROW_RESULT:
|
||||
cout << "CACHE_ROW_ITEM";
|
||||
// cout << "CACHE_ROW_ITEM";
|
||||
break;
|
||||
case DECIMAL_RESULT:
|
||||
str = isp->val_str(&val);
|
||||
// str = isp->val_str(&val);
|
||||
cout << "CACHE_DECIMAL_ITEM";
|
||||
break;
|
||||
default:
|
||||
cout << "CACHE_UNKNOWN_ITEM";
|
||||
break;
|
||||
}
|
||||
if (str)
|
||||
cout << ": (" << str->ptr() << ')' << endl;
|
||||
else
|
||||
cout << ": <NULL>" << endl;
|
||||
// if (str)
|
||||
// cout << ": (" << str->c_ptr() << ')' << endl;
|
||||
// else
|
||||
// cout << ": <NULL>" << endl;
|
||||
cout << endl;
|
||||
break;
|
||||
}
|
||||
case Item::DATE_ITEM:
|
||||
@@ -1018,9 +1021,9 @@ bool buildPredicateItem(Item_func* ifp, gp_walk_info* gwip)
|
||||
// @bug5811. This filter string is for cross engine to use.
|
||||
// Use real table name.
|
||||
ifp->print(&str, QT_INFINIDB_DERIVED);
|
||||
//IDEBUG(cout << str.ptr() << endl);
|
||||
//IDEBUG(cout << str.c_ptr() << endl);
|
||||
if (str.ptr())
|
||||
cf->data(str.ptr());
|
||||
cf->data(str.c_ptr());
|
||||
ParseTree* ptp = new ParseTree(cf);
|
||||
gwip->ptWorkStack.push(ptp);
|
||||
return true;
|
||||
@@ -1099,7 +1102,7 @@ bool buildPredicateItem(Item_func* ifp, gp_walk_info* gwip)
|
||||
ifp->print(&str, QT_INFINIDB_DERIVED);
|
||||
IDEBUG(cout << str.ptr() << endl);
|
||||
if (str.ptr())
|
||||
cf->data(str.ptr());
|
||||
cf->data(str.c_ptr());
|
||||
ParseTree* ptp = new ParseTree(cf);
|
||||
gwip->ptWorkStack.push(ptp);
|
||||
}
|
||||
@@ -3797,9 +3800,7 @@ void gp_walk(const Item *item, void *arg)
|
||||
string cval;
|
||||
if (str->ptr())
|
||||
{
|
||||
cval = str->ptr();
|
||||
// MariaDB doesn't always put a null terminator. Trim to proper length.
|
||||
cval = cval.substr(0, str->length());
|
||||
cval = str->c_ptr();
|
||||
}
|
||||
size_t spos = cval.find_last_not_of(" ");
|
||||
if (spos != string::npos)
|
||||
@@ -4582,7 +4583,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, bool i
|
||||
// cout << "DERIVED TABLE DEBUG" << endl;
|
||||
String str;
|
||||
(table_ptr->derived->first_select())->print(gwi.thd, &str, QT_INFINIDB_DERIVED);
|
||||
// cout << str.ptr() << endl;
|
||||
// cout << str.c_ptr() << endl;
|
||||
// cout << "DERIVED TABLE DEBUG END" << endl;
|
||||
|
||||
SELECT_LEX *select_cursor = table_ptr->derived->first_select();
|
||||
@@ -6622,7 +6623,7 @@ int cp_get_table_plan(THD* thd, SCSEP& csep, cal_table_info& ti)
|
||||
if (bitmap_is_set(read_set, field->field_index))
|
||||
{
|
||||
SimpleColumn* sc = new SimpleColumn(table->s->db.str, table->s->table_name.str, field->field_name, sessionID);
|
||||
string alias(table->alias.ptr());
|
||||
string alias(table->alias.c_ptr());
|
||||
sc->tableAlias(lower(alias));
|
||||
assert (sc);
|
||||
boost::shared_ptr<SimpleColumn> spsc(sc);
|
||||
@@ -6634,7 +6635,7 @@ int cp_get_table_plan(THD* thd, SCSEP& csep, cal_table_info& ti)
|
||||
if (gwi->columnMap.empty())
|
||||
{
|
||||
CalpontSystemCatalog::TableName tn = make_table(table->s->db.str, table->s->table_name.str);
|
||||
CalpontSystemCatalog::TableAliasName tan = make_aliastable(table->s->db.str, table->s->table_name.str, table->alias.ptr());
|
||||
CalpontSystemCatalog::TableAliasName tan = make_aliastable(table->s->db.str, table->s->table_name.str, table->alias.c_ptr());
|
||||
SimpleColumn *sc = getSmallestColumn(csc, tn, tan, table, *gwi);
|
||||
SRCP srcp(sc);
|
||||
gwi->columnMap.insert(CalpontSelectExecutionPlan::ColumnMap::value_type(sc->columnName(), srcp));
|
||||
@@ -6676,7 +6677,7 @@ int cp_get_table_plan(THD* thd, SCSEP& csep, cal_table_info& ti)
|
||||
csep->returnedCols(gwi->returnedCols);
|
||||
csep->columnMap(gwi->columnMap);
|
||||
CalpontSelectExecutionPlan::TableList tblist;
|
||||
tblist.push_back(make_aliastable(table->s->db.str, table->s->table_name.str, table->alias.ptr()));
|
||||
tblist.push_back(make_aliastable(table->s->db.str, table->s->table_name.str, table->alias.c_ptr()));
|
||||
csep->tableList(tblist);
|
||||
|
||||
// @bug 3321. Set max number of blocks in a dictionary file to be scanned for filtering
|
||||
|
||||
@@ -448,6 +448,17 @@ int fetchNextRow(uchar *buf, cal_table_info& ti, cal_connection_info* ci)
|
||||
*(*f)->null_ptr &= ~(*f)->null_bit;
|
||||
intColVal = row.getUintField<8>(s);
|
||||
DataConvert::datetimeToString(intColVal, tmp, 255);
|
||||
|
||||
/* setting the field_length is a sort-of hack. The length
|
||||
* at this point can be long enough to include mseconds.
|
||||
* ColumnStore doesn't fully support mseconds yet so if
|
||||
* they are requested, trim them off.
|
||||
* At a later date we should set this more intelligently
|
||||
* based on the result set.
|
||||
*/
|
||||
if ((*f)->field_length > 19)
|
||||
(*f)->field_length = strlen(tmp);
|
||||
|
||||
Field_varstring* f2 = (Field_varstring*)*f;
|
||||
f2->store(tmp, strlen(tmp), f2->charset());
|
||||
break;
|
||||
|
||||
@@ -39,6 +39,8 @@ read_rnd_buffer_size = 16M
|
||||
myisam_sort_buffer_size = 64M
|
||||
thread_cache_size = 8
|
||||
query_cache_size = 0
|
||||
# Disable client progress reports. More people are annoyed by it than not.
|
||||
progress_report_time=0
|
||||
# Try number of CPU's*2 for thread_concurrency
|
||||
#thread_concurrency = 8
|
||||
thread_stack = 512K
|
||||
|
||||
@@ -8,9 +8,7 @@ set(DDLProc_SRCS ddlproc.cpp ddlprocessor.cpp)
|
||||
|
||||
add_executable(DDLProc ${DDLProc_SRCS})
|
||||
|
||||
add_dependencies(DDLProc libnetsnmpmibs)
|
||||
target_link_libraries(DDLProc ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool)
|
||||
|
||||
target_link_libraries(DDLProc ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} threadpool)
|
||||
|
||||
install(TARGETS DDLProc DESTINATION ${ENGINE_BINDIR})
|
||||
install(TARGETS DDLProc DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||
|
||||
|
||||
@@ -10,5 +10,5 @@ add_executable(DecomSvr ${DecomSvr_SRCS})
|
||||
|
||||
target_link_libraries(DecomSvr ${ENGINE_LDFLAGS} ${Boost_LIBRARIES} pthread rt)
|
||||
|
||||
install(TARGETS DecomSvr DESTINATION ${ENGINE_BINDIR})
|
||||
install(TARGETS DecomSvr DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||
|
||||
|
||||
@@ -12,11 +12,9 @@ set(DMLProc_SRCS
|
||||
|
||||
add_executable(DMLProc ${DMLProc_SRCS})
|
||||
|
||||
add_dependencies(DMLProc libnetsnmpmibs)
|
||||
target_link_libraries(DMLProc ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} ${NETSNMP_LIBRARIES} threadpool ddlcleanuputil batchloader)
|
||||
|
||||
target_link_libraries(DMLProc ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS} threadpool ddlcleanuputil batchloader)
|
||||
|
||||
install(TARGETS DMLProc DESTINATION ${ENGINE_BINDIR})
|
||||
install(TARGETS DMLProc DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#include "boost/progress.hpp"
|
||||
using namespace std;
|
||||
|
||||
#include "snmpglobal.h"
|
||||
#include "snmpmanager.h"
|
||||
#include "alarmglobal.h"
|
||||
#include "alarmmanager.h"
|
||||
#include "liboamcpp.h"
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
@@ -132,8 +132,8 @@ void rollbackAll(DBRM* dbrm)
|
||||
{
|
||||
Oam oam;
|
||||
try {
|
||||
snmpmanager::SNMPManager alarmMgr;
|
||||
alarmMgr.sendAlarmReport("System", oam::ROLLBACK_FAILURE, snmpmanager::CLEAR);
|
||||
alarmmanager::ALARMManager alarmMgr;
|
||||
alarmMgr.sendAlarmReport("System", oam::ROLLBACK_FAILURE, alarmmanager::CLEAR);
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
@@ -270,8 +270,8 @@ void rollbackAll(DBRM* dbrm)
|
||||
rc = dbrm->setReadOnly(true);
|
||||
//Raise an alarm
|
||||
try {
|
||||
snmpmanager::SNMPManager alarmMgr;
|
||||
alarmMgr.sendAlarmReport("System", oam::ROLLBACK_FAILURE, snmpmanager::SET);
|
||||
alarmmanager::ALARMManager alarmMgr;
|
||||
alarmMgr.sendAlarmReport("System", oam::ROLLBACK_FAILURE, alarmmanager::SET);
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
@@ -396,8 +396,8 @@ void rollbackAll(DBRM* dbrm)
|
||||
rc = dbrm->setReadOnly(true);
|
||||
//Raise an alarm
|
||||
try {
|
||||
snmpmanager::SNMPManager alarmMgr;
|
||||
alarmMgr.sendAlarmReport("System", oam::ROLLBACK_FAILURE, snmpmanager::SET);
|
||||
alarmmanager::ALARMManager alarmMgr;
|
||||
alarmMgr.sendAlarmReport("System", oam::ROLLBACK_FAILURE, alarmmanager::SET);
|
||||
}
|
||||
catch (...)
|
||||
{}
|
||||
|
||||
@@ -8,11 +8,9 @@ set(ExeMgr_SRCS main.cpp activestatementcounter.cpp femsghandler.cpp)
|
||||
|
||||
add_executable(ExeMgr ${ExeMgr_SRCS})
|
||||
|
||||
add_dependencies(ExeMgr libnetsnmpmibs)
|
||||
target_link_libraries(ExeMgr ${ENGINE_LDFLAGS} ${ENGINE_EXEC_LIBS} ${NETSNMP_LIBRARIES} cacheutils threadpool)
|
||||
|
||||
target_link_libraries(ExeMgr ${ENGINE_LDFLAGS} ${ENGINE_EXEC_LIBS} cacheutils threadpool)
|
||||
|
||||
install(TARGETS ExeMgr DESTINATION ${ENGINE_BINDIR})
|
||||
install(TARGETS ExeMgr DESTINATION ${ENGINE_BINDIR} COMPONENT platform)
|
||||
|
||||
|
||||
########### install files ###############
|
||||
|
||||
1
m4/libtool.m4
vendored
1
m4/libtool.m4
vendored
@@ -1 +0,0 @@
|
||||
/usr/share/aclocal/libtool.m4
|
||||
1
m4/ltoptions.m4
vendored
1
m4/ltoptions.m4
vendored
@@ -1 +0,0 @@
|
||||
/usr/share/aclocal/ltoptions.m4
|
||||
1
m4/ltsugar.m4
vendored
1
m4/ltsugar.m4
vendored
@@ -1 +0,0 @@
|
||||
/usr/share/aclocal/ltsugar.m4
|
||||
1
m4/ltversion.m4
vendored
1
m4/ltversion.m4
vendored
@@ -1 +0,0 @@
|
||||
/usr/share/aclocal/ltversion.m4
|
||||
1
m4/lt~obsolete.m4
vendored
1
m4/lt~obsolete.m4
vendored
@@ -1 +0,0 @@
|
||||
/usr/share/aclocal/lt~obsolete.m4
|
||||
@@ -1,20 +0,0 @@
|
||||
# $Id$
|
||||
|
||||
.PHONY: test coverage leakcheck docs bootstrap install clean
|
||||
test:
|
||||
|
||||
coverage:
|
||||
|
||||
leakcheck:
|
||||
|
||||
docs:
|
||||
|
||||
all:
|
||||
$(MAKE) -C net-snmp
|
||||
|
||||
install:
|
||||
$(MAKE) -C net-snmp install
|
||||
|
||||
clean:
|
||||
$(MAKE) -C net-snmp clean
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
net-snmp-5.7.3/
|
||||
116
net-snmp/net-snmp-5.7.3/.gitignore
vendored
116
net-snmp/net-snmp-5.7.3/.gitignore
vendored
@@ -1,116 +0,0 @@
|
||||
*~
|
||||
*.bak
|
||||
*.bs
|
||||
*.ft
|
||||
*.ft.1
|
||||
*.la
|
||||
*.lo
|
||||
*.made
|
||||
*.o
|
||||
*.obj
|
||||
*.old
|
||||
*.orig
|
||||
*.out
|
||||
*.pdb
|
||||
*.rej
|
||||
.libs/
|
||||
agent/*.exe
|
||||
agent/mibgroup/agent_module_dot_conf.h
|
||||
agent/mibgroup/agent_module_includes.h
|
||||
agent/mibgroup/agent_module_inits.h
|
||||
agent/mibgroup/agent_module_shutdown.h
|
||||
agent/mibgroup/mib_module_dot_conf.h
|
||||
agent/mibgroup/mib_module_includes.h
|
||||
agent/mibgroup/mib_module_inits.h
|
||||
agent/mibgroup/mib_module_shutdown.h
|
||||
agent/snmpd
|
||||
apps/*.exe
|
||||
apps/agentxtrap
|
||||
apps/encode_keychange
|
||||
apps/snmpbulkget
|
||||
apps/snmpbulkwalk
|
||||
apps/snmpdelta
|
||||
apps/snmpdf
|
||||
apps/snmpget
|
||||
apps/snmpgetnext
|
||||
apps/snmpnetstat/*.exe
|
||||
apps/snmpnetstat/snmpnetstat
|
||||
apps/snmpset
|
||||
apps/snmpstatus
|
||||
apps/snmptable
|
||||
apps/snmptest
|
||||
apps/snmptls
|
||||
apps/snmptranslate
|
||||
apps/snmptrap
|
||||
apps/snmptrapd
|
||||
apps/snmpusm
|
||||
apps/snmpvacm
|
||||
apps/snmpwalk
|
||||
apps/sshtosnmp
|
||||
autom4te.cache/
|
||||
ChangeLog.add*
|
||||
ChangeLog.reallyadd
|
||||
CHANGES.new*
|
||||
confdefs.h
|
||||
config.cache
|
||||
config.log
|
||||
config.status
|
||||
configure-summary
|
||||
dist/generation-scripts/gen-variables
|
||||
docs/html
|
||||
docs/latex
|
||||
EXAMPLE.conf
|
||||
include/net-snmp/agent/agent_module_config.h
|
||||
include/net-snmp/agent/mib_module_config.h
|
||||
include/net-snmp/library/snmpv3-security-includes.h
|
||||
include/net-snmp/net-snmp-config.h
|
||||
libtool
|
||||
local/snmpcheck
|
||||
local/snmpconf
|
||||
Makefile
|
||||
man/*.[1358]
|
||||
man/default_store.3.h
|
||||
man/manaliases
|
||||
mibs/.index
|
||||
mk/
|
||||
module_tmp_header.h
|
||||
net-snmp-5*
|
||||
net-snmp-6*
|
||||
net-snmp-config
|
||||
net-snmp-config-x
|
||||
net-snmp-create-v3-user
|
||||
NEWS.new*
|
||||
perl/*.yml
|
||||
perl/*/*.def
|
||||
perl/*/*.yml
|
||||
perl/*/*/*.yml
|
||||
perl/agent/agent.c
|
||||
perl/agent/default_store/default_store.c
|
||||
perl/agent/default_store/default_store.def
|
||||
perl/ASN/ASN.c
|
||||
perl/blib/
|
||||
perl/default_store/default_store.c
|
||||
perl/NetSNMP.c
|
||||
perl/OID/OID.c
|
||||
perl/SNMP/SNMP.c
|
||||
perl/SNMP/t/*.log
|
||||
perl/SNMP/t/*.pid
|
||||
perl/SNMP/t/*.stderr
|
||||
perl/SNMP/t/snmptest.cmd
|
||||
perl/TrapReceiver/const-c.inc
|
||||
perl/TrapReceiver/const-xs.inc
|
||||
perl/TrapReceiver/TrapReceiver.c
|
||||
pm_to_blib
|
||||
python/build
|
||||
sedscript
|
||||
snmplib/snmpsm_init.h
|
||||
snmplib/snmpsm_shutdown.h
|
||||
snmplib/transports/snmp_transport_inits.h
|
||||
stamp-h
|
||||
TAGS
|
||||
testing/failed_tests
|
||||
testing/testing/
|
||||
win32/*/debug
|
||||
win32/*/release
|
||||
win32/bin
|
||||
win32/lib
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,327 +0,0 @@
|
||||
Various copyrights apply to this package, listed in various separate
|
||||
parts below. Please make sure that you read all the parts.
|
||||
|
||||
---- Part 1: CMU/UCD copyright notice: (BSD like) -----
|
||||
|
||||
|
||||
Copyright 1989, 1991, 1992 by Carnegie Mellon University
|
||||
|
||||
Derivative Work - 1996, 1998-2000
|
||||
Copyright 1996, 1998-2000 The Regents of the University of California
|
||||
|
||||
All Rights Reserved
|
||||
|
||||
Permission to use, copy, modify and distribute this software and its
|
||||
documentation for any purpose and without fee is hereby granted,
|
||||
provided that the above copyright notice appears in all copies and
|
||||
that both that copyright notice and this permission notice appear in
|
||||
supporting documentation, and that the name of CMU and The Regents of
|
||||
the University of California not be used in advertising or publicity
|
||||
pertaining to distribution of the software without specific written
|
||||
permission.
|
||||
|
||||
CMU AND THE REGENTS OF THE UNIVERSITY OF CALIFORNIA DISCLAIM ALL
|
||||
WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL CMU OR
|
||||
THE REGENTS OF THE UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY SPECIAL,
|
||||
INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
|
||||
FROM THE LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
|
||||
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
---- Part 2: Networks Associates Technology, Inc copyright notice (BSD) -----
|
||||
|
||||
Copyright (c) 2001-2003, Networks Associates Technology, Inc
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the Networks Associates Technology, Inc nor the
|
||||
names of its contributors may be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
||||
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
---- Part 3: Cambridge Broadband Ltd. copyright notice (BSD) -----
|
||||
|
||||
Portions of this code are copyright (c) 2001-2003, Cambridge Broadband Ltd.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* The name of Cambridge Broadband Ltd. may not be used to endorse or
|
||||
promote products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
---- Part 4: Sun Microsystems, Inc. copyright notice (BSD) -----
|
||||
|
||||
Copyright <20> 2003 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
California 95054, U.S.A. All rights reserved.
|
||||
|
||||
Use is subject to license terms below.
|
||||
|
||||
This distribution may include materials developed by third parties.
|
||||
|
||||
Sun, Sun Microsystems, the Sun logo and Solaris are trademarks or registered
|
||||
trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the Sun Microsystems, Inc. nor the
|
||||
names of its contributors may be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
||||
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
---- Part 5: Sparta, Inc copyright notice (BSD) -----
|
||||
|
||||
Copyright (c) 2003-2013, Sparta, Inc
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of Sparta, Inc nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
||||
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
---- Part 6: Cisco/BUPTNIC copyright notice (BSD) -----
|
||||
|
||||
Copyright (c) 2004, Cisco, Inc and Information Network
|
||||
Center of Beijing University of Posts and Telecommunications.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of Cisco, Inc, Beijing University of Posts and
|
||||
Telecommunications, nor the names of their contributors may
|
||||
be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
||||
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
---- Part 7: Fabasoft R&D Software GmbH & Co KG copyright notice (BSD) -----
|
||||
|
||||
Copyright (c) Fabasoft R&D Software GmbH & Co KG, 2003
|
||||
oss@fabasoft.com
|
||||
Author: Bernhard Penz <bernhard.penz@fabasoft.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* The name of Fabasoft R&D Software GmbH & Co KG or any of its subsidiaries,
|
||||
brand or product names may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
||||
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
---- Part 8: Apple Inc. copyright notice (BSD) -----
|
||||
|
||||
Copyright (c) 2007 Apple Inc. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
3. Neither the name of Apple Inc. ("Apple") nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
||||
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
---- Part 9: ScienceLogic, LLC copyright notice (BSD) -----
|
||||
|
||||
Copyright (c) 2009, ScienceLogic, LLC
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of ScienceLogic, LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
||||
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
|
||||
---- Part 10: IETF copyright notice (BSD) -----
|
||||
|
||||
Copyright (c) 2013 IETF Trust and the persons identified as authors of
|
||||
the code. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
· Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
· Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
· Neither the name of Internet Society, IETF or IETF Trust, nor the
|
||||
names of specific contributors, may be used to endorse or promote
|
||||
products derived from this software without specific prior written
|
||||
permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS
|
||||
IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,69 +0,0 @@
|
||||
The discussion about coding style on the net-snmp-coders mailing list
|
||||
can be found at the following web address:
|
||||
|
||||
http://sourceforge.net/mailarchive/message.php?msg_id=1009885
|
||||
(Thread "design proposal - coding style" started on 2001-02-08)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Indentation:
|
||||
|
||||
We've adopted the following indent style:
|
||||
|
||||
indent -orig -nbc -bap -nut -nfca -T netsnmp_mib_handler -T netsnmp_handler_registration -T netsnmp_handler_args -T netsnmp_delegated_cache -T netsnmp_baby_steps_modes -T netsnmp_baby_steps_access_methods -T netsnmp_mode_handler_list -T netsnmp_mib_handler_methods -T netsnmp_monitor_callback_header -T netsnmp_monitor_set_request_data -T netsnmp_monitor_callback_cooperative -T netsnmp_old_api_info -T netsnmp_old_api_cache -T netsnmp_row_merge_status -T netsnmp_scalar_group -T netsnmp_set_info -T netsnmp_request_info -T netsnmp_set_info -T netsnmp_tree_cache -T netsnmp_agent_request_info -T netsnmp_cachemap -T netsnmp_agent_session -T netsnmp_stash_cache_info -T netsnmp_stash_cache_data -T netsnmp_request_group_item -T netsnmp_request_group -T netsnmp_table_array_callbacks -T netsnmp_table_row -T netsnmp_table_data -T netsnmp_table_data_set_storage -T netsnmp_table_data_set -T netsnmp_column_info -T netsnmp_table_registration_info -T netsnmp_table_request_info -T netsnmp_iterator_info -T netsnmp_tdata_row -T netsnmp_tdata -T netsnmp_subtree -T netsnmp_watcher_info -T netsnmp_arp_entry -T netsnmp_interface_stats -T netsnmp_interface_entry -T netsnmp_conf_if_list -T netsnmp_ipaddress_entry -T netsnmp_ipstats -T netsnmp_route_entry -T netsnmp_systemstats_entry -T netsnmp_tcpconn_entry -T netsnmp_udp_endpoint_entry -T netsnmp_container -T netsnmp_iterator -T netsnmp_data_list -T netsnmp_data_list_saveinfo -T netsnmp_factory -T netsnmp_file -T netsnmp_oid_stash_node -T netsnmp_oid_stash_save_info -T netsnmp_pdu -T netsnmp_request_list -T netsnmp_vardata -T netsnmp_callback_pass -T netsnmp_callback_info -T netsnmp_token_descr -T netsnmp_std_data -T netsnmp_transport -T netsnmp_transport_list -T netsnmp_tdomain -T netsnmp_line_info -T netsnmp_line_process_info -T netsnmp_token_value_index
|
||||
|
||||
[wow, what an annoying list! The above -T list can be (re)generated by
|
||||
running:
|
||||
perl -n -e 'print "-T $1 " if (/}\s*(netsnmp_\w+)\s*;/);' */*.h
|
||||
in the include/net-snmp directory]
|
||||
|
||||
If possible, please run all new code submitted to the project through
|
||||
the above command. However, if sending a patch, please do *not* send
|
||||
a patch that reformats the entire file. Just the new sections of code
|
||||
should be in the above style to make it easier for us to dissect what
|
||||
you did in your patch.
|
||||
|
||||
Briefly, here's a description of the style:
|
||||
|
||||
Blank lines:
|
||||
after procedures
|
||||
not (forced) after blocks of declarations or block comments
|
||||
multiple declarations not split onto separate lines
|
||||
|
||||
Comments:
|
||||
Block comments indented 4 spaces from surrounding code
|
||||
Start/End on separate lines
|
||||
Solid '*' on the left of block comments
|
||||
"One-line" comments start in column 33
|
||||
|
||||
Bracing/Indent/etc:
|
||||
K&R-style bracing (including "cuddle-else")
|
||||
'case' statements in line with 'switch'
|
||||
No space between procedure name and opening parenthesis
|
||||
variable declarations lined up, and start in column 16
|
||||
Procedure return type on a separate line to the procedure name
|
||||
Four character basic and continuation line indent
|
||||
No tabs used in the file, always use 8 spaces instead.
|
||||
Continuation parameters lined up with opening parenthesis
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Function names and Variable names:
|
||||
|
||||
should_be_like_this and notLikeThis
|
||||
|
||||
New public functions and defines should ideally start with a netsnmp_
|
||||
or NETSNMP_ prefix, respectively.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Structures:
|
||||
|
||||
We have decided to typedef all structures into names using the
|
||||
following convention:
|
||||
|
||||
typedef struct netsnmp_wombat_s {
|
||||
int something_cool;
|
||||
} netsnmp_wombat;
|
||||
|
||||
The important things to note here are that the struct name ends in a
|
||||
"_s", the typedef name doesn't end in "_t", and the typedef is not to a
|
||||
pointer and everything begins with "netsnmp_".
|
||||
|
||||
@@ -1,193 +0,0 @@
|
||||
###############################################################################
|
||||
#
|
||||
# EXAMPLE.conf:
|
||||
# An example configuration file for configuring the Net-SNMP agent ('snmpd')
|
||||
# See the 'snmpd.conf(5)' man page for details
|
||||
#
|
||||
# Some entries are deliberately commented out, and will need to be explicitly activated
|
||||
#
|
||||
###############################################################################
|
||||
#
|
||||
# AGENT BEHAVIOUR
|
||||
#
|
||||
|
||||
# Listen for connections from the local system only
|
||||
agentAddress udp:127.0.0.1:161
|
||||
# Listen for connections on all interfaces (both IPv4 *and* IPv6)
|
||||
#agentAddress udp:161,udp6:[::1]:161
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# SNMPv3 AUTHENTICATION
|
||||
#
|
||||
# Note that these particular settings don't actually belong here.
|
||||
# They should be copied to the file /var/net-snmp/snmpd.conf
|
||||
# and the passwords changed, before being uncommented in that file *only*.
|
||||
# Then restart the agent
|
||||
|
||||
# createUser authOnlyUser MD5 "remember to change this password"
|
||||
# createUser authPrivUser SHA "remember to change this one too" DES
|
||||
# createUser internalUser MD5 "this is only ever used internally, but still change the password"
|
||||
|
||||
# If you also change the usernames (which might be sensible),
|
||||
# then remember to update the other occurances in this example config file to match.
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# ACCESS CONTROL
|
||||
#
|
||||
|
||||
# system + hrSystem groups only
|
||||
view systemonly included .1.3.6.1.2.1.1
|
||||
view systemonly included .1.3.6.1.2.1.25.1
|
||||
|
||||
# Full access from the local host
|
||||
#rocommunity public localhost
|
||||
# Default access to basic system info
|
||||
rocommunity public default -V systemonly
|
||||
|
||||
# Full access from an example network
|
||||
# Adjust this network address to match your local
|
||||
# settings, change the community string,
|
||||
# and check the 'agentAddress' setting above
|
||||
#rocommunity secret 10.0.0.0/16
|
||||
|
||||
# Full read-only access for SNMPv3
|
||||
rouser authOnlyUser
|
||||
# Full write access for encrypted requests
|
||||
# Remember to activate the 'createUser' lines above
|
||||
#rwuser authPrivUser priv
|
||||
|
||||
# It's no longer typically necessary to use the full 'com2sec/group/access' configuration
|
||||
# r[ou]user and r[ow]community, together with suitable views, should cover most requirements
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# SYSTEM INFORMATION
|
||||
#
|
||||
|
||||
# Note that setting these values here, results in the corresponding MIB objects being 'read-only'
|
||||
# See snmpd.conf(5) for more details
|
||||
sysLocation Sitting on the Dock of the Bay
|
||||
sysContact Me <me@example.org>
|
||||
# Application + End-to-End layers
|
||||
sysServices 72
|
||||
|
||||
|
||||
#
|
||||
# Process Monitoring
|
||||
#
|
||||
# At least one 'mountd' process
|
||||
proc mountd
|
||||
# No more than 4 'ntalkd' processes - 0 is OK
|
||||
proc ntalkd 4
|
||||
# At least one 'sendmail' process, but no more than 10
|
||||
proc sendmail 10 1
|
||||
|
||||
# Walk the UCD-SNMP-MIB::prTable to see the resulting output
|
||||
# Note that this table will be empty if there are no "proc" entries in the snmpd.conf file
|
||||
|
||||
|
||||
#
|
||||
# Disk Monitoring
|
||||
#
|
||||
# 10MBs required on root disk, 5% free on /var, 10% free on all other disks
|
||||
disk / 10000
|
||||
disk /var 5%
|
||||
includeAllDisks 10%
|
||||
|
||||
# Walk the UCD-SNMP-MIB::dskTable to see the resulting output
|
||||
# Note that this table will be empty if there are no "disk" entries in the snmpd.conf file
|
||||
|
||||
|
||||
#
|
||||
# System Load
|
||||
#
|
||||
# Unacceptable 1-, 5-, and 15-minute load averages
|
||||
load 12 10 5
|
||||
|
||||
# Walk the UCD-SNMP-MIB::laTable to see the resulting output
|
||||
# Note that this table *will* be populated, even without a "load" entry in the snmpd.conf file
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# ACTIVE MONITORING
|
||||
#
|
||||
|
||||
# send SNMPv1 traps
|
||||
trapsink localhost public
|
||||
# send SNMPv2c traps
|
||||
#trap2sink localhost public
|
||||
# send SNMPv2c INFORMs
|
||||
#informsink localhost public
|
||||
|
||||
# Note that you typically only want *one* of these three lines
|
||||
# Uncommenting two (or all three) will result in multiple copies of each notification.
|
||||
|
||||
|
||||
#
|
||||
# Event MIB - automatically generate alerts
|
||||
#
|
||||
# Remember to activate the 'createUser' lines above
|
||||
iquerySecName internalUser
|
||||
rouser internalUser
|
||||
# generate traps on UCD error conditions
|
||||
defaultMonitors yes
|
||||
# generate traps on linkUp/Down
|
||||
linkUpDownNotifications yes
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# EXTENDING THE AGENT
|
||||
#
|
||||
|
||||
#
|
||||
# Arbitrary extension commands
|
||||
#
|
||||
extend test1 /bin/echo Hello, world!
|
||||
extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35
|
||||
#extend-sh test3 /bin/sh /tmp/shtest
|
||||
|
||||
# Note that this last entry requires the script '/tmp/shtest' to be created first,
|
||||
# containing the same three shell commands, before the line is uncommented
|
||||
|
||||
# Walk the NET-SNMP-EXTEND-MIB tables (nsExtendConfigTable, nsExtendOutput1Table
|
||||
# and nsExtendOutput2Table) to see the resulting output
|
||||
|
||||
# Note that the "extend" directive supercedes the previous "exec" and "sh" directives
|
||||
# However, walking the UCD-SNMP-MIB::extTable should still returns the same output,
|
||||
# as well as the fuller results in the above tables.
|
||||
|
||||
|
||||
#
|
||||
# "Pass-through" MIB extension command
|
||||
#
|
||||
#pass .1.3.6.1.4.1.8072.2.255 /bin/sh PREFIX/local/passtest
|
||||
#pass .1.3.6.1.4.1.8072.2.255 /usr/bin/perl PREFIX/local/passtest.pl
|
||||
|
||||
# Note that this requires one of the two 'passtest' scripts to be installed first,
|
||||
# before the appropriate line is uncommented.
|
||||
# These scripts can be found in the 'local' directory of the source distribution,
|
||||
# and are not installed automatically.
|
||||
|
||||
# Walk the NET-SNMP-PASS-MIB::netSnmpPassExamples subtree to see the resulting output
|
||||
|
||||
|
||||
#
|
||||
# AgentX Sub-agents
|
||||
#
|
||||
# Run as an AgentX master agent
|
||||
master agentx
|
||||
# Listen for network connections (from localhost)
|
||||
# rather than the default named socket /var/agentx/master
|
||||
#agentXSocket tcp:localhost:705
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,278 +0,0 @@
|
||||
TABLE OF CONTENTS
|
||||
=================
|
||||
|
||||
Table Of Contents
|
||||
Quick Instructions
|
||||
* Net-SNMP Specific Information
|
||||
Long (but you should read these) Instructions
|
||||
Installing the Perl/SNMP Module
|
||||
* Compilers and Options
|
||||
Compiling For Multiple Architectures
|
||||
Installation Names
|
||||
Optional Features
|
||||
Sharing Defaults
|
||||
Operation Controls
|
||||
|
||||
* = required reading
|
||||
|
||||
QUICK INSTRUCTIONS
|
||||
==================
|
||||
|
||||
1) Run ./configure
|
||||
(type "./configure --help" for a quick usage summary.)
|
||||
(--prefix=PATH will change the default /usr/local installation path.)
|
||||
(see "Compilers and Options" on changing the compiler to use)
|
||||
|
||||
2) Optionally edit include/net-snmp/net-snmp-config.h
|
||||
(due to prompting done by the configure script, this is very rarely
|
||||
necessary.)
|
||||
|
||||
3) make
|
||||
|
||||
4) Run the next command as root:
|
||||
5) make install
|
||||
|
||||
6) configure the agent
|
||||
(either using 'snmpconf' or by crafting an snmpd.conf file manually.
|
||||
The file 'EXAMPLE.conf' may be a suitable starting point)
|
||||
|
||||
Note: By default, everything will be installed in /usr/local.
|
||||
(see below for more instructions)
|
||||
|
||||
Net-SNMP Specific Information
|
||||
=============================
|
||||
|
||||
As of UCD-SNMP V3.3.1 the configuration files are now looked for in
|
||||
$(prefix)/share/snmp, where ($prefix) is defined as the value passed
|
||||
to the --prefix argument of the configure script, or /usr/local if
|
||||
undefined. In version 3.0.3 till 3.3, the files were kept in
|
||||
$(prefix)/lib/snmp
|
||||
|
||||
Optional features to pass to configure for Net-SNMP can be obtained by
|
||||
running configure --help.
|
||||
|
||||
LONG (but you should read these) INSTRUCTIONS
|
||||
=============================================
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure') and a file `configure-summary'
|
||||
containing the summary displayed at the end of the `configure' run.
|
||||
|
||||
The file `include/net-snmp/net-snmp-config.h' is also generated
|
||||
at this time. It contains IMPORTANT information such as the location
|
||||
of log and configuration files. In some special cases you may need to
|
||||
modify this file but it is prefererable to work out a way of getting
|
||||
`configure' to set things up for your particular environment.
|
||||
|
||||
As the `configure' invocation often gets lengthy and difficult to
|
||||
type or if you have several different ways you want to configure a
|
||||
system, you may want to create a shell script containing your invocation.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for. When it
|
||||
completes it prints a short message (also available in configure-summary)
|
||||
indicating what functionality will be available when compiled.
|
||||
|
||||
2. If necessary, edit include/net-snmp/net-snmp-config.h (see above).
|
||||
|
||||
3. Type `make' to compile the package.
|
||||
|
||||
4. Type `make test' which runs a variety of tests to see what functionality
|
||||
has been incorporated and if it works.
|
||||
|
||||
5. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
6. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'.
|
||||
|
||||
7. You can remove the application by typing `make uninstall'.
|
||||
|
||||
There may be additional installation issues discussed in the
|
||||
README's for various platforms such as README.solaris.
|
||||
|
||||
|
||||
Installing the Perl/SNMP Module
|
||||
===============================
|
||||
|
||||
The Perl/SNMP Module is now bundled with the net-snmp package
|
||||
(which includes other Net-SNMP specific modules as well), all of which
|
||||
are located in the net-snmp/perl directory. The Perl package provides
|
||||
a high level abstract interface to the functionality found in the
|
||||
Net-SNMP libraries and demon applications.
|
||||
|
||||
It is recommended you install the perl modules as you build the
|
||||
Net-SNMP package. The configure script can be run as follows to
|
||||
automatically find perl and use it to install the perl modules:
|
||||
|
||||
./configure --with-perl-modules
|
||||
|
||||
If you wish to use the embedded perl support available in the
|
||||
Net-SNMP agent (and starting in Net-SNMP 5.2, the trap receiver),
|
||||
then use the following option instead:
|
||||
|
||||
./configure --enable-embedded-perl --enable-shared
|
||||
|
||||
Starting with Net-SNMP 5.4, configure enables embedded Perl and the
|
||||
Perl modules by default when possible unless explicitly disabled.
|
||||
|
||||
If you wish to build the perl modules by hand, *install Net-SNMP
|
||||
first* and then change directories to the perl subdirectory and:
|
||||
|
||||
Run:
|
||||
cd perl
|
||||
perl Makefile.PL
|
||||
make
|
||||
make test
|
||||
make install (as root)
|
||||
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, there is a `maketarget' script that will generate a symlink'ed
|
||||
shadow-directory for the object files. Do a `sh maketarget', then `cd' into
|
||||
targets/`config.guess` and do the configuration and installation.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made.
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
@@ -1,461 +0,0 @@
|
||||
|
||||
#
|
||||
# Makefile.in (at the root of net-snmp)
|
||||
#
|
||||
|
||||
top_builddir = .
|
||||
VPATH = @srcdir@
|
||||
|
||||
SUBDIRS = snmplib @MAINSUBS@
|
||||
FTSUBDIRS = @FTMAINSUBS@ snmplib
|
||||
TESTDIRS = testing
|
||||
|
||||
CPP = @CPP@ \
|
||||
-Iinclude -I$(srcdir)/include -I$(srcdir)/agent/mibgroup -I. -I$(srcdir) \
|
||||
-DDONT_INC_STRUCTS -DBINDIR=$(bindir) \
|
||||
$(EXTRACPPFLAGS)
|
||||
|
||||
INSTALLHEADERS=version.h net-snmp-features.h
|
||||
INCLUDESUBDIR=system
|
||||
INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi.h cygwin.h \
|
||||
darwin.h darwin7.h darwin8.h darwin9.h darwin10.h dragonfly.h dynix.h \
|
||||
freebsd2.h freebsd3.h freebsd4.h freebsd5.h freebsd6.h \
|
||||
freebsd7.h freebsd8.h freebsd9.h freebsd10.h freebsd11.h \
|
||||
freebsd12.h freebsd.h \
|
||||
generic.h \
|
||||
hpux.h irix.h linux.h mingw32.h mips.h netbsd.h osf5.h \
|
||||
openbsd.h openbsd5.h openbsd4.h \
|
||||
solaris2.3.h solaris2.4.h solaris2.5.h solaris2.6.h \
|
||||
solaris.h sunos.h svr5.h sysv.h ultrix4.h
|
||||
INCLUDESUBDIR2=machine
|
||||
INCLUDESUBDIRHEADERS2=generic.h
|
||||
INSTALLBUILTHEADERS=include/net-snmp/net-snmp-config.h
|
||||
INSTALLBUILTINCLUDEHEADERS=@FEATUREHEADERS@
|
||||
INSTALLBINSCRIPTS=net-snmp-config net-snmp-create-v3-user
|
||||
INSTALLUCDHEADERS=ucd-snmp-config.h version.h mib_module_config.h
|
||||
|
||||
#
|
||||
# other install rules.
|
||||
#
|
||||
OTHERINSTALL=copypersistentfiles @PERLINSTALLTARGS@ @PYTHONINSTALLTARGS@
|
||||
OTHERUNINSTALL=@PERLUNINSTALLTARGS@ @PYTHONUNINSTALLTARGS@
|
||||
COPY_PERSISTENT_FILES=@COPY_PERSISTENT_FILES@
|
||||
PERSISTENT_DIRECTORY=@PERSISTENT_DIRECTORY@
|
||||
UCDPERSISTENT_DIRECTORY=@UCDPERSISTENT_DIRECTORY@
|
||||
|
||||
#
|
||||
# perl specific
|
||||
#
|
||||
# yes, order matters here. default_store must occur before anything else
|
||||
PERLMODULES=default_store SNMP ASN OID agent TrapReceiver
|
||||
PERLMODULEFTS=perl/default_store/netsnmp-feature-definitions.ft \
|
||||
perl/SNMP/netsnmp-feature-definitions.ft \
|
||||
perl/ASN/netsnmp-feature-definitions.ft \
|
||||
perl/OID/netsnmp-feature-definitions.ft \
|
||||
perl/agent/netsnmp-feature-definitions.ft \
|
||||
perl/TrapReceiver/netsnmp-feature-definitions.ft
|
||||
PERLARGS=@PERLARGS@
|
||||
|
||||
#
|
||||
# python specific
|
||||
#
|
||||
PYTHONARGS=@PYTHONARGS@
|
||||
PYTHONMODULEFTS=python/netsnmp/netsnmp-feature-definitions.ft
|
||||
|
||||
#
|
||||
# libtool
|
||||
#
|
||||
LIBTOOL_DEPS = @LIBTOOL_DEPS@
|
||||
|
||||
#
|
||||
# feature checks for optional components
|
||||
#
|
||||
FTOTHERTARGS=@PERLFEATURES@ @PYTHONFEATURES@
|
||||
|
||||
#
|
||||
# targets
|
||||
#
|
||||
all: sedscript EXAMPLE.conf @FEATURETARGS@ standardall net-snmp-config-x net-snmp-create-v3-user @PERLTARGS@ @PYTHONTARGS@
|
||||
|
||||
start-flag:
|
||||
@touch build-in-progress-flag
|
||||
|
||||
end-flag:
|
||||
@rm -f build-in-progress-flag > /dev/null 2>&1
|
||||
|
||||
libtool: $(LIBTOOL_DEPS)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
|
||||
snmplib: @FEATURETARGS@
|
||||
@(cd snmplib; $(MAKE) )
|
||||
|
||||
agent: @FEATURETARGS@
|
||||
@(cd snmplib; $(MAKE) )
|
||||
@(cd agent; $(MAKE) )
|
||||
|
||||
apps: @FEATURETARGS@
|
||||
@(cd snmplib; $(MAKE) )
|
||||
@(cd agent; $(MAKE) libs)
|
||||
@(cd apps; $(MAKE) )
|
||||
|
||||
snmpget snmpbulkget snmpwalk snmpbulkwalk snmptranslate snmpstatus snmpdelta snmptable snmptest snmpset snmpusm snmpvacm snmpgetnext encode_keychange snmpdf snmptrap snmptls: @FEATURETARGS@
|
||||
@(cd snmplib; $(MAKE) )
|
||||
@(cd apps; $(MAKE) $@ )
|
||||
|
||||
agentxtrap snmptrapd: @FEATURETARGS@
|
||||
@(cd snmplib; $(MAKE) )
|
||||
@(cd agent; $(MAKE) libs)
|
||||
@(cd apps; $(MAKE) $@ )
|
||||
|
||||
#
|
||||
# local build rules
|
||||
#
|
||||
sedscript: sedscript.in include/net-snmp/net-snmp-config.h $(srcdir)/agent/mibgroup/mibdefs.h
|
||||
$(CPP) $(srcdir)/sedscript.in | egrep '^s[/#]' | sed 's/REMOVEME//g;s# */#/#g;s/ *#/#/g;s#/ *#/#g;s/# g/#g/;' > sedscript
|
||||
echo 's/VERSIONINFO/$(VERSION)/g' >> sedscript
|
||||
echo 's#DATADIR#$(datadir)#g' >> sedscript
|
||||
echo 's#LIBDIR#$(libdir)#g' >> sedscript
|
||||
echo 's#BINDIR#$(bindir)#g' >> sedscript
|
||||
echo 's#PERSISTENT_DIRECTORY#$(PERSISTENT_DIRECTORY)#g' >> sedscript
|
||||
echo 's#SYSCONFDIR#@sysconfdir@#g' >> sedscript
|
||||
|
||||
EXAMPLE.conf: sedscript EXAMPLE.conf.def
|
||||
$(SED) -f sedscript $(srcdir)/EXAMPLE.conf.def > EXAMPLE.conf
|
||||
|
||||
docs: docsdir
|
||||
|
||||
docsdir: docsdox
|
||||
|
||||
docsdox: doxygen.conf
|
||||
srcdir=$(srcdir) VERSION=$(VERSION) doxygen $(srcdir)/doxygen.conf
|
||||
|
||||
net-snmp-config-x: net-snmp-config
|
||||
chmod a+x net-snmp-config
|
||||
touch net-snmp-config-x
|
||||
|
||||
net-snmp-create-v3-user-x: net-snmp-create-v3-user
|
||||
chmod a+x net-snmp-create-v3-user
|
||||
touch net-snmp-create-v3-user-x
|
||||
|
||||
#
|
||||
# extra install rules
|
||||
#
|
||||
|
||||
copypersistentfiles:
|
||||
@if test "$(COPY_PERSISTENT_FILES)" = "yes" -a -d $(UCDPERSISTENT_DIRECTORY) -a ! -d $(PERSISTENT_DIRECTORY) ; then \
|
||||
cp -pr $(UCDPERSISTENT_DIRECTORY) $(PERSISTENT_DIRECTORY) ; \
|
||||
echo "copying $(UCDPERSISTENT_DIRECTORY) to $(PERSISTENT_DIRECTORY)" ; \
|
||||
fi
|
||||
#
|
||||
# test targets
|
||||
#
|
||||
test test-mibs testall testfailed testsimple: all testdirs
|
||||
( cd testing; $(MAKE) $@ )
|
||||
|
||||
testdirs:
|
||||
for i in $(TESTDIRS) ; do \
|
||||
( cd $$i ; $(MAKE) ) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done
|
||||
|
||||
distall: ${srcdir}/configure ${srcdir}/include/net-snmp/net-snmp-config.h
|
||||
|
||||
OTHERCLEANTARGETS=EXAMPLE.conf sedscript
|
||||
OTHERCLEANTODOS=perlclean @PYTHONCLEANTARGS@ cleanfeatures perlcleanfeatures pythoncleanfeatures
|
||||
|
||||
#
|
||||
# perl specific build rules
|
||||
#
|
||||
# override LD_RUN_PATH to avoid dependencies on the build directory
|
||||
perlmodules: perlmakefiles subdirs
|
||||
@(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{archlibexp}/CORE);'`") ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi
|
||||
|
||||
perlmakefiles: net-snmp-config-x
|
||||
@if test ! -f perl/Makefile; then \
|
||||
(dir=`pwd`; \
|
||||
cd perl ; \
|
||||
$(PERL) Makefile.PL -NET-SNMP-IN-SOURCE=true -NET-SNMP-CONFIG="sh $$dir/net-snmp-config" $(PERLARGS) ) ; \
|
||||
fi
|
||||
|
||||
perlinstall:
|
||||
@(cd perl ; $(MAKE) install) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi
|
||||
|
||||
perluninstall:
|
||||
@(cd perl ; $(MAKE) uninstall) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi
|
||||
|
||||
perltest:
|
||||
@(cd perl ; $(MAKE) test) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi
|
||||
|
||||
perlclean:
|
||||
@if test -f perl/Makefile; then \
|
||||
( cd perl ; $(MAKE) clean ) ; \
|
||||
fi
|
||||
|
||||
perlrealclean:
|
||||
@if test -f perl/Makefile; then \
|
||||
( cd perl ; $(MAKE) realclean ) ; \
|
||||
fi
|
||||
|
||||
.h.ft:
|
||||
$(FEATURECHECK) --feature-global $(top_builddir)/include/net-snmp/feature-details.h `dirname $<` $< $@ $(CC) -I $(top_builddir)/include -I $(top_srcdir)/include -E $(CPPFLAGS) $(CFLAGS) -c
|
||||
|
||||
perlfeatures: $(PERLMODULEFTS)
|
||||
|
||||
perlcleanfeatures:
|
||||
$(RM) $(PERLMODULEFTS)
|
||||
|
||||
|
||||
# python specific build rules
|
||||
#
|
||||
PYMAKE=$(PYTHON) setup.py $(PYTHONARGS)
|
||||
pythonmodules: subdirs
|
||||
@(dir=`pwd`; cd python; $(PYMAKE) build --basedir=$$dir) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi
|
||||
|
||||
pythoninstall:
|
||||
@(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi
|
||||
|
||||
pythonuninstall:
|
||||
echo "WARNING: python doesn't support uninstall"
|
||||
|
||||
pythontest:
|
||||
@(dir=`pwd`; cd python; $(PYMAKE) test --basedir=$$dir) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi
|
||||
|
||||
pythonclean:
|
||||
@(dir=`pwd`; cd python; $(PYMAKE) clean --basedir=$$dir)
|
||||
|
||||
pythonfeatures: $(PYTHONMODULEFTS)
|
||||
|
||||
pythoncleanfeatures:
|
||||
$(RM) $(PYTHONMODULEFTS)
|
||||
|
||||
#
|
||||
# make distclean completely removes all traces of building including
|
||||
# any files generated by configure itself.
|
||||
#
|
||||
distclean: perlrealclean clean configclean tarclean
|
||||
|
||||
makefileclean:
|
||||
rm -f Makefile snmplib/Makefile \
|
||||
agent/Makefile agent/mibgroup/Makefile \
|
||||
agent/helpers/Makefile \
|
||||
apps/Makefile apps/snmpnetstat/Makefile \
|
||||
man/Makefile mibs/Makefile ov/Makefile \
|
||||
local/Makefile testing/Makefile
|
||||
|
||||
configclean: makefileclean
|
||||
rm -f config.cache config.status config.log \
|
||||
libtool include/net-snmp/net-snmp-config.h \
|
||||
net-snmp-config net-snmp-config-x configure-summary \
|
||||
net-snmp-create-v3-user net-snmp-create-v3-user-x
|
||||
rm -f mibs/.index
|
||||
rm -f include/net-snmp/agent/mib_module_config.h \
|
||||
include/net-snmp/agent/agent_module_config.h \
|
||||
include/net-snmp/library/snmpv3-security-includes.h \
|
||||
include/net-snmp/feature-details.h \
|
||||
snmplib/snmpsm_init.h snmplib/snmpsm_shutdown.h \
|
||||
snmplib/transports/snmp_transport_inits.h \
|
||||
agent/mibgroup/agent_module_includes.h \
|
||||
agent/mibgroup/agent_module_inits.h \
|
||||
agent/mibgroup/agent_module_shutdown.h \
|
||||
agent/mibgroup/agent_module_dot_conf.h \
|
||||
agent/mibgroup/mib_module_includes.h \
|
||||
agent/mibgroup/mib_module_inits.h \
|
||||
agent/mibgroup/mib_module_shutdown.h \
|
||||
agent/mibgroup/mib_module_dot_conf.h \
|
||||
local/snmpconf
|
||||
rm -rf mk
|
||||
rm -f *.core
|
||||
|
||||
#
|
||||
# Configure script related targets
|
||||
#
|
||||
touchit:
|
||||
touch configure include/net-snmp/net-snmp-config.h.in
|
||||
touch config.status
|
||||
touch stamp-h stamp-h.in
|
||||
|
||||
Makefile: Makefile.in config.status Makefile.rules Makefile.top
|
||||
@if test "x$(NOAUTODEPS)" = "x"; then \
|
||||
echo "running config.status because the following file(s) changed:"; \
|
||||
echo " $?"; \
|
||||
./config.status; \
|
||||
else \
|
||||
echo "WARNING: not running config.status"; \
|
||||
fi
|
||||
|
||||
configure_ac = configure.ac \
|
||||
configure.d/config_modules_agent \
|
||||
configure.d/config_modules_lib \
|
||||
configure.d/config_os_functions \
|
||||
configure.d/config_os_headers \
|
||||
configure.d/config_os_libs1 \
|
||||
configure.d/config_os_libs2 \
|
||||
configure.d/config_os_misc1 \
|
||||
configure.d/config_os_misc2 \
|
||||
configure.d/config_os_misc3 \
|
||||
configure.d/config_os_misc4 \
|
||||
configure.d/config_os_progs \
|
||||
configure.d/config_os_struct_members \
|
||||
configure.d/config_project_ipv6_types \
|
||||
configure.d/config_project_manual \
|
||||
configure.d/config_project_paths \
|
||||
configure.d/config_project_perl_python \
|
||||
configure.d/config_project_types \
|
||||
configure.d/config_project_with_enable
|
||||
|
||||
$(srcdir)/include/net-snmp/net-snmp-config.h.in: stamp-h.in
|
||||
$(srcdir)/stamp-h.in: $(configure_ac) acconfig.h
|
||||
@if test "x$(NOAUTODEPS)" = "x" -a "x$(AUTOHEADER)" != "x:"; then \
|
||||
cd ${srcdir} && LC_COLLATE=C $(AUTOHEADER); \
|
||||
echo timestamp > ${srcdir}/stamp-h.in; \
|
||||
else \
|
||||
echo "WARNING: not running autoheader"; \
|
||||
fi
|
||||
|
||||
include/net-snmp/net-snmp-config.h: stamp-h
|
||||
stamp-h: include/net-snmp/net-snmp-config.h.in config.status
|
||||
@if test "x$(NOAUTODEPS)" = "x"; then \
|
||||
echo "running config.status because the following file(s) changed:"; \
|
||||
echo " $?"; \
|
||||
./config.status; \
|
||||
echo timestamp > stamp-h; \
|
||||
else \
|
||||
echo "WARNING: not running config.status"; \
|
||||
fi
|
||||
|
||||
$(srcdir)/configure: $(configure_ac) aclocal.m4
|
||||
@if test "x$(NOAUTODEPS)" = "x" -a "x$(AUTOCONF)" != "x:"; then \
|
||||
cd ${srcdir} && $(AUTOCONF); \
|
||||
echo "Please run configure now."; \
|
||||
sh -c exit 2; \
|
||||
else \
|
||||
echo "WARNING: not running autoconf"; \
|
||||
fi
|
||||
|
||||
gendir=dist/generation-scripts
|
||||
generation-scripts: generation-scripts-dirs $(gendir)/gen-transport-headers $(gendir)/gen-security-headers
|
||||
|
||||
$(gendir)/gen-variables: $(gendir)/gen-variables.in
|
||||
./config.status
|
||||
|
||||
generation-scripts-dirs:
|
||||
@if [ ! -d dist ] ; then \
|
||||
mkdir dist ; \
|
||||
fi
|
||||
@if [ ! -d dist/generation-scripts ] ; then \
|
||||
mkdir dist/generation-scripts ; \
|
||||
fi
|
||||
|
||||
$(gendir)/gen-transport-headers: $(gendir)/gen-transport-headers.in $(gendir)/gen-variables
|
||||
rm -f $@
|
||||
autoconf -o $@ $<
|
||||
chmod a+x $@
|
||||
|
||||
$(gendir)/gen-security-headers: $(gendir)/gen-security-headers.in $(gendir)/gen-variables
|
||||
rm -f $@
|
||||
autoconf -o $@ $<
|
||||
chmod a+x $@
|
||||
|
||||
config.status: configure
|
||||
@if test "x$(NOAUTODEPS)" = "x"; then \
|
||||
echo "running config.status because $? changed"; \
|
||||
./config.status --recheck; \
|
||||
else \
|
||||
echo "WARNING: not running config.status --recheck"; \
|
||||
fi
|
||||
|
||||
#
|
||||
# Emacs TAGS file
|
||||
#
|
||||
TAGS:
|
||||
$(FIND) $(srcdir) -path $(srcdir)/dist/rpm -prune -o -name '*.[ch]' -print | etags -
|
||||
|
||||
#
|
||||
# Internal distribution packaging, etc.
|
||||
#
|
||||
#tag:
|
||||
# @if test "x$(VERSION)" = "x"; then \
|
||||
# echo "you need to supply a VERSION string."; \
|
||||
# exit 2; \
|
||||
# fi
|
||||
# ${srcdir}/agent/mibgroup/versiontag $(VERSION) tag
|
||||
|
||||
tar:
|
||||
@if test "x$(VERSION)" = "x"; then \
|
||||
echo "you need to supply a VERSION string."; \
|
||||
exit 2; \
|
||||
fi
|
||||
${srcdir}/agent/mibgroup/versiontag $(VERSION) tar
|
||||
|
||||
tarclean:
|
||||
@if test -x ${srcdir}/agent/mibgroup/versiontag ; then \
|
||||
${srcdir}/agent/mibgroup/versiontag Ext clean ; \
|
||||
fi
|
||||
|
||||
checks:
|
||||
$(MAKE) -k makefilecheck commentcheck warningcheck dependcheck \
|
||||
assertcheck perlcalloccheck
|
||||
|
||||
dependcheck:
|
||||
@echo "Checking for full paths in dependency files..."
|
||||
@if grep -n -E "^/" `$(FIND) $(top_srcdir) -name Makefile.depend`; then false; fi
|
||||
|
||||
warningcheck:
|
||||
@echo "Checking for cpp warnings..."
|
||||
@if grep -n "#warning" `$(FIND) $(top_srcdir) -name \*.\[ch\]`; then false; fi
|
||||
|
||||
assertcheck:
|
||||
@echo "Checking for non-snmp asserts..."
|
||||
@if grep -n -w "assert" `$(FIND) $(top_srcdir) -name \*.\[ch\] | grep -v snmp_assert.h | egrep -v 'perl/.*c' | grep -v openssl`; then false; fi
|
||||
|
||||
commentcheck:
|
||||
@echo "Checking for C++ style comments..."
|
||||
@if grep -n -E "([^:)n]|^)//" `$(FIND) $(top_srcdir) -path './win32' -prune -o -name \*.\[ch\] | grep -v agent/mibgroup/winExtDLL.c`; then false; fi
|
||||
|
||||
makefilecheck:
|
||||
@echo "Checking for non-portable Makefile constructs..."
|
||||
@if grep -n "\.c=" `$(FIND) $(top_srcdir) -name .svn -prune -o -path ./Makefile.in -prune -o -name "Makefile.*" -print`; then false; fi
|
||||
|
||||
# Invoking calloc() directly or indirectly from a Perl XSUB and freeing that
|
||||
# memory by calling free() from the XSUB is a sure way to trigger "Free to
|
||||
# wrong pool" errors on Windows.
|
||||
perlcalloccheck:
|
||||
@echo "Checking for calloc() in Perl's external subroutines ..."
|
||||
@if grep -nwE 'calloc|SNMP_MALLOC_STRUCT|SNMP_MALLOC_TYPEDEF' `$(FIND) $(top_srcdir) -name '*.xs'`; then false; fi
|
||||
|
||||
dist: tar
|
||||
|
||||
FAQ.html:
|
||||
local/FAQ2HTML FAQ
|
||||
|
||||
.PHONY: docs docsdir mancp testdirs test TAGS
|
||||
# note: tags and docs are phony to force rebulding
|
||||
.PHONY: snmplib agent apps \
|
||||
snmpget snmpbulkget snmpwalk snmpbulkwalk snmptranslate snmpstatus \
|
||||
snmpdelta snmptable snmptest snmpset snmpusm snmpvacm snmpgetnext \
|
||||
encode_keychange snmpdf snmptrap snmptrapd
|
||||
.PHONY: perlfeatures pythonfeatures
|
||||
@@ -1,475 +0,0 @@
|
||||
|
||||
#
|
||||
# standard target definitions. Set appropriate variables to make use of them.
|
||||
#
|
||||
# note: the strange use of the "it" variable is for shell parsing when
|
||||
# there is no targets to install for that rule.
|
||||
#
|
||||
|
||||
# the standard items to build: libraries, bins, and sbins
|
||||
STANDARDTARGETS =$(INSTALLLIBS) $(INSTALLBINPROGS) $(INSTALLSBINPROGS)
|
||||
STANDARDCLEANTARGETS=$(INSTALLLIBS) $(INSTALLPOSTLIBS) $(INSTALLBINPROGS) $(INSTALLSBINPROGS) $(INSTALLUCDLIBS)
|
||||
|
||||
standardall: subdirs $(STANDARDTARGETS)
|
||||
|
||||
objs: ${OBJS} ${LOBJS}
|
||||
|
||||
# features require that subdirs be made *first* to get dependency
|
||||
# collection processed in the right order
|
||||
.PHONY: features ftobjs ftsubdirs
|
||||
features: $(FTOTHERTARGS) ftsubdirs ftobjs $(FEATUREFILE)
|
||||
ftobjs: $(FTOBJS)
|
||||
$(FEATUREFILE): $(FTOBJS) $(top_builddir)/include/net-snmp/feature-details.h
|
||||
cat $(FTOBJS) > $(FEATUREFILE).in
|
||||
$(FEATUREPROCESS) $(FEATUREFILE) $(top_builddir)/include/net-snmp/feature-details.h @FEATURE_REMOVE_FLAGS@ @FEATURE_ADD_FLAGS@
|
||||
ftsubdirs:
|
||||
@if test "$(FTSUBDIRS)" != ""; then \
|
||||
SUBDIRS="$(FTSUBDIRS)" ; \
|
||||
else \
|
||||
SUBDIRS="$(SUBDIRS)" ; \
|
||||
fi ; \
|
||||
if test "$$SUBDIRS" != ""; then \
|
||||
it="$$SUBDIRS" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making features in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) features ) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
.PHONY: cleanfeatures cleanfeaturessubdirs
|
||||
cleanfeatures: cleanfeaturessubdirs
|
||||
rm -f $(FTOBJS)
|
||||
rm -f $(FEATUREFILE)
|
||||
rm -f $(top_builddir)/include/net-snmp/feature-details.h
|
||||
|
||||
cleanfeaturessubdirs:
|
||||
@if test "$(FTSUBDIRS)" != ""; then \
|
||||
SUBDIRS="$(FTSUBDIRS)" ; \
|
||||
else \
|
||||
SUBDIRS="$(SUBDIRS)" ; \
|
||||
fi ; \
|
||||
if test "$$SUBDIRS" != ""; then \
|
||||
it="$$SUBDIRS" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making cleanfeatures in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) cleanfeatures ) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
# feature-check definitions
|
||||
.SUFFIXES: .ft
|
||||
.c.ft:
|
||||
@test -f $(top_builddir)/include/net-snmp/feature-details.h || \
|
||||
echo "/* Generated by make. Do not modify directly */" \
|
||||
> $(top_builddir)/include/net-snmp/feature-details.h
|
||||
$(FEATURECHECK) --feature-global $(top_builddir)/include/net-snmp/feature-details.h $(mysubdir) $< $@ $(CC) -E $(CPPFLAGS) $(CFLAGS) -c
|
||||
|
||||
subdirs:
|
||||
@if test "$(SUBDIRS)" != ""; then \
|
||||
it="$(SUBDIRS)" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making all in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) ) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
# installlibs handles local, ucd and subdir libs. need to do subdir libs
|
||||
# before bins, sinze those libs may be needed for successful linking
|
||||
install: installlocalheaders @installucdheaders@ \
|
||||
installlibs \
|
||||
installlocalbin installlocalsbin \
|
||||
installsubdirs $(OTHERINSTALL)
|
||||
|
||||
uninstall: uninstalllibs uninstallbin uninstallsbin uninstallheaders \
|
||||
uninstallsubdirs $(OTHERUNINSTALL)
|
||||
|
||||
installprogs: installbin installsbin
|
||||
|
||||
#
|
||||
# headers
|
||||
#
|
||||
# set INSTALLHEADERS to a list of things to install in each makefile.
|
||||
# set INSTALLBUILTINCLUDEHEADERS a list built and placed into include/net-snmp/
|
||||
# set INSTALLBUILTHEADERS to a list of things to install from builddir
|
||||
# set INSTALLSUBDIRHEADERS and INSTALLSUBDIR to subdirectory headers
|
||||
# set INSTALLSUBDIRHEADERS2 and INSTALLSUBDIR2 to more subdirectory headers
|
||||
# set INSTALLBUILTSUBDIRHEADERS and INSTALLBUILTSUBDIR to a list from builddir
|
||||
#
|
||||
installheaders: installlocalheaders @installucdheaders@ installsubdirheaders
|
||||
|
||||
installlocalheaders:
|
||||
@if test "$(INSTALLBUILTINCLUDEHEADERS)" != "" ; then \
|
||||
echo creating directory $(INSTALL_PREFIX)$(includedir) ; \
|
||||
it="$(INSTALLBUILTINCLUDEHEADERS)" ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/library ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/agent ; \
|
||||
for i in $$it ; do \
|
||||
$(INSTALL_DATA) include/net-snmp/$$i $(INSTALL_PREFIX)$(includedir)/$$i ; \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/$$i" ; \
|
||||
done \
|
||||
fi
|
||||
@if test "$(INSTALLHEADERS)" != "" ; then \
|
||||
echo creating directory $(INSTALL_PREFIX)$(includedir) ; \
|
||||
it="$(INSTALLHEADERS)" ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir) ; \
|
||||
for i in $$it ; do \
|
||||
$(INSTALL_DATA) $(top_srcdir)/include/net-snmp/$$i $(INSTALL_PREFIX)$(includedir) ; \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(includedir)" ; \
|
||||
done \
|
||||
fi
|
||||
@if test "$(INSTALLBUILTHEADERS)" != "" ; then \
|
||||
echo creating directory $(INSTALL_PREFIX)$(includedir) ; \
|
||||
it="$(INSTALLBUILTHEADERS)" ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir) ; \
|
||||
for i in $$it ; do \
|
||||
$(INSTALL_DATA) $$i $(INSTALL_PREFIX)$(includedir) ; \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(includedir)" ; \
|
||||
done \
|
||||
fi
|
||||
@if test "$(INCLUDESUBDIRHEADERS)" != "" ; then \
|
||||
echo creating directory $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR) ; \
|
||||
it="$(INCLUDESUBDIRHEADERS)" ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR) ; \
|
||||
for i in $$it ; do \
|
||||
$(INSTALL_DATA) $(top_srcdir)/include/net-snmp/$(INCLUDESUBDIR)/$$i $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR) ; \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR)" ; \
|
||||
done \
|
||||
fi
|
||||
@if test "$(INCLUDESUBDIRHEADERS2)" != "" ; then \
|
||||
echo creating directory $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2) ; \
|
||||
it="$(INCLUDESUBDIRHEADERS2)" ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2) ; \
|
||||
for i in $$it ; do \
|
||||
$(INSTALL_DATA) $(top_srcdir)/include/net-snmp/$(INCLUDESUBDIR2)/$$i $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2) ; \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2)" ; \
|
||||
done \
|
||||
fi
|
||||
@if test "$(INSTALLBUILTSUBDIRHEADERS)" != "" ; then \
|
||||
echo creating directory $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR) ; \
|
||||
it="$(INSTALLBUILTSUBDIRHEADERS)" ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR) ; \
|
||||
for i in $$it ; do \
|
||||
$(INSTALL_DATA) $$i $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR) ; \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR)" ; \
|
||||
done \
|
||||
fi
|
||||
|
||||
installucdheaders:
|
||||
@if test "$(INSTALLUCDHEADERS)" != "" ; then \
|
||||
echo creating directory $(INSTALL_PREFIX)$(ucdincludedir) ; \
|
||||
it="$(INSTALLUCDHEADERS)" ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(ucdincludedir) ; \
|
||||
for i in $$it ; do \
|
||||
$(INSTALL_DATA) $(top_srcdir)/include/ucd-snmp/$$i $(INSTALL_PREFIX)$(ucdincludedir) ; \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(ucdincludedir)" ; \
|
||||
done \
|
||||
fi
|
||||
|
||||
installsubdirheaders:
|
||||
@if test "$(SUBDIRS)" != ""; then \
|
||||
it="$(SUBDIRS)" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making installheaders in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) installheaders) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
uninstallheaders:
|
||||
@if test "$(INSTALLHEADERS)" != "" ; then \
|
||||
it="$(INSTALLHEADERS)" ; \
|
||||
for i in $$it ; do \
|
||||
rm -f $(INSTALL_PREFIX)$(includedir)/$$i ; \
|
||||
echo "removing $$i from $(INSTALL_PREFIX)$(includedir)" ; \
|
||||
done \
|
||||
fi
|
||||
@if test "$(INSTALLBUILTHEADERS)" != "" ; then \
|
||||
it="$(INSTALLBUILTHEADERS)" ; \
|
||||
for i in $$it ; do \
|
||||
rm -f $(INSTALL_PREFIX)$(includedir)/`basename $$i` ; \
|
||||
echo "removing $$i from $(INSTALL_PREFIX)$(includedir)" ; \
|
||||
done \
|
||||
fi
|
||||
@if test "$(INCLUDESUBDIRHEADERS)" != "" ; then \
|
||||
it="$(INCLUDESUBDIRHEADERS)" ; \
|
||||
for i in $$it ; do \
|
||||
rm -f $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR)/$$i ; \
|
||||
echo "removing $$i from $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR)" ; \
|
||||
done \
|
||||
fi
|
||||
@if test "$(INCLUDESUBDIRHEADERS2)" != "" ; then \
|
||||
it="$(INCLUDESUBDIRHEADERS2)" ; \
|
||||
for i in $$it ; do \
|
||||
rm -f $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2)/$$i ; \
|
||||
echo "removing $$i from $(INSTALL_PREFIX)$(includedir)/$(INCLUDESUBDIR2)" ; \
|
||||
done \
|
||||
fi
|
||||
@if test "$(INSTALLBUILTSUBDIRHEADERS)" != "" ; then \
|
||||
it="$(INSTALLBUILTSUBDIRHEADERS)" ; \
|
||||
for i in $$it ; do \
|
||||
rm -f $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR)/`basename $$i` ; \
|
||||
echo "removing $$i from $(INSTALL_PREFIX)$(includedir)/$(INSTALLBUILTSUBDIR)" ; \
|
||||
done \
|
||||
fi
|
||||
|
||||
#
|
||||
# libraries
|
||||
#
|
||||
# set INSTALLLIBS to a list of things to install in each makefile.
|
||||
#
|
||||
installlibs: installlocallibs @installucdlibs@ installsubdirlibs installpostlibs
|
||||
|
||||
installlocallibs: $(INSTALLLIBS)
|
||||
@if test "$(INSTALLLIBS)" != ""; then \
|
||||
it="$(INSTALLLIBS)" ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(libdir) ; \
|
||||
$(INSTALL) $(INSTALLLIBS) $(INSTALL_PREFIX)$(libdir) ; \
|
||||
for i in $$it ; do \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(libdir)"; \
|
||||
$(RANLIB) $(INSTALL_PREFIX)$(libdir)/$$i ; \
|
||||
done ; \
|
||||
$(LIB_LDCONFIG_CMD) ; \
|
||||
fi
|
||||
|
||||
installpostlibs: $(INSTALLPOSTLIBS)
|
||||
@if test "$(INSTALLPOSTLIBS)" != ""; then \
|
||||
it="$(INSTALLPOSTLIBS)" ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(libdir) ; \
|
||||
$(INSTALL) $(INSTALLPOSTLIBS) $(INSTALL_PREFIX)$(libdir) ; \
|
||||
for i in $$it ; do \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(libdir)"; \
|
||||
$(RANLIB) $(INSTALL_PREFIX)$(libdir)/$$i ; \
|
||||
done ; \
|
||||
$(LIB_LDCONFIG_CMD) ; \
|
||||
fi
|
||||
|
||||
installucdlibs: $(INSTALLUCDLIBS)
|
||||
@if test "$(INSTALLUCDLIBS)" != ""; then \
|
||||
it="$(INSTALLUCDLIBS)" ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(libdir) ; \
|
||||
$(INSTALL) $(INSTALLUCDLIBS) $(INSTALL_PREFIX)$(libdir) ; \
|
||||
for i in $$it ; do \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(libdir)"; \
|
||||
$(RANLIB) $(INSTALL_PREFIX)$(libdir)/$$i ; \
|
||||
done ; \
|
||||
$(LIB_LDCONFIG_CMD) ; \
|
||||
fi
|
||||
|
||||
installsubdirlibs:
|
||||
@if test "$(SUBDIRS)" != ""; then \
|
||||
it="$(SUBDIRS)" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making installlibs in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) installlibs) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
uninstalllibs:
|
||||
@if test "$(INSTALLLIBS)" != ""; then \
|
||||
it="$(INSTALLLIBS)" ; \
|
||||
for i in $$it ; do \
|
||||
$(UNINSTALL) $(INSTALL_PREFIX)$(libdir)/$$i ; \
|
||||
echo "removing $$i from $(INSTALL_PREFIX)$(libdir)"; \
|
||||
done \
|
||||
fi
|
||||
|
||||
#
|
||||
# normal bin binaries
|
||||
#
|
||||
# set INSTALLBINPROGS to a list of things to install in each makefile.
|
||||
#
|
||||
installbin: installlocalbin installsubdirbin
|
||||
|
||||
installlocalbin: $(INSTALLBINPROGS)
|
||||
@if test "$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" != " "; then \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(bindir) ; \
|
||||
it="$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" ; \
|
||||
$(INSTALL) $(INSTALLBINPROGS) $(INSTALLBINSCRIPTS) $(INSTALL_PREFIX)$(bindir) ; \
|
||||
for i in $$it ; do \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(bindir)"; \
|
||||
done \
|
||||
fi
|
||||
|
||||
installsubdirbin:
|
||||
@if test "$(SUBDIRS)" != ""; then \
|
||||
it="$(SUBDIRS)" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making installbin in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) installbin) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
uninstallbin:
|
||||
@if test "$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" != " "; then \
|
||||
it="$(INSTALLBINPROGS) $(INSTALLBINSCRIPTS)" ; \
|
||||
for i in $$it ; do \
|
||||
$(UNINSTALL) $(INSTALL_PREFIX)$(bindir)/$$i ; \
|
||||
echo "removing $$i from $(INSTALL_PREFIX)$(bindir)"; \
|
||||
done \
|
||||
fi
|
||||
|
||||
#
|
||||
# sbin binaries
|
||||
#
|
||||
# set INSTALLSBINPROGS to a list of things to install in each makefile.
|
||||
#
|
||||
installsbin: installlocalsbin installsubdirsbin
|
||||
|
||||
installlocalsbin: $(INSTALLSBINPROGS)
|
||||
@if test "$(INSTALLSBINPROGS)" != ""; then \
|
||||
it="$(INSTALLSBINPROGS)" ; \
|
||||
$(SHELL) $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(sbindir) ; \
|
||||
$(INSTALL) $(INSTALLSBINPROGS) $(INSTALL_PREFIX)$(sbindir) ; \
|
||||
for i in $$it ; do \
|
||||
echo "installing $$i in $(INSTALL_PREFIX)$(sbindir)"; \
|
||||
done \
|
||||
fi
|
||||
|
||||
installsubdirsbin:
|
||||
@if test "$(SUBDIRS)" != ""; then \
|
||||
it="$(SUBDIRS)" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making installsbin in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) installsbin) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
uninstallsbin:
|
||||
@if test "$(INSTALLSBINPROGS)" != ""; then \
|
||||
it="$(INSTALLSBINPROGS)" ; \
|
||||
for i in $$it ; do \
|
||||
$(UNINSTALL) $(INSTALL_PREFIX)$(sbindir)/$$i ; \
|
||||
echo "removing $$i from $(INSTALL_PREFIX)$(sbindir)"; \
|
||||
done \
|
||||
fi
|
||||
|
||||
#
|
||||
# general make install target for subdirs
|
||||
#
|
||||
installsubdirs:
|
||||
@if test "$(SUBDIRS)" != ""; then \
|
||||
it="$(SUBDIRS)" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making install in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) install) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
uninstallsubdirs:
|
||||
@if test "$(SUBDIRS)" != ""; then \
|
||||
it="$(SUBDIRS)" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making uninstall in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) uninstall) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
#
|
||||
# cleaning targets
|
||||
#
|
||||
clean: cleansubdirs $(OTHERCLEANTODOS)
|
||||
$(LIBTOOLCLEAN) ${OBJS} ${LOBJS} ${FTOBJS} core $(STANDARDCLEANTARGETS) $(OTHERCLEANTARGETS)
|
||||
|
||||
cleansubdirs:
|
||||
@if test "$(SUBDIRS)" != ""; then \
|
||||
it="$(SUBDIRS)" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making clean in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) clean) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
lint:
|
||||
lint -nhx $(CSRCS)
|
||||
|
||||
#
|
||||
# wacky dependency building.
|
||||
#
|
||||
depend: dependdirs
|
||||
@if test -f Makefile.depend ; then \
|
||||
makedepend `echo $(CPPFLAGS) | sed 's/-f[-a-z]*//g'` -o .lo $(srcdir)/*.c $(srcdir)/*/*.c ; \
|
||||
fi
|
||||
|
||||
|
||||
nosysdepend: nosysdependdirs
|
||||
@if test -f Makefile.depend ; then \
|
||||
makedepend `echo $(CPPFLAGS) | sed 's/-f[-a-z]*//g'` -o .lo $(srcdir)/*.c $(srcdir)/*/*.c ; \
|
||||
$(PERL) -n -i.bak $(top_srcdir)/makenosysdepend.pl Makefile ; \
|
||||
fi
|
||||
|
||||
distdepend: nosysdepend distdependdirs
|
||||
@if test -f Makefile.depend ; then \
|
||||
$(PERL) $(top_srcdir)/makefileindepend.pl ; \
|
||||
fi
|
||||
|
||||
dependdirs:
|
||||
@if test "$(SUBDIRS)" != ""; then \
|
||||
it="$(SUBDIRS)" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making depend in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) depend) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
nosysdependdirs:
|
||||
@if test "$(SUBDIRS)" != ""; then \
|
||||
it="$(SUBDIRS)" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making nosysdepend in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) nosysdepend) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
distdependdirs:
|
||||
@if test "$(SUBDIRS)" != ""; then \
|
||||
it="$(SUBDIRS)" ; \
|
||||
for i in $$it ; do \
|
||||
echo "making distdepend in `pwd`/$$i"; \
|
||||
( cd $$i ; $(MAKE) distdepend) ; \
|
||||
if test $$? != 0 ; then \
|
||||
exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
|
||||
# These aren't real targets, let gnu's make know that.
|
||||
.PHONY: clean cleansubdirs lint \
|
||||
install installprogs installheaders installlibs \
|
||||
installbin installsbin installsubdirs \
|
||||
all subdirs standardall objs features \
|
||||
depend nosysdepend distdepend dependdirs nosysdependdirs distdependdirs
|
||||
@@ -1,121 +0,0 @@
|
||||
#
|
||||
# Minimum environment and virtual path setup
|
||||
#
|
||||
SHELL = @SHELL@
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VERSION = @VERSION@
|
||||
@SET_MAKE@
|
||||
|
||||
#
|
||||
# Paths
|
||||
#
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libdir = @libdir@
|
||||
datarootdir = @datarootdir@
|
||||
datadir = @datadir@
|
||||
includedir = @includedir@/net-snmp
|
||||
ucdincludedir = @includedir@/ucd-snmp
|
||||
mandir = @mandir@
|
||||
man1dir = $(mandir)/man1
|
||||
man3dir = $(mandir)/man3
|
||||
man5dir = $(mandir)/man5
|
||||
man8dir = $(mandir)/man8
|
||||
snmplibdir = $(datadir)/snmp
|
||||
mibdir = $(snmplibdir)/mibs
|
||||
persistentdir = @PERSISTENT_DIRECTORY@
|
||||
DESTDIR = @INSTALL_PREFIX@
|
||||
INSTALL_PREFIX = $(DESTDIR)
|
||||
|
||||
#
|
||||
# Programs
|
||||
#
|
||||
INSTALL = $(LIBTOOL) --mode=install @INSTALL@
|
||||
UNINSTALL = $(LIBTOOL) --mode=uninstall rm -f
|
||||
LIBTOOLCLEAN = $(LIBTOOL) --mode=clean rm -f
|
||||
FEATURECHECK = $(top_srcdir)/local/minimalist/feature-check
|
||||
FEATUREPROCESS = $(top_srcdir)/local/minimalist/feature-remove
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
SED = @SED@
|
||||
LN_S = @LN_S@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
PERL = @PERLPROG@
|
||||
PYTHON = @PYTHONPROG@
|
||||
FIND = @FIND@
|
||||
EGREP = @EGREP@
|
||||
|
||||
#
|
||||
# Compiler arguments
|
||||
#
|
||||
CFLAGS = @CFLAGS@ @DEVFLAGS@
|
||||
EXTRACPPFLAGS = @EXTRACPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBTOOL = @LIBTOOL@ @LIBTOOLFLAGS@
|
||||
EXEEXT = @EXEEXT@
|
||||
|
||||
# Misc Compiling Stuff
|
||||
CC = @CC@
|
||||
LINKCC = @LINKCC@
|
||||
|
||||
# use libtool versioning the way they recommend.
|
||||
# The (slightly clarified) rules:
|
||||
#
|
||||
# - If any interfaces/structures have been removed or changed since the
|
||||
# last update, increment current (+5), and set age and revision to 0. Stop.
|
||||
#
|
||||
# - If any interfaces have been added since the last public release, then
|
||||
# increment current and age, and set revision to 0. Stop.
|
||||
#
|
||||
# - If the source code has changed at all since the last update,
|
||||
# then increment revision (c:r:a becomes c:r+1:a).
|
||||
#
|
||||
# Note: maintenance releases (eg 5.2.x) should never have changes
|
||||
# that would require a current to be incremented.
|
||||
#
|
||||
# policy: we increment major releases of LIBCURRENT by 5 starting at
|
||||
# 5.3 was at 10, 5.4 is at 15, ... This leaves some room for needed
|
||||
# changes for past releases if absolutely necessary.
|
||||
#
|
||||
LIBCURRENT = 30
|
||||
LIBAGE = 0
|
||||
LIBREVISION = 3
|
||||
|
||||
LIB_LD_CMD = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) -o
|
||||
LIB_EXTENSION = la
|
||||
LIB_VERSION =
|
||||
LIB_LDCONFIG_CMD = $(LIBTOOL) --mode=finish $(INSTALL_PREFIX)$(libdir)
|
||||
LINK = $(LIBTOOL) --mode=link $(LINKCC)
|
||||
# RANLIB = @RANLIB@
|
||||
RANLIB = :
|
||||
|
||||
# libtool definitions
|
||||
.SUFFIXES: .c .o .lo .rc
|
||||
.c.lo:
|
||||
$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
|
||||
.rc.lo:
|
||||
$(LIBTOOL) --mode=compile --tag=CC windres -o $@ -i $<
|
||||
|
||||
# include paths
|
||||
#
|
||||
SRC_TOP_INCLUDES = -I$(top_srcdir)/include
|
||||
SRC_SNMPLIB_INCLUDES = -I$(top_srcdir)/snmplib
|
||||
SRC_AGENT_INCLUDES = -I$(top_srcdir)/agent
|
||||
SRC_HELPER_INCLUDES = -I$(top_srcdir)/agent/helpers
|
||||
SRC_MIBGROUP_INCLUDES = -I$(top_srcdir)/agent/mibgroup
|
||||
|
||||
BLD_TOP_INCLUDES = -I$(top_builddir)/include $(SRC_TOP_INCLUDES)
|
||||
BLD_SNMPLIB_INCLUDES = -I$(top_builddir)/snmplib $(SRC_SNMPLIB_INCLUDES)
|
||||
BLD_AGENT_INCLUDES = -I$(top_builddir)/agent $(SRC_AGENT_INCLUDES)
|
||||
BLD_HELPER_INCLUDES = -I$(top_builddir)/agent/helpers $(SRC_HELPER_INCLUDES)
|
||||
BLD_MIBGROUP_INCLUDES = -I$(top_builddir)/agent/mibgroup $(SRC_MIBGROUP_INCLUDES)
|
||||
|
||||
TOP_INCLUDES = $(@TOP_INCLUDES@)
|
||||
SNMPLIB_INCLUDES = $(@SNMPLIB_INCLUDES@)
|
||||
AGENT_INCLUDES = $(@AGENT_INCLUDES@)
|
||||
HELPER_INCLUDES = $(@HELPER_INCLUDES@)
|
||||
MIBGROUP_INCLUDES = $(@MIBGROUP_INCLUDES@) @EXTERNAL_MIBGROUP_INCLUDES@
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,104 +0,0 @@
|
||||
--- INTRODUCTION
|
||||
|
||||
Just a quick note on porting and sending me patches:
|
||||
|
||||
First off, you probably should subscribe to
|
||||
net-snmp-coders@lists.sourceforge.net by sending a message to
|
||||
net-snmp-coders-request@lists.sourceforge.net with a subject line of
|
||||
subscribe. This is a mailing list to discuss all oft the coding
|
||||
aspects of the project.
|
||||
|
||||
Additionally, you should probably be developing against the latest
|
||||
snapshot of the source code, which can be obtained through the
|
||||
net-snmp cvs server. Details can be found at
|
||||
http://www.net-snmp.org/cvs/.
|
||||
|
||||
If you send patches to us, it would greatly help us if you sent them
|
||||
to us based on the current checked out copy from CVS. To do this,
|
||||
send us the output of "cvs diff -u" run in the top level net-snmp
|
||||
source tree after you have modified the files that will fix the
|
||||
problem or add the feature you're submitting the patch for.
|
||||
|
||||
Quite a while back I started using the GNU autoconf testing suite to
|
||||
greatly enhance portability. Because of this porting to new
|
||||
architectures is much easier than before. However, new people porting
|
||||
the package to new architectures rarely take advantage of this setup
|
||||
and send me patches with lots of '#ifdef ARCH' type C code in it. Let
|
||||
me say up front, I *hate* this type of coding now (even though I used
|
||||
to use it a lot). What is better is to check for the necessary
|
||||
functionality using the configure script and then use the results of
|
||||
those tests.
|
||||
|
||||
To do this, you need to install the GNU 'autoconf' package which also
|
||||
requires the GNU 'm4' (gm4) package as well. This double installation
|
||||
is extremely easy and shouldn't take you more than 15 minutes max.
|
||||
After that, modify the configure.in and acconfig.h files as needed
|
||||
instead of modifying the config.h or configure files directly. The
|
||||
Makefile will re-produce these files from the first two.
|
||||
|
||||
Worst case: Don't put in #ifdef architecture style statements.
|
||||
Rather, create a new define in the s/ and m/ system specific header
|
||||
files and use those defines to test against in the C code. This
|
||||
should only be done for things that can't be checked using configure
|
||||
though.
|
||||
|
||||
Some autoconf examples:
|
||||
|
||||
--- HEADER FILES
|
||||
|
||||
In configure.in:
|
||||
AC_CHECK_HEADERS(headdir/header.h)
|
||||
|
||||
Then in your source code:
|
||||
#ifdef HAVE_HEADDIR_HEADER_H
|
||||
#include <headdir/header.h>
|
||||
#ENDIF
|
||||
|
||||
--- LIBRARY ROUTIENS
|
||||
|
||||
In configure.in:
|
||||
AC_CHECK_LIB(libexample, example_function)
|
||||
|
||||
Thats it. The Makefiles will automatically link against -llibexample
|
||||
if example_function is found in the library.
|
||||
|
||||
--- FUNCTION CHECKS
|
||||
|
||||
In configure.in:
|
||||
AC_CHECK_FUNCS(example_function)
|
||||
|
||||
In source code:
|
||||
#ifdef HAVE_EXAMPLE_FUNCTION
|
||||
/* use it */
|
||||
#endif
|
||||
|
||||
--- STRUCTURE MEMBER CHECKS
|
||||
|
||||
In configure.in:
|
||||
AC_CHECK_MEMBERS([struct STRUCTURE.MEMBER],,,[[
|
||||
#include lines
|
||||
]])
|
||||
^^^^^^^^^ ^^^^^^ (change)
|
||||
|
||||
In source code:
|
||||
#ifdef HAVE_STRUCT_STRUCTURE_MEMBER
|
||||
/* use it */
|
||||
#endif
|
||||
|
||||
--- READ THE MANUAL
|
||||
|
||||
The GNU autoconf info files are extremely well written and easy to
|
||||
follow. Please check them out.
|
||||
|
||||
I'd be happy to help you through anything you don't understand or
|
||||
through more complex examples (eg, checking for structure parts or
|
||||
existance). I'd be far less happy to get patches ignoring the above
|
||||
request. If you simple can't abide by this, please send the patches
|
||||
anyway, but it'll just take me longer to get them applied.
|
||||
|
||||
Submit the patch to http://www.net-snmp.org/patches/.
|
||||
Please include what version of the net-snmp package it was applied to
|
||||
and state the arcitectures you have tested it on.
|
||||
|
||||
Thanks a lot for the consideration,
|
||||
Wes
|
||||
@@ -1,360 +0,0 @@
|
||||
README file for net-snmp Version: 5.7.3
|
||||
|
||||
DISCLAIMER
|
||||
|
||||
The Authors assume no responsibility for damage or loss of system
|
||||
performance as a direct or indirect result of the use of this
|
||||
software. This software is provided "as is" without express or
|
||||
implied warranty.
|
||||
|
||||
TABLE OF CONTENTS
|
||||
|
||||
Disclaimer
|
||||
Table Of Contents
|
||||
Introduction
|
||||
* Supported Architectures
|
||||
Availability
|
||||
Web Page
|
||||
* Installation
|
||||
Copying And Copyrights
|
||||
* Frequently Asked Questions
|
||||
Helping Out
|
||||
* Code Update Announcements
|
||||
* Mailing Lists
|
||||
Agent Extensibility
|
||||
Example Agent Configuration and Usage
|
||||
Configuration
|
||||
Submitting Bug Reports
|
||||
Closing
|
||||
Thanks
|
||||
|
||||
* = Required Reading.
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
This package was originally based on the CMU 2.1.2.1 snmp code. It
|
||||
has been greatly modified, restructured, enhanced and fixed. It
|
||||
hardly looks the same as anything that CMU has ever released. It
|
||||
was renamed from cmu-snmp to ucd-snmp in 1995 and later renamed from
|
||||
ucd-snmp to net-snmp in November 2000.
|
||||
|
||||
This README file serves as a starting place to learn about the
|
||||
package, but very little of the documentation is contained within
|
||||
this file. The FAQ is an excellent place to start as well.
|
||||
Additionally, there are a bunch of README files for specific
|
||||
architectures and specific features. You might wish to look at some
|
||||
of these other files as well.
|
||||
|
||||
SUPPORTED ARCHITECTURES
|
||||
|
||||
Please see the FAQ for this information.
|
||||
|
||||
Please let us know if you compile it on other OS versions and it
|
||||
works for you so we can add them to the above list.
|
||||
|
||||
Porting: Please! read the PORTING file.
|
||||
|
||||
Also note that many architecture have architecture specific README
|
||||
files, so you should check to see if there is one appropriate to
|
||||
your platform.
|
||||
|
||||
AVAILABILITY
|
||||
|
||||
Download:
|
||||
- http://www.net-snmp.org/download/
|
||||
- ftp://ftp.net-snmp.org/pub/sourceforge/net-snmp/
|
||||
Web page:
|
||||
- http://www.net-snmp.org/
|
||||
Project Wiki:
|
||||
- http://www.net-snmp.org/wiki/
|
||||
Sourceforge Project page:
|
||||
- http://sourceforge.net/projects/net-snmp
|
||||
Mirrors:
|
||||
- US: ftp://ftp.freesnmp.com/mirrors/net-snmp/
|
||||
|
||||
The old ucd-snmp.ucdavis.edu web site and ftp server is now
|
||||
offline and should not be accessed any longer.
|
||||
|
||||
WEB PAGES
|
||||
|
||||
http://www.net-snmp.org/
|
||||
http://sourceforge.net/projects/net-snmp
|
||||
http://www.net-snmp.org/wiki/
|
||||
|
||||
INSTALLATION
|
||||
|
||||
See the INSTALL file distributed with this package.
|
||||
|
||||
COPYING AND COPYRIGHTS
|
||||
|
||||
See the COPYING file distributed with this package.
|
||||
|
||||
FREQUENTLY ASKED QUESTIONS
|
||||
|
||||
See the FAQ file distributed with this package.
|
||||
This is also available on the project Wiki at
|
||||
|
||||
http://www.net-snmp.org/wiki/index.php/FAQ
|
||||
|
||||
so that the wider Net-SNMP community can help maintain it!
|
||||
|
||||
HELPING OUT
|
||||
|
||||
This is a project worked on by people around the net. We'd love
|
||||
your help, but please read the PORTING file first. Also, subscribe
|
||||
to the net-snmp-coders list described below and mention what you're
|
||||
going to work on to make sure no one else is already doing so!
|
||||
You'll also need to keep up to date with the latest code snap shot,
|
||||
which can be obtained from CVS using the information found at
|
||||
http://www.net-snmp.org/cvs/.
|
||||
|
||||
Contributions to the Net-SNMP source code in any form are greatly
|
||||
appreciated. We expect the parties providing such contributions to
|
||||
have the right to contribute them to the Net-SNMP project or that
|
||||
the parties that do have the right have directed the person
|
||||
submitting the contribution to do so. In addition, all contributors
|
||||
need to be aware that if the contribution is accepted and
|
||||
incorporated into the Net-SNMP project, it will be redistributed
|
||||
under the terms of the license agreement used for the entire body of
|
||||
work that comprises the Net-SNMP project (see the COPYING file for
|
||||
details). If this license agreement ever changes the contribution
|
||||
will continue to be released under any new licenses as well. Thank
|
||||
you, in advance, for your gracious contributions.
|
||||
|
||||
CODE UPDATE ANNOUNCEMENTS
|
||||
|
||||
See the NEWS file and the ChangeLog file for details on what has
|
||||
changed between releases.
|
||||
|
||||
We hate broadcasting announce messages to other mailing lists and
|
||||
newsgroups, so there is a mailing list set up to handle release
|
||||
announcements. Any time we put new software out for ftp, we'll mail
|
||||
this fact to net-snmp-announce@lists.sourceforge.net. See the
|
||||
MAILING LISTS section described below to sign up for these
|
||||
announcements.
|
||||
|
||||
We will post new announcements on a very infrequent basis to the
|
||||
other channels (the other snmp mailing lists and newsgroups like
|
||||
comp.protocols.snmp), but only for major code revisions and not for
|
||||
bug-fix patches or small feature upgrades.
|
||||
|
||||
MAILING LISTS
|
||||
|
||||
The lists:
|
||||
|
||||
A number of mailing lists have been created for support of the project:
|
||||
The main ones are:
|
||||
|
||||
net-snmp-announce@lists.sourceforge.net -- For official announcements
|
||||
net-snmp-users@lists.sourceforge.net -- For usage discussions
|
||||
net-snmp-coders@lists.sourceforge.net -- For development discussions
|
||||
|
||||
The -coders list is intended for discussion on development of code
|
||||
that will be shipped as part of the package. The -users list is
|
||||
for general discussion on configuring and using the package,
|
||||
including issues with coding user-developed applications (clients,
|
||||
managers, MIB modules, etc).
|
||||
|
||||
Please do *NOT* send messages to both -users and -coders lists.
|
||||
This is completely unnecessary, and simply serves to further
|
||||
overload (and annoy) the core development team. If in doubt,
|
||||
just use the -users list.
|
||||
|
||||
|
||||
The other lists of possible interest are:
|
||||
|
||||
net-snmp-cvs@lists.sourceforge.net -- For cvs update announcements
|
||||
net-snmp-bugs@lists.sourceforge.net -- For Bug database update announcements
|
||||
net-snmp-patches@lists.sourceforge.net -- For Patch database update announcements
|
||||
|
||||
Please do NOT post messages to these lists (or to the announce list above).
|
||||
Bug reports and Patches should be submitted via the Source Forge tracker
|
||||
system. See the main project web pages for details.
|
||||
|
||||
To subscribe to any of these lists, please see:
|
||||
|
||||
http://www.net-snmp.org/lists/
|
||||
|
||||
|
||||
Archives:
|
||||
The archives for these mailing lists can be found by following links at
|
||||
|
||||
http://www.net-snmp.org/lists/
|
||||
|
||||
AGENT EXTENSIBILITY
|
||||
|
||||
The agent that comes with this package is extensible through use of
|
||||
shell scripts and other methods. See the configuration manual pages
|
||||
(like snmpd.conf) and run the snmpconf perl script for further details.
|
||||
|
||||
You can also extend the agent by writing C code directly. The agent
|
||||
is extremely modular in nature and you need only create new files,
|
||||
re-run configure and re-compile (or link against its libraries). No
|
||||
modification of the distributed source files are necessary. See the
|
||||
following files for details on how to go about this:
|
||||
http://www.net-snmp.org/tutorial-5/toolkit/,
|
||||
agent/mibgroup/examples/*.c
|
||||
|
||||
Also, see the local/mib2c program and its README file for help in
|
||||
turning a textual mib description into a C code template.
|
||||
|
||||
We now support AgentX for subagent extensibility. The net-snmp
|
||||
agent can run as both a master agent and a subagent. Additionally,
|
||||
a toolkit is provided that enables users of it to easily embed a
|
||||
agentx client into external applications. See the tutorial at
|
||||
http://www.net-snmp.org/tutorial-5/toolkit/ for an example of how
|
||||
go about doing this.
|
||||
|
||||
CONFIGURATION
|
||||
|
||||
See the man/snmp.conf.5 manual page.
|
||||
|
||||
For the agent, additionally see the man/snmpd.conf.5 manual page.
|
||||
|
||||
For the snmptrapd, see the man/snmptrapd.conf.5 manual page.
|
||||
|
||||
You can also run the snmpconf perl script to help you create some of
|
||||
these files.
|
||||
|
||||
SUBMITTING BUG REPORTS
|
||||
|
||||
Important: *Please* include what version of the net-snmp (or
|
||||
ucd-snmp) package you are using and what architecture(s) you're
|
||||
using, as well as detailed information about exactly what is wrong.
|
||||
|
||||
To submit a bug report, please use the web interface at
|
||||
http://www.net-snmp.org/bugs/. It is a full-fledged
|
||||
bug-tracking system that will allow you to search for already
|
||||
existing bug reports as well as track the status of your report as
|
||||
it is processed by the core developers.
|
||||
|
||||
If you intend to submit a patch as well, please read the PORTING
|
||||
file before you do so and then submit it to
|
||||
http://www.net-snmp.org/patches/.
|
||||
|
||||
CLOSING
|
||||
|
||||
We love patches. Send some to us! But before you do, please see
|
||||
the 'PORTING' file for information on helping us out with the
|
||||
process of integrating your patches (regardless of whether its a new
|
||||
feature implementation or a new port).
|
||||
|
||||
Also, We're interested if anyone actually uses/likes/hates/whatever
|
||||
this package... Mail us a note and let us know what you think of it!
|
||||
|
||||
Have fun and may it make your life easier,
|
||||
|
||||
The net-snmp developers
|
||||
|
||||
THANKS
|
||||
|
||||
The following people have contributed various patches and
|
||||
improvements. To them we owe our deepest thanks (and you do too!):
|
||||
|
||||
Wes Hardaker <hardaker@users.sourceforge.net>
|
||||
Steve Waldbusser <waldbusser@nextbeacon.com>
|
||||
Dan A. Dickey <ddickey@transition.com>
|
||||
Dave Shield <D.T.Shield@csc.liv.ac.uk>
|
||||
Giovanni S. Marzot <gmarzot@nortelnetworks.com>
|
||||
Niels Baggesen <nba@users.sourceforge.net>
|
||||
Simon Leinen <simon@limmat.switch.ch>
|
||||
David T. Perkins <dperkins@dsperkins.com>
|
||||
Mike Perik <mikep@crt.com>
|
||||
Sanjai Narain <narain@thumper.bellcore.com>
|
||||
francus@metsny.delphi.com
|
||||
Gary Palmer <gpalmer@freebsd.org>
|
||||
Marc G. Fournier <scrappy@ki.net>
|
||||
Gary A. Hayward <gah@bellcore.com>
|
||||
Jennifer Bray <jbray@origin-at.co.uk>
|
||||
Philip Guenther <guenther@gac.edu>
|
||||
Elwyn B Davies <edavies@origin-at.co.uk>
|
||||
Simon Burge <simonb@telstra.com.au>
|
||||
David Paul Zimmerman <dpz@apple.com>
|
||||
Alan Batie <batie@aahz.jf.intel.com>
|
||||
Michael Douglass <mikedoug@texas.net>
|
||||
Ted Rule <Ted_Rule@FLEXTECH.CO.UK>
|
||||
Craig Bevins <craigb@bitcom.net.au>
|
||||
Arther Hyun <arthur@psi.com>
|
||||
Cristian Estan <Cristian.Estan@net.utcluj.ro>
|
||||
Eugene Polovnikov <eugen@rd.zgik.zaporizhzhe.ua>
|
||||
Jakob Ellerstedt <jakob@dynarc.se>
|
||||
Michael J. Slifcak <slif@bellsouth.net>
|
||||
Jonas Olsson <jolsson@erv.ericsson.se>
|
||||
James H. Young <sysjhy@gsu.edu>
|
||||
Jeff Johnson <jbj@redhat.com>
|
||||
Markku Laukkanen <marlaukk@stybba.ntc.nokia.com>
|
||||
Derek Simkowiak <dereks@kd-dev.com>
|
||||
David F. Newman <dnewman@epnet.com>
|
||||
Nick Amato <naamato@merit.edu>
|
||||
Mike Baer <baerm@calweb.com>
|
||||
Patrick Lawrence <pjlawrence@ucdavis.edu>
|
||||
Russ Mundy <mundy@tislabs.com>
|
||||
Olafur Gudmundsson <ogud@tislabs.com>
|
||||
David Reeder <dreeder@tislabs.com>
|
||||
Ed Lewis <lewis@tislabs.com>
|
||||
Bill Babson <wbabson@tislabs.com>
|
||||
Chris Smith <csmith@platform.com>
|
||||
Mike Michaud <mikemichaud@earthlink.net>
|
||||
Andy Hood <ahood@westpac.com.au>
|
||||
Robert Story <rstory@freesnmp.com>
|
||||
Bert Driehuis <driehuis@playbeing.org>
|
||||
Juergen Schoenwaelder <schoenw@ibr.cs.tu-bs.de>
|
||||
Frank Strauss <strauss@ibr.cs.tu-bs.de>
|
||||
Ragnar Kj<4B>rstad <ucd@ragnark.vestdata.no>
|
||||
Jochen Kmietsch <jochen.kmietsch@tu-clausthal.de>
|
||||
Jun-ichiro itojun Hagino <itojun@iijlab.net>
|
||||
John L Villalovos <john.l.villalovos@intel.com>
|
||||
Christoph Mammitzsch <Christoph.Mammitzsch@tu-clausthal.de>
|
||||
Arne Oesleboe <Arne.Oesleboe@item.ntnu.no>
|
||||
Jeff Cours <jeff@ultradns.com>
|
||||
Karl Schilke <karl_schilke@eli.net>
|
||||
John Naylon <jbpn@cambridgebroadband.com>
|
||||
Ken Hornstein <kenh@cmf.nrl.navy.mil>
|
||||
Martin Oldfield <m@mail.tc>
|
||||
Harrie Hazewinkel <harrie@users.sourceforge.net>
|
||||
Mark Ferlatte <ferlatte@users.sourceforge.net>
|
||||
Marus Meissner <marcusmeissner@users.sourceforge.net>
|
||||
Stephan Wenzer <stephanwenzel@users.sourceforge.net>
|
||||
Ron Mevissen <ron.mevissen@eed.ericsson.se>
|
||||
T.J. Mather <tjmather@tjmather.com>
|
||||
Craig Setera <seterajunk@charter.net>
|
||||
Katsuhisa ABE <abekatsu@cysols.com>
|
||||
Axel Kittenberger <Axel.Kittenberger@maxxio.com>
|
||||
Johannes Schmidt-Fischer <jsf@InterFace-AG.com>
|
||||
Jeffrey Watson <nostaw@users.sourceforge.net>
|
||||
Bruce Shaw <Bruce.Shaw@gov.ab.ca>
|
||||
Stefan Radman <sradman@users.sourceforge.net>
|
||||
Stephen J. Friedl <sjfriedl@users.sourceforge.net>
|
||||
Alex Burger <alex_b@users.sourceforge.net>
|
||||
Christophe Varoqui <ext.devoteam.varoqui@sncf.fr>
|
||||
Srikanth Pindiproli <sripindip@users.sourceforge.net>
|
||||
Kevin Graham <kevgraham7@users.sourceforge.net>
|
||||
Xiaofeng Ling <xfling@users.sourceforge.net>
|
||||
Brandon Knitter <knitterb@bl...>
|
||||
Andrew Findlay <andrew.findlay@skills-1st.co.uk>
|
||||
Ron Tabor <rtabor@users.sourceforge.net>
|
||||
Peter Warasin <drg-r3@users.sourceforge.net>
|
||||
Bob Rowlands <robert.rowlands@sun.com>
|
||||
Peter Hicks <Peter.Hicks@POGGS.CO.UK>
|
||||
Andy Smith <wasmith32@earthlink.net>
|
||||
Nick Barkas <nbarkas@users.sourceforge.net>
|
||||
Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
Geert De Peuter <geert@depeuter.org>
|
||||
Magnus Fromreide <magfr@lysator.liu.se>
|
||||
Marcus Meissner <marcusmeissner@users.sourceforge.net>
|
||||
Andrew Rucker Jones <arjones@users.sourceforge.net>
|
||||
Dai.H. <dg-f@users.sourceforge.net>
|
||||
Thomas Anders <tanders@users.sourceforge.net>
|
||||
Vladislav Bogdanov <slava_reg@nsys.by>
|
||||
Peter Martin <pnmartin@users.sourceforge.net>
|
||||
Thomas Lackey <telackey@users.sourceforge.net>
|
||||
Joe Buehler <jbuehler@spirentcom.com>
|
||||
Anders Persson <apersson@users.sourceforge.net>
|
||||
Rojer <rojer@users.sourceforge.net>
|
||||
Bart Van Assche <bart.vanassche@gmail.com>
|
||||
Pablo Carboni <pcarboni@users.sourceforge.net>
|
||||
Bill Fenner <fenner@gmail.com>
|
||||
Brian Sipos <bsiposrkf@users.sourceforge.net>
|
||||
|
||||
We've probably forgotten people on this list. Let us know if you've
|
||||
contributed code and we've left you out.
|
||||
@@ -1,118 +0,0 @@
|
||||
1. INTRODUCTION
|
||||
|
||||
Last revision 05/30/2003
|
||||
|
||||
This document describes the process to build net-snmp-5.0.8 stack for embedded linux
|
||||
platforms based on the following Matsushita(Panasonic) processors family.
|
||||
|
||||
AM33,AM34
|
||||
MN10300,MN103E0HRA
|
||||
|
||||
The same procedure can be followed to build the net-snmp stack for other Matsushita
|
||||
family of processors also.
|
||||
|
||||
2. ENVIRONMENT
|
||||
|
||||
Host Machine : Linux 7.1 or later ( with nfs server or samba server installed ).
|
||||
Target Machine : Am33 Based Embedded platform.
|
||||
Cross-compiler : GNU compiler version 3.1 for AM33/AM34/MN10300/MN103E010HRA
|
||||
am33_2.0-linux-gnu-gcc
|
||||
Host-Target Setup : Samba mount or NFS mount
|
||||
|
||||
|
||||
2. CONFIGURATION
|
||||
|
||||
The following configuration flags can be used to create Makefile.You can reaplce
|
||||
some of the configuration flags according to your platform and compiler.
|
||||
|
||||
Perl support was NOT compiled in due to unavailability of perl support for
|
||||
AM3X platform at this time.
|
||||
|
||||
The parameters passed to configure are as follows...
|
||||
( you can down load the script configure.am33 script )
|
||||
|
||||
--with-cc=am33_2.0-linux-gnu-gcc
|
||||
--host=i686-pc-linux-gnu
|
||||
--target=am33-linux ( Can be removed, if it stops building process )
|
||||
--disable-dlopen
|
||||
--disable-dlclose
|
||||
--disable-dlerror
|
||||
--with-endianness=little
|
||||
--with-openssl=no
|
||||
--with-cflags="-g -mam33 -O2 -static"
|
||||
--oldincludedir=./usr/local
|
||||
--prefix=./usr/local
|
||||
--exec-prefix=./usr/local
|
||||
--with-persistent-directory=./usr/local
|
||||
|
||||
These parameters passed are depending on the capabilities available for the
|
||||
AM33/AM34 development environment at the time of build. These parameter can be
|
||||
changed depending on the avialable capabilities and desired preferences.
|
||||
|
||||
You can use the below shell script directly to create Makefiles and other files.
|
||||
This script also insttals all binaries ,libraries in usr directory in the directory
|
||||
in which this scrip executed.
|
||||
|
||||
# configure.am33
|
||||
#--------------------------------------------------------------------------
|
||||
./configure --with-cc=am33_2.0-linux-gnu-gcc --host=i686-pc-linux-gnu \
|
||||
--disable-dlopen --target=am33-linux --disable-dlclose --disable-dlerror \
|
||||
--with-endianness=little --with-openssl=no --with-cflags="-g -mam33 -O2 -static" \
|
||||
--oldincludedir=./usr/local --prefix=./usr/local --exec-prefix=./usr/local \
|
||||
--with-persistent-directory=./usr/local
|
||||
|
||||
make
|
||||
make install
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
2. INSTALLATION
|
||||
|
||||
Find a partition with 60 Mb available space which will be mounted on to target machine.
|
||||
Copy or ftp the binary to this location ( copy entire usr directory tree ).
|
||||
Copy net-snmp configuration files from host machine (.snmp directory) on to target / directory.
|
||||
snmp configuration files can be created on host machine by running sbmpconf command. Make sure
|
||||
that host is using snmpconf from net-snmp-5.0.8 version.
|
||||
|
||||
-:ON AM3X target Shell :-
|
||||
Mount the above directory on AM3X platform either using NFS or sambs clients on target machine.
|
||||
|
||||
If you are running a previous version, stop the daemon
|
||||
|
||||
ps -ef | grep snmp
|
||||
|
||||
will return something like:
|
||||
|
||||
root 17736 1 - Jan 26 ? 0:00 /usr/local/sbin/snmpd
|
||||
|
||||
the PID is 17736, so you need to type
|
||||
|
||||
kill {PID}
|
||||
|
||||
in our example this would be
|
||||
|
||||
kill 17736.
|
||||
|
||||
cd /usr/local/sbin
|
||||
./snmpd
|
||||
|
||||
2. TESTING
|
||||
|
||||
You will need to know your SNMP community. For this example, we will use "public".
|
||||
|
||||
snmpwalk -v 2c -m ALL -c public -t 100 localhost .1.3 > snmpwalk.txt
|
||||
more snmpwalk.txt
|
||||
|
||||
This should return a considerable amount of output.
|
||||
|
||||
3. ISSUES
|
||||
|
||||
You may not see correct target name in the build summary. Just ignore it.
|
||||
|
||||
|
||||
Please refer net-snmp documentation for more information...
|
||||
|
||||
|
||||
Srinivasa Rao Gurusu
|
||||
Engineer
|
||||
Panasonic Semiconductor Development Center ( PSDC )
|
||||
gurusus@research.panasonic.com
|
||||
@@ -1,462 +0,0 @@
|
||||
The following is a list of SNMP MIB tables and object, and their
|
||||
implementation status for Net-SNMP.
|
||||
|
||||
Note that simply adding a MIB file does not allow the agent to return values
|
||||
for the MIB. See the FAQ question here for details:
|
||||
|
||||
http://www.net-snmp.org/FAQ.html#How_do_I_add_a_MIB_to_the_agent_
|
||||
|
||||
|
||||
This table was generated by inspecting the source, so it may be incorrect,
|
||||
especially with regards to OS platform support. If an object/table is listed
|
||||
for your OS but doesn't work (or vice-cersa), let us know.
|
||||
|
||||
The Rel column indicates the first release that an object/table was
|
||||
available. That does not imply that all platforms indicated in the OS
|
||||
column were supported for that release. There is no breakdown of feature
|
||||
introduction by platform. Note that the earliest CVS information I could
|
||||
find was for sometime around ucd-snmp 3.2.
|
||||
|
||||
The OS platform is probably the least reliable of the columns, as most are
|
||||
marked as 'unix?', indicating that most unix-based platforms should
|
||||
support the table.
|
||||
|
||||
An '=' in a file path indicates that the table/object name should be
|
||||
substituted in place of the '=' in the path. All paths are relative to
|
||||
the agent/mibgroup directory.
|
||||
|
||||
X.*.0 indicates all scalars under node X.
|
||||
X.?.0 indicates all scalars execept as noted.
|
||||
.Y.0 indicates that Y is an exception to the previous scalar group.
|
||||
|
||||
|
||||
Table Style
|
||||
----------------------------
|
||||
O old (ucd) style helper
|
||||
D table data helper
|
||||
I table iterator
|
||||
A iterate_access
|
||||
S scalar helper
|
||||
G scalar group helper
|
||||
W watched scalar
|
||||
M mfd
|
||||
C container table
|
||||
|
||||
Platform Keys
|
||||
------------------
|
||||
A All systems
|
||||
U unix based
|
||||
L Linux
|
||||
S Solaris
|
||||
H HP-UX
|
||||
B BSD Based
|
||||
F FreeBSD
|
||||
O OpenBSD
|
||||
N NetBSD
|
||||
X MacOSX
|
||||
W Win32 based
|
||||
$ Microsoft
|
||||
C cygwi---
|
||||
M MingW
|
||||
|
||||
A number after a platform indicates notes at the bottom of the file.
|
||||
|
||||
table/object group OS Rel Styl File
|
||||
==============================================================================
|
||||
SNMPv2-MIB
|
||||
system.?.0 A 5.5 W mibII/system_mib.c
|
||||
.sysORLastChange.0 A 5.5 W mibII/sysORTable.c
|
||||
sysORTable A 5.5 C mibII/sysORTable.c
|
||||
snmp.*.0 A 5.5 G mibII/snmp_mib_5_5.c
|
||||
setSerialNo.0 A 5.0 W mibII/setSerialNo.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SNMP-FRAMEWORK-MIB
|
||||
snmpEngine.*.0 A ~4.0? O snmpv3/snmpEngine.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SNMP-MPD-MIB
|
||||
snmpMPDStats.*.0 A ~4.0? G snmpv3/snmpMPDStats_5_5.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SNMP-TARGET-MIB
|
||||
snmpTargetSpinLock.0 A 3.6 O target/snmpTargetAddrEntry.c
|
||||
snmpTargetAddrTable A 3.6 O target/snmpTargetAddrEntry.c
|
||||
snmpTargetParamsTable A 3.6 O target/snmpTargetParamsEntry.c
|
||||
snmpUnavailableContexts.0 A 5.5 G target/target_counters_5_5.c
|
||||
snmpUnknownContexts.0 A 5.5 G target/target_counters_5_5.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SNMP-NOTIFICATION-MIB
|
||||
snmpNotifyTable A 4.2 O notification/=
|
||||
snmpNotifyFilterProfileTable A 4.2 O notification/=
|
||||
snmpNotifyFilterTable A 4.2 O notification/=
|
||||
nlmConfig.*.0 ---
|
||||
nlmStats.*.0 ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
NOTIFICATION-LOG-MIB
|
||||
* ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SNMP-PROXY-MIB
|
||||
snmpProxyTable ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SNMP-USER-BASED-SM-MIB
|
||||
usmStats.*.0 A ~4.0 O snmpv3/usmStats.c
|
||||
usmStats.*.0 A 5.5 G snmpv3/usmStats_5_5.c
|
||||
usmUserTable A ~4.0? O snmpv3/usmUser.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SNMP-VIEW-BASED-ACM-MIB
|
||||
vacmContextTable A ~3.5 I mibII/vacm_context.c
|
||||
vacmSecurityToGroupTable A ~3.5 O
|
||||
vacmAccessContextTable A ~3.5 O mibII/vacm_vars.c
|
||||
vacmViewSpinLock.0 A ~3.5 O
|
||||
vacmViewTreeFamilyTable A ~3.5 O
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SNMP-USM-DH-OBJECTS-MIB
|
||||
usmDHPublicObjects.*.0 A 5.2 S snmp-usm-dh-objects-mib/=/*
|
||||
usmDHUserKeyTable A 5.2 M snmp-usm-dh-objects-mib/=/*
|
||||
usmDHKickstartTable ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SNMP-COMMUNITY-MIB
|
||||
snmpCommunityMIBObjects.*.0 ---
|
||||
snmpCommunityTable ---
|
||||
snmpTargetAddrExtTable ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
IF-MIB
|
||||
ifNumber.0 U $2 ~3.2 O mibII/interfaces.c
|
||||
ifTableLastChange.0 ---
|
||||
ifTable (old) U $2 ~3.5 O mibII/interfaces.c
|
||||
ifTable (new) L 5.2 M if-mib/ifTable/*
|
||||
ifTable (new) FOS 5.4 M if-mib/ifTable/*
|
||||
ifXTable L 5.2 M if-mib/ifXTable/*
|
||||
ifXTable FOS 5.4 M if-mib/ifXTable/*
|
||||
ifStackLastChange.0 ---
|
||||
ifStackTable ---
|
||||
ifTestTable ---
|
||||
ifRcvAddressTable ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
RFC1213-MIB
|
||||
atTable (D) U $2 ~3.5 O mibII/at.c
|
||||
egp.*.0 ---
|
||||
egpNeighTable ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
IP-MIB
|
||||
ip.*.0 U $2 ~3.2 G mibII/ip.c
|
||||
icmp.*.0 U $2 ~3.2 G mibII/icmp.c
|
||||
|
||||
ipSystemStatsTable L 5.2 M ip-mib/=/*
|
||||
ipSystemStatsTable S 5.5 M ip-mib/=/*
|
||||
ipIfStatsTableLastChange.0 ---
|
||||
ipIfStatsTable L-- 5.5 M ip-mib/=/*
|
||||
|
||||
ipAddrTable (D) U $2 4.2 O mibII/ipAddr.c
|
||||
ipAddressSpinLock.0 A 5.5 O mibII/ipAddr.c
|
||||
ipAddressTable L 5.2 M ip-mib/=/*
|
||||
ipAddressTable S 5.5 M ip-mib/=/*
|
||||
ipAddressPrefixTable L 5.3 M ip-mib/=/*
|
||||
|
||||
ipRouteTable (D) U $2 ~3.5 O mibII/*route*.c
|
||||
ipNetToMediaTable (D) U $2 ~3.5 O mibII/at.c
|
||||
ipNetToPhysicalTable (implemented as inetNetToMediaTable)
|
||||
inetNetToMediaTable L 5.2 M ip-mib/=/*
|
||||
ipDefaultRouterTable L 5.5 M ip-mib/=/*
|
||||
|
||||
icmpStatsTable ---
|
||||
icmpMsgStatsTable ---
|
||||
|
||||
ipv4InterfaceTableLastChange ---
|
||||
ipv4InterfaceTable L 5.3 M ip-mib/=/*
|
||||
|
||||
ipv6InterfaceTableLastChange ---
|
||||
ipv6InterfaceTable L 5.3 M ip-mib/=/*
|
||||
ipv6RouterAdvertTable ---
|
||||
ipv6IpForwarding.0 L 5.3 S ip-mib/ip_scalars.c
|
||||
ipv6IpDefaultHopLimit.0 L 5.3 S ip-mib/ip_scalars.c
|
||||
ipv6RouterAdvertSpinLock.0 ---
|
||||
ipv6ScopeZoneIndexTable ---
|
||||
|
||||
ipForwarding.0 L 5.4 S ip-mib/ip_scalars.c
|
||||
ipDefaultTTL.0 L 5.4 S ip-mib/ip_scalars.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
IPV6-MIB
|
||||
ipv6MIBObjects.?.0 U 4.1 O mibII/ipv6.c
|
||||
.ipv6IfTableLastChange.0 ---
|
||||
.ipv6RouteNumber.0 ---
|
||||
.ipv6DiscardedRoutes.0 ---
|
||||
ipv6Interfaces U1 4.1 O mibII/ipv6.c
|
||||
ipv6IfTable U1 4.1 O mibII/ipv6.c
|
||||
ipv6IfStatsTable U1 4.1 O mibII/ipv6.c
|
||||
ipv6AddrPrefixTable ---
|
||||
ipv6AddrTable ---
|
||||
ipv6RouteTable ---
|
||||
ipv6NetToMediaTable ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
IPV6-TCP-MIB
|
||||
ipv6TcpConnTable U1 4.1 O mibII/ipv6.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
IPV6-UDP-MIB
|
||||
ipv6UdpTable U1 4.1 O mibII/ipv6.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
IPV6-ICMP-MIB
|
||||
ipv6IfIcmpTable U1 4.1 O mibII/ipv6.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
IP-FORWARD-MIB
|
||||
ipForward.*.0 ---
|
||||
ipForwardTable (D) ---
|
||||
ipCidrRouteTable (D)(new) L 5.2 A mibII/=
|
||||
ipCidrRouteTable (D)(newer) L 5.2 M ip-forward-mib/=/*
|
||||
inetCidrRouteTable L 5.2 M ip-forward-mib/=/*
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
TCP-MIB
|
||||
tcp.*.0 U $2 ~3.2 G mibII/tcp.c
|
||||
tcpConnTable (D) U $2 4.2 I mibII/tcpTable.c
|
||||
tcpConnectionTable L 5.3 M tcp-mib/=/*
|
||||
tcpConnectionTable S 5.4 M tcp-mib/=/*
|
||||
tcpListenerTable L 5.3 M tcp-mib/=/*
|
||||
tcpListenerTable S 5.4 M tcp-mib/=/*
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
UDP-MIB
|
||||
udpEndpointTable L 5.3 M udp-mib/=/*
|
||||
udpEndpointTable S 5.4 M udp-mib/=/*
|
||||
udp.*.0 U $2 ~3.2 G mibII/udp.c
|
||||
udpTable (D) U $2 4.2 I mibII/udpTable.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
IF-INVERTED-STACK-MIB
|
||||
* ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
RMON-MIB
|
||||
etherStatsTable U 5.0 O Rmon/statistics.c
|
||||
.etherStatsJabbers L3 5.5 M rmon-mib/=/*
|
||||
etherHistoryControlTable U 5.0 O Rmon/history.c
|
||||
etherHistoryTable U 5.0 O Rmon/history.c
|
||||
alarmTable U 3.2 O Rmon/alarm.c
|
||||
eventTable U 3.2 O Rmon/event.c
|
||||
logTable U 5.0 O Rmon/event.c
|
||||
hostControlTable ---
|
||||
hostTable ---
|
||||
hostTimeTable ---
|
||||
hostTopNControlTable ---
|
||||
hostTopNTable ---
|
||||
matrixControlTable ---
|
||||
matrixSDTable ---
|
||||
matrixDSTable ---
|
||||
filterTable ---
|
||||
channelTable ---
|
||||
bufferControlTable ---
|
||||
captureBufferTable ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
HOST-RESOURCES-MIB
|
||||
hrSystem.*.0 U ~3.3 O host/hr_system.c
|
||||
hrMemorySize U ~3.3 O host/hr_storage.c
|
||||
hrStorageTable U ~3.3 O host/hr_storage.c
|
||||
hrDeviceTable U ~3.3 O host/hr_device.c
|
||||
hrProcessorTable U ~3.3 O host/hr_proc.c
|
||||
hrNetworkTable U ~3.3 O host/hr_network.c
|
||||
hrPrinterTable U ~3.3 O host/hr_print.c
|
||||
hrDiskStorageTable U ~3.3 O host/hr_disk.c
|
||||
hrPartitionTable U ~3.3 O host/hr_partition.c
|
||||
hrFSTable U ~3.3 O host/hr_filesys.c
|
||||
hrSWOSIndex.0 --- ~3.3 O host/hr_swrun.c
|
||||
hrSWRunTable U ~3.3 O host/hr_swrun.c
|
||||
hrSWRunPerfTable U ~3.3 O host/hr_swrun.c
|
||||
hrSWInstalled.*.0 U ~3.3 O host/hr_swinst.c
|
||||
hrSWInstalledTable U ~3.3 O host/hr_swinst.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
DISMAN-EVENT-MIB
|
||||
mteTriggerTable A 5.0 O disman/=
|
||||
mteTriggerFailures.0 ---
|
||||
mteTriggerDeltaTable A 5.0 O disman/=
|
||||
mteTriggerExistenceTable A 5.0 O disman/=
|
||||
mteTriggerBooleanTable A 5.0 O disman/=
|
||||
mteTriggerThresholdTable A 5.0 O disman/=
|
||||
mteObjectsTable A 5.0 O disman/=
|
||||
mteEventTable A 5.0.7 D disman/=
|
||||
mteEventFailures.0 ---
|
||||
mteEventNotificationTable A 5.0.7 D disman/=
|
||||
mteResource.*.0 ---
|
||||
mteEventSetTabel ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
DISMAN-SCHEDULE-MIB
|
||||
schedLocalTime.0 A 5.3 D disman/schedule/=
|
||||
schedTable A 5.3 D disman/schedule/=
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
DISMAN-EXPRESSION-MIB (expired ID)
|
||||
expErrorTable U 5.2 O disman/expression/=
|
||||
expExpressionTable U 5.2 O disman/expression/=
|
||||
expObjectTable U 5.2 O disman/expression/=
|
||||
expValueTable U 5.2 O disman/expression/=
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
DISMAN-PING-MIB (draft-ietf-disman-remops-mib-v2*)
|
||||
pingCtlTable U 5.2 O disman/ping/=
|
||||
pingProbeHistoryTable U 5.2 O disman/ping/=
|
||||
pingResultsTable U 5.2 O disman/ping/=
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
DISMAN-TRACEROUTE-MIB (draft-ietf-disman-remops-mib-v2*)
|
||||
traceRouteCtlTable U 5.2 O disman/traceroute/=
|
||||
traceRouteHopsTable U 5.2 O disman/traceroute/=
|
||||
traceRouteProbeHistory U 5.2 O disman/traceroute/=
|
||||
traceRouteResultsTable U 5.2 O disman/traceroute/=
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
DISMAN-NSLOOKUP-MIB (draft-ietf-disman-remops-mib-v2*)
|
||||
lookupCtlTable U 5.2 O disman/nslookup/=
|
||||
lookupResultsTable U 5.2 O disman/nslookup/=
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
DISMAN-SCRIPT-MIB
|
||||
* ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
EtherLike-MIB
|
||||
dot3StatsTable L 5.5 M etherlike-mib/=
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
AGENTX-MIB
|
||||
* ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
LM-SENSORS-MIB
|
||||
lmTempSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
|
||||
lmFanSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
|
||||
lmVoltSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
|
||||
lmMiscSensorsTable LS 5.0 O ucd-snmp/lmSensors.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
UCD-SNMP-MIB
|
||||
prTable U $ ~3.2 O ucd-snmp/proc.c
|
||||
memory.*.0 U ~3.2 O ucd-snmp/memory*.c
|
||||
extTable U $ ~3.2 D ucd-snmp/extensible.c
|
||||
dskTable U 3.2 O ucd-snmp/disk.c
|
||||
fileTable A 3.6 O ucd-snmp/file.c
|
||||
laTable U $ ~3.2 O ucd-snmp/loadave.c
|
||||
systemStats.*.0 U 3.4 O ucd-snmp/vmstat*.c
|
||||
ipFwAccTable U 3.5 O misc/ipfwacc.c
|
||||
dlModTable U 4.2 O ucd-snmp/dlmod.c
|
||||
diskIOTable U 4.1 O ucd-snmp/diskio.c
|
||||
ucdDemoMIBObjects A ~3.5 O examples/ucdDemoPublic.c
|
||||
logMatch U ~3.5 O ucd-snmp/logmatch.c
|
||||
version.*.0 A ~3.2 O ucd-snmp/versioninfo.c
|
||||
snmperrs.*.0 A ~3.5 O ucd-snmp/errormib.c
|
||||
mrTable (D) ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
NET-SNMP-EXTEND-MIB
|
||||
nsExtendConfigTable U ~3.5 D agent/extend.c
|
||||
nsExtendOutput1Table U ~3.5 D agent/extend.c
|
||||
nsExtentOutput2Table U ~3.5 D agent/extend.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
NET-SNMP-AGENT-MIB
|
||||
nsModuleTable A 5.0 I agent/nsModuleTable.c
|
||||
nsCacheTable A 5.0 I agent/nsCache.c
|
||||
nsConfigDebug.*.0 A 5.0 I agent/nsDebug.c
|
||||
nsDebugTokenTable A 5.0 O
|
||||
nsConfigLogging A 5.0 I agent/nsLogging.c
|
||||
nsLoggingTable A 5.0 O
|
||||
nsTransactionTable A 5.0 I agent/nsTransactionTable.c
|
||||
netSnmpExampleScalars A 5.0 O
|
||||
netSnmpIETFWGTable A 5.0 D examples/data_set.c
|
||||
netSnmpHostsTable A 5.0 A examples/=*
|
||||
nstAgentModules A 5.0 O
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
NET-SNMP-VACM-MIB
|
||||
nsVacmAccessTable A 5.4 I agent/nsVacmAccessTable.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
MTA-MIB
|
||||
mtaTable U 4.2 O mibII/mta_sendmail.c
|
||||
mtaGroupTable U 4.2 O mibII/mta_sendmail.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SMUX-MIB
|
||||
smuxPeerTable ---
|
||||
smuxTreeTable ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
BGP4-MIB (draft-ietf-idr-bgp4-mib)
|
||||
bgpPeerTable A 3.5 O smux/snmp_bgp.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
OSPF-MIB (draft-ietf-ospf-mib-update)
|
||||
* A 3.5 O smux/snmp_ospf.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
RIPv2-MIB
|
||||
* A 3.5 O smux/snmp_rip2.c
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
TUNNEL-MIB
|
||||
tunnelIfTable L 4.2 O tunnel/tunnel.c
|
||||
tunnelConfigTable L 4.2 O tunnel/tunnel.c
|
||||
tunnelInetConfigTable ---
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SCTP-MIB
|
||||
sctpStats L 5.5 S sctp-mib/sctpScalars*
|
||||
sctpParameters L 5.5 S sctp-mib/sctpScalars*
|
||||
sctpAssocTable L 5.5 C sctp-mib/=
|
||||
sctpAssocLocalAddrTable L 5.5 C sctp-mib/=
|
||||
sctpAssocRemAddrTable L 5.5 C sctp-mib/=
|
||||
sctpLookupLocalPortTable L 5.5 C sctp-mib/=
|
||||
sctpLookupRemPortTable L 5.5 C sctp-mib/=
|
||||
sctpLookupRemHostNameTable L 5.5 C sctp-mib/=
|
||||
sctpLookupRemPrimIPAddrTable L 5.5 C sctp-mib/=
|
||||
sctpLookupRemIPAddrTable L 5.5 C sctp-mib/=
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
SNMP-TSM-MIB
|
||||
snmpTsmStats A 5.6 D tsm-mib/snmpTsmStats/=
|
||||
snmpConfiguration A 5.6 W tsm-mib/=
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
TLSTM-MIB
|
||||
snmpTlstmSession A 5.6 W tlstm-mib/=/*
|
||||
tlstmCertificateMapping.* A 5.6 w tlstm-mib/=
|
||||
tlstmCertToTSNTable A 5.6 D tlstm-mib/=/*
|
||||
tlstmParamsTable A 5.6 D tlstm-mib/=/*
|
||||
tlstmAddrTable A 5.6 D tlstm-mib/=/*
|
||||
|
||||
==============================================================================
|
||||
|
||||
Misc notes
|
||||
----------
|
||||
1: available for systems using KAME ipv6
|
||||
2: with platform SDK. See README.win32
|
||||
3: works only with Intel and Broadcom network cards and must run as root only
|
||||
|
||||
Other feature info
|
||||
------------------
|
||||
smux 3.2
|
||||
AgentX 4.0
|
||||
proxy support 4.2
|
||||
override token 5.0
|
||||
proper context support 5.2
|
||||
DISMAN-EVENT-MIB implementation rewrite 5.3
|
||||
AgentX, host, disman/event by default 5.3
|
||||
SSH Transport module 5.5
|
||||
(D)TLS Transport module 5.6
|
||||
@@ -1,47 +0,0 @@
|
||||
Net-SNMP contains a reasonably full implementation of the AgentX agent
|
||||
extensibility protocol (RFC 2741) in as much as it supports all
|
||||
the protocol operations described in this document. The core
|
||||
functionality has received a reasonable amount of exposure, and
|
||||
is believed to be more or less stable in normal use. It will
|
||||
also handle the non-graceful termination of subagents - returning
|
||||
a 'genErr' error for three successive requests before unregistering
|
||||
the unresponsive subagent.
|
||||
|
||||
A subagent will attempts to re-establish contact with a dead and
|
||||
resurrected master based on the agentxPingInterval setting. The default
|
||||
for this configuration variable is 15 seconds. It can be changed by
|
||||
putting the following line in your APPLICATION.conf file:
|
||||
|
||||
agentxPingInterval 60
|
||||
|
||||
will make the subagent try to ping the master every 60 seconds, and if
|
||||
the connection is deemed broken it'll try and reconnect to the master
|
||||
agent after that point (once every 60 seconds).
|
||||
|
||||
Similarly, a subagent will not be able to re-register in place of a
|
||||
defunct colleague until the master agent has received three requests
|
||||
for the dead connection (and hence unregistered it).
|
||||
|
||||
Some of the less frequently used features (index allocation,
|
||||
range registration, etc), have received less thorough testing,
|
||||
and may well not be fully functional. Some of the omissions
|
||||
of the earlier release (use of GetBulk, the AgentX MIB)
|
||||
are still missing from this version.
|
||||
|
||||
AgentX support is now included in the agent by default, but needs
|
||||
to be explicitly enabled before use. Activate it using by putting a line
|
||||
|
||||
master agentx
|
||||
|
||||
in the snmpd.conf file. This support is also enabled automatically
|
||||
when the '-x' flag is given (to specify a different master AgentX socket),
|
||||
or when the agent is invoked as an AgentX subagent (i.e. via the name
|
||||
'agentxd' or with the '-X' flag).
|
||||
|
||||
See the main project web page for an examples of a simple stand-alone
|
||||
subagent. (http://www.net-snmp.org/tutorial/tutorial-5/toolkit/)
|
||||
|
||||
|
||||
Please report any problems experienced to the net-snmp-coders list.
|
||||
|
||||
Dave
|
||||
@@ -1,78 +0,0 @@
|
||||
Some notes for the AIX port
|
||||
===========================
|
||||
|
||||
1. Known problems
|
||||
-----------------
|
||||
|
||||
There are the following known problems on AIX:
|
||||
|
||||
1) Shared libraries / embedded perl
|
||||
|
||||
Up to (and including) net-snmp 5.4, configure forced a static build
|
||||
on AIX which caused embedded Perl to be disabled as well.
|
||||
|
||||
Starting with net-snmp 5.4.1, we build shared libraries by default on AIX
|
||||
(like on any other platform) using run-time linking. configure forces the
|
||||
use of the required "-brtl" linker flag.
|
||||
|
||||
With net-snmp 5.5 the shared library build is broken again but the there is
|
||||
no forced static build - use --disable-shared when building.
|
||||
|
||||
2) "grep: capacity exceeded" or "sed: Command line is too long" during configure
|
||||
|
||||
The version of "grep" shipped with AIX versions up to (and including) 5.1
|
||||
has a known limitation of only supporting a maximum of 2048 characters per line.
|
||||
This may cause a significant number of "grep: capacity exceeded" errors during
|
||||
configure which breaks the build. See bug 1367794 for details. The fix is to
|
||||
either install GNU grep (and have it in PATH before the AIX grep) or to upgrade
|
||||
to AIX 5.2 or later.
|
||||
|
||||
There's a similar issue with AIX /usr/bin/sed up to at least AIX 5.3 that
|
||||
causes a significant number of "sed: Command line is too long." errors during
|
||||
configure. The fix is to install GNU sed.
|
||||
|
||||
3) nlist errors with 64-bit kernels
|
||||
|
||||
Accessing certain MIB objects on AIX 5.x machines running a 64-bit kernel will
|
||||
trigger nlist/klookup errors. Starting from net-snmp 5.4, you can avoid those
|
||||
by using
|
||||
|
||||
./configure --without-kmem-usage ...
|
||||
|
||||
|
||||
4) IPv6
|
||||
|
||||
Starting with net-snmp 5.4 you can enable the UDPIPv6 and TCPIPv6 transports
|
||||
on AIX 5.x:
|
||||
|
||||
./configure --enable-ipv6
|
||||
|
||||
There's no support for the IPv6 MIBs, though.
|
||||
|
||||
5) Compiler for Perl
|
||||
|
||||
In general, Perl modules need to be compiled with the same compiler and
|
||||
compiler options as Perl itself. configure detects some mismatches (gcc vs.
|
||||
vendor compiler), but treats different incarnations of the same compiler type
|
||||
as similar. If your version of Perl (e.g. the one supplied by IBM for AIX 5.x)
|
||||
has been compiled with cc_r on AIX, please make sure you also use CC=cc_r when
|
||||
building net-snmp. Building with xlc in this case is known to fail (see bug
|
||||
#1600099).
|
||||
|
||||
|
||||
2. Patches
|
||||
----------
|
||||
|
||||
You may want to have a look for existing AIX patches in our patches tracker
|
||||
(http://www.net-snmp.org/patches/). If you can offer patches yourself to
|
||||
improve the AIX support, please submit them there.
|
||||
|
||||
|
||||
3. Feedback
|
||||
-----------
|
||||
|
||||
Please also see README and PORTING.
|
||||
|
||||
If you have questions, additional insights or (even better) patches regarding
|
||||
net-snmp on AIX, please refer to the net-snmp mailing lists (see
|
||||
http://www.net-snmp.org/lists).
|
||||
@@ -1,22 +0,0 @@
|
||||
Some notes for the HP-UX 11.0/11i port
|
||||
======================================
|
||||
|
||||
1. Starting the net-snmp daemon via rc script
|
||||
---------------------------------------------
|
||||
|
||||
When starting the net-snmp daemon via rc script you have to trap some signals
|
||||
because otherwise the daemon will die the moment the rc script ends. I trap
|
||||
the signals 1, 2 and 3 via "trap '' 1 2 3" immediately before starting the
|
||||
daemon. I didn't check whether all these signals need to be trapped, probably
|
||||
SIGHUP will suffice. BTW this applies to the HP-UX 10.x version as well. It
|
||||
would be a good idea to ignore or handle these signals in the daemon...
|
||||
|
||||
2. Author, credits, comments
|
||||
----------------------------
|
||||
|
||||
The HP-UX 11.0 port was done by Johannes Schmidt-Fischer <jsf@InterFace-AG.com>
|
||||
|
||||
If you have questions or problems please feel free to contact me via the
|
||||
above mentioned e-mail address. Please send a copy of your e-mail to the
|
||||
net-snmp-coders mailing list - probably someone else can answer your
|
||||
question earlier than me;-)
|
||||
@@ -1,56 +0,0 @@
|
||||
Some notes for the IRIX port
|
||||
============================
|
||||
|
||||
1. Compiling
|
||||
------------
|
||||
|
||||
net-snmp 5.3.1 and later have been compiled successfully on IRIX 6.5 using the
|
||||
MIPSpro C compiler 7.4.4m in C99 mode:
|
||||
|
||||
CC=c99 ./configure && make && make install
|
||||
|
||||
Please note that the "host" module doesn't compile on IRIX, so you *cannot*
|
||||
configure with "--with-mib-modules=host".
|
||||
|
||||
Compiling with gcc may be possible, but is unsupported at this point in time
|
||||
due to difficulties with the IRIX system headers. Brent Bice has reported
|
||||
a successful build of net-snmp 5.4 with gcc 3.4.6 on a IP30 machine using:
|
||||
|
||||
CFLAGS="-D_PAGESZ=16384 -D_MIPS3_ADDRSPACE -DIP30 -DR10000 -DMP \
|
||||
-DCELL_PREPARE -DBHV_PREPARE" ./configure ...
|
||||
|
||||
See http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi/0620/bks/\
|
||||
SGI_Developer/books/DevDriver_PG/sgi_html/ch10.html and
|
||||
/var/sysgen/Makefile.kernio .
|
||||
|
||||
2. CPU stats
|
||||
------------
|
||||
|
||||
net-snmp 5.4.1 and later reports CPU statistics on IRIX 6.x by default using
|
||||
the hardware/cpu/cpu_sysinfo module. There's also an alternative implementation:
|
||||
hardware/cpu/cpu_pcp. For full discussion and build instructions for cpu_pcp
|
||||
see Patch #1675869:
|
||||
|
||||
http://sf.net/support/tracker.php?aid=1675869
|
||||
|
||||
|
||||
3. Known Issues
|
||||
---------------
|
||||
|
||||
Accessing certain MIB objects on IRIX64 machines (i.e. when running a 64-bit
|
||||
kernel will trigger nlist/klookup errors. The agent will not return proper
|
||||
values for the affected MIB objects (e.g. tcpConnTable, udpTable).
|
||||
Starting from net-snmp 5.4, you can avoid nlist altogether (recommended for
|
||||
IRIX64) by using
|
||||
|
||||
./configure --without-kmem-usage ...
|
||||
|
||||
|
||||
3. Feedback
|
||||
-----------
|
||||
|
||||
Please also see README and PORTING.
|
||||
|
||||
If you have questions, additional insights or (even better) patches regarding
|
||||
net-snmp on IRIX, please refer to the net-snmp mailing lists (see
|
||||
http://www.net-snmp.org/lists).
|
||||
@@ -1,165 +0,0 @@
|
||||
This version of net-snmp supports an experimental SNMPv3 security model
|
||||
using Kerberos 5 for authentication. The protocol is described in an
|
||||
up-and-coming IETF Internet-Draft.
|
||||
|
||||
This document describes a brief overview of the Kerberos Security Model
|
||||
and how to use it.
|
||||
|
||||
DESCRIPTION:
|
||||
|
||||
The Kerberos Security Model does not use USM; it is completely seperate
|
||||
and is not tied to USM in any way. It works by placing the following
|
||||
ASN.1 sequence inside of the SNMPv3 msgSecurityParameters:
|
||||
|
||||
ksmSecurityParameters ::= SEQUENCE {
|
||||
-- The Kerberos 5 checksum type used to checksum this message
|
||||
ksmChecksumType INTEGER(0..2147483647),
|
||||
-- The actual keyed checksum data returned by Kerberos
|
||||
ksmChecksum OCTET STRING,
|
||||
-- The Kerberos 5 message (either an AP_REQ or AP_REP)
|
||||
ksmKerberosMsg OCTET STRING,
|
||||
-- The cached ticket identifier
|
||||
ksmCachedTicket INTEGER(0..2147483647)
|
||||
}
|
||||
|
||||
Note that the whole SEQUENCE is BER encoded as an OCTET STRING.
|
||||
|
||||
ksmChecksumType is an integer which corresponded to the checksum algorithm
|
||||
used to secure this message as defined by Kerberos (see section 8.3 of
|
||||
RFC1510).
|
||||
|
||||
ksmChecksum is the output of the checksum algoritm defined by ksmChecksumtype
|
||||
(with all NULs in the space for the checksum).
|
||||
|
||||
ksmKerberosMsg is a Kerberos 5 AP_REQ or AP_REP message, depending on
|
||||
whether or not it is a request or a response (AP_REQ for requests, AP_REP
|
||||
for responses).
|
||||
|
||||
ksmCachedTicket is a integer which uniquely identifies a ticked already
|
||||
cached on the agent to save the overhead of transferring a whole AP_REQ/AP_REP.
|
||||
If there is no such cached ticket, it is left at zero.
|
||||
|
||||
An agent, upon receiving a message using the KSM, will decode the AP_REQ
|
||||
contained within the security parameters and thus validate the client's
|
||||
identity. Using the subkey contained within the AP_REQ, the agent will
|
||||
validate the checksum (after first clearing the checksum bytes to zero),
|
||||
and issue a response, encoding the appropriate AP_REP message in the
|
||||
ksmSecurityParameters.
|
||||
|
||||
If the securityLevel of the message is set to AuthPriv, the scopedPdu
|
||||
payload will be encrypted using the encryption key and algorithm of the
|
||||
AP_REQ subkey. Note that in this case, the msgData will be a BER-encoded
|
||||
OCTET STRING corresponding to the "cipher" element of the EncryptedData
|
||||
sequence defined in RFC 1510, section 6.1.
|
||||
|
||||
Since this security model is experimental, the number assigned to this
|
||||
security model is taken from the recommendations of RFC 2271, section 5,
|
||||
which specify enterprise-specific Security Models of the form:
|
||||
|
||||
SnmpSecurityModel = enterpriseID * 256 + security model number
|
||||
in that enterprise ID;
|
||||
|
||||
In the case of KSM this gives us:
|
||||
|
||||
SnmpSecurityModel = 8072 * 256 + 0 = 2066432
|
||||
|
||||
|
||||
USAGE:
|
||||
|
||||
To actually USE the Kerberos Security Model, do the following:
|
||||
|
||||
0) Install Kerberos
|
||||
|
||||
Let it be stated up front - Installing Kerberos completely "cold", without
|
||||
any Kerberos experience at all, can be daunting (to say the least). If you
|
||||
already have a Kerberos infrastructure at your site, then all of the hard
|
||||
work has been done. If you do NOT, but you still want to tackle it,
|
||||
you might be interested in the Kerberos FAQ, which can be found at:
|
||||
|
||||
http://www.nrl.navy.mil/CCS/people/kenh/kerberos-faq.html
|
||||
|
||||
Currently the code in net-snmp only supports using MIT Kerberos
|
||||
libraries to link against (you should be able to use any kind of Kerberos
|
||||
server, however).
|
||||
|
||||
1) Compile net-snmp with Kerberos.
|
||||
|
||||
This assumes that you already have Kerberos libraries in place.
|
||||
|
||||
Configure net-snmp to include the Kerberos Security Model (ksm) and
|
||||
use --with-cflags and --with-ldflags to specify the location and names
|
||||
of Kerberos header files and libraries. For example, on my system I
|
||||
run:
|
||||
|
||||
./configure --with-cflags='-I/usr/krb5/include' \
|
||||
--with-ldflags='-L/usr/krb5/lib -lkrb5 -lcrypto -lcom_err -R/usr/krb5/lib'
|
||||
|
||||
Note that this is on Solaris, and that -R is required to set the correct
|
||||
shared library path. If you have a newer version of Kerberos, you might
|
||||
instead have to use:
|
||||
|
||||
-lkrb5 -lk5crypto -lcom_err
|
||||
|
||||
as the libraries to link against. If you get errors (for example, you
|
||||
get a message that says the compiler isn't working) you can check
|
||||
config.log for the output of the compiler.
|
||||
|
||||
2) Configure Kerberos and SNMP
|
||||
|
||||
Currently, net-snmp uses the "host" principal assigned to a host. This
|
||||
may change in the future. You will want to create host principals of
|
||||
the form:
|
||||
|
||||
host/f.q.d.n@YOUR.REALM
|
||||
|
||||
For example:
|
||||
|
||||
host/mydesktop.example.org@EXAMPLE.ORG
|
||||
|
||||
and place the encryption keys for these principals on every machine you
|
||||
wish to run a SNMP agent (you place each key on it's corresponding machine).
|
||||
Your Kerberos documentation should explain how to do this (in the case
|
||||
of MIT Kerberos, you want to look at the "ktadd" command inside of
|
||||
kadmin).
|
||||
|
||||
If you have a Kerberos infrastructure, you likely already have these
|
||||
principals in place on your systems.
|
||||
|
||||
If you're installing Kerberos for the first time as well, you also
|
||||
need to create client principals corresponding to your userid. See
|
||||
your Kerberos documentation.
|
||||
|
||||
On the SNMP _agent_ side, you'll want to place in your snmpd.conf file
|
||||
(the one that lives in /usr/local/share/snmp/snmpd.conf, or whereever
|
||||
you have configured on your system):
|
||||
|
||||
rwuser -s ksm userid@YOUR.REALM
|
||||
|
||||
to allow the Kerberos principal 'userid@YOUR.REALM' read/write access to
|
||||
the MIB tree.
|
||||
|
||||
3) Run the agent and client applications
|
||||
|
||||
Note that before you do any of this, you will have to have valid Kerberos
|
||||
credentials (generally acquired with the "kinit" program).
|
||||
|
||||
The agent should run without any additional flags.
|
||||
|
||||
You should run the client apps with the following flags:
|
||||
|
||||
-Y defSecurityModel=ksm
|
||||
-v 3
|
||||
-u username
|
||||
-l authNoPriv
|
||||
|
||||
for example:
|
||||
|
||||
snmpget -v 3 -Y defSecurityModel=ksm -u myname -l authNoPriv testhost \
|
||||
system.sysDescr.0
|
||||
|
||||
If you wish to encrypt the payload, change the -l argument to "authPriv".
|
||||
|
||||
If you run into problems, you can add the -Dksm flag to both the manager
|
||||
applications and the agent to get more detailed Kerberos error messages.
|
||||
Note that this setup assumes a working Kerberos infrastructure; if you
|
||||
run into problems, check to make sure Kerberos is working for you.
|
||||
@@ -1,61 +0,0 @@
|
||||
README.osX
|
||||
$Id$
|
||||
|
||||
This is what I had to do to get it to work for me. Your mileage may vary.
|
||||
If this doesn't work for you, or you have fixes for any problems listed,
|
||||
please post to <net-snmp-coders@lists.sourceforge.net>. Thanks!
|
||||
|
||||
- ALL
|
||||
|
||||
- nlist doesn't support icmpstat
|
||||
|
||||
- disable the icmp module during configure by specifying
|
||||
"--with-out-mib-modules=mibII/icmp", or at startup by adding
|
||||
"-I -icmp" to the snmpd command line.
|
||||
|
||||
|
||||
- 10.4.7 (Universal) and Leopard with 5.4 sources:
|
||||
[Supplied by Chris Jalbert]
|
||||
|
||||
- build using gcc 4.0 (see below) and configure using:
|
||||
--with-persistent-directory=/var/db/net-snmp \
|
||||
--with-defaults \
|
||||
--without-rpm \
|
||||
--with-mib-modules="host ucd-snmp/diskio" \
|
||||
--with-out-mib-modules="mibII/icmp host/hr_swrun" \
|
||||
--without-kmem-usage
|
||||
|
||||
The first line sets up persistent storage in the OS X standard location.
|
||||
|
||||
The third line is necessary because RPM is not properly disabled.
|
||||
|
||||
The fourth line includes those modules appear to build properly and
|
||||
mostly work. The next line is necessary because those sub-modules
|
||||
do not build.
|
||||
|
||||
The final line is necessary because /dev/kmem was removed in
|
||||
the Intel / Universal builds of the OS, and I believe the APIs will
|
||||
be removed in Leopard.
|
||||
This line is the most critical for proper building on OS X.
|
||||
|
||||
|
||||
- 10.3.x and earlier
|
||||
|
||||
- Some older versions of Apple's cpp doesn't like configure.
|
||||
|
||||
- run 'gcc_select' to see what version you are using, and
|
||||
'gcc_select -l' to list available versions. I've had success with
|
||||
3.3, selected by running (as root) 'gcc_select 3.3'. (Note: this was
|
||||
on Panther, 10.3.2)
|
||||
|
||||
- Some older versions of net-snmp as installed by Apple contains
|
||||
bad flags in net-snmp-config.
|
||||
|
||||
- build your own version, and install over Apple's version. The
|
||||
configure flags you need for the same configuration:
|
||||
|
||||
configure --prefix=/usr --mandir=/usr/share/man
|
||||
--infodir=/usr/share/info --with-libwrap --with-defaults
|
||||
--prefix=/usr --with-persistent-directory=/var/db/ucd-snmp
|
||||
--with-mib-modules=host
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
README.snmpv3
|
||||
-------------
|
||||
How to setup SNMPv3, a very brief document for Dave to elaborate and
|
||||
do a better job on since I suck at writing documentation and he
|
||||
doesn't ;-) --Wes:
|
||||
|
||||
Note: SHA authentication and DES/AES encryption support is only available
|
||||
if you have OpenSSL installed or if you've compiled using
|
||||
--with-openssl=internal. If you use --with-openssl=internal please
|
||||
read the documentation in snmplib/openssl/README for important details.
|
||||
|
||||
Note: encryption support now *is* enabled in the binary releases downloadable
|
||||
from the net-snmp web site.
|
||||
|
||||
Note: this description assumes you're using the software compiled from
|
||||
source, and so installed using the default prefix location (/usr/local).
|
||||
If you're working with a vendor-provided system, or have configured
|
||||
things with a different prefix, you'll need to adjust locations accordingly.
|
||||
|
||||
CREATING THE FIRST USER:
|
||||
------------------------
|
||||
First, you need to create a new snmpv3 user and give them rights to
|
||||
do things:
|
||||
|
||||
net-snmp-config --create-snmpv3-user -a "my_password" myuser
|
||||
|
||||
WARNING: SNMPv3 pass phrases must be at least 8 characters long!
|
||||
|
||||
The above line creates the user "myuser" with a password of
|
||||
"my_password" (and uses MD5 and DES for protection). (Note that
|
||||
encryption support isn't enabled in the binary releases downloadable
|
||||
from the net-snmp web site.) net-snmp-config will also add a line
|
||||
to your snmpd.conf file to let that user have read/write access to
|
||||
your agent. You may want to change this in your snmpd.conf file
|
||||
(see the snmpd.conf manual page). Run net-snmp-config --help for
|
||||
more information about it.
|
||||
|
||||
Start the agent and test your setup:
|
||||
/usr/local/sbin/snmpd
|
||||
[...wait a few seconds... It will run in the background and
|
||||
return you to your shell immediately.]
|
||||
|
||||
snmpget -v 3 -u myuser -l authNoPriv -a MD5 -A my_password localhost sysUpTime.0
|
||||
[ this should return information about how long your agent has been up]
|
||||
|
||||
snmpget -v 3 -u myuser -l authPriv -a MD5 -A my_password
|
||||
-x DES -X my_password localhost sysUpTime.0
|
||||
[ this should return similar information, but encrypts the transmission ]
|
||||
|
||||
CREATING A SECOND USER:
|
||||
-----------------------
|
||||
Start the agent (if you didn't do so above).
|
||||
|
||||
You can create as many users as you like using the above method, but
|
||||
this details another way of doing it while the agent is running by
|
||||
modifying the user database using the snmp protocol itself:
|
||||
|
||||
Now, lets create a second user using the first user (just for fun)
|
||||
for both authentication purposes and as a template (or "cloning
|
||||
source"):
|
||||
|
||||
snmpusm -v 3 -u myuser -l authNoPriv -a MD5 -A my_password localhost create wes myuser
|
||||
|
||||
The above should have created the user "wes" with the same password as
|
||||
the "myuser" user. So then, you need to change his password using:
|
||||
|
||||
snmpusm -v 3 -u wes -l authNoPriv -a MD5 -A my_password localhost passwd my_password new_passphrase
|
||||
|
||||
See, wasn't that easy? You can now create users. Wheeee....
|
||||
|
||||
But, you'll have to add a configuration line that allows them access
|
||||
to do things. Do this with another "rwuser" line in your
|
||||
/usr/local/share/snmp/snmpd.conf file (you'll need to stop and start
|
||||
the agent again, or send the agent a SIGHUP signal):
|
||||
|
||||
rwuser wes
|
||||
|
||||
Or, optional use the "rouser" token instead of the "rwuser" token to
|
||||
only grant them read-only access.
|
||||
|
||||
Now, test your new user:
|
||||
|
||||
snmpget -v 3 -u wes -l authNoPriv -a MD5 -A new_passphrase localhost sysUpTime.0
|
||||
|
||||
|
||||
FURTHER STUDIES:
|
||||
---------------
|
||||
|
||||
Tired of all those command line authentication options?
|
||||
----------------------------------------
|
||||
put something like this in your $HOME/.snmp/snmp.conf file (make it
|
||||
readable only by you!!!):
|
||||
|
||||
defSecurityName wes
|
||||
defContext ""
|
||||
defAuthType MD5
|
||||
defSecurityLevel authNoPriv
|
||||
defAuthPassphrase new_passphrase
|
||||
defVersion 3
|
||||
|
||||
And this is in place the last of the above example lines boils down to:
|
||||
|
||||
snmpget localhost sysUpTime.0
|
||||
|
||||
Which is about as simple as I can make it for ya ;-)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,29 +0,0 @@
|
||||
snmptrapd MySQL Logging
|
||||
-----------------------
|
||||
|
||||
A trap handler for logging traps to a MySQL database was added
|
||||
in release 5.5.0.
|
||||
|
||||
The MySQL database location and password must be configured in
|
||||
/root/.my.cnf:
|
||||
|
||||
[snmptrapd]
|
||||
host=localhost
|
||||
password=sql
|
||||
|
||||
User may also be configured, if using a MySQL user besides root.
|
||||
|
||||
snmptrapd.conf must be configured to for the queue size and
|
||||
periodic flush interval:
|
||||
|
||||
# maximum number of traps to queue before forced flush
|
||||
sqlMaxQueue 140
|
||||
|
||||
# seconds between periodic queue flushes
|
||||
sqlSaveInterval 9
|
||||
|
||||
A value of 0 for sqlSaveInterval will completely disable MySQL
|
||||
logging of traps.
|
||||
|
||||
The schema must be loaded into MySQL before running snmptrapd.
|
||||
The schema can be found in dist/schema-snmptrapd.sql
|
||||
@@ -1,343 +0,0 @@
|
||||
Improved Error Reporting and Thread-Safe Use of the SNMP Library
|
||||
|
||||
There is a need in some environments to support multiple threads
|
||||
in a single application. The SNMP Library provides the Single Session
|
||||
functions which support thread-safe operation when certain precautions
|
||||
are taken. This document describes the operation of the SNMP Library
|
||||
with a focus on its session management functions. The Traditional API
|
||||
and the Single API functions are compared and contrasted.
|
||||
A working understanding of the CMU or UCD SNMP Library
|
||||
API is recommended to fully appreciate the concepts discussed.
|
||||
The document ends with a list of restrictions for using the Single API
|
||||
in a multi-threaded application.
|
||||
|
||||
Unfortunately, the SNMPv3 support was added about the same time as
|
||||
the thread support and since they occurred in parallel the SNMPv3
|
||||
support was never checked for multi-threading correctness. It is
|
||||
most likely that it is not thread-safe at this time.
|
||||
|
||||
***** IMPORTANT ANNOUNCEMENT *****
|
||||
To the point, no resource locks are applied within the SNMP Library.
|
||||
The APDU encoding and some session management functions can be used
|
||||
in thread-safe manners. The MIB file parsing is not thread-safe.
|
||||
The Single Session API was made available in November 1998.
|
||||
Existing applications use the Traditional API, which is not thread-safe.
|
||||
The thread-safe considerations are discussed throughout this document.
|
||||
|
||||
The research and development of the Single Session API that I've completed
|
||||
was wholly funded by my employer, Internet Security Systems, Inc.
|
||||
and is distributed freely to the Internet community.
|
||||
|
||||
-Mike Slifcak, 23 April 1999
|
||||
|
||||
09 July 1999 Removed references to snmp_synch_setup and snmp_synch_reset
|
||||
|
||||
|
||||
Availability
|
||||
|
||||
The Single Session API is integrated into the currently available
|
||||
versions of the CMU SNMP library and the UC-Davis SNMP package.
|
||||
|
||||
ftp://ftp.net.cmu.edu/pub/snmp/cmu-snmp-V1.13.tar.gz and later
|
||||
Read : snmp_sess_api.3, Changes.SingleSession
|
||||
|
||||
ftp://ucd-snmp.ucdavis.edu/ucd-snmp-3.6.tar.gz and later
|
||||
Read : snmp_sess_api.3, README.thread (after version 3.6.1)
|
||||
|
||||
Both libraries work equally well in Windows NT and various
|
||||
UNIX platforms. Please read this document and refer to
|
||||
the snmp_sess_api section 3 manual page.
|
||||
|
||||
Glossary of Terms
|
||||
|
||||
APDU Application Protocol Data Unit
|
||||
API Application Programming Interface
|
||||
CMU Carnegie-Mellon University, Pittsburgh, PA.
|
||||
Library The SNMP library; Both CMU and UCD versions are applicable.
|
||||
Session Concept embodying the management of transacting SNMP APDUS.
|
||||
SNMP Simple Network Management Protocol
|
||||
UCD University of California at Davis, CA.
|
||||
|
||||
Introduction
|
||||
|
||||
The Library extends the UNIX file concept (open, close, read, write) to a Session.
|
||||
Opening a Session binds a local socket to a well-known port and creates internal
|
||||
structures to help with controlling the transaction of SNMP APDUs. Closing a
|
||||
Session releases the memory and system resources used for these purposes.
|
||||
|
||||
Since the mid-1980s, many SNMP applications have used the Traditional Session
|
||||
API to transact SNMP APDUs between the local host and SNMP-enabled devices.
|
||||
|
||||
The Traditional Session API does not support multi-threaded applications:
|
||||
|
||||
1) There are no resource locks to prevent exposing the Library's
|
||||
global data resources to corruption in a multi-threaded application;
|
||||
|
||||
2) The Traditional API functions that receive SNMP APDUs
|
||||
do not provide an interface for one of many sessions;
|
||||
|
||||
3) Errors discovered by the Library are communicated through global
|
||||
data structures and are not associated with the session
|
||||
in which the error occurred.
|
||||
|
||||
The Single Session API provides these capabilities:
|
||||
|
||||
1) Manage a single SNMP session safely, in multi-threaded or
|
||||
non-threaded applications, by avoiding access to data structures
|
||||
that the Traditional Session API may share between Sessions;
|
||||
|
||||
2) Associate errors with the session context for threaded
|
||||
and non-threaded applications.
|
||||
|
||||
|
||||
Contrasting and Comparing Traditional API and Single API
|
||||
|
||||
The Traditional API uses the struct snmp_session pointer returned
|
||||
from snmp_open() to identify one SNMP session. The Single API uses
|
||||
the opaque pointer returned from snmp_sess_open() to identify one
|
||||
SNMP session.
|
||||
|
||||
Helpful Hint : The Library copies the contents of the
|
||||
structure which is input to snmp_open() and snmp_sess_open().
|
||||
Once copied, changing that input structure's data
|
||||
has no effect on the opened SNMP Session.
|
||||
|
||||
The Traditional API uses the snmp_error() function to identify any
|
||||
library and system errors that occurred during the processing for
|
||||
one SNMP session. The Single API uses snmp_sess_error() for the
|
||||
same purpose.
|
||||
|
||||
The Traditional API manages the private Sessions list structure;
|
||||
adding to the list during snmp_open(), removing during snmp_close.
|
||||
|
||||
With few exceptions, the Traditional API calls the Single API
|
||||
for each session that appears on the Sessions list.
|
||||
|
||||
The Traditional API reads from all Sessions on the Sessions list;
|
||||
The Single API does not use the Sessions list.
|
||||
The Single API can read from only one Session.
|
||||
|
||||
Helpful Hint :
|
||||
This is the basis for thread-safe-ness of the Library.
|
||||
There are no resource locks applied.
|
||||
|
||||
|
||||
Using the Single API
|
||||
|
||||
A multi-threaded application that deploys the SNMP Library should
|
||||
should complete all MIB file parsing before additional threads
|
||||
are activated. Drawing from the parsed contents of the MIB does
|
||||
not incur any data corruption exposure once the internal MIB structures
|
||||
are initialised.
|
||||
|
||||
The application may create threads such that a single thread may manage
|
||||
a single SNMP session. The thread should call snmp_sess_init()
|
||||
to prepare a struct snmp_session structure. The thread can adjust
|
||||
session parameters such as the remote UDP port or the local UDP port,
|
||||
which must be set prior to invoking snmp_sess_open().
|
||||
|
||||
The first call to snmp_sess_init() initialises the SNMP Library,
|
||||
including the MIB parse trees, before any SNMP sessions are created.
|
||||
Applications that call snmp_sess_init() do not need to read MIBs
|
||||
nor setup environment variables to utilize the Library.
|
||||
|
||||
After the struct snmp_session is setup, the thread must call
|
||||
snmp_sess_open() to create an SNMP session. If at any time
|
||||
the thread must change the Session configuration,
|
||||
snmp_sess_session() returns the pointer to the internal configuration
|
||||
structure (a struct snmp_session, copied from snmp_sess_open).
|
||||
The thread can adjust parameters such as the session timeout
|
||||
or the community string with this returned struct snmp_session pointer.
|
||||
Changes to the remote or local port values have no effect on an opened Session.
|
||||
|
||||
The thread can build PDUs and bind variables to PDUs, as it performs its duties.
|
||||
The thread then calls snmp_sess_send() or snmp_sess_async_send() to build and send
|
||||
an SNMP APDU to the remote device. If a Get-Response-PDU is expected, the thread
|
||||
should call snmp_sess_synch_response() instead.
|
||||
|
||||
When the thread is finished using the session, it must free the resources
|
||||
that the Library used to manage the session.
|
||||
Finally, the thread must call snmp_sess_close() to end the Session.
|
||||
|
||||
Snmp_sess_init(), snmp_open(), and snmp_sess_open()
|
||||
must use the same calling parameter for a given Session.
|
||||
Other methods should use only the returned parameter from
|
||||
snmp_open() and snmp_sess_open() to access the opened SNMP Session.
|
||||
|
||||
|
||||
Error Processing
|
||||
|
||||
Two calls were added : snmp_error() and snmp_sess_error() return the
|
||||
"errno" and "snmp_errno" values from the per session data, and a string
|
||||
that describes the errors that they represent. The string must be freed
|
||||
by the caller.
|
||||
|
||||
Use snmp_error() to process failures after Traditional API calls,
|
||||
or snmp_sess_error() to process failure after Single API calls.
|
||||
In the case where an SNMP session could not be opened,
|
||||
call snmp_error() using the struct snmp_session supplied to either snmp_open()
|
||||
or snmp_sess_open().
|
||||
|
||||
|
||||
The following variables and functions are obsolete and may create problems
|
||||
in a multi-threaded application :
|
||||
|
||||
int snmp_errno
|
||||
char * snmp_detail
|
||||
snmp_set_detail()
|
||||
snmp_api_errstring()
|
||||
|
||||
|
||||
Function Summary
|
||||
|
||||
The functions in the following table are functionally equivalent,
|
||||
with the exception of these behaviors:
|
||||
- The Traditional API manages many sessions
|
||||
- The Traditional API passes a struct snmp_session pointer,
|
||||
and touches the Sessions list
|
||||
- The Single API manages only one session
|
||||
- The Single API passes an opaque pointer, and does not use Sessions list
|
||||
|
||||
Traditional Single Comment
|
||||
=========== ============== =======
|
||||
snmp_sess_init snmp_sess_init Call before either open
|
||||
snmp_open snmp_sess_open Single not on Sessions list
|
||||
snmp_sess_session Exposes snmp_session pointer
|
||||
snmp_send snmp_sess_send Send one APDU
|
||||
snmp_async_send snmp_sess_async_send Send one APDU with callback
|
||||
snmp_select_info snmp_sess_select_info Which session(s) have input
|
||||
snmp_read snmp_sess_read Read APDUs
|
||||
snmp_timeout snmp_sess_timeout Check for timeout
|
||||
snmp_close snmp_sess_close Single not on Sessions list
|
||||
snmp_synch_response snmp_sess_synch_response Send/receive one APDU
|
||||
snmp_error snmp_sess_error Get library,system errno
|
||||
|
||||
|
||||
Example 1 : Traditional API use.
|
||||
|
||||
#include "snmp_api.h"
|
||||
...
|
||||
int liberr, syserr;
|
||||
char *errstr;
|
||||
struct snmp_session Session, *sptr;
|
||||
...
|
||||
snmp_sess_init(&Session);
|
||||
Session.peername = "foo.bar.net";
|
||||
sptr = snmp_open(&Session);
|
||||
if (sptr == NULL) {
|
||||
/* Error codes found in open calling argument */
|
||||
snmp_error(&Session, &liberr, &syserr, &errstr);
|
||||
printf("SNMP create error %s.\n", errstr);
|
||||
free(errstr);
|
||||
return 0;
|
||||
}
|
||||
/* Pass sptr to snmp_error from here forward */
|
||||
...
|
||||
/* Change the community name */
|
||||
free(sptr->community);
|
||||
sptr->community = strdup("public");
|
||||
sptr->community_len = strlen("public");
|
||||
...
|
||||
if (0 == snmp_send(sptr, pdu)) {
|
||||
snmp_error(sptr, &liberr, &syserr, &errstr);
|
||||
printf("SNMP write error %s.\n", errstr);
|
||||
free(errstr);
|
||||
return 0;
|
||||
}
|
||||
snmp_close(sptr);
|
||||
|
||||
|
||||
Example 2 : Single API use.
|
||||
|
||||
#include "snmp_api.h"
|
||||
...
|
||||
int liberr, syserr;
|
||||
char *errstr;
|
||||
void *sessp; /* <-- an opaque pointer, not a struct pointer */
|
||||
struct snmp_session Session, *sptr;
|
||||
...
|
||||
snmp_sess_init(&Session);
|
||||
Session.peername = "foo.bar.net";
|
||||
sessp = snmp_sess_open(&Session);
|
||||
if (sessp == NULL) {
|
||||
/* Error codes found in open calling argument */
|
||||
snmp_error(&Session, &liberr, &syserr, &errstr);
|
||||
printf("SNMP create error %s.\n", errstr);
|
||||
free(errstr);
|
||||
return 0;
|
||||
}
|
||||
sptr = snmp_sess_session(sessp); /* <-- get the snmp_session pointer */
|
||||
|
||||
/* Pass sptr to snmp_sess_error from here forward */
|
||||
...
|
||||
/* Change the community name */
|
||||
free(sptr->community);
|
||||
sptr->community = strdup("public");
|
||||
sptr->community_len = strlen("public");
|
||||
...
|
||||
if (0 == snmp_sess_send(sessp, pdu)) {
|
||||
snmp_sess_error(sessp, &liberr, &syserr, &errstr);
|
||||
printf("SNMP write error %s.\n", errstr);
|
||||
free(errstr);
|
||||
return 0;
|
||||
}
|
||||
snmp_sess_close(sessp);
|
||||
|
||||
Example 3. Differences Between Traditional API and Single API Usage
|
||||
5a6
|
||||
> void *sessp; /* <-- an opaque pointer, not a struct pointer */
|
||||
11,13c12,14
|
||||
< sptr = snmp_open(&Session);
|
||||
< if (sptr == NULL) {
|
||||
---
|
||||
> sessp = snmp_sess_open(&Session);
|
||||
> if (sessp == NULL) {
|
||||
19c20,22
|
||||
< /* Pass sptr to snmp_error from here forward */
|
||||
---
|
||||
> sptr = snmp_sess_session(sessp); /* <-- get the snmp_session pointer */
|
||||
>
|
||||
> /* Pass sptr to snmp_sess_error from here forward */
|
||||
26,27c29,30
|
||||
< if (0 == snmp_send(sptr, pdu)) {
|
||||
< snmp_error(sptr, &liberr, &syserr, &errstr);
|
||||
---
|
||||
> if (0 == snmp_sess_send(sessp, pdu)) {
|
||||
> snmp_sess_error(sessp, &liberr, &syserr, &errstr);
|
||||
33c36
|
||||
< snmp_close(sptr);
|
||||
---
|
||||
> snmp_sess_close(sessp);
|
||||
|
||||
|
||||
Restrictions on Multi-threaded Use of the SNMP Library
|
||||
|
||||
1. Invoke SOCK_STARTUP or SOCK_CLEANUP from the main thread only.
|
||||
|
||||
2. The MIB parsing functions use global shared data and are not
|
||||
multi-thread safe when the MIB tree is under construction.
|
||||
Once the tree is built, the data can be safely referenced from
|
||||
any thread. There is no provision for freeing the MIB tree.
|
||||
Suggestion: Read the MIB files before an SNMP session is created.
|
||||
This can be accomplished by invoking snmp_sess_init from the main
|
||||
thread and discarding the buffer which is initialised.
|
||||
|
||||
3. Invoke the SNMPv2p initialisation before an SNMP session is created,
|
||||
for reasons similar to reading the MIB file.
|
||||
The SNMPv2p structures should be available to all SNMP sessions.
|
||||
CAUTION: These structures have not been tested in a multi-threaded
|
||||
application.
|
||||
|
||||
4. Sessions created using the Single API do not interact with other
|
||||
SNMP sessions. If you choose to use Traditional API calls, call
|
||||
them from a single thread. The Library cannot reference an SNMP
|
||||
session using both Traditional and Single API calls.
|
||||
|
||||
5. Using the callback mechanism for asynchronous response PDUs
|
||||
requires additional caution in a multi-threaded application.
|
||||
This means a callback function probably should probably not use
|
||||
Single API calls to further process the session.
|
||||
|
||||
6. Each call to snmp_sess_open() creates an IDS. Only a call to
|
||||
snmp_sess_close() releases the resources used by the IDS.
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
Some notes for the Tru64 Unix 5.x port
|
||||
======================================
|
||||
|
||||
1. Compiling
|
||||
------------
|
||||
|
||||
The following procedure has been proven to successfully compile net-snmp
|
||||
version 5.2.2 and later on Tru64 Unix 5.1B (Alpha EV5.6) using the Compaq C 6.5
|
||||
compiler:
|
||||
|
||||
./configure --disable-embedded-perl
|
||||
make
|
||||
su -
|
||||
make install
|
||||
|
||||
A recent GNU C compiler (gcc) will probably work, too.
|
||||
|
||||
Please note that the "host" module doesn't compile on Tru64, so you *cannot*
|
||||
run configure with "--with-mib-modules=host".
|
||||
|
||||
2. Embedded Perl
|
||||
----------------
|
||||
|
||||
The Perl package (5.00503) shipped with Tru64 Unix 5.1 isn't complete enough
|
||||
to allow to build net-snmp with embedded Perl support. If you need embedded
|
||||
Perl support, do your own Perl installation first.
|
||||
|
||||
3. IPv6
|
||||
-------
|
||||
|
||||
Starting with net-snmp 5.4 you can enable the UDPIPv6 and TCPIPv6 transports
|
||||
on Tru64 Unix 5.1:
|
||||
|
||||
./configure --enable-ipv6
|
||||
|
||||
There's no support for the IPv6 MIBs, though.
|
||||
|
||||
|
||||
4. Known problems
|
||||
-----------------
|
||||
|
||||
"make test" is known to report the following failure:
|
||||
|
||||
59: testing full snmpwalk (SNMPv2c) against agent (may take time)... FAIL
|
||||
|
||||
so it's obvious that there are still problems with some MIB modules on Tru64.
|
||||
If you have ideas how to fix them, please let us know!
|
||||
|
||||
|
||||
5. Feedback
|
||||
-----------
|
||||
|
||||
Please also see README and PORTING.
|
||||
|
||||
If you have questions, additional insights or (even better) patches regarding
|
||||
net-snmp on Tru64 Unix, please refer to the net-snmp mailing lists (see
|
||||
http://www.net-snmp.org/lists).
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,60 +0,0 @@
|
||||
TODO list of possible projects/developments/etc
|
||||
===============================================
|
||||
|
||||
APIs:
|
||||
Perl (basically OK - may need a review/update)
|
||||
PHP (PHP-shipped API is out of date, needs reworking)
|
||||
Java (see netsnmpj)
|
||||
Tk/Tcl
|
||||
WinSNMP
|
||||
Python (yapsnmp? / snmpy?)
|
||||
#Net
|
||||
|
||||
Agent MIBs:
|
||||
Notification Filtering
|
||||
Community MIB
|
||||
Proxy MIB (extended to support proxying of subtrees)
|
||||
RMON/RMON2
|
||||
MIB-2 updates (in hand)
|
||||
IPv6
|
||||
Firewall (inc. connection tracking)
|
||||
DisMan:
|
||||
monitor (done?)
|
||||
RemOps (preliminary implementation)
|
||||
Tunnel
|
||||
WWW-MIB
|
||||
Hardware Abstraction Layer:
|
||||
HostRes (convert to use HAL and clean up - in progress)
|
||||
UCDavis (convert to use HAL and update structures - in progress)
|
||||
|
||||
Extensibility:
|
||||
AgentX (reasonably stable now)
|
||||
SMUX (?obsolete?)
|
||||
embedded Perl (done? in hand?)
|
||||
" Python
|
||||
DisMan script MIB
|
||||
Extend scripts (new, so will need to bed down)
|
||||
Pass scripts (support SNMPv2 exceptions/errors)
|
||||
DLMod (OK, but MIB i/f not robust)
|
||||
|
||||
Library:
|
||||
Threading
|
||||
Debugging (heirarchical)
|
||||
Config (split syntax & processing, persist/read-only/etc)
|
||||
SecModels:
|
||||
Kerberos (?done)
|
||||
SBSM (?in hand)
|
||||
Pre-compiled MIBs
|
||||
|
||||
Traps:
|
||||
Separate thread in agen
|
||||
Pluggable modules (?done)
|
||||
Dynamic loading
|
||||
Persistent connection
|
||||
Threaded handler
|
||||
|
||||
Documentation:
|
||||
Tutorials
|
||||
Extending the agent
|
||||
Agent internals
|
||||
|
||||
@@ -1,822 +0,0 @@
|
||||
/*
|
||||
* net-snmp configuration header file
|
||||
*
|
||||
* NOTE: DO NOT EDIT include/net-snmp/net-snmp-config.h.in as your changes
|
||||
* will be overwritten. This content is in acconfig.h and merged
|
||||
* into include/net-snmp/net-snmp-config.h.in by autoheader.
|
||||
*/
|
||||
/* Portions of this file are subject to the following copyright(s). See
|
||||
* the Net-SNMP's COPYING file for more details and other copyrights
|
||||
* that may apply:
|
||||
*/
|
||||
/*
|
||||
* Portions of this file are copyrighted by:
|
||||
* Copyright <20> 2003 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms specified in the COPYING file
|
||||
* distributed with the Net-SNMP package.
|
||||
*/
|
||||
|
||||
#ifndef NET_SNMP_CONFIG_H
|
||||
#define NET_SNMP_CONFIG_H
|
||||
|
||||
|
||||
/* ********* NETSNMP_MARK_BEGIN_AUTOCONF_DEFINITIONS ********* */
|
||||
/*
|
||||
* put all autoconf-specific definitions below here
|
||||
*
|
||||
*/
|
||||
#ifndef NETSNMP_NO_AUTOCONF_DEFINITIONS
|
||||
|
||||
/* definitions added by configure on-the-fly */
|
||||
@TOP@
|
||||
@BOTTOM@
|
||||
|
||||
/* end of definitions added by configure on-the-fly */
|
||||
|
||||
/* If you have openssl 0.9.7 or above, you likely have AES support. */
|
||||
#undef NETSNMP_USE_OPENSSL
|
||||
#if (defined(NETSNMP_USE_OPENSSL) && defined(HAVE_OPENSSL_AES_H) && defined(HAVE_AES_CFB128_ENCRYPT)) || defined(NETSNMP_USE_INTERNAL_CRYPTO)
|
||||
#define HAVE_AES 1
|
||||
#endif
|
||||
|
||||
/* define random functions */
|
||||
|
||||
#ifndef HAVE_RANDOM
|
||||
#ifdef HAVE_LRAND48
|
||||
#define random lrand48
|
||||
#define srandom(s) srand48(s)
|
||||
#else
|
||||
#ifdef HAVE_RAND
|
||||
#define random rand
|
||||
#define srandom(s) srand(s)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* define signal if DNE */
|
||||
|
||||
#ifndef HAVE_SIGNAL
|
||||
#ifdef HAVE_SIGSET
|
||||
#define signal(a,b) sigset(a,b)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DMALLOC_H
|
||||
#define DMALLOC_FUNC_CHECK
|
||||
#endif
|
||||
|
||||
#endif /* NETSNMP_NO_AUTOCONF_DEFINITIONS */
|
||||
|
||||
|
||||
|
||||
|
||||
/* ********* NETSNMP_MARK_BEGIN_CLEAN_NAMESPACE ********* */
|
||||
/*
|
||||
* put all new net-snmp-specific definitions here
|
||||
*
|
||||
* all definitions MUST have a NETSNMP_ prefix
|
||||
*
|
||||
*/
|
||||
|
||||
/* Default (SNMP) version number for the tools to use */
|
||||
#define NETSNMP_DEFAULT_SNMP_VERSION 3
|
||||
|
||||
/* don't change these values! */
|
||||
#define NETSNMP_SNMPV1 0xAAAA /* readable by anyone */
|
||||
#define NETSNMP_SNMPV2ANY 0xA000 /* V2 Any type (includes NoAuth) */
|
||||
#define NETSNMP_SNMPV2AUTH 0x8000 /* V2 Authenticated requests only */
|
||||
|
||||
/* default list of mibs to load */
|
||||
#define NETSNMP_DEFAULT_MIBS "IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB"
|
||||
|
||||
/* debugging stuff */
|
||||
/* if defined, we optimize the code to exclude all debugging calls. */
|
||||
#undef NETSNMP_NO_DEBUGGING
|
||||
/* ignore the -D flag and always print debugging information */
|
||||
#define NETSNMP_ALWAYS_DEBUG 0
|
||||
|
||||
/* reverse encoding BER packets is both faster and more efficient in space. */
|
||||
#define NETSNMP_USE_REVERSE_ASNENCODING 1
|
||||
#define NETSNMP_DEFAULT_ASNENCODING_DIRECTION 1 /* 1 = reverse, 0 = forwards */
|
||||
|
||||
/* PERSISTENT_DIRECTORY: If defined, the library is capabile of saving
|
||||
persisant information to this directory in the form of configuration
|
||||
lines: PERSISTENT_DIRECTORY/NAME.persistent.conf */
|
||||
#define NETSNMP_PERSISTENT_DIRECTORY "/var/snmp"
|
||||
|
||||
/* AGENT_DIRECTORY_MODE: the mode the agents should use to create
|
||||
directories with. Since the data stored here is probably sensitive, it
|
||||
probably should be read-only by root/administrator. */
|
||||
#define NETSNMP_AGENT_DIRECTORY_MODE 0700
|
||||
|
||||
/* MAX_PERSISTENT_BACKUPS:
|
||||
* The maximum number of persistent backups the library will try to
|
||||
* read from the persistent cache directory. If an application fails to
|
||||
* close down successfully more than this number of times, data will be lost.
|
||||
*/
|
||||
#define NETSNMP_MAX_PERSISTENT_BACKUPS 10
|
||||
|
||||
/* define the system type include file here */
|
||||
#define NETSNMP_SYSTEM_INCLUDE_FILE <net-snmp/system/generic.h>
|
||||
|
||||
/* define the machine (cpu) type include file here */
|
||||
#define NETSNMP_MACHINE_INCLUDE_FILE <net-snmp/machine/generic.h>
|
||||
|
||||
/* define the UDP buffer defaults undefined means use the OS buffers
|
||||
* by default */
|
||||
#undef NETSNMP_DEFAULT_SERVER_SEND_BUF
|
||||
#undef NETSNMP_DEFAULT_SERVER_RECV_BUF
|
||||
#undef NETSNMP_DEFAULT_CLIENT_SEND_BUF
|
||||
#undef NETSNMP_DEFAULT_CLIENT_RECV_BUF
|
||||
|
||||
/* net-snmp's major path names */
|
||||
#undef SNMPLIBPATH
|
||||
#undef SNMPSHAREPATH
|
||||
#undef SNMPCONFPATH
|
||||
#undef SNMPDLMODPATH
|
||||
|
||||
/* NETSNMP_LOGFILE: If defined it closes stdout/err/in and opens this in
|
||||
out/err's place. (stdin is closed so that sh scripts won't wait for it) */
|
||||
#undef NETSNMP_LOGFILE
|
||||
|
||||
/* default system contact */
|
||||
#undef NETSNMP_SYS_CONTACT
|
||||
|
||||
/* system location */
|
||||
#undef NETSNMP_SYS_LOC
|
||||
|
||||
/* Use libwrap to handle allow/deny hosts? */
|
||||
#undef NETSNMP_USE_LIBWRAP
|
||||
|
||||
/* Mib-2 tree Info */
|
||||
/* These are the system information variables. */
|
||||
|
||||
#define NETSNMP_VERS_DESC "unknown" /* overridden at run time */
|
||||
#define NETSNMP_SYS_NAME "unknown" /* overridden at run time */
|
||||
|
||||
/* comment out the second define to turn off functionality for any of
|
||||
these: (See README for details) */
|
||||
|
||||
/* proc PROCESSNAME [MAX] [MIN] */
|
||||
#define NETSNMP_PROCMIBNUM 2
|
||||
|
||||
/* exec/shell NAME COMMAND */
|
||||
#define NETSNMP_SHELLMIBNUM 8
|
||||
|
||||
/* swap MIN */
|
||||
#define NETSNMP_MEMMIBNUM 4
|
||||
|
||||
/* disk DISK MINSIZE */
|
||||
#define NETSNMP_DISKMIBNUM 9
|
||||
|
||||
/* load 1 5 15 */
|
||||
#define NETSNMP_LOADAVEMIBNUM 10
|
||||
|
||||
/* which version are you using? This mibloc will tell you */
|
||||
#define NETSNMP_VERSIONMIBNUM 100
|
||||
|
||||
/* Reports errors the agent runs into */
|
||||
/* (typically its "can't fork, no mem" problems) */
|
||||
#define NETSNMP_ERRORMIBNUM 101
|
||||
|
||||
/* The sub id of EXTENSIBLEMIB returned to queries of
|
||||
.iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0 */
|
||||
#define NETSNMP_AGENTID 250
|
||||
|
||||
/* This ID is returned after the AGENTID above. IE, the resulting
|
||||
value returned by a query to sysObjectID is
|
||||
EXTENSIBLEMIB.AGENTID.???, where ??? is defined below by OSTYPE */
|
||||
|
||||
#define NETSNMP_HPUX9ID 1
|
||||
#define NETSNMP_SUNOS4ID 2
|
||||
#define NETSNMP_SOLARISID 3
|
||||
#define NETSNMP_OSFID 4
|
||||
#define NETSNMP_ULTRIXID 5
|
||||
#define NETSNMP_HPUX10ID 6
|
||||
#define NETSNMP_NETBSD1ID 7
|
||||
#define NETSNMP_FREEBSDID 8
|
||||
#define NETSNMP_IRIXID 9
|
||||
#define NETSNMP_LINUXID 10
|
||||
#define NETSNMP_BSDIID 11
|
||||
#define NETSNMP_OPENBSDID 12
|
||||
#define NETSNMP_WIN32ID 13
|
||||
#define NETSNMP_HPUX11ID 14
|
||||
#define NETSNMP_AIXID 15
|
||||
#define NETSNMP_MACOSXID 16
|
||||
#define NETSNMP_DRAGONFLYID 17
|
||||
#define NETSNMP_UNKNOWNID 255
|
||||
|
||||
#ifdef hpux9
|
||||
#define NETSNMP_OSTYPE NETSNMP_HPUX9ID
|
||||
#endif
|
||||
#ifdef hpux10
|
||||
#define NETSNMP_OSTYPE NETSNMP_HPUX10ID
|
||||
#endif
|
||||
#ifdef hpux11
|
||||
#define NETSNMP_OSTYPE NETSNMP_HPUX11ID
|
||||
#endif
|
||||
#ifdef sunos4
|
||||
#define NETSNMP_OSTYPE NETSNMP_SUNOS4ID
|
||||
#endif
|
||||
#ifdef solaris2
|
||||
#define NETSNMP_OSTYPE NETSNMP_SOLARISID
|
||||
#endif
|
||||
#if defined(osf3) || defined(osf4) || defined(osf5)
|
||||
#define NETSNMP_OSTYPE NETSNMP_OSFID
|
||||
#endif
|
||||
#ifdef ultrix4
|
||||
#define NETSNMP_OSTYPE NETSNMP_ULTRIXID
|
||||
#endif
|
||||
#if defined(netbsd1) || defined(netbsd2)
|
||||
#define NETSNMP_OSTYPE NETSNMP_NETBSD1ID
|
||||
#endif
|
||||
#if defined(__FreeBSD__)
|
||||
#define NETSNMP_OSTYPE NETSNMP_FREEBSDID
|
||||
#endif
|
||||
#if defined(__DragonFly__)
|
||||
#define NETSNMP_OSTYPE NETSNMP_DRAGONFLYID
|
||||
#endif
|
||||
#if defined(irix6) || defined(irix5)
|
||||
#define NETSNMP_OSTYPE NETSNMP_IRIXID
|
||||
#endif
|
||||
#ifdef linux
|
||||
#define NETSNMP_OSTYPE NETSNMP_LINUXID
|
||||
#endif
|
||||
#if defined(bsdi2) || defined(bsdi3) || defined(bsdi4)
|
||||
#define NETSNMP_OSTYPE NETSNMP_BSDIID
|
||||
#endif
|
||||
#if defined(openbsd)
|
||||
#define NETSNMP_OSTYPE NETSNMP_OPENBSDID
|
||||
#endif
|
||||
#ifdef WIN32
|
||||
#define NETSNMP_OSTYPE NETSNMP_WIN32ID
|
||||
#endif
|
||||
#if defined(aix3) || defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
|
||||
#define NETSNMP_OSTYPE NETSNMP_AIXID
|
||||
#endif
|
||||
#if defined(darwin) && (darwin >= 8)
|
||||
#define NETSNMP_OSTYPE NETSNMP_MACOSXID
|
||||
#endif
|
||||
/* unknown */
|
||||
#ifndef NETSNMP_OSTYPE
|
||||
#define NETSNMP_OSTYPE NETSNMP_UNKNOWNID
|
||||
#endif
|
||||
|
||||
/* The enterprise number has been assigned by the IANA group. */
|
||||
/* Optionally, this may point to the location in the tree your */
|
||||
/* company/organization has been allocated. */
|
||||
/* The assigned enterprise number for the NET_SNMP MIB modules. */
|
||||
#define NETSNMP_ENTERPRISE_OID 8072
|
||||
#define NETSNMP_ENTERPRISE_MIB 1,3,6,1,4,1,8072
|
||||
#define NETSNMP_ENTERPRISE_DOT_MIB 1.3.6.1.4.1.8072
|
||||
#define NETSNMP_ENTERPRISE_DOT_MIB_LENGTH 7
|
||||
|
||||
/* The assigned enterprise number for sysObjectID. */
|
||||
#define NETSNMP_SYSTEM_MIB 1,3,6,1,4,1,8072,3,2,NETSNMP_OSTYPE
|
||||
#define NETSNMP_SYSTEM_DOT_MIB 1.3.6.1.4.1.8072.3.2.NETSNMP_OSTYPE
|
||||
#define NETSNMP_SYSTEM_DOT_MIB_LENGTH 10
|
||||
|
||||
/* The assigned enterprise number for notifications. */
|
||||
#define NETSNMP_NOTIFICATION_MIB 1,3,6,1,4,1,8072,4
|
||||
#define NETSNMP_NOTIFICATION_DOT_MIB 1.3.6.1.4.1.8072.4
|
||||
#define NETSNMP_NOTIFICATION_DOT_MIB_LENGTH 8
|
||||
|
||||
/* this is the location of the ucdavis mib tree. It shouldn't be
|
||||
changed, as the places it is used are expected to be constant
|
||||
values or are directly tied to the UCD-SNMP-MIB. */
|
||||
#define NETSNMP_UCDAVIS_OID 2021
|
||||
#define NETSNMP_UCDAVIS_MIB 1,3,6,1,4,1,2021
|
||||
#define NETSNMP_UCDAVIS_DOT_MIB 1.3.6.1.4.1.2021
|
||||
#define NETSNMP_UCDAVIS_DOT_MIB_LENGTH 7
|
||||
|
||||
/* how long to wait (seconds) for error querys before reseting the error trap.*/
|
||||
#define NETSNMP_ERRORTIMELENGTH 600
|
||||
|
||||
/* Exec command to fix PROC problems */
|
||||
/* %s will be replaced by the process name in error */
|
||||
|
||||
/* #define NETSNMP_PROCFIXCMD "/usr/bin/perl /local/scripts/fixproc %s" */
|
||||
|
||||
/* Exec command to fix EXEC problems */
|
||||
/* %s will be replaced by the exec/script name in error */
|
||||
|
||||
/* #define NETSNMP_EXECFIXCMD "/usr/bin/perl /local/scripts/fixproc %s" */
|
||||
|
||||
/* Should exec output Cashing be used (speeds up things greatly), and
|
||||
if so, After how many seconds should the cache re-newed? Note:
|
||||
Don't define CASHETIME to disable cashing completely */
|
||||
|
||||
#define NETSNMP_EXCACHETIME 30
|
||||
#define NETSNMP_CACHEFILE ".snmp-exec-cache"
|
||||
#define NETSNMP_MAXCACHESIZE (1500*80) /* roughly 1500 lines max */
|
||||
|
||||
/* misc defaults */
|
||||
|
||||
/* default of 100 meg minimum if the minimum size is not specified in
|
||||
the config file */
|
||||
#define NETSNMP_DEFDISKMINIMUMSPACE 100000
|
||||
|
||||
/* default maximum load average before error */
|
||||
#define NETSNMP_DEFMAXLOADAVE 12.0
|
||||
|
||||
/* max times to loop reading output from execs. */
|
||||
/* Because of sleep(1)s, this will also be time to wait (in seconds) for exec
|
||||
to finish */
|
||||
#define NETSNMP_MAXREADCOUNT 100
|
||||
|
||||
/* Set if snmpgets should block and never timeout */
|
||||
/* The original CMU code had this hardcoded as = 1 */
|
||||
#define NETSNMP_SNMPBLOCK 1
|
||||
|
||||
/* How long to wait before restarting the agent after a snmpset to
|
||||
EXTENSIBLEMIB.VERSIONMIBNUM.VERRESTARTAGENT. This is
|
||||
necessary to finish the snmpset reply before restarting. */
|
||||
#define NETSNMP_RESTARTSLEEP 5
|
||||
|
||||
/* UNdefine to allow specifying zero-length community string */
|
||||
/* #define NETSNMP_NO_ZEROLENGTH_COMMUNITY 1 */
|
||||
|
||||
/* Number of community strings to store */
|
||||
#define NETSNMP_NUM_COMMUNITIES 5
|
||||
|
||||
/* internal define */
|
||||
#define NETSNMP_LASTFIELD -1
|
||||
|
||||
/* Pluggable transports. */
|
||||
|
||||
/* This is defined if support for the UDP/IP transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_UDP_DOMAIN
|
||||
|
||||
/* This is defined if support for the "callback" transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
|
||||
|
||||
/* This is defined if support for the TCP/IP transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_TCP_DOMAIN
|
||||
|
||||
/* This is defined if support for the Unix transport domain
|
||||
(a.k.a. "local IPC") is available. */
|
||||
#undef NETSNMP_TRANSPORT_UNIX_DOMAIN
|
||||
|
||||
/* This is defined if support for the AAL5 PVC transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
|
||||
|
||||
/* This is defined if support for the IPX transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_IPX_DOMAIN
|
||||
|
||||
/* This is defined if support for the UDP/IPv6 transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
|
||||
|
||||
/* This is defined if support for the TCP/IPv6 transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
|
||||
|
||||
/* This is defined if support for the TLS transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_TLSBASE_DOMAIN
|
||||
|
||||
/* This is defined if support for the Alias transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_ALIAS_DOMAIN
|
||||
|
||||
/* This is defined if support for the SSH transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_SSH_DOMAIN
|
||||
|
||||
/* This is defined if support for the DTLS/UDP transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_DTLSUDP_DOMAIN
|
||||
|
||||
/* This is defined if support for the TLS/TCP transport domain is
|
||||
available. */
|
||||
#undef NETSNMP_TRANSPORT_TLSTCP_DOMAIN
|
||||
|
||||
/* This is defined if support for stdin/out transport domain is available. */
|
||||
#undef NETSNMP_TRANSPORT_STD_DOMAIN
|
||||
|
||||
/* This is defined if support for the IPv4Base transport domain is available. */
|
||||
#undef NETSNMP_TRANSPORT_IPV4BASE_DOMAIN
|
||||
|
||||
/* define this if the USM security module is available */
|
||||
#undef NETSNMP_SECMOD_USM
|
||||
|
||||
/* define this if the KSM (kerberos based snmp) security module is available */
|
||||
#undef NETSNMP_SECMOD_KSM
|
||||
|
||||
/* define this if the local security module is available */
|
||||
#undef NETSNMP_SECMOD_LOCALSM
|
||||
|
||||
/* define if configured as a "mini-agent" */
|
||||
#undef NETSNMP_MINI_AGENT
|
||||
|
||||
/* this is the location of the net-snmp mib tree. It shouldn't be
|
||||
changed, as the places it is used are expected to be constant
|
||||
values or are directly tied to the UCD-SNMP-MIB. */
|
||||
#define NETSNMP_OID 8072
|
||||
#define NETSNMP_MIB 1,3,6,1,4,1,8072
|
||||
#define NETSNMP_DOT_MIB 1.3.6.1.4.1.8072
|
||||
#define NETSNMP_DOT_MIB_LENGTH 7
|
||||
|
||||
/* pattern for temporary file names */
|
||||
#define NETSNMP_TEMP_FILE_PATTERN "/tmp/snmpdXXXXXX"
|
||||
|
||||
/*
|
||||
* this must be before the system/machine includes, to allow them to
|
||||
* override and turn off inlining. To do so, they should do the
|
||||
* following:
|
||||
*
|
||||
* #undef NETSNMP_ENABLE_INLINE
|
||||
* #define NETSNMP_ENABLE_INLINE 0
|
||||
*
|
||||
* A user having problems with their compiler can also turn off
|
||||
* the use of inline by defining NETSNMP_NO_INLINE via their cflags:
|
||||
*
|
||||
* -DNETSNMP_NO_INLINE
|
||||
*
|
||||
* Header and source files should only test against NETSNMP_USE_INLINE:
|
||||
*
|
||||
* #ifdef NETSNMP_USE_INLINE
|
||||
* NETSNMP_INLINE function(int parm) { return parm -1; }
|
||||
* #endif
|
||||
*
|
||||
* Functions which should be static, regardless of whether or not inline
|
||||
* is available or enabled should use the NETSNMP_STATIC_INLINE macro,
|
||||
* like so:
|
||||
*
|
||||
* NETSNMP_STATIC_INLINE function(int parm) { return parm -1; }
|
||||
*
|
||||
* NOT like this:
|
||||
*
|
||||
* static NETSNMP_INLINE function(int parm) { return parm -1; }
|
||||
*
|
||||
*/
|
||||
#ifdef NETSNMP_BROKEN_INLINE
|
||||
# define NETSNMP_ENABLE_INLINE 0
|
||||
#else
|
||||
# define NETSNMP_ENABLE_INLINE 1
|
||||
#endif
|
||||
|
||||
#include NETSNMP_SYSTEM_INCLUDE_FILE
|
||||
#include NETSNMP_MACHINE_INCLUDE_FILE
|
||||
|
||||
#if NETSNMP_ENABLE_INLINE && !defined(NETSNMP_NO_INLINE)
|
||||
# define NETSNMP_USE_INLINE 1
|
||||
# ifndef NETSNMP_INLINE
|
||||
# define NETSNMP_INLINE inline
|
||||
# endif
|
||||
# ifndef NETSNMP_STATIC_INLINE
|
||||
# define NETSNMP_STATIC_INLINE static inline
|
||||
# endif
|
||||
#else
|
||||
# define NETSNMP_INLINE
|
||||
# define NETSNMP_STATIC_INLINE static
|
||||
#endif
|
||||
|
||||
#ifndef NETSNMP_IMPORT
|
||||
# define NETSNMP_IMPORT extern
|
||||
#endif
|
||||
|
||||
/* comment the next line if you are compiling with libsnmp.h
|
||||
and are not using the UC-Davis SNMP library. */
|
||||
#define UCD_SNMP_LIBRARY 1
|
||||
|
||||
/* final conclusion on nlist usage */
|
||||
#if defined(HAVE_NLIST) && defined(HAVE_STRUCT_NLIST_N_VALUE) && !defined(NETSNMP_DONT_USE_NLIST) && defined(HAVE_KMEM) && !defined(NETSNMP_NO_KMEM_USAGE)
|
||||
#define NETSNMP_CAN_USE_NLIST
|
||||
#endif
|
||||
|
||||
|
||||
/* ********* NETSNMP_MARK_BEGIN_LEGACY_DEFINITIONS *********/
|
||||
/*
|
||||
* existing definitions prior to Net-SNMP 5.4
|
||||
*
|
||||
* do not add anything new here
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef NETSNMP_NO_LEGACY_DEFINITIONS
|
||||
|
||||
#ifdef NETSNMP_DEFAULT_SNMP_VERSION
|
||||
# define DEFAULT_SNMP_VERSION NETSNMP_DEFAULT_SNMP_VERSION
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_SNMPV1
|
||||
# define SNMPV1 NETSNMP_SNMPV1
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_SNMPV2ANY
|
||||
# define SNMPV2ANY NETSNMP_SNMPV2ANY
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_SNMPV2AUTH
|
||||
# define SNMPV2AUTH NETSNMP_SNMPV2AUTH
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_DEFAULT_MIBS
|
||||
# define DEFAULT_MIBS NETSNMP_DEFAULT_MIBS
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_DEFAULT_MIBDIRS
|
||||
# define DEFAULT_MIBDIRS NETSNMP_DEFAULT_MIBDIRS
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_DEFAULT_MIBFILES
|
||||
# define DEFAULT_MIBFILES NETSNMP_DEFAULT_MIBFILES
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
|
||||
# define OPAQUE_SPECIAL_TYPES NETSNMP_WITH_OPAQUE_SPECIAL_TYPES
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_ENABLE_SCAPI_AUTHPRIV
|
||||
# define SCAPI_AUTHPRIV NETSNMP_ENABLE_SCAPI_AUTHPRIV
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_USE_INTERNAL_MD5
|
||||
# define USE_INTERNAL_MD5 NETSNMP_USE_INTERNAL_MD5
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_USE_PKCS11
|
||||
# define USE_PKCS NETSNMP_USE_PKCS11
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_USE_OPENSSL
|
||||
# define USE_OPENSSL NETSNMP_USE_OPENSSL
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_NO_DEBUGGING
|
||||
# define SNMP_NO_DEBUGGING NETSNMP_NO_DEBUGGING
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_ALWAYS_DEBUG
|
||||
# define SNMP_ALWAYS_DEBUG NETSNMP_ALWAYS_DEBUG
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_USE_REVERSE_ASNENCODING
|
||||
# define USE_REVERSE_ASNENCODING NETSNMP_USE_REVERSE_ASNENCODING
|
||||
#endif
|
||||
#ifdef NETSNMP_DEFAULT_ASNENCODING_DIRECTION
|
||||
# define DEFAULT_ASNENCODING_DIRECTION NETSNMP_DEFAULT_ASNENCODING_DIRECTION
|
||||
#endif
|
||||
|
||||
#define PERSISTENT_DIRECTORY NETSNMP_PERSISTENT_DIRECTORY
|
||||
#define PERSISTENT_MASK NETSNMP_PERSISTENT_MASK
|
||||
#define AGENT_DIRECTORY_MODE NETSNMP_AGENT_DIRECTORY_MODE
|
||||
#define MAX_PERSISTENT_BACKUPS NETSNMP_MAX_PERSISTENT_BACKUPS
|
||||
#define SYSTEM_INCLUDE_FILE NETSNMP_SYSTEM_INCLUDE_FILE
|
||||
#define MACHINE_INCLUDE_FILE NETSNMP_MACHINE_INCLUDE_FILE
|
||||
|
||||
#ifdef NETSNMP_DEFAULT_SERVER_SEND_BUF
|
||||
# define DEFAULT_SERVER_SEND_BUF NETSNMP_DEFAULT_SERVER_SEND_BUF
|
||||
#endif
|
||||
#ifdef NETSNMP_DEFAULT_SERVER_RECV_BUF
|
||||
# define DEFAULT_SERVER_RECV_BUF NETSNMP_DEFAULT_SERVER_RECV_BUF
|
||||
#endif
|
||||
#ifdef NETSNMP_DEFAULT_CLIENT_SEND_BUF
|
||||
# define DEFAULT_CLIENT_SEND_BUF NETSNMP_DEFAULT_CLIENT_SEND_BUF
|
||||
#endif
|
||||
#ifdef NETSNMP_DEFAULT_CLIENT_RECV_BUF
|
||||
# define DEFAULT_CLIENT_RECV_BUF NETSNMP_DEFAULT_CLIENT_RECV_BUF
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_LOGFILE
|
||||
# define LOGFILE NETSNMP_LOGFILE
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_SYS_CONTACT
|
||||
# define SYS_CONTACT NETSNMP_SYS_CONTACT
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_SYS_LOC
|
||||
# define SYS_LOC NETSNMP_SYS_LOC
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_USE_LIBWRAP
|
||||
# define USE_LIBWRAP NETSNMP_USE_LIBWRAP
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_ENABLE_TESTING_CODE
|
||||
# define SNMP_TESTING_CODE NETSNMP_ENABLE_TESTING_CODE
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_NO_ROOT_ACCESS
|
||||
# define NO_ROOT_ACCESS NETSNMP_NO_ROOT_ACCESS
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_NO_KMEM_USAGE
|
||||
# define NO_KMEM_USAGE NETSNMP_NO_KMEM_USAGE
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_NO_DUMMY_VALUES
|
||||
# define NO_DUMMY_VALUES NETSNMP_NO_DUMMY_VALUES
|
||||
#endif
|
||||
|
||||
#define VERS_DESC NETSNMP_VERS_DESC
|
||||
#define SYS_NAME NETSNMP_SYS_NAME
|
||||
|
||||
#define PROCMIBNUM NETSNMP_PROCMIBNUM
|
||||
#define SHELLMIBNUM NETSNMP_SHELLMIBNUM
|
||||
#define MEMMIBNUM NETSNMP_MEMMIBNUM
|
||||
#define DISKMIBNUM NETSNMP_DISKMIBNUM
|
||||
|
||||
#define LOADAVEMIBNUM NETSNMP_LOADAVEMIBNUM
|
||||
#define VERSIONMIBNUM NETSNMP_VERSIONMIBNUM
|
||||
#define ERRORMIBNUM NETSNMP_ERRORMIBNUM
|
||||
#define AGENTID NETSNMP_AGENTID
|
||||
|
||||
#define HPUX9ID NETSNMP_HPUX9ID
|
||||
#define SUNOS4ID NETSNMP_SUNOS4ID
|
||||
#define SOLARISID NETSNMP_SOLARISID
|
||||
#define OSFID NETSNMP_OSFID
|
||||
#define ULTRIXID NETSNMP_ULTRIXID
|
||||
#define HPUX10ID NETSNMP_HPUX10ID
|
||||
#define NETBSD1ID NETSNMP_NETBSD1ID
|
||||
#define FREEBSDID NETSNMP_FREEBSDID
|
||||
#define IRIXID NETSNMP_IRIXID
|
||||
#define LINUXID NETSNMP_LINUXID
|
||||
#define BSDIID NETSNMP_BSDIID
|
||||
#define OPENBSDID NETSNMP_OPENBSDID
|
||||
#define WIN32ID NETSNMP_WIN32ID
|
||||
#define HPUX11ID NETSNMP_HPUX11ID
|
||||
#define AIXID NETSNMP_AIXID
|
||||
#define MACOSXID NETSNMP_MACOSXID
|
||||
#define UNKNOWNID NETSNMP_UNKNOWNID
|
||||
|
||||
#define ENTERPRISE_OID NETSNMP_ENTERPRISE_OID
|
||||
#define ENTERPRISE_MIB NETSNMP_ENTERPRISE_MIB
|
||||
#define ENTERPRISE_DOT_MIB NETSNMP_ENTERPRISE_DOT_MIB
|
||||
#define ENTERPRISE_DOT_MIB_LENGTH NETSNMP_ENTERPRISE_DOT_MIB_LENGTH
|
||||
|
||||
#define SYSTEM_MIB NETSNMP_SYSTEM_MIB
|
||||
#define SYSTEM_DOT_MIB NETSNMP_SYSTEM_DOT_MIB
|
||||
#define SYSTEM_DOT_MIB_LENGTH NETSNMP_SYSTEM_DOT_MIB_LENGTH
|
||||
|
||||
#define NOTIFICATION_MIB NETSNMP_NOTIFICATION_MIB
|
||||
#define NOTIFICATION_DOT_MIB NETSNMP_NOTIFICATION_DOT_MIB
|
||||
#define NOTIFICATION_DOT_MIB_LENGTH NETSNMP_NOTIFICATION_DOT_MIB_LENGTH
|
||||
|
||||
#define UCDAVIS_OID NETSNMP_UCDAVIS_OID
|
||||
#define UCDAVIS_MIB NETSNMP_UCDAVIS_MIB
|
||||
#define UCDAVIS_DOT_MIB NETSNMP_UCDAVIS_DOT_MIB
|
||||
#define UCDAVIS_DOT_MIB_LENGTH NETSNMP_UCDAVIS_DOT_MIB_LENGTH
|
||||
|
||||
#define ERRORTIMELENGTH NETSNMP_ERRORTIMELENGTH
|
||||
|
||||
#ifdef NETSNMP_PROCFIXCMD
|
||||
# define PROCFIXCMD NETSNMP_PROCFIXCMD
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_EXECFIXCMD
|
||||
# define EXECFIXCMD NETSNMP_EXECFIXCMD
|
||||
#endif
|
||||
|
||||
#define EXCACHETIME NETSNMP_EXCACHETIME
|
||||
#define CACHEFILE NETSNMP_CACHEFILE
|
||||
#define MAXCACHESIZE NETSNMP_MAXCACHESIZE
|
||||
|
||||
#define DEFDISKMINIMUMSPACE NETSNMP_DEFDISKMINIMUMSPACE
|
||||
#define DEFMAXLOADAVE NETSNMP_DEFMAXLOADAVE
|
||||
#define MAXREADCOUNT NETSNMP_MAXREADCOUNT
|
||||
|
||||
#define SNMPBLOCK NETSNMP_SNMPBLOCK
|
||||
#define RESTARTSLEEP NETSNMP_RESTARTSLEEP
|
||||
|
||||
#define NUM_COMMUNITIES NETSNMP_NUM_COMMUNITIES
|
||||
|
||||
#ifdef NETSNMP_NO_ZEROLENGTH_COMMUNITY
|
||||
# define NO_ZEROLENGTH_COMMUNITY NETSNMP_NO_ZEROLENGTH_COMMUNITY
|
||||
#endif
|
||||
|
||||
#define LASTFIELD NETSNMP_LASTFIELD
|
||||
|
||||
#define CONFIGURE_OPTIONS NETSNMP_CONFIGURE_OPTIONS
|
||||
|
||||
#ifdef NETSNMP_TRANSPORT_UDP_DOMAIN
|
||||
# define SNMP_TRANSPORT_UDP_DOMAIN NETSNMP_TRANSPORT_UDP_DOMAIN
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_TRANSPORT_CALLBACK_DOMAIN
|
||||
# define SNMP_TRANSPORT_CALLBACK_DOMAIN NETSNMP_TRANSPORT_CALLBACK_DOMAIN
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_TRANSPORT_TCP_DOMAIN
|
||||
# define SNMP_TRANSPORT_TCP_DOMAIN NETSNMP_TRANSPORT_TCP_DOMAIN
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_TRANSPORT_UNIX_DOMAIN
|
||||
# define SNMP_TRANSPORT_UNIX_DOMAIN NETSNMP_TRANSPORT_UNIX_DOMAIN
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
|
||||
# define SNMP_TRANSPORT_AAL5PVC_DOMAIN NETSNMP_TRANSPORT_AAL5PVC_DOMAIN
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_TRANSPORT_IPX_DOMAIN
|
||||
# define SNMP_TRANSPORT_IPX_DOMAIN NETSNMP_TRANSPORT_IPX_DOMAIN
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
|
||||
# define SNMP_TRANSPORT_UDPIPV6_DOMAIN NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
|
||||
# define SNMP_TRANSPORT_TCPIPV6_DOMAIN NETSNMP_TRANSPORT_TCPIPV6_DOMAIN
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_TRANSPORT_TLS_DOMAIN
|
||||
# define SNMP_TRANSPORT_TLS_DOMAIN NETSNMP_TRANSPORT_TLS_DOMAIN
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_TRANSPORT_STD_DOMAIN
|
||||
# define SNMP_TRANSPORT_STD_DOMAIN NETSNMP_TRANSPORT_STD_DOMAIN
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_SECMOD_USM
|
||||
# define SNMP_SECMOD_USM NETSNMP_SECMOD_USM
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_SECMOD_KSM
|
||||
# define SNMP_SECMOD_KSM NETSNMP_SECMOD_KSM
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_SECMOD_LOCALSM
|
||||
# define SNMP_SECMOD_LOCALSM NETSNMP_SECMOD_LOCALSM
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_REENTRANT
|
||||
# define NS_REENTRANT NETSNMP_REENTRANT
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_ENABLE_IPV6
|
||||
# define INET6 NETSNMP_ENABLE_IPV6
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_ENABLE_LOCAL_SMUX
|
||||
# define LOCAL_SMUX NETSNMP_ENABLE_LOCAL_SMUX
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_AGENTX_DOM_SOCK_ONLY
|
||||
# define AGENTX_DOM_SOCK_ONLY NETSNMP_AGENTX_DOM_SOCK_ONLY
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_SNMPTRAPD_DISABLE_AGENTX
|
||||
# define SNMPTRAPD_DISABLE_AGENTX
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_USE_KERBEROS_MIT
|
||||
# define MIT_NEW_CRYPTO NETSNMP_USE_KERBEROS_MIT
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_USE_KERBEROS_HEIMDAL
|
||||
# define HEIMDAL NETSNMP_USE_KERBEROS_HEIMDAL
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_AGENTX_SOCKET
|
||||
# define AGENTX_SOCKET NETSNMP_AGENTX_SOCKET
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_DISABLE_MIB_LOADING
|
||||
# define DISABLE_MIB_LOADING NETSNMP_DISABLE_MIB_LOADING
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_DISABLE_SNMPV1
|
||||
# define DISABLE_SNMPV1 NETSNMP_DISABLE_SNMPV1
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_DISABLE_SNMPV2C
|
||||
# define DISABLE_SNMPV2C NETSNMP_DISABLE_SNMPV2C
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_DISABLE_SET_SUPPORT
|
||||
# define DISABLE_SET_SUPPORT NETSNMP_DISABLE_SET_SUPPORT
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_DISABLE_DES
|
||||
# define DISABLE_DES NETSNMP_DISABLE_DES
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_DISABLE_MD5
|
||||
# define DISABLE_MD5 NETSNMP_DISABLE_MD5
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_DONT_USE_NLIST
|
||||
# define DONT_USE_NLIST NETSNMP_DONT_USE_NLIST
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_CAN_USE_NLIST
|
||||
# define CAN_USE_NLIST NETSNMP_CAN_USE_NLIST
|
||||
#endif
|
||||
|
||||
#ifdef NETSNMP_CAN_USE_SYSCTL
|
||||
# define CAN_USE_SYSCTL NETSNMP_CAN_USE_SYSCTL
|
||||
#endif
|
||||
|
||||
#endif /* NETSNMP_NO_LEGACY_DEFINITIONS */
|
||||
|
||||
|
||||
#endif /* NET_SNMP_CONFIG_H */
|
||||
24
net-snmp/net-snmp-5.7.3/aclocal.m4
vendored
24
net-snmp/net-snmp-5.7.3/aclocal.m4
vendored
@@ -1,24 +0,0 @@
|
||||
# generated automatically by aclocal 1.11 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
m4_include([m4/ac_add_search_path.m4])
|
||||
m4_include([m4/ac_msg_cache.m4])
|
||||
m4_include([m4/ac_msg_module_dbg.m4])
|
||||
m4_include([m4/ac_prompt_user.m4])
|
||||
m4_include([m4/libtool.m4])
|
||||
m4_include([m4/ltoptions.m4])
|
||||
m4_include([m4/ltsugar.m4])
|
||||
m4_include([m4/ltversion.m4])
|
||||
m4_include([m4/lt~obsolete.m4])
|
||||
m4_include([m4/netsnmp_arg.m4])
|
||||
m4_include([m4/netsnmp_search_libs.m4])
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,345 +0,0 @@
|
||||
#
|
||||
# Makefile for snmpd
|
||||
#
|
||||
|
||||
top_builddir = ..
|
||||
mysubdir=agent
|
||||
|
||||
# use GNU vpath, if available, to only set a path for source and headers
|
||||
# VPATH will pick up objects too, which is bad if you are sharing a
|
||||
# source dir...
|
||||
@GNU_vpath@ %.h $(srcdir)
|
||||
@GNU_vpath@ %.c $(srcdir)
|
||||
# fallback to regular VPATH for non-gnu...
|
||||
@NON_GNU_VPATH@ $(srcdir)
|
||||
|
||||
#
|
||||
# what to install
|
||||
#
|
||||
SUBDIRS=helpers mibgroup
|
||||
FTSUBDIRS=mibgroup helpers
|
||||
|
||||
INSTALLSBINPROGS= @SNMPD@
|
||||
INSTALLLIBS = libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)
|
||||
INSTALLPOSTLIBS = libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION)
|
||||
|
||||
INCLUDESUBDIR=agent
|
||||
HEADERS=\
|
||||
agent_read_config.h \
|
||||
agent_registry.h \
|
||||
agent_index.h \
|
||||
agent_sysORTable.h \
|
||||
agent_trap.h \
|
||||
auto_nlist.h \
|
||||
ds_agent.h \
|
||||
snmp_agent.h \
|
||||
snmp_vars.h \
|
||||
var_struct.h \
|
||||
agent_handler.h \
|
||||
net-snmp-agent-includes.h \
|
||||
mib_modules.h \
|
||||
agent_callbacks.h \
|
||||
sysORTable.h \
|
||||
all_helpers.h \
|
||||
baby_steps.h \
|
||||
bulk_to_next.h \
|
||||
cache_handler.h \
|
||||
debug_handler.h \
|
||||
instance.h \
|
||||
mode_end_call.h \
|
||||
multiplexer.h \
|
||||
null.h \
|
||||
old_api.h \
|
||||
read_only.h \
|
||||
row_merge.h \
|
||||
scalar.h \
|
||||
scalar_group.h \
|
||||
serialize.h \
|
||||
snmp_get_statistic.h \
|
||||
stash_cache.h \
|
||||
stash_to_next.h \
|
||||
table_array.h \
|
||||
table_container.h \
|
||||
table.h \
|
||||
table_data.h \
|
||||
table_dataset.h \
|
||||
table_tdata.h \
|
||||
table_iterator.h \
|
||||
watcher.h
|
||||
|
||||
HEADERSONLY=mfd.h set_helper.h
|
||||
|
||||
INCLUDESUBDIRHEADERS=$(HEADERS) $(HEADERSONLY)
|
||||
|
||||
INSTALLBUILTSUBDIRHEADERS=../include/net-snmp/agent/mib_module_config.h \
|
||||
../include/net-snmp/agent/agent_module_config.h \
|
||||
mibgroup/mib_module_includes.h
|
||||
INSTALLBUILTSUBDIR=agent
|
||||
|
||||
INCLUDEMIBGROUPDIR=agent/mibgroup
|
||||
INCLUDEMIBGROUPDIRHEADERS=struct.h util_funcs.h util_funcs/header_generic.h \
|
||||
util_funcs/header_simple_table.h util_funcs/MIB_STATS_CACHE_TIMEOUT.h
|
||||
|
||||
OTHERINSTALL=installmibgroupheaders @EMBEDPERLINSTALL@
|
||||
OTHERUNINSTALL=@EMBEDPERLUNINSTALL@
|
||||
|
||||
# XXX: need to install these They're really UCD specific, however.
|
||||
BROKEINSTALL= \
|
||||
mibgroup/struct.h \
|
||||
mibgroup/util_funcs.h \
|
||||
mibgroup/mibincl.h \
|
||||
mibgroup/ucd-snmp/dlmod.h \
|
||||
mibgroup/utilities/execute.h \
|
||||
mibgroup/header_complex.h
|
||||
|
||||
INSTALLUCDHEADERS= \
|
||||
agent_index.h \
|
||||
agent_read_config.h \
|
||||
agent_registry.h \
|
||||
agent_sysORTable.h \
|
||||
agent_trap.h \
|
||||
auto_nlist.h \
|
||||
ds_agent.h \
|
||||
header_complex.h \
|
||||
mibincl.h \
|
||||
snmp_agent.h \
|
||||
ucd-snmp-includes.h \
|
||||
ucd-snmp-agent-includes.h \
|
||||
util_funcs.h \
|
||||
var_struct.h
|
||||
|
||||
#
|
||||
# how to build it info
|
||||
#
|
||||
USELIBS = ../snmplib/libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION)
|
||||
AGENTLIB = libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION)
|
||||
MIBLIB = libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION)
|
||||
|
||||
LAGENTLIBS = @LAGENTLIBS@
|
||||
LMIBLIBS = @LMIBLIBS@
|
||||
VAL_LIBS = @VAL_LIBS@
|
||||
PERLLDOPTS_FOR_APPS = @PERLLDOPTS_FOR_APPS@
|
||||
PERLLDOPTS_FOR_LIBS = @PERLLDOPTS_FOR_LIBS@
|
||||
LIBS = $(USELIBS) @AGENTLIBS@ $(PERLLDOPTS_FOR_APPS) $(VAL_LIBS)
|
||||
OUR_AGENT_LIBS = $(AGENTLIB) $(MIBLIB) $(LIBS) @DLLIBS@
|
||||
CPPFLAGS = $(TOP_INCLUDES) -I. $(AGENT_INCLUDES) $(MIBGROUP_INCLUDES) \
|
||||
$(SNMPLIB_INCLUDES) @CPPFLAGS@
|
||||
|
||||
|
||||
#
|
||||
# Objects
|
||||
#
|
||||
|
||||
# libnetsnmpmibs objects.
|
||||
@mibgroup_list_lo@
|
||||
@mibgroup_list_ft@
|
||||
@mibgroup_list_o@
|
||||
@agentgroup_list_lo@
|
||||
@agentgroup_list_ft@
|
||||
@agentgroup_list_o@
|
||||
FTMIBOBJS = $(mibgroup_list_ft) mib_modules.ft auto_nlist.ft
|
||||
LMIBOBJS = $(mibgroup_list_lo) mib_modules.lo auto_nlist.lo
|
||||
MIBOBJS = $(mibgroup_list_o) mib_modules.o auto_nlist.o
|
||||
|
||||
# libnetsnmpagent objects
|
||||
LIBAGENTOBJS= \
|
||||
helpers/all_helpers.o \
|
||||
helpers/baby_steps.o \
|
||||
helpers/bulk_to_next.o \
|
||||
helpers/cache_handler.o \
|
||||
helpers/debug_handler.o \
|
||||
helpers/instance.o \
|
||||
helpers/mode_end_call.o \
|
||||
helpers/multiplexer.o \
|
||||
helpers/null.o \
|
||||
helpers/old_api.o \
|
||||
helpers/read_only.o \
|
||||
helpers/row_merge.o \
|
||||
helpers/scalar.o \
|
||||
helpers/scalar_group.o \
|
||||
helpers/serialize.o \
|
||||
helpers/snmp_get_statistic.o \
|
||||
helpers/stash_cache.o \
|
||||
helpers/stash_to_next.o \
|
||||
helpers/table.o \
|
||||
helpers/table_array.o \
|
||||
helpers/table_container.o \
|
||||
helpers/table_data.o \
|
||||
helpers/table_dataset.o \
|
||||
helpers/table_iterator.o \
|
||||
helpers/table_row.o \
|
||||
helpers/table_tdata.o \
|
||||
helpers/watcher.o \
|
||||
agent_handler.o \
|
||||
agent_index.o \
|
||||
agent_read_config.o \
|
||||
agent_registry.o \
|
||||
agent_sysORTable.o \
|
||||
agent_trap.o \
|
||||
kernel.o \
|
||||
snmp_agent.o \
|
||||
snmp_vars.o \
|
||||
$(agentgroup_list_o) \
|
||||
@OTHERAGENTLIBOBJS@
|
||||
|
||||
LLIBAGENTOBJS= \
|
||||
helpers/all_helpers.lo \
|
||||
helpers/baby_steps.lo \
|
||||
helpers/bulk_to_next.lo \
|
||||
helpers/cache_handler.lo \
|
||||
helpers/debug_handler.lo \
|
||||
helpers/instance.lo \
|
||||
helpers/mode_end_call.lo \
|
||||
helpers/multiplexer.lo \
|
||||
helpers/null.lo \
|
||||
helpers/old_api.lo \
|
||||
helpers/read_only.lo \
|
||||
helpers/row_merge.lo \
|
||||
helpers/scalar.lo \
|
||||
helpers/scalar_group.lo \
|
||||
helpers/serialize.lo \
|
||||
helpers/snmp_get_statistic.lo \
|
||||
helpers/stash_cache.lo \
|
||||
helpers/stash_to_next.lo \
|
||||
helpers/table.lo \
|
||||
helpers/table_array.lo \
|
||||
helpers/table_container.lo \
|
||||
helpers/table_data.lo \
|
||||
helpers/table_dataset.lo \
|
||||
helpers/table_iterator.lo \
|
||||
helpers/table_row.lo \
|
||||
helpers/table_tdata.lo \
|
||||
helpers/watcher.lo \
|
||||
agent_handler.lo \
|
||||
agent_index.lo \
|
||||
agent_read_config.lo \
|
||||
agent_registry.lo \
|
||||
agent_sysORTable.lo \
|
||||
agent_trap.lo \
|
||||
kernel.lo \
|
||||
snmp_agent.lo \
|
||||
snmp_vars.lo \
|
||||
$(agentgroup_list_lo) \
|
||||
@OTHERAGENTLIBLOBJS@
|
||||
|
||||
LLIBAGENTFTS= \
|
||||
helpers/all_helpers.ft \
|
||||
helpers/baby_steps.ft \
|
||||
helpers/bulk_to_next.ft \
|
||||
helpers/cache_handler.ft \
|
||||
helpers/debug_handler.ft \
|
||||
helpers/instance.ft \
|
||||
helpers/mode_end_call.ft \
|
||||
helpers/multiplexer.ft \
|
||||
helpers/null.ft \
|
||||
helpers/old_api.ft \
|
||||
helpers/read_only.ft \
|
||||
helpers/row_merge.ft \
|
||||
helpers/scalar.ft \
|
||||
helpers/scalar_group.ft \
|
||||
helpers/serialize.ft \
|
||||
helpers/snmp_get_statistic.ft \
|
||||
helpers/stash_cache.ft \
|
||||
helpers/stash_to_next.ft \
|
||||
helpers/table.ft \
|
||||
helpers/table_array.ft \
|
||||
helpers/table_container.ft \
|
||||
helpers/table_data.ft \
|
||||
helpers/table_dataset.ft \
|
||||
helpers/table_iterator.ft \
|
||||
helpers/table_row.ft \
|
||||
helpers/table_tdata.ft \
|
||||
helpers/watcher.ft \
|
||||
agent_handler.ft \
|
||||
agent_index.ft \
|
||||
agent_read_config.ft \
|
||||
agent_registry.ft \
|
||||
agent_sysORTable.ft \
|
||||
agent_trap.ft \
|
||||
kernel.ft \
|
||||
snmp_agent.ft \
|
||||
snmp_vars.ft \
|
||||
$(agentgroup_list_ft) \
|
||||
@OTHERAGENTLIBLFTS@
|
||||
|
||||
# The agent objects.
|
||||
AGENTOBJS=snmpd.o @other_agentobjs@
|
||||
LAGENTOBJS=snmpd.lo @other_lagentobjs@
|
||||
FTAGENTOBJS=snmpd.ft @other_ftagentobjs@
|
||||
|
||||
#
|
||||
# Define OBJS and LOBJS for clean target (just this directory)
|
||||
#
|
||||
OBJS = $(LIBAGENTOBJS) $(AGENTOBJS) mib_modules.o auto_nlist.o
|
||||
LOBJS = $(LLIBAGENTOBJS) $(LAGENTOBJS) mib_modules.lo auto_nlist.lo
|
||||
FTOBJS = $(LLIBAGENTFTS) $(FTAGENTOBJS) mib_modules.ft auto_nlist.ft
|
||||
|
||||
FEATUREFILE = $(top_builddir)/include/net-snmp/agent/features.h
|
||||
|
||||
all: agentlib subdirs miblib $(INSTALLBINPROGS) $(INSTALLSBINPROGS)
|
||||
|
||||
#
|
||||
# build stuff targets
|
||||
#
|
||||
getkstat: getkstat.o
|
||||
$(CC) $(CFLAGS) -o $@ $? $(LIBS)
|
||||
|
||||
getkstat.o: mibgroup/kernel_sunos5.c
|
||||
$(CC) $(CFLAGS) -o $@ -D_GETKSTAT_TEST -DDODEBUG -c $?
|
||||
|
||||
getmibstat: getmibstat.o
|
||||
$(CC) $(CFLAGS) -o $@ $? $(LIBS)
|
||||
|
||||
getmibstat.o: mibgroup/kernel_sunos5.c
|
||||
$(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $?
|
||||
|
||||
snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG)
|
||||
$(LINK) $(CFLAGS) -o $@ ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS}
|
||||
|
||||
libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS)
|
||||
$(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@
|
||||
$(RANLIB) $(AGENTLIB)
|
||||
|
||||
libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION): ${LMIBOBJS} $(AGENTLIB) $(USELIBS)
|
||||
$(LIB_LD_CMD) $(MIBLIB) ${LMIBOBJS} $(AGENTLIB) $(USELIBS) @LD_NO_UNDEFINED@ $(LDFLAGS) ${LMIBLIBS} $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@
|
||||
$(RANLIB) $(MIBLIB)
|
||||
|
||||
agentlib: $(AGENTLIB)
|
||||
|
||||
miblib: $(MIBLIB)
|
||||
|
||||
libs: $(AGENTLIB) $(MIBLIB)
|
||||
|
||||
embedperlinstall:
|
||||
@$(SHELL) $(srcdir)/../mkinstalldirs $(INSTALL_PREFIX)$(snmplibdir)
|
||||
@$(INSTALL_DATA) $(srcdir)/snmp_perl.pl $(INSTALL_PREFIX)$(snmplibdir)/snmp_perl.pl
|
||||
@echo "install: installed snmp_perl.pl in $(INSTALL_PREFIX)$(snmplibdir)"
|
||||
|
||||
embedperluninstall:
|
||||
@rm -f $(INSTALL_PREFIX)$(snmplibdir)/snmp_perl.pl
|
||||
@echo "removed snmp_perl.pl from $(INSTALL_PREFIX)$(snmplibdir)"
|
||||
|
||||
installmibgroupheaders:
|
||||
@for it in $(INCLUDEMIBGROUPDIRHEADERS) ; do \
|
||||
itd=`dirname "$(INSTALL_PREFIX)$(includedir)/agent/$$it"` ; \
|
||||
if [ ! -d "$$itd" ] ; then \
|
||||
echo "creating directory $$itd" ; \
|
||||
$(SHELL) "$(top_srcdir)/mkinstalldirs" "$$itd" ; \
|
||||
fi ; \
|
||||
$(INSTALL_DATA) "$(top_srcdir)/$(INCLUDEMIBGROUPDIR)/$$it" \
|
||||
"$$itd" ; \
|
||||
echo "installing $$it in $$itd" ; \
|
||||
done
|
||||
|
||||
@module_list_deps@
|
||||
@agent_module_list_deps@
|
||||
@mib_module_list_deps@
|
||||
|
||||
mib_modules.lo: mibgroup/mib_module_inits.h
|
||||
#
|
||||
# dependency for snmplib object. it's here because the headers listed
|
||||
# are relative to the agent directory.
|
||||
|
||||
subdirs: agentlib
|
||||
# wait for agentlib before building 'subdirs' target
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,892 +0,0 @@
|
||||
/*
|
||||
* agent_index.c
|
||||
*
|
||||
* Maintain a registry of index allocations
|
||||
* (Primarily required for AgentX support,
|
||||
* but it could be more widely useable).
|
||||
*/
|
||||
|
||||
|
||||
#include <net-snmp/net-snmp-config.h>
|
||||
#include <net-snmp/net-snmp-features.h>
|
||||
#include <signal.h>
|
||||
#if HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#if HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
#if HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
||||
#include <net-snmp/agent/agent_callbacks.h>
|
||||
#include <net-snmp/agent/agent_index.h>
|
||||
|
||||
#include "snmpd.h"
|
||||
#include "mibgroup/struct.h"
|
||||
#include <net-snmp/agent/table.h>
|
||||
#include <net-snmp/agent/table_iterator.h>
|
||||
|
||||
#ifdef USING_AGENTX_SUBAGENT_MODULE
|
||||
#include "agentx/subagent.h"
|
||||
#include "agentx/client.h"
|
||||
#endif
|
||||
|
||||
netsnmp_feature_child_of(agent_index_all, libnetsnmpagent)
|
||||
|
||||
netsnmp_feature_child_of(remove_index, agent_index_all)
|
||||
|
||||
/*
|
||||
* Initial support for index allocation
|
||||
*/
|
||||
|
||||
struct snmp_index {
|
||||
netsnmp_variable_list *varbind; /* or pointer to var_list ? */
|
||||
int allocated;
|
||||
netsnmp_session *session;
|
||||
struct snmp_index *next_oid;
|
||||
struct snmp_index *prev_oid;
|
||||
struct snmp_index *next_idx;
|
||||
} *snmp_index_head = NULL;
|
||||
|
||||
extern netsnmp_session *main_session;
|
||||
|
||||
/*
|
||||
* The caller is responsible for free()ing the memory returned by
|
||||
* this function.
|
||||
*/
|
||||
|
||||
char *
|
||||
register_string_index(oid * name, size_t name_len, char *cp)
|
||||
{
|
||||
netsnmp_variable_list varbind, *res;
|
||||
|
||||
memset(&varbind, 0, sizeof(netsnmp_variable_list));
|
||||
varbind.type = ASN_OCTET_STR;
|
||||
snmp_set_var_objid(&varbind, name, name_len);
|
||||
if (cp != ANY_STRING_INDEX) {
|
||||
snmp_set_var_value(&varbind, (u_char *) cp, strlen(cp));
|
||||
res = register_index(&varbind, ALLOCATE_THIS_INDEX, main_session);
|
||||
} else {
|
||||
res = register_index(&varbind, ALLOCATE_ANY_INDEX, main_session);
|
||||
}
|
||||
|
||||
if (res == NULL) {
|
||||
return NULL;
|
||||
} else {
|
||||
char *rv = (char *)malloc(res->val_len + 1);
|
||||
if (rv) {
|
||||
memcpy(rv, res->val.string, res->val_len);
|
||||
rv[res->val_len] = 0;
|
||||
}
|
||||
free(res);
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
register_int_index(oid * name, size_t name_len, int val)
|
||||
{
|
||||
netsnmp_variable_list varbind, *res;
|
||||
|
||||
memset(&varbind, 0, sizeof(netsnmp_variable_list));
|
||||
varbind.type = ASN_INTEGER;
|
||||
snmp_set_var_objid(&varbind, name, name_len);
|
||||
varbind.val.string = varbind.buf;
|
||||
if (val != ANY_INTEGER_INDEX) {
|
||||
varbind.val_len = sizeof(long);
|
||||
*varbind.val.integer = val;
|
||||
res = register_index(&varbind, ALLOCATE_THIS_INDEX, main_session);
|
||||
} else {
|
||||
res = register_index(&varbind, ALLOCATE_ANY_INDEX, main_session);
|
||||
}
|
||||
|
||||
if (res == NULL) {
|
||||
return -1;
|
||||
} else {
|
||||
int rv = *(res->val.integer);
|
||||
free(res);
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The caller is responsible for free()ing the memory returned by
|
||||
* this function.
|
||||
*/
|
||||
|
||||
netsnmp_variable_list *
|
||||
register_oid_index(oid * name, size_t name_len,
|
||||
oid * value, size_t value_len)
|
||||
{
|
||||
netsnmp_variable_list varbind;
|
||||
|
||||
memset(&varbind, 0, sizeof(netsnmp_variable_list));
|
||||
varbind.type = ASN_OBJECT_ID;
|
||||
snmp_set_var_objid(&varbind, name, name_len);
|
||||
if (value != ANY_OID_INDEX) {
|
||||
snmp_set_var_value(&varbind, (u_char *) value,
|
||||
value_len * sizeof(oid));
|
||||
return register_index(&varbind, ALLOCATE_THIS_INDEX, main_session);
|
||||
} else {
|
||||
return register_index(&varbind, ALLOCATE_ANY_INDEX, main_session);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The caller is responsible for free()ing the memory returned by
|
||||
* this function.
|
||||
*/
|
||||
|
||||
netsnmp_variable_list *
|
||||
register_index(netsnmp_variable_list * varbind, int flags,
|
||||
netsnmp_session * ss)
|
||||
{
|
||||
netsnmp_variable_list *rv = NULL;
|
||||
struct snmp_index *new_index, *idxptr, *idxptr2;
|
||||
struct snmp_index *prev_oid_ptr, *prev_idx_ptr;
|
||||
int res, res2, i;
|
||||
|
||||
DEBUGMSGTL(("register_index", "register "));
|
||||
DEBUGMSGVAR(("register_index", varbind));
|
||||
DEBUGMSG(("register_index", "for session %8p\n", ss));
|
||||
|
||||
#if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(TESTING)
|
||||
if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_ROLE) == SUB_AGENT) {
|
||||
return (agentx_register_index(ss, varbind, flags));
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Look for the requested OID entry
|
||||
*/
|
||||
prev_oid_ptr = NULL;
|
||||
prev_idx_ptr = NULL;
|
||||
res = 1;
|
||||
res2 = 1;
|
||||
for (idxptr = snmp_index_head; idxptr != NULL;
|
||||
prev_oid_ptr = idxptr, idxptr = idxptr->next_oid) {
|
||||
if ((res = snmp_oid_compare(varbind->name, varbind->name_length,
|
||||
idxptr->varbind->name,
|
||||
idxptr->varbind->name_length)) <= 0)
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Found the OID - now look at the registered indices
|
||||
*/
|
||||
if (res == 0 && idxptr) {
|
||||
if (varbind->type != idxptr->varbind->type)
|
||||
return NULL; /* wrong type */
|
||||
|
||||
/*
|
||||
* If we've been asked for an arbitrary new value,
|
||||
* then find the end of the list.
|
||||
* If we've been asked for any arbitrary value,
|
||||
* then look for an unused entry, and use that.
|
||||
* If there aren't any, continue as for new.
|
||||
* Otherwise, locate the given value in the (sorted)
|
||||
* list of already allocated values
|
||||
*/
|
||||
if (flags & ALLOCATE_ANY_INDEX) {
|
||||
for (idxptr2 = idxptr; idxptr2 != NULL;
|
||||
prev_idx_ptr = idxptr2, idxptr2 = idxptr2->next_idx) {
|
||||
|
||||
if (flags == ALLOCATE_ANY_INDEX && !(idxptr2->allocated)) {
|
||||
if ((rv =
|
||||
snmp_clone_varbind(idxptr2->varbind)) != NULL) {
|
||||
idxptr2->session = ss;
|
||||
idxptr2->allocated = 1;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (idxptr2 = idxptr; idxptr2 != NULL;
|
||||
prev_idx_ptr = idxptr2, idxptr2 = idxptr2->next_idx) {
|
||||
switch (varbind->type) {
|
||||
case ASN_INTEGER:
|
||||
res2 =
|
||||
(*varbind->val.integer -
|
||||
*idxptr2->varbind->val.integer);
|
||||
break;
|
||||
case ASN_OCTET_STR:
|
||||
i = SNMP_MIN(varbind->val_len,
|
||||
idxptr2->varbind->val_len);
|
||||
res2 =
|
||||
memcmp(varbind->val.string,
|
||||
idxptr2->varbind->val.string, i);
|
||||
break;
|
||||
case ASN_OBJECT_ID:
|
||||
res2 =
|
||||
snmp_oid_compare(varbind->val.objid,
|
||||
varbind->val_len / sizeof(oid),
|
||||
idxptr2->varbind->val.objid,
|
||||
idxptr2->varbind->val_len /
|
||||
sizeof(oid));
|
||||
break;
|
||||
default:
|
||||
return NULL; /* wrong type */
|
||||
}
|
||||
if (res2 <= 0)
|
||||
break;
|
||||
}
|
||||
if (res2 == 0) {
|
||||
if (idxptr2->allocated) {
|
||||
/*
|
||||
* No good: the index is in use.
|
||||
*/
|
||||
return NULL;
|
||||
} else {
|
||||
/*
|
||||
* Okay, it's unallocated, we can just claim ownership
|
||||
* here.
|
||||
*/
|
||||
if ((rv =
|
||||
snmp_clone_varbind(idxptr2->varbind)) != NULL) {
|
||||
idxptr2->session = ss;
|
||||
idxptr2->allocated = 1;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* OK - we've now located where the new entry needs to
|
||||
* be fitted into the index registry tree
|
||||
* To recap:
|
||||
* 'prev_oid_ptr' points to the head of the OID index
|
||||
* list prior to this one. If this is null, then
|
||||
* it means that this is the first OID in the list.
|
||||
* 'idxptr' points either to the head of this OID list,
|
||||
* or the next OID (if this is a new OID request)
|
||||
* These can be distinguished by the value of 'res'.
|
||||
*
|
||||
* 'prev_idx_ptr' points to the index entry that sorts
|
||||
* immediately prior to the requested value (if any).
|
||||
* If an arbitrary value is required, then this will
|
||||
* point to the last allocated index.
|
||||
* If this pointer is null, then either this is a new
|
||||
* OID request, or the requested value is the first
|
||||
* in the list.
|
||||
* 'idxptr2' points to the next sorted index (if any)
|
||||
* but is not actually needed any more.
|
||||
*
|
||||
* Clear? Good!
|
||||
* I hope you've been paying attention.
|
||||
* There'll be a test later :-)
|
||||
*/
|
||||
|
||||
/*
|
||||
* We proceed by creating the new entry
|
||||
* (by copying the entry provided)
|
||||
*/
|
||||
new_index = (struct snmp_index *) calloc(1, sizeof(struct snmp_index));
|
||||
if (new_index == NULL)
|
||||
return NULL;
|
||||
|
||||
if (NULL == snmp_varlist_add_variable(&new_index->varbind,
|
||||
varbind->name,
|
||||
varbind->name_length,
|
||||
varbind->type,
|
||||
varbind->val.string,
|
||||
varbind->val_len)) {
|
||||
/*
|
||||
* if (snmp_clone_var( varbind, new_index->varbind ) != 0 )
|
||||
*/
|
||||
free(new_index);
|
||||
return NULL;
|
||||
}
|
||||
new_index->session = ss;
|
||||
new_index->allocated = 1;
|
||||
|
||||
if (varbind->type == ASN_OCTET_STR && flags == ALLOCATE_THIS_INDEX)
|
||||
new_index->varbind->val.string[new_index->varbind->val_len] = 0;
|
||||
|
||||
/*
|
||||
* If we've been given a value, then we can use that, but
|
||||
* otherwise, we need to create a new value for this entry.
|
||||
* Note that ANY_INDEX and NEW_INDEX are both covered by this
|
||||
* test (since NEW_INDEX & ANY_INDEX = ANY_INDEX, remember?)
|
||||
*/
|
||||
if (flags & ALLOCATE_ANY_INDEX) {
|
||||
if (prev_idx_ptr) {
|
||||
if (snmp_clone_var(prev_idx_ptr->varbind, new_index->varbind)
|
||||
!= 0) {
|
||||
free(new_index);
|
||||
return NULL;
|
||||
}
|
||||
} else
|
||||
new_index->varbind->val.string = new_index->varbind->buf;
|
||||
|
||||
switch (varbind->type) {
|
||||
case ASN_INTEGER:
|
||||
if (prev_idx_ptr) {
|
||||
(*new_index->varbind->val.integer)++;
|
||||
} else
|
||||
*(new_index->varbind->val.integer) = 1;
|
||||
new_index->varbind->val_len = sizeof(long);
|
||||
break;
|
||||
case ASN_OCTET_STR:
|
||||
if (prev_idx_ptr) {
|
||||
i = new_index->varbind->val_len - 1;
|
||||
while (new_index->varbind->buf[i] == 'z') {
|
||||
new_index->varbind->buf[i] = 'a';
|
||||
i--;
|
||||
if (i < 0) {
|
||||
i = new_index->varbind->val_len;
|
||||
new_index->varbind->buf[i] = 'a';
|
||||
new_index->varbind->buf[i + 1] = 0;
|
||||
}
|
||||
}
|
||||
new_index->varbind->buf[i]++;
|
||||
} else
|
||||
strcpy((char *) new_index->varbind->buf, "aaaa");
|
||||
new_index->varbind->val_len =
|
||||
strlen((char *) new_index->varbind->buf);
|
||||
break;
|
||||
case ASN_OBJECT_ID:
|
||||
if (prev_idx_ptr) {
|
||||
i = prev_idx_ptr->varbind->val_len / sizeof(oid) - 1;
|
||||
while (new_index->varbind->val.objid[i] == 255) {
|
||||
new_index->varbind->val.objid[i] = 1;
|
||||
i--;
|
||||
if (i == 0 && new_index->varbind->val.objid[0] == 2) {
|
||||
new_index->varbind->val.objid[0] = 1;
|
||||
i = new_index->varbind->val_len / sizeof(oid);
|
||||
new_index->varbind->val.objid[i] = 0;
|
||||
new_index->varbind->val_len += sizeof(oid);
|
||||
}
|
||||
}
|
||||
new_index->varbind->val.objid[i]++;
|
||||
} else {
|
||||
/*
|
||||
* If the requested OID name is small enough,
|
||||
* * append another OID (1) and use this as the
|
||||
* * default starting value for new indexes.
|
||||
*/
|
||||
if ((varbind->name_length + 1) * sizeof(oid) <= 40) {
|
||||
for (i = 0; i < (int) varbind->name_length; i++)
|
||||
new_index->varbind->val.objid[i] =
|
||||
varbind->name[i];
|
||||
new_index->varbind->val.objid[varbind->name_length] =
|
||||
1;
|
||||
new_index->varbind->val_len =
|
||||
(varbind->name_length + 1) * sizeof(oid);
|
||||
} else {
|
||||
/*
|
||||
* Otherwise use '.1.1.1.1...'
|
||||
*/
|
||||
i = 40 / sizeof(oid);
|
||||
if (i > 4)
|
||||
i = 4;
|
||||
new_index->varbind->val_len = i * (sizeof(oid));
|
||||
for (i--; i >= 0; i--)
|
||||
new_index->varbind->val.objid[i] = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
snmp_free_var(new_index->varbind);
|
||||
free(new_index);
|
||||
return NULL; /* Index type not supported */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to duplicate the new varbind for return.
|
||||
*/
|
||||
|
||||
if ((rv = snmp_clone_varbind(new_index->varbind)) == NULL) {
|
||||
snmp_free_var(new_index->varbind);
|
||||
free(new_index);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Right - we've set up the new entry.
|
||||
* All that remains is to link it into the tree.
|
||||
* There are a number of possible cases here,
|
||||
* so watch carefully.
|
||||
*/
|
||||
if (prev_idx_ptr) {
|
||||
new_index->next_idx = prev_idx_ptr->next_idx;
|
||||
new_index->next_oid = prev_idx_ptr->next_oid;
|
||||
prev_idx_ptr->next_idx = new_index;
|
||||
} else {
|
||||
if (res == 0 && idxptr) {
|
||||
new_index->next_idx = idxptr;
|
||||
new_index->next_oid = idxptr->next_oid;
|
||||
} else {
|
||||
new_index->next_idx = NULL;
|
||||
new_index->next_oid = idxptr;
|
||||
}
|
||||
|
||||
if (prev_oid_ptr) {
|
||||
while (prev_oid_ptr) {
|
||||
prev_oid_ptr->next_oid = new_index;
|
||||
prev_oid_ptr = prev_oid_ptr->next_idx;
|
||||
}
|
||||
} else
|
||||
snmp_index_head = new_index;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*
|
||||
* Release an allocated index,
|
||||
* to allow it to be used elsewhere
|
||||
*/
|
||||
netsnmp_feature_child_of(release_index,netsnmp_unused)
|
||||
#ifndef NETSNMP_FEATURE_REMOVE_RELEASE_INDEX
|
||||
int
|
||||
release_index(netsnmp_variable_list * varbind)
|
||||
{
|
||||
return (unregister_index(varbind, TRUE, NULL));
|
||||
}
|
||||
#endif /* NETSNMP_FEATURE_REMOVE_RELEASE_INDEX */
|
||||
|
||||
#ifndef NETSNMP_FEATURE_REMOVE_REMOVE_INDEX
|
||||
/*
|
||||
* Completely remove an allocated index,
|
||||
* due to errors in the registration process.
|
||||
*/
|
||||
int
|
||||
remove_index(netsnmp_variable_list * varbind, netsnmp_session * ss)
|
||||
{
|
||||
return (unregister_index(varbind, FALSE, ss));
|
||||
}
|
||||
#endif /* NETSNMP_FEATURE_REMOVE_REMOVE_INDEX */
|
||||
|
||||
void
|
||||
unregister_index_by_session(netsnmp_session * ss)
|
||||
{
|
||||
struct snmp_index *idxptr, *idxptr2;
|
||||
for (idxptr = snmp_index_head; idxptr != NULL;
|
||||
idxptr = idxptr->next_oid)
|
||||
for (idxptr2 = idxptr; idxptr2 != NULL;
|
||||
idxptr2 = idxptr2->next_idx)
|
||||
if (idxptr2->session == ss) {
|
||||
idxptr2->allocated = 0;
|
||||
idxptr2->session = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
unregister_index(netsnmp_variable_list * varbind, int remember,
|
||||
netsnmp_session * ss)
|
||||
{
|
||||
struct snmp_index *idxptr, *idxptr2;
|
||||
struct snmp_index *prev_oid_ptr, *prev_idx_ptr;
|
||||
int res, res2, i;
|
||||
|
||||
#if defined(USING_AGENTX_SUBAGENT_MODULE) && !defined(TESTING)
|
||||
if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_ROLE) == SUB_AGENT) {
|
||||
return (agentx_unregister_index(ss, varbind));
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Look for the requested OID entry
|
||||
*/
|
||||
prev_oid_ptr = NULL;
|
||||
prev_idx_ptr = NULL;
|
||||
res = 1;
|
||||
res2 = 1;
|
||||
for (idxptr = snmp_index_head; idxptr != NULL;
|
||||
prev_oid_ptr = idxptr, idxptr = idxptr->next_oid) {
|
||||
if ((res = snmp_oid_compare(varbind->name, varbind->name_length,
|
||||
idxptr->varbind->name,
|
||||
idxptr->varbind->name_length)) <= 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (res != 0)
|
||||
return INDEX_ERR_NOT_ALLOCATED;
|
||||
if (varbind->type != idxptr->varbind->type)
|
||||
return INDEX_ERR_WRONG_TYPE;
|
||||
|
||||
for (idxptr2 = idxptr; idxptr2 != NULL;
|
||||
prev_idx_ptr = idxptr2, idxptr2 = idxptr2->next_idx) {
|
||||
switch (varbind->type) {
|
||||
case ASN_INTEGER:
|
||||
res2 =
|
||||
(*varbind->val.integer -
|
||||
*idxptr2->varbind->val.integer);
|
||||
break;
|
||||
case ASN_OCTET_STR:
|
||||
i = SNMP_MIN(varbind->val_len,
|
||||
idxptr2->varbind->val_len);
|
||||
res2 =
|
||||
memcmp(varbind->val.string,
|
||||
idxptr2->varbind->val.string, i);
|
||||
break;
|
||||
case ASN_OBJECT_ID:
|
||||
res2 =
|
||||
snmp_oid_compare(varbind->val.objid,
|
||||
varbind->val_len / sizeof(oid),
|
||||
idxptr2->varbind->val.objid,
|
||||
idxptr2->varbind->val_len /
|
||||
sizeof(oid));
|
||||
break;
|
||||
default:
|
||||
return INDEX_ERR_WRONG_TYPE; /* wrong type */
|
||||
}
|
||||
if (res2 <= 0)
|
||||
break;
|
||||
}
|
||||
if (res2 != 0 || (res2 == 0 && !idxptr2->allocated)) {
|
||||
return INDEX_ERR_NOT_ALLOCATED;
|
||||
}
|
||||
if (ss != idxptr2->session)
|
||||
return INDEX_ERR_WRONG_SESSION;
|
||||
|
||||
/*
|
||||
* If this is a "normal" index unregistration,
|
||||
* mark the index entry as unused, but leave
|
||||
* it in situ. This allows differentiation
|
||||
* between ANY_INDEX and NEW_INDEX
|
||||
*/
|
||||
if (remember) {
|
||||
idxptr2->allocated = 0; /* Unused index */
|
||||
idxptr2->session = NULL;
|
||||
return SNMP_ERR_NOERROR;
|
||||
}
|
||||
/*
|
||||
* If this is a failed attempt to register a
|
||||
* number of indexes, the successful ones
|
||||
* must be removed completely.
|
||||
*/
|
||||
if (prev_idx_ptr) {
|
||||
prev_idx_ptr->next_idx = idxptr2->next_idx;
|
||||
} else if (prev_oid_ptr) {
|
||||
if (idxptr2->next_idx) /* Use p_idx_ptr as a temp variable */
|
||||
prev_idx_ptr = idxptr2->next_idx;
|
||||
else
|
||||
prev_idx_ptr = idxptr2->next_oid;
|
||||
while (prev_oid_ptr) {
|
||||
prev_oid_ptr->next_oid = prev_idx_ptr;
|
||||
prev_oid_ptr = prev_oid_ptr->next_idx;
|
||||
}
|
||||
} else {
|
||||
if (idxptr2->next_idx)
|
||||
snmp_index_head = idxptr2->next_idx;
|
||||
else
|
||||
snmp_index_head = idxptr2->next_oid;
|
||||
}
|
||||
snmp_free_var(idxptr2->varbind);
|
||||
free(idxptr2);
|
||||
return SNMP_ERR_NOERROR;
|
||||
}
|
||||
|
||||
netsnmp_feature_child_of(unregister_indexes,netsnmp_unused)
|
||||
#ifndef NETSNMP_FEATURE_REMOVE_UNREGISTER_INDEXES
|
||||
int
|
||||
unregister_string_index(oid * name, size_t name_len, char *cp)
|
||||
{
|
||||
netsnmp_variable_list varbind;
|
||||
|
||||
memset(&varbind, 0, sizeof(netsnmp_variable_list));
|
||||
varbind.type = ASN_OCTET_STR;
|
||||
snmp_set_var_objid(&varbind, name, name_len);
|
||||
snmp_set_var_value(&varbind, (u_char *) cp, strlen(cp));
|
||||
return (unregister_index(&varbind, FALSE, main_session));
|
||||
}
|
||||
|
||||
int
|
||||
unregister_int_index(oid * name, size_t name_len, int val)
|
||||
{
|
||||
netsnmp_variable_list varbind;
|
||||
|
||||
memset(&varbind, 0, sizeof(netsnmp_variable_list));
|
||||
varbind.type = ASN_INTEGER;
|
||||
snmp_set_var_objid(&varbind, name, name_len);
|
||||
varbind.val.string = varbind.buf;
|
||||
varbind.val_len = sizeof(long);
|
||||
*varbind.val.integer = val;
|
||||
return (unregister_index(&varbind, FALSE, main_session));
|
||||
}
|
||||
|
||||
int
|
||||
unregister_oid_index(oid * name, size_t name_len,
|
||||
oid * value, size_t value_len)
|
||||
{
|
||||
netsnmp_variable_list varbind;
|
||||
|
||||
memset(&varbind, 0, sizeof(netsnmp_variable_list));
|
||||
varbind.type = ASN_OBJECT_ID;
|
||||
snmp_set_var_objid(&varbind, name, name_len);
|
||||
snmp_set_var_value(&varbind, (u_char *) value,
|
||||
value_len * sizeof(oid));
|
||||
return (unregister_index(&varbind, FALSE, main_session));
|
||||
}
|
||||
#endif /* NETSNMP_FEATURE_REMOVE_UNREGISTER_INDEXES */
|
||||
|
||||
void
|
||||
dump_idx_registry(void)
|
||||
{
|
||||
struct snmp_index *idxptr, *idxptr2;
|
||||
u_char *sbuf = NULL, *ebuf = NULL;
|
||||
size_t sbuf_len = 0, sout_len = 0, ebuf_len = 0, eout_len = 0;
|
||||
|
||||
if (snmp_index_head != NULL) {
|
||||
printf("\nIndex Allocations:\n");
|
||||
}
|
||||
|
||||
for (idxptr = snmp_index_head; idxptr != NULL;
|
||||
idxptr = idxptr->next_oid) {
|
||||
sout_len = 0;
|
||||
if (sprint_realloc_objid(&sbuf, &sbuf_len, &sout_len, 1,
|
||||
idxptr->varbind->name,
|
||||
idxptr->varbind->name_length)) {
|
||||
printf("%s indexes:\n", sbuf);
|
||||
} else {
|
||||
printf("%s [TRUNCATED] indexes:\n", sbuf);
|
||||
}
|
||||
|
||||
for (idxptr2 = idxptr; idxptr2 != NULL;
|
||||
idxptr2 = idxptr2->next_idx) {
|
||||
switch (idxptr2->varbind->type) {
|
||||
case ASN_INTEGER:
|
||||
printf(" %ld for session %8p, allocated %d\n",
|
||||
*idxptr2->varbind->val.integer, idxptr2->session,
|
||||
idxptr2->allocated);
|
||||
break;
|
||||
case ASN_OCTET_STR:
|
||||
printf(" \"%s\" for session %8p, allocated %d\n",
|
||||
idxptr2->varbind->val.string, idxptr2->session,
|
||||
idxptr2->allocated);
|
||||
break;
|
||||
case ASN_OBJECT_ID:
|
||||
eout_len = 0;
|
||||
if (sprint_realloc_objid(&ebuf, &ebuf_len, &eout_len, 1,
|
||||
idxptr2->varbind->val.objid,
|
||||
idxptr2->varbind->val_len /
|
||||
sizeof(oid))) {
|
||||
printf(" %s for session %8p, allocated %d\n", ebuf,
|
||||
idxptr2->session, idxptr2->allocated);
|
||||
} else {
|
||||
printf
|
||||
(" %s [TRUNCATED] for sess %8p, allocated %d\n",
|
||||
ebuf, idxptr2->session, idxptr2->allocated);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf("unsupported type (%d/0x%02x)\n",
|
||||
idxptr2->varbind->type, idxptr2->varbind->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sbuf != NULL) {
|
||||
free(sbuf);
|
||||
}
|
||||
if (ebuf != NULL) {
|
||||
free(ebuf);
|
||||
}
|
||||
}
|
||||
|
||||
netsnmp_feature_child_of(count_indexes, netsnmp_unused)
|
||||
#ifndef NETSNMP_FEATURE_REMOVE_UNUSED
|
||||
unsigned long
|
||||
count_indexes(oid * name, size_t namelen, int include_unallocated)
|
||||
{
|
||||
struct snmp_index *i = NULL, *j = NULL;
|
||||
unsigned long n = 0;
|
||||
|
||||
for (i = snmp_index_head; i != NULL; i = i->next_oid) {
|
||||
if (netsnmp_oid_equals(name, namelen,
|
||||
i->varbind->name,
|
||||
i->varbind->name_length) == 0) {
|
||||
for (j = i; j != NULL; j = j->next_idx) {
|
||||
if (j->allocated || include_unallocated) {
|
||||
n++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
#endif /* NETSNMP_FEATURE_REMOVE_UNUSED */
|
||||
|
||||
#ifdef TESTING
|
||||
netsnmp_variable_list varbind;
|
||||
netsnmp_session main_sess, *main_session = &main_sess;
|
||||
|
||||
void
|
||||
test_string_register(int n, char *cp)
|
||||
{
|
||||
varbind->name[4] = n;
|
||||
if (register_string_index(varbind->name, varbind.name_length, cp) ==
|
||||
NULL)
|
||||
printf("allocating %s failed\n", cp);
|
||||
}
|
||||
|
||||
void
|
||||
test_int_register(int n, int val)
|
||||
{
|
||||
varbind->name[4] = n;
|
||||
if (register_int_index(varbind->name, varbind.name_length, val) == -1)
|
||||
printf("allocating %d/%d failed\n", n, val);
|
||||
}
|
||||
|
||||
void
|
||||
test_oid_register(int n, int subid)
|
||||
{
|
||||
netsnmp_variable_list *res;
|
||||
|
||||
varbind->name[4] = n;
|
||||
if (subid != -1) {
|
||||
varbind->val.objid[5] = subid;
|
||||
res = register_oid_index(varbind->name, varbind.name_length,
|
||||
varbind->val.objid,
|
||||
varbind->val_len / sizeof(oid));
|
||||
} else
|
||||
res =
|
||||
register_oid_index(varbind->name, varbind.name_length, NULL,
|
||||
0);
|
||||
|
||||
if (res == NULL)
|
||||
printf("allocating %d/%d failed\n", n, subid);
|
||||
}
|
||||
|
||||
void
|
||||
main(int argc, char argv[])
|
||||
{
|
||||
oid name[] = { 1, 2, 3, 4, 0 };
|
||||
int i;
|
||||
|
||||
memset(&varbind, 0, sizeof(netsnmp_variable_list));
|
||||
snmp_set_var_objid(&varbind, name, 5);
|
||||
varbind->type = ASN_OCTET_STR;
|
||||
/*
|
||||
* Test index structure linking:
|
||||
* a) sorted by OID
|
||||
*/
|
||||
test_string_register(20, "empty OID");
|
||||
test_string_register(10, "first OID");
|
||||
test_string_register(40, "last OID");
|
||||
test_string_register(30, "middle OID");
|
||||
|
||||
/*
|
||||
* b) sorted by index value
|
||||
*/
|
||||
test_string_register(25, "eee: empty IDX");
|
||||
test_string_register(25, "aaa: first IDX");
|
||||
test_string_register(25, "zzz: last IDX");
|
||||
test_string_register(25, "mmm: middle IDX");
|
||||
printf("This next one should fail....\n");
|
||||
test_string_register(25, "eee: empty IDX"); /* duplicate */
|
||||
printf("done\n");
|
||||
|
||||
/*
|
||||
* c) test initial index linking
|
||||
*/
|
||||
test_string_register(5, "eee: empty initial IDX");
|
||||
test_string_register(5, "aaa: replace initial IDX");
|
||||
|
||||
/*
|
||||
* Did it all work?
|
||||
*/
|
||||
dump_idx_registry();
|
||||
unregister_index_by_session(main_session);
|
||||
/*
|
||||
* Now test index allocation
|
||||
* a) integer values
|
||||
*/
|
||||
test_int_register(110, -1); /* empty */
|
||||
test_int_register(110, -1); /* append */
|
||||
test_int_register(110, 10); /* append exact */
|
||||
printf("This next one should fail....\n");
|
||||
test_int_register(110, 10); /* exact duplicate */
|
||||
printf("done\n");
|
||||
test_int_register(110, -1); /* append */
|
||||
test_int_register(110, 5); /* insert exact */
|
||||
|
||||
/*
|
||||
* b) string values
|
||||
*/
|
||||
test_string_register(120, NULL); /* empty */
|
||||
test_string_register(120, NULL); /* append */
|
||||
test_string_register(120, "aaaz");
|
||||
test_string_register(120, NULL); /* minor rollover */
|
||||
test_string_register(120, "zzzz");
|
||||
test_string_register(120, NULL); /* major rollover */
|
||||
|
||||
/*
|
||||
* c) OID values
|
||||
*/
|
||||
|
||||
test_oid_register(130, -1); /* empty */
|
||||
test_oid_register(130, -1); /* append */
|
||||
|
||||
varbind->val_len = varbind.name_length * sizeof(oid);
|
||||
memcpy(varbind->buf, varbind.name, varbind.val_len);
|
||||
varbind->val.objid = (oid *) varbind.buf;
|
||||
varbind->val_len += sizeof(oid);
|
||||
|
||||
test_oid_register(130, 255); /* append exact */
|
||||
test_oid_register(130, -1); /* minor rollover */
|
||||
test_oid_register(130, 100); /* insert exact */
|
||||
printf("This next one should fail....\n");
|
||||
test_oid_register(130, 100); /* exact duplicate */
|
||||
printf("done\n");
|
||||
|
||||
varbind->val.objid = (oid *) varbind.buf;
|
||||
for (i = 0; i < 6; i++)
|
||||
varbind->val.objid[i] = 255;
|
||||
varbind->val.objid[0] = 1;
|
||||
test_oid_register(130, 255); /* set up rollover */
|
||||
test_oid_register(130, -1); /* medium rollover */
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
varbind->val.objid[i] = 255;
|
||||
varbind->val.objid[0] = 2;
|
||||
test_oid_register(130, 255); /* set up rollover */
|
||||
test_oid_register(130, -1); /* major rollover */
|
||||
|
||||
/*
|
||||
* Did it all work?
|
||||
*/
|
||||
dump_idx_registry();
|
||||
|
||||
/*
|
||||
* Test the various "invalid" requests
|
||||
* (unsupported types, mis-matched types, etc)
|
||||
*/
|
||||
printf("The rest of these should fail....\n");
|
||||
test_oid_register(110, -1);
|
||||
test_oid_register(110, 100);
|
||||
test_oid_register(120, -1);
|
||||
test_oid_register(120, 100);
|
||||
test_string_register(110, NULL);
|
||||
test_string_register(110, "aaaa");
|
||||
test_string_register(130, NULL);
|
||||
test_string_register(130, "aaaa");
|
||||
test_int_register(120, -1);
|
||||
test_int_register(120, 1);
|
||||
test_int_register(130, -1);
|
||||
test_int_register(130, 1);
|
||||
printf("done - this dump should be the same as before\n");
|
||||
dump_idx_registry();
|
||||
}
|
||||
#endif
|
||||
@@ -1,338 +0,0 @@
|
||||
/*
|
||||
* agent_read_config.c
|
||||
*/
|
||||
|
||||
#include <net-snmp/net-snmp-config.h>
|
||||
#include <net-snmp/net-snmp-features.h>
|
||||
|
||||
#if HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#if HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#if HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
#if HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#if HAVE_NETINET_IN_SYSTM_H
|
||||
#include <netinet/in_systm.h>
|
||||
#endif
|
||||
#if HAVE_NETINET_IP_H
|
||||
#include <netinet/ip.h>
|
||||
#endif
|
||||
#ifdef NETSNMP_ENABLE_IPV6
|
||||
#if HAVE_NETINET_IP6_H
|
||||
#include <netinet/ip6.h>
|
||||
#endif
|
||||
#endif
|
||||
#if HAVE_SYS_QUEUE_H
|
||||
#include <sys/queue.h>
|
||||
#endif
|
||||
#if HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#if HAVE_SYS_SOCKETVAR_H
|
||||
#ifndef dynix
|
||||
#include <sys/socketvar.h>
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#if HAVE_SYS_STREAM_H
|
||||
# ifdef sysv5UnixWare7
|
||||
# define _KMEMUSER 1 /* <sys/stream.h> needs this for queue_t */
|
||||
# endif
|
||||
#include <sys/stream.h>
|
||||
#endif
|
||||
#if HAVE_NET_ROUTE_H
|
||||
#include <net/route.h>
|
||||
#endif
|
||||
#if HAVE_NETINET_IP_VAR_H
|
||||
#include <netinet/ip_var.h>
|
||||
#endif
|
||||
#ifdef NETSNMP_ENABLE_IPV6
|
||||
#if HAVE_NETNETSNMP_ENABLE_IPV6_IP6_VAR_H
|
||||
#include <netinet6/ip6_var.h>
|
||||
#endif
|
||||
#endif
|
||||
#if HAVE_NETINET_IN_PCB_H
|
||||
#include <netinet/in_pcb.h>
|
||||
#endif
|
||||
#if HAVE_INET_MIB2_H
|
||||
#include <inet/mib2.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
#ifdef HAVE_GRP_H
|
||||
#include <grp.h>
|
||||
#endif
|
||||
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
||||
|
||||
#include "mibgroup/struct.h"
|
||||
#include <net-snmp/agent/agent_trap.h>
|
||||
#include "snmpd.h"
|
||||
#include <net-snmp/agent/agent_callbacks.h>
|
||||
#include <net-snmp/agent/table.h>
|
||||
#include <net-snmp/agent/table_iterator.h>
|
||||
#include <net-snmp/agent/table_data.h>
|
||||
#include <net-snmp/agent/table_dataset.h>
|
||||
#include "agent_module_includes.h"
|
||||
#include "mib_module_includes.h"
|
||||
|
||||
netsnmp_feature_child_of(agent_read_config_all, libnetsnmpagent)
|
||||
|
||||
netsnmp_feature_child_of(snmpd_unregister_config_handler, agent_read_config_all)
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
void
|
||||
snmpd_set_agent_user(const char *token, char *cptr)
|
||||
{
|
||||
if (cptr[0] == '#') {
|
||||
char *ecp;
|
||||
int uid;
|
||||
|
||||
uid = strtoul(cptr + 1, &ecp, 10);
|
||||
if (*ecp != 0) {
|
||||
config_perror("Bad number");
|
||||
} else {
|
||||
netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_USERID, uid);
|
||||
}
|
||||
#if defined(HAVE_GETPWNAM) && defined(HAVE_PWD_H)
|
||||
} else {
|
||||
struct passwd *info;
|
||||
|
||||
info = getpwnam(cptr);
|
||||
if (info)
|
||||
netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_USERID, info->pw_uid);
|
||||
else
|
||||
config_perror("User not found in passwd database");
|
||||
endpwent();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
snmpd_set_agent_group(const char *token, char *cptr)
|
||||
{
|
||||
if (cptr[0] == '#') {
|
||||
char *ecp;
|
||||
int gid = strtoul(cptr + 1, &ecp, 10);
|
||||
|
||||
if (*ecp != 0) {
|
||||
config_perror("Bad number");
|
||||
} else {
|
||||
netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_GROUPID, gid);
|
||||
}
|
||||
#if defined(HAVE_GETGRNAM) && defined(HAVE_GRP_H)
|
||||
} else {
|
||||
struct group *info;
|
||||
|
||||
info = getgrnam(cptr);
|
||||
if (info)
|
||||
netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_GROUPID, info->gr_gid);
|
||||
else
|
||||
config_perror("Group not found in group database");
|
||||
endgrent();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NETSNMP_NO_LISTEN_SUPPORT
|
||||
void
|
||||
snmpd_set_agent_address(const char *token, char *cptr)
|
||||
{
|
||||
char buf[SPRINT_MAX_LEN];
|
||||
char *ptr;
|
||||
|
||||
/*
|
||||
* has something been specified before?
|
||||
*/
|
||||
ptr = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_PORTS);
|
||||
|
||||
if (ptr) {
|
||||
/*
|
||||
* append to the older specification string
|
||||
*/
|
||||
snprintf(buf, sizeof(buf), "%s,%s", ptr, cptr);
|
||||
buf[sizeof(buf) - 1] = '\0';
|
||||
} else {
|
||||
strlcpy(buf, cptr, sizeof(buf));
|
||||
}
|
||||
|
||||
DEBUGMSGTL(("snmpd_ports", "port spec: %s\n", buf));
|
||||
netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_PORTS, buf);
|
||||
}
|
||||
#endif /* NETSNMP_NO_LISTEN_SUPPORT */
|
||||
|
||||
void
|
||||
init_agent_read_config(const char *app)
|
||||
{
|
||||
if (app != NULL) {
|
||||
netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
|
||||
NETSNMP_DS_LIB_APPTYPE, app);
|
||||
} else {
|
||||
app = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
|
||||
NETSNMP_DS_LIB_APPTYPE);
|
||||
}
|
||||
|
||||
register_app_config_handler("authtrapenable",
|
||||
snmpd_parse_config_authtrap, NULL,
|
||||
"1 | 2\t\t(1 = enable, 2 = disable)");
|
||||
register_app_config_handler("pauthtrapenable",
|
||||
snmpd_parse_config_authtrap, NULL, NULL);
|
||||
|
||||
|
||||
if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_ROLE) == MASTER_AGENT) {
|
||||
#ifndef NETSNMP_DISABLE_SNMPV1
|
||||
register_app_config_handler("trapsink",
|
||||
snmpd_parse_config_trapsink,
|
||||
snmpd_free_trapsinks,
|
||||
"host [community] [port]");
|
||||
#endif
|
||||
#ifndef NETSNMP_DISABLE_SNMPV2C
|
||||
register_app_config_handler("trap2sink",
|
||||
snmpd_parse_config_trap2sink,
|
||||
snmpd_free_trapsinks,
|
||||
"host [community] [port]");
|
||||
register_app_config_handler("informsink",
|
||||
snmpd_parse_config_informsink,
|
||||
snmpd_free_trapsinks,
|
||||
"host [community] [port]");
|
||||
#endif
|
||||
register_app_config_handler("trapsess",
|
||||
snmpd_parse_config_trapsess,
|
||||
snmpd_free_trapsinks,
|
||||
"[snmpcmdargs] host");
|
||||
}
|
||||
#if !defined(NETSNMP_DISABLE_SNMPV1) || !defined(NETSNMP_DISABLE_SNMPV2C)
|
||||
register_app_config_handler("trapcommunity",
|
||||
snmpd_parse_config_trapcommunity,
|
||||
snmpd_free_trapcommunity,
|
||||
"community-string");
|
||||
#endif /* support for community based SNMP */
|
||||
netsnmp_ds_register_config(ASN_OCTET_STR, app, "v1trapaddress",
|
||||
NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_TRAP_ADDR);
|
||||
#ifdef HAVE_UNISTD_H
|
||||
register_app_config_handler("agentuser",
|
||||
snmpd_set_agent_user, NULL, "userid");
|
||||
register_app_config_handler("agentgroup",
|
||||
snmpd_set_agent_group, NULL, "groupid");
|
||||
#endif
|
||||
#ifndef NETSNMP_NO_LISTEN_SUPPORT
|
||||
register_app_config_handler("agentaddress",
|
||||
snmpd_set_agent_address, NULL,
|
||||
"SNMP bind address");
|
||||
#endif /* NETSNMP_NO_LISTEN_SUPPORT */
|
||||
netsnmp_ds_register_config(ASN_BOOLEAN, app, "quit",
|
||||
NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_QUIT_IMMEDIATELY);
|
||||
netsnmp_ds_register_config(ASN_BOOLEAN, app, "leave_pidfile",
|
||||
NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_LEAVE_PIDFILE);
|
||||
netsnmp_ds_register_config(ASN_BOOLEAN, app, "dontLogTCPWrappersConnects",
|
||||
NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS);
|
||||
netsnmp_ds_register_config(ASN_INTEGER, app, "maxGetbulkRepeats",
|
||||
NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_MAX_GETBULKREPEATS);
|
||||
netsnmp_ds_register_config(ASN_INTEGER, app, "maxGetbulkResponses",
|
||||
NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES);
|
||||
netsnmp_init_handler_conf();
|
||||
|
||||
#include "agent_module_dot_conf.h"
|
||||
#include "mib_module_dot_conf.h"
|
||||
#ifdef TESTING
|
||||
print_config_handlers();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
update_config(void)
|
||||
{
|
||||
snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
|
||||
SNMPD_CALLBACK_PRE_UPDATE_CONFIG, NULL);
|
||||
free_config();
|
||||
read_configs();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
snmpd_register_config_handler(const char *token,
|
||||
void (*parser) (const char *, char *),
|
||||
void (*releaser) (void), const char *help)
|
||||
{
|
||||
DEBUGMSGTL(("snmpd_register_app_config_handler",
|
||||
"registering .conf token for \"%s\"\n", token));
|
||||
register_app_config_handler(token, parser, releaser, help);
|
||||
}
|
||||
|
||||
void
|
||||
snmpd_register_const_config_handler(const char *token,
|
||||
void (*parser) (const char *, const char *),
|
||||
void (*releaser) (void), const char *help)
|
||||
{
|
||||
DEBUGMSGTL(("snmpd_register_app_config_handler",
|
||||
"registering .conf token for \"%s\"\n", token));
|
||||
register_app_config_handler(token, (void(*)(const char *, char *))parser,
|
||||
releaser, help);
|
||||
}
|
||||
|
||||
#ifdef NETSNMP_FEATURE_REQUIRE_SNMPD_UNREGISTER_CONFIG_HANDLER
|
||||
netsnmp_feature_require(unregister_app_config_handler)
|
||||
#endif /* NETSNMP_FEATURE_REQUIRE_SNMPD_UNREGISTER_CONFIG_HANDLER */
|
||||
|
||||
#ifndef NETSNMP_FEATURE_REMOVE_SNMPD_UNREGISTER_CONFIG_HANDLER
|
||||
void
|
||||
snmpd_unregister_config_handler(const char *token)
|
||||
{
|
||||
unregister_app_config_handler(token);
|
||||
}
|
||||
#endif /* NETSNMP_FEATURE_REMOVE_SNMPD_UNREGISTER_CONFIG_HANDLER */
|
||||
|
||||
/*
|
||||
* this function is intended for use by mib-modules to store permenant
|
||||
* configuration information generated by sets or persistent counters
|
||||
*/
|
||||
void
|
||||
snmpd_store_config(const char *line)
|
||||
{
|
||||
read_app_config_store(line);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,236 +0,0 @@
|
||||
#include <net-snmp/net-snmp-config.h>
|
||||
#if HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#if HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#include <stddef.h>
|
||||
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
||||
#include <net-snmp/agent/agent_callbacks.h>
|
||||
#include <net-snmp/agent/agent_sysORTable.h>
|
||||
#include <net-snmp/agent/sysORTable.h>
|
||||
|
||||
typedef struct data_node_s {
|
||||
struct sysORTable data;
|
||||
struct data_node_s* next;
|
||||
struct data_node_s* prev;
|
||||
}* data_node;
|
||||
|
||||
static data_node table = NULL;
|
||||
|
||||
static void
|
||||
erase(data_node entry)
|
||||
{
|
||||
entry->data.OR_uptime = netsnmp_get_agent_uptime();
|
||||
DEBUGMSGTL(("agent/sysORTable", "UNREG_SYSOR %p\n", &entry->data));
|
||||
snmp_call_callbacks(SNMP_CALLBACK_APPLICATION, SNMPD_CALLBACK_UNREG_SYSOR,
|
||||
&entry->data);
|
||||
free(entry->data.OR_oid);
|
||||
free(entry->data.OR_descr);
|
||||
if (entry->next == entry)
|
||||
table = NULL;
|
||||
else {
|
||||
entry->next->prev = entry->prev;
|
||||
entry->prev->next = entry->next;
|
||||
if (entry == table)
|
||||
table = entry->next;
|
||||
}
|
||||
free(entry);
|
||||
}
|
||||
|
||||
void
|
||||
netsnmp_sysORTable_foreach(void (*f)(const struct sysORTable*, void*), void* c)
|
||||
{
|
||||
DEBUGMSGTL(("agent/sysORTable", "foreach(%p, %p)\n", f, c));
|
||||
if(table) {
|
||||
data_node run = table;
|
||||
do {
|
||||
data_node tmp = run;
|
||||
run = run->next;
|
||||
f(&tmp->data, c);
|
||||
} while(table && run != table);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
register_sysORTable_sess(oid * oidin,
|
||||
size_t oidlen,
|
||||
const char *descr, netsnmp_session * ss)
|
||||
{
|
||||
data_node entry;
|
||||
|
||||
DEBUGMSGTL(("agent/sysORTable", "registering: "));
|
||||
DEBUGMSGOID(("agent/sysORTable", oidin, oidlen));
|
||||
DEBUGMSG(("agent/sysORTable", ", session %p\n", ss));
|
||||
|
||||
entry = (data_node)calloc(1, sizeof(struct data_node_s));
|
||||
if (entry == NULL) {
|
||||
DEBUGMSGTL(("agent/sysORTable", "Failed to allocate new entry\n"));
|
||||
return SYS_ORTABLE_REGISTRATION_FAILED;
|
||||
}
|
||||
|
||||
entry->data.OR_descr = strdup(descr);
|
||||
if (entry->data.OR_descr == NULL) {
|
||||
DEBUGMSGTL(("agent/sysORTable", "Failed to allocate new sysORDescr\n"));
|
||||
free(entry);
|
||||
return SYS_ORTABLE_REGISTRATION_FAILED;
|
||||
}
|
||||
|
||||
entry->data.OR_oid = (oid *) malloc(sizeof(oid) * oidlen);
|
||||
if (entry->data.OR_oid == NULL) {
|
||||
DEBUGMSGTL(("agent/sysORTable", "Failed to allocate new sysORID\n"));
|
||||
free(entry->data.OR_descr);
|
||||
free(entry);
|
||||
return SYS_ORTABLE_REGISTRATION_FAILED;
|
||||
}
|
||||
|
||||
memcpy(entry->data.OR_oid, oidin, sizeof(oid) * oidlen);
|
||||
entry->data.OR_oidlen = oidlen;
|
||||
entry->data.OR_sess = ss;
|
||||
|
||||
if(table) {
|
||||
entry->next = table;
|
||||
entry->prev = table->prev;
|
||||
table->prev->next = entry;
|
||||
table->prev = entry;
|
||||
} else
|
||||
table = entry->next = entry->prev = entry;
|
||||
|
||||
entry->data.OR_uptime = netsnmp_get_agent_uptime();
|
||||
|
||||
snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
|
||||
SNMPD_CALLBACK_REG_SYSOR, &entry->data);
|
||||
|
||||
return SYS_ORTABLE_REGISTERED_OK;
|
||||
}
|
||||
|
||||
int
|
||||
register_sysORTable(oid * oidin, size_t oidlen, const char *descr)
|
||||
{
|
||||
return register_sysORTable_sess(oidin, oidlen, descr, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
unregister_sysORTable_sess(oid * oidin,
|
||||
size_t oidlen, netsnmp_session * ss)
|
||||
{
|
||||
int any_unregistered = 0;
|
||||
|
||||
DEBUGMSGTL(("agent/sysORTable", "sysORTable unregistering: "));
|
||||
DEBUGMSGOID(("agent/sysORTable", oidin, oidlen));
|
||||
DEBUGMSG(("agent/sysORTable", ", session %p\n", ss));
|
||||
|
||||
if(table) {
|
||||
data_node run = table;
|
||||
do {
|
||||
data_node tmp = run;
|
||||
run = run->next;
|
||||
if (tmp->data.OR_sess == ss &&
|
||||
snmp_oid_compare(oidin, oidlen,
|
||||
tmp->data.OR_oid, tmp->data.OR_oidlen) == 0) {
|
||||
erase(tmp);
|
||||
any_unregistered = 1;
|
||||
}
|
||||
} while(table && run != table);
|
||||
}
|
||||
|
||||
if (any_unregistered) {
|
||||
DEBUGMSGTL(("agent/sysORTable", "unregistering successfull\n"));
|
||||
return SYS_ORTABLE_UNREGISTERED_OK;
|
||||
} else {
|
||||
DEBUGMSGTL(("agent/sysORTable", "unregistering failed\n"));
|
||||
return SYS_ORTABLE_NO_SUCH_REGISTRATION;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
unregister_sysORTable(oid * oidin, size_t oidlen)
|
||||
{
|
||||
return unregister_sysORTable_sess(oidin, oidlen, NULL);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
unregister_sysORTable_by_session(netsnmp_session * ss)
|
||||
{
|
||||
DEBUGMSGTL(("agent/sysORTable",
|
||||
"sysORTable unregistering session %p\n", ss));
|
||||
|
||||
if(table) {
|
||||
data_node run = table;
|
||||
do {
|
||||
data_node tmp = run;
|
||||
run = run->next;
|
||||
if (((ss->flags & SNMP_FLAGS_SUBSESSION) &&
|
||||
tmp->data.OR_sess == ss) ||
|
||||
(!(ss->flags & SNMP_FLAGS_SUBSESSION) && tmp->data.OR_sess &&
|
||||
tmp->data.OR_sess->subsession == ss))
|
||||
erase(tmp);
|
||||
} while(table && run != table);
|
||||
}
|
||||
|
||||
DEBUGMSGTL(("agent/sysORTable",
|
||||
"sysORTable unregistering session %p done\n", ss));
|
||||
}
|
||||
|
||||
static int
|
||||
register_sysOR_callback(int majorID, int minorID, void *serverarg,
|
||||
void *clientarg)
|
||||
{
|
||||
struct sysORTable *parms = (struct sysORTable *) serverarg;
|
||||
|
||||
return register_sysORTable_sess(parms->OR_oid, parms->OR_oidlen,
|
||||
parms->OR_descr, parms->OR_sess);
|
||||
}
|
||||
|
||||
static int
|
||||
unregister_sysOR_by_session_callback(int majorID, int minorID,
|
||||
void *serverarg, void *clientarg)
|
||||
{
|
||||
netsnmp_session *session = (netsnmp_session *) serverarg;
|
||||
|
||||
unregister_sysORTable_by_session(session);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
unregister_sysOR_callback(int majorID, int minorID, void *serverarg,
|
||||
void *clientarg)
|
||||
{
|
||||
struct sysORTable *parms = (struct sysORTable *) serverarg;
|
||||
|
||||
return unregister_sysORTable_sess(parms->OR_oid,
|
||||
parms->OR_oidlen,
|
||||
parms->OR_sess);
|
||||
}
|
||||
|
||||
void
|
||||
init_agent_sysORTable(void)
|
||||
{
|
||||
DEBUGMSGTL(("agent/sysORTable", "init_agent_sysORTable\n"));
|
||||
|
||||
snmp_register_callback(SNMP_CALLBACK_APPLICATION,
|
||||
SNMPD_CALLBACK_REQ_REG_SYSOR,
|
||||
register_sysOR_callback, NULL);
|
||||
snmp_register_callback(SNMP_CALLBACK_APPLICATION,
|
||||
SNMPD_CALLBACK_REQ_UNREG_SYSOR,
|
||||
unregister_sysOR_callback, NULL);
|
||||
snmp_register_callback(SNMP_CALLBACK_APPLICATION,
|
||||
SNMPD_CALLBACK_REQ_UNREG_SYSOR_SESS,
|
||||
unregister_sysOR_by_session_callback, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
shutdown_agent_sysORTable(void)
|
||||
{
|
||||
DEBUGMSGTL(("agent/sysORTable", "shutdown_sysORTable\n"));
|
||||
while(table)
|
||||
erase(table);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,271 +0,0 @@
|
||||
#include <net-snmp/net-snmp-config.h>
|
||||
|
||||
#ifdef NETSNMP_CAN_USE_NLIST
|
||||
#if HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <netinet/in.h>
|
||||
#ifdef HAVE_NLIST_H
|
||||
#include <nlist.h>
|
||||
#endif
|
||||
#if HAVE_KVM_H
|
||||
#include <kvm.h>
|
||||
#endif
|
||||
|
||||
#include <net-snmp/agent/auto_nlist.h>
|
||||
#include "autonlist.h"
|
||||
#include "kernel.h"
|
||||
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
#include <net-snmp/agent/ds_agent.h>
|
||||
|
||||
struct autonlist *nlists = 0;
|
||||
static void init_nlist(struct nlist *);
|
||||
|
||||
long
|
||||
auto_nlist_value(const char *string)
|
||||
{
|
||||
struct autonlist **ptr, *it = 0;
|
||||
int cmp;
|
||||
|
||||
if (string == 0)
|
||||
return 0;
|
||||
|
||||
ptr = &nlists;
|
||||
while (*ptr != 0 && it == 0) {
|
||||
cmp = strcmp((*ptr)->symbol, string);
|
||||
if (cmp == 0)
|
||||
it = *ptr;
|
||||
else if (cmp < 0) {
|
||||
ptr = &((*ptr)->left);
|
||||
} else {
|
||||
ptr = &((*ptr)->right);
|
||||
}
|
||||
}
|
||||
if (*ptr == 0) {
|
||||
#if !(defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7))
|
||||
static char *n_name = NULL;
|
||||
#endif
|
||||
*ptr = (struct autonlist *) malloc(sizeof(struct autonlist));
|
||||
memset(*ptr, 0, sizeof(struct autonlist));
|
||||
it = *ptr;
|
||||
it->left = 0;
|
||||
it->right = 0;
|
||||
it->symbol = (char *) malloc(strlen(string) + 1);
|
||||
strcpy(it->symbol, string);
|
||||
/*
|
||||
* allocate an extra byte for inclusion of a preceding '_' later
|
||||
*/
|
||||
it->nl[0].n_name = (char *) malloc(strlen(string) + 2);
|
||||
#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
|
||||
strcpy(it->nl[0].n_name, string);
|
||||
it->nl[0].n_name[strlen(string)+1] = '\0';
|
||||
#elif defined(freebsd9)
|
||||
sprintf(__DECONST(char*, it->nl[0].n_name), "_%s", string);
|
||||
#else
|
||||
|
||||
if (n_name != NULL)
|
||||
free(n_name);
|
||||
|
||||
n_name = malloc(strlen(string) + 2);
|
||||
if (n_name == NULL) {
|
||||
snmp_log(LOG_ERR, "nlist err: failed to allocate memory");
|
||||
return (-1);
|
||||
}
|
||||
snprintf(n_name, strlen(string) + 2, "_%s", string);
|
||||
it->nl[0].n_name = (const char*)n_name;
|
||||
#endif
|
||||
it->nl[1].n_name = 0;
|
||||
init_nlist(it->nl);
|
||||
#if !(defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7) || \
|
||||
defined(netbsd1) || defined(dragonfly))
|
||||
if (it->nl[0].n_type == 0) {
|
||||
#if defined(freebsd9)
|
||||
strcpy(__DECONST(char*, it->nl[0].n_name), string);
|
||||
__DECONST(char*, it->nl[0].n_name)[strlen(string)+1] = '\0';
|
||||
#else
|
||||
static char *n_name2 = NULL;
|
||||
|
||||
if (n_name2 != NULL)
|
||||
free(n_name2);
|
||||
|
||||
n_name2 = malloc(strlen(string) + 1);
|
||||
if (n_name2 == NULL) {
|
||||
snmp_log(LOG_ERR, "nlist err: failed to allocate memory");
|
||||
return (-1);
|
||||
}
|
||||
strcpy(n_name2, string);
|
||||
it->nl[0].n_name = (const char*)n_name2;
|
||||
#endif
|
||||
init_nlist(it->nl);
|
||||
}
|
||||
#endif
|
||||
if (it->nl[0].n_type == 0) {
|
||||
if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
|
||||
snmp_log(LOG_ERR, "nlist err: neither %s nor _%s found.\n",
|
||||
string, string);
|
||||
}
|
||||
return (-1);
|
||||
} else {
|
||||
DEBUGMSGTL(("auto_nlist:auto_nlist_value",
|
||||
"found symbol %s at %lx.\n",
|
||||
it->symbol, it->nl[0].n_value));
|
||||
return (it->nl[0].n_value);
|
||||
}
|
||||
} else
|
||||
return (it->nl[0].n_value);
|
||||
}
|
||||
|
||||
int
|
||||
auto_nlist(const char *string, char *var, size_t size)
|
||||
{
|
||||
long result;
|
||||
int ret;
|
||||
result = auto_nlist_value(string);
|
||||
if (result != -1) {
|
||||
if (var != NULL) {
|
||||
ret = klookup(result, var, size);
|
||||
if (!ret)
|
||||
snmp_log(LOG_ERR,
|
||||
"auto_nlist failed on %s at location %lx\n",
|
||||
string, result);
|
||||
return ret;
|
||||
} else
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
init_nlist(struct nlist nl[])
|
||||
{
|
||||
int ret;
|
||||
#if HAVE_KVM_OPENFILES
|
||||
kvm_t *kernel;
|
||||
char kvm_errbuf[4096];
|
||||
|
||||
if ((kernel = kvm_openfiles(KERNEL_LOC, NULL, NULL, O_RDONLY, kvm_errbuf))
|
||||
== NULL) {
|
||||
if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
|
||||
return;
|
||||
} else {
|
||||
snmp_log_perror("kvm_openfiles");
|
||||
snmp_log(LOG_ERR, "kvm_openfiles: %s\n", kvm_errbuf);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if ((ret = kvm_nlist(kernel, nl)) == -1) {
|
||||
if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
|
||||
return;
|
||||
} else {
|
||||
snmp_log_perror("kvm_nlist");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
kvm_close(kernel);
|
||||
#else /* ! HAVE_KVM_OPENFILES */
|
||||
#if (defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)) && defined(HAVE_KNLIST)
|
||||
if (knlist(nl, 1, sizeof(struct nlist)) == -1) {
|
||||
DEBUGMSGTL(("auto_nlist:init_nlist", "knlist failed on symbol: %s\n",
|
||||
nl[0].n_name));
|
||||
if (errno == EFAULT) {
|
||||
nl[0].n_type = 0;
|
||||
nl[0].n_value = 0;
|
||||
} else {
|
||||
snmp_log_perror("knlist");
|
||||
if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
|
||||
return;
|
||||
} else {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
if ((ret = nlist(KERNEL_LOC, nl)) == -1) {
|
||||
if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
|
||||
return;
|
||||
} else {
|
||||
snmp_log_perror("nlist");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
#endif /*aix4 */
|
||||
#endif /* ! HAVE_KVM_OPENFILES */
|
||||
for (ret = 0; nl[ret].n_name != NULL; ret++) {
|
||||
#if defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7)
|
||||
if (nl[ret].n_type == 0 && nl[ret].n_value != 0)
|
||||
nl[ret].n_type = 1;
|
||||
#endif
|
||||
if (nl[ret].n_type == 0) {
|
||||
if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
|
||||
NETSNMP_DS_AGENT_NO_ROOT_ACCESS)) {
|
||||
DEBUGMSGTL(("auto_nlist:init_nlist", "nlist err: %s not found\n",
|
||||
nl[ret].n_name));
|
||||
}
|
||||
} else {
|
||||
DEBUGMSGTL(("auto_nlist:init_nlist", "nlist: %s 0x%X\n", nl[ret].n_name,
|
||||
(unsigned int) nl[ret].n_value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
KNLookup(struct nlist nl[], int nl_which, char *buf, size_t s)
|
||||
{
|
||||
struct nlist *nlp = &nl[nl_which];
|
||||
|
||||
if (nlp->n_value == 0) {
|
||||
snmp_log(LOG_ERR, "Accessing non-nlisted variable: %s\n",
|
||||
nlp->n_name);
|
||||
nlp->n_value = -1; /* only one error message ... */
|
||||
return 0;
|
||||
}
|
||||
if (nlp->n_value == -1)
|
||||
return 0;
|
||||
|
||||
return klookup(nlp->n_value, buf, s);
|
||||
}
|
||||
|
||||
#ifdef TESTING
|
||||
void
|
||||
auto_nlist_print_tree(int indent, struct autonlist *ptr)
|
||||
{
|
||||
char buf[1024];
|
||||
if (indent == -2) {
|
||||
snmp_log(LOG_ERR, "nlist tree:\n");
|
||||
auto_nlist_print_tree(12, nlists);
|
||||
} else {
|
||||
if (ptr == 0)
|
||||
return;
|
||||
sprintf(buf, "%%%ds\n", indent);
|
||||
/*
|
||||
* DEBUGMSGTL(("auto_nlist", "buf: %s\n",buf));
|
||||
*/
|
||||
DEBUGMSGTL(("auto_nlist", buf, ptr->symbol));
|
||||
auto_nlist_print_tree(indent + 2, ptr->left);
|
||||
auto_nlist_print_tree(indent + 2, ptr->right);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#else /* !NETSNMP_CAN_USE_NLIST */
|
||||
#include <net-snmp/agent/auto_nlist.h>
|
||||
int
|
||||
auto_nlist_noop(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* NETSNMP_CAN_USE_NLIST */
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef AUTONLIST_H
|
||||
|
||||
struct autonlist {
|
||||
char *symbol;
|
||||
struct nlist nl[2];
|
||||
struct autonlist *left, *right;
|
||||
};
|
||||
|
||||
#define AUTONLIST_H
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,38 +0,0 @@
|
||||
#
|
||||
# Makefile for libnetsnmphelpers
|
||||
#
|
||||
|
||||
top_builddir=../..
|
||||
|
||||
# use GNU vpath, if available, to only set a path for source and headers
|
||||
# VPATH will pick up objects too, which is bad if you are sharing a
|
||||
# source dir...
|
||||
@GNU_vpath@ %.h $(srcdir)
|
||||
@GNU_vpath@ %.c $(srcdir)
|
||||
# fallback to regular VPATH for non-gnu...
|
||||
@NON_GNU_VPATH@ $(srcdir)
|
||||
|
||||
#
|
||||
# What to install
|
||||
#
|
||||
|
||||
INSTALLLIBS=libnetsnmphelpers.$(LIB_EXTENSION)$(LIB_VERSION)
|
||||
INCLUDESUBDIR=agent
|
||||
|
||||
#
|
||||
# Build info
|
||||
#
|
||||
HELPERLIB = libnetsnmphelpers.$(LIB_EXTENSION)$(LIB_VERSION)
|
||||
# -I. -I.. -I../..
|
||||
CPPFLAGS= $(TOP_INCLUDES) -I. $(AGENT_INCLUDES) $(MIBGROUP_INCLUDES) \
|
||||
$(SNMPLIB_INCLUDES) @CPPFLAGS@
|
||||
|
||||
OBJS = dummy.o
|
||||
|
||||
LOBJS = dummy.lo
|
||||
|
||||
all: standardall
|
||||
|
||||
libnetsnmphelpers.$(LIB_EXTENSION)$(LIB_VERSION): $(LOBJS)
|
||||
$(LIB_LD_CMD) $@ $(LOBJS) @LD_NO_UNDEFINED@ $(LDFLAGS) $(LIB_LD_LIBS)
|
||||
$(RANLIB) $@
|
||||
@@ -1,58 +0,0 @@
|
||||
/** @name handler
|
||||
* @{ */
|
||||
|
||||
#include <net-snmp/net-snmp-config.h>
|
||||
#include <net-snmp/net-snmp-features.h>
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
||||
|
||||
#include <net-snmp/agent/debug_handler.h>
|
||||
#include <net-snmp/agent/serialize.h>
|
||||
#include <net-snmp/agent/read_only.h>
|
||||
#include <net-snmp/agent/bulk_to_next.h>
|
||||
#include <net-snmp/agent/table_dataset.h>
|
||||
#include <net-snmp/agent/stash_cache.h>
|
||||
|
||||
netsnmp_feature_child_of(mib_helpers, libnetsnmpagent)
|
||||
|
||||
|
||||
/** call the initialization sequence for all handlers with init_ routines. */
|
||||
void
|
||||
netsnmp_init_helpers(void)
|
||||
{
|
||||
netsnmp_init_debug_helper();
|
||||
netsnmp_init_serialize();
|
||||
netsnmp_init_read_only_helper();
|
||||
netsnmp_init_bulk_to_next_helper();
|
||||
#ifndef NETSNMP_FEATURE_REMOVE_TABLE_DATASET
|
||||
netsnmp_init_table_dataset();
|
||||
#endif /* NETSNMP_FEATURE_REMOVE_TABLE_DATASET */
|
||||
|
||||
#ifndef NETSNMP_FEATURE_REMOVE_ROW_MERGE
|
||||
netsnmp_init_row_merge();
|
||||
#endif /* NETSNMP_FEATURE_REMOVE_ROW_MERGE */
|
||||
#ifndef NETSNMP_FEATURE_REMOVE_STASH_CACHE
|
||||
netsnmp_init_stash_cache_helper();
|
||||
#endif /* NETSNMP_FEATURE_REMOVE_STASH_CACHE */
|
||||
}
|
||||
|
||||
/** @defgroup utilities utility_handlers
|
||||
* Simplify request processing
|
||||
* A group of handlers intended to simplify certain aspects of processing
|
||||
* a request for a MIB object. These helpers do not implement any MIB
|
||||
* objects themselves. Rather they handle specific generic situations,
|
||||
* either returning an error, or passing a (possibly simpler) request
|
||||
* down to lower level handlers.
|
||||
* @ingroup handler
|
||||
*/
|
||||
|
||||
/** @defgroup leaf leaf_handlers
|
||||
* Process individual leaf objects
|
||||
* A group of handlers to implement individual leaf objects and instances
|
||||
* (both scalar objects, and individual objects and instances within a table).
|
||||
* These handlers will typically allow control to be passed down to a lower
|
||||
* level, user-provided handler, but this is (usually) optional.
|
||||
* @ingroup handler
|
||||
*/
|
||||
|
||||
/** @} */
|
||||
@@ -1,565 +0,0 @@
|
||||
/*
|
||||
* baby_steps.c
|
||||
* $Id$
|
||||
*/
|
||||
#include <net-snmp/net-snmp-config.h>
|
||||
#include <net-snmp/net-snmp-features.h>
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
||||
|
||||
netsnmp_feature_provide(baby_steps)
|
||||
netsnmp_feature_child_of(baby_steps, mib_helpers)
|
||||
|
||||
#ifdef NETSNMP_FEATURE_REQUIRE_BABY_STEPS
|
||||
netsnmp_feature_require(check_requests_error)
|
||||
#endif
|
||||
|
||||
#ifndef NETSNMP_FEATURE_REMOVE_BABY_STEPS
|
||||
|
||||
#include <net-snmp/agent/baby_steps.h>
|
||||
|
||||
#define BABY_STEPS_PER_MODE_MAX 4
|
||||
#define BSTEP_USE_ORIGINAL 0xffff
|
||||
|
||||
static u_short get_mode_map[BABY_STEPS_PER_MODE_MAX] = {
|
||||
MODE_BSTEP_PRE_REQUEST, MODE_BSTEP_OBJECT_LOOKUP, BSTEP_USE_ORIGINAL, MODE_BSTEP_POST_REQUEST };
|
||||
|
||||
#ifndef NETSNMP_NO_WRITE_SUPPORT
|
||||
static u_short set_mode_map[SNMP_MSG_INTERNAL_SET_MAX][BABY_STEPS_PER_MODE_MAX] = {
|
||||
/*R1*/
|
||||
{ MODE_BSTEP_PRE_REQUEST, MODE_BSTEP_OBJECT_LOOKUP, MODE_BSTEP_ROW_CREATE,
|
||||
MODE_BSTEP_CHECK_VALUE },
|
||||
/*R2*/
|
||||
{ MODE_BSTEP_UNDO_SETUP, BABY_STEP_NONE, BABY_STEP_NONE, BABY_STEP_NONE },
|
||||
/*A */
|
||||
{ MODE_BSTEP_SET_VALUE,MODE_BSTEP_CHECK_CONSISTENCY,
|
||||
MODE_BSTEP_COMMIT, BABY_STEP_NONE },
|
||||
/*C */
|
||||
{ MODE_BSTEP_IRREVERSIBLE_COMMIT, MODE_BSTEP_UNDO_CLEANUP, MODE_BSTEP_POST_REQUEST,
|
||||
BABY_STEP_NONE},
|
||||
/*F */
|
||||
{ MODE_BSTEP_UNDO_CLEANUP, MODE_BSTEP_POST_REQUEST, BABY_STEP_NONE,
|
||||
BABY_STEP_NONE },
|
||||
/*U */
|
||||
{ MODE_BSTEP_UNDO_COMMIT, MODE_BSTEP_UNDO_SET, MODE_BSTEP_UNDO_CLEANUP,
|
||||
MODE_BSTEP_POST_REQUEST}
|
||||
};
|
||||
#endif /* NETSNMP_NO_WRITE_SUPPORT */
|
||||
|
||||
static int
|
||||
_baby_steps_helper(netsnmp_mib_handler *handler,
|
||||
netsnmp_handler_registration *reginfo,
|
||||
netsnmp_agent_request_info *reqinfo,
|
||||
netsnmp_request_info *requests);
|
||||
static int
|
||||
_baby_steps_access_multiplexer(netsnmp_mib_handler *handler,
|
||||
netsnmp_handler_registration *reginfo,
|
||||
netsnmp_agent_request_info *reqinfo,
|
||||
netsnmp_request_info *requests);
|
||||
|
||||
/** @defgroup baby_steps baby_steps
|
||||
* Calls your handler in baby_steps for set processing.
|
||||
* @ingroup handler
|
||||
* @{
|
||||
*/
|
||||
|
||||
static netsnmp_baby_steps_modes *
|
||||
netsnmp_baby_steps_modes_ref(netsnmp_baby_steps_modes *md)
|
||||
{
|
||||
md->refcnt++;
|
||||
return md;
|
||||
}
|
||||
|
||||
static void
|
||||
netsnmp_baby_steps_modes_deref(netsnmp_baby_steps_modes *md)
|
||||
{
|
||||
if (--md->refcnt == 0)
|
||||
free(md);
|
||||
}
|
||||
|
||||
/** returns a baby_steps handler that can be injected into a given
|
||||
* handler chain.
|
||||
*/
|
||||
netsnmp_mib_handler *
|
||||
netsnmp_baby_steps_handler_get(u_long modes)
|
||||
{
|
||||
netsnmp_mib_handler *mh;
|
||||
netsnmp_baby_steps_modes *md;
|
||||
|
||||
mh = netsnmp_create_handler("baby_steps", _baby_steps_helper);
|
||||
if(!mh)
|
||||
return NULL;
|
||||
|
||||
md = SNMP_MALLOC_TYPEDEF(netsnmp_baby_steps_modes);
|
||||
if (NULL == md) {
|
||||
snmp_log(LOG_ERR,"malloc failed in netsnmp_baby_steps_handler_get\n");
|
||||
netsnmp_handler_free(mh);
|
||||
mh = NULL;
|
||||
}
|
||||
else {
|
||||
md->refcnt = 1;
|
||||
mh->myvoid = md;
|
||||
mh->data_clone = (void *(*)(void *))netsnmp_baby_steps_modes_ref;
|
||||
mh->data_free = (void (*)(void *))netsnmp_baby_steps_modes_deref;
|
||||
if (0 == modes)
|
||||
modes = BABY_STEP_ALL;
|
||||
md->registered = modes;
|
||||
}
|
||||
|
||||
/*
|
||||
* don't set MIB_HANDLER_AUTO_NEXT, since we need to call lower
|
||||
* handlers with a munged mode.
|
||||
*/
|
||||
|
||||
return mh;
|
||||
}
|
||||
|
||||
/** @internal Implements the baby_steps handler */
|
||||
static int
|
||||
_baby_steps_helper(netsnmp_mib_handler *handler,
|
||||
netsnmp_handler_registration *reginfo,
|
||||
netsnmp_agent_request_info *reqinfo,
|
||||
netsnmp_request_info *requests)
|
||||
{
|
||||
netsnmp_baby_steps_modes *bs_modes;
|
||||
int save_mode, i, rc = SNMP_ERR_NOERROR;
|
||||
u_short *mode_map_ptr;
|
||||
|
||||
DEBUGMSGTL(("baby_steps", "Got request, mode %s\n",
|
||||
se_find_label_in_slist("agent_mode",reqinfo->mode)));
|
||||
|
||||
bs_modes = (netsnmp_baby_steps_modes*)handler->myvoid;
|
||||
netsnmp_assert(NULL != bs_modes);
|
||||
|
||||
switch (reqinfo->mode) {
|
||||
|
||||
#ifndef NETSNMP_NO_WRITE_SUPPORT
|
||||
case MODE_SET_RESERVE1:
|
||||
/*
|
||||
* clear completed modes
|
||||
* xxx-rks: this will break for pdus with set requests to different
|
||||
* rows in the same table when the handler is set up to use the row
|
||||
* merge helper as well (or if requests are serialized).
|
||||
*/
|
||||
bs_modes->completed = 0;
|
||||
/** fall through */
|
||||
|
||||
case MODE_SET_RESERVE2:
|
||||
case MODE_SET_ACTION:
|
||||
case MODE_SET_COMMIT:
|
||||
case MODE_SET_FREE:
|
||||
case MODE_SET_UNDO:
|
||||
mode_map_ptr = set_mode_map[reqinfo->mode];
|
||||
break;
|
||||
#endif /* NETSNMP_NO_WRITE_SUPPORT */
|
||||
|
||||
default:
|
||||
/*
|
||||
* clear completed modes
|
||||
*/
|
||||
bs_modes->completed = 0;
|
||||
|
||||
mode_map_ptr = get_mode_map;
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE: if you update this chart, please update the versions in
|
||||
* local/mib2c-conf.d/parent-set.m2i
|
||||
* agent/mibgroup/helpers/baby_steps.c
|
||||
* while you're at it.
|
||||
*/
|
||||
/*
|
||||
***********************************************************************
|
||||
* Baby Steps Flow Chart (2004.06.05) *
|
||||
* *
|
||||
* +--------------+ +================+ U = unconditional path *
|
||||
* |optional state| ||required state|| S = path for success *
|
||||
* +--------------+ +================+ E = path for error *
|
||||
***********************************************************************
|
||||
*
|
||||
* +--------------+
|
||||
* | pre |
|
||||
* | request |
|
||||
* +--------------+
|
||||
* | U
|
||||
* +-------------+ +==============+
|
||||
* | row |f|<-------|| object ||
|
||||
* | create |1| E || lookup ||
|
||||
* +-------------+ +==============+
|
||||
* E | | S | S
|
||||
* | +------------------>|
|
||||
* | +==============+
|
||||
* | E || check ||
|
||||
* |<---------------|| values ||
|
||||
* | +==============+
|
||||
* | | S
|
||||
* | +==============+
|
||||
* | +<-------|| undo ||
|
||||
* | | E || setup ||
|
||||
* | | +==============+
|
||||
* | | | S
|
||||
* | | +==============+
|
||||
* | | || set ||-------------------------->+
|
||||
* | | || value || E |
|
||||
* | | +==============+ |
|
||||
* | | | S |
|
||||
* | | +--------------+ |
|
||||
* | | | check |-------------------------->|
|
||||
* | | | consistency | E |
|
||||
* | | +--------------+ |
|
||||
* | | | S |
|
||||
* | | +==============+ +==============+ |
|
||||
* | | || commit ||-------->|| undo || |
|
||||
* | | || || E || commit || |
|
||||
* | | +==============+ +==============+ |
|
||||
* | | | S U |<--------+
|
||||
* | | +--------------+ +==============+
|
||||
* | | | irreversible | || undo ||
|
||||
* | | | commit | || set ||
|
||||
* | | +--------------+ +==============+
|
||||
* | | | U U |
|
||||
* | +-------------->|<------------------------+
|
||||
* | +==============+
|
||||
* | || undo ||
|
||||
* | || cleanup ||
|
||||
* | +==============+
|
||||
* +---------------------->| U
|
||||
* |
|
||||
* (err && f1)------------------->+
|
||||
* | |
|
||||
* +--------------+ +--------------+
|
||||
* | post |<--------| row |
|
||||
* | request | U | release |
|
||||
* +--------------+ +--------------+
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* save original mode
|
||||
*/
|
||||
save_mode = reqinfo->mode;
|
||||
for(i = 0; i < BABY_STEPS_PER_MODE_MAX; ++i ) {
|
||||
/*
|
||||
* break if we run out of baby steps for this mode
|
||||
*/
|
||||
if(mode_map_ptr[i] == BABY_STEP_NONE)
|
||||
break;
|
||||
|
||||
DEBUGMSGTL(("baby_steps", " baby step mode %s\n",
|
||||
se_find_label_in_slist("babystep_mode",mode_map_ptr[i])));
|
||||
|
||||
/*
|
||||
* skip modes the handler didn't register for
|
||||
*/
|
||||
if (BSTEP_USE_ORIGINAL != mode_map_ptr[i]) {
|
||||
u_int mode_flag;
|
||||
|
||||
#ifndef NETSNMP_NO_WRITE_SUPPORT
|
||||
/*
|
||||
* skip undo commit if commit wasn't hit, and
|
||||
* undo_cleanup if undo_setup wasn't hit.
|
||||
*/
|
||||
if((MODE_SET_UNDO == save_mode) &&
|
||||
(MODE_BSTEP_UNDO_COMMIT == mode_map_ptr[i]) &&
|
||||
!(BABY_STEP_COMMIT & bs_modes->completed)) {
|
||||
DEBUGMSGTL(("baby_steps",
|
||||
" skipping commit undo (no commit)\n"));
|
||||
continue;
|
||||
}
|
||||
else if((MODE_SET_FREE == save_mode) &&
|
||||
(MODE_BSTEP_UNDO_CLEANUP == mode_map_ptr[i]) &&
|
||||
!(BABY_STEP_UNDO_SETUP & bs_modes->completed)) {
|
||||
DEBUGMSGTL(("baby_steps",
|
||||
" skipping undo cleanup (no undo setup)\n"));
|
||||
continue;
|
||||
}
|
||||
#endif /* NETSNMP_NO_WRITE_SUPPORT */
|
||||
|
||||
reqinfo->mode = mode_map_ptr[i];
|
||||
mode_flag = netsnmp_baby_step_mode2flag( mode_map_ptr[i] );
|
||||
if((mode_flag & bs_modes->registered))
|
||||
bs_modes->completed |= mode_flag;
|
||||
else {
|
||||
DEBUGMSGTL(("baby_steps",
|
||||
" skipping mode (not registered)\n"));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
reqinfo->mode = save_mode;
|
||||
}
|
||||
|
||||
#ifdef BABY_STEPS_NEXT_MODE
|
||||
/*
|
||||
* I can't remember why I wanted the next mode in the request,
|
||||
* but it's not used anywhere, so don't use this code. saved,
|
||||
* in case I remember why I thought needed it. - rstory 040911
|
||||
*/
|
||||
if((BABY_STEPS_PER_MODE_MAX - 1) == i)
|
||||
reqinfo->next_mode_ok = BABY_STEP_NONE;
|
||||
else {
|
||||
if(BSTEP_USE_ORIGINAL == mode_map_ptr[i+1])
|
||||
reqinfo->next_mode_ok = save_mode;
|
||||
else
|
||||
reqinfo->next_mode_ok = mode_map_ptr[i+1];
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* call handlers for baby step
|
||||
*/
|
||||
rc = netsnmp_call_next_handler(handler, reginfo, reqinfo,
|
||||
requests);
|
||||
|
||||
/*
|
||||
* check for error calling handler (unlikely, but...)
|
||||
*/
|
||||
if(rc) {
|
||||
DEBUGMSGTL(("baby_steps", " ERROR:handler error\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* check for errors in any of the requests for GET-like, reserve1,
|
||||
* reserve2 and action. (there is no recovery from errors
|
||||
* in commit, free or undo.)
|
||||
*/
|
||||
if (MODE_IS_GET(save_mode)
|
||||
#ifndef NETSNMP_NO_WRITE_SUPPORT
|
||||
|| (save_mode < SNMP_MSG_INTERNAL_SET_COMMIT)
|
||||
#endif /* NETSNMP_NO_WRITE_SUPPORT */
|
||||
) {
|
||||
rc = netsnmp_check_requests_error(requests);
|
||||
if(rc) {
|
||||
DEBUGMSGTL(("baby_steps", " ERROR:request error\n"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* restore original mode
|
||||
*/
|
||||
reqinfo->mode = save_mode;
|
||||
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/** initializes the baby_steps helper which then registers a baby_steps
|
||||
* handler as a run-time injectable handler for configuration file
|
||||
* use.
|
||||
*/
|
||||
netsnmp_feature_child_of(netsnmp_baby_steps_handler_init,netsnmp_unused)
|
||||
#ifndef NETSNMP_FEATURE_REMOVE_NETSNMP_BABY_STEPS_HANDLER_INIT
|
||||
void
|
||||
netsnmp_baby_steps_handler_init(void)
|
||||
{
|
||||
netsnmp_register_handler_by_name("baby_steps",
|
||||
netsnmp_baby_steps_handler_get(BABY_STEP_ALL));
|
||||
}
|
||||
#endif /* NETSNMP_FEATURE_REMOVE_NETSNMP_BABY_STEPS_HANDLER_INIT */
|
||||
|
||||
/** @} */
|
||||
|
||||
/** @defgroup access_multiplexer baby_steps_access_multiplexer: calls individual access methods based on baby_step mode.
|
||||
* @ingroup baby_steps
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** returns a baby_steps handler that can be injected into a given
|
||||
* handler chain.
|
||||
*/
|
||||
netsnmp_mib_handler *
|
||||
netsnmp_baby_steps_access_multiplexer_get(netsnmp_baby_steps_access_methods *am)
|
||||
{
|
||||
netsnmp_mib_handler *mh;
|
||||
|
||||
mh = netsnmp_create_handler("baby_steps_mux",
|
||||
_baby_steps_access_multiplexer);
|
||||
if(!mh)
|
||||
return NULL;
|
||||
|
||||
mh->myvoid = am;
|
||||
mh->flags |= MIB_HANDLER_AUTO_NEXT;
|
||||
|
||||
return mh;
|
||||
}
|
||||
|
||||
/** @internal Implements the baby_steps handler */
|
||||
static int
|
||||
_baby_steps_access_multiplexer(netsnmp_mib_handler *handler,
|
||||
netsnmp_handler_registration *reginfo,
|
||||
netsnmp_agent_request_info *reqinfo,
|
||||
netsnmp_request_info *requests)
|
||||
{
|
||||
void *temp_void;
|
||||
Netsnmp_Node_Handler *method = NULL;
|
||||
netsnmp_baby_steps_access_methods *access_methods;
|
||||
int rc = SNMP_ERR_NOERROR;
|
||||
|
||||
/** call handlers should enforce these */
|
||||
netsnmp_assert((handler!=NULL) && (reginfo!=NULL) && (reqinfo!=NULL) &&
|
||||
(requests!=NULL));
|
||||
|
||||
DEBUGMSGT(("baby_steps_mux", "mode %s\n",
|
||||
se_find_label_in_slist("babystep_mode",reqinfo->mode)));
|
||||
|
||||
access_methods = (netsnmp_baby_steps_access_methods *)handler->myvoid;
|
||||
if(!access_methods) {
|
||||
snmp_log(LOG_ERR,"baby_steps_access_multiplexer has no methods\n");
|
||||
return SNMPERR_GENERR;
|
||||
}
|
||||
|
||||
switch(reqinfo->mode) {
|
||||
|
||||
case MODE_BSTEP_PRE_REQUEST:
|
||||
if( access_methods->pre_request )
|
||||
method = access_methods->pre_request;
|
||||
break;
|
||||
|
||||
case MODE_BSTEP_OBJECT_LOOKUP:
|
||||
if( access_methods->object_lookup )
|
||||
method = access_methods->object_lookup;
|
||||
break;
|
||||
|
||||
case SNMP_MSG_GET:
|
||||
case SNMP_MSG_GETNEXT:
|
||||
if( access_methods->get_values )
|
||||
method = access_methods->get_values;
|
||||
break;
|
||||
|
||||
#ifndef NETSNMP_NO_WRITE_SUPPORT
|
||||
case MODE_BSTEP_CHECK_VALUE:
|
||||
if( access_methods->object_syntax_checks )
|
||||
method = access_methods->object_syntax_checks;
|
||||
break;
|
||||
|
||||
case MODE_BSTEP_ROW_CREATE:
|
||||
if( access_methods->row_creation )
|
||||
method = access_methods->row_creation;
|
||||
break;
|
||||
|
||||
case MODE_BSTEP_UNDO_SETUP:
|
||||
if( access_methods->undo_setup )
|
||||
method = access_methods->undo_setup;
|
||||
break;
|
||||
|
||||
case MODE_BSTEP_SET_VALUE:
|
||||
if( access_methods->set_values )
|
||||
method = access_methods->set_values;
|
||||
break;
|
||||
|
||||
case MODE_BSTEP_CHECK_CONSISTENCY:
|
||||
if( access_methods->consistency_checks )
|
||||
method = access_methods->consistency_checks;
|
||||
break;
|
||||
|
||||
case MODE_BSTEP_UNDO_SET:
|
||||
if( access_methods->undo_sets )
|
||||
method = access_methods->undo_sets;
|
||||
break;
|
||||
|
||||
case MODE_BSTEP_COMMIT:
|
||||
if( access_methods->commit )
|
||||
method = access_methods->commit;
|
||||
break;
|
||||
|
||||
case MODE_BSTEP_UNDO_COMMIT:
|
||||
if( access_methods->undo_commit )
|
||||
method = access_methods->undo_commit;
|
||||
break;
|
||||
|
||||
case MODE_BSTEP_IRREVERSIBLE_COMMIT:
|
||||
if( access_methods->irreversible_commit )
|
||||
method = access_methods->irreversible_commit;
|
||||
break;
|
||||
|
||||
case MODE_BSTEP_UNDO_CLEANUP:
|
||||
if( access_methods->undo_cleanup )
|
||||
method = access_methods->undo_cleanup;
|
||||
break;
|
||||
#endif /* NETSNMP_NO_WRITE_SUPPORT */
|
||||
|
||||
case MODE_BSTEP_POST_REQUEST:
|
||||
if( access_methods->post_request )
|
||||
method = access_methods->post_request;
|
||||
break;
|
||||
|
||||
default:
|
||||
snmp_log(LOG_ERR,"unknown mode %d\n", reqinfo->mode);
|
||||
return SNMP_ERR_GENERR;
|
||||
}
|
||||
|
||||
/*
|
||||
* if method exists, set up handler void and call method.
|
||||
*/
|
||||
if(NULL != method) {
|
||||
temp_void = handler->myvoid;
|
||||
handler->myvoid = access_methods->my_access_void;
|
||||
rc = (*method)(handler, reginfo, reqinfo, requests);
|
||||
handler->myvoid = temp_void;
|
||||
}
|
||||
else {
|
||||
rc = SNMP_ERR_GENERR;
|
||||
snmp_log(LOG_ERR,"baby steps multiplexer handler called for a mode "
|
||||
"with no handler\n");
|
||||
netsnmp_assert(NULL != method);
|
||||
}
|
||||
|
||||
/*
|
||||
* don't call any lower handlers, it will be done for us
|
||||
* since we set MIB_HANDLER_AUTO_NEXT
|
||||
*/
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
* give a baby step mode, return the flag for that mode
|
||||
*/
|
||||
int
|
||||
netsnmp_baby_step_mode2flag( u_int mode )
|
||||
{
|
||||
switch( mode ) {
|
||||
case MODE_BSTEP_OBJECT_LOOKUP:
|
||||
return BABY_STEP_OBJECT_LOOKUP;
|
||||
#ifndef NETSNMP_NO_WRITE_SUPPORT
|
||||
case MODE_BSTEP_SET_VALUE:
|
||||
return BABY_STEP_SET_VALUE;
|
||||
case MODE_BSTEP_IRREVERSIBLE_COMMIT:
|
||||
return BABY_STEP_IRREVERSIBLE_COMMIT;
|
||||
case MODE_BSTEP_CHECK_VALUE:
|
||||
return BABY_STEP_CHECK_VALUE;
|
||||
case MODE_BSTEP_PRE_REQUEST:
|
||||
return BABY_STEP_PRE_REQUEST;
|
||||
case MODE_BSTEP_POST_REQUEST:
|
||||
return BABY_STEP_POST_REQUEST;
|
||||
case MODE_BSTEP_UNDO_SETUP:
|
||||
return BABY_STEP_UNDO_SETUP;
|
||||
case MODE_BSTEP_UNDO_CLEANUP:
|
||||
return BABY_STEP_UNDO_CLEANUP;
|
||||
case MODE_BSTEP_UNDO_SET:
|
||||
return BABY_STEP_UNDO_SET;
|
||||
case MODE_BSTEP_ROW_CREATE:
|
||||
return BABY_STEP_ROW_CREATE;
|
||||
case MODE_BSTEP_CHECK_CONSISTENCY:
|
||||
return BABY_STEP_CHECK_CONSISTENCY;
|
||||
case MODE_BSTEP_COMMIT:
|
||||
return BABY_STEP_COMMIT;
|
||||
case MODE_BSTEP_UNDO_COMMIT:
|
||||
return BABY_STEP_UNDO_COMMIT;
|
||||
#endif /* NETSNMP_NO_WRITE_SUPPORT */
|
||||
default:
|
||||
netsnmp_assert("unknown flag");
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/** @} */
|
||||
|
||||
#else /* NETSNMP_FEATURE_REMOVE_BABY_STEPS */
|
||||
netsnmp_feature_unused(baby_steps);
|
||||
#endif /* NETSNMP_FEATURE_REMOVE_BABY_STEPS */
|
||||
|
||||
@@ -1,139 +0,0 @@
|
||||
#include <net-snmp/net-snmp-config.h>
|
||||
|
||||
#include <net-snmp/net-snmp-includes.h>
|
||||
#include <net-snmp/agent/net-snmp-agent-includes.h>
|
||||
|
||||
#include <net-snmp/agent/bulk_to_next.h>
|
||||
|
||||
/** @defgroup bulk_to_next bulk_to_next
|
||||
* Convert GETBULK requests into GETNEXT requests for the handler.
|
||||
* The only purpose of this handler is to convert a GETBULK request
|
||||
* to a GETNEXT request. It is inserted into handler chains where
|
||||
* the handler has not set the HANDLER_CAN_GETBULK flag.
|
||||
* @ingroup utilities
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** returns a bulk_to_next handler that can be injected into a given
|
||||
* handler chain.
|
||||
*/
|
||||
netsnmp_mib_handler *
|
||||
netsnmp_get_bulk_to_next_handler(void)
|
||||
{
|
||||
netsnmp_mib_handler *handler =
|
||||
netsnmp_create_handler("bulk_to_next",
|
||||
netsnmp_bulk_to_next_helper);
|
||||
|
||||
if (NULL != handler)
|
||||
handler->flags |= MIB_HANDLER_AUTO_NEXT;
|
||||
|
||||
return handler;
|
||||
}
|
||||
|
||||
/** takes answered requests and decrements the repeat count and
|
||||
* updates the requests to the next to-do varbind in the list */
|
||||
void
|
||||
netsnmp_bulk_to_next_fix_requests(netsnmp_request_info *requests)
|
||||
{
|
||||
netsnmp_request_info *request;
|
||||
/*
|
||||
* Make sure that:
|
||||
* - repeats remain
|
||||
* - last handler provided an answer
|
||||
* - answer didn't exceed range end (ala check_getnext_results)
|
||||
* - there is a next variable
|
||||
* then
|
||||
* update the varbinds for the next request series
|
||||
*/
|
||||
for (request = requests; request; request = request->next) {
|
||||
if (request->repeat > 0 &&
|
||||
request->requestvb->type != ASN_NULL &&
|
||||
request->requestvb->type != ASN_PRIV_RETRY &&
|
||||
(snmp_oid_compare(request->requestvb->name,
|
||||
request->requestvb->name_length,
|
||||
request->range_end,
|
||||
request->range_end_len) < 0) &&
|
||||
request->requestvb->next_variable ) {
|
||||
request->repeat--;
|
||||
snmp_set_var_objid(request->requestvb->next_variable,
|
||||
request->requestvb->name,
|
||||
request->requestvb->name_length);
|
||||
request->requestvb = request->requestvb->next_variable;
|
||||
request->requestvb->type = ASN_PRIV_RETRY;
|
||||
/*
|
||||
* if inclusive == 2, it was set in check_getnext_results for
|
||||
* the previous requestvb. Now that we've moved on, clear it.
|
||||
*/
|
||||
if (2 == request->inclusive)
|
||||
request->inclusive = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** @internal Implements the bulk_to_next handler */
|
||||
int
|
||||
netsnmp_bulk_to_next_helper(netsnmp_mib_handler *handler,
|
||||
netsnmp_handler_registration *reginfo,
|
||||
netsnmp_agent_request_info *reqinfo,
|
||||
netsnmp_request_info *requests)
|
||||
{
|
||||
|
||||
int ret = SNMP_ERR_NOERROR;
|
||||
|
||||
/*
|
||||
* this code depends on AUTO_NEXT being set
|
||||
*/
|
||||
netsnmp_assert(handler->flags & MIB_HANDLER_AUTO_NEXT);
|
||||
|
||||
/*
|
||||
* don't do anything for any modes besides GETBULK. Just return, and
|
||||
* the agent will call the next handler (AUTO_NEXT).
|
||||
*
|
||||
* for GETBULK, we munge the mode, call the next handler ourselves
|
||||
* (setting AUTO_NEXT_OVERRRIDE so the agent knows what we did),
|
||||
* restore the mode and fix up the requests.
|
||||
*/
|
||||
if(MODE_GETBULK == reqinfo->mode) {
|
||||
|
||||
DEBUGIF("bulk_to_next") {
|
||||
netsnmp_request_info *req = requests;
|
||||
while(req) {
|
||||
DEBUGMSGTL(("bulk_to_next", "Got request: "));
|
||||
DEBUGMSGOID(("bulk_to_next", req->requestvb->name,
|
||||
req->requestvb->name_length));
|
||||
DEBUGMSG(("bulk_to_next", "\n"));
|
||||
req = req->next;
|
||||
}
|
||||
}
|
||||
|
||||
reqinfo->mode = MODE_GETNEXT;
|
||||
ret =
|
||||
netsnmp_call_next_handler(handler, reginfo, reqinfo, requests);
|
||||
reqinfo->mode = MODE_GETBULK;
|
||||
|
||||
/*
|
||||
* update the varbinds for the next request series
|
||||
*/
|
||||
netsnmp_bulk_to_next_fix_requests(requests);
|
||||
|
||||
/*
|
||||
* let agent handler know that we've already called next handler
|
||||
*/
|
||||
handler->flags |= MIB_HANDLER_AUTO_NEXT_OVERRIDE_ONCE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/** initializes the bulk_to_next helper which then registers a bulk_to_next
|
||||
* handler as a run-time injectable handler for configuration file
|
||||
* use.
|
||||
*/
|
||||
void
|
||||
netsnmp_init_bulk_to_next_helper(void)
|
||||
{
|
||||
netsnmp_register_handler_by_name("bulk_to_next",
|
||||
netsnmp_get_bulk_to_next_handler());
|
||||
}
|
||||
/** @} */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user