Import from CVS master
authorJoshua Tolley <josh@endpoint.com>
Fri, 26 Nov 2010 17:22:01 +0000 (10:22 -0700)
committerJoshua Tolley <josh@endpoint.com>
Fri, 26 Nov 2010 17:22:01 +0000 (10:22 -0700)
247 files changed:
APPLICATION-MIB [new file with mode: 0644]
COPYRIGHT [new file with mode: 0644]
KNOWNBUG.txt [new file with mode: 0644]
Makefile [new file with mode: 0644]
PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable.c [new file with mode: 0644]
PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable.h [new file with mode: 0644]
PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_access.h [new file with mode: 0644]
PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_get.c [new file with mode: 0644]
PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_get.h [new file with mode: 0644]
PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_set.c [new file with mode: 0644]
PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_set.h [new file with mode: 0644]
PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_enums.h [new file with mode: 0644]
PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_interface.c [new file with mode: 0644]
PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_interface.h [new file with mode: 0644]
PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_oids.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_access.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_access.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_get.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_get.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_set.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_set.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_enums.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_interface.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_interface.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_oids.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_access.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_access.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_get.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_get.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_set.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_set.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_enums.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_interface.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_interface.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_oids.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/old/pgsqlPgAmopTable.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/old/pgsqlPgAmopTable.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/pgsqlPgAmopTable.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/pgsqlPgAmopTable.h [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/tmp/pgsqlPgAggregateTable.c [new file with mode: 0644]
PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/tmp/pgsqlPgAggregateTable.h [new file with mode: 0644]
RDBMS-MIB [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbInfoTable/README [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_access.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_access.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_get.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_get.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_enums.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_interface.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_interface.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_oids.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_access.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_access.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_get.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_get.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_set.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_set.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_enums.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_interface.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_interface.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_oids.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_access.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_access.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_get.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_get.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_set.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_set.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_enums.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_interface.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_interface.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_oids.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_access.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_access.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_get.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_get.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_set.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_set.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_enums.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_interface.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_interface.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_oids.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_access.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_access.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_get.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_get.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_set.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_set.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_enums.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_interface.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_interface.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_oids.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/README [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_access.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_access.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_get.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_get.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_set.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_set.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_enums.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_interface.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_interface.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_oids.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvLimitedResource/README [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvLimitedResource/rdbmsSrvLimitedResource.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_access.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_access.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_get.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_get.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_set.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_set.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_enums.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_interface.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_interface.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_oids.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_access.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_access.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_get.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_get.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_set.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_set.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_enums.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_interface.c [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_interface.h [new file with mode: 0644]
RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_oids.h [new file with mode: 0644]
README.pgsnmpd [new file with mode: 0644]
TODO.txt [new file with mode: 0644]
customquery.c [new file with mode: 0644]
customquery.h [new file with mode: 0644]
doc/pgsnmpd.htm [new file with mode: 0644]
doc/pgsnmpd_faq.html [new file with mode: 0644]
pg_array.c [new file with mode: 0644]
pg_array.h [new file with mode: 0644]
pgsnmpd.c [new file with mode: 0644]
pgsnmpd.conf [new file with mode: 0644]
pgsnmpd.h [new file with mode: 0644]
pgsnmpd.sql [new file with mode: 0644]
pgsnmpd.yaml [new file with mode: 0644]
pgsnmpd_regress.pl [new file with mode: 0644]
pgsqlMibWriter.pl [new file with mode: 0644]
pgsql_mib_pieces/PGSQL-MIB [new file with mode: 0644]
pgsql_mib_pieces/a_PGSQL_MIB_header.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_aggregate.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_aggregate.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_am.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_am.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_amop.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_amop.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_amproc.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_amproc.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_attrdef.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_attrdef.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_attribute.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_attribute.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_auth_members.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_auth_members.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_authid.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_authid.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_autovacuum.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_autovacuum.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_cast.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_cast.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_class.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_class.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_constraint.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_constraint.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_conversion.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_conversion.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_database.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_database.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_depend.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_depend.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_description.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_description.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_enum.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_enum.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_index.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_index.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_inherits.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_inherits.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_language.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_language.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_largeobject.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_largeobject.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_listener.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_listener.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_namespace.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_namespace.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_opclass.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_opclass.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_operator.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_operator.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_opfamily.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_opfamily.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_pltemplate.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_pltemplate.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_proc.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_proc.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_rewrite.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_rewrite.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_shdepend.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_shdepend.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_shdescription.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_shdescription.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_statistic.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_statistic.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_tablespace.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_tablespace.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_trigger.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_trigger.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_ts_config.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_ts_config.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_ts_config_map.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_ts_config_map.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_ts_dict.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_ts_dict.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_ts_parser.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_ts_parser.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_ts_template.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_ts_template.tbldef [new file with mode: 0644]
pgsql_mib_pieces/pg_type.mib [new file with mode: 0644]
pgsql_mib_pieces/pg_type.tbldef [new file with mode: 0644]
pgsql_mib_pieces/reprocess.sh [new file with mode: 0644]
pgsql_mib_pieces/z_FOOTER.mib [new file with mode: 0644]
query_reader.c [new file with mode: 0644]
query_reader.h [new file with mode: 0644]
test_pgsnmpd.sh [new file with mode: 0755]
yaml_interp.c [new file with mode: 0644]

diff --git a/APPLICATION-MIB b/APPLICATION-MIB
new file mode 100644 (file)
index 0000000..021cf41
--- /dev/null
@@ -0,0 +1,441 @@
+   APPLICATION-MIB DEFINITIONS ::= BEGIN
+
+   IMPORTS
+       OBJECT-TYPE, Counter32, Gauge32
+         FROM SNMPv2-SMI
+       mib-2
+         FROM RFC1213-MIB
+       DisplayString, TimeStamp
+         FROM SNMPv2-TC;
+
+
+   -- Textual conventions
+
+   -- DistinguishedName [5] is used to refer to objects in the
+   -- directory.
+
+   DistinguishedName ::= TEXTUAL-CONVENTION
+       STATUS current
+       DESCRIPTION
+           "A Distinguished Name represented in accordance with
+            RFC1485."
+       SYNTAX DisplayString
+
+   application MODULE-IDENTITY
+       LAST-UPDATED "9311280000Z"
+       ORGANIZATION "IETF Mail and Directory Management Working Group"
+       CONTACT-INFO
+         "        Ned Freed
+
+          Postal: Innosoft International, Inc.
+                   250 West First Street, Suite 240
+                  Claremont, CA  91711
+                  US
+
+             Tel: +1 909 624 7907
+             Fax: +1 909 621 5319
+
+          E-Mail: ned@innosoft.com"
+       DESCRIPTION
+         "The MIB module describing network service applications"
+       ::= { mib-2 27 }
+
+   -- The basic applTable contains a list of the application
+   -- entities.
+   applTable OBJECT-TYPE
+       SYNTAX SEQUENCE OF ApplEntry
+       MAX-ACCESS not-accessible
+       STATUS current
+       DESCRIPTION
+           "The table holding objects which apply to all different
+            kinds of applications providing network services."
+       ::= {application 1}
+
+   applEntry OBJECT-TYPE
+       SYNTAX ApplEntry
+       MAX-ACCESS not-accessible
+       STATUS current
+       DESCRIPTION
+         "An entry associated with a network service application."
+       INDEX {applIndex}
+       ::= {applTable 1}
+
+   ApplEntry ::= SEQUENCE {
+       applIndex
+           INTEGER,
+       applName
+           DisplayString,
+       applDirectoryName
+           DistinguishedName,
+       applVersion
+           DisplayString,
+       applUptime
+           TimeStamp,
+       applOperStatus
+           INTEGER,
+       applLastChange
+           TimeStamp,
+       applInboundAssociations
+           Gauge32,
+       applOutboundAssociations
+           Gauge32,
+       applAccumulatedInboundAssociations
+           Counter32,
+       applAccumulatedOutboundAssociations
+           Counter32,
+       applLastInboundActivity
+           TimeStamp,
+       applLastOutboundActivity
+           TimeStamp,
+       applRejectedInboundAssociations
+           Counter32,
+       applFailedOutboundAssociations
+           Counter32
+   }
+
+   applIndex OBJECT-TYPE
+       SYNTAX INTEGER (1..2147483647)
+       MAX-ACCESS not-accessible
+       STATUS current
+       DESCRIPTION
+         "An index to uniquely identify the network service
+          application."
+       ::= {applEntry 1}
+
+   applName OBJECT-TYPE
+       SYNTAX DisplayString
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The name the network service application chooses to be
+          known by."
+       ::= {applEntry 2}
+
+   applDirectoryName OBJECT-TYPE
+       SYNTAX DistinguishedName
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The Distinguished Name of the directory entry where
+          static information about this application is stored.
+          An empty string indicates that no information about
+          the application is available in the directory."
+       ::= {applEntry 3}
+
+   applVersion OBJECT-TYPE
+       SYNTAX DisplayString
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The version of network service application software."
+       ::= {applEntry 4}
+
+   applUptime OBJECT-TYPE
+       SYNTAX TimeStamp
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The value of sysUpTime at the time the network service
+          application was last initialized.  If the application was
+          last initialized prior to the last initialization of the
+          network management subsystem, then this object contains
+          a zero value."
+       ::= {applEntry 5}
+
+   applOperStatus OBJECT-TYPE
+       SYNTAX INTEGER {
+         up(1),
+         down(2),
+         halted(3),
+         congested(4),
+         restarting(5)
+       }
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "Indicates the operational status of the network service
+          application. 'down' indicates that the network service is
+          not available. 'running' indicates that the network service
+          is operational and available.  'halted' indicates that the
+          service is operational but not available.  'congested'
+          indicates that the service is operational but no additional
+          inbound associations can be accomodated.  'restarting'
+          indicates that the service is currently unavailable but is
+          in the process of restarting and will be available soon."
+       ::= {applEntry 6}
+
+   applLastChange OBJECT-TYPE
+       SYNTAX TimeStamp
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The value of sysUpTime at the time the network service
+          application entered its current operational state.  If
+          the current state was entered prior to the last
+          initialization of the local network management subsystem,
+          then this object contains a zero value."
+       ::= {applEntry 7}
+
+   applInboundAssociations OBJECT-TYPE
+       SYNTAX Gauge32
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The number of current associations to the network service
+          application, where it is the responder.  For dynamic single
+          threaded processes, this will be the number of application
+          instances."
+       ::= {applEntry 8}
+
+   applOutboundAssociations OBJECT-TYPE
+       SYNTAX Gauge32
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The number of current associations to the network service
+          application, where it is the initiator.  For dynamic single
+          threaded processes, this will be the number of application
+          instances."
+       ::= {applEntry 9}
+
+   applAccumulatedInboundAssociations OBJECT-TYPE
+       SYNTAX Counter32
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The total number of associations to the application entity
+          since application initialization, where it was the responder.
+          For  dynamic single threaded processes, this will be the
+          number of application instances."
+       ::= {applEntry 10}
+
+   applAccumulatedOutboundAssociations OBJECT-TYPE
+       SYNTAX Counter32
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The total number of associations to the application entity
+          since application initialization, where it was the initiator.
+          For dynamic single threaded processes, this will be the
+          number of application instances."
+       ::= {applEntry 11}
+
+   applLastInboundActivity OBJECT-TYPE
+       SYNTAX TimeStamp
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The value of sysUpTime at the time this application last
+          had an inbound association.  If the last association
+          occurred prior to the last initialization of the network
+          subsystem, then this object contains a zero value."
+       ::= {applEntry 12}
+
+   applLastOutboundActivity OBJECT-TYPE
+       SYNTAX TimeStamp
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The value of sysUpTime at the time this application last
+          had an outbound association.  If the last association
+          occurred prior to the last initialization of the network
+          subsystem, then this object contains a zero value."
+       ::= {applEntry 13}
+
+   applRejectedInboundAssociations OBJECT-TYPE
+       SYNTAX Counter32
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The total number of inbound associations the application
+          entity has rejected, since application initialization."
+       ::= {applEntry 14}
+
+   applFailedOutboundAssociations OBJECT-TYPE
+       SYNTAX Counter32
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The total number associations where the application entity
+          is initiator and association establishment has failed,
+          since application initialization."
+       ::= {applEntry 15}
+
+
+   -- The assocTable augments the information in the applTable
+   -- with information about associations.  Note that two levels
+   -- of compliance are specified below, depending on whether
+   -- association monitoring is mandated.
+
+   assocTable OBJECT-TYPE
+       SYNTAX SEQUENCE OF AssocEntry
+       MAX-ACCESS not-accessible
+       STATUS current
+       DESCRIPTION
+           "The table holding a set of all active application
+            associations."
+       ::= {application 2}
+
+   assocEntry OBJECT-TYPE
+       SYNTAX AssocEntry
+       MAX-ACCESS not-accessible
+       STATUS current
+       DESCRIPTION
+         "An entry associated with an association for a network
+          service application."
+       INDEX {applIndex, assocIndex}
+       ::= {assocTable 1}
+
+   AssocEntry ::= SEQUENCE {
+       assocIndex
+           INTEGER,
+       assocRemoteApplication
+           DisplayString,
+       assocApplicationProtocol
+           OBJECT IDENTIFIER,
+       assocApplicationType
+           INTEGER,
+       assocDuration
+           TimeStamp
+   }
+
+   assocIndex OBJECT-TYPE
+       SYNTAX INTEGER (1..2147483647)
+       MAX-ACCESS not-accessible
+       STATUS current
+       DESCRIPTION
+         "An index to uniquely identify each association for a network
+          service application."
+       ::= {assocEntry 1}
+
+   assocRemoteApplication OBJECT-TYPE
+       SYNTAX DisplayString
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The name of the system running remote network service
+          application.  For an IP-based application this should be
+          either a domain name or IP address.  For an OSI application
+          it should be the string encoded distinguished name of the
+          managed object.  For X.400(84) MTAs which do not have a
+          Distinguished Name, the RFC1327 [6] syntax
+          'mta in globalid' should be used."
+       ::= {assocEntry 2}
+
+   assocApplicationProtocol OBJECT-TYPE
+       SYNTAX OBJECT IDENTIFIER
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "An identification of the protocol being used for the
+          application.  For an OSI Application, this will be the
+          Application Context.  For Internet applications, the IANA
+          maintains a registry of the OIDs which correspond to
+          well-known applications.  If the application protocol is
+          not listed in the registry, an OID value of the form
+          {applTCPProtoID port} or {applUDProtoID port} are used for
+          TCP-based and UDP-based protocols, respectively. In either
+          case 'port' corresponds to the primary port number being
+          used by the protocol."
+       ::= {assocEntry 3}
+
+   assocApplicationType OBJECT-TYPE
+       SYNTAX INTEGER {
+           ua-initiator(1),
+           ua-responder(2),
+           peer-initiator(3),
+           peer-responder(4)}
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "This indicates whether the remote application is some type of
+          client making use of this network service (e.g. a User Agent)
+          or a server acting as a peer. Also indicated is whether the
+          remote end initiated an incoming connection to the network
+          service or responded to an outgoing connection made by the
+          local application."
+       ::= {assocEntry 4}
+
+   assocDuration OBJECT-TYPE
+       SYNTAX TimeStamp
+       MAX-ACCESS read-only
+       STATUS current
+       DESCRIPTION
+         "The value of sysUpTime at the time this association was
+          started.  If this association started prior to the last
+          initialization of the network subsystem, then this
+          object contains a zero value."
+       ::= {assocEntry 5}
+
+
+   -- Conformance information
+
+   applConformance OBJECT IDENTIFIER ::= {application 3}
+
+   applGroups      OBJECT IDENTIFIER ::= {applConformance 1}
+   applCompliances OBJECT IDENTIFIER ::= {applConformance 2}
+
+
+   -- Compliance statements
+
+   applCompliance MODULE-COMPLIANCE
+       STATUS current
+       DESCRIPTION
+         "The compliance statement for SNMPv2 entities
+          which implement the Network Services Monitoring MIB
+          for basic monitoring of network service applications."
+       MODULE  -- this module
+         MANDATORY-GROUPS {applGroup}
+       ::= {applCompliances 1}
+
+   assocCompliance MODULE-COMPLIANCE
+       STATUS current
+       DESCRIPTION
+         "The compliance statement for SNMPv2 entities which
+          implement the Network Services Monitoring MIB for basic
+          monitoring of network service applications and their
+          associations."
+       MODULE  -- this module
+         MANDATORY-GROUPS {applGroup, assocGroup}
+       ::= {applCompliances 2}
+
+   -- Units of conformance
+
+   applGroup OBJECT-GROUP
+       OBJECTS {
+         applName, applVersion, applUptime, applOperStatus,
+         applLastChange, applInboundAssociations,
+         applOutboundAssociations, applAccumulatedInboundAssociations,
+         applAccumulatedOutboundAssociations, applLastInboundActivity,
+         applLastOutboundActivity, applRejectedInboundAssociations,
+         applFailedOutboundAssociations}
+       STATUS current
+       DESCRIPTION
+         "A collection of objects providing basic monitoring of
+          network service applications."
+       ::= {applGroups 1}
+
+   assocGroup OBJECT-GROUP
+       OBJECTS {
+         assocRemoteApplication, assocApplicationProtocol,
+         assocApplicationType, assocDuration}
+       STATUS current
+       DESCRIPTION
+         "A collection of objects providing basic monitoring of
+          network service applications' associations."
+       ::= {applGroups 2}
+
+
+   -- OIDs of the form {applTCPProtoID port} are intended to be used
+   -- for TCP-based protocols that don't have OIDs assigned by other
+   -- means. {applUDPProtoID port} serves the same purpose for
+   -- UDP-based protocols. In either case 'port' corresponds to
+   -- the primary port number being used by the protocol. For example,
+   -- assuming no other OID is assigned for SMTP, an OID of
+   -- {applTCPProtoID 25} could be used, since SMTP is a TCP-based
+   -- protocol that uses port 25 as its primary port.
+
+   applTCPProtoID OBJECT IDENTIFIER ::= {application 4}
+   applUDPProtoID OBJECT IDENTIFIER ::= {application 5}
+
+   END
diff --git a/COPYRIGHT b/COPYRIGHT
new file mode 100644 (file)
index 0000000..e4782a3
--- /dev/null
+++ b/COPYRIGHT
@@ -0,0 +1,22 @@
+pgsnmpd - snmpd for the PostgreSQL Database Management System
+
+This is under the following license.
+
+Copyright (c) 2003-2007, PostgreSQL Global Development Group
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose, without fee, and without a written agreement
+is hereby granted, provided that the above copyright notice and this
+paragraph and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
+LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
+DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
+PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
diff --git a/KNOWNBUG.txt b/KNOWNBUG.txt
new file mode 100644 (file)
index 0000000..3152c75
--- /dev/null
@@ -0,0 +1 @@
+== Ver 1.0 Release.
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..7864b4a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,50 @@
+# $PostgreSQL: pgsql/contrib/pgsnmp/Makefile,v 1.05 2005/11/10 11:03:07 saito Exp $
+
+PROGRAM = pgsnmpd
+
+OBJS   = pgsnmpd.o \
+          RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable.o RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_access.o  RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_get.o \
+          RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_set.o  RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_interface.o \
+          RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable.o RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_access.o  \
+         RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_get.o  RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_interface.o \
+          RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable.o RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_access.o \
+         RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_get.o  RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_set.o \
+         RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_interface.o \
+          RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_interface.o \
+         RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable.o RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_access.o \
+         RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_get.o RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_set.o \
+         RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable.o RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_access.o \
+         RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_get.o RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_set.o \
+         RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_interface.o \
+         RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable.o RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_access.o \
+         RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_get.o RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_set.o \
+         RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_interface.o \
+         RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable.o RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_access.o \
+         RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_get.o RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_set.o \
+         RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_interface.o \
+         RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable.o RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_set.o \
+         RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_access.o RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_interface.o \
+         RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_get.o  \
+          customquery.o \
+          query_reader.o \
+         pg_array.o
+
+SNMPFLAGS=-I. -I./RDBMS-MIB_src $(shell net-snmp-config --cflags)
+AGENTLIBS=$(shell net-snmp-config --agent-libs)
+
+PG_CPPFLAGS = -O0 -g -I$(libpq_srcdir) $(SNMPFLAGS)
+PG_LIBS = $(libpq_pgport) $(AGENTLIBS) -lyaml
+
+DOCS = README.pgsnmpd
+
+DATA = pgsnmpd.conf pgsnmpd.sql 
+
+ifndef DONT_USE_PGXS
+PGXS := $(shell pg_config --pgxs)
+include $(PGXS)
+else
+subdir = contrib/pgsnmpd
+top_builddir = ../..
+include $(top_builddir)/src/Makefile.global
+include $(top_srcdir)/contrib/contrib-global.mk
+endif
diff --git a/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable.c b/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable.c
new file mode 100644 (file)
index 0000000..5ab5792
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.32.2.3 $ of : mfd-top.m2c,v $ 
+ *
+ * $Id: pgsnmpdConnectionsTable.c,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
+ */
+/** \mainpage MFD helper for pgsnmpdConnectionsTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsnmpdConnectionsTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "pgsnmpdConnectionsTable_interface.h"
+
+oid pgsnmpdConnectionsTable_oid[] = { PGSNMPDCONNECTIONSTABLE_OID };
+int pgsnmpdConnectionsTable_oid_size = OID_LENGTH(pgsnmpdConnectionsTable_oid);
+
+void initialize_table_pgsnmpdConnectionsTable(void);
+
+
+/**
+ * Initializes the pgsnmpdConnectionsTable module
+ */
+void
+init_pgsnmpdConnectionsTable(void)
+{
+    DEBUGMSGTL(("verbose:pgsnmpdConnectionsTable:init_pgsnmpdConnectionsTable","called\n"));
+
+    /*
+     * TODO:300:o: Perform pgsnmpdConnectionsTable one-time module initialization.
+     */
+     
+    /*
+     * here we initialize all the tables we're planning on supporting
+     */
+    if (should_init("pgsnmpdConnectionsTable"))
+        initialize_table_pgsnmpdConnectionsTable();
+
+} /* init_pgsnmpdConnectionsTable */
+
+/**
+ * Initialize the table pgsnmpdConnectionsTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+initialize_table_pgsnmpdConnectionsTable(void)
+{
+    pgsnmpdConnectionsTable_registration_ptr user_context;
+    u_long flags;
+
+    DEBUGMSGTL(("verbose:pgsnmpdConnectionsTable:initialize_table_pgsnmpdConnectionsTable","called\n"));
+
+    /*
+     * TODO:301:o: Perform pgsnmpdConnectionsTable one-time table initialization.
+     */
+
+    /*
+     * TODO:302:o: |->Initialize pgsnmpdConnectionsTable user context
+     * if you'd like to pass in a pointer to some data for this
+     * table, allocate or set it up here.
+     */
+    /*
+     * a netsnmp_data_list is a simple way to store void pointers. A simple
+     * string token is used to add, find or remove pointers.
+     */
+    user_context = netsnmp_create_data_list("pgsnmpdConnectionsTable", NULL, NULL);
+    
+    /*
+     * No support for any flags yet, but in the future you would
+     * set any flags here.
+     */
+    flags = 0;
+    
+    /*
+     * call interface initialization code
+     */
+    _pgsnmpdConnectionsTable_initialize_interface(user_context, flags);
+} /* initialize_table_pgsnmpdConnectionsTable */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_ERROR                : other error
+ */
+int
+pgsnmpdConnectionsTable_pre_request(pgsnmpdConnectionsTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:pgsnmpdConnectionsTable:pgsnmpdConnectionsTable_pre_request","called\n"));
+
+    /*
+     * TODO:510:o: Perform pgsnmpdConnectionsTable pre-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* pgsnmpdConnectionsTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : other error (ignored)
+ */
+int
+pgsnmpdConnectionsTable_post_request(pgsnmpdConnectionsTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:pgsnmpdConnectionsTable:pgsnmpdConnectionsTable_post_request","called\n"));
+
+    /*
+     * TODO:511:o: Perform pgsnmpdConnectionsTable pos-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* pgsnmpdConnectionsTable_post_request */
+
+
+/** @{ */
diff --git a/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable.h b/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable.h
new file mode 100644 (file)
index 0000000..7191830
--- /dev/null
@@ -0,0 +1,198 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.32.2.3 $ of : mfd-top.m2c,v $
+ *
+ * $Id: pgsnmpdConnectionsTable.h,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
+ */
+#ifndef PGSNMPDCONNECTIONSTABLE_H
+#define PGSNMPDCONNECTIONSTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @defgroup misc misc: Miscelaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+    /* *INDENT-OFF*  */
+config_require(PGSQL-MIB/pgsnmpdConnectionsTable/pgsnmpdConnectionsTable_interface);
+config_require(PGSQL-MIB/pgsnmpdConnectionsTable/pgsnmpdConnectionsTable_data_access);
+config_require(PGSQL-MIB/pgsnmpdConnectionsTable/pgsnmpdConnectionsTable_data_get);
+config_require(PGSQL-MIB/pgsnmpdConnectionsTable/pgsnmpdConnectionsTable_data_set);
+    /* *INDENT-ON*  */
+
+/* OID and column number definitions for  */
+#include "pgsnmpdConnectionsTable_oids.h"
+
+/* enum definions */
+#include "pgsnmpdConnectionsTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_pgsnmpdConnectionsTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsnmpdConnectionsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsnmpdConnectionsTable is subid 1 of pgsnmpdTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.1.1, length: 10
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+    /*
+     * TODO:101:o: |-> Review pgsnmpdConnectionsTable registration context.
+     */
+typedef netsnmp_data_list * pgsnmpdConnectionsTable_registration_ptr;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review pgsnmpdConnectionsTable data context structure.
+ * This structure is used to represent the data for pgsnmpdConnectionsTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * pgsnmpdConnectionsTable.
+ */
+typedef struct pgsnmpdConnectionsTable_data_s {
+    
+        /*
+         * pgsnmpdConnHost(2)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+         */
+   char   pgsnmpdConnHost[255];
+size_t      pgsnmpdConnHost_len; /* # of char elements, not bytes */
+    
+        /*
+         * pgsnmpdConnPort(3)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+         */
+   char   pgsnmpdConnPort[255];
+size_t      pgsnmpdConnPort_len; /* # of char elements, not bytes */
+    
+        /*
+         * pgsnmpdConnDbName(4)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+         */
+   char   pgsnmpdConnDbName[255];
+size_t      pgsnmpdConnDbName_len; /* # of char elements, not bytes */
+    
+} pgsnmpdConnectionsTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review pgsnmpdConnectionsTable mib index.
+ * This structure is used to represent the index for pgsnmpdConnectionsTable.
+ */
+typedef struct pgsnmpdConnectionsTable_mib_index_s {
+
+        /*
+         * pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+         */
+        /** 128 - 0(other indexes) - oid length(12) = 115 */
+   char   pgsnmpdConnID[115];
+   size_t      pgsnmpdConnID_len;
+
+
+} pgsnmpdConnectionsTable_mib_index;
+
+    /*
+     * TODO:121:r: |   |-> Review pgsnmpdConnectionsTable max index length.
+     * If you KNOW that your indexes will never exceed a certain
+     * length, update this macro to that length.
+     *
+     * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+     * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+     * Guessing 128 - col/entry(2)  - oid len(10)
+*/
+#define MAX_pgsnmpdConnectionsTable_IDX_LEN     116
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review pgsnmpdConnectionsTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * pgsnmpdConnectionsTable_rowreq_ctx pointer.
+ */
+typedef struct pgsnmpdConnectionsTable_rowreq_ctx_s {
+
+    /** this must be first for container compare to work */
+    netsnmp_index        oid_idx;
+    oid                  oid_tmp[MAX_pgsnmpdConnectionsTable_IDX_LEN];
+    
+    pgsnmpdConnectionsTable_mib_index        tbl_idx;
+    
+    pgsnmpdConnectionsTable_data              data;
+
+    /*
+     * flags per row. Currently, the first (lower) 8 bits are reserved
+     * for the user. See mfd.h for other flags.
+     */
+    u_int                       rowreq_flags;
+
+    /*
+     * implementor's context pointer (provided during registration)
+     */
+    pgsnmpdConnectionsTable_registration_ptr pgsnmpdConnectionsTable_reg;
+
+    /*
+     * TODO:131:o: |   |-> Add useful data to pgsnmpdConnectionsTable rowreq context.
+     */
+    
+    /*
+     * storage for future expansion
+     */
+    netsnmp_data_list             *pgsnmpdConnectionsTable_data_list;
+
+} pgsnmpdConnectionsTable_rowreq_ctx;
+
+typedef struct pgsnmpdConnectionsTable_ref_rowreq_ctx_s {
+    pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx;
+} pgsnmpdConnectionsTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+    int pgsnmpdConnectionsTable_pre_request(pgsnmpdConnectionsTable_registration_ptr user_context);
+    int pgsnmpdConnectionsTable_post_request(pgsnmpdConnectionsTable_registration_ptr user_context);
+
+
+extern oid pgsnmpdConnectionsTable_oid[];
+extern int pgsnmpdConnectionsTable_oid_size;
+
+
+#include "pgsnmpdConnectionsTable_interface.h"
+#include "pgsnmpdConnectionsTable_data_access.h"
+#include "pgsnmpdConnectionsTable_data_get.h"
+#include "pgsnmpdConnectionsTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSNMPDCONNECTIONSTABLE_H */
diff --git a/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_access.h b/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_access.h
new file mode 100644 (file)
index 0000000..d378541
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.12 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: pgsnmpdConnectionsTable_data_access.h,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
+ */
+#ifndef PGSNMPDCONNECTIONSTABLE_DATA_ACCESS_H
+#define PGSNMPDCONNECTIONSTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsnmpdConnectionsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsnmpdConnectionsTable is subid 1 of pgsnmpdTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.1.1, length: 10
+*/
+
+
+    int pgsnmpdConnectionsTable_init_data(pgsnmpdConnectionsTable_registration_ptr pgsnmpdConnectionsTable_reg);
+
+
+/*
+ * TODO:180:o: Review pgsnmpdConnectionsTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define PGSNMPDCONNECTIONSTABLE_CACHE_TIMEOUT   60
+
+void pgsnmpdConnectionsTable_container_init(netsnmp_container **container_ptr_ptr,
+                             netsnmp_cache *cache);
+int pgsnmpdConnectionsTable_cache_load(netsnmp_container *container);
+void pgsnmpdConnectionsTable_cache_free(netsnmp_container *container);
+
+    /*
+    ***************************************************
+    ***             START EXAMPLE CODE              ***
+    ***---------------------------------------------***/
+/* *********************************************************************
+ * Since we have no idea how you really access your data, we'll go with
+ * a worst case example: a flat text file.
diff --git a/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_get.c b/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_get.c
new file mode 100644 (file)
index 0000000..c2e7677
--- /dev/null
@@ -0,0 +1,279 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18.2.1 $ of : mfd-data-get.m2c,v $ 
+ *
+ * $Id: pgsnmpdConnectionsTable_data_get.c,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsnmpdConnectionsTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement pgsnmpdConnectionsTable get routines.
+ * TODO:240:M: Implement pgsnmpdConnectionsTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsnmpdConnectionsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsnmpdConnectionsTable is subid 1 of pgsnmpdTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.1.1, length: 10
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement pgsnmpdConnectionsTable data context functions.
+ */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsnmpdConnectionEntry.pgsnmpdConnID
+ * pgsnmpdConnID is subid 1 of pgsnmpdConnectionEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.27645.1.1.1.1.1
+ * Description:
+Identifying string for this connection. Default is host:port:database.
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE pgsnmpdConnID IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsnmpdConnID.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsnmpdConnID_map(char **mib_pgsnmpdConnID_val_ptr_ptr, size_t *mib_pgsnmpdConnID_val_ptr_len_ptr, char *raw_pgsnmpdConnID_val_ptr, size_t raw_pgsnmpdConnID_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_pgsnmpdConnID_val_ptr);
+    netsnmp_assert((NULL != mib_pgsnmpdConnID_val_ptr_ptr) && (NULL != mib_pgsnmpdConnID_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:pgsnmpdConnectionsTable:pgsnmpdConnID_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement pgsnmpdConnID non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_pgsnmpdConnID_val_ptr_len; /* assume equal */
+    if((NULL == *mib_pgsnmpdConnID_val_ptr_ptr) || (*mib_pgsnmpdConnID_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_pgsnmpdConnID_val_ptr_ptr = realloc( *mib_pgsnmpdConnID_val_ptr_ptr, converted_len * sizeof(**mib_pgsnmpdConnID_val_ptr_ptr));
+        if(NULL == *mib_pgsnmpdConnID_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_pgsnmpdConnID_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_pgsnmpdConnID_val_ptr_ptr, raw_pgsnmpdConnID_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* pgsnmpdConnID_map */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This convenience function is useful for setting all the MIB index
+ *  components with a single function call. It is assume that the C values
+ *  have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+pgsnmpdConnectionsTable_indexes_set_tbl_idx(pgsnmpdConnectionsTable_mib_index *tbl_idx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len)
+{
+    DEBUGMSGTL(("verbose:pgsnmpdConnectionsTable:pgsnmpdConnectionsTable_indexes_set_tbl_idx","called\n"));
+
+    /* pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+     tbl_idx->pgsnmpdConnID_len = sizeof(tbl_idx->pgsnmpdConnID);
+    /*
+     * make sure there is enough space for pgsnmpdConnID data
+     */
+    if ((NULL == tbl_idx->pgsnmpdConnID) ||
+        (tbl_idx->pgsnmpdConnID_len < (pgsnmpdConnID_val_ptr_len * sizeof(tbl_idx->pgsnmpdConnID[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+        return MFD_ERROR;
+    }
+    tbl_idx->pgsnmpdConnID_len = pgsnmpdConnID_val_ptr_len * sizeof(tbl_idx->pgsnmpdConnID[0]);
+    memcpy( tbl_idx->pgsnmpdConnID, pgsnmpdConnID_val_ptr, tbl_idx->pgsnmpdConnID_len );
+    
+
+    return MFD_SUCCESS;
+} /* pgsnmpdConnectionsTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This function sets the mib indexs, then updates the oid indexs
+ *  from the mib index.
+ */
+int
+pgsnmpdConnectionsTable_indexes_set(pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len)
+{
+    DEBUGMSGTL(("verbose:pgsnmpdConnectionsTable:pgsnmpdConnectionsTable_indexes_set","called\n"));
+
+    if(MFD_SUCCESS != pgsnmpdConnectionsTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+                                   , pgsnmpdConnID_val_ptr, pgsnmpdConnID_val_ptr_len
+           ))
+        return MFD_ERROR;
+
+    /*
+     * convert mib index to oid index
+     */
+    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+    if(0 != pgsnmpdConnectionsTable_index_to_oid(&rowreq_ctx->oid_idx,
+                                    &rowreq_ctx->tbl_idx)) {
+        return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* pgsnmpdConnectionsTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsnmpdConnectionEntry.pgsnmpdConnHost
+ * pgsnmpdConnHost is subid 2 of pgsnmpdConnectionEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.27645.1.1.1.1.2
+ * Description:
+Host name, IP address, or other identifier of the host PostgreSQL server for this connection
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE pgsnmpdConnHost IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsnmpdConnectionEntry.pgsnmpdConnPort
+ * pgsnmpdConnPort is subid 3 of pgsnmpdConnectionEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.27645.1.1.1.1.3
+ * Description:
+PostgreSQL server port number for this connection
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE pgsnmpdConnPort IS NOT ACCESSIBLE
+ *
+ *
+ */
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsnmpdConnectionEntry.pgsnmpdConnDbName
+ * pgsnmpdConnDbName is subid 4 of pgsnmpdConnectionEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.27645.1.1.1.1.4
+ * Description:
+Name of the database this connection is connected to
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE pgsnmpdConnDbName IS NOT ACCESSIBLE
+ *
+ *
+ */
+
+
+/** @} */
diff --git a/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_get.h b/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_get.h
new file mode 100644 (file)
index 0000000..2e12dae
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18.2.1 $ of : mfd-data-get.m2c,v $
+ *
+ * $Id: pgsnmpdConnectionsTable_data_get.h,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
+ *
+ * @file pgsnmpdConnectionsTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef PGSNMPDCONNECTIONSTABLE_DATA_GET_H
+#define PGSNMPDCONNECTIONSTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsnmpdConnectionsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsnmpdConnectionsTable is subid 1 of pgsnmpdTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.1.1, length: 10
+*/
+    /*
+     * indexes
+     */
+    int pgsnmpdConnID_map(char **mib_pgsnmpdConnID_val_ptr_ptr, size_t *mib_pgsnmpdConnID_val_ptr_len_ptr, char *raw_pgsnmpdConnID_val_ptr, size_t raw_pgsnmpdConnID_val_ptr_len, int allow_realloc);
+
+    int pgsnmpdConnHost_map(char **mib_pgsnmpdConnHost_val_ptr_ptr, size_t *mib_pgsnmpdConnHost_val_ptr_len_ptr, char *raw_pgsnmpdConnHost_val_ptr, size_t raw_pgsnmpdConnHost_val_ptr_len, int allow_realloc);
+    int pgsnmpdConnHost_get( pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx, char **pgsnmpdConnHost_val_ptr_ptr, size_t *pgsnmpdConnHost_val_ptr_len_ptr );
+    int pgsnmpdConnPort_map(char **mib_pgsnmpdConnPort_val_ptr_ptr, size_t *mib_pgsnmpdConnPort_val_ptr_len_ptr, char *raw_pgsnmpdConnPort_val_ptr, size_t raw_pgsnmpdConnPort_val_ptr_len, int allow_realloc);
+    int pgsnmpdConnPort_get( pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx, char **pgsnmpdConnPort_val_ptr_ptr, size_t *pgsnmpdConnPort_val_ptr_len_ptr );
+    int pgsnmpdConnDbName_map(char **mib_pgsnmpdConnDbName_val_ptr_ptr, size_t *mib_pgsnmpdConnDbName_val_ptr_len_ptr, char *raw_pgsnmpdConnDbName_val_ptr, size_t raw_pgsnmpdConnDbName_val_ptr_len, int allow_realloc);
+    int pgsnmpdConnDbName_get( pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx, char **pgsnmpdConnDbName_val_ptr_ptr, size_t *pgsnmpdConnDbName_val_ptr_len_ptr );
+
+
+int pgsnmpdConnectionsTable_indexes_set_tbl_idx(pgsnmpdConnectionsTable_mib_index *tbl_idx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len);
+int pgsnmpdConnectionsTable_indexes_set(pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSNMPDCONNECTIONSTABLE_DATA_GET_H */
+/** @} */
diff --git a/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_set.c b/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_set.c
new file mode 100644 (file)
index 0000000..44af8ae
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18 $ of : mfd-data-set.m2c,v $
+ *
+ * $Id: pgsnmpdConnectionsTable_data_set.c,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsnmpdConnectionsTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ * 
+ * @{
+ */
+/** @} */
diff --git a/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_set.h b/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_data_set.h
new file mode 100644 (file)
index 0000000..d077ee0
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18 $ of : mfd-data-set.m2c,v $ 
+ *
+ * $Id: pgsnmpdConnectionsTable_data_set.h,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
+ */
+#ifndef PGSNMPDCONNECTIONSTABLE_DATA_SET_H
+#define PGSNMPDCONNECTIONSTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSNMPDCONNECTIONSTABLE_DATA_SET_H */
diff --git a/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_enums.h b/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_enums.h
new file mode 100644 (file)
index 0000000..5fcc4cd
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : generic-table-enums.m2c,v 1.3 2004/05/18 17:44:32 rstory Exp $
+ *
+ * $Id: pgsnmpdConnectionsTable_enums.h,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
+ */
+#ifndef PGSNMPDCONNECTIONSTABLE_ENUMS_H
+#define PGSNMPDCONNECTIONSTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table pgsnmpdConnectionsTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSNMPDCONNECTIONSTABLE_ENUMS_H */
diff --git a/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_interface.c b/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_interface.c
new file mode 100644 (file)
index 0000000..2b42a61
--- /dev/null
@@ -0,0 +1,707 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.43.2.3 $ of : mfd-interface.m2c,v $ 
+ *
+ * $Id: pgsnmpdConnectionsTable_interface.c,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * ***                                                               ***
+ * ***  NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE  ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE.      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***    IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES.   ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsnmpdConnectionsTable.h"
+
+
+#include <net-snmp/library/container.h>
+
+#include "pgsnmpdConnectionsTable_interface.h"
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsnmpdConnectionsTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsnmpdConnectionsTable is subid 1 of pgsnmpdTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.1.1, length: 10
+*/
+typedef struct pgsnmpdConnectionsTable_interface_ctx_s {
+
+   netsnmp_container              *container;
+   netsnmp_cache                  *cache; /* optional cache */
+
+   pgsnmpdConnectionsTable_registration_ptr      user_ctx;
+   
+   netsnmp_table_registration_info  tbl_info;
+
+   netsnmp_baby_steps_access_methods access_multiplexer;
+
+} pgsnmpdConnectionsTable_interface_ctx;
+
+static pgsnmpdConnectionsTable_interface_ctx pgsnmpdConnectionsTable_if_ctx;
+
+static void _pgsnmpdConnectionsTable_container_init(
+    pgsnmpdConnectionsTable_interface_ctx *if_ctx);
+
+
+static Netsnmp_Node_Handler _mfd_pgsnmpdConnectionsTable_pre_request;
+static Netsnmp_Node_Handler _mfd_pgsnmpdConnectionsTable_post_request;
+static Netsnmp_Node_Handler _mfd_pgsnmpdConnectionsTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_pgsnmpdConnectionsTable_get_values;
+/**
+ * @internal
+ * Initialize the table pgsnmpdConnectionsTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+_pgsnmpdConnectionsTable_initialize_interface(pgsnmpdConnectionsTable_registration_ptr reg_ptr,  u_long flags)
+{
+    netsnmp_baby_steps_access_methods *access_multiplexer =
+        &pgsnmpdConnectionsTable_if_ctx.access_multiplexer;
+    netsnmp_table_registration_info *tbl_info = &pgsnmpdConnectionsTable_if_ctx.tbl_info;
+    netsnmp_handler_registration *reginfo;
+    netsnmp_mib_handler *handler;
+    int    mfd_modes = 0;
+
+    DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:_pgsnmpdConnectionsTable_initialize_interface","called\n"));
+
+
+    /*************************************************
+     *
+     * save interface context for pgsnmpdConnectionsTable
+     */
+    /*
+     * Setting up the table's definition
+     */
+    netsnmp_table_helper_add_indexes(tbl_info,
+                                  ASN_OCTET_STR, /** index: pgsnmpdConnID */
+                             0);
+
+    /*  Define the minimum and maximum accessible columns.  This
+        optimizes retrival. */
+    tbl_info->min_column = PGSNMPDCONNECTIONSTABLE_MIN_COL;
+    tbl_info->max_column = PGSNMPDCONNECTIONSTABLE_MAX_COL;
+
+    /*
+     * save users context
+     */
+    pgsnmpdConnectionsTable_if_ctx.user_ctx = reg_ptr;
+
+    /*
+     * call data access initialization code
+     */
+    pgsnmpdConnectionsTable_init_data(reg_ptr);
+
+    /*
+     * set up the container
+     */
+    _pgsnmpdConnectionsTable_container_init(&pgsnmpdConnectionsTable_if_ctx);
+    if (NULL == pgsnmpdConnectionsTable_if_ctx.container) {
+        snmp_log(LOG_ERR,"could not initialize container for pgsnmpdConnectionsTable\n");
+        return;
+    }
+    
+    /*
+     * access_multiplexer: REQUIRED wrapper for get request handling
+     */
+    access_multiplexer->object_lookup = _mfd_pgsnmpdConnectionsTable_object_lookup;
+    access_multiplexer->get_values = _mfd_pgsnmpdConnectionsTable_get_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->pre_request = _mfd_pgsnmpdConnectionsTable_pre_request;
+    access_multiplexer->post_request = _mfd_pgsnmpdConnectionsTable_post_request;
+
+
+    /*************************************************
+     *
+     * Create a registration, save our reg data, register table.
+     */
+    DEBUGMSGTL(("pgsnmpdConnectionsTable:init_pgsnmpdConnectionsTable",
+                "Registering pgsnmpdConnectionsTable as a mibs-for-dummies table.\n"));                 
+    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+    reginfo = netsnmp_handler_registration_create("pgsnmpdConnectionsTable", handler,
+                                                  pgsnmpdConnectionsTable_oid,
+                                                  pgsnmpdConnectionsTable_oid_size,
+                                                  HANDLER_CAN_BABY_STEP |
+                                                  HANDLER_CAN_RONLY
+                                                  );
+    if(NULL == reginfo) {
+        snmp_log(LOG_ERR,"error registering table pgsnmpdConnectionsTable\n");
+        return;
+    }
+    reginfo->my_reg_void = &pgsnmpdConnectionsTable_if_ctx;
+
+    /*************************************************
+     *
+     * set up baby steps handler, create it and inject it
+     */
+    if( access_multiplexer->object_lookup )
+        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+    if( access_multiplexer->set_values )
+        mfd_modes |= BABY_STEP_SET_VALUES;
+    if( access_multiplexer->irreversible_commit )
+        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+    if( access_multiplexer->object_syntax_checks )
+        mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+    if( access_multiplexer->pre_request )
+        mfd_modes |= BABY_STEP_PRE_REQUEST;
+    if( access_multiplexer->post_request )
+        mfd_modes |= BABY_STEP_POST_REQUEST;
+    
+    if( access_multiplexer->undo_setup )
+        mfd_modes |= BABY_STEP_UNDO_SETUP;
+    if( access_multiplexer->undo_cleanup )
+        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+    if( access_multiplexer->undo_sets )
+        mfd_modes |= BABY_STEP_UNDO_SETS;
+    
+    if( access_multiplexer->row_creation )
+        mfd_modes |= BABY_STEP_ROW_CREATE;
+    if( access_multiplexer->consistency_checks )
+        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+    if( access_multiplexer->commit )
+        mfd_modes |= BABY_STEP_COMMIT;
+    if( access_multiplexer->undo_commit )
+        mfd_modes |= BABY_STEP_UNDO_COMMIT;
+    
+    handler = netsnmp_baby_steps_handler_get(mfd_modes);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+     */
+    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject container_table helper
+     */
+    handler =
+        netsnmp_container_table_handler_get(tbl_info,
+                                            pgsnmpdConnectionsTable_if_ctx.container,
+                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+    netsnmp_inject_handler( reginfo, handler );
+
+    /*************************************************
+     *
+     * inject cache helper
+     */
+    if(NULL != pgsnmpdConnectionsTable_if_ctx.cache) {
+        handler = netsnmp_cache_handler_get(pgsnmpdConnectionsTable_if_ctx.cache);
+        netsnmp_inject_handler( reginfo, handler );
+    }
+
+    /*
+     * register table
+     */
+    netsnmp_register_table(reginfo, tbl_info);
+} /* _pgsnmpdConnectionsTable_initialize_interface */
+
+void
+pgsnmpdConnectionsTable_valid_columns_set(netsnmp_column_info *vc)
+{
+    pgsnmpdConnectionsTable_if_ctx.tbl_info.valid_columns = vc;
+} /* pgsnmpdConnectionsTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+pgsnmpdConnectionsTable_index_to_oid(netsnmp_index *oid_idx,
+                         pgsnmpdConnectionsTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_pgsnmpdConnID;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_pgsnmpdConnID, 0x00, sizeof(var_pgsnmpdConnID) );
+    var_pgsnmpdConnID.type = ASN_OCTET_STR;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_pgsnmpdConnID.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:pgsnmpdConnectionsTable:pgsnmpdConnectionsTable_index_to_oid","called\n"));
+
+        /* pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+    snmp_set_var_value(&var_pgsnmpdConnID, (u_char*)&mib_idx->pgsnmpdConnID,
+                       mib_idx->pgsnmpdConnID_len * sizeof(mib_idx->pgsnmpdConnID[0]));
+
+
+    err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+                           NULL, 0, &var_pgsnmpdConnID);
+    if(err)
+        snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_pgsnmpdConnID );
+
+    return err;
+} /* pgsnmpdConnectionsTable_index_to_oid */
+
+/**
+ * extract pgsnmpdConnectionsTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR  : no error
+ * @retval SNMP_ERR_GENERR   : error
+ */
+int
+pgsnmpdConnectionsTable_index_from_oid(netsnmp_index *oid_idx,
+                         pgsnmpdConnectionsTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_pgsnmpdConnID;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_pgsnmpdConnID, 0x00, sizeof(var_pgsnmpdConnID) );
+    var_pgsnmpdConnID.type = ASN_OCTET_STR;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_pgsnmpdConnID.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:pgsnmpdConnectionsTable:pgsnmpdConnectionsTable_index_from_oid","called\n"));
+
+    /*
+     * parse the oid into the individual index components
+     */
+    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+                             &var_pgsnmpdConnID );
+    if (err == SNMP_ERR_NOERROR) {
+        /*
+         * copy out values
+         */
+    /*
+     * NOTE: val_len is in bytes, pgsnmpdConnID_len might not be
+     */
+         if(var_pgsnmpdConnID.val_len > sizeof(mib_idx->pgsnmpdConnID))
+             err = SNMP_ERR_GENERR;
+         else {
+             memcpy(mib_idx->pgsnmpdConnID, var_pgsnmpdConnID.val.string, var_pgsnmpdConnID.val_len);
+             mib_idx->pgsnmpdConnID_len = var_pgsnmpdConnID.val_len / sizeof(mib_idx->pgsnmpdConnID[0]);
+         }
+
+
+    }
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_pgsnmpdConnID );
+
+    return err;
+} /* pgsnmpdConnectionsTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a pgsnmpdConnectionsTable_rowreq_ctx
+ */
+pgsnmpdConnectionsTable_rowreq_ctx *
+pgsnmpdConnectionsTable_allocate_rowreq_ctx(void)
+{
+    pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx =
+                  SNMP_MALLOC_TYPEDEF(pgsnmpdConnectionsTable_rowreq_ctx);
+
+    DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:pgsnmpdConnectionsTable_allocate_rowreq_ctx","called\n"));
+
+    if(NULL == rowreq_ctx) {
+        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+                 "pgsnmpdConnectionsTable_rowreq_ctx.\n");
+    }
+
+    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+    rowreq_ctx->pgsnmpdConnectionsTable_data_list = NULL;
+    rowreq_ctx->pgsnmpdConnectionsTable_reg = pgsnmpdConnectionsTable_if_ctx.user_ctx;
+
+
+    return rowreq_ctx;
+} /* pgsnmpdConnectionsTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a pgsnmpdConnectionsTable_rowreq_ctx
+ */
+void
+pgsnmpdConnectionsTable_release_rowreq_ctx(pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:pgsnmpdConnectionsTable_release_rowreq_ctx","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+
+    /*
+     * free index oid pointer
+     */
+    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+        free(rowreq_ctx->oid_idx.oids);
+
+    SNMP_FREE(rowreq_ctx);
+} /* pgsnmpdConnectionsTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_pgsnmpdConnectionsTable_pre_request(netsnmp_mib_handler *handler,
+                            netsnmp_handler_registration *reginfo,
+                            netsnmp_agent_request_info *agtreq_info,
+                            netsnmp_request_info *requests)
+{
+    int rc = pgsnmpdConnectionsTable_pre_request(pgsnmpdConnectionsTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:pgsnmpdConnectionsTable","error %d from "
+                    "pgsnmpdConnectionsTable_pre_request\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsnmpdConnectionsTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_pgsnmpdConnectionsTable_post_request(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx;
+    int rc = pgsnmpdConnectionsTable_post_request(pgsnmpdConnectionsTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:pgsnmpdConnectionsTable","error %d from "
+                    "pgsnmpdConnectionsTable_post_request\n", rc));
+    }
+    
+    /*
+     * if there are no errors, check for and handle row creation/deletion
+     */
+    rc = netsnmp_check_requests_error(requests);
+    if ((SNMP_ERR_NOERROR == rc) &&
+        (NULL !=
+         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
+        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+            CONTAINER_INSERT(pgsnmpdConnectionsTable_if_ctx.container, rowreq_ctx);
+        }
+        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+            CONTAINER_REMOVE(pgsnmpdConnectionsTable_if_ctx.container, rowreq_ctx);
+            pgsnmpdConnectionsTable_release_rowreq_ctx(rowreq_ctx);
+        }
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsnmpdConnectionsTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_pgsnmpdConnectionsTable_object_lookup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    
+    DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:_mfd_pgsnmpdConnectionsTable_object_lookup","called\n"));
+
+    /*
+     * get our context from mfd
+     * pgsnmpdConnectionsTable_interface_ctx *if_ctx =
+     *             (pgsnmpdConnectionsTable_interface_ctx *)reginfo->my_reg_void;
+     */
+
+    if(NULL == rowreq_ctx) {
+        netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
+    }
+    else {
+        pgsnmpdConnectionsTable_row_prep(rowreq_ctx);
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsnmpdConnectionsTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_pgsnmpdConnectionsTable_get_column( pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:_mfd_pgsnmpdConnectionsTable_get_column","called\n"));
+
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _pgsnmpdConnectionsTable_get_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _pgsnmpdConnectionsTable_get_column */
+
+int
+_mfd_pgsnmpdConnectionsTable_get_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    u_char                     * old_string;
+    void                      (*dataFreeHook)(void *);
+    int                        rc;
+
+    DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:_mfd_pgsnmpdConnectionsTable_get_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * save old pointer, so we can free it if replaced
+         */
+        old_string = requests->requestvb->val.string;
+        dataFreeHook = requests->requestvb->dataFreeHook;
+        if(NULL == requests->requestvb->val.string) {
+            requests->requestvb->val.string = requests->requestvb->buf;
+            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+        else if(requests->requestvb->buf == requests->requestvb->val.string) {
+            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+
+        /*
+         * get column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _pgsnmpdConnectionsTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            if(MFD_SKIP == rc) {
+                requests->requestvb->type = ASN_PRIV_RETRY;
+                rc = SNMP_ERR_NOERROR;
+            }
+        }
+        else if (NULL == requests->requestvb->val.string) {
+            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+            rc = SNMP_ERR_GENERR;
+        }
+        if(rc)
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+        /*
+         * if the buffer wasn't used previously for the old data (i.e. it
+         * was allcoated memory)  and the get routine replaced the pointer,
+         * we need to free the previous pointer.
+         */
+        if(old_string && (old_string != requests->requestvb->buf) &&
+           (requests->requestvb->val.string != old_string)) {
+            if(dataFreeHook)
+                (*dataFreeHook)(old_string);
+            else
+                free(old_string);
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsnmpdConnectionsTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+    DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:_cache_load","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache for pgsnmpdConnectionsTable_cache_load\n");
+        return -1;
+    }
+
+    /** should only be called for an invalid or expired cache */
+    netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+    
+    /*
+     * call user code
+     */
+    return pgsnmpdConnectionsTable_cache_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_item_free(pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+    DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:_cache_item_free","called\n"));
+
+    if(NULL == rowreq_ctx)
+        return;
+
+    pgsnmpdConnectionsTable_release_rowreq_ctx(rowreq_ctx);
+} /* _cache_item_free */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+    netsnmp_container *container;
+
+    DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:_cache_free","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache in pgsnmpdConnectionsTable_cache_free\n");
+        return;
+    }
+
+    container = (netsnmp_container*)cache->magic;
+
+    /*
+     * call user code
+     */
+    pgsnmpdConnectionsTable_cache_free(container);
+    
+    /*
+     * free all items. inefficient, but easy.
+     */
+    CONTAINER_CLEAR(container,
+                    (netsnmp_container_obj_func *)_cache_item_free,
+                    NULL);
+} /* _cache_free */
+
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_pgsnmpdConnectionsTable_container_init(pgsnmpdConnectionsTable_interface_ctx *if_ctx)
+{
+    DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:_pgsnmpdConnectionsTable_container_init","called\n"));
+    
+    /*
+     * set up the cache
+     */
+    if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+                                         _cache_load, _cache_free,
+                                         pgsnmpdConnectionsTable_oid,
+                                         pgsnmpdConnectionsTable_oid_size);
+
+    if(NULL == if_ctx->cache) {
+        snmp_log(LOG_ERR, "error creating cache for pgsnmpdConnectionsTable\n");
+        return;
+    }
+
+    if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+    pgsnmpdConnectionsTable_container_init(&if_ctx->container, if_ctx->cache);
+    if(NULL == if_ctx->container)
+        if_ctx->container = netsnmp_container_find("pgsnmpdConnectionsTable:table_container");
+    if(NULL == if_ctx->container) {
+        snmp_log(LOG_ERR,"error creating container in "
+                 "pgsnmpdConnectionsTable_container_init\n");
+        return;
+    }
+    if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _pgsnmpdConnectionsTable_container_init */
+
diff --git a/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_interface.h b/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_interface.h
new file mode 100644 (file)
index 0000000..872beea
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.43.2.3 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: pgsnmpdConnectionsTable_interface.h,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
+ */
+/** @defgroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ *          or used to interpret functionality. It is subject to
+ *          change at any time.
+ * 
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * ***                                                               ***
+ * ***  NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE  ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE.      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***    IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES.   ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef PGSNMPDCONNECTIONSTABLE_INTERFACE_H
+#define PGSNMPDCONNECTIONSTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "pgsnmpdConnectionsTable.h"
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _pgsnmpdConnectionsTable_initialize_interface(pgsnmpdConnectionsTable_registration_ptr user_ctx,
+                                    u_long flags);
+
+    pgsnmpdConnectionsTable_rowreq_ctx * pgsnmpdConnectionsTable_allocate_rowreq_ctx(void);
+void pgsnmpdConnectionsTable_release_rowreq_ctx(pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx);
+
+int pgsnmpdConnectionsTable_index_to_oid(netsnmp_index *oid_idx,
+                            pgsnmpdConnectionsTable_mib_index *mib_idx);
+int pgsnmpdConnectionsTable_index_from_oid(netsnmp_index *oid_idx,
+                              pgsnmpdConnectionsTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void pgsnmpdConnectionsTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSNMPDCONNECTIONSTABLE_INTERFACE_H */
diff --git a/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_oids.h b/PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_oids.h
new file mode 100644 (file)
index 0000000..9f8d9c6
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : generic-table-oids.m2c,v 1.10 2004/10/08 23:39:17 rstory Exp $
+ *
+ * $Id: pgsnmpdConnectionsTable_oids.h,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
+ */
+#ifndef PGSNMPDCONNECTIONSTABLE_OIDS_H
+#define PGSNMPDCONNECTIONSTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table pgsnmpdConnectionsTable */
+#define PGSNMPDCONNECTIONSTABLE_OID              1,3,6,1,4,1,27645,1,1,1
+#define COLUMN_PGSNMPDCONNID           1
+#define COLUMN_PGSNMPDCONNHOST         2
+#define COLUMN_PGSNMPDCONNPORT         3
+#define COLUMN_PGSNMPDCONNDBNAME               4
+
+#define PGSNMPDCONNECTIONSTABLE_MIN_COL                
+#define PGSNMPDCONNECTIONSTABLE_MAX_COL                
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSNMPDCONNECTIONSTABLE_OIDS_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable.c
new file mode 100644 (file)
index 0000000..5d427c0
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.32.2.3 $ of : mfd-top.m2c,v $ 
+ *
+ * $Id: pgsqlPgAggregateTable.c,v 1.1 2008/01/17 11:49:24 eggyknap Exp $
+ */
+/** \mainpage MFD helper for pgsqlPgAggregateTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsqlPgAggregateTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "pgsqlPgAggregateTable_interface.h"
+
+oid pgsqlPgAggregateTable_oid[] = { PGSQLPGAGGREGATETABLE_OID };
+int pgsqlPgAggregateTable_oid_size = OID_LENGTH(pgsqlPgAggregateTable_oid);
+
+void initialize_table_pgsqlPgAggregateTable(void);
+
+
+/**
+ * Initializes the pgsqlPgAggregateTable module
+ */
+void
+init_pgsqlPgAggregateTable(void)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:init_pgsqlPgAggregateTable","called\n"));
+
+    /*
+     * TODO:300:o: Perform pgsqlPgAggregateTable one-time module initialization.
+     */
+     
+    /*
+     * here we initialize all the tables we're planning on supporting
+     */
+    if (should_init("pgsqlPgAggregateTable"))
+        initialize_table_pgsqlPgAggregateTable();
+
+} /* init_pgsqlPgAggregateTable */
+
+/**
+ * Initialize the table pgsqlPgAggregateTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+initialize_table_pgsqlPgAggregateTable(void)
+{
+    pgsqlPgAggregateTable_registration_ptr user_context;
+    u_long flags;
+
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:initialize_table_pgsqlPgAggregateTable","called\n"));
+
+    /*
+     * TODO:301:o: Perform pgsqlPgAggregateTable one-time table initialization.
+     */
+
+    /*
+     * TODO:302:o: |->Initialize pgsqlPgAggregateTable user context
+     * if you'd like to pass in a pointer to some data for this
+     * table, allocate or set it up here.
+     */
+    /*
+     * a netsnmp_data_list is a simple way to store void pointers. A simple
+     * string token is used to add, find or remove pointers.
+     */
+    user_context = netsnmp_create_data_list("pgsqlPgAggregateTable", NULL, NULL);
+    
+    /*
+     * No support for any flags yet, but in the future you would
+     * set any flags here.
+     */
+    flags = 0;
+    
+    /*
+     * call interface initialization code
+     */
+    _pgsqlPgAggregateTable_initialize_interface(user_context, flags);
+} /* initialize_table_pgsqlPgAggregateTable */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_ERROR                : other error
+ */
+int
+pgsqlPgAggregateTable_pre_request(pgsqlPgAggregateTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_pre_request","called\n"));
+
+    /*
+     * TODO:510:o: Perform pgsqlPgAggregateTable pre-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : other error (ignored)
+ */
+int
+pgsqlPgAggregateTable_post_request(pgsqlPgAggregateTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_post_request","called\n"));
+
+    /*
+     * TODO:511:o: Perform pgsqlPgAggregateTable pos-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateTable_post_request */
+
+
+/** @{ */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable.h
new file mode 100644 (file)
index 0000000..18c7e4d
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.32.2.3 $ of : mfd-top.m2c,v $
+ *
+ * $Id: pgsqlPgAggregateTable.h,v 1.1 2008/01/17 11:49:24 eggyknap Exp $
+ */
+#ifndef PGSQLPGAGGREGATETABLE_H
+#define PGSQLPGAGGREGATETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @defgroup misc misc: Miscelaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+    /* *INDENT-OFF*  */
+config_require(PGSQL-MIB/pgsqlPgAggregateTable/pgsqlPgAggregateTable_interface);
+config_require(PGSQL-MIB/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_access);
+config_require(PGSQL-MIB/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_get);
+config_require(PGSQL-MIB/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_set);
+    /* *INDENT-ON*  */
+
+/* OID and column number definitions for  */
+#include "pgsqlPgAggregateTable_oids.h"
+
+/* enum definions */
+#include "pgsqlPgAggregateTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_pgsqlPgAggregateTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAggregateTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAggregateTable is subid 1 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.1, length: 10
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+    /*
+     * TODO:101:o: |-> Review pgsqlPgAggregateTable registration context.
+     */
+typedef netsnmp_data_list * pgsqlPgAggregateTable_registration_ptr;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review pgsqlPgAggregateTable data context structure.
+ * This structure is used to represent the data for pgsqlPgAggregateTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * pgsqlPgAggregateTable.
+ */
+typedef struct pgsqlPgAggregateTable_data_s {
+    
+        /*
+         * pgsqlPgAggregateAggfnoid(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAggregateAggfnoid;
+    
+        /*
+         * pgsqlPgAggregateAggtransfn(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAggregateAggtransfn;
+    
+        /*
+         * pgsqlPgAggregateAggfinalfn(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAggregateAggfinalfn;
+    
+        /*
+         * pgsqlPgAggregateAggsortop(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAggregateAggsortop;
+    
+        /*
+         * pgsqlPgAggregateAggtranstype(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAggregateAggtranstype;
+    
+        /*
+         * pgsqlPgAggregateAgginitval(7)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+         */
+   char   pgsqlPgAggregateAgginitval[255];
+size_t      pgsqlPgAggregateAgginitval_len; /* # of char elements, not bytes */
+    
+} pgsqlPgAggregateTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review pgsqlPgAggregateTable mib index.
+ * This structure is used to represent the index for pgsqlPgAggregateTable.
+ */
+typedef struct pgsqlPgAggregateTable_mib_index_s {
+
+        /*
+         * pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+         */
+        /** 128 - 2(other indexes) - oid length(12) = 113 */
+   char   pgsnmpdConnID[113];
+   size_t      pgsnmpdConnID_len;
+
+        /*
+         * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   rdbmsDbIndex;
+
+        /*
+         * pgsqlPgAggregateEntryOID(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+         */
+   long   pgsqlPgAggregateEntryOID;
+
+
+} pgsqlPgAggregateTable_mib_index;
+
+    /*
+     * TODO:121:r: |   |-> Review pgsqlPgAggregateTable max index length.
+     * If you KNOW that your indexes will never exceed a certain
+     * length, update this macro to that length.
+     *
+     * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+     * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+     * Guessing 128 - col/entry(2)  - oid len(10)
+*/
+#define MAX_pgsqlPgAggregateTable_IDX_LEN     116
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review pgsqlPgAggregateTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * pgsqlPgAggregateTable_rowreq_ctx pointer.
+ */
+typedef struct pgsqlPgAggregateTable_rowreq_ctx_s {
+
+    /** this must be first for container compare to work */
+    netsnmp_index        oid_idx;
+    oid                  oid_tmp[MAX_pgsqlPgAggregateTable_IDX_LEN];
+    
+    pgsqlPgAggregateTable_mib_index        tbl_idx;
+    
+    pgsqlPgAggregateTable_data              data;
+
+    /*
+     * flags per row. Currently, the first (lower) 8 bits are reserved
+     * for the user. See mfd.h for other flags.
+     */
+    u_int                       rowreq_flags;
+
+    /*
+     * implementor's context pointer (provided during registration)
+     */
+    pgsqlPgAggregateTable_registration_ptr pgsqlPgAggregateTable_reg;
+
+    /*
+     * TODO:131:o: |   |-> Add useful data to pgsqlPgAggregateTable rowreq context.
+     */
+    
+    /*
+     * storage for future expansion
+     */
+    netsnmp_data_list             *pgsqlPgAggregateTable_data_list;
+
+} pgsqlPgAggregateTable_rowreq_ctx;
+
+typedef struct pgsqlPgAggregateTable_ref_rowreq_ctx_s {
+    pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx;
+} pgsqlPgAggregateTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+    int pgsqlPgAggregateTable_pre_request(pgsqlPgAggregateTable_registration_ptr user_context);
+    int pgsqlPgAggregateTable_post_request(pgsqlPgAggregateTable_registration_ptr user_context);
+
+
+extern oid pgsqlPgAggregateTable_oid[];
+extern int pgsqlPgAggregateTable_oid_size;
+
+
+#include "pgsqlPgAggregateTable_interface.h"
+#include "pgsqlPgAggregateTable_data_access.h"
+#include "pgsqlPgAggregateTable_data_get.h"
+#include "pgsqlPgAggregateTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAGGREGATETABLE_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_access.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_access.c
new file mode 100644 (file)
index 0000000..2f55780
--- /dev/null
@@ -0,0 +1,297 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.12 $ of : mfd-data-access.m2c,v $ 
+ *
+ * $Id: pgsqlPgAggregateTable_data_access.c,v 1.2 2008/01/17 12:29:36 eggyknap Exp $
+ */
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "pgsqlPgAggregateTable.h"
+#include "pgsqlPgAggregateTable_data_access.h"
+
+/** @defgroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ * 
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAggregateTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAggregateTable is subid 1 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.1, length: 10
+*/
+
+/**
+ * initialization for pgsqlPgAggregateTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param pgsqlPgAggregateTable_reg
+ *        Pointer to pgsqlPgAggregateTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : unrecoverable error.
+ */
+int
+pgsqlPgAggregateTable_init_data(pgsqlPgAggregateTable_registration_ptr pgsqlPgAggregateTable_reg)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_init_data","called\n"));
+
+    /*
+     * TODO:303:o: Initialize pgsqlPgAggregateTable data.
+     */
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateTable_init_data */
+
+/**
+ * container-cached overview
+ *
+ */
+
+/***********************************************************************
+ *
+ * cache
+ *
+ ***********************************************************************/
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ *        create a custom container, use this parameter to return it
+ *        to the MFD helper. If set to NULL, the MFD helper will
+ *        allocate a container for you.
+ * @param  cache A pointer to a cache structure. You can set the timeout
+ *         and other cache flags using this pointer.
+ *
+ *  This function is called at startup to allow you to customize certain
+ *  aspects of the access method. For the most part, it is for advanced
+ *  users. The default code should suffice for most cases. If no custom
+ *  container is allocated, the MFD code will create one for your.
+ *
+ *  This is also the place to set up cache behavior. The default, to
+ *  simply set the cache timeout, will work well with the default
+ *  container. If you are using a custom container, you may want to
+ *  look at the cache helper documentation to see if there are any
+ *  flags you want to set.
+ *
+ * @remark
+ *  This would also be a good place to do any initialization needed
+ *  for you data source. For example, opening a connection to another
+ *  process that will supply the data, opening a database, etc.
+ */
+void
+pgsqlPgAggregateTable_container_init(netsnmp_container **container_ptr_ptr,
+                        netsnmp_cache *cache)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_container_init","called\n"));
+    
+    if((NULL == cache) || (NULL == container_ptr_ptr)) {
+        snmp_log(LOG_ERR,"bad params to pgsqlPgAggregateTable_container_init\n");
+        return;
+    }
+
+    /*
+     * For advanced users, you can use a custom container. If you
+     * do not create one, one will be created for you.
+     */
+    *container_ptr_ptr = NULL;
+
+    /*
+     * TODO:345:A: Set up pgsqlPgAggregateTable cache properties.
+     *
+     * Also for advanced users, you can set parameters for the
+     * cache. Do not change the magic pointer, as it is used
+     * by the MFD helper. To completely disable caching, set
+     * cache->enabled to 0.
+     */
+    cache->timeout = PGSQLPGAGGREGATETABLE_CACHE_TIMEOUT; /* seconds */
+} /* pgsqlPgAggregateTable_container_init */
+
+/**
+ * load cache data
+ *
+ * TODO:350:M: Implement pgsqlPgAggregateTable cache load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR                : other error.
+ *
+ *  This function is called to cache the index(es) (and data, optionally)
+ *  for the every row in the data set.
+ *
+ * @remark
+ *  While loading the cache, the only important thing is the indexes.
+ *  If access to your data is cheap/fast (e.g. you have a pointer to a
+ *  structure in memory), it would make sense to update the data here.
+ *  If, however, the accessing the data invovles more work (e.g. parsing
+ *  some other existing data, or peforming calculations to derive the data),
+ *  then you can limit yourself to setting the indexes and saving any
+ *  information you will need later. Then use the saved information in
+ *  pgsqlPgAggregateTable_row_prep() for populating data.
+ *
+ * @note
+ *  If you need consistency between rows (like you want statistics
+ *  for each row to be from the same time frame), you should set all
+ *  data here.
+ *
+ */
+int
+pgsqlPgAggregateTable_cache_load(netsnmp_container *container)
+{
+    pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx;
+    size_t                 count = 0;
+    
+   char   pgsnmpdConnID[112] = "Default conn ID";
+   size_t      pgsnmpdConnID_len = strlen(pgsnmpdConnID);
+   long   rdbmsDbIndex = 1;
+   int i, resultCount, tmpInt;
+   char *tmpString;
+   PGresult *pg_db_qry;
+
+snmp_log(LOG_INFO, "Running pgsqlPgAggregateTable\n");
+   if (PQstatus(dbconn) == CONNECTION_OK) 
+          pg_db_qry = PQexec(dbconn, "SELECT aggfnoid::INTEGER, aggfnoid, aggtransfn, aggfinalfn, aggsortop, aggtranstype, agginitval FROM pg_aggregate ORDER BY 1 ASC");
+       else {
+               snmp_log(LOG_ERR, "Can't get connected to database\n");
+               return MFD_RESOURCE_UNAVAILABLE;
+       }
+
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_cache_load","called\n"));
+
+       if (PQresultStatus(pg_db_qry) != PGRES_TUPLES_OK) {
+               snmp_log(LOG_ERR, "Didn't get any results from the database\n");
+               PQclear(pg_db_qry);
+               return MFD_RESOURCE_UNAVAILABLE;
+       }
+    resultCount = PQntuples(pg_db_qry);
+
+    /*
+     * TODO:351:M: |-> Load/update data in the pgsqlPgAggregateTable container.
+     * loop over your pgsqlPgAggregateTable data, allocate a rowreq context,
+     * set the index(es) [and data, optionally] and insert into
+     * the container.
+     */
+    for (i = 0; i < resultCount; i++) {
+
+        /*
+         * TODO:352:M: |   |-> set indexes in new pgsqlPgAggregateTable rowreq context.
+         */
+        rowreq_ctx = pgsqlPgAggregateTable_allocate_rowreq_ctx();
+        if (NULL == rowreq_ctx) {
+            snmp_log(LOG_ERR, "memory allocation failed\n");
+            return MFD_RESOURCE_UNAVAILABLE;
+        }
+        if(MFD_SUCCESS != pgsqlPgAggregateTable_indexes_set(rowreq_ctx
+                               , pgsnmpdConnID, pgsnmpdConnID_len
+                               , rdbmsDbIndex
+                               , atol(PQgetvalue(pg_db_qry, i, 0))
+               )) {
+            snmp_log(LOG_ERR,"error setting index while loading "
+                     "pgsqlPgAggregateTable cache.\n");
+            pgsqlPgAggregateTable_release_rowreq_ctx(rowreq_ctx);
+            continue;
+        }
+       rowreq_ctx->data.pgsqlPgAggregateAgginitval_len = 255;
+
+    rowreq_ctx->data.pgsqlPgAggregateAggfnoid = strtoul(PQgetvalue(pg_db_qry, i, 1), NULL, 10);
+    
+    rowreq_ctx->data.pgsqlPgAggregateAggtransfn = strtoul(PQgetvalue(pg_db_qry, i, 2), NULL, 10);
+    
+    rowreq_ctx->data.pgsqlPgAggregateAggfinalfn = strtoul(PQgetvalue(pg_db_qry, i, 3), NULL, 10);
+    
+    rowreq_ctx->data.pgsqlPgAggregateAggsortop = strtoul(PQgetvalue(pg_db_qry, i, 4), NULL, 10);
+    
+    rowreq_ctx->data.pgsqlPgAggregateAggtranstype = strtoul(PQgetvalue(pg_db_qry, i, 5), NULL, 10);
+
+    tmpString = PQgetvalue(pg_db_qry, i, 6);
+    tmpInt = strlen(tmpString);
+    if ((NULL == rowreq_ctx->data.pgsqlPgAggregateAgginitval) ||
+        (rowreq_ctx->data.pgsqlPgAggregateAgginitval_len < (tmpInt * sizeof(rowreq_ctx->data.pgsqlPgAggregateAgginitval[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+        return MFD_ERROR;
+    }
+    rowreq_ctx->data.pgsqlPgAggregateAgginitval_len = tmpInt * sizeof(rowreq_ctx->data.pgsqlPgAggregateAgginitval[0]);
+    memcpy( rowreq_ctx->data.pgsqlPgAggregateAgginitval, tmpString, rowreq_ctx->data.pgsqlPgAggregateAgginitval_len );
+    
+        
+        /*
+         * insert into table container
+         */
+        CONTAINER_INSERT(container, rowreq_ctx);
+        ++count;
+    }
+
+
+    DEBUGMSGT(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_cache_load",
+               "inserted %d records\n", count));
+    PQclear(pg_db_qry);
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateTable_cache_load */
+
+/**
+ * cache clean up
+ *
+ * @param container container with all current items
+ *
+ *  This optional callback is called prior to all
+ *  item's being removed from the container. If you
+ *  need to do any processing before that, do it here.
+ *
+ * @note
+ *  The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+pgsqlPgAggregateTable_cache_free(netsnmp_container *container)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_cache_free","called\n"));
+
+    /*
+     * TODO:380:M: Free pgsqlPgAggregateTable cache.
+     */
+} /* pgsqlPgAggregateTable_cache_free */
+
+/**
+ * prepare row for processing.
+ *
+ *  When the agent has located the row for a request, this function is
+ *  called to prepare the row for processing. If you fully populated
+ *  the data context during the index setup phase, you may not need to
+ *  do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ */
+int
+pgsqlPgAggregateTable_row_prep( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_row_prep","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:390:o: Prepare row for request.
+     * If populating row data was delayed, this is the place to
+     * fill in the row for this request.
+     */
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateTable_row_prep */
+
+/** @} */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_access.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_access.h
new file mode 100644 (file)
index 0000000..6831083
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.12 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: pgsqlPgAggregateTable_data_access.h,v 1.1 2008/01/17 11:49:24 eggyknap Exp $
+ */
+#ifndef PGSQLPGAGGREGATETABLE_DATA_ACCESS_H
+#define PGSQLPGAGGREGATETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAggregateTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAggregateTable is subid 1 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.1, length: 10
+*/
+
+
+    int pgsqlPgAggregateTable_init_data(pgsqlPgAggregateTable_registration_ptr pgsqlPgAggregateTable_reg);
+
+
+/*
+ * TODO:180:o: Review pgsqlPgAggregateTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define PGSQLPGAGGREGATETABLE_CACHE_TIMEOUT   60
+
+void pgsqlPgAggregateTable_container_init(netsnmp_container **container_ptr_ptr,
+                             netsnmp_cache *cache);
+int pgsqlPgAggregateTable_cache_load(netsnmp_container *container);
+void pgsqlPgAggregateTable_cache_free(netsnmp_container *container);
+
+    /*
+    ***************************************************
+    ***             START EXAMPLE CODE              ***
+    ***---------------------------------------------***/
+/* *********************************************************************
+ * Since we have no idea how you really access your data, we'll go with
+ * a worst case example: a flat text file.
+ */
+#define MAX_LINE_SIZE 256
+    /*
+    ***---------------------------------------------***
+    ***              END  EXAMPLE CODE              ***
+    ***************************************************/
+    int pgsqlPgAggregateTable_row_prep( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAGGREGATETABLE_DATA_ACCESS_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_get.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_get.c
new file mode 100644 (file)
index 0000000..c156328
--- /dev/null
@@ -0,0 +1,839 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18.2.1 $ of : mfd-data-get.m2c,v $ 
+ *
+ * $Id: pgsqlPgAggregateTable_data_get.c,v 1.1 2008/01/17 11:49:24 eggyknap Exp $
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsqlPgAggregateTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement pgsqlPgAggregateTable get routines.
+ * TODO:240:M: Implement pgsqlPgAggregateTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAggregateTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAggregateTable is subid 1 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.1, length: 10
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement pgsqlPgAggregateTable data context functions.
+ */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsnmpdConnectionEntry.pgsnmpdConnID
+ * pgsnmpdConnID is subid 1 of pgsnmpdConnectionEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.27645.1.1.1.1.1
+ * Description:
+Identifying string for this connection. Default is host:port:database.
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE pgsnmpdConnID IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsnmpdConnID.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsnmpdConnID_map(char **mib_pgsnmpdConnID_val_ptr_ptr, size_t *mib_pgsnmpdConnID_val_ptr_len_ptr, char *raw_pgsnmpdConnID_val_ptr, size_t raw_pgsnmpdConnID_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_pgsnmpdConnID_val_ptr);
+    netsnmp_assert((NULL != mib_pgsnmpdConnID_val_ptr_ptr) && (NULL != mib_pgsnmpdConnID_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsnmpdConnID_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement pgsnmpdConnID non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_pgsnmpdConnID_val_ptr_len; /* assume equal */
+    if((NULL == *mib_pgsnmpdConnID_val_ptr_ptr) || (*mib_pgsnmpdConnID_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_pgsnmpdConnID_val_ptr_ptr = realloc( *mib_pgsnmpdConnID_val_ptr_ptr, converted_len * sizeof(**mib_pgsnmpdConnID_val_ptr_ptr));
+        if(NULL == *mib_pgsnmpdConnID_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_pgsnmpdConnID_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_pgsnmpdConnID_val_ptr_ptr, raw_pgsnmpdConnID_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* pgsnmpdConnID_map */
+
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAggregateEntry.pgsqlPgAggregateEntryOID
+ * pgsqlPgAggregateEntryOID is subid 1 of pgsqlPgAggregateEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.27645.1.2.1.1.1
+ * Description:
+OID of this entry
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE pgsqlPgAggregateEntryOID IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAggregateEntryOID.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAggregateEntryOID_map(long *mib_pgsqlPgAggregateEntryOID_val_ptr, long raw_pgsqlPgAggregateEntryOID_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAggregateEntryOID_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateEntryOID_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAggregateEntryOID mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAggregateEntryOID_val_ptr) = raw_pgsqlPgAggregateEntryOID_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateEntryOID_map */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This convenience function is useful for setting all the MIB index
+ *  components with a single function call. It is assume that the C values
+ *  have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+pgsqlPgAggregateTable_indexes_set_tbl_idx(pgsqlPgAggregateTable_mib_index *tbl_idx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len, long rdbmsDbIndex_val, long pgsqlPgAggregateEntryOID_val)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_indexes_set_tbl_idx","called\n"));
+
+    /* pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+     tbl_idx->pgsnmpdConnID_len = sizeof(tbl_idx->pgsnmpdConnID);
+    /*
+     * make sure there is enough space for pgsnmpdConnID data
+     */
+    if ((NULL == tbl_idx->pgsnmpdConnID) ||
+        (tbl_idx->pgsnmpdConnID_len < (pgsnmpdConnID_val_ptr_len * sizeof(tbl_idx->pgsnmpdConnID[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+        return MFD_ERROR;
+    }
+    tbl_idx->pgsnmpdConnID_len = pgsnmpdConnID_val_ptr_len * sizeof(tbl_idx->pgsnmpdConnID[0]);
+    memcpy( tbl_idx->pgsnmpdConnID, pgsnmpdConnID_val_ptr, tbl_idx->pgsnmpdConnID_len );
+    
+    /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->rdbmsDbIndex = rdbmsDbIndex_val;
+    
+    /* pgsqlPgAggregateEntryOID(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+    tbl_idx->pgsqlPgAggregateEntryOID = pgsqlPgAggregateEntryOID_val;
+    
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This function sets the mib indexs, then updates the oid indexs
+ *  from the mib index.
+ */
+int
+pgsqlPgAggregateTable_indexes_set(pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len, long rdbmsDbIndex_val, long pgsqlPgAggregateEntryOID_val)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_indexes_set","called\n"));
+
+    if(MFD_SUCCESS != pgsqlPgAggregateTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+                                   , pgsnmpdConnID_val_ptr, pgsnmpdConnID_val_ptr_len
+                                   , rdbmsDbIndex_val
+                                   , pgsqlPgAggregateEntryOID_val
+           ))
+        return MFD_ERROR;
+
+    /*
+     * convert mib index to oid index
+     */
+    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+    if(0 != pgsqlPgAggregateTable_index_to_oid(&rowreq_ctx->oid_idx,
+                                    &rowreq_ctx->tbl_idx)) {
+        return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAggregateEntry.pgsqlPgAggregateAggfnoid
+ * pgsqlPgAggregateAggfnoid is subid 2 of pgsqlPgAggregateEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.1.1.2
+ * Description:
+pg_proc OID of the aggregate function
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAggregateAggfnoid.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAggregateAggfnoid_map(long *mib_pgsqlPgAggregateAggfnoid_val_ptr, long raw_pgsqlPgAggregateAggfnoid_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAggregateAggfnoid_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAggfnoid_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAggregateAggfnoid mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAggregateAggfnoid_val_ptr) = raw_pgsqlPgAggregateAggfnoid_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAggfnoid_map */
+
+/**
+ * Extract the current value of the pgsqlPgAggregateAggfnoid data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAggregateAggfnoid_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAggregateAggfnoid_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAggregateAggfnoid_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAggregateAggfnoid_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAggfnoid_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAggregateAggfnoid data.
+ * set (* pgsqlPgAggregateAggfnoid_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAggregateAggfnoid_val_ptr ) = rowreq_ctx->data.pgsqlPgAggregateAggfnoid;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAggfnoid_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAggregateEntry.pgsqlPgAggregateAggtransfn
+ * pgsqlPgAggregateAggtransfn is subid 3 of pgsqlPgAggregateEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.1.1.3
+ * Description:
+Transition function
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAggregateAggtransfn.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAggregateAggtransfn_map(long *mib_pgsqlPgAggregateAggtransfn_val_ptr, long raw_pgsqlPgAggregateAggtransfn_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAggregateAggtransfn_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAggtransfn_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAggregateAggtransfn mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAggregateAggtransfn_val_ptr) = raw_pgsqlPgAggregateAggtransfn_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAggtransfn_map */
+
+/**
+ * Extract the current value of the pgsqlPgAggregateAggtransfn data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAggregateAggtransfn_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAggregateAggtransfn_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAggregateAggtransfn_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAggregateAggtransfn_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAggtransfn_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAggregateAggtransfn data.
+ * set (* pgsqlPgAggregateAggtransfn_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAggregateAggtransfn_val_ptr ) = rowreq_ctx->data.pgsqlPgAggregateAggtransfn;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAggtransfn_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAggregateEntry.pgsqlPgAggregateAggfinalfn
+ * pgsqlPgAggregateAggfinalfn is subid 4 of pgsqlPgAggregateEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.1.1.4
+ * Description:
+Final function (zero if none)
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAggregateAggfinalfn.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAggregateAggfinalfn_map(long *mib_pgsqlPgAggregateAggfinalfn_val_ptr, long raw_pgsqlPgAggregateAggfinalfn_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAggregateAggfinalfn_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAggfinalfn_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAggregateAggfinalfn mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAggregateAggfinalfn_val_ptr) = raw_pgsqlPgAggregateAggfinalfn_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAggfinalfn_map */
+
+/**
+ * Extract the current value of the pgsqlPgAggregateAggfinalfn data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAggregateAggfinalfn_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAggregateAggfinalfn_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAggregateAggfinalfn_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAggregateAggfinalfn_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAggfinalfn_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAggregateAggfinalfn data.
+ * set (* pgsqlPgAggregateAggfinalfn_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAggregateAggfinalfn_val_ptr ) = rowreq_ctx->data.pgsqlPgAggregateAggfinalfn;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAggfinalfn_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAggregateEntry.pgsqlPgAggregateAggsortop
+ * pgsqlPgAggregateAggsortop is subid 5 of pgsqlPgAggregateEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.1.1.5
+ * Description:
+Associated sort operator (zero if none)
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAggregateAggsortop.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAggregateAggsortop_map(long *mib_pgsqlPgAggregateAggsortop_val_ptr, long raw_pgsqlPgAggregateAggsortop_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAggregateAggsortop_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAggsortop_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAggregateAggsortop mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAggregateAggsortop_val_ptr) = raw_pgsqlPgAggregateAggsortop_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAggsortop_map */
+
+/**
+ * Extract the current value of the pgsqlPgAggregateAggsortop data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAggregateAggsortop_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAggregateAggsortop_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAggregateAggsortop_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAggregateAggsortop_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAggsortop_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAggregateAggsortop data.
+ * set (* pgsqlPgAggregateAggsortop_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAggregateAggsortop_val_ptr ) = rowreq_ctx->data.pgsqlPgAggregateAggsortop;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAggsortop_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAggregateEntry.pgsqlPgAggregateAggtranstype
+ * pgsqlPgAggregateAggtranstype is subid 6 of pgsqlPgAggregateEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.1.1.6
+ * Description:
+Data type of the aggregate function's internal transition (state) data
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAggregateAggtranstype.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAggregateAggtranstype_map(long *mib_pgsqlPgAggregateAggtranstype_val_ptr, long raw_pgsqlPgAggregateAggtranstype_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAggregateAggtranstype_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAggtranstype_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAggregateAggtranstype mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAggregateAggtranstype_val_ptr) = raw_pgsqlPgAggregateAggtranstype_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAggtranstype_map */
+
+/**
+ * Extract the current value of the pgsqlPgAggregateAggtranstype data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAggregateAggtranstype_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAggregateAggtranstype_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAggregateAggtranstype_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAggregateAggtranstype_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAggtranstype_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAggregateAggtranstype data.
+ * set (* pgsqlPgAggregateAggtranstype_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAggregateAggtranstype_val_ptr ) = rowreq_ctx->data.pgsqlPgAggregateAggtranstype;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAggtranstype_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAggregateEntry.pgsqlPgAggregateAgginitval
+ * pgsqlPgAggregateAgginitval is subid 7 of pgsqlPgAggregateEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.1.1.7
+ * Description:
+The initial value of the transition state. This is a text field containing the initial value in its external string representation. If this field is NULL, the transition state value starts out NULL
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAggregateAgginitval.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAggregateAgginitval_map(char **mib_pgsqlPgAggregateAgginitval_val_ptr_ptr, size_t *mib_pgsqlPgAggregateAgginitval_val_ptr_len_ptr, char *raw_pgsqlPgAggregateAgginitval_val_ptr, size_t raw_pgsqlPgAggregateAgginitval_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_pgsqlPgAggregateAgginitval_val_ptr);
+    netsnmp_assert((NULL != mib_pgsqlPgAggregateAgginitval_val_ptr_ptr) && (NULL != mib_pgsqlPgAggregateAgginitval_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAgginitval_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement pgsqlPgAggregateAgginitval non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_pgsqlPgAggregateAgginitval_val_ptr_len; /* assume equal */
+    if((NULL == *mib_pgsqlPgAggregateAgginitval_val_ptr_ptr) || (*mib_pgsqlPgAggregateAgginitval_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_pgsqlPgAggregateAgginitval_val_ptr_ptr = realloc( *mib_pgsqlPgAggregateAgginitval_val_ptr_ptr, converted_len * sizeof(**mib_pgsqlPgAggregateAgginitval_val_ptr_ptr));
+        if(NULL == *mib_pgsqlPgAggregateAgginitval_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_pgsqlPgAggregateAgginitval_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_pgsqlPgAggregateAgginitval_val_ptr_ptr, raw_pgsqlPgAggregateAgginitval_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAgginitval_map */
+
+/**
+ * Extract the current value of the pgsqlPgAggregateAgginitval data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAggregateAgginitval_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param pgsqlPgAggregateAgginitval_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by pgsqlPgAggregateAgginitval.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*pgsqlPgAggregateAgginitval_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update pgsqlPgAggregateAgginitval_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+pgsqlPgAggregateAgginitval_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, char **pgsqlPgAggregateAgginitval_val_ptr_ptr, size_t *pgsqlPgAggregateAgginitval_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != pgsqlPgAggregateAgginitval_val_ptr_ptr) && (NULL != *pgsqlPgAggregateAgginitval_val_ptr_ptr));
+   netsnmp_assert( NULL != pgsqlPgAggregateAgginitval_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateAgginitval_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAggregateAgginitval data.
+ * set (* pgsqlPgAggregateAgginitval_val_ptr_ptr ) and (* pgsqlPgAggregateAgginitval_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for pgsqlPgAggregateAgginitval data
+     */
+    if ((NULL == (* pgsqlPgAggregateAgginitval_val_ptr_ptr )) ||
+        ((* pgsqlPgAggregateAgginitval_val_ptr_len_ptr ) < (rowreq_ctx->data.pgsqlPgAggregateAgginitval_len * sizeof((* pgsqlPgAggregateAgginitval_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for pgsqlPgAggregateAgginitval data
+         */
+        (* pgsqlPgAggregateAgginitval_val_ptr_ptr ) = malloc(rowreq_ctx->data.pgsqlPgAggregateAgginitval_len * sizeof((* pgsqlPgAggregateAgginitval_val_ptr_ptr )[0]));
+        if(NULL == (* pgsqlPgAggregateAgginitval_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* pgsqlPgAggregateAgginitval_val_ptr_len_ptr ) = rowreq_ctx->data.pgsqlPgAggregateAgginitval_len * sizeof((* pgsqlPgAggregateAgginitval_val_ptr_ptr )[0]);
+    memcpy( (* pgsqlPgAggregateAgginitval_val_ptr_ptr ), rowreq_ctx->data.pgsqlPgAggregateAgginitval, (* pgsqlPgAggregateAgginitval_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAggregateAgginitval_get */
+
+
+
+/** @} */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_get.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_get.h
new file mode 100644 (file)
index 0000000..c5c1e73
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18.2.1 $ of : mfd-data-get.m2c,v $
+ *
+ * $Id: pgsqlPgAggregateTable_data_get.h,v 1.1 2008/01/17 11:49:24 eggyknap Exp $
+ *
+ * @file pgsqlPgAggregateTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef PGSQLPGAGGREGATETABLE_DATA_GET_H
+#define PGSQLPGAGGREGATETABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAggregateTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAggregateTable is subid 1 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.1, length: 10
+*/
+    /*
+     * indexes
+     */
+    int pgsnmpdConnID_map(char **mib_pgsnmpdConnID_val_ptr_ptr, size_t *mib_pgsnmpdConnID_val_ptr_len_ptr, char *raw_pgsnmpdConnID_val_ptr, size_t raw_pgsnmpdConnID_val_ptr_len, int allow_realloc);
+    int pgsqlPgAggregateEntryOID_map(long *mib_pgsqlPgAggregateEntryOID_val_ptr, long raw_pgsqlPgAggregateEntryOID_val);
+
+    int pgsqlPgAggregateAggfnoid_map(long *mib_pgsqlPgAggregateAggfnoid_val_ptr, long raw_pgsqlPgAggregateAggfnoid_val);
+    int pgsqlPgAggregateAggfnoid_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAggregateAggfnoid_val_ptr );
+    int pgsqlPgAggregateAggtransfn_map(long *mib_pgsqlPgAggregateAggtransfn_val_ptr, long raw_pgsqlPgAggregateAggtransfn_val);
+    int pgsqlPgAggregateAggtransfn_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAggregateAggtransfn_val_ptr );
+    int pgsqlPgAggregateAggfinalfn_map(long *mib_pgsqlPgAggregateAggfinalfn_val_ptr, long raw_pgsqlPgAggregateAggfinalfn_val);
+    int pgsqlPgAggregateAggfinalfn_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAggregateAggfinalfn_val_ptr );
+    int pgsqlPgAggregateAggsortop_map(long *mib_pgsqlPgAggregateAggsortop_val_ptr, long raw_pgsqlPgAggregateAggsortop_val);
+    int pgsqlPgAggregateAggsortop_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAggregateAggsortop_val_ptr );
+    int pgsqlPgAggregateAggtranstype_map(long *mib_pgsqlPgAggregateAggtranstype_val_ptr, long raw_pgsqlPgAggregateAggtranstype_val);
+    int pgsqlPgAggregateAggtranstype_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAggregateAggtranstype_val_ptr );
+    int pgsqlPgAggregateAgginitval_map(char **mib_pgsqlPgAggregateAgginitval_val_ptr_ptr, size_t *mib_pgsqlPgAggregateAgginitval_val_ptr_len_ptr, char *raw_pgsqlPgAggregateAgginitval_val_ptr, size_t raw_pgsqlPgAggregateAgginitval_val_ptr_len, int allow_realloc);
+    int pgsqlPgAggregateAgginitval_get( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, char **pgsqlPgAggregateAgginitval_val_ptr_ptr, size_t *pgsqlPgAggregateAgginitval_val_ptr_len_ptr );
+
+
+int pgsqlPgAggregateTable_indexes_set_tbl_idx(pgsqlPgAggregateTable_mib_index *tbl_idx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len, long rdbmsDbIndex_val, long pgsqlPgAggregateEntryOID_val);
+int pgsqlPgAggregateTable_indexes_set(pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len, long rdbmsDbIndex_val, long pgsqlPgAggregateEntryOID_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAGGREGATETABLE_DATA_GET_H */
+/** @} */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_set.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_set.c
new file mode 100644 (file)
index 0000000..b266046
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18 $ of : mfd-data-set.m2c,v $
+ *
+ * $Id: pgsqlPgAggregateTable_data_set.c,v 1.1 2008/01/17 11:49:24 eggyknap Exp $
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsqlPgAggregateTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ * 
+ * @{
+ */
+/** @} */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_set.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_data_set.h
new file mode 100644 (file)
index 0000000..52061bc
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18 $ of : mfd-data-set.m2c,v $ 
+ *
+ * $Id: pgsqlPgAggregateTable_data_set.h,v 1.1 2008/01/17 11:49:24 eggyknap Exp $
+ */
+#ifndef PGSQLPGAGGREGATETABLE_DATA_SET_H
+#define PGSQLPGAGGREGATETABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAGGREGATETABLE_DATA_SET_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_enums.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_enums.h
new file mode 100644 (file)
index 0000000..161cc07
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : generic-table-enums.m2c,v 1.3 2004/05/18 17:44:32 rstory Exp $
+ *
+ * $Id: pgsqlPgAggregateTable_enums.h,v 1.1 2008/01/17 11:49:24 eggyknap Exp $
+ */
+#ifndef PGSQLPGAGGREGATETABLE_ENUMS_H
+#define PGSQLPGAGGREGATETABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table pgsqlPgAggregateTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAGGREGATETABLE_ENUMS_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_interface.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_interface.c
new file mode 100644 (file)
index 0000000..8215a2d
--- /dev/null
@@ -0,0 +1,784 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.43.2.3 $ of : mfd-interface.m2c,v $ 
+ *
+ * $Id: pgsqlPgAggregateTable_interface.c,v 1.1 2008/01/17 11:49:24 eggyknap Exp $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * ***                                                               ***
+ * ***  NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE  ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE.      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***    IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES.   ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsqlPgAggregateTable.h"
+
+
+#include <net-snmp/library/container.h>
+
+#include "pgsqlPgAggregateTable_interface.h"
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAggregateTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAggregateTable is subid 1 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.1, length: 10
+*/
+typedef struct pgsqlPgAggregateTable_interface_ctx_s {
+
+   netsnmp_container              *container;
+   netsnmp_cache                  *cache; /* optional cache */
+
+   pgsqlPgAggregateTable_registration_ptr      user_ctx;
+   
+   netsnmp_table_registration_info  tbl_info;
+
+   netsnmp_baby_steps_access_methods access_multiplexer;
+
+} pgsqlPgAggregateTable_interface_ctx;
+
+static pgsqlPgAggregateTable_interface_ctx pgsqlPgAggregateTable_if_ctx;
+
+static void _pgsqlPgAggregateTable_container_init(
+    pgsqlPgAggregateTable_interface_ctx *if_ctx);
+
+
+static Netsnmp_Node_Handler _mfd_pgsqlPgAggregateTable_pre_request;
+static Netsnmp_Node_Handler _mfd_pgsqlPgAggregateTable_post_request;
+static Netsnmp_Node_Handler _mfd_pgsqlPgAggregateTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_pgsqlPgAggregateTable_get_values;
+/**
+ * @internal
+ * Initialize the table pgsqlPgAggregateTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+_pgsqlPgAggregateTable_initialize_interface(pgsqlPgAggregateTable_registration_ptr reg_ptr,  u_long flags)
+{
+    netsnmp_baby_steps_access_methods *access_multiplexer =
+        &pgsqlPgAggregateTable_if_ctx.access_multiplexer;
+    netsnmp_table_registration_info *tbl_info = &pgsqlPgAggregateTable_if_ctx.tbl_info;
+    netsnmp_handler_registration *reginfo;
+    netsnmp_mib_handler *handler;
+    int    mfd_modes = 0;
+
+    DEBUGMSGTL(("internal:pgsqlPgAggregateTable:_pgsqlPgAggregateTable_initialize_interface","called\n"));
+
+
+    /*************************************************
+     *
+     * save interface context for pgsqlPgAggregateTable
+     */
+    /*
+     * Setting up the table's definition
+     */
+    netsnmp_table_helper_add_indexes(tbl_info,
+                                  ASN_OCTET_STR, /** index: pgsnmpdConnID */
+                                  ASN_INTEGER, /** index: rdbmsDbIndex */
+                                  ASN_INTEGER, /** index: pgsqlPgAggregateEntryOID */
+                             0);
+
+    /*  Define the minimum and maximum accessible columns.  This
+        optimizes retrival. */
+    tbl_info->min_column = PGSQLPGAGGREGATETABLE_MIN_COL;
+    tbl_info->max_column = PGSQLPGAGGREGATETABLE_MAX_COL;
+
+    /*
+     * save users context
+     */
+    pgsqlPgAggregateTable_if_ctx.user_ctx = reg_ptr;
+
+    /*
+     * call data access initialization code
+     */
+    pgsqlPgAggregateTable_init_data(reg_ptr);
+
+    /*
+     * set up the container
+     */
+    _pgsqlPgAggregateTable_container_init(&pgsqlPgAggregateTable_if_ctx);
+    if (NULL == pgsqlPgAggregateTable_if_ctx.container) {
+        snmp_log(LOG_ERR,"could not initialize container for pgsqlPgAggregateTable\n");
+        return;
+    }
+    
+    /*
+     * access_multiplexer: REQUIRED wrapper for get request handling
+     */
+    access_multiplexer->object_lookup = _mfd_pgsqlPgAggregateTable_object_lookup;
+    access_multiplexer->get_values = _mfd_pgsqlPgAggregateTable_get_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->pre_request = _mfd_pgsqlPgAggregateTable_pre_request;
+    access_multiplexer->post_request = _mfd_pgsqlPgAggregateTable_post_request;
+
+
+    /*************************************************
+     *
+     * Create a registration, save our reg data, register table.
+     */
+    DEBUGMSGTL(("pgsqlPgAggregateTable:init_pgsqlPgAggregateTable",
+                "Registering pgsqlPgAggregateTable as a mibs-for-dummies table.\n"));           
+    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+    reginfo = netsnmp_handler_registration_create("pgsqlPgAggregateTable", handler,
+                                                  pgsqlPgAggregateTable_oid,
+                                                  pgsqlPgAggregateTable_oid_size,
+                                                  HANDLER_CAN_BABY_STEP |
+                                                  HANDLER_CAN_RONLY
+                                                  );
+    if(NULL == reginfo) {
+        snmp_log(LOG_ERR,"error registering table pgsqlPgAggregateTable\n");
+        return;
+    }
+    reginfo->my_reg_void = &pgsqlPgAggregateTable_if_ctx;
+
+    /*************************************************
+     *
+     * set up baby steps handler, create it and inject it
+     */
+    if( access_multiplexer->object_lookup )
+        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+    if( access_multiplexer->set_values )
+        mfd_modes |= BABY_STEP_SET_VALUES;
+    if( access_multiplexer->irreversible_commit )
+        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+    if( access_multiplexer->object_syntax_checks )
+        mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+    if( access_multiplexer->pre_request )
+        mfd_modes |= BABY_STEP_PRE_REQUEST;
+    if( access_multiplexer->post_request )
+        mfd_modes |= BABY_STEP_POST_REQUEST;
+    
+    if( access_multiplexer->undo_setup )
+        mfd_modes |= BABY_STEP_UNDO_SETUP;
+    if( access_multiplexer->undo_cleanup )
+        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+    if( access_multiplexer->undo_sets )
+        mfd_modes |= BABY_STEP_UNDO_SETS;
+    
+    if( access_multiplexer->row_creation )
+        mfd_modes |= BABY_STEP_ROW_CREATE;
+    if( access_multiplexer->consistency_checks )
+        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+    if( access_multiplexer->commit )
+        mfd_modes |= BABY_STEP_COMMIT;
+    if( access_multiplexer->undo_commit )
+        mfd_modes |= BABY_STEP_UNDO_COMMIT;
+    
+    handler = netsnmp_baby_steps_handler_get(mfd_modes);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+     */
+    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject container_table helper
+     */
+    handler =
+        netsnmp_container_table_handler_get(tbl_info,
+                                            pgsqlPgAggregateTable_if_ctx.container,
+                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+    netsnmp_inject_handler( reginfo, handler );
+
+    /*************************************************
+     *
+     * inject cache helper
+     */
+    if(NULL != pgsqlPgAggregateTable_if_ctx.cache) {
+        handler = netsnmp_cache_handler_get(pgsqlPgAggregateTable_if_ctx.cache);
+        netsnmp_inject_handler( reginfo, handler );
+    }
+
+    /*
+     * register table
+     */
+    netsnmp_register_table(reginfo, tbl_info);
+} /* _pgsqlPgAggregateTable_initialize_interface */
+
+void
+pgsqlPgAggregateTable_valid_columns_set(netsnmp_column_info *vc)
+{
+    pgsqlPgAggregateTable_if_ctx.tbl_info.valid_columns = vc;
+} /* pgsqlPgAggregateTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+pgsqlPgAggregateTable_index_to_oid(netsnmp_index *oid_idx,
+                         pgsqlPgAggregateTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_pgsnmpdConnID;
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+    /*
+     * pgsqlPgAggregateEntryOID(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+     */
+    netsnmp_variable_list var_pgsqlPgAggregateEntryOID;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_pgsnmpdConnID, 0x00, sizeof(var_pgsnmpdConnID) );
+    var_pgsnmpdConnID.type = ASN_OCTET_STR;
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+    memset( &var_pgsqlPgAggregateEntryOID, 0x00, sizeof(var_pgsqlPgAggregateEntryOID) );
+    var_pgsqlPgAggregateEntryOID.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_pgsnmpdConnID.next_variable =  &var_rdbmsDbIndex; var_rdbmsDbIndex.next_variable =  &var_pgsqlPgAggregateEntryOID; var_pgsqlPgAggregateEntryOID.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_index_to_oid","called\n"));
+
+        /* pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+    snmp_set_var_value(&var_pgsnmpdConnID, (u_char*)&mib_idx->pgsnmpdConnID,
+                       mib_idx->pgsnmpdConnID_len * sizeof(mib_idx->pgsnmpdConnID[0]));
+
+        /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_rdbmsDbIndex, (u_char*)&mib_idx->rdbmsDbIndex,
+                       sizeof(mib_idx->rdbmsDbIndex));
+
+        /* pgsqlPgAggregateEntryOID(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+    snmp_set_var_value(&var_pgsqlPgAggregateEntryOID, (u_char*)&mib_idx->pgsqlPgAggregateEntryOID,
+                       sizeof(mib_idx->pgsqlPgAggregateEntryOID));
+
+
+    err = build_oid_noalloc(oid_idx->oids, oid_idx->len, (size_t *)&oid_idx->len,
+                           NULL, 0, &var_pgsnmpdConnID);
+    if(err)
+        snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_pgsnmpdConnID );
+
+    return err;
+} /* pgsqlPgAggregateTable_index_to_oid */
+
+/**
+ * extract pgsqlPgAggregateTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR  : no error
+ * @retval SNMP_ERR_GENERR   : error
+ */
+int
+pgsqlPgAggregateTable_index_from_oid(netsnmp_index *oid_idx,
+                         pgsqlPgAggregateTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_pgsnmpdConnID;
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+    /*
+     * pgsqlPgAggregateEntryOID(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+     */
+    netsnmp_variable_list var_pgsqlPgAggregateEntryOID;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_pgsnmpdConnID, 0x00, sizeof(var_pgsnmpdConnID) );
+    var_pgsnmpdConnID.type = ASN_OCTET_STR;
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+    memset( &var_pgsqlPgAggregateEntryOID, 0x00, sizeof(var_pgsqlPgAggregateEntryOID) );
+    var_pgsqlPgAggregateEntryOID.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_pgsnmpdConnID.next_variable =  &var_rdbmsDbIndex; var_rdbmsDbIndex.next_variable =  &var_pgsqlPgAggregateEntryOID; var_pgsqlPgAggregateEntryOID.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAggregateTable:pgsqlPgAggregateTable_index_from_oid","called\n"));
+
+    /*
+     * parse the oid into the individual index components
+     */
+    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+                             &var_pgsnmpdConnID );
+    if (err == SNMP_ERR_NOERROR) {
+        /*
+         * copy out values
+         */
+    /*
+     * NOTE: val_len is in bytes, pgsnmpdConnID_len might not be
+     */
+         if(var_pgsnmpdConnID.val_len > sizeof(mib_idx->pgsnmpdConnID))
+             err = SNMP_ERR_GENERR;
+         else {
+             memcpy(mib_idx->pgsnmpdConnID, var_pgsnmpdConnID.val.string, var_pgsnmpdConnID.val_len);
+             mib_idx->pgsnmpdConnID_len = var_pgsnmpdConnID.val_len / sizeof(mib_idx->pgsnmpdConnID[0]);
+         }
+    mib_idx->rdbmsDbIndex = *((long *)var_rdbmsDbIndex.val.string);
+    mib_idx->pgsqlPgAggregateEntryOID = *((long *)var_pgsqlPgAggregateEntryOID.val.string);
+
+
+    }
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_pgsnmpdConnID );
+
+    return err;
+} /* pgsqlPgAggregateTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a pgsqlPgAggregateTable_rowreq_ctx
+ */
+pgsqlPgAggregateTable_rowreq_ctx *
+pgsqlPgAggregateTable_allocate_rowreq_ctx(void)
+{
+    pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx =
+                  SNMP_MALLOC_TYPEDEF(pgsqlPgAggregateTable_rowreq_ctx);
+
+    DEBUGMSGTL(("internal:pgsqlPgAggregateTable:pgsqlPgAggregateTable_allocate_rowreq_ctx","called\n"));
+
+    if(NULL == rowreq_ctx) {
+        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+                 "pgsqlPgAggregateTable_rowreq_ctx.\n");
+    }
+
+    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+    rowreq_ctx->pgsqlPgAggregateTable_data_list = NULL;
+    rowreq_ctx->pgsqlPgAggregateTable_reg = pgsqlPgAggregateTable_if_ctx.user_ctx;
+
+
+    return rowreq_ctx;
+} /* pgsqlPgAggregateTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a pgsqlPgAggregateTable_rowreq_ctx
+ */
+void
+pgsqlPgAggregateTable_release_rowreq_ctx(pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("internal:pgsqlPgAggregateTable:pgsqlPgAggregateTable_release_rowreq_ctx","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+
+    /*
+     * free index oid pointer
+     */
+    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+        free(rowreq_ctx->oid_idx.oids);
+
+    SNMP_FREE(rowreq_ctx);
+} /* pgsqlPgAggregateTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_pgsqlPgAggregateTable_pre_request(netsnmp_mib_handler *handler,
+                            netsnmp_handler_registration *reginfo,
+                            netsnmp_agent_request_info *agtreq_info,
+                            netsnmp_request_info *requests)
+{
+    int rc = pgsqlPgAggregateTable_pre_request(pgsqlPgAggregateTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:pgsqlPgAggregateTable","error %d from "
+                    "pgsqlPgAggregateTable_pre_request\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsqlPgAggregateTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_pgsqlPgAggregateTable_post_request(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx;
+    int rc = pgsqlPgAggregateTable_post_request(pgsqlPgAggregateTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:pgsqlPgAggregateTable","error %d from "
+                    "pgsqlPgAggregateTable_post_request\n", rc));
+    }
+    
+    /*
+     * if there are no errors, check for and handle row creation/deletion
+     */
+    rc = netsnmp_check_requests_error(requests);
+    if ((SNMP_ERR_NOERROR == rc) &&
+        (NULL !=
+         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
+        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+            CONTAINER_INSERT(pgsqlPgAggregateTable_if_ctx.container, rowreq_ctx);
+        }
+        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+            CONTAINER_REMOVE(pgsqlPgAggregateTable_if_ctx.container, rowreq_ctx);
+            pgsqlPgAggregateTable_release_rowreq_ctx(rowreq_ctx);
+        }
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsqlPgAggregateTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_pgsqlPgAggregateTable_object_lookup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    
+    DEBUGMSGTL(("internal:pgsqlPgAggregateTable:_mfd_pgsqlPgAggregateTable_object_lookup","called\n"));
+
+    /*
+     * get our context from mfd
+     * pgsqlPgAggregateTable_interface_ctx *if_ctx =
+     *             (pgsqlPgAggregateTable_interface_ctx *)reginfo->my_reg_void;
+     */
+
+    if(NULL == rowreq_ctx) {
+        netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
+    }
+    else {
+        pgsqlPgAggregateTable_row_prep(rowreq_ctx);
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsqlPgAggregateTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_pgsqlPgAggregateTable_get_column( pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:pgsqlPgAggregateTable:_mfd_pgsqlPgAggregateTable_get_column","called\n"));
+
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* pgsqlPgAggregateAggfnoid(2)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAGGREGATEAGGFNOID:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAggregateAggfnoid_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAggregateAggtransfn(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAGGREGATEAGGTRANSFN:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAggregateAggtransfn_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAggregateAggfinalfn(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAGGREGATEAGGFINALFN:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAggregateAggfinalfn_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAggregateAggsortop(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAGGREGATEAGGSORTOP:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAggregateAggsortop_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAggregateAggtranstype(6)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAGGREGATEAGGTRANSTYPE:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAggregateAggtranstype_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAggregateAgginitval(7)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+    case COLUMN_PGSQLPGAGGREGATEAGGINITVAL:
+    var->type = ASN_OCTET_STR;
+rc = pgsqlPgAggregateAgginitval_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _pgsqlPgAggregateTable_get_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _pgsqlPgAggregateTable_get_column */
+
+int
+_mfd_pgsqlPgAggregateTable_get_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    u_char                     * old_string;
+    void                      (*dataFreeHook)(void *);
+    int                        rc;
+
+    DEBUGMSGTL(("internal:pgsqlPgAggregateTable:_mfd_pgsqlPgAggregateTable_get_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * save old pointer, so we can free it if replaced
+         */
+        old_string = requests->requestvb->val.string;
+        dataFreeHook = requests->requestvb->dataFreeHook;
+        if(NULL == requests->requestvb->val.string) {
+            requests->requestvb->val.string = requests->requestvb->buf;
+            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+        else if(requests->requestvb->buf == requests->requestvb->val.string) {
+            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+
+        /*
+         * get column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _pgsqlPgAggregateTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            if(MFD_SKIP == rc) {
+                requests->requestvb->type = ASN_PRIV_RETRY;
+                rc = SNMP_ERR_NOERROR;
+            }
+        }
+        else if (NULL == requests->requestvb->val.string) {
+            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+            rc = SNMP_ERR_GENERR;
+        }
+        if(rc)
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+        /*
+         * if the buffer wasn't used previously for the old data (i.e. it
+         * was allcoated memory)  and the get routine replaced the pointer,
+         * we need to free the previous pointer.
+         */
+        if(old_string && (old_string != requests->requestvb->buf) &&
+           (requests->requestvb->val.string != old_string)) {
+            if(dataFreeHook)
+                (*dataFreeHook)(old_string);
+            else
+                free(old_string);
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsqlPgAggregateTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+    DEBUGMSGTL(("internal:pgsqlPgAggregateTable:_cache_load","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache for pgsqlPgAggregateTable_cache_load\n");
+        return -1;
+    }
+
+    /** should only be called for an invalid or expired cache */
+    netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+    
+    /*
+     * call user code
+     */
+    return pgsqlPgAggregateTable_cache_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_item_free(pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+    DEBUGMSGTL(("internal:pgsqlPgAggregateTable:_cache_item_free","called\n"));
+
+    if(NULL == rowreq_ctx)
+        return;
+
+    pgsqlPgAggregateTable_release_rowreq_ctx(rowreq_ctx);
+} /* _cache_item_free */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+    netsnmp_container *container;
+
+    DEBUGMSGTL(("internal:pgsqlPgAggregateTable:_cache_free","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache in pgsqlPgAggregateTable_cache_free\n");
+        return;
+    }
+
+    container = (netsnmp_container*)cache->magic;
+
+    /*
+     * call user code
+     */
+    pgsqlPgAggregateTable_cache_free(container);
+    
+    /*
+     * free all items. inefficient, but easy.
+     */
+    CONTAINER_CLEAR(container,
+                    (netsnmp_container_obj_func *)_cache_item_free,
+                    NULL);
+} /* _cache_free */
+
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_pgsqlPgAggregateTable_container_init(pgsqlPgAggregateTable_interface_ctx *if_ctx)
+{
+    DEBUGMSGTL(("internal:pgsqlPgAggregateTable:_pgsqlPgAggregateTable_container_init","called\n"));
+    
+    /*
+     * set up the cache
+     */
+    if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+                                         _cache_load, _cache_free,
+                                         pgsqlPgAggregateTable_oid,
+                                         pgsqlPgAggregateTable_oid_size);
+
+    if(NULL == if_ctx->cache) {
+        snmp_log(LOG_ERR, "error creating cache for pgsqlPgAggregateTable\n");
+        return;
+    }
+
+    if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+    pgsqlPgAggregateTable_container_init(&if_ctx->container, if_ctx->cache);
+    if(NULL == if_ctx->container)
+        if_ctx->container = netsnmp_container_find("pgsqlPgAggregateTable:table_container");
+    if(NULL == if_ctx->container) {
+        snmp_log(LOG_ERR,"error creating container in "
+                 "pgsqlPgAggregateTable_container_init\n");
+        return;
+    }
+    if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _pgsqlPgAggregateTable_container_init */
+
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_interface.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_interface.h
new file mode 100644 (file)
index 0000000..94a4e9a
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.43.2.3 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: pgsqlPgAggregateTable_interface.h,v 1.1 2008/01/17 11:49:24 eggyknap Exp $
+ */
+/** @defgroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ *          or used to interpret functionality. It is subject to
+ *          change at any time.
+ * 
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * ***                                                               ***
+ * ***  NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE  ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE.      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***    IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES.   ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef PGSQLPGAGGREGATETABLE_INTERFACE_H
+#define PGSQLPGAGGREGATETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "pgsqlPgAggregateTable.h"
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _pgsqlPgAggregateTable_initialize_interface(pgsqlPgAggregateTable_registration_ptr user_ctx,
+                                    u_long flags);
+
+    pgsqlPgAggregateTable_rowreq_ctx * pgsqlPgAggregateTable_allocate_rowreq_ctx(void);
+void pgsqlPgAggregateTable_release_rowreq_ctx(pgsqlPgAggregateTable_rowreq_ctx *rowreq_ctx);
+
+int pgsqlPgAggregateTable_index_to_oid(netsnmp_index *oid_idx,
+                            pgsqlPgAggregateTable_mib_index *mib_idx);
+int pgsqlPgAggregateTable_index_from_oid(netsnmp_index *oid_idx,
+                              pgsqlPgAggregateTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void pgsqlPgAggregateTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAGGREGATETABLE_INTERFACE_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_oids.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable_oids.h
new file mode 100644 (file)
index 0000000..bb5a69d
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : generic-table-oids.m2c,v 1.10 2004/10/08 23:39:17 rstory Exp $
+ *
+ * $Id: pgsqlPgAggregateTable_oids.h,v 1.1 2008/01/17 11:49:24 eggyknap Exp $
+ */
+#ifndef PGSQLPGAGGREGATETABLE_OIDS_H
+#define PGSQLPGAGGREGATETABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table pgsqlPgAggregateTable */
+#define PGSQLPGAGGREGATETABLE_OID              1,3,6,1,4,1,27645,1,2,1
+#define COLUMN_PGSQLPGAGGREGATEENTRYOID                1
+#define COLUMN_PGSQLPGAGGREGATEAGGFNOID                2
+#define COLUMN_PGSQLPGAGGREGATEAGGTRANSFN              3
+#define COLUMN_PGSQLPGAGGREGATEAGGFINALFN              4
+#define COLUMN_PGSQLPGAGGREGATEAGGSORTOP               5
+#define COLUMN_PGSQLPGAGGREGATEAGGTRANSTYPE            6
+#define COLUMN_PGSQLPGAGGREGATEAGGINITVAL              7
+
+#define PGSQLPGAGGREGATETABLE_MIN_COL          COLUMN_PGSQLPGAGGREGATEAGGFNOID
+#define PGSQLPGAGGREGATETABLE_MAX_COL          COLUMN_PGSQLPGAGGREGATEAGGINITVAL
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAGGREGATETABLE_OIDS_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable.c
new file mode 100644 (file)
index 0000000..d8d6304
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.32.2.3 $ of : mfd-top.m2c,v $ 
+ *
+ * $Id: pgsqlPgAmTable.c,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ */
+/** \mainpage MFD helper for pgsqlPgAmTable
+ *
+ * \section intro Introduction
+ * Introductory text.
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsqlPgAmTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "pgsqlPgAmTable_interface.h"
+
+oid pgsqlPgAmTable_oid[] = { PGSQLPGAMTABLE_OID };
+int pgsqlPgAmTable_oid_size = OID_LENGTH(pgsqlPgAmTable_oid);
+
+void initialize_table_pgsqlPgAmTable(void);
+
+
+/**
+ * Initializes the pgsqlPgAmTable module
+ */
+void
+init_pgsqlPgAmTable(void)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:init_pgsqlPgAmTable","called\n"));
+
+    /*
+     * TODO:300:o: Perform pgsqlPgAmTable one-time module initialization.
+     */
+     
+    /*
+     * here we initialize all the tables we're planning on supporting
+     */
+    if (should_init("pgsqlPgAmTable"))
+        initialize_table_pgsqlPgAmTable();
+
+} /* init_pgsqlPgAmTable */
+
+/**
+ * Initialize the table pgsqlPgAmTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+initialize_table_pgsqlPgAmTable(void)
+{
+    pgsqlPgAmTable_registration_ptr user_context;
+    u_long flags;
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:initialize_table_pgsqlPgAmTable","called\n"));
+
+    /*
+     * TODO:301:o: Perform pgsqlPgAmTable one-time table initialization.
+     */
+
+    /*
+     * TODO:302:o: |->Initialize pgsqlPgAmTable user context
+     * if you'd like to pass in a pointer to some data for this
+     * table, allocate or set it up here.
+     */
+    /*
+     * a netsnmp_data_list is a simple way to store void pointers. A simple
+     * string token is used to add, find or remove pointers.
+     */
+    user_context = netsnmp_create_data_list("pgsqlPgAmTable", NULL, NULL);
+    
+    /*
+     * No support for any flags yet, but in the future you would
+     * set any flags here.
+     */
+    flags = 0;
+    
+    /*
+     * call interface initialization code
+     */
+    _pgsqlPgAmTable_initialize_interface(user_context, flags);
+} /* initialize_table_pgsqlPgAmTable */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_ERROR                : other error
+ */
+int
+pgsqlPgAmTable_pre_request(pgsqlPgAmTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_pre_request","called\n"));
+
+    /*
+     * TODO:510:o: Perform pgsqlPgAmTable pre-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : other error (ignored)
+ */
+int
+pgsqlPgAmTable_post_request(pgsqlPgAmTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_post_request","called\n"));
+
+    /*
+     * TODO:511:o: Perform pgsqlPgAmTable pos-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmTable_post_request */
+
+
+/** @{ */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable.h
new file mode 100644 (file)
index 0000000..a6e5f01
--- /dev/null
@@ -0,0 +1,306 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.32.2.3 $ of : mfd-top.m2c,v $
+ *
+ * $Id: pgsqlPgAmTable.h,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ */
+#ifndef PGSQLPGAMTABLE_H
+#define PGSQLPGAMTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @defgroup misc misc: Miscelaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+    /* *INDENT-OFF*  */
+config_require(PGSQL-MIB/pgsqlPgAmTable/pgsqlPgAmTable_interface);
+config_require(PGSQL-MIB/pgsqlPgAmTable/pgsqlPgAmTable_data_access);
+config_require(PGSQL-MIB/pgsqlPgAmTable/pgsqlPgAmTable_data_get);
+config_require(PGSQL-MIB/pgsqlPgAmTable/pgsqlPgAmTable_data_set);
+    /* *INDENT-ON*  */
+
+/* OID and column number definitions for  */
+#include "pgsqlPgAmTable_oids.h"
+
+/* enum definions */
+#include "pgsqlPgAmTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_pgsqlPgAmTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAmTable is subid 2 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.2, length: 10
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+    /*
+     * TODO:101:o: |-> Review pgsqlPgAmTable registration context.
+     */
+typedef netsnmp_data_list * pgsqlPgAmTable_registration_ptr;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review pgsqlPgAmTable data context structure.
+ * This structure is used to represent the data for pgsqlPgAmTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * pgsqlPgAmTable.
+ */
+typedef struct pgsqlPgAmTable_data_s {
+    
+        /*
+         * pgsqlPgAmAmname(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+         */
+   char   pgsqlPgAmAmname[255];
+size_t      pgsqlPgAmAmname_len; /* # of char elements, not bytes */
+    
+        /*
+         * pgsqlPgAmAmstrategies(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmstrategies;
+    
+        /*
+         * pgsqlPgAmAmsupport(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmsupport;
+    
+        /*
+         * pgsqlPgAmAmorderstrategy(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmorderstrategy;
+    
+        /*
+         * pgsqlPgAmAmcanunique(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+         */
+   u_long   pgsqlPgAmAmcanunique;
+    
+        /*
+         * pgsqlPgAmAmcanmulticol(7)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+         */
+   u_long   pgsqlPgAmAmcanmulticol;
+    
+        /*
+         * pgsqlPgAmAmoptionalkey(8)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+         */
+   u_long   pgsqlPgAmAmoptionalkey;
+    
+        /*
+         * pgsqlPgAmAmindexnulls(9)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+         */
+   u_long   pgsqlPgAmAmindexnulls;
+    
+        /*
+         * pgsqlPgAmAmstorage(10)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+         */
+   u_long   pgsqlPgAmAmstorage;
+    
+        /*
+         * pgsqlPgAmAmclusterable(11)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+         */
+   u_long   pgsqlPgAmAmclusterable;
+    
+        /*
+         * pgsqlPgAmAminsert(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAminsert;
+    
+        /*
+         * pgsqlPgAmAmbeginscan(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmbeginscan;
+    
+        /*
+         * pgsqlPgAmAmgettuple(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmgettuple;
+    
+        /*
+         * pgsqlPgAmAmgetmulti(15)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmgetmulti;
+    
+        /*
+         * pgsqlPgAmAmrescan(16)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmrescan;
+    
+        /*
+         * pgsqlPgAmAmendscan(17)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmendscan;
+    
+        /*
+         * pgsqlPgAmAmmarkpos(18)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmmarkpos;
+    
+        /*
+         * pgsqlPgAmAmrestrpos(19)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmrestrpos;
+    
+        /*
+         * pgsqlPgAmAmbuild(20)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmbuild;
+    
+        /*
+         * pgsqlPgAmAmbulkdelete(21)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmbulkdelete;
+    
+        /*
+         * pgsqlPgAmAmvacuumcleanup(22)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmvacuumcleanup;
+    
+        /*
+         * pgsqlPgAmAmcostestimate(23)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmcostestimate;
+    
+        /*
+         * pgsqlPgAmAmoptions(24)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h
+         */
+   long   pgsqlPgAmAmoptions;
+    
+} pgsqlPgAmTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review pgsqlPgAmTable mib index.
+ * This structure is used to represent the index for pgsqlPgAmTable.
+ */
+typedef struct pgsqlPgAmTable_mib_index_s {
+
+        /*
+         * pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+         */
+        /** 128 - 2(other indexes) - oid length(12) = 113 */
+   char   pgsnmpdConnID[113];
+   size_t      pgsnmpdConnID_len;
+
+        /*
+         * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   rdbmsDbIndex;
+
+        /*
+         * pgsqlPgAmEntryOID(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+         */
+   long   pgsqlPgAmEntryOID;
+
+
+} pgsqlPgAmTable_mib_index;
+
+    /*
+     * TODO:121:r: |   |-> Review pgsqlPgAmTable max index length.
+     * If you KNOW that your indexes will never exceed a certain
+     * length, update this macro to that length.
+     *
+     * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+     * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+     * Guessing 128 - col/entry(2)  - oid len(10)
+*/
+#define MAX_pgsqlPgAmTable_IDX_LEN     116
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review pgsqlPgAmTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * pgsqlPgAmTable_rowreq_ctx pointer.
+ */
+typedef struct pgsqlPgAmTable_rowreq_ctx_s {
+
+    /** this must be first for container compare to work */
+    netsnmp_index        oid_idx;
+    oid                  oid_tmp[MAX_pgsqlPgAmTable_IDX_LEN];
+    
+    pgsqlPgAmTable_mib_index        tbl_idx;
+    
+    pgsqlPgAmTable_data              data;
+
+    /*
+     * flags per row. Currently, the first (lower) 8 bits are reserved
+     * for the user. See mfd.h for other flags.
+     */
+    u_int                       rowreq_flags;
+
+    /*
+     * implementor's context pointer (provided during registration)
+     */
+    pgsqlPgAmTable_registration_ptr pgsqlPgAmTable_reg;
+
+    /*
+     * TODO:131:o: |   |-> Add useful data to pgsqlPgAmTable rowreq context.
+     */
+    
+    /*
+     * storage for future expansion
+     */
+    netsnmp_data_list             *pgsqlPgAmTable_data_list;
+
+} pgsqlPgAmTable_rowreq_ctx;
+
+typedef struct pgsqlPgAmTable_ref_rowreq_ctx_s {
+    pgsqlPgAmTable_rowreq_ctx *rowreq_ctx;
+} pgsqlPgAmTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+    int pgsqlPgAmTable_pre_request(pgsqlPgAmTable_registration_ptr user_context);
+    int pgsqlPgAmTable_post_request(pgsqlPgAmTable_registration_ptr user_context);
+
+
+extern oid pgsqlPgAmTable_oid[];
+extern int pgsqlPgAmTable_oid_size;
+
+
+#include "pgsqlPgAmTable_interface.h"
+#include "pgsqlPgAmTable_data_access.h"
+#include "pgsqlPgAmTable_data_get.h"
+#include "pgsqlPgAmTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAMTABLE_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_access.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_access.c
new file mode 100644 (file)
index 0000000..0d910c4
--- /dev/null
@@ -0,0 +1,312 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.12 $ of : mfd-data-access.m2c,v $ 
+ *
+ * $Id: pgsqlPgAmTable_data_access.c,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ */
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "pgsqlPgAmTable.h"
+#include "pgsqlPgAmTable_data_access.h"
+
+/** @defgroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ * 
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAmTable is subid 2 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.2, length: 10
+*/
+
+/**
+ * initialization for pgsqlPgAmTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param pgsqlPgAmTable_reg
+ *        Pointer to pgsqlPgAmTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : unrecoverable error.
+ */
+int
+pgsqlPgAmTable_init_data(pgsqlPgAmTable_registration_ptr pgsqlPgAmTable_reg)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_init_data","called\n"));
+
+    /*
+     * TODO:303:o: Initialize pgsqlPgAmTable data.
+     */
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmTable_init_data */
+
+/**
+ * container-cached overview
+ *
+ */
+
+/***********************************************************************
+ *
+ * cache
+ *
+ ***********************************************************************/
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ *        create a custom container, use this parameter to return it
+ *        to the MFD helper. If set to NULL, the MFD helper will
+ *        allocate a container for you.
+ * @param  cache A pointer to a cache structure. You can set the timeout
+ *         and other cache flags using this pointer.
+ *
+ *  This function is called at startup to allow you to customize certain
+ *  aspects of the access method. For the most part, it is for advanced
+ *  users. The default code should suffice for most cases. If no custom
+ *  container is allocated, the MFD code will create one for your.
+ *
+ *  This is also the place to set up cache behavior. The default, to
+ *  simply set the cache timeout, will work well with the default
+ *  container. If you are using a custom container, you may want to
+ *  look at the cache helper documentation to see if there are any
+ *  flags you want to set.
+ *
+ * @remark
+ *  This would also be a good place to do any initialization needed
+ *  for you data source. For example, opening a connection to another
+ *  process that will supply the data, opening a database, etc.
+ */
+void
+pgsqlPgAmTable_container_init(netsnmp_container **container_ptr_ptr,
+                        netsnmp_cache *cache)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_container_init","called\n"));
+    
+    if((NULL == cache) || (NULL == container_ptr_ptr)) {
+        snmp_log(LOG_ERR,"bad params to pgsqlPgAmTable_container_init\n");
+        return;
+    }
+
+    /*
+     * For advanced users, you can use a custom container. If you
+     * do not create one, one will be created for you.
+     */
+    *container_ptr_ptr = NULL;
+
+    /*
+     * TODO:345:A: Set up pgsqlPgAmTable cache properties.
+     *
+     * Also for advanced users, you can set parameters for the
+     * cache. Do not change the magic pointer, as it is used
+     * by the MFD helper. To completely disable caching, set
+     * cache->enabled to 0.
+     */
+    cache->timeout = PGSQLPGAMTABLE_CACHE_TIMEOUT; /* seconds */
+} /* pgsqlPgAmTable_container_init */
+
+/**
+ * load cache data
+ *
+ * TODO:350:M: Implement pgsqlPgAmTable cache load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR                : other error.
+ *
+ *  This function is called to cache the index(es) (and data, optionally)
+ *  for the every row in the data set.
+ *
+ * @remark
+ *  While loading the cache, the only important thing is the indexes.
+ *  If access to your data is cheap/fast (e.g. you have a pointer to a
+ *  structure in memory), it would make sense to update the data here.
+ *  If, however, the accessing the data invovles more work (e.g. parsing
+ *  some other existing data, or peforming calculations to derive the data),
+ *  then you can limit yourself to setting the indexes and saving any
+ *  information you will need later. Then use the saved information in
+ *  pgsqlPgAmTable_row_prep() for populating data.
+ *
+ * @note
+ *  If you need consistency between rows (like you want statistics
+ *  for each row to be from the same time frame), you should set all
+ *  data here.
+ *
+ */
+int
+pgsqlPgAmTable_cache_load(netsnmp_container *container)
+{
+    pgsqlPgAmTable_rowreq_ctx *rowreq_ctx;
+    size_t                 count = 0;
+
+   int i, resultCount, tmpInt;
+   char *tmpString;
+   PGresult *pg_db_qry;
+
+   char   pgsnmpdConnID[112] = "Default conn ID";
+   size_t      pgsnmpdConnID_len = strlen(pgsnmpdConnID);
+   long   rdbmsDbIndex = 1;
+   long   pgsqlPgAmEntryOID;
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_cache_load","called\n"));
+    snmp_log(LOG_INFO, "Running pgsqlPgAmTable\n");
+
+    if (PQstatus(dbconn) == CONNECTION_OK)
+       pg_db_qry = PQexec(dbconn, "SELECT oid, amname, amstrategies, amsupport, amorderstrategy, CASE WHEN amcanunique THEN 1 ELSE 2 END, CASE WHEN amcanmulticol THEN 1 ELSE 2 END, CASE WHEN amoptionalkey THEN 1 ELSE 2 END, CASE WHEN amindexnulls THEN 1 ELSE 2 END, CASE WHEN amstorage THEN 1 ELSE 2 END, CASE WHEN amclusterable THEN 1 ELSE 2 END, aminsert, ambeginscan, amgettuple, amgetmulti, amrescan, amendscan, ammarkpos, amrestrpos, ambuild, ambulkdelete, amvacuumcleanup, amcostestimate, amoptions  FROM pg_am");
+    else {
+           snmp_log(LOG_ERR, "Can't get connected to database\n");
+           return MFD_RESOURCE_UNAVAILABLE;
+    }
+    if (PQresultStatus(pg_db_qry) != PGRES_TUPLES_OK) {
+           snmp_log(LOG_ERR, "Didn't get any results from the database\n");
+           PQclear(pg_db_qry);
+           return MFD_RESOURCE_UNAVAILABLE;
+    }
+    resultCount = PQntuples(pg_db_qry);
+
+    /*
+     * TODO:351:M: |-> Load/update data in the pgsqlPgAmTable container.
+     * loop over your pgsqlPgAmTable data, allocate a rowreq context,
+     * set the index(es) [and data, optionally] and insert into
+     * the container.
+     */
+    for (i = 0; i < resultCount; i++) {
+        /*
+         * TODO:352:M: |   |-> set indexes in new pgsqlPgAmTable rowreq context.
+         */
+        rowreq_ctx = pgsqlPgAmTable_allocate_rowreq_ctx();
+        if (NULL == rowreq_ctx) {
+            snmp_log(LOG_ERR, "memory allocation failed\n");
+            return MFD_RESOURCE_UNAVAILABLE;
+        }
+        if(MFD_SUCCESS != pgsqlPgAmTable_indexes_set(rowreq_ctx
+                               , pgsnmpdConnID, pgsnmpdConnID_len
+                               , rdbmsDbIndex
+                               , atol(PQgetvalue(pg_db_qry, i, 0))
+               )) {
+            snmp_log(LOG_ERR,"error setting index while loading "
+                     "pgsqlPgAmTable cache.\n");
+            pgsqlPgAmTable_release_rowreq_ctx(rowreq_ctx);
+            continue;
+        }
+       rowreq_ctx->data.pgsqlPgAmAmname_len = 255;
+
+       tmpString = PQgetvalue(pg_db_qry, i, 1);
+       tmpInt = strlen(tmpString);
+       if ((NULL == rowreq_ctx->data.pgsqlPgAmAmname) ||
+               (rowreq_ctx->data.pgsqlPgAmAmname_len < (tmpInt * sizeof(rowreq_ctx->data.pgsqlPgAmAmname[0])))) {
+               snmp_log(LOG_ERR,"not enough space for value\n");
+               return MFD_ERROR;
+       }
+       rowreq_ctx->data.pgsqlPgAmAmname_len = tmpInt * sizeof(rowreq_ctx->data.pgsqlPgAmAmname[0]);
+       memcpy( rowreq_ctx->data.pgsqlPgAmAmname, tmpString, rowreq_ctx->data.pgsqlPgAmAmname_len );
+    
+    rowreq_ctx->data.pgsqlPgAmAmstrategies = strtoul(PQgetvalue(pg_db_qry, i, 2), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmsupport = strtoul(PQgetvalue(pg_db_qry, i, 3), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmorderstrategy = strtoul(PQgetvalue(pg_db_qry, i, 4), NULL, 10);
+
+    /* These are TruthValue columns. 1 = true, 2 = false */
+    rowreq_ctx->data.pgsqlPgAmAmcanunique, strtoul(PQgetvalue(pg_db_qry, i, 5), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmcanmulticol, strtoul(PQgetvalue(pg_db_qry, i, 6), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmoptionalkey, strtoul(PQgetvalue(pg_db_qry, i, 7), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmindexnulls, strtoul(PQgetvalue(pg_db_qry, i, 8), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmstorage, strtoul(PQgetvalue(pg_db_qry, i, 9), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmclusterable, strtoul(PQgetvalue(pg_db_qry, i, 10), NULL, 10);
+    
+    rowreq_ctx->data.pgsqlPgAmAminsert = strtoul(PQgetvalue(pg_db_qry, i, 11), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmbeginscan = strtoul(PQgetvalue(pg_db_qry, i, 12), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmgettuple = strtoul(PQgetvalue(pg_db_qry, i, 13), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmgetmulti = strtoul(PQgetvalue(pg_db_qry, i, 14), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmrescan = strtoul(PQgetvalue(pg_db_qry, i, 15), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmendscan = strtoul(PQgetvalue(pg_db_qry, i, 16), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmmarkpos = strtoul(PQgetvalue(pg_db_qry, i, 17), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmrestrpos = strtoul(PQgetvalue(pg_db_qry, i, 18), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmbuild = strtoul(PQgetvalue(pg_db_qry, i, 19), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmbulkdelete = strtoul(PQgetvalue(pg_db_qry, i, 20), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmvacuumcleanup = strtoul(PQgetvalue(pg_db_qry, i, 21), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmcostestimate = strtoul(PQgetvalue(pg_db_qry, i, 22), NULL, 10);
+    rowreq_ctx->data.pgsqlPgAmAmoptions = strtoul(PQgetvalue(pg_db_qry, i, 23), NULL, 10);
+    
+        /*
+         * insert into table container
+         */
+        CONTAINER_INSERT(container, rowreq_ctx);
+        ++count;
+    }
+
+
+    DEBUGMSGT(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_cache_load",
+               "inserted %d records\n", count));
+    PQclear(pg_db_qry);
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmTable_cache_load */
+
+/**
+ * cache clean up
+ *
+ * @param container container with all current items
+ *
+ *  This optional callback is called prior to all
+ *  item's being removed from the container. If you
+ *  need to do any processing before that, do it here.
+ *
+ * @note
+ *  The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+pgsqlPgAmTable_cache_free(netsnmp_container *container)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_cache_free","called\n"));
+
+    /*
+     * TODO:380:M: Free pgsqlPgAmTable cache.
+     */
+} /* pgsqlPgAmTable_cache_free */
+
+/**
+ * prepare row for processing.
+ *
+ *  When the agent has located the row for a request, this function is
+ *  called to prepare the row for processing. If you fully populated
+ *  the data context during the index setup phase, you may not need to
+ *  do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ */
+int
+pgsqlPgAmTable_row_prep( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_row_prep","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:390:o: Prepare row for request.
+     * If populating row data was delayed, this is the place to
+     * fill in the row for this request.
+     */
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmTable_row_prep */
+
+/** @} */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_access.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_access.h
new file mode 100644 (file)
index 0000000..29987d0
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.12 $ of : mfd-data-access.m2c,v $
+ *
+ * $Id: pgsqlPgAmTable_data_access.h,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ */
+#ifndef PGSQLPGAMTABLE_DATA_ACCESS_H
+#define PGSQLPGAMTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAmTable is subid 2 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.2, length: 10
+*/
+
+
+    int pgsqlPgAmTable_init_data(pgsqlPgAmTable_registration_ptr pgsqlPgAmTable_reg);
+
+
+/*
+ * TODO:180:o: Review pgsqlPgAmTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define PGSQLPGAMTABLE_CACHE_TIMEOUT   60
+
+void pgsqlPgAmTable_container_init(netsnmp_container **container_ptr_ptr,
+                             netsnmp_cache *cache);
+int pgsqlPgAmTable_cache_load(netsnmp_container *container);
+void pgsqlPgAmTable_cache_free(netsnmp_container *container);
+
+    /*
+    ***************************************************
+    ***             START EXAMPLE CODE              ***
+    ***---------------------------------------------***/
+/* *********************************************************************
+ * Since we have no idea how you really access your data, we'll go with
+ * a worst case example: a flat text file.
+ */
+#define MAX_LINE_SIZE 256
+    /*
+    ***---------------------------------------------***
+    ***              END  EXAMPLE CODE              ***
+    ***************************************************/
+    int pgsqlPgAmTable_row_prep( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAMTABLE_DATA_ACCESS_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_get.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_get.c
new file mode 100644 (file)
index 0000000..84d66fb
--- /dev/null
@@ -0,0 +1,2289 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18.2.1 $ of : mfd-data-get.m2c,v $ 
+ *
+ * $Id: pgsqlPgAmTable_data_get.c,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsqlPgAmTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement pgsqlPgAmTable get routines.
+ * TODO:240:M: Implement pgsqlPgAmTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAmTable is subid 2 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.2, length: 10
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement pgsqlPgAmTable data context functions.
+ */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmEntryOID
+ * pgsqlPgAmEntryOID is subid 1 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.1
+ * Description:
+OID of this entry
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE pgsqlPgAmEntryOID IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmEntryOID.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmEntryOID_map(long *mib_pgsqlPgAmEntryOID_val_ptr, long raw_pgsqlPgAmEntryOID_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmEntryOID_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmEntryOID_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmEntryOID mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmEntryOID_val_ptr) = raw_pgsqlPgAmEntryOID_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmEntryOID_map */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This convenience function is useful for setting all the MIB index
+ *  components with a single function call. It is assume that the C values
+ *  have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+pgsqlPgAmTable_indexes_set_tbl_idx(pgsqlPgAmTable_mib_index *tbl_idx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len, long rdbmsDbIndex_val, long pgsqlPgAmEntryOID_val)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_indexes_set_tbl_idx","called\n"));
+
+    /* pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+     tbl_idx->pgsnmpdConnID_len = sizeof(tbl_idx->pgsnmpdConnID);
+    /*
+     * make sure there is enough space for pgsnmpdConnID data
+     */
+    if ((NULL == tbl_idx->pgsnmpdConnID) ||
+        (tbl_idx->pgsnmpdConnID_len < (pgsnmpdConnID_val_ptr_len * sizeof(tbl_idx->pgsnmpdConnID[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+        return MFD_ERROR;
+    }
+    tbl_idx->pgsnmpdConnID_len = pgsnmpdConnID_val_ptr_len * sizeof(tbl_idx->pgsnmpdConnID[0]);
+    memcpy( tbl_idx->pgsnmpdConnID, pgsnmpdConnID_val_ptr, tbl_idx->pgsnmpdConnID_len );
+    
+    /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->rdbmsDbIndex = rdbmsDbIndex_val;
+    
+    /* pgsqlPgAmEntryOID(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+    tbl_idx->pgsqlPgAmEntryOID = pgsqlPgAmEntryOID_val;
+    
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This function sets the mib indexs, then updates the oid indexs
+ *  from the mib index.
+ */
+int
+pgsqlPgAmTable_indexes_set(pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len, long rdbmsDbIndex_val, long pgsqlPgAmEntryOID_val)
+{
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_indexes_set","called\n"));
+
+    if(MFD_SUCCESS != pgsqlPgAmTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+                                   , pgsnmpdConnID_val_ptr, pgsnmpdConnID_val_ptr_len
+                                   , rdbmsDbIndex_val
+                                   , pgsqlPgAmEntryOID_val
+           ))
+        return MFD_ERROR;
+
+    /*
+     * convert mib index to oid index
+     */
+    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+    if(0 != pgsqlPgAmTable_index_to_oid(&rowreq_ctx->oid_idx,
+                                    &rowreq_ctx->tbl_idx)) {
+        return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmname
+ * pgsqlPgAmAmname is subid 2 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.2
+ * Description:
+Name of the access method
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmname.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmname_map(char **mib_pgsqlPgAmAmname_val_ptr_ptr, size_t *mib_pgsqlPgAmAmname_val_ptr_len_ptr, char *raw_pgsqlPgAmAmname_val_ptr, size_t raw_pgsqlPgAmAmname_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_pgsqlPgAmAmname_val_ptr);
+    netsnmp_assert((NULL != mib_pgsqlPgAmAmname_val_ptr_ptr) && (NULL != mib_pgsqlPgAmAmname_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmname_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement pgsqlPgAmAmname non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_pgsqlPgAmAmname_val_ptr_len; /* assume equal */
+    if((NULL == *mib_pgsqlPgAmAmname_val_ptr_ptr) || (*mib_pgsqlPgAmAmname_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_pgsqlPgAmAmname_val_ptr_ptr = realloc( *mib_pgsqlPgAmAmname_val_ptr_ptr, converted_len * sizeof(**mib_pgsqlPgAmAmname_val_ptr_ptr));
+        if(NULL == *mib_pgsqlPgAmAmname_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_pgsqlPgAmAmname_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_pgsqlPgAmAmname_val_ptr_ptr, raw_pgsqlPgAmAmname_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmname_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmname data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmname_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param pgsqlPgAmAmname_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by pgsqlPgAmAmname.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*pgsqlPgAmAmname_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update pgsqlPgAmAmname_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+pgsqlPgAmAmname_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, char **pgsqlPgAmAmname_val_ptr_ptr, size_t *pgsqlPgAmAmname_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != pgsqlPgAmAmname_val_ptr_ptr) && (NULL != *pgsqlPgAmAmname_val_ptr_ptr));
+   netsnmp_assert( NULL != pgsqlPgAmAmname_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmname_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmname data.
+ * set (* pgsqlPgAmAmname_val_ptr_ptr ) and (* pgsqlPgAmAmname_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for pgsqlPgAmAmname data
+     */
+    if ((NULL == (* pgsqlPgAmAmname_val_ptr_ptr )) ||
+        ((* pgsqlPgAmAmname_val_ptr_len_ptr ) < (rowreq_ctx->data.pgsqlPgAmAmname_len * sizeof((* pgsqlPgAmAmname_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for pgsqlPgAmAmname data
+         */
+        (* pgsqlPgAmAmname_val_ptr_ptr ) = malloc(rowreq_ctx->data.pgsqlPgAmAmname_len * sizeof((* pgsqlPgAmAmname_val_ptr_ptr )[0]));
+        if(NULL == (* pgsqlPgAmAmname_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* pgsqlPgAmAmname_val_ptr_len_ptr ) = rowreq_ctx->data.pgsqlPgAmAmname_len * sizeof((* pgsqlPgAmAmname_val_ptr_ptr )[0]);
+    memcpy( (* pgsqlPgAmAmname_val_ptr_ptr ), rowreq_ctx->data.pgsqlPgAmAmname, (* pgsqlPgAmAmname_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmname_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmstrategies
+ * pgsqlPgAmAmstrategies is subid 3 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.3
+ * Description:
+Number of operator strategies for this access method
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmstrategies.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmstrategies_map(long *mib_pgsqlPgAmAmstrategies_val_ptr, long raw_pgsqlPgAmAmstrategies_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmstrategies_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmstrategies_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmstrategies mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmstrategies_val_ptr) = raw_pgsqlPgAmAmstrategies_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmstrategies_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmstrategies data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmstrategies_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmstrategies_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmstrategies_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmstrategies_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmstrategies_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmstrategies data.
+ * set (* pgsqlPgAmAmstrategies_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmstrategies_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmstrategies;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmstrategies_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmsupport
+ * pgsqlPgAmAmsupport is subid 4 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.4
+ * Description:
+Number of support routines for this access method
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmsupport.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmsupport_map(long *mib_pgsqlPgAmAmsupport_val_ptr, long raw_pgsqlPgAmAmsupport_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmsupport_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmsupport_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmsupport mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmsupport_val_ptr) = raw_pgsqlPgAmAmsupport_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmsupport_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmsupport data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmsupport_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmsupport_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmsupport_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmsupport_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmsupport_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmsupport data.
+ * set (* pgsqlPgAmAmsupport_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmsupport_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmsupport;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmsupport_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmorderstrategy
+ * pgsqlPgAmAmorderstrategy is subid 5 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.5
+ * Description:
+Zero if the index offers no sort order, otherwise the strategy number of the strategy operator that describes the sort order
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmorderstrategy.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmorderstrategy_map(long *mib_pgsqlPgAmAmorderstrategy_val_ptr, long raw_pgsqlPgAmAmorderstrategy_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmorderstrategy_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmorderstrategy_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmorderstrategy mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmorderstrategy_val_ptr) = raw_pgsqlPgAmAmorderstrategy_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmorderstrategy_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmorderstrategy data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmorderstrategy_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmorderstrategy_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmorderstrategy_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmorderstrategy_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmorderstrategy_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmorderstrategy data.
+ * set (* pgsqlPgAmAmorderstrategy_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmorderstrategy_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmorderstrategy;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmorderstrategy_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmcanunique
+ * pgsqlPgAmAmcanunique is subid 6 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.6
+ * Description:
+Does the access method support unique indexes?
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  1      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ * Enum range: 2/8. Values:  true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmcanunique.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmcanunique_map(u_long *mib_pgsqlPgAmAmcanunique_val_ptr, u_long raw_pgsqlPgAmAmcanunique_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmcanunique_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmcanunique_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmcanunique enum mapping.
+     * uses INTERNAL_* macros defined in the header files
+     */
+    switch(raw_pgsqlPgAmAmcanunique_val) {
+        case INTERNAL_PGSQLPGAMAMCANUNIQUE_TRUE:
+             *mib_pgsqlPgAmAmcanunique_val_ptr = TRUTHVALUE_TRUE;
+             break;
+
+        case INTERNAL_PGSQLPGAMAMCANUNIQUE_FALSE:
+             *mib_pgsqlPgAmAmcanunique_val_ptr = TRUTHVALUE_FALSE;
+             break;
+
+             default:
+                 snmp_log(LOG_ERR, "couldn't map value %ld for pgsqlPgAmAmcanunique\n", raw_pgsqlPgAmAmcanunique_val );
+                 return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmcanunique_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmcanunique data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmcanunique_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmcanunique_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmcanunique_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmcanunique_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmcanunique_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmcanunique data.
+ * set (* pgsqlPgAmAmcanunique_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmcanunique_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmcanunique;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmcanunique_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmcanmulticol
+ * pgsqlPgAmAmcanmulticol is subid 7 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.7
+ * Description:
+Does the access method support multicolumn indexes?
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  1      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ * Enum range: 2/8. Values:  true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmcanmulticol.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmcanmulticol_map(u_long *mib_pgsqlPgAmAmcanmulticol_val_ptr, u_long raw_pgsqlPgAmAmcanmulticol_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmcanmulticol_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmcanmulticol_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmcanmulticol enum mapping.
+     * uses INTERNAL_* macros defined in the header files
+     */
+    switch(raw_pgsqlPgAmAmcanmulticol_val) {
+        case INTERNAL_PGSQLPGAMAMCANMULTICOL_TRUE:
+             *mib_pgsqlPgAmAmcanmulticol_val_ptr = TRUTHVALUE_TRUE;
+             break;
+
+        case INTERNAL_PGSQLPGAMAMCANMULTICOL_FALSE:
+             *mib_pgsqlPgAmAmcanmulticol_val_ptr = TRUTHVALUE_FALSE;
+             break;
+
+             default:
+                 snmp_log(LOG_ERR, "couldn't map value %ld for pgsqlPgAmAmcanmulticol\n", raw_pgsqlPgAmAmcanmulticol_val );
+                 return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmcanmulticol_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmcanmulticol data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmcanmulticol_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmcanmulticol_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmcanmulticol_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmcanmulticol_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmcanmulticol_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmcanmulticol data.
+ * set (* pgsqlPgAmAmcanmulticol_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmcanmulticol_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmcanmulticol;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmcanmulticol_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmoptionalkey
+ * pgsqlPgAmAmoptionalkey is subid 8 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.8
+ * Description:
+Does the access method support a scan without any constraint for the first index column?
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  1      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ * Enum range: 2/8. Values:  true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmoptionalkey.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmoptionalkey_map(u_long *mib_pgsqlPgAmAmoptionalkey_val_ptr, u_long raw_pgsqlPgAmAmoptionalkey_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmoptionalkey_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmoptionalkey_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmoptionalkey enum mapping.
+     * uses INTERNAL_* macros defined in the header files
+     */
+    switch(raw_pgsqlPgAmAmoptionalkey_val) {
+        case INTERNAL_PGSQLPGAMAMOPTIONALKEY_TRUE:
+             *mib_pgsqlPgAmAmoptionalkey_val_ptr = TRUTHVALUE_TRUE;
+             break;
+
+        case INTERNAL_PGSQLPGAMAMOPTIONALKEY_FALSE:
+             *mib_pgsqlPgAmAmoptionalkey_val_ptr = TRUTHVALUE_FALSE;
+             break;
+
+             default:
+                 snmp_log(LOG_ERR, "couldn't map value %ld for pgsqlPgAmAmoptionalkey\n", raw_pgsqlPgAmAmoptionalkey_val );
+                 return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmoptionalkey_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmoptionalkey data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmoptionalkey_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmoptionalkey_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmoptionalkey_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmoptionalkey_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmoptionalkey_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmoptionalkey data.
+ * set (* pgsqlPgAmAmoptionalkey_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmoptionalkey_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmoptionalkey;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmoptionalkey_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmindexnulls
+ * pgsqlPgAmAmindexnulls is subid 9 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.9
+ * Description:
+Does the access method support null index entries?
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  1      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ * Enum range: 2/8. Values:  true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmindexnulls.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmindexnulls_map(u_long *mib_pgsqlPgAmAmindexnulls_val_ptr, u_long raw_pgsqlPgAmAmindexnulls_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmindexnulls_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmindexnulls_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmindexnulls enum mapping.
+     * uses INTERNAL_* macros defined in the header files
+     */
+    switch(raw_pgsqlPgAmAmindexnulls_val) {
+        case INTERNAL_PGSQLPGAMAMINDEXNULLS_TRUE:
+             *mib_pgsqlPgAmAmindexnulls_val_ptr = TRUTHVALUE_TRUE;
+             break;
+
+        case INTERNAL_PGSQLPGAMAMINDEXNULLS_FALSE:
+             *mib_pgsqlPgAmAmindexnulls_val_ptr = TRUTHVALUE_FALSE;
+             break;
+
+             default:
+                 snmp_log(LOG_ERR, "couldn't map value %ld for pgsqlPgAmAmindexnulls\n", raw_pgsqlPgAmAmindexnulls_val );
+                 return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmindexnulls_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmindexnulls data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmindexnulls_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmindexnulls_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmindexnulls_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmindexnulls_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmindexnulls_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmindexnulls data.
+ * set (* pgsqlPgAmAmindexnulls_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmindexnulls_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmindexnulls;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmindexnulls_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmstorage
+ * pgsqlPgAmAmstorage is subid 10 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.10
+ * Description:
+Can index storage data type differ from column data type?
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  1      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ * Enum range: 2/8. Values:  true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmstorage.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmstorage_map(u_long *mib_pgsqlPgAmAmstorage_val_ptr, u_long raw_pgsqlPgAmAmstorage_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmstorage_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmstorage_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmstorage enum mapping.
+     * uses INTERNAL_* macros defined in the header files
+     */
+    switch(raw_pgsqlPgAmAmstorage_val) {
+        case INTERNAL_PGSQLPGAMAMSTORAGE_TRUE:
+             *mib_pgsqlPgAmAmstorage_val_ptr = TRUTHVALUE_TRUE;
+             break;
+
+        case INTERNAL_PGSQLPGAMAMSTORAGE_FALSE:
+             *mib_pgsqlPgAmAmstorage_val_ptr = TRUTHVALUE_FALSE;
+             break;
+
+             default:
+                 snmp_log(LOG_ERR, "couldn't map value %ld for pgsqlPgAmAmstorage\n", raw_pgsqlPgAmAmstorage_val );
+                 return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmstorage_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmstorage data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmstorage_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmstorage_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmstorage_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmstorage_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmstorage_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmstorage data.
+ * set (* pgsqlPgAmAmstorage_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmstorage_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmstorage;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmstorage_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmclusterable
+ * pgsqlPgAmAmclusterable is subid 11 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.11
+ * Description:
+Can an index of this type be clustered on?
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  1      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ * Enum range: 2/8. Values:  true(1), false(2)
+ *
+ * Its syntax is TruthValue (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmclusterable.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmclusterable_map(u_long *mib_pgsqlPgAmAmclusterable_val_ptr, u_long raw_pgsqlPgAmAmclusterable_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmclusterable_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmclusterable_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmclusterable enum mapping.
+     * uses INTERNAL_* macros defined in the header files
+     */
+    switch(raw_pgsqlPgAmAmclusterable_val) {
+        case INTERNAL_PGSQLPGAMAMCLUSTERABLE_TRUE:
+             *mib_pgsqlPgAmAmclusterable_val_ptr = TRUTHVALUE_TRUE;
+             break;
+
+        case INTERNAL_PGSQLPGAMAMCLUSTERABLE_FALSE:
+             *mib_pgsqlPgAmAmclusterable_val_ptr = TRUTHVALUE_FALSE;
+             break;
+
+             default:
+                 snmp_log(LOG_ERR, "couldn't map value %ld for pgsqlPgAmAmclusterable\n", raw_pgsqlPgAmAmclusterable_val );
+                 return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmclusterable_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmclusterable data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmclusterable_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmclusterable_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmclusterable_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmclusterable_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmclusterable_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmclusterable data.
+ * set (* pgsqlPgAmAmclusterable_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmclusterable_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmclusterable;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmclusterable_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAminsert
+ * pgsqlPgAmAminsert is subid 12 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.12
+ * Description:
+Insert this tuple
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAminsert.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAminsert_map(long *mib_pgsqlPgAmAminsert_val_ptr, long raw_pgsqlPgAmAminsert_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAminsert_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAminsert_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAminsert mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAminsert_val_ptr) = raw_pgsqlPgAmAminsert_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAminsert_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAminsert data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAminsert_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAminsert_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAminsert_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAminsert_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAminsert_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAminsert data.
+ * set (* pgsqlPgAmAminsert_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAminsert_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAminsert;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAminsert_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmbeginscan
+ * pgsqlPgAmAmbeginscan is subid 13 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.13
+ * Description:
+Start new scan
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmbeginscan.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmbeginscan_map(long *mib_pgsqlPgAmAmbeginscan_val_ptr, long raw_pgsqlPgAmAmbeginscan_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmbeginscan_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmbeginscan_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmbeginscan mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmbeginscan_val_ptr) = raw_pgsqlPgAmAmbeginscan_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmbeginscan_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmbeginscan data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmbeginscan_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmbeginscan_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmbeginscan_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmbeginscan_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmbeginscan_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmbeginscan data.
+ * set (* pgsqlPgAmAmbeginscan_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmbeginscan_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmbeginscan;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmbeginscan_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmgettuple
+ * pgsqlPgAmAmgettuple is subid 14 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.14
+ * Description:
+Next valid tuple
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmgettuple.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmgettuple_map(long *mib_pgsqlPgAmAmgettuple_val_ptr, long raw_pgsqlPgAmAmgettuple_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmgettuple_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmgettuple_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmgettuple mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmgettuple_val_ptr) = raw_pgsqlPgAmAmgettuple_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmgettuple_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmgettuple data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmgettuple_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmgettuple_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmgettuple_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmgettuple_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmgettuple_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmgettuple data.
+ * set (* pgsqlPgAmAmgettuple_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmgettuple_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmgettuple;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmgettuple_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmgetmulti
+ * pgsqlPgAmAmgetmulti is subid 15 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.15
+ * Description:
+Fetch multiple tuples
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmgetmulti.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmgetmulti_map(long *mib_pgsqlPgAmAmgetmulti_val_ptr, long raw_pgsqlPgAmAmgetmulti_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmgetmulti_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmgetmulti_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmgetmulti mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmgetmulti_val_ptr) = raw_pgsqlPgAmAmgetmulti_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmgetmulti_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmgetmulti data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmgetmulti_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmgetmulti_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmgetmulti_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmgetmulti_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmgetmulti_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmgetmulti data.
+ * set (* pgsqlPgAmAmgetmulti_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmgetmulti_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmgetmulti;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmgetmulti_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmrescan
+ * pgsqlPgAmAmrescan is subid 16 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.16
+ * Description:
+Restart this scan
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmrescan.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmrescan_map(long *mib_pgsqlPgAmAmrescan_val_ptr, long raw_pgsqlPgAmAmrescan_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmrescan_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmrescan_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmrescan mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmrescan_val_ptr) = raw_pgsqlPgAmAmrescan_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmrescan_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmrescan data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmrescan_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmrescan_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmrescan_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmrescan_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmrescan_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmrescan data.
+ * set (* pgsqlPgAmAmrescan_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmrescan_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmrescan;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmrescan_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmendscan
+ * pgsqlPgAmAmendscan is subid 17 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.17
+ * Description:
+End this scan
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmendscan.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmendscan_map(long *mib_pgsqlPgAmAmendscan_val_ptr, long raw_pgsqlPgAmAmendscan_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmendscan_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmendscan_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmendscan mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmendscan_val_ptr) = raw_pgsqlPgAmAmendscan_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmendscan_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmendscan data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmendscan_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmendscan_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmendscan_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmendscan_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmendscan_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmendscan data.
+ * set (* pgsqlPgAmAmendscan_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmendscan_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmendscan;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmendscan_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmmarkpos
+ * pgsqlPgAmAmmarkpos is subid 18 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.18
+ * Description:
+Mark current scan position
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmmarkpos.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmmarkpos_map(long *mib_pgsqlPgAmAmmarkpos_val_ptr, long raw_pgsqlPgAmAmmarkpos_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmmarkpos_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmmarkpos_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmmarkpos mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmmarkpos_val_ptr) = raw_pgsqlPgAmAmmarkpos_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmmarkpos_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmmarkpos data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmmarkpos_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmmarkpos_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmmarkpos_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmmarkpos_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmmarkpos_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmmarkpos data.
+ * set (* pgsqlPgAmAmmarkpos_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmmarkpos_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmmarkpos;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmmarkpos_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmrestrpos
+ * pgsqlPgAmAmrestrpos is subid 19 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.19
+ * Description:
+Restore marked scan position
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmrestrpos.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmrestrpos_map(long *mib_pgsqlPgAmAmrestrpos_val_ptr, long raw_pgsqlPgAmAmrestrpos_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmrestrpos_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmrestrpos_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmrestrpos mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmrestrpos_val_ptr) = raw_pgsqlPgAmAmrestrpos_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmrestrpos_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmrestrpos data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmrestrpos_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmrestrpos_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmrestrpos_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmrestrpos_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmrestrpos_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmrestrpos data.
+ * set (* pgsqlPgAmAmrestrpos_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmrestrpos_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmrestrpos;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmrestrpos_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmbuild
+ * pgsqlPgAmAmbuild is subid 20 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.20
+ * Description:
+Build new index
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmbuild.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmbuild_map(long *mib_pgsqlPgAmAmbuild_val_ptr, long raw_pgsqlPgAmAmbuild_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmbuild_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmbuild_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmbuild mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmbuild_val_ptr) = raw_pgsqlPgAmAmbuild_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmbuild_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmbuild data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmbuild_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmbuild_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmbuild_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmbuild_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmbuild_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmbuild data.
+ * set (* pgsqlPgAmAmbuild_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmbuild_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmbuild;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmbuild_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmbulkdelete
+ * pgsqlPgAmAmbulkdelete is subid 21 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.21
+ * Description:
+Bulk-delete function
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmbulkdelete.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmbulkdelete_map(long *mib_pgsqlPgAmAmbulkdelete_val_ptr, long raw_pgsqlPgAmAmbulkdelete_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmbulkdelete_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmbulkdelete_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmbulkdelete mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmbulkdelete_val_ptr) = raw_pgsqlPgAmAmbulkdelete_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmbulkdelete_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmbulkdelete data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmbulkdelete_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmbulkdelete_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmbulkdelete_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmbulkdelete_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmbulkdelete_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmbulkdelete data.
+ * set (* pgsqlPgAmAmbulkdelete_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmbulkdelete_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmbulkdelete;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmbulkdelete_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmvacuumcleanup
+ * pgsqlPgAmAmvacuumcleanup is subid 22 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.22
+ * Description:
+Post- VACUUM cleanup function
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmvacuumcleanup.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmvacuumcleanup_map(long *mib_pgsqlPgAmAmvacuumcleanup_val_ptr, long raw_pgsqlPgAmAmvacuumcleanup_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmvacuumcleanup_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmvacuumcleanup_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmvacuumcleanup mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmvacuumcleanup_val_ptr) = raw_pgsqlPgAmAmvacuumcleanup_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmvacuumcleanup_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmvacuumcleanup data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmvacuumcleanup_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmvacuumcleanup_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmvacuumcleanup_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmvacuumcleanup_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmvacuumcleanup_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmvacuumcleanup data.
+ * set (* pgsqlPgAmAmvacuumcleanup_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmvacuumcleanup_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmvacuumcleanup;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmvacuumcleanup_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmcostestimate
+ * pgsqlPgAmAmcostestimate is subid 23 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.23
+ * Description:
+Function to estimate cost of an index scan
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmcostestimate.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmcostestimate_map(long *mib_pgsqlPgAmAmcostestimate_val_ptr, long raw_pgsqlPgAmAmcostestimate_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmcostestimate_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmcostestimate_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmcostestimate mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmcostestimate_val_ptr) = raw_pgsqlPgAmAmcostestimate_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmcostestimate_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmcostestimate data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmcostestimate_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmcostestimate_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmcostestimate_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmcostestimate_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmcostestimate_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmcostestimate data.
+ * set (* pgsqlPgAmAmcostestimate_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmcostestimate_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmcostestimate;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmcostestimate_get */
+
+/*---------------------------------------------------------------------
+ * PGSQL-MIB::pgsqlPgAmEntry.pgsqlPgAmAmoptions
+ * pgsqlPgAmAmoptions is subid 24 of pgsqlPgAmEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.4.1.27645.1.2.2.1.24
+ * Description:
+Function to parse and validate reloptions for an index
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-pgsqlPgAmAmoptions.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+pgsqlPgAmAmoptions_map(long *mib_pgsqlPgAmAmoptions_val_ptr, long raw_pgsqlPgAmAmoptions_val)
+{
+    netsnmp_assert(NULL != mib_pgsqlPgAmAmoptions_val_ptr);
+    
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmoptions_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement pgsqlPgAmAmoptions mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_pgsqlPgAmAmoptions_val_ptr) = raw_pgsqlPgAmAmoptions_val;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmoptions_map */
+
+/**
+ * Extract the current value of the pgsqlPgAmAmoptions data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param pgsqlPgAmAmoptions_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+pgsqlPgAmAmoptions_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmoptions_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != pgsqlPgAmAmoptions_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmAmoptions_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the pgsqlPgAmAmoptions data.
+ * set (* pgsqlPgAmAmoptions_val_ptr ) from rowreq_ctx->data
+ */
+    (* pgsqlPgAmAmoptions_val_ptr ) = rowreq_ctx->data.pgsqlPgAmAmoptions;
+
+    return MFD_SUCCESS;
+} /* pgsqlPgAmAmoptions_get */
+
+
+
+/** @} */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_get.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_get.h
new file mode 100644 (file)
index 0000000..19852b7
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18.2.1 $ of : mfd-data-get.m2c,v $
+ *
+ * $Id: pgsqlPgAmTable_data_get.h,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ *
+ * @file pgsqlPgAmTable_data_get.h
+ *
+ * @addtogroup get
+ *
+ * Prototypes for get functions
+ *
+ * @{
+ */
+#ifndef PGSQLPGAMTABLE_DATA_GET_H
+#define PGSQLPGAMTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAmTable is subid 2 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.2, length: 10
+*/
+    /*
+     * indexes
+     */
+    int pgsnmpdConnID_map(char **mib_pgsnmpdConnID_val_ptr_ptr, size_t *mib_pgsnmpdConnID_val_ptr_len_ptr, char *raw_pgsnmpdConnID_val_ptr, size_t raw_pgsnmpdConnID_val_ptr_len, int allow_realloc);
+    int rdbmsDbIndex_map(long *mib_rdbmsDbIndex_val_ptr, long raw_rdbmsDbIndex_val);
+    int pgsqlPgAmEntryOID_map(long *mib_pgsqlPgAmEntryOID_val_ptr, long raw_pgsqlPgAmEntryOID_val);
+
+    int pgsqlPgAmAmname_map(char **mib_pgsqlPgAmAmname_val_ptr_ptr, size_t *mib_pgsqlPgAmAmname_val_ptr_len_ptr, char *raw_pgsqlPgAmAmname_val_ptr, size_t raw_pgsqlPgAmAmname_val_ptr_len, int allow_realloc);
+    int pgsqlPgAmAmname_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, char **pgsqlPgAmAmname_val_ptr_ptr, size_t *pgsqlPgAmAmname_val_ptr_len_ptr );
+    int pgsqlPgAmAmstrategies_map(long *mib_pgsqlPgAmAmstrategies_val_ptr, long raw_pgsqlPgAmAmstrategies_val);
+    int pgsqlPgAmAmstrategies_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmstrategies_val_ptr );
+    int pgsqlPgAmAmsupport_map(long *mib_pgsqlPgAmAmsupport_val_ptr, long raw_pgsqlPgAmAmsupport_val);
+    int pgsqlPgAmAmsupport_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmsupport_val_ptr );
+    int pgsqlPgAmAmorderstrategy_map(long *mib_pgsqlPgAmAmorderstrategy_val_ptr, long raw_pgsqlPgAmAmorderstrategy_val);
+    int pgsqlPgAmAmorderstrategy_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmorderstrategy_val_ptr );
+    int pgsqlPgAmAmcanunique_map(u_long *mib_pgsqlPgAmAmcanunique_val_ptr, u_long raw_pgsqlPgAmAmcanunique_val);
+    int pgsqlPgAmAmcanunique_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmcanunique_val_ptr );
+    int pgsqlPgAmAmcanmulticol_map(u_long *mib_pgsqlPgAmAmcanmulticol_val_ptr, u_long raw_pgsqlPgAmAmcanmulticol_val);
+    int pgsqlPgAmAmcanmulticol_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmcanmulticol_val_ptr );
+    int pgsqlPgAmAmoptionalkey_map(u_long *mib_pgsqlPgAmAmoptionalkey_val_ptr, u_long raw_pgsqlPgAmAmoptionalkey_val);
+    int pgsqlPgAmAmoptionalkey_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmoptionalkey_val_ptr );
+    int pgsqlPgAmAmindexnulls_map(u_long *mib_pgsqlPgAmAmindexnulls_val_ptr, u_long raw_pgsqlPgAmAmindexnulls_val);
+    int pgsqlPgAmAmindexnulls_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmindexnulls_val_ptr );
+    int pgsqlPgAmAmstorage_map(u_long *mib_pgsqlPgAmAmstorage_val_ptr, u_long raw_pgsqlPgAmAmstorage_val);
+    int pgsqlPgAmAmstorage_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmstorage_val_ptr );
+    int pgsqlPgAmAmclusterable_map(u_long *mib_pgsqlPgAmAmclusterable_val_ptr, u_long raw_pgsqlPgAmAmclusterable_val);
+    int pgsqlPgAmAmclusterable_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, u_long * pgsqlPgAmAmclusterable_val_ptr );
+    int pgsqlPgAmAminsert_map(long *mib_pgsqlPgAmAminsert_val_ptr, long raw_pgsqlPgAmAminsert_val);
+    int pgsqlPgAmAminsert_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAminsert_val_ptr );
+    int pgsqlPgAmAmbeginscan_map(long *mib_pgsqlPgAmAmbeginscan_val_ptr, long raw_pgsqlPgAmAmbeginscan_val);
+    int pgsqlPgAmAmbeginscan_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmbeginscan_val_ptr );
+    int pgsqlPgAmAmgettuple_map(long *mib_pgsqlPgAmAmgettuple_val_ptr, long raw_pgsqlPgAmAmgettuple_val);
+    int pgsqlPgAmAmgettuple_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmgettuple_val_ptr );
+    int pgsqlPgAmAmgetmulti_map(long *mib_pgsqlPgAmAmgetmulti_val_ptr, long raw_pgsqlPgAmAmgetmulti_val);
+    int pgsqlPgAmAmgetmulti_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmgetmulti_val_ptr );
+    int pgsqlPgAmAmrescan_map(long *mib_pgsqlPgAmAmrescan_val_ptr, long raw_pgsqlPgAmAmrescan_val);
+    int pgsqlPgAmAmrescan_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmrescan_val_ptr );
+    int pgsqlPgAmAmendscan_map(long *mib_pgsqlPgAmAmendscan_val_ptr, long raw_pgsqlPgAmAmendscan_val);
+    int pgsqlPgAmAmendscan_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmendscan_val_ptr );
+    int pgsqlPgAmAmmarkpos_map(long *mib_pgsqlPgAmAmmarkpos_val_ptr, long raw_pgsqlPgAmAmmarkpos_val);
+    int pgsqlPgAmAmmarkpos_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmmarkpos_val_ptr );
+    int pgsqlPgAmAmrestrpos_map(long *mib_pgsqlPgAmAmrestrpos_val_ptr, long raw_pgsqlPgAmAmrestrpos_val);
+    int pgsqlPgAmAmrestrpos_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmrestrpos_val_ptr );
+    int pgsqlPgAmAmbuild_map(long *mib_pgsqlPgAmAmbuild_val_ptr, long raw_pgsqlPgAmAmbuild_val);
+    int pgsqlPgAmAmbuild_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmbuild_val_ptr );
+    int pgsqlPgAmAmbulkdelete_map(long *mib_pgsqlPgAmAmbulkdelete_val_ptr, long raw_pgsqlPgAmAmbulkdelete_val);
+    int pgsqlPgAmAmbulkdelete_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmbulkdelete_val_ptr );
+    int pgsqlPgAmAmvacuumcleanup_map(long *mib_pgsqlPgAmAmvacuumcleanup_val_ptr, long raw_pgsqlPgAmAmvacuumcleanup_val);
+    int pgsqlPgAmAmvacuumcleanup_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmvacuumcleanup_val_ptr );
+    int pgsqlPgAmAmcostestimate_map(long *mib_pgsqlPgAmAmcostestimate_val_ptr, long raw_pgsqlPgAmAmcostestimate_val);
+    int pgsqlPgAmAmcostestimate_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmcostestimate_val_ptr );
+    int pgsqlPgAmAmoptions_map(long *mib_pgsqlPgAmAmoptions_val_ptr, long raw_pgsqlPgAmAmoptions_val);
+    int pgsqlPgAmAmoptions_get( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, long * pgsqlPgAmAmoptions_val_ptr );
+
+
+int pgsqlPgAmTable_indexes_set_tbl_idx(pgsqlPgAmTable_mib_index *tbl_idx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len, long rdbmsDbIndex_val, long pgsqlPgAmEntryOID_val);
+int pgsqlPgAmTable_indexes_set(pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, char *pgsnmpdConnID_val_ptr,  size_t pgsnmpdConnID_val_ptr_len, long rdbmsDbIndex_val, long pgsqlPgAmEntryOID_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAMTABLE_DATA_GET_H */
+/** @} */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_set.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_set.c
new file mode 100644 (file)
index 0000000..59971e9
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18 $ of : mfd-data-set.m2c,v $
+ *
+ * $Id: pgsqlPgAmTable_data_set.c,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ *
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsqlPgAmTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ * 
+ * @{
+ */
+/** @} */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_set.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_data_set.h
new file mode 100644 (file)
index 0000000..b5ff1d8
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.18 $ of : mfd-data-set.m2c,v $ 
+ *
+ * $Id: pgsqlPgAmTable_data_set.h,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ */
+#ifndef PGSQLPGAMTABLE_DATA_SET_H
+#define PGSQLPGAMTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAMTABLE_DATA_SET_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_enums.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_enums.h
new file mode 100644 (file)
index 0000000..051af4e
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : generic-table-enums.m2c,v 1.3 2004/05/18 17:44:32 rstory Exp $
+ *
+ * $Id: pgsqlPgAmTable_enums.h,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ */
+#ifndef PGSQLPGAMTABLE_ENUMS_H
+#define PGSQLPGAMTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table pgsqlPgAmTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * pgsqlPgAmAmcanunique (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE  1 
+#define TRUTHVALUE_FALSE  2 
+
+
+#endif /* TRUTHVALUE_ENUMS */
+
+    /*
+     * TODO:140:o: Define interal representation of pgsqlPgAmAmcanunique enums.
+     * (used for value mapping; see notes at top of file)
+     */
+#define INTERNAL_PGSQLPGAMAMCANUNIQUE_TRUE  1 
+#define INTERNAL_PGSQLPGAMAMCANUNIQUE_FALSE  2 
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * pgsqlPgAmAmcanmulticol (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE  1 
+#define TRUTHVALUE_FALSE  2 
+
+
+#endif /* TRUTHVALUE_ENUMS */
+
+    /*
+     * TODO:140:o: Define interal representation of pgsqlPgAmAmcanmulticol enums.
+     * (used for value mapping; see notes at top of file)
+     */
+#define INTERNAL_PGSQLPGAMAMCANMULTICOL_TRUE  1 
+#define INTERNAL_PGSQLPGAMAMCANMULTICOL_FALSE  2 
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * pgsqlPgAmAmoptionalkey (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE  1 
+#define TRUTHVALUE_FALSE  2 
+
+
+#endif /* TRUTHVALUE_ENUMS */
+
+    /*
+     * TODO:140:o: Define interal representation of pgsqlPgAmAmoptionalkey enums.
+     * (used for value mapping; see notes at top of file)
+     */
+#define INTERNAL_PGSQLPGAMAMOPTIONALKEY_TRUE  1 
+#define INTERNAL_PGSQLPGAMAMOPTIONALKEY_FALSE  2 
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * pgsqlPgAmAmindexnulls (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE  1 
+#define TRUTHVALUE_FALSE  2 
+
+
+#endif /* TRUTHVALUE_ENUMS */
+
+    /*
+     * TODO:140:o: Define interal representation of pgsqlPgAmAmindexnulls enums.
+     * (used for value mapping; see notes at top of file)
+     */
+#define INTERNAL_PGSQLPGAMAMINDEXNULLS_TRUE  1 
+#define INTERNAL_PGSQLPGAMAMINDEXNULLS_FALSE  2 
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * pgsqlPgAmAmstorage (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE  1 
+#define TRUTHVALUE_FALSE  2 
+
+
+#endif /* TRUTHVALUE_ENUMS */
+
+    /*
+     * TODO:140:o: Define interal representation of pgsqlPgAmAmstorage enums.
+     * (used for value mapping; see notes at top of file)
+     */
+#define INTERNAL_PGSQLPGAMAMSTORAGE_TRUE  1 
+#define INTERNAL_PGSQLPGAMAMSTORAGE_FALSE  2 
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * pgsqlPgAmAmclusterable (TruthValue / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef TRUTHVALUE_ENUMS
+#define TRUTHVALUE_ENUMS
+
+#define TRUTHVALUE_TRUE  1 
+#define TRUTHVALUE_FALSE  2 
+
+
+#endif /* TRUTHVALUE_ENUMS */
+
+    /*
+     * TODO:140:o: Define interal representation of pgsqlPgAmAmclusterable enums.
+     * (used for value mapping; see notes at top of file)
+     */
+#define INTERNAL_PGSQLPGAMAMCLUSTERABLE_TRUE  1 
+#define INTERNAL_PGSQLPGAMAMCLUSTERABLE_FALSE  2 
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAMTABLE_ENUMS_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_interface.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_interface.c
new file mode 100644 (file)
index 0000000..3259307
--- /dev/null
@@ -0,0 +1,903 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.43.2.3 $ of : mfd-interface.m2c,v $ 
+ *
+ * $Id: pgsqlPgAmTable_interface.c,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * ***                                                               ***
+ * ***  NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE  ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE.      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***    IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES.   ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "pgsqlPgAmTable.h"
+
+
+#include <net-snmp/library/container.h>
+
+#include "pgsqlPgAmTable_interface.h"
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table pgsqlPgAmTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * pgsqlPgAmTable is subid 2 of pgsqlCatalogTables.
+ * Its status is Current.
+ * OID: .1.3.6.1.4.1.27645.1.2.2, length: 10
+*/
+typedef struct pgsqlPgAmTable_interface_ctx_s {
+
+   netsnmp_container              *container;
+   netsnmp_cache                  *cache; /* optional cache */
+
+   pgsqlPgAmTable_registration_ptr      user_ctx;
+   
+   netsnmp_table_registration_info  tbl_info;
+
+   netsnmp_baby_steps_access_methods access_multiplexer;
+
+} pgsqlPgAmTable_interface_ctx;
+
+static pgsqlPgAmTable_interface_ctx pgsqlPgAmTable_if_ctx;
+
+static void _pgsqlPgAmTable_container_init(
+    pgsqlPgAmTable_interface_ctx *if_ctx);
+
+
+static Netsnmp_Node_Handler _mfd_pgsqlPgAmTable_pre_request;
+static Netsnmp_Node_Handler _mfd_pgsqlPgAmTable_post_request;
+static Netsnmp_Node_Handler _mfd_pgsqlPgAmTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_pgsqlPgAmTable_get_values;
+/**
+ * @internal
+ * Initialize the table pgsqlPgAmTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+_pgsqlPgAmTable_initialize_interface(pgsqlPgAmTable_registration_ptr reg_ptr,  u_long flags)
+{
+    netsnmp_baby_steps_access_methods *access_multiplexer =
+        &pgsqlPgAmTable_if_ctx.access_multiplexer;
+    netsnmp_table_registration_info *tbl_info = &pgsqlPgAmTable_if_ctx.tbl_info;
+    netsnmp_handler_registration *reginfo;
+    netsnmp_mib_handler *handler;
+    int    mfd_modes = 0;
+
+    DEBUGMSGTL(("internal:pgsqlPgAmTable:_pgsqlPgAmTable_initialize_interface","called\n"));
+
+
+    /*************************************************
+     *
+     * save interface context for pgsqlPgAmTable
+     */
+    /*
+     * Setting up the table's definition
+     */
+    netsnmp_table_helper_add_indexes(tbl_info,
+                                  ASN_OCTET_STR, /** index: pgsnmpdConnID */
+                                  ASN_INTEGER, /** index: rdbmsDbIndex */
+                                  ASN_INTEGER, /** index: pgsqlPgAmEntryOID */
+                             0);
+
+    /*  Define the minimum and maximum accessible columns.  This
+        optimizes retrival. */
+    tbl_info->min_column = PGSQLPGAMTABLE_MIN_COL;
+    tbl_info->max_column = PGSQLPGAMTABLE_MAX_COL;
+
+    /*
+     * save users context
+     */
+    pgsqlPgAmTable_if_ctx.user_ctx = reg_ptr;
+
+    /*
+     * call data access initialization code
+     */
+    pgsqlPgAmTable_init_data(reg_ptr);
+
+    /*
+     * set up the container
+     */
+    _pgsqlPgAmTable_container_init(&pgsqlPgAmTable_if_ctx);
+    if (NULL == pgsqlPgAmTable_if_ctx.container) {
+        snmp_log(LOG_ERR,"could not initialize container for pgsqlPgAmTable\n");
+        return;
+    }
+    
+    /*
+     * access_multiplexer: REQUIRED wrapper for get request handling
+     */
+    access_multiplexer->object_lookup = _mfd_pgsqlPgAmTable_object_lookup;
+    access_multiplexer->get_values = _mfd_pgsqlPgAmTable_get_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->pre_request = _mfd_pgsqlPgAmTable_pre_request;
+    access_multiplexer->post_request = _mfd_pgsqlPgAmTable_post_request;
+
+
+    /*************************************************
+     *
+     * Create a registration, save our reg data, register table.
+     */
+    DEBUGMSGTL(("pgsqlPgAmTable:init_pgsqlPgAmTable",
+                "Registering pgsqlPgAmTable as a mibs-for-dummies table.\n"));          
+    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+    reginfo = netsnmp_handler_registration_create("pgsqlPgAmTable", handler,
+                                                  pgsqlPgAmTable_oid,
+                                                  pgsqlPgAmTable_oid_size,
+                                                  HANDLER_CAN_BABY_STEP |
+                                                  HANDLER_CAN_RONLY
+                                                  );
+    if(NULL == reginfo) {
+        snmp_log(LOG_ERR,"error registering table pgsqlPgAmTable\n");
+        return;
+    }
+    reginfo->my_reg_void = &pgsqlPgAmTable_if_ctx;
+
+    /*************************************************
+     *
+     * set up baby steps handler, create it and inject it
+     */
+    if( access_multiplexer->object_lookup )
+        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+    if( access_multiplexer->set_values )
+        mfd_modes |= BABY_STEP_SET_VALUES;
+    if( access_multiplexer->irreversible_commit )
+        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+    if( access_multiplexer->object_syntax_checks )
+        mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+    if( access_multiplexer->pre_request )
+        mfd_modes |= BABY_STEP_PRE_REQUEST;
+    if( access_multiplexer->post_request )
+        mfd_modes |= BABY_STEP_POST_REQUEST;
+    
+    if( access_multiplexer->undo_setup )
+        mfd_modes |= BABY_STEP_UNDO_SETUP;
+    if( access_multiplexer->undo_cleanup )
+        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+    if( access_multiplexer->undo_sets )
+        mfd_modes |= BABY_STEP_UNDO_SETS;
+    
+    if( access_multiplexer->row_creation )
+        mfd_modes |= BABY_STEP_ROW_CREATE;
+    if( access_multiplexer->consistency_checks )
+        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+    if( access_multiplexer->commit )
+        mfd_modes |= BABY_STEP_COMMIT;
+    if( access_multiplexer->undo_commit )
+        mfd_modes |= BABY_STEP_UNDO_COMMIT;
+    
+    handler = netsnmp_baby_steps_handler_get(mfd_modes);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+     */
+    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject container_table helper
+     */
+    handler =
+        netsnmp_container_table_handler_get(tbl_info,
+                                            pgsqlPgAmTable_if_ctx.container,
+                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+    netsnmp_inject_handler( reginfo, handler );
+
+    /*************************************************
+     *
+     * inject cache helper
+     */
+    if(NULL != pgsqlPgAmTable_if_ctx.cache) {
+        handler = netsnmp_cache_handler_get(pgsqlPgAmTable_if_ctx.cache);
+        netsnmp_inject_handler( reginfo, handler );
+    }
+
+    /*
+     * register table
+     */
+    netsnmp_register_table(reginfo, tbl_info);
+} /* _pgsqlPgAmTable_initialize_interface */
+
+void
+pgsqlPgAmTable_valid_columns_set(netsnmp_column_info *vc)
+{
+    pgsqlPgAmTable_if_ctx.tbl_info.valid_columns = vc;
+} /* pgsqlPgAmTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+pgsqlPgAmTable_index_to_oid(netsnmp_index *oid_idx,
+                         pgsqlPgAmTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_pgsnmpdConnID;
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+    /*
+     * pgsqlPgAmEntryOID(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+     */
+    netsnmp_variable_list var_pgsqlPgAmEntryOID;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_pgsnmpdConnID, 0x00, sizeof(var_pgsnmpdConnID) );
+    var_pgsnmpdConnID.type = ASN_OCTET_STR;
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+    memset( &var_pgsqlPgAmEntryOID, 0x00, sizeof(var_pgsqlPgAmEntryOID) );
+    var_pgsqlPgAmEntryOID.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_pgsnmpdConnID.next_variable =  &var_rdbmsDbIndex; var_rdbmsDbIndex.next_variable =  &var_pgsqlPgAmEntryOID; var_pgsqlPgAmEntryOID.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_index_to_oid","called\n"));
+
+        /* pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+    snmp_set_var_value(&var_pgsnmpdConnID, (u_char*)&mib_idx->pgsnmpdConnID,
+                       mib_idx->pgsnmpdConnID_len * sizeof(mib_idx->pgsnmpdConnID[0]));
+
+        /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_rdbmsDbIndex, (u_char*)&mib_idx->rdbmsDbIndex,
+                       sizeof(mib_idx->rdbmsDbIndex));
+
+        /* pgsqlPgAmEntryOID(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/r/d/h */
+    snmp_set_var_value(&var_pgsqlPgAmEntryOID, (u_char*)&mib_idx->pgsqlPgAmEntryOID,
+                       sizeof(mib_idx->pgsqlPgAmEntryOID));
+
+
+    err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
+                           NULL, 0, &var_pgsnmpdConnID);
+    if(err)
+        snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_pgsnmpdConnID );
+
+    return err;
+} /* pgsqlPgAmTable_index_to_oid */
+
+/**
+ * extract pgsqlPgAmTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR  : no error
+ * @retval SNMP_ERR_GENERR   : error
+ */
+int
+pgsqlPgAmTable_index_from_oid(netsnmp_index *oid_idx,
+                         pgsqlPgAmTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * pgsnmpdConnID(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_pgsnmpdConnID;
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+    /*
+     * pgsqlPgAmEntryOID(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/r/d/h
+     */
+    netsnmp_variable_list var_pgsqlPgAmEntryOID;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_pgsnmpdConnID, 0x00, sizeof(var_pgsnmpdConnID) );
+    var_pgsnmpdConnID.type = ASN_OCTET_STR;
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+    memset( &var_pgsqlPgAmEntryOID, 0x00, sizeof(var_pgsqlPgAmEntryOID) );
+    var_pgsqlPgAmEntryOID.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_pgsnmpdConnID.next_variable =  &var_rdbmsDbIndex; var_rdbmsDbIndex.next_variable =  &var_pgsqlPgAmEntryOID; var_pgsqlPgAmEntryOID.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:pgsqlPgAmTable:pgsqlPgAmTable_index_from_oid","called\n"));
+
+    /*
+     * parse the oid into the individual index components
+     */
+    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+                             &var_pgsnmpdConnID );
+    if (err == SNMP_ERR_NOERROR) {
+        /*
+         * copy out values
+         */
+    /*
+     * NOTE: val_len is in bytes, pgsnmpdConnID_len might not be
+     */
+         if(var_pgsnmpdConnID.val_len > sizeof(mib_idx->pgsnmpdConnID))
+             err = SNMP_ERR_GENERR;
+         else {
+             memcpy(mib_idx->pgsnmpdConnID, var_pgsnmpdConnID.val.string, var_pgsnmpdConnID.val_len);
+             mib_idx->pgsnmpdConnID_len = var_pgsnmpdConnID.val_len / sizeof(mib_idx->pgsnmpdConnID[0]);
+         }
+    mib_idx->rdbmsDbIndex = *((long *)var_rdbmsDbIndex.val.string);
+    mib_idx->pgsqlPgAmEntryOID = *((long *)var_pgsqlPgAmEntryOID.val.string);
+
+
+    }
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_pgsnmpdConnID );
+
+    return err;
+} /* pgsqlPgAmTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a pgsqlPgAmTable_rowreq_ctx
+ */
+pgsqlPgAmTable_rowreq_ctx *
+pgsqlPgAmTable_allocate_rowreq_ctx(void)
+{
+    pgsqlPgAmTable_rowreq_ctx *rowreq_ctx =
+                  SNMP_MALLOC_TYPEDEF(pgsqlPgAmTable_rowreq_ctx);
+
+    DEBUGMSGTL(("internal:pgsqlPgAmTable:pgsqlPgAmTable_allocate_rowreq_ctx","called\n"));
+
+    if(NULL == rowreq_ctx) {
+        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+                 "pgsqlPgAmTable_rowreq_ctx.\n");
+    }
+
+    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+    rowreq_ctx->pgsqlPgAmTable_data_list = NULL;
+    rowreq_ctx->pgsqlPgAmTable_reg = pgsqlPgAmTable_if_ctx.user_ctx;
+
+
+    return rowreq_ctx;
+} /* pgsqlPgAmTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a pgsqlPgAmTable_rowreq_ctx
+ */
+void
+pgsqlPgAmTable_release_rowreq_ctx(pgsqlPgAmTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("internal:pgsqlPgAmTable:pgsqlPgAmTable_release_rowreq_ctx","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+
+    /*
+     * free index oid pointer
+     */
+    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+        free(rowreq_ctx->oid_idx.oids);
+
+    SNMP_FREE(rowreq_ctx);
+} /* pgsqlPgAmTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_pgsqlPgAmTable_pre_request(netsnmp_mib_handler *handler,
+                            netsnmp_handler_registration *reginfo,
+                            netsnmp_agent_request_info *agtreq_info,
+                            netsnmp_request_info *requests)
+{
+    int rc = pgsqlPgAmTable_pre_request(pgsqlPgAmTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:pgsqlPgAmTable","error %d from "
+                    "pgsqlPgAmTable_pre_request\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsqlPgAmTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_pgsqlPgAmTable_post_request(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    pgsqlPgAmTable_rowreq_ctx *rowreq_ctx;
+    int rc = pgsqlPgAmTable_post_request(pgsqlPgAmTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:pgsqlPgAmTable","error %d from "
+                    "pgsqlPgAmTable_post_request\n", rc));
+    }
+    
+    /*
+     * if there are no errors, check for and handle row creation/deletion
+     */
+    rc = netsnmp_check_requests_error(requests);
+    if ((SNMP_ERR_NOERROR == rc) &&
+        (NULL !=
+         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
+        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+            CONTAINER_INSERT(pgsqlPgAmTable_if_ctx.container, rowreq_ctx);
+        }
+        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+            CONTAINER_REMOVE(pgsqlPgAmTable_if_ctx.container, rowreq_ctx);
+            pgsqlPgAmTable_release_rowreq_ctx(rowreq_ctx);
+        }
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsqlPgAmTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_pgsqlPgAmTable_object_lookup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    pgsqlPgAmTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    
+    DEBUGMSGTL(("internal:pgsqlPgAmTable:_mfd_pgsqlPgAmTable_object_lookup","called\n"));
+
+    /*
+     * get our context from mfd
+     * pgsqlPgAmTable_interface_ctx *if_ctx =
+     *             (pgsqlPgAmTable_interface_ctx *)reginfo->my_reg_void;
+     */
+
+    if(NULL == rowreq_ctx) {
+        netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
+    }
+    else {
+        pgsqlPgAmTable_row_prep(rowreq_ctx);
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsqlPgAmTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_pgsqlPgAmTable_get_column( pgsqlPgAmTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:pgsqlPgAmTable:_mfd_pgsqlPgAmTable_get_column","called\n"));
+
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* pgsqlPgAmAmname(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+    case COLUMN_PGSQLPGAMAMNAME:
+    var->type = ASN_OCTET_STR;
+rc = pgsqlPgAmAmname_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+    /* pgsqlPgAmAmstrategies(3)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMSTRATEGIES:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmstrategies_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmsupport(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMSUPPORT:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmsupport_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmorderstrategy(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMORDERSTRATEGY:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmorderstrategy_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmcanunique(6)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+    case COLUMN_PGSQLPGAMAMCANUNIQUE:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmcanunique_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmcanmulticol(7)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+    case COLUMN_PGSQLPGAMAMCANMULTICOL:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmcanmulticol_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmoptionalkey(8)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+    case COLUMN_PGSQLPGAMAMOPTIONALKEY:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmoptionalkey_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmindexnulls(9)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+    case COLUMN_PGSQLPGAMAMINDEXNULLS:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmindexnulls_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmstorage(10)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+    case COLUMN_PGSQLPGAMAMSTORAGE:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmstorage_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmclusterable(11)/TruthValue/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+    case COLUMN_PGSQLPGAMAMCLUSTERABLE:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmclusterable_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAminsert(12)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMINSERT:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAminsert_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmbeginscan(13)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMBEGINSCAN:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmbeginscan_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmgettuple(14)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMGETTUPLE:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmgettuple_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmgetmulti(15)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMGETMULTI:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmgetmulti_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmrescan(16)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMRESCAN:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmrescan_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmendscan(17)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMENDSCAN:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmendscan_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmmarkpos(18)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMMARKPOS:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmmarkpos_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmrestrpos(19)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMRESTRPOS:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmrestrpos_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmbuild(20)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMBUILD:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmbuild_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmbulkdelete(21)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMBULKDELETE:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmbulkdelete_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmvacuumcleanup(22)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMVACUUMCLEANUP:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmvacuumcleanup_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmcostestimate(23)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMCOSTESTIMATE:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmcostestimate_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* pgsqlPgAmAmoptions(24)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/r/d/h */
+    case COLUMN_PGSQLPGAMAMOPTIONS:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = pgsqlPgAmAmoptions_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _pgsqlPgAmTable_get_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _pgsqlPgAmTable_get_column */
+
+int
+_mfd_pgsqlPgAmTable_get_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    pgsqlPgAmTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    u_char                     * old_string;
+    void                      (*dataFreeHook)(void *);
+    int                        rc;
+
+    DEBUGMSGTL(("internal:pgsqlPgAmTable:_mfd_pgsqlPgAmTable_get_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * save old pointer, so we can free it if replaced
+         */
+        old_string = requests->requestvb->val.string;
+        dataFreeHook = requests->requestvb->dataFreeHook;
+        if(NULL == requests->requestvb->val.string) {
+            requests->requestvb->val.string = requests->requestvb->buf;
+            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+        else if(requests->requestvb->buf == requests->requestvb->val.string) {
+            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+
+        /*
+         * get column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _pgsqlPgAmTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            if(MFD_SKIP == rc) {
+                requests->requestvb->type = ASN_PRIV_RETRY;
+                rc = SNMP_ERR_NOERROR;
+            }
+        }
+        else if (NULL == requests->requestvb->val.string) {
+            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+            rc = SNMP_ERR_GENERR;
+        }
+        if(rc)
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+        /*
+         * if the buffer wasn't used previously for the old data (i.e. it
+         * was allcoated memory)  and the get routine replaced the pointer,
+         * we need to free the previous pointer.
+         */
+        if(old_string && (old_string != requests->requestvb->buf) &&
+           (requests->requestvb->val.string != old_string)) {
+            if(dataFreeHook)
+                (*dataFreeHook)(old_string);
+            else
+                free(old_string);
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_pgsqlPgAmTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+    DEBUGMSGTL(("internal:pgsqlPgAmTable:_cache_load","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache for pgsqlPgAmTable_cache_load\n");
+        return -1;
+    }
+
+    /** should only be called for an invalid or expired cache */
+    netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+    
+    /*
+     * call user code
+     */
+    return pgsqlPgAmTable_cache_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_item_free(pgsqlPgAmTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+    DEBUGMSGTL(("internal:pgsqlPgAmTable:_cache_item_free","called\n"));
+
+    if(NULL == rowreq_ctx)
+        return;
+
+    pgsqlPgAmTable_release_rowreq_ctx(rowreq_ctx);
+} /* _cache_item_free */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+    netsnmp_container *container;
+
+    DEBUGMSGTL(("internal:pgsqlPgAmTable:_cache_free","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache in pgsqlPgAmTable_cache_free\n");
+        return;
+    }
+
+    container = (netsnmp_container*)cache->magic;
+
+    /*
+     * call user code
+     */
+    pgsqlPgAmTable_cache_free(container);
+    
+    /*
+     * free all items. inefficient, but easy.
+     */
+    CONTAINER_CLEAR(container,
+                    (netsnmp_container_obj_func *)_cache_item_free,
+                    NULL);
+} /* _cache_free */
+
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_pgsqlPgAmTable_container_init(pgsqlPgAmTable_interface_ctx *if_ctx)
+{
+    DEBUGMSGTL(("internal:pgsqlPgAmTable:_pgsqlPgAmTable_container_init","called\n"));
+    
+    /*
+     * set up the cache
+     */
+    if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+                                         _cache_load, _cache_free,
+                                         pgsqlPgAmTable_oid,
+                                         pgsqlPgAmTable_oid_size);
+
+    if(NULL == if_ctx->cache) {
+        snmp_log(LOG_ERR, "error creating cache for pgsqlPgAmTable\n");
+        return;
+    }
+
+    if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+    pgsqlPgAmTable_container_init(&if_ctx->container, if_ctx->cache);
+    if(NULL == if_ctx->container)
+        if_ctx->container = netsnmp_container_find("pgsqlPgAmTable:table_container");
+    if(NULL == if_ctx->container) {
+        snmp_log(LOG_ERR,"error creating container in "
+                 "pgsqlPgAmTable_container_init\n");
+        return;
+    }
+    if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _pgsqlPgAmTable_container_init */
+
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_interface.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_interface.h
new file mode 100644 (file)
index 0000000..86903e1
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *       version : 1.43.2.3 $ of : mfd-interface.m2c,v $
+ *
+ * $Id: pgsqlPgAmTable_interface.h,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ */
+/** @defgroup interface: Routines to interface to Net-SNMP
+ *
+ * \warning This code should not be modified, called directly,
+ *          or used to interpret functionality. It is subject to
+ *          change at any time.
+ * 
+ * @{
+ */
+/*
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ * ***                                                               ***
+ * ***  NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE  ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THIS FILE DOES NOT CONTAIN ANY USER EDITABLE CODE.      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***       THE GENERATED CODE IS INTERNAL IMPLEMENTATION, AND      ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * ***    IS SUBJECT TO CHANGE WITHOUT WARNING IN FUTURE RELEASES.   ***
+ * ***                                                               ***
+ * ***                                                               ***
+ * *********************************************************************
+ * *********************************************************************
+ * *********************************************************************
+ */
+#ifndef PGSQLPGAMTABLE_INTERFACE_H
+#define PGSQLPGAMTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "pgsqlPgAmTable.h"
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _pgsqlPgAmTable_initialize_interface(pgsqlPgAmTable_registration_ptr user_ctx,
+                                    u_long flags);
+
+    pgsqlPgAmTable_rowreq_ctx * pgsqlPgAmTable_allocate_rowreq_ctx(void);
+void pgsqlPgAmTable_release_rowreq_ctx(pgsqlPgAmTable_rowreq_ctx *rowreq_ctx);
+
+int pgsqlPgAmTable_index_to_oid(netsnmp_index *oid_idx,
+                            pgsqlPgAmTable_mib_index *mib_idx);
+int pgsqlPgAmTable_index_from_oid(netsnmp_index *oid_idx,
+                              pgsqlPgAmTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void pgsqlPgAmTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAMTABLE_INTERFACE_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_oids.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmTable/pgsqlPgAmTable_oids.h
new file mode 100644 (file)
index 0000000..85bb01d
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : generic-table-oids.m2c,v 1.10 2004/10/08 23:39:17 rstory Exp $
+ *
+ * $Id: pgsqlPgAmTable_oids.h,v 1.1 2008/01/17 12:29:36 eggyknap Exp $
+ */
+#ifndef PGSQLPGAMTABLE_OIDS_H
+#define PGSQLPGAMTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table pgsqlPgAmTable */
+#define PGSQLPGAMTABLE_OID              1,3,6,1,4,1,27645,1,2,2
+#define COLUMN_PGSQLPGAMENTRYOID               1
+#define COLUMN_PGSQLPGAMAMNAME         2
+#define COLUMN_PGSQLPGAMAMSTRATEGIES           3
+#define COLUMN_PGSQLPGAMAMSUPPORT              4
+#define COLUMN_PGSQLPGAMAMORDERSTRATEGY                5
+#define COLUMN_PGSQLPGAMAMCANUNIQUE            6
+#define COLUMN_PGSQLPGAMAMCANMULTICOL          7
+#define COLUMN_PGSQLPGAMAMOPTIONALKEY          8
+#define COLUMN_PGSQLPGAMAMINDEXNULLS           9
+#define COLUMN_PGSQLPGAMAMSTORAGE              10
+#define COLUMN_PGSQLPGAMAMCLUSTERABLE          11
+#define COLUMN_PGSQLPGAMAMINSERT               12
+#define COLUMN_PGSQLPGAMAMBEGINSCAN            13
+#define COLUMN_PGSQLPGAMAMGETTUPLE             14
+#define COLUMN_PGSQLPGAMAMGETMULTI             15
+#define COLUMN_PGSQLPGAMAMRESCAN               16
+#define COLUMN_PGSQLPGAMAMENDSCAN              17
+#define COLUMN_PGSQLPGAMAMMARKPOS              18
+#define COLUMN_PGSQLPGAMAMRESTRPOS             19
+#define COLUMN_PGSQLPGAMAMBUILD                20
+#define COLUMN_PGSQLPGAMAMBULKDELETE           21
+#define COLUMN_PGSQLPGAMAMVACUUMCLEANUP                22
+#define COLUMN_PGSQLPGAMAMCOSTESTIMATE         23
+#define COLUMN_PGSQLPGAMAMOPTIONS              24
+
+#define PGSQLPGAMTABLE_MIN_COL         COLUMN_PGSQLPGAMAMNAME
+#define PGSQLPGAMTABLE_MAX_COL         COLUMN_PGSQLPGAMAMOPTIONS
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PGSQLPGAMTABLE_OIDS_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/old/pgsqlPgAmopTable.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/old/pgsqlPgAmopTable.c
new file mode 100644 (file)
index 0000000..66de62f
--- /dev/null
@@ -0,0 +1,316 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : mib2c.iterate.conf 15999 2007-03-25 22:32:02Z dts12 $
+ */
+
+#include "pgsnmpd.h"
+#include "pgsqlPgAmopTable.h"
+
+void fill_pgsqlPgAmopTable(void);
+
+/** Initializes the pgsqlPgAmopTable module */
+void
+init_pgsqlPgAmopTable(void)
+{
+  /* here we initialize all the tables we're planning on supporting */
+    initialize_table_pgsqlPgAmopTable();
+}
+
+  /* TODO: "Determine the first/last column names" */
+
+/** Initialize the pgsqlPgAmopTable table by defining its contents and how it's structured */
+void
+initialize_table_pgsqlPgAmopTable(void)
+{
+    static oid pgsqlPgAmopTable_oid[] = {1,3,6,1,4,1,27645,1,2,3};
+    size_t pgsqlPgAmopTable_oid_len   = OID_LENGTH(pgsqlPgAmopTable_oid);
+    netsnmp_handler_registration    *reg;
+    netsnmp_iterator_info           *iinfo;
+    netsnmp_table_registration_info *table_info;
+
+    reg = netsnmp_create_handler_registration(
+              "pgsqlPgAmopTable",     pgsqlPgAmopTable_handler,
+              pgsqlPgAmopTable_oid, pgsqlPgAmopTable_oid_len,
+              HANDLER_CAN_RONLY
+              );
+
+    table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+    netsnmp_table_helper_add_indexes(table_info,
+                           ASN_OCTET_STR,  /* index: pgsnmpdConnID */
+                           ASN_INTEGER,  /* index: rdbmsDbIndex */
+                           ASN_INTEGER,  /* index: pgsqlPgAmopEntryOID */
+                           0);
+    table_info->min_column = COLUMN_PGSQLPGAMOPAMOPFAMILY;
+    table_info->max_column = COLUMN_PGSQLPGAMOPAMOPMETHOD;
+    
+    iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info );
+    iinfo->get_first_data_point = pgsqlPgAmopTable_get_first_data_point;
+    iinfo->get_next_data_point  = pgsqlPgAmopTable_get_next_data_point;
+    iinfo->table_reginfo        = table_info;
+    
+    netsnmp_register_table_iterator( reg, iinfo );
+
+    /* Initialise the contents of the table here */
+    fill_pgsqlPgAmopTable();
+}
+
+#define CONNID_LEN 255
+
+    /* Typical data structure for a row entry */
+struct pgsqlPgAmopTable_entry {
+    /* Index values */
+    u_char pgsnmpdConnID[CONNID_LEN];
+    size_t pgsnmpdConnID_len;
+    long rdbmsDbIndex;
+    long pgsqlPgAmopEntryOID;
+
+    /* Column values */
+    long pgsqlPgAmopAmopfamily;
+    long pgsqlPgAmopAmoplefttype;
+    long pgsqlPgAmopAmoprighttype;
+    int  pgsqlPgAmopAmopstrategy;
+    int  pgsqlPgAmopAmopreqcheck;
+    long pgsqlPgAmopAmopopr;
+    long pgsqlPgAmopAmopmethod;
+
+    /* Illustrate using a simple linked list */
+    int   valid;
+    struct pgsqlPgAmopTable_entry *next;
+};
+
+struct pgsqlPgAmopTable_entry  *pgsqlPgAmopTable_head = NULL;
+
+/* Quiet compiler */
+struct pgsqlPgAmopTable_entry *
+pgsqlPgAmopTable_createEntry(
+                 char* pgsnmpdConnID,
+                 size_t pgsnmpdConnID_len,
+                 long  rdbmsDbIndex,
+                 long  pgsqlPgAmopEntryOID
+                );
+void
+pgsqlPgAmopTable_removeEntry( struct pgsqlPgAmopTable_entry *entry );
+
+/* create a new row in the (unsorted) table */
+struct pgsqlPgAmopTable_entry *
+pgsqlPgAmopTable_createEntry(
+                 char* pgsnmpdConnID,
+                 size_t pgsnmpdConnID_len,
+                 long  rdbmsDbIndex,
+                 long  pgsqlPgAmopEntryOID
+                ) {
+    struct pgsqlPgAmopTable_entry *entry;
+
+    entry = SNMP_MALLOC_TYPEDEF(struct pgsqlPgAmopTable_entry);
+    if (!entry)
+        return NULL;
+
+    /*memset(entry->pgsnmpdConnID, 0, CONNID_LEN); */
+    memcpy(entry->pgsnmpdConnID, pgsnmpdConnID, pgsnmpdConnID_len);
+    entry->pgsnmpdConnID_len = pgsnmpdConnID_len;
+    entry->rdbmsDbIndex = rdbmsDbIndex;
+    entry->pgsqlPgAmopEntryOID = pgsqlPgAmopEntryOID;
+
+    entry->next = pgsqlPgAmopTable_head;
+    pgsqlPgAmopTable_head = entry;
+    return entry;
+}
+
+/* remove a row from the table */
+void
+pgsqlPgAmopTable_removeEntry( struct pgsqlPgAmopTable_entry *entry ) {
+    struct pgsqlPgAmopTable_entry *ptr, *prev;
+
+    if (!entry)
+        return;    /* Nothing to remove */
+
+    for ( ptr  = pgsqlPgAmopTable_head, prev = NULL;
+          ptr != NULL;
+          prev = ptr, ptr = ptr->next ) {
+        if ( ptr == entry )
+            break;
+    }
+    if ( !ptr )
+        return;    /* Can't find it */
+
+    if ( prev == NULL )
+        pgsqlPgAmopTable_head = ptr->next;
+    else
+        prev->next = ptr->next;
+
+    SNMP_FREE( entry );   /* XXX - release any other internal resources */
+}
+
+void fill_pgsqlPgAmopTable(void) {
+    PGresult *pg_db_query;
+    int resultCount, i;
+    struct pgsqlPgAmopTable_entry *entry;
+    char pgsnmpdConnID[112] = "Default conn ID";
+    size_t pgsnmpdConnID_len = strlen(pgsnmpdConnID) + 1;
+    long rdbmsDbIndex = 1;
+
+    snmp_log(LOG_INFO, "Initializing pgsqlPgAmopTable\n");
+    if (PQstatus(dbconn) == CONNECTION_OK) {
+        pg_db_query = PQexec(dbconn, "SELECT oid::INTEGER, amopfamily::INTEGER, amoplefttype::INTEGER, amoprighttype::INTEGER, amopstrategy, amopreqcheck, amopopr::INTEGER , amopmethod::INTEGER FROM pg_amop ORDER BY 1 ASC");
+    }
+    else {
+        snmp_log(LOG_ERR, "Can't get connected to database\n");
+        return;
+        /* TODO: I should signal MFD_RESOURCE_UNAVAILABLE somehow, here */
+    }
+
+    if (PQresultStatus(pg_db_query) != PGRES_TUPLES_OK) {
+        snmp_log(LOG_ERR, "Didn't get any results from the database\n");
+        PQclear(pg_db_query);
+        return;
+        /* TODO: I should signal MFD_RESOURCE_UNAVAILABLE somehow, here */
+    }
+    resultCount = PQntuples(pg_db_query);
+    for (i = 0; i < resultCount; i++) {
+        entry = pgsqlPgAmopTable_createEntry(pgsnmpdConnID, pgsnmpdConnID_len,
+                 rdbmsDbIndex, atol(PQgetvalue(pg_db_query, i, 0)));
+        entry->pgsqlPgAmopAmopfamily    = atol(PQgetvalue(pg_db_query, i, 1));
+        entry->pgsqlPgAmopAmoplefttype  = atol(PQgetvalue(pg_db_query, i, 2));
+        entry->pgsqlPgAmopAmoprighttype = atol(PQgetvalue(pg_db_query, i, 3));
+        entry->pgsqlPgAmopAmopstrategy  = atoi(PQgetvalue(pg_db_query, i, 4));
+        entry->pgsqlPgAmopAmopreqcheck  = atoi(PQgetvalue(pg_db_query, i, 5));
+        entry->pgsqlPgAmopAmopopr       = atol(PQgetvalue(pg_db_query, i, 6));
+        entry->pgsqlPgAmopAmopmethod    = atol(PQgetvalue(pg_db_query, i, 7));
+    }
+    snmp_log(LOG_INFO, "Finished initializing pgsqlPgAmopTable with %d entries\n", resultCount);
+}
+
+/* Example iterator hook routines - using 'get_next' to do most of the work */
+netsnmp_variable_list *
+pgsqlPgAmopTable_get_first_data_point(void **my_loop_context,
+                          void **my_data_context,
+                          netsnmp_variable_list *put_index_data,
+                          netsnmp_iterator_info *mydata)
+{
+    *my_loop_context = pgsqlPgAmopTable_head;
+    return pgsqlPgAmopTable_get_next_data_point(my_loop_context, my_data_context,
+                                    put_index_data,  mydata );
+}
+
+netsnmp_variable_list *
+pgsqlPgAmopTable_get_next_data_point(void **my_loop_context,
+                          void **my_data_context,
+                          netsnmp_variable_list *put_index_data,
+                          netsnmp_iterator_info *mydata)
+{
+    struct pgsqlPgAmopTable_entry *entry = (struct pgsqlPgAmopTable_entry *)*my_loop_context;
+    netsnmp_variable_list *idx = put_index_data;
+
+    if ( entry ) {
+        snmp_set_var_value( idx, entry->pgsnmpdConnID, sizeof(entry->pgsnmpdConnID) );
+        idx = idx->next_variable;
+        snmp_set_var_typed_integer( idx, ASN_INTEGER, entry->rdbmsDbIndex );
+        idx = idx->next_variable;
+        snmp_set_var_typed_integer( idx, ASN_INTEGER, entry->pgsqlPgAmopEntryOID );
+        idx = idx->next_variable;
+        *my_data_context = (void *)entry;
+        *my_loop_context = (void *)entry->next;
+        return put_index_data;
+    } else {
+        return NULL;
+    }
+}
+
+
+/** handles requests for the pgsqlPgAmopTable table */
+int
+pgsqlPgAmopTable_handler(
+    netsnmp_mib_handler               *handler,
+    netsnmp_handler_registration      *reginfo,
+    netsnmp_agent_request_info        *reqinfo,
+    netsnmp_request_info              *requests) {
+
+    netsnmp_request_info       *request;
+    netsnmp_table_request_info *table_info;
+    struct pgsqlPgAmopTable_entry          *table_entry;
+
+    switch (reqinfo->mode) {
+        /*
+         * Read-support (also covers GetNext requests)
+         */
+    case MODE_GET:
+        for (request=requests; request; request=request->next) {
+            table_entry = (struct pgsqlPgAmopTable_entry *)
+                              netsnmp_extract_iterator_context(request);
+            table_info  =     netsnmp_extract_table_info(      request);
+    
+            switch (table_info->colnum) {
+            case COLUMN_PGSQLPGAMOPAMOPFAMILY:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmopfamily);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPLEFTTYPE:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmoplefttype);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPRIGHTTYPE:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmoprighttype);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPSTRATEGY:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmopstrategy);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPREQCHECK:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmopreqcheck);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPOPR:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmopopr);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPMETHOD:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmopmethod);
+                break;
+            default:
+                netsnmp_set_request_error(reqinfo, request,
+                                          SNMP_NOSUCHOBJECT);
+                break;
+            }
+        }
+        break;
+
+    }
+    return SNMP_ERR_NOERROR;
+}
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/old/pgsqlPgAmopTable.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/old/pgsqlPgAmopTable.h
new file mode 100644 (file)
index 0000000..2d7ee0c
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : mib2c.iterate.conf 15999 2007-03-25 22:32:02Z dts12 $
+ */
+#ifndef PGSQLPGAMOPTABLE_H
+#define PGSQLPGAMOPTABLE_H
+
+/* function declarations */
+void init_pgsqlPgAmopTable(void);
+void initialize_table_pgsqlPgAmopTable(void);
+Netsnmp_Node_Handler pgsqlPgAmopTable_handler;
+Netsnmp_First_Data_Point  pgsqlPgAmopTable_get_first_data_point;
+Netsnmp_Next_Data_Point   pgsqlPgAmopTable_get_next_data_point;
+
+/* column number definitions for table pgsqlPgAmopTable */
+       #define COLUMN_PGSQLPGAMOPENTRYOID              1
+       #define COLUMN_PGSQLPGAMOPAMOPFAMILY            2
+       #define COLUMN_PGSQLPGAMOPAMOPLEFTTYPE          3
+       #define COLUMN_PGSQLPGAMOPAMOPRIGHTTYPE         4
+       #define COLUMN_PGSQLPGAMOPAMOPSTRATEGY          5
+       #define COLUMN_PGSQLPGAMOPAMOPREQCHECK          6
+       #define COLUMN_PGSQLPGAMOPAMOPOPR               7
+       #define COLUMN_PGSQLPGAMOPAMOPMETHOD            8
+#endif /* PGSQLPGAMOPTABLE_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/pgsqlPgAmopTable.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/pgsqlPgAmopTable.c
new file mode 100644 (file)
index 0000000..74d70f2
--- /dev/null
@@ -0,0 +1,329 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : mib2c.iterate.conf 15999 2007-03-25 22:32:02Z dts12 $
+ */
+
+#include "pgsnmpd.h"
+#include "pgsqlPgAmopTable.h"
+
+    /* TODO: if this works, move it to pgsnmpd.h */
+#define CONNIDLEN 113
+    /* Typical data structure for a row entry */
+struct pgsqlPgAmopTable_entry {
+    /* Index values */
+    u_char pgsnmpdConnID[CONNIDLEN];
+    size_t pgsnmpdConnID_len;
+    long rdbmsDbIndex;
+    long pgsqlPgAmopEntryOID;
+
+    /* Column values */
+    /*long pgsqlPgAmopEntryOID; */
+    long pgsqlPgAmopAmopfamily;
+    long pgsqlPgAmopAmoplefttype;
+    long pgsqlPgAmopAmoprighttype;
+    long pgsqlPgAmopAmopstrategy;
+    long pgsqlPgAmopAmopreqcheck;
+    long pgsqlPgAmopAmopopr;
+    long pgsqlPgAmopAmopmethod;
+
+    /* Illustrate using a simple linked list */
+    int   valid;
+    struct pgsqlPgAmopTable_entry *next;
+};
+
+struct pgsqlPgAmopTable_entry  *pgsqlPgAmopTable_head;
+
+struct pgsqlPgAmopTable_entry *pgsqlPgAmopTable_createEntry(
+                 char* pgsnmpdConnID,
+                 size_t pgsnmpdConnID_len,
+                 long  rdbmsDbIndex,
+                 long  pgsqlPgAmopEntryOID
+                );
+
+void
+pgsqlPgAmopTable_removeEntry( struct pgsqlPgAmopTable_entry *entry );
+
+/** Initializes the pgsqlPgAmopTable module */
+void
+init_pgsqlPgAmopTable(void)
+{
+  /* here we initialize all the tables we're planning on supporting */
+    initialize_table_pgsqlPgAmopTable();
+}
+
+void fill_pgsqlPgAmopTable(void) {
+    PGresult *pg_db_query;
+    int resultCount, i;
+    struct pgsqlPgAmopTable_entry *entry;
+    char pgsnmpdConnID[112] = "Default conn ID";
+    size_t pgsnmpdConnID_len = strlen(pgsnmpdConnID) + 1;
+    long rdbmsDbIndex = 1;
+
+    snmp_log(LOG_INFO, "Initializing pgsqlPgAmopTable\n");
+    if (PQstatus(dbconn) == CONNECTION_OK) {
+        pg_db_query = PQexec(dbconn, "SELECT oid::INTEGER, amopfamily::INTEGER, amoplefttype::INTEGER, amoprighttype::INTEGER, amopstrategy, amopreqcheck, amopopr::INTEGER , amopmethod::INTEGER FROM pg_amop ORDER BY 1 ASC LIMIT 3");
+    }
+    else {
+        snmp_log(LOG_ERR, "Can't get connected to database\n");
+        return;
+        /* TODO: I should signal MFD_RESOURCE_UNAVAILABLE somehow, here */
+    }
+
+    if (PQresultStatus(pg_db_query) != PGRES_TUPLES_OK) {
+        snmp_log(LOG_ERR, "Didn't get any results from the database\n");
+        PQclear(pg_db_query);
+        return;
+        /* TODO: I should signal MFD_RESOURCE_UNAVAILABLE somehow, here */
+    }
+    resultCount = PQntuples(pg_db_query);
+    for (i = 0; i < resultCount; i++) {
+        entry = pgsqlPgAmopTable_createEntry(pgsnmpdConnID, pgsnmpdConnID_len,
+                 rdbmsDbIndex, atol(PQgetvalue(pg_db_query, i, 0)));
+        entry->pgsqlPgAmopAmopfamily    = atol(PQgetvalue(pg_db_query, i, 1));
+        entry->pgsqlPgAmopAmoplefttype  = atol(PQgetvalue(pg_db_query, i, 2));
+        entry->pgsqlPgAmopAmoprighttype = atol(PQgetvalue(pg_db_query, i, 3));
+        entry->pgsqlPgAmopAmopstrategy  = atoi(PQgetvalue(pg_db_query, i, 4));
+        entry->pgsqlPgAmopAmopreqcheck  = atoi(PQgetvalue(pg_db_query, i, 5));
+        entry->pgsqlPgAmopAmopopr       = atol(PQgetvalue(pg_db_query, i, 6));
+        entry->pgsqlPgAmopAmopmethod    = atol(PQgetvalue(pg_db_query, i, 7));
+    }
+    snmp_log(LOG_INFO, "Finished initializing pgsqlPgAmopTable with %d entries\n", resultCount);
+}
+
+/* TODO # Determine the first/last column names */
+
+/** Initialize the pgsqlPgAmopTable table by defining its contents and how it's structured */
+void
+initialize_table_pgsqlPgAmopTable(void)
+{
+    static oid pgsqlPgAmopTable_oid[] = {1,3,6,1,4,1,27645,1,2,3};
+    size_t pgsqlPgAmopTable_oid_len   = OID_LENGTH(pgsqlPgAmopTable_oid);
+    netsnmp_handler_registration    *reg;
+    netsnmp_iterator_info           *iinfo;
+    netsnmp_table_registration_info *table_info;
+    struct pgsqlPgAmopTable_entry *entry;
+    char *connID = "Default conn ID\0";
+    int conn_len = strlen(connID);
+
+    reg = netsnmp_create_handler_registration(
+              "pgsqlPgAmopTable",     pgsqlPgAmopTable_handler,
+              pgsqlPgAmopTable_oid, pgsqlPgAmopTable_oid_len,
+              HANDLER_CAN_RONLY
+              );
+
+    table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+    netsnmp_table_helper_add_indexes(table_info,
+                           ASN_OCTET_STR,  /* index: pgsnmpdConnID */
+                           ASN_INTEGER,  /* index: rdbmsDbIndex */
+                           ASN_INTEGER,  /* index: pgsqlPgAmopEntryOID */
+                           0);
+    table_info->min_column = COLUMN_PGSQLPGAMOPENTRYOID;
+    table_info->max_column = COLUMN_PGSQLPGAMOPAMOPMETHOD;
+    
+    iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info );
+    iinfo->get_first_data_point = pgsqlPgAmopTable_get_first_data_point;
+    iinfo->get_next_data_point  = pgsqlPgAmopTable_get_next_data_point;
+    iinfo->table_reginfo        = table_info;
+    
+    netsnmp_register_table_iterator( reg, iinfo );
+
+    /* Initialise the contents of the table here */
+    fill_pgsqlPgAmopTable();
+}
+
+/* create a new row in the (unsorted) table */
+struct pgsqlPgAmopTable_entry *
+pgsqlPgAmopTable_createEntry(
+                 char* pgsnmpdConnID,
+                 size_t pgsnmpdConnID_len,
+                 long  rdbmsDbIndex,
+                 long  pgsqlPgAmopEntryOID
+                ) {
+    struct pgsqlPgAmopTable_entry *entry;
+
+    entry = SNMP_MALLOC_TYPEDEF(struct pgsqlPgAmopTable_entry);
+    if (!entry)
+        return NULL;
+
+    memset(entry->pgsnmpdConnID, 0, CONNIDLEN);
+    memcpy(entry->pgsnmpdConnID, pgsnmpdConnID, pgsnmpdConnID_len);
+    entry->pgsnmpdConnID_len = pgsnmpdConnID_len;
+    entry->rdbmsDbIndex = rdbmsDbIndex;
+    entry->pgsqlPgAmopEntryOID = pgsqlPgAmopEntryOID;
+    entry->next = pgsqlPgAmopTable_head;
+    pgsqlPgAmopTable_head = entry;
+    return entry;
+}
+
+/* remove a row from the table */
+void
+pgsqlPgAmopTable_removeEntry( struct pgsqlPgAmopTable_entry *entry ) {
+    struct pgsqlPgAmopTable_entry *ptr, *prev;
+
+    if (!entry)
+        return;    /* Nothing to remove */
+
+    for ( ptr  = pgsqlPgAmopTable_head, prev = NULL;
+          ptr != NULL;
+          prev = ptr, ptr = ptr->next ) {
+        if ( ptr == entry )
+            break;
+    }
+    if ( !ptr )
+        return;    /* Can't find it */
+
+    if ( prev == NULL )
+        pgsqlPgAmopTable_head = ptr->next;
+    else
+        prev->next = ptr->next;
+
+    SNMP_FREE( entry );   /* XXX - release any other internal resources */
+}
+
+
+/* Example iterator hook routines - using 'get_next' to do most of the work */
+netsnmp_variable_list *
+pgsqlPgAmopTable_get_first_data_point(void **my_loop_context,
+                          void **my_data_context,
+                          netsnmp_variable_list *put_index_data,
+                          netsnmp_iterator_info *mydata)
+{
+    *my_loop_context = pgsqlPgAmopTable_head;
+    snmp_log(LOG_INFO, "*** get_first called\n");
+    return pgsqlPgAmopTable_get_next_data_point(my_loop_context, my_data_context,
+                                    put_index_data,  mydata );
+}
+
+netsnmp_variable_list *
+pgsqlPgAmopTable_get_next_data_point(void **my_loop_context,
+                          void **my_data_context,
+                          netsnmp_variable_list *put_index_data,
+                          netsnmp_iterator_info *mydata)
+{
+    struct pgsqlPgAmopTable_entry *entry = (struct pgsqlPgAmopTable_entry *)*my_loop_context;
+    netsnmp_variable_list *idx = put_index_data;
+
+    snmp_log(LOG_INFO, "*** get_next called\n");
+    if ( entry ) {
+        snmp_set_var_value( idx, entry->pgsnmpdConnID, sizeof(entry->pgsnmpdConnID) );
+        idx = idx->next_variable;
+        snmp_set_var_typed_integer( idx, ASN_INTEGER, entry->rdbmsDbIndex );
+        idx = idx->next_variable;
+        snmp_set_var_typed_integer( idx, ASN_INTEGER, entry->pgsqlPgAmopEntryOID );
+        idx = idx->next_variable;
+        *my_data_context = (void *)entry;
+        *my_loop_context = (void *)entry->next;
+        return put_index_data;
+    } else {
+        return NULL;
+    }
+}
+
+
+/** handles requests for the pgsqlPgAmopTable table */
+int
+pgsqlPgAmopTable_handler(
+    netsnmp_mib_handler               *handler,
+    netsnmp_handler_registration      *reginfo,
+    netsnmp_agent_request_info        *reqinfo,
+    netsnmp_request_info              *requests) {
+
+    netsnmp_request_info       *request;
+    netsnmp_table_request_info *table_info;
+    struct pgsqlPgAmopTable_entry          *table_entry;
+
+    snmp_log(LOG_INFO, "Handler called\n");
+    switch (reqinfo->mode) {
+        /*
+         * Read-support (also covers GetNext requests)
+         */
+    case MODE_GET:
+        for (request=requests; request; request=request->next) {
+            table_entry = (struct pgsqlPgAmopTable_entry *)
+                              netsnmp_extract_iterator_context(request);
+            table_info  =     netsnmp_extract_table_info(      request);
+    
+            switch (table_info->colnum) {
+            case COLUMN_PGSQLPGAMOPENTRYOID:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopEntryOID);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPFAMILY:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmopfamily);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPLEFTTYPE:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmoplefttype);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPRIGHTTYPE:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmoprighttype);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPSTRATEGY:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmopstrategy);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPREQCHECK:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmopreqcheck);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPOPR:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmopopr);
+                break;
+            case COLUMN_PGSQLPGAMOPAMOPMETHOD:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAmopAmopmethod);
+                break;
+            default:
+                netsnmp_set_request_error(reqinfo, request,
+                                          SNMP_NOSUCHOBJECT);
+                break;
+            }
+        }
+        break;
+
+    }
+    return SNMP_ERR_NOERROR;
+}
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/pgsqlPgAmopTable.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/pgsqlPgAmopTable.h
new file mode 100644 (file)
index 0000000..2d7ee0c
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : mib2c.iterate.conf 15999 2007-03-25 22:32:02Z dts12 $
+ */
+#ifndef PGSQLPGAMOPTABLE_H
+#define PGSQLPGAMOPTABLE_H
+
+/* function declarations */
+void init_pgsqlPgAmopTable(void);
+void initialize_table_pgsqlPgAmopTable(void);
+Netsnmp_Node_Handler pgsqlPgAmopTable_handler;
+Netsnmp_First_Data_Point  pgsqlPgAmopTable_get_first_data_point;
+Netsnmp_Next_Data_Point   pgsqlPgAmopTable_get_next_data_point;
+
+/* column number definitions for table pgsqlPgAmopTable */
+       #define COLUMN_PGSQLPGAMOPENTRYOID              1
+       #define COLUMN_PGSQLPGAMOPAMOPFAMILY            2
+       #define COLUMN_PGSQLPGAMOPAMOPLEFTTYPE          3
+       #define COLUMN_PGSQLPGAMOPAMOPRIGHTTYPE         4
+       #define COLUMN_PGSQLPGAMOPAMOPSTRATEGY          5
+       #define COLUMN_PGSQLPGAMOPAMOPREQCHECK          6
+       #define COLUMN_PGSQLPGAMOPAMOPOPR               7
+       #define COLUMN_PGSQLPGAMOPAMOPMETHOD            8
+#endif /* PGSQLPGAMOPTABLE_H */
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/tmp/pgsqlPgAggregateTable.c b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/tmp/pgsqlPgAggregateTable.c
new file mode 100644 (file)
index 0000000..b9e769d
--- /dev/null
@@ -0,0 +1,254 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : mib2c.iterate.conf 15999 2007-03-25 22:32:02Z dts12 $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include "pgsqlPgAggregateTable.h"
+
+/** Initializes the pgsqlPgAggregateTable module */
+void
+init_pgsqlPgAggregateTable(void)
+{
+  /* here we initialize all the tables we're planning on supporting */
+    initialize_table_pgsqlPgAggregateTable();
+}
+
+  # Determine the first/last column names
+
+/** Initialize the pgsqlPgAggregateTable table by defining its contents and how it's structured */
+void
+initialize_table_pgsqlPgAggregateTable(void)
+{
+    static oid pgsqlPgAggregateTable_oid[] = {1,3,6,1,4,1,27645,1,2,1};
+    size_t pgsqlPgAggregateTable_oid_len   = OID_LENGTH(pgsqlPgAggregateTable_oid);
+    netsnmp_handler_registration    *reg;
+    netsnmp_iterator_info           *iinfo;
+    netsnmp_table_registration_info *table_info;
+
+    reg = netsnmp_create_handler_registration(
+              "pgsqlPgAggregateTable",     pgsqlPgAggregateTable_handler,
+              pgsqlPgAggregateTable_oid, pgsqlPgAggregateTable_oid_len,
+              HANDLER_CAN_RONLY
+              );
+
+    table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info );
+    netsnmp_table_helper_add_indexes(table_info,
+                           ASN_OCTET_STR,  /* index: pgsnmpdConnID */
+                           ASN_INTEGER,  /* index: rdbmsDbIndex */
+                           ASN_INTEGER,  /* index: pgsqlPgAggregateEntryOID */
+                           0);
+    table_info->min_column = COLUMN_PGSQLPGAGGREGATEAGGFNOID;
+    table_info->max_column = COLUMN_PGSQLPGAGGREGATEAGGINITVAL;
+    
+    iinfo = SNMP_MALLOC_TYPEDEF( netsnmp_iterator_info );
+    iinfo->get_first_data_point = pgsqlPgAggregateTable_get_first_data_point;
+    iinfo->get_next_data_point  = pgsqlPgAggregateTable_get_next_data_point;
+    iinfo->table_reginfo        = table_info;
+    
+    netsnmp_register_table_iterator( reg, iinfo );
+
+    /* Initialise the contents of the table here */
+}
+
+    /* Typical data structure for a row entry */
+struct pgsqlPgAggregateTable_entry {
+    /* Index values */
+    char pgsnmpdConnID[NNN];
+    size_t pgsnmpdConnID_len;
+    long rdbmsDbIndex;
+    long pgsqlPgAggregateEntryOID;
+
+    /* Column values */
+    long pgsqlPgAggregateAggfnoid;
+    long pgsqlPgAggregateAggtransfn;
+    long pgsqlPgAggregateAggfinalfn;
+    long pgsqlPgAggregateAggsortop;
+    long pgsqlPgAggregateAggtranstype;
+    char pgsqlPgAggregateAgginitval[NNN];
+    size_t pgsqlPgAggregateAgginitval_len;
+
+    /* Illustrate using a simple linked list */
+    int   valid;
+    struct pgsqlPgAggregateTable_entry *next;
+};
+
+struct pgsqlPgAggregateTable_entry  *pgsqlPgAggregateTable_head;
+
+/* create a new row in the (unsorted) table */
+struct pgsqlPgAggregateTable_entry *
+pgsqlPgAggregateTable_createEntry(
+                 char* pgsnmpdConnID,
+                 size_t pgsnmpdConnID_len,
+                 long  rdbmsDbIndex,
+                 long  pgsqlPgAggregateEntryOID,
+                ) {
+    struct pgsqlPgAggregateTable_entry *entry;
+
+    entry = SNMP_MALLOC_TYPEDEF(struct pgsqlPgAggregateTable_entry);
+    if (!entry)
+        return NULL;
+
+    memcpy(entry->pgsnmpdConnID, pgsnmpdConnID, pgsnmpdConnID_len);
+    entry->pgsnmpdConnID_len = pgsnmpdConnID_len;
+    entry->rdbmsDbIndex = rdbmsDbIndex;
+    entry->pgsqlPgAggregateEntryOID = pgsqlPgAggregateEntryOID;
+    entry->next = pgsqlPgAggregateTable_head;
+    pgsqlPgAggregateTable_head = entry;
+    return entry;
+}
+
+/* remove a row from the table */
+void
+pgsqlPgAggregateTable_removeEntry( struct pgsqlPgAggregateTable_entry *entry ) {
+    struct pgsqlPgAggregateTable_entry *ptr, *prev;
+
+    if (!entry)
+        return;    /* Nothing to remove */
+
+    for ( ptr  = pgsqlPgAggregateTable_head, prev = NULL;
+          ptr != NULL;
+          prev = ptr, ptr = ptr->next ) {
+        if ( ptr == entry )
+            break;
+    }
+    if ( !ptr )
+        return;    /* Can't find it */
+
+    if ( prev == NULL )
+        pgsqlPgAggregateTable_head = ptr->next;
+    else
+        prev->next = ptr->next;
+
+    SNMP_FREE( entry );   /* XXX - release any other internal resources */
+}
+
+
+/* Example iterator hook routines - using 'get_next' to do most of the work */
+netsnmp_variable_list *
+pgsqlPgAggregateTable_get_first_data_point(void **my_loop_context,
+                          void **my_data_context,
+                          netsnmp_variable_list *put_index_data,
+                          netsnmp_iterator_info *mydata)
+{
+    *my_loop_context = pgsqlPgAggregateTable_head;
+    return pgsqlPgAggregateTable_get_next_data_point(my_loop_context, my_data_context,
+                                    put_index_data,  mydata );
+}
+
+netsnmp_variable_list *
+pgsqlPgAggregateTable_get_next_data_point(void **my_loop_context,
+                          void **my_data_context,
+                          netsnmp_variable_list *put_index_data,
+                          netsnmp_iterator_info *mydata)
+{
+    struct pgsqlPgAggregateTable_entry *entry = (struct pgsqlPgAggregateTable_entry *)*my_loop_context;
+    netsnmp_variable_list *idx = put_index_data;
+
+    if ( entry ) {
+        snmp_set_var_value( idx, entry->pgsnmpdConnID, sizeof(entry->pgsnmpdConnID) );
+        idx = idx->next_variable;
+        snmp_set_var_typed_integer( idx, ASN_INTEGER, entry->rdbmsDbIndex );
+        idx = idx->next_variable;
+        snmp_set_var_typed_integer( idx, ASN_INTEGER, entry->pgsqlPgAggregateEntryOID );
+        idx = idx->next_variable;
+        *my_data_context = (void *)entry;
+        *my_loop_context = (void *)entry->next;
+        return put_index_data;
+    } else {
+        return NULL;
+    }
+}
+
+
+/** handles requests for the pgsqlPgAggregateTable table */
+int
+pgsqlPgAggregateTable_handler(
+    netsnmp_mib_handler               *handler,
+    netsnmp_handler_registration      *reginfo,
+    netsnmp_agent_request_info        *reqinfo,
+    netsnmp_request_info              *requests) {
+
+    netsnmp_request_info       *request;
+    netsnmp_table_request_info *table_info;
+    struct pgsqlPgAggregateTable_entry          *table_entry;
+
+    switch (reqinfo->mode) {
+        /*
+         * Read-support (also covers GetNext requests)
+         */
+    case MODE_GET:
+        for (request=requests; request; request=request->next) {
+            table_entry = (struct pgsqlPgAggregateTable_entry *)
+                              netsnmp_extract_iterator_context(request);
+            table_info  =     netsnmp_extract_table_info(      request);
+    
+            switch (table_info->colnum) {
+            case COLUMN_PGSQLPGAGGREGATEAGGFNOID:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAggregateAggfnoid);
+                break;
+            case COLUMN_PGSQLPGAGGREGATEAGGTRANSFN:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAggregateAggtransfn);
+                break;
+            case COLUMN_PGSQLPGAGGREGATEAGGFINALFN:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAggregateAggfinalfn);
+                break;
+            case COLUMN_PGSQLPGAGGREGATEAGGSORTOP:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAggregateAggsortop);
+                break;
+            case COLUMN_PGSQLPGAGGREGATEAGGTRANSTYPE:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER,
+                                            table_entry->pgsqlPgAggregateAggtranstype);
+                break;
+            case COLUMN_PGSQLPGAGGREGATEAGGINITVAL:
+                if ( !table_entry ) {
+                    netsnmp_set_request_error(reqinfo, request,
+                                              SNMP_NOSUCHINSTANCE);
+                    continue;
+                }
+                snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR,
+                                 (u_char*)table_entry->pgsqlPgAggregateAgginitval,
+                                          table_entry->pgsqlPgAggregateAgginitval_len);
+                break;
+            default:
+                netsnmp_set_request_error(reqinfo, request,
+                                          SNMP_NOSUCHOBJECT);
+                break;
+            }
+        }
+        break;
+
+    }
+    return SNMP_ERR_NOERROR;
+}
diff --git a/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/tmp/pgsqlPgAggregateTable.h b/PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/tmp/pgsqlPgAggregateTable.h
new file mode 100644 (file)
index 0000000..57e2917
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *  : mib2c.iterate.conf 15999 2007-03-25 22:32:02Z dts12 $
+ */
+#ifndef PGSQLPGAGGREGATETABLE_H
+#define PGSQLPGAGGREGATETABLE_H
+
+/* function declarations */
+void init_pgsqlPgAggregateTable(void);
+void initialize_table_pgsqlPgAggregateTable(void);
+Netsnmp_Node_Handler pgsqlPgAggregateTable_handler;
+Netsnmp_First_Data_Point  pgsqlPgAggregateTable_get_first_data_point;
+Netsnmp_Next_Data_Point   pgsqlPgAggregateTable_get_next_data_point;
+
+/* column number definitions for table pgsqlPgAggregateTable */
+       #define COLUMN_PGSQLPGAGGREGATEENTRYOID         1
+       #define COLUMN_PGSQLPGAGGREGATEAGGFNOID         2
+       #define COLUMN_PGSQLPGAGGREGATEAGGTRANSFN               3
+       #define COLUMN_PGSQLPGAGGREGATEAGGFINALFN               4
+       #define COLUMN_PGSQLPGAGGREGATEAGGSORTOP                5
+       #define COLUMN_PGSQLPGAGGREGATEAGGTRANSTYPE             6
+       #define COLUMN_PGSQLPGAGGREGATEAGGINITVAL               7
+#endif /* PGSQLPGAGGREGATETABLE_H */
diff --git a/RDBMS-MIB b/RDBMS-MIB
new file mode 100644 (file)
index 0000000..1cfa5ac
--- /dev/null
+++ b/RDBMS-MIB
@@ -0,0 +1,1420 @@
+  RDBMS-MIB DEFINITIONS ::= BEGIN
+
+  IMPORTS
+     MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
+      Counter32, Gauge32, Integer32
+          FROM SNMPv2-SMI
+      DisplayString, DateAndTime, AutonomousType
+          FROM SNMPv2-TC
+      applIndex, applGroup
+          FROM APPLICATION-MIB
+      mib-2
+          FROM RFC1213-MIB;
+
+  rdbmsMIB MODULE-IDENTITY
+      LAST-UPDATED "9406150655Z"
+      ORGANIZATION "IETF RDBMSMIB Working Group"
+      CONTACT-INFO
+              "           David Brower
+
+                  Postal: The ASK Group, INGRES DBMS Development
+                          1080 Marina Village Parkway
+                          Alameda, CA  94501
+                          US
+
+                     Tel: +1 510 748 3418
+                     Fax: +1 510 748 2770
+
+                  E-mail: daveb@ingres.com"
+      DESCRIPTION
+          "The MIB module to describe objects for generic relational
+           databases."
+
+      ::= { mib-2 39 }
+
+  rdbmsObjects        OBJECT IDENTIFIER ::= { rdbmsMIB 1 }
+
+  ----------------------------------------------------------------
+
+  rdbmsDbTable    OBJECT-TYPE
+      SYNTAX      SEQUENCE OF RdbmsDbEntry
+      MAX-ACCESS  not-accessible
+      STATUS      current
+      DESCRIPTION
+          "The table of databases installed on a system."
+      ::= { rdbmsObjects 1 }
+
+  rdbmsDbEntry    OBJECT-TYPE
+      SYNTAX      RdbmsDbEntry
+      MAX-ACCESS  not-accessible
+      STATUS      current
+      DESCRIPTION
+          "An entry for a single database on the host.  Whether a
+           particular database is represented by a row in rdbmsDbTable
+           may be dependent on the activity level of that database,
+           according to the product's implementation.  An instance of
+           rdbmsRelState having the value active, other, or restricted
+           implies that an entry, corresponding to that instance, will
+           be present."
+      INDEX  { rdbmsDbIndex }
+      ::= { rdbmsDbTable 1 }
+
+  RdbmsDbEntry    ::=
+      SEQUENCE {
+          rdbmsDbIndex            INTEGER,
+          rdbmsDbPrivateMibOID        OBJECT IDENTIFIER,
+          rdbmsDbVendorName       DisplayString,
+          rdbmsDbName             DisplayString,
+          rdbmsDbContact          DisplayString
+      }
+
+  rdbmsDbIndex        OBJECT-TYPE
+      SYNTAX          INTEGER (1..2147483647)
+      MAX-ACCESS      not-accessible
+      STATUS          current
+      DESCRIPTION
+          "A numeric index, unique among all the databases from all
+           products on this host.  This value is a surrogate for the
+           conceptually unique key, which is {PrivateMibOID,
+           databasename}"
+      ::= { rdbmsDbEntry  1 }
+
+  rdbmsDbPrivateMibOID    OBJECT-TYPE
+      SYNTAX          OBJECT IDENTIFIER
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+         "The authoritative identification for the private MIB for
+          this database, presumably based on the vendor, e.g., {
+          enterprises 111 <optional subidentifiers>} for Oracle
+          databases, {enterprises 757 <optional subidentifiers>} for
+          Ingres databases, { enterprises 897 <optional
+          subidentifiers>} for Sybase databases, etc.
+
+          If no OBJECT IDENTIFIER exists for the private MIB, attempts
+
+          to access this object will return noSuchName (SNMPv1)
+          or noSuchInstance (SNMPv2)."
+      ::= { rdbmsDbEntry  2 }
+
+  rdbmsDbVendorName   OBJECT-TYPE
+      SYNTAX          DisplayString
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+          "The name of the vendor whose RDBMS manages this database,
+           for informational purposes."
+      ::= { rdbmsDbEntry 3 }
+
+  rdbmsDbName     OBJECT-TYPE
+      SYNTAX      DisplayString
+      MAX-ACCESS  read-only
+      STATUS      current
+      DESCRIPTION
+          "The name of this database, in a product specific format.  The
+           product may need to qualify the name in some way to resolve
+           conflicts if it is possible for a database name to be
+           duplicated on a host.  It might be necessary to construct a
+           hierarchical name embedding the RDBMS instance/installation
+           on the host, and/or the owner of the database.  For instance,
+           '/test-installation/database-owner/database-name'."
+      ::= { rdbmsDbEntry 4 }
+
+  rdbmsDbContact  OBJECT-TYPE
+      SYNTAX      DisplayString
+      MAX-ACCESS  read-write
+      STATUS      current
+      DESCRIPTION
+          "The textual identification of the contact person for this
+           managed database, together with information on how to contact
+           this person.
+
+           Note: if there is no server associated with this database, an
+           agent may need to keep this in other persistent storage,
+           e.g., a configuration file.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+      ::= { rdbmsDbEntry 5 }
+
+  ----------------------------------------------------------------
+
+  rdbmsDbInfoTable    OBJECT-TYPE
+      SYNTAX          SEQUENCE OF RdbmsDbInfoEntry
+      MAX-ACCESS      not-accessible
+      STATUS          current
+      DESCRIPTION
+          "The table of additional information about databases present
+           on the host."
+      ::= { rdbmsObjects 2 }
+
+  rdbmsDbInfoEntry    OBJECT-TYPE
+      SYNTAX          RdbmsDbInfoEntry
+      MAX-ACCESS      not-accessible
+      STATUS          current
+      DESCRIPTION
+          "Information that must be present if the database is actively
+           opened.  If the database is not actively opened, then
+           attempts to access corresponding instances in this table may
+           result in either noSuchName (SNMPv1) or noSuchInstance
+           (SNMPv2).  'Actively opened' means at least one of the
+           rdbmsRelState entries for this database in the rdbmsRelTable
+           is active(2)."
+      INDEX  { rdbmsDbIndex }
+      ::= { rdbmsDbInfoTable 1 }
+
+  RdbmsDbInfoEntry ::=
+      SEQUENCE {
+          rdbmsDbInfoProductName      DisplayString,
+          rdbmsDbInfoVersion          DisplayString,
+          rdbmsDbInfoSizeUnits        INTEGER,
+          rdbmsDbInfoSizeAllocated    INTEGER,
+          rdbmsDbInfoSizeUsed         INTEGER,
+          rdbmsDbInfoLastBackup       DateAndTime
+      }
+
+  rdbmsDbInfoProductName  OBJECT-TYPE
+      SYNTAX          DisplayString
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+          "The textual product name of the server that created or last
+           restructured this database.  The format is product specific."
+      ::= { rdbmsDbInfoEntry 1 }
+
+  rdbmsDbInfoVersion  OBJECT-TYPE
+      SYNTAX          DisplayString
+      MAX-ACCESS      read-only
+
+      STATUS          current
+      DESCRIPTION
+          "The version number of the server that created or last
+           restructured this database.  The format is product specific."
+      ::= { rdbmsDbInfoEntry 2 }
+
+  rdbmsDbInfoSizeUnits    OBJECT-TYPE
+      SYNTAX              INTEGER {
+                              bytes(1),
+                              kbytes(2),
+                              mbytes(3),
+                              gbytes(4),
+                              tbytes(5)
+                              }
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "Identification of the units used to measure the size of this
+           database in rdbmsDbInfoSizeAllocated and rdbmsDbInfoSizeUsed.
+           bytes(1) indicates individual bytes, kbytes(2) indicates
+           units of kilobytes, mbytes(3) indicates units of megabytes,
+           gbytes(4) indicates units of gigabytes, and tbytes(5)
+           indicates units of terabytes.  All are binary multiples -- 1K
+           = 1024.  If writable, changes here are reflected in the get
+           values of the associated objects."
+
+      ::= { rdbmsDbInfoEntry 3 }
+
+  rdbmsDbInfoSizeAllocated    OBJECT-TYPE
+      SYNTAX                  INTEGER (1..2147483647)
+      MAX-ACCESS              read-write
+      STATUS                  current
+      DESCRIPTION
+          "The estimated size of this database (in
+           rdbmsDbInfoSizeUnits), which is the disk space that has been
+           allocated to it and is no longer available to users on this
+           host.  rdbmsDbInfoSize does not necessarily indicate the
+           amount of space actually in use for database data.  Some
+           databases may support extending allocated size, and others
+           may not.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+  --       Note:  computing SizeAllocated may be expensive, and SNMP
+  --       agents might cache the value to increase performance.
+
+      ::= { rdbmsDbInfoEntry 4 }
+
+  rdbmsDbInfoSizeUsed     OBJECT-TYPE
+      SYNTAX              INTEGER (1..2147483647)
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The estimated size of this database, in rdbmsDbInfoSizeUnits,
+           which is actually in use for database data."
+
+  --       Note:  computing SizeUsed may be expensive, and SNMP
+  --       agents might cache the value to increase performance.
+      ::= { rdbmsDbInfoEntry 5 }
+
+  rdbmsDbInfoLastBackup       OBJECT-TYPE
+       SYNTAX                 DateAndTime
+       MAX-ACCESS             read-only
+       STATUS                 current
+       DESCRIPTION
+          "The date and time that the latest complete or partial backup
+           of the database was taken. If a database has never been
+           backed up, then attempts to access this object will
+           result in either noSuchName (SNMPv1) or noSuchInstance
+           (SNMPv2)."
+       ::= { rdbmsDbInfoEntry 6 }
+
+  ----------------------------------------------------------------
+
+  rdbmsDbParamTable       OBJECT-TYPE
+      SYNTAX              SEQUENCE OF RdbmsDbParamEntry
+      MAX-ACCESS          not-accessible
+      STATUS              current
+      DESCRIPTION
+          "The table of configuration parameters for a database.
+           Entries should be populated according to the following
+           guidelines:
+           (1) The value should be specified through administrative
+               (human) intervention.
+           (2) It should be configured on a per-database basis.
+           (3) One of the following is true:
+               (a) The parameter has a non-numeric value;
+               (b) The current value is numeric, but it only changes due
+                   to human intervention;
+               (c) The current value is numeric and dynamic, but the
+                   RDBMS does not track access/allocation failures
+                   related to the parameter;
+               (d) The current value is numeric and dynamic, the
+                   RDBMS tracks changes in access/allocation failures
+                   related to the parameter, but the failure has no
+                   significant impact on RDBMS performance or
+
+                   availability.
+               (e) The current value is numeric and dynamic, the
+                   RDBMS tracks changes in access/allocation failures
+                   related to the parameter, the failure has
+                   significant impact on RDBMS performance or
+                   availability, and is shown in the
+                   rdbmsDbLimitedResource table."
+      ::= { rdbmsObjects 3 }
+
+  rdbmsDbParamEntry       OBJECT-TYPE
+      SYNTAX              RdbmsDbParamEntry
+      MAX-ACCESS          not-accessible
+      STATUS              current
+      DESCRIPTION
+          "An entry for a single configuration parameter for a database.
+           Parameters with single values have a subindex value of one.
+           If the parameter is naturally considered to contain a
+           variable number of members of a class, e.g.  members of the
+           DBA user group, or files which are part of the database, then
+           it must be presented as a set of rows.  If, on the other
+           hand, the parameter represents a set of choices from a class,
+           e.g. the permissions on a file or the options chosen out of
+           the set of all options allowed, AND is guaranteed to always
+           fit in the 255 character length of a DisplayString, then it
+           may be presented as a comma separated list with a subindex
+           value of one.  Zero may not be used as a subindex value.
+
+           If the database is not actively opened, then attempts
+           to access corresponding instances in this table may result in
+           either noSuchName (SNMPv1) or noSuchInstance (SNMPv2).
+           'Actively opened' means at least one of the
+           rdbmsRelState entries for this database in the rdbmsRelTable
+           is active(2)."
+      INDEX  { rdbmsDbIndex, rdbmsDbParamName, rdbmsDbParamSubIndex }
+      ::= { rdbmsDbParamTable 1 }
+
+  RdbmsDbParamEntry ::=
+      SEQUENCE {
+          rdbmsDbParamName                DisplayString,
+          rdbmsDbParamSubIndex            INTEGER,
+          rdbmsDbParamID                  AutonomousType,
+          rdbmsDbParamCurrValue           DisplayString,
+          rdbmsDbParamComment             DisplayString
+      }
+
+  rdbmsDbParamName        OBJECT-TYPE
+      SYNTAX              DisplayString (SIZE (1..64))
+      MAX-ACCESS          not-accessible
+
+      STATUS              current
+      DESCRIPTION
+          "The name of a configuration parameter for a database.  This
+           name is product-specific.  The length is limited to 64
+           characters to constrain the number of sub-identifiers needed
+           for instance identification (and to minimize network
+           traffic)."
+
+      ::= { rdbmsDbParamEntry 1 }
+
+  rdbmsDbParamSubIndex    OBJECT-TYPE
+      SYNTAX              INTEGER (1..2147483647)
+      MAX-ACCESS          not-accessible
+      STATUS              current
+      DESCRIPTION
+          "The subindex value for this parameter.  If the parameter is
+           naturally considered to contain a variable number of members
+           of a class, e.g.  members of the DBA user group, or files
+           which are part of the database, then it must be presented as
+           a set of rows.  If, on the other hand, the parameter
+           represents a set of choices from a class, e.g. the
+           permissions on a file or the options chosen out of the set of
+           all options allowed, AND is guaranteed to always fit in the
+           255 character length of a DisplayString, then it may be
+           presented as a comma separated list with a subindex value of
+           one.  Zero may not be used as a value."
+      ::= { rdbmsDbParamEntry 2 }
+
+  rdbmsDbParamID          OBJECT-TYPE
+      SYNTAX              AutonomousType
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The ID of the parameter which may be described in some other
+           MIB (e.g., an enterprise-specific MIB module).  If there is
+           no ID for this rdbmsDbParamName, attempts to access this
+           object will return noSuchName (SNMPv1) or noSuchInstance
+           (SNMPv2)."
+      ::= { rdbmsDbParamEntry 3 }
+
+  rdbmsDbParamCurrValue OBJECT-TYPE
+      SYNTAX              DisplayString
+      MAX-ACCESS          read-write
+      STATUS              current
+      DESCRIPTION
+          "The value for a configuration parameter now in effect, the
+           actual setting for the database.  While there may multiple
+           values in the temporal domain of interest (for instance, the
+
+           value to take effect at the next restart), this is the
+           current setting.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+      ::= { rdbmsDbParamEntry 4 }
+
+  rdbmsDbParamComment     OBJECT-TYPE
+      SYNTAX              DisplayString
+      MAX-ACCESS          read-write
+      STATUS              current
+      DESCRIPTION
+          "Annotation which describes the purpose of a configuration
+           parameter or the reason for a particular parameter's
+           setting.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+      ::= { rdbmsDbParamEntry 5 }
+
+  ----------------------------------------------------------------
+
+  rdbmsDbLimitedResourceTable         OBJECT-TYPE
+      SYNTAX          SEQUENCE OF RdbmsDbLimitedResourceEntry
+      MAX-ACCESS      not-accessible
+      STATUS          current
+      DESCRIPTION
+          "The table of limited resources that are kept per-database."
+      ::= { rdbmsObjects 4 }
+
+  rdbmsDbLimitedResourceEntry     OBJECT-TYPE
+      SYNTAX      RdbmsDbLimitedResourceEntry
+      MAX-ACCESS  not-accessible
+      STATUS      current
+      DESCRIPTION
+          "An entry for a single limited resource kept per-database.
+           A limited resource has maximum use determined by a parameter
+           that might or might not be changeable at run time, or visible
+           in the rdbmsDbParamTable. Examples would be the number of
+           available locks, or disk space on a partition.  Arrays of
+           resources are supported through an integer sub index, which
+           should have the value of one for single-instance names.
+
+           Limited resources that are shared across databases, are best
+           put in the rdbmsSvrLimitedResourceTable instead of this one.
+
+           If the database is not actively opened, then attempts to
+           access corresponding instances in this table may result in
+           either noSuchName (SNMPv1) or noSuchInstance (SNMPv2).
+           'Actively opened' means at least one of the rdbmsRelState
+           entries for this database in the rdbmsRelTable is active(2)."
+
+      INDEX { rdbmsDbIndex, rdbmsDbLimitedResourceName }
+      ::= { rdbmsDbLimitedResourceTable 1 }
+
+  RdbmsDbLimitedResourceEntry ::=
+      SEQUENCE {
+          rdbmsDbLimitedResourceName          DisplayString,
+          rdbmsDbLimitedResourceID            AutonomousType,
+          rdbmsDbLimitedResourceLimit         INTEGER,
+          rdbmsDbLimitedResourceCurrent       INTEGER,
+          rdbmsDbLimitedResourceHighwater     INTEGER,
+          rdbmsDbLimitedResourceFailures      Counter32,
+          rdbmsDbLimitedResourceDescription   DisplayString
+      }
+
+  rdbmsDbLimitedResourceName          OBJECT-TYPE
+      SYNTAX          DisplayString
+      MAX-ACCESS      not-accessible
+      STATUS          current
+      DESCRIPTION
+          "The name of the resource, for instance 'global locks' or
+           'locks for the FOO database', or 'data space on /dev/rdsk/5s0
+           for FOO'. The length is limited to 64 characters to constrain
+           the number of sub-identifiers needed for instance
+           identification (and to minimize network traffic)."
+      ::= { rdbmsDbLimitedResourceEntry  1 }
+
+  rdbmsDbLimitedResourceID OBJECT-TYPE
+      SYNTAX              AutonomousType
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The ID of the resource which may be described in some other
+           MIB (e.g., an enterprise-specific MIB module).  If there is
+           no ID for this rdbmsDbLimitedResourceName, attempts to access
+           this object will return noSuchName (SNMPv1) or noSuchInstance
+           (SNMPv2)."
+      ::= { rdbmsDbLimitedResourceEntry 2 }
+
+  rdbmsDbLimitedResourceLimit         OBJECT-TYPE
+      SYNTAX          INTEGER (1..2147483647)
+      MAX-ACCESS      read-write
+      STATUS          current
+
+      DESCRIPTION
+          "The maximum value the resource use may attain.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+      ::= { rdbmsDbLimitedResourceEntry  3 }
+
+  rdbmsDbLimitedResourceCurrent       OBJECT-TYPE
+      SYNTAX          INTEGER (1..2147483647)
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+          "The current value for the resource."
+      ::= { rdbmsDbLimitedResourceEntry  4 }
+
+  rdbmsDbLimitedResourceHighwater     OBJECT-TYPE
+      SYNTAX          INTEGER (1..2147483647)
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+          "The maximum value of the resource seen since applUpTime
+           was reset for the earliest server which has the database
+           actively opened.
+
+           If there are two servers with the database open, and the
+           oldest one dies, the proper way to invalidate the value is by
+           resetting sysUpTime."
+      ::= { rdbmsDbLimitedResourceEntry  5 }
+
+  rdbmsDbLimitedResourceFailures      OBJECT-TYPE
+      SYNTAX          Counter32
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+          "The number of times the system wanted to exceed the limit of
+           the resource since applUpTime was reset for the earliest
+           server which has the database actively opened.
+
+           If there are two servers with the DB open, and the
+           oldest one dies, the proper way to invalidate the value is by
+           resetting sysUpTime."
+      ::= { rdbmsDbLimitedResourceEntry  6 }
+
+  rdbmsDbLimitedResourceDescription           OBJECT-TYPE
+      SYNTAX          DisplayString
+      MAX-ACCESS      read-write
+      STATUS          current
+
+      DESCRIPTION
+          "A description of the resource and the meaning of the integer
+           units used for Limit, Current, and Highwater.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+      ::= { rdbmsDbLimitedResourceEntry  7 }
+
+  ----------------------------------------------------------------
+
+  rdbmsSrvTable       OBJECT-TYPE
+      SYNTAX          SEQUENCE OF RdbmsSrvEntry
+      MAX-ACCESS      not-accessible
+      STATUS          current
+      DESCRIPTION
+          "The table of database servers running or installed
+           on a system."
+      ::= { rdbmsObjects 5 }
+
+  rdbmsSrvEntry   OBJECT-TYPE
+      SYNTAX      RdbmsSrvEntry
+      MAX-ACCESS  not-accessible
+      STATUS      current
+      DESCRIPTION
+          "An entry for a single database server.  A server is an
+           independent entity that provides access to one or more
+           databases.  Failure of one does not affect access to
+           databases through any other servers.  There might be one or
+           more servers providing access to a database.  A server may be
+           a 'process' or collection of 'processes', as interpreted by
+           the product."
+      INDEX { applIndex }
+      ::= { rdbmsSrvTable 1 }
+
+  RdbmsSrvEntry ::=
+      SEQUENCE {
+          rdbmsSrvPrivateMibOID   OBJECT IDENTIFIER,
+          rdbmsSrvVendorName  DisplayString,
+          rdbmsSrvProductName DisplayString,
+          rdbmsSrvContact     DisplayString
+      }
+
+  rdbmsSrvPrivateMibOID   OBJECT-TYPE
+      SYNTAX          OBJECT IDENTIFIER
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+
+          "The authoritative identification for the private MIB for this
+           server, presumably based on the vendor, e.g., { enterprises
+           111 <optional subidentifiers>} for Oracle servers, {
+           enterprises 757 <optional subidentifiers>} for Ingres
+           servers, { enterprises 897 <optional subidentifiers>} for
+           Sybase servers, etc.
+
+           If no OBJECT IDENTIFIER exists for the private MIB, attempts
+           to access this object will return noSuchName (SNMPv1)
+           or noSuchInstance (SNMPv2)."
+      ::= { rdbmsSrvEntry  1 }
+
+  rdbmsSrvVendorName  OBJECT-TYPE
+      SYNTAX          DisplayString
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+          "The name of the vendor whose RDBMS manages this database,
+           for informational purposes."
+      ::= { rdbmsSrvEntry 2 }
+
+  rdbmsSrvProductName  OBJECT-TYPE
+      SYNTAX          DisplayString
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+          "The product name of this server.  This is normally the
+           vendor's formal name for the product, in product specific
+           format."
+      ::= { rdbmsSrvEntry 3 }
+
+  rdbmsSrvContact OBJECT-TYPE
+      SYNTAX      DisplayString
+      MAX-ACCESS  read-write
+      STATUS      current
+      DESCRIPTION
+          "The textual identification of the contact person for this
+           managed server, together with information on how to contact
+           this person.
+
+           Note: if there is no active server associated with this
+           object, an agent may need to keep this in other persistent
+           storage, e.g., a configuration file.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+      ::= { rdbmsSrvEntry 4 }
+
+  ----------------------------------------------------------------
+
+  rdbmsSrvInfoTable   OBJECT-TYPE
+      SYNTAX          SEQUENCE OF RdbmsSrvInfoEntry
+      MAX-ACCESS      not-accessible
+      STATUS          current
+      DESCRIPTION
+          "The table of additional information about database servers.
+
+           Entries in this table correspond to applications in the
+           APPLICATION-MIB applTable.  Some objects in that table are
+           application-specific.  When they are associated with an RDBMS
+           server in this table, the objects have the following
+           meanings.
+
+           applName - The name of this server, i.e., the process or
+           group of processes providing access to this database.  The
+           exact format will be product and host specific.
+
+           applVersion - The version number of this server, in product
+           specific format.
+
+           applOperStatus - up(1) means operational and available for
+           general use.  down(2) means the server is not available for
+           use, but is known to the agent.  The other states have broad
+           meaning, and may need to be supplemented by the vendor
+           private MIB.  Halted(3) implies an administrative state of
+           unavailability.  Congested(4) implies a resource or or
+           administrative limit is prohibiting new inbound associations.
+           The 'available soon' description of restarting(5) may include
+           an indeterminate amount of recovery.
+
+           applLastChange is the time the agent noticed the most recent
+           change to applOperStatus.
+
+           applInboundAssociation is the number of currently active
+           local and remote conversations (usually SQL connects).
+
+           applOutboundAssociations is not provided by this MIB.
+
+           applAccumulatedInboundAssociations is the total number of
+           local and remote conversations started since the server came
+           up.
+
+           applAccumulatedOutbound associations is not provided by this
+           MIB.
+
+           applLastInboundActivity is the time the most recent local or
+
+           remote conversation was attempted or disconnected.
+
+           applLastOutboundActivity is not provided by this MIB.
+
+           applRejectedInboundAssociations is the number of local or
+           remote conversations rejected by the server for
+           administrative reasons or because of resource limitations.
+
+           applFailedOutboundAssociations is not provided by this MIB."
+
+      ::= { rdbmsObjects 6 }
+
+  rdbmsSrvInfoEntry   OBJECT-TYPE
+      SYNTAX          RdbmsSrvInfoEntry
+      MAX-ACCESS      not-accessible
+      STATUS          current
+      DESCRIPTION
+          "Information that must be present for a single 'up' database
+           server, with visibility determined by the value of the
+           corresponding applOperStatus object.  If an instance of
+           applOperStatus is not up(1), then attempts to access
+           corresponding instances in this table may result in either
+           noSuchName (SNMPv1) or noSuchInstance (SNMPv2) being returned
+           by the agent."
+      INDEX { applIndex }
+      ::= { rdbmsSrvInfoTable 1 }
+
+  RdbmsSrvInfoEntry ::=
+      SEQUENCE {
+          rdbmsSrvInfoStartupTime                 DateAndTime,
+          rdbmsSrvInfoFinishedTransactions        Gauge32,
+          rdbmsSrvInfoDiskReads                   Counter32,
+          rdbmsSrvInfoDiskWrites                  Counter32,
+          rdbmsSrvInfoLogicalReads                Counter32,
+          rdbmsSrvInfoLogicalWrites               Counter32,
+          rdbmsSrvInfoPageWrites                  Counter32,
+          rdbmsSrvInfoPageReads                   Counter32,
+          rdbmsSrvInfoDiskOutOfSpaces             Counter32,
+          rdbmsSrvInfoHandledRequests             Counter32,
+          rdbmsSrvInfoRequestRecvs                Counter32,
+          rdbmsSrvInfoRequestSends                Counter32,
+          rdbmsSrvInfoHighwaterInboundAssociations        Gauge32,
+          rdbmsSrvInfoMaxInboundAssociations              Gauge32
+      }
+
+  rdbmsSrvInfoStartupTime  OBJECT-TYPE
+      SYNTAX              DateAndTime
+      MAX-ACCESS          read-only
+
+      STATUS              current
+      DESCRIPTION
+          "The date and time at which this server was last started."
+      ::= { rdbmsSrvInfoEntry 1 }
+
+  rdbmsSrvInfoFinishedTransactions  OBJECT-TYPE
+      SYNTAX              Gauge32
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The number of transactions visible to this server that have
+           been completed by either commit or abort.  Some database
+           operations, such as read-only queries, may not result in the
+           creation of a transaction."
+      ::= { rdbmsSrvInfoEntry 2 }
+
+  rdbmsSrvInfoDiskReads   OBJECT-TYPE
+      SYNTAX              Counter32
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The total number of reads of database files issued to the
+           operating system by this server since startup.  Numbers are
+           not comparable between products.  What constitutes a
+           readand how it is accounted is product-specific."
+      ::= { rdbmsSrvInfoEntry 3 }
+
+  rdbmsSrvInfoLogicalReads    OBJECT-TYPE
+      SYNTAX                  Counter32
+      MAX-ACCESS              read-only
+      STATUS                  current
+      DESCRIPTION
+          "The total number of logical reads of database files made
+           internally by this server since startup.  The values of this
+           object and those of rdbmsSrvInfoDiskReads reveal the effect
+           of caching on read operation. Numbers are not comparable
+           between products, and may only be meaningful when aggregated
+           across all servers sharing a common cache."
+      ::= { rdbmsSrvInfoEntry 4 }
+
+  rdbmsSrvInfoDiskWrites  OBJECT-TYPE
+      SYNTAX              Counter32
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The total number of writes to database files issued to the
+           operating system by this server since startup.  Numbers are
+           not comparable between products."
+
+      ::= { rdbmsSrvInfoEntry 5 }
+
+  rdbmsSrvInfoLogicalWrites  OBJECT-TYPE
+      SYNTAX              Counter32
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The total number of times parts of the database files have
+           been marked 'dirty' and in need of writing to the disk.  This
+           value and rdbmsSrvInfoDiskWrites give some indication of the
+           effect of 'write-behind' strategies in reducing the number of
+           disk writes compared to database operations.  Because the
+           writes may be done by servers other than those marking the
+           parts of the database files dirty, these values may only be
+           meaningful when aggregated across all servers sharing a
+           common cache.  Numbers are not comparable between products."
+      ::= { rdbmsSrvInfoEntry 6 }
+
+  rdbmsSrvInfoPageReads   OBJECT-TYPE
+      SYNTAX              Counter32
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The total number of pages in database files read by this
+           server since startup.  'Pages' are product specific units of
+           disk i/o operations.  This value, along with
+           rdbmsSrvInfoDiskReads, reveals the effect of any grouping
+           read-ahead that may be used to enhance performance of some
+           queries, such as scans."
+      ::= { rdbmsSrvInfoEntry 7}
+
+  rdbmsSrvInfoPageWrites  OBJECT-TYPE
+      SYNTAX              Counter32
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The total number of pages in database files written by this
+           server since startup.  Pages are product-specific units of
+           disk I/O.  This value, with rdbmsSrvInfoDiskWrites, shows the
+           effect of write strategies that collapse logical writes of
+           contiguous pages into single calls to the operating system."
+      ::= { rdbmsSrvInfoEntry 8 }
+
+  rdbmsSrvInfoDiskOutOfSpaces OBJECT-TYPE
+      SYNTAX                  Counter32
+      MAX-ACCESS              read-only
+      STATUS                  current
+      DESCRIPTION
+
+          "The total number of times the server has been unable to
+           obtain disk space that it wanted, since server startup.  This
+           would be inspected by an agent on receipt of an
+           rdbmsOutOfSpace trap."
+      ::= { rdbmsSrvInfoEntry 9 }
+
+  rdbmsSrvInfoHandledRequests     OBJECT-TYPE
+      SYNTAX              Counter32
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The total number of requests made to the server on inbound
+           associations.  The meaning of 'requests' is product specific,
+           and is not comparable between products.
+
+           This is intended to encapsulate high level semantic
+           operations between clients and servers, or between peers.
+           For instance, one request might correspond to a 'select' or
+           an 'insert' statement.  It is not intended to capture disk
+           i/o described in rdbmsSrvInfoDiskReads and
+           rdbmsSrvInfoDiskWrites."
+      ::= { rdbmsSrvInfoEntry 10 }
+
+  rdbmsSrvInfoRequestRecvs        OBJECT-TYPE
+      SYNTAX              Counter32
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The number of receive operations made processing any requests
+           on inbound associations. The meaning of operations is product
+           specific, and is not comparable between products.
+
+           This is intended to capture lower-level i/o operations than
+           shown by HandledRequests, between clients and servers, or
+           between peers.  For instance, it might roughly correspond to
+           the amount of data given with an 'insert' statement.  It is
+           not intended to capture disk i/o described in
+           rdbmsSrvInfoDiskReads and rdbmsSrvInfoDiskWrites."
+      ::= { rdbmsSrvInfoEntry 11 }
+
+  rdbmsSrvInfoRequestSends        OBJECT-TYPE
+      SYNTAX              Counter32
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The number of send operations made processing requests
+           handled on inbound associations.  The meaning of operations
+           is product specific, and is not comparable between products.
+
+           This is intended to capture lower-level i/o operations than
+           shown by HandledRequests, between between clients and
+           servers, or between peers.  It might roughly correspond to
+           the number of rows returned by a 'select' statement.  It is
+           not intended to capture disk i/o described in DiskReads."
+      ::= { rdbmsSrvInfoEntry 12 }
+
+  rdbmsSrvInfoHighwaterInboundAssociations  OBJECT-TYPE
+      SYNTAX              Gauge32
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The greatest number of inbound associations that have been
+           simultaneously open to this server since startup."
+      ::= { rdbmsSrvInfoEntry 13 }
+
+  rdbmsSrvInfoMaxInboundAssociations OBJECT-TYPE
+      SYNTAX              Gauge32
+      MAX-ACCESS          read-write
+      STATUS              current
+      DESCRIPTION
+          "The greatest number of inbound associations that can be
+           simultaneously open with this server.  If there is no limit,
+           then the value should be zero.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+      ::= { rdbmsSrvInfoEntry 14 }
+
+  ----------------------------------------------------------------
+
+  rdbmsSrvParamTable      OBJECT-TYPE
+      SYNTAX              SEQUENCE OF RdbmsSrvParamEntry
+      MAX-ACCESS          not-accessible
+      STATUS              current
+      DESCRIPTION
+          "The table of configuration parameters for a server.  Entries
+           should be populated according to the following guidelines:
+           (1) The value should be specified through administrative
+               (human) intervention.
+           (2) It should be configured on a per-server or a more global
+               basis, with duplicate entries for each server sharing
+               use of the parameter.
+           (3) One of the following is true:
+               (a) The parameter has a non-numeric value;
+               (b) The current value is numeric, but it only changes due
+                   to human intervention;
+
+               (c) The current value is numeric and dynamic, but the
+                   RDBMS does not track access/allocation failures
+                   related to the parameter;
+               (d) The current value is numeric and dynamic, the
+                   RDBMS tracks changes in access/allocation failures
+                   related to the parameter, but the failure has no
+                   significant impact on RDBMS performance or
+                   availability.
+               (e) The current value is numeric and dynamic, the
+                   RDBMS tracks changes in access/allocation failures
+                   related to the parameter, the failure has
+                   significant impact on RDBMS performance or
+                   availability, and is shown in the
+                   rdbmsSrvLimitedResource table."
+      ::= { rdbmsObjects 7 }
+
+  rdbmsSrvParamEntry      OBJECT-TYPE
+      SYNTAX              RdbmsSrvParamEntry
+      MAX-ACCESS          not-accessible
+      STATUS              current
+      DESCRIPTION
+          "An entry for a single configuration parameter for a server.
+           Parameters with single values have a subindex value of one.
+           If the parameter is naturally considered to contain a
+           variable number of members of a class, e.g.  members of the
+           DBA user group, or tracepoints active in the server, then it
+           must be presented as a set of rows.  If, on the other hand,
+           the parameter represents a set of choices from a class,
+           e.g. the permissions on a file or the options chosen out of
+           the set of all options allowed, AND is guaranteed to always
+           fit in the 255 character length of a DisplayString, then it
+           may be presented as a comma separated list with a subindex
+           value of one.  Zero may not be used as a subindex value.
+
+           Entries for a server must be present if the value of the
+           corresponding applOperStatus object is up(1).  If an instance
+           of applOperStatus is not up(1), then attempts to access
+           corresponding instances in this table may result in either
+           noSuchName (SNMPv1) or noSuchInstance (SNMPv2) being returned
+           by the agent."
+      INDEX  { applIndex, rdbmsSrvParamName, rdbmsSrvParamSubIndex }
+      ::= { rdbmsSrvParamTable 1 }
+
+  RdbmsSrvParamEntry ::=
+      SEQUENCE {
+          rdbmsSrvParamName           DisplayString,
+          rdbmsSrvParamSubIndex       INTEGER,
+          rdbmsSrvParamID             AutonomousType,
+
+          rdbmsSrvParamCurrValue      DisplayString,
+          rdbmsSrvParamComment        DisplayString
+      }
+
+  rdbmsSrvParamName       OBJECT-TYPE
+      SYNTAX              DisplayString (SIZE (1..64))
+      MAX-ACCESS          not-accessible
+      STATUS              current
+      DESCRIPTION
+          "The name of a configuration parameter for a server.  This
+           name is product-specific. The length is limited to 64
+           characters to constrain the number of sub-identifiers needed
+           for instance identification (and to minimize network
+           traffic)."
+      ::= { rdbmsSrvParamEntry 1 }
+
+  rdbmsSrvParamSubIndex   OBJECT-TYPE
+      SYNTAX              INTEGER (1..2147483647)
+      MAX-ACCESS          not-accessible
+      STATUS              current
+      DESCRIPTION
+          "The subindex value for this parameter.  If the parameter is
+           naturally considered to contain a variable number of members
+           of a class, e.g.  members of the DBA user group, or files
+           which are part of the database, then it must be presented as
+           a set of rows.  If, on the other hand, the parameter
+           represents a set of choices from a class, e.g. the
+           permissions on a file or the options chosen out of the set of
+           all options allowed, AND is guaranteed to always fit in the
+           255 character length of a DisplayString, then it may be
+           presented as a comma separated list with a subindex value of
+           one.  Zero may not be used as a value."
+      ::= { rdbmsSrvParamEntry 2 }
+
+  rdbmsSrvParamID         OBJECT-TYPE
+      SYNTAX              AutonomousType
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The ID of the parameter which may be described in some
+           other MIB.  If there is no ID for this rdbmsSrvParamName,
+           attempts to access this object will return noSuchName
+           (SNMPv1) or noSuchInstance (SNMPv2)."
+      ::= { rdbmsSrvParamEntry 3 }
+
+  rdbmsSrvParamCurrValue  OBJECT-TYPE
+      SYNTAX              DisplayString
+      MAX-ACCESS          read-write
+
+      STATUS              current
+      DESCRIPTION
+          "The value for a configuration parameter now in effect, the
+           actual setting for the server.  While there may multiple
+           values in the temporal domain of interest (for instance, the
+           value to take effect at the next restart), this is the
+           current setting.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+      ::= { rdbmsSrvParamEntry 4 }
+
+  rdbmsSrvParamComment    OBJECT-TYPE
+      SYNTAX              DisplayString
+      MAX-ACCESS          read-write
+      STATUS              current
+      DESCRIPTION
+          "Annotation which describes the purpose of a configuration
+           parameter or the reason for a particular parameter's
+           setting.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+      ::= { rdbmsSrvParamEntry 5 }
+
+  ----------------------------------------------------------------
+
+  rdbmsSrvLimitedResourceTable        OBJECT-TYPE
+      SYNTAX          SEQUENCE OF RdbmsSrvLimitedResourceEntry
+      MAX-ACCESS      not-accessible
+      STATUS          current
+      DESCRIPTION
+          "The table of limited resources relevant to a server."
+      ::= { rdbmsObjects 8 }
+
+  rdbmsSrvLimitedResourceEntry    OBJECT-TYPE
+      SYNTAX      RdbmsSrvLimitedResourceEntry
+      MAX-ACCESS  not-accessible
+      STATUS      current
+      DESCRIPTION
+          "An entry for a single limited resource kept by the server.
+           A limited resource has maximum use determined by a parameter
+           that might or might not changeable at run time, or visible in
+           the rbmsSrvParamTable.  Examples would be the number of
+           available locks, or number of concurrent executions allowed
+           in a server.  Arrays of resources are supported through an
+
+           integer subindex, which should have the value of one for
+           single-instance names.
+
+           Limited resources that are shared across servers or databases
+           are best duplicated in this table across
+           all servers accessing the resource."
+      INDEX { applIndex, rdbmsSrvLimitedResourceName }
+      ::= { rdbmsSrvLimitedResourceTable 1 }
+
+  RdbmsSrvLimitedResourceEntry ::=
+      SEQUENCE {
+          rdbmsSrvLimitedResourceName         DisplayString,
+          rdbmsSrvLimitedResourceID           AutonomousType,
+          rdbmsSrvLimitedResourceLimit        INTEGER,
+          rdbmsSrvLimitedResourceCurrent      INTEGER,
+          rdbmsSrvLimitedResourceHighwater    INTEGER,
+          rdbmsSrvLimitedResourceFailures     Counter32,
+          rdbmsSrvLimitedResourceDescription  DisplayString
+      }
+
+  rdbmsSrvLimitedResourceName         OBJECT-TYPE
+      SYNTAX          DisplayString
+      MAX-ACCESS      not-accessible
+      STATUS          current
+      DESCRIPTION
+          "The name of the resource, for instance 'threads' or
+           'semaphores', or 'buffer pages'"
+      ::= { rdbmsSrvLimitedResourceEntry  1 }
+
+  rdbmsSrvLimitedResourceID OBJECT-TYPE
+      SYNTAX              AutonomousType
+      MAX-ACCESS          read-only
+      STATUS              current
+      DESCRIPTION
+          "The ID of the resource which may be described in some other
+           MIB.  If there is no ID for this rdbmsSrvLimitedResourceName,
+           attempts to access this object will return noSuchName
+           (SNMPv1) or noSuchInstance (SNMPv2)."
+      ::= { rdbmsSrvLimitedResourceEntry 2 }
+
+  rdbmsSrvLimitedResourceLimit        OBJECT-TYPE
+      SYNTAX          INTEGER (1..2147483647)
+      MAX-ACCESS      read-write
+      STATUS          current
+
+      DESCRIPTION
+          "The maximum value the resource use may attain.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+      ::= { rdbmsSrvLimitedResourceEntry  3 }
+
+  rdbmsSrvLimitedResourceCurrent      OBJECT-TYPE
+      SYNTAX          INTEGER (1..2147483647)
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+          "The current value for the resource."
+      ::= { rdbmsSrvLimitedResourceEntry  4 }
+
+  rdbmsSrvLimitedResourceHighwater            OBJECT-TYPE
+      SYNTAX          INTEGER (1..2147483647)
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+          "The maximum value of the resource seen since applUpTime
+           was reset."
+      ::= { rdbmsSrvLimitedResourceEntry  5 }
+
+  rdbmsSrvLimitedResourceFailures     OBJECT-TYPE
+      SYNTAX          Counter32
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+          "The number of times the system wanted to exceed the limit of
+           the resource since applUpTime was reset."
+      ::= { rdbmsSrvLimitedResourceEntry  6 }
+
+  rdbmsSrvLimitedResourceDescription    OBJECT-TYPE
+      SYNTAX          DisplayString
+      MAX-ACCESS      read-write
+      STATUS          current
+      DESCRIPTION
+          "A description of the resource and the meaning of the integer
+           units used for Limit, Current, and Highwater.
+
+           Note that a compliant agent does not need to
+           allow write access to this object."
+
+      ::= { rdbmsSrvLimitedResourceEntry  7 }
+
+  ----------------------------------------------------------------
+
+  rdbmsRelTable   OBJECT-TYPE
+      SYNTAX      SEQUENCE OF RdbmsRelEntry
+      MAX-ACCESS  not-accessible
+      STATUS      current
+      DESCRIPTION
+          "A table relating databases and servers present on a host."
+      ::= { rdbmsObjects 9 }
+
+  rdbmsRelEntry   OBJECT-TYPE
+      SYNTAX      RdbmsRelEntry
+      MAX-ACCESS  not-accessible
+      STATUS      current
+      DESCRIPTION
+          "An entry relating a single database server to a single
+           database to which it may provide access.  The table is
+           indexed first by the index of rdbmsDbTable, and then
+           rdbmsSrvTable, so that all servers capable of providing
+           access to a given database may be found by SNMP traversal
+           operations (get-next and get-bulk).  The makeup of this table
+           depends on the product's architecture, e.g. if it is one
+           server - many databases, then each server will appear n
+           times, where n is the number of databases it may access, and
+           each database will appear once.  If the architecture is one
+           database - many servers, then each server will appear once
+           and each database will appear n times, where n is the number
+           of servers that may be accessing it."
+      INDEX  { rdbmsDbIndex, applIndex }
+      ::= { rdbmsRelTable 1 }
+
+  RdbmsRelEntry ::=
+      SEQUENCE {
+           rdbmsRelState          INTEGER,
+           rdbmsRelActiveTime     DateAndTime
+      }
+
+  rdbmsRelState   OBJECT-TYPE
+      SYNTAX      INTEGER{
+                      other(1),
+                      active(2),
+                      available(3),
+                      restricted(4),
+                      unavailable(5)
+                      }
+      MAX-ACCESS  read-only
+      STATUS      current
+      DESCRIPTION
+
+          "The state of this server's access to this database.
+           Active(2) means the server is actively using the database.
+           Available(3) means the server could use the database if
+           necessary.  Restricted(4) means the database is in some
+           administratively determined state of less-than-complete
+           availability.  Unavailable(5) means the database is not
+           available through this server.  Other(1) means the
+           database/server is in some other condition, possibly
+           described in the vendor private MIB."
+
+      ::= { rdbmsRelEntry 1 }
+
+  rdbmsRelActiveTime  OBJECT-TYPE
+      SYNTAX          DateAndTime
+      MAX-ACCESS      read-only
+      STATUS          current
+      DESCRIPTION
+          "The time the database was made active by the server.  If an
+           instance of rdbmsRelState is not active(1), then attempts to
+           access the corresponding instance of this object may result
+           in either noSuchName (SNMPv1) or noSuchInstance (SNMPv2)
+           being returned by the agent."
+      ::= { rdbmsRelEntry 2 }
+
+  ----------------------------------------------------------------
+
+  -- Well known resources for which limits, high water marks,
+  -- access or allocation failures, and current levels of use
+  -- are possibly available in either the rdbmsDbLimitedResources
+  -- or the rdbmsSrvLimitedResources tables.
+
+  rdbmsWellKnownLimitedResources OBJECT IDENTIFIER
+          ::= { rdbmsObjects 10 }
+
+  rdbmsLogSpace   OBJECT-IDENTITY
+                  STATUS  current
+                  DESCRIPTION
+                  "Storage allocated for redo and undo logs."
+          ::= { rdbmsWellKnownLimitedResources 1}
+
+  ----------------------------------------------------------------
+
+  rdbmsTraps       OBJECT IDENTIFIER ::= { rdbmsMIB 2 }
+
+  rdbmsStateChange    NOTIFICATION-TYPE
+      OBJECTS         { rdbmsRelState }
+      STATUS          current
+      DESCRIPTION
+
+          "An rdbmsStateChange trap signifies that one of the database
+           server/databases managed by this agent has changed its
+           rdbmsRelState in a way that makes it less accessible for use.
+           For these purposes, both active(2) and available(3) are
+           considered fully accessible.  The state sent with the trap is
+           the new, less accessible state."
+      ::= { rdbmsTraps 1 }
+
+  rdbmsOutOfSpace NOTIFICATION-TYPE
+      OBJECTS     { rdbmsSrvInfoDiskOutOfSpaces }
+      STATUS      current
+      DESCRIPTION
+          "An rdbmsOutOfSpace trap signifies that one of the database
+           servers managed by this agent has been unable to allocate
+           space for one of the databases managed by this agent.  Care
+           should be taken to avoid flooding the network with these
+           traps."
+      ::= { rdbmsTraps 2 }
+
+  ----------------------------------------------------------------
+
+  -- compliance information
+
+  rdbmsConformance    OBJECT IDENTIFIER ::= { rdbmsMIB 3 }
+  rdbmsCompliances    OBJECT IDENTIFIER ::= { rdbmsConformance 1 }
+  rdbmsGroups         OBJECT IDENTIFIER ::= { rdbmsConformance 2 }
+
+  -- compliance statements
+
+  rdbmsCompliance     MODULE-COMPLIANCE
+      STATUS          current
+      DESCRIPTION
+          "The compliance statement for SNMP entities which
+           implement the RDBMS MIB"
+      MODULE HOST-RESOURCES-MIB
+          MANDATORY-GROUPS    { hrSystem }
+      MODULE APPLICATION-MIB
+          MANDATORY-GROUPS { applGroup }
+      MODULE RDBMS-MIB
+          MANDATORY-GROUPS { rdbmsGroup }
+
+      GROUP  rdbmsGroup
+          DESCRIPTION
+              "The rdbmsGroup is mandatory, but no write access
+               to objects is required for compliance."
+          OBJECT      rdbmsDbContact
+          MIN-ACCESS  read-only
+          DESCRIPTION
+
+              "A compliant system need not allow write-access to this
+              object."
+          OBJECT      rdbmsDbParamCurrValue
+          MIN-ACCESS  read-only
+          DESCRIPTION
+              "A compliant system need not allow write-access to this
+              object."
+          OBJECT      rdbmsDbParamComment
+          MIN-ACCESS  read-only
+          DESCRIPTION
+              "A compliant system need not allow write-access to this
+              object."
+          OBJECT      rdbmsDbLimitedResourceLimit
+          MIN-ACCESS  read-only
+          DESCRIPTION
+              "A compliant system need not allow write-access to this
+              object."
+          OBJECT      rdbmsDbLimitedResourceDescription
+          MIN-ACCESS  read-only
+          DESCRIPTION
+              "A compliant system need not allow write-access to this
+              object."
+          OBJECT      rdbmsSrvContact
+          MIN-ACCESS  read-only
+          DESCRIPTION
+              "A compliant system need not allow write-access to this
+              object."
+          OBJECT      rdbmsSrvInfoMaxInboundAssociations
+          MIN-ACCESS  read-only
+          DESCRIPTION
+              "A compliant system need not allow write-access to this
+              object."
+          OBJECT      rdbmsSrvParamCurrValue
+          MIN-ACCESS  read-only
+          DESCRIPTION
+              "A compliant system need not allow write-access to this
+              object."
+          OBJECT      rdbmsSrvParamComment
+          MIN-ACCESS  read-only
+          DESCRIPTION
+              "A compliant system need not allow write-access to this
+              object."
+          OBJECT      rdbmsSrvLimitedResourceLimit
+          MIN-ACCESS  read-only
+          DESCRIPTION
+              "A compliant system need not allow write-access to this
+              object."
+          OBJECT      rdbmsSrvLimitedResourceDescription
+
+          MIN-ACCESS  read-only
+          DESCRIPTION
+              "A compliant system need not allow write-access to this
+              object."
+
+      ::= { rdbmsCompliances 1 }
+
+  -- units of conformance
+
+      -- rdbmsStateChange and rdbmsOutOfSpace traps are omitted
+      -- intentionally.  They are not required or part of any
+      -- conformance group.
+
+  rdbmsGroup   OBJECT-GROUP
+      OBJECTS  {
+                  rdbmsDbPrivateMibOID, rdbmsDbVendorName,
+                  rdbmsDbName, rdbmsDbContact,
+
+                  rdbmsDbInfoProductName, rdbmsDbInfoVersion,
+                  rdbmsDbInfoSizeUnits, rdbmsDbInfoSizeAllocated,
+                  rdbmsDbInfoSizeUsed, rdbmsDbInfoLastBackup,
+
+                  rdbmsDbParamCurrValue, rdbmsDbParamComment,
+
+                  rdbmsDbLimitedResourceLimit,
+                  rdbmsDbLimitedResourceCurrent,
+                  rdbmsDbLimitedResourceHighwater,
+                  rdbmsDbLimitedResourceFailures,
+                  rdbmsDbLimitedResourceDescription,
+
+                  rdbmsSrvPrivateMibOID, rdbmsSrvVendorName,
+                  rdbmsSrvProductName, rdbmsSrvContact,
+
+                  rdbmsSrvInfoStartupTime,
+                  rdbmsSrvInfoFinishedTransactions,
+                  rdbmsSrvInfoDiskReads, rdbmsSrvInfoDiskWrites,
+                  rdbmsSrvInfoLogicalReads, rdbmsSrvInfoLogicalWrites,
+                  rdbmsSrvInfoPageReads, rdbmsSrvInfoPageWrites,
+                  rdbmsSrvInfoHandledRequests,
+                  rdbmsSrvInfoRequestRecvs, rdbmsSrvInfoRequestSends,
+                  rdbmsSrvInfoHighwaterInboundAssociations,
+                  rdbmsSrvInfoMaxInboundAssociations,
+
+                  rdbmsSrvParamCurrValue, rdbmsSrvParamComment,
+
+                  rdbmsSrvLimitedResourceLimit,
+                  rdbmsSrvLimitedResourceCurrent,
+                  rdbmsSrvLimitedResourceHighwater,
+
+                  rdbmsSrvLimitedResourceFailures,
+                  rdbmsSrvLimitedResourceDescription,
+
+                  rdbmsRelState, rdbmsRelActiveTime }
+      STATUS   current
+      DESCRIPTION
+          "A collection of objects providing basic instrumentation of an
+           RDBMS entity."
+      ::= { rdbmsGroups 1 }
+
+  ----------------------------------------------------------------
+
+  END
diff --git a/RDBMS-MIB_src/rdbmsDbInfoTable/README b/RDBMS-MIB_src/rdbmsDbInfoTable/README
new file mode 100644 (file)
index 0000000..c4a8778
--- /dev/null
@@ -0,0 +1 @@
+For PostgreSQL version 8.0.x the rdbmsDbInfoSize* fields are returned as 0, because that information is unavailable. 
diff --git a/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable.c b/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable.c
new file mode 100644 (file)
index 0000000..7bc63ef
--- /dev/null
@@ -0,0 +1,123 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbInfoTable.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbInfoTable.c,v 1.3 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbInfoTable.h"
+#include "rdbmsDbInfoTable_interface.h"
+
+oid rdbmsDbInfoTable_oid[] = { RDBMSDBINFOTABLE_OID };
+int rdbmsDbInfoTable_oid_size = OID_LENGTH(rdbmsDbInfoTable_oid);
+
+void initialize_table_rdbmsDbInfoTable(void);
+
+
+/**
+ * Initializes the rdbmsDbInfoTable module
+ */
+void
+init_rdbmsDbInfoTable(void)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:init_rdbmsDbInfoTable","called\n"));
+
+    /*
+     * TODO:300:o: Perform rdbmsDbInfoTable one-time module initialization.
+     */
+     
+    /*
+     * here we initialize all the tables we're planning on supporting
+     */
+    if (should_init("rdbmsDbInfoTable"))
+        initialize_table_rdbmsDbInfoTable();
+
+} /* init_rdbmsDbInfoTable */
+
+/**
+ * Initialize the table rdbmsDbInfoTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+initialize_table_rdbmsDbInfoTable(void)
+{
+    rdbmsDbInfoTable_registration_ptr user_context;
+    u_long flags;
+
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:initialize_table_rdbmsDbInfoTable","called\n"));
+
+    /*
+     * TODO:301:o: Perform rdbmsDbInfoTable one-time table initialization.
+     */
+
+    /*
+     * TODO:302:o: |->Initialize rdbmsDbInfoTable user context
+     * if you'd like to pass in a pointer to some data for this
+     * table, allocate or set it up here.
+     */
+    /*
+     * a netsnmp_data_list is a simple way to store void pointers. A simple
+     * string token is used to add, find or remove pointers.
+     */
+    user_context = netsnmp_create_data_list("rdbmsDbInfoTable", NULL, NULL);
+    
+    /*
+     * No support for any flags yet, but in the future you would
+     * set any flags here.
+     */
+    flags = 0;
+    
+    /*
+     * call interface initialization code
+     */
+    _rdbmsDbInfoTable_initialize_interface(user_context, flags);
+} /* initialize_table_rdbmsDbInfoTable */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_ERROR                : other error
+ */
+int
+rdbmsDbInfoTable_pre_request(rdbmsDbInfoTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_pre_request","called\n"));
+
+    /*
+     * TODO:510:o: Perform rdbmsDbInfoTable pre-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : other error (ignored)
+ */
+int
+rdbmsDbInfoTable_post_request(rdbmsDbInfoTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_post_request","called\n"));
+
+    /*
+     * TODO:511:o: Perform rdbmsDbInfoTable pos-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoTable_post_request */
+
+
+/** @{ */
diff --git a/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable.h b/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable.h
new file mode 100644 (file)
index 0000000..321aa86
--- /dev/null
@@ -0,0 +1,223 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbInfoTable.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbInfoTable.h,v 1.5 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBINFOTABLE_H
+#define RDBMSDBINFOTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @defgroup misc misc: Miscelaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+    /* *INDENT-OFF*  */
+config_require(RDBMS-MIB/rdbmsDbInfoTable/rdbmsDbInfoTable_interface);
+config_require(RDBMS-MIB/rdbmsDbInfoTable/rdbmsDbInfoTable_data_access);
+config_require(RDBMS-MIB/rdbmsDbInfoTable/rdbmsDbInfoTable_data_get);
+    /* *INDENT-ON*  */
+
+/* OID and column number definitions for  */
+#include "rdbmsDbInfoTable_oids.h"
+
+/* enum definions */
+#include "rdbmsDbInfoTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_rdbmsDbInfoTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbInfoTable is subid 2 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.2, length: 9
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+    /*
+     * TODO:101:o: |-> Review rdbmsDbInfoTable registration context.
+     */
+typedef netsnmp_data_list * rdbmsDbInfoTable_registration_ptr;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review rdbmsDbInfoTable data context structure.
+ * This structure is used to represent the data for rdbmsDbInfoTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * rdbmsDbInfoTable.
+ */
+typedef struct rdbmsDbInfoTable_data_s {
+    
+        /*
+         * rdbmsDbInfoProductName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+         */
+   char   rdbmsDbInfoProductName[255];
+size_t      rdbmsDbInfoProductName_len; /* # of char elements, not bytes */
+    
+        /*
+         * rdbmsDbInfoVersion(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+         */
+   char   rdbmsDbInfoVersion[255];
+size_t      rdbmsDbInfoVersion_len; /* # of char elements, not bytes */
+    
+        /*
+         * rdbmsDbInfoSizeUnits(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+         */
+   u_long   rdbmsDbInfoSizeUnits;
+    
+        /*
+         * rdbmsDbInfoSizeAllocated(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+         */
+   long   rdbmsDbInfoSizeAllocated;
+    
+        /*
+         * rdbmsDbInfoSizeUsed(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+         */
+   long   rdbmsDbInfoSizeUsed;
+    
+        /*
+         * rdbmsDbInfoLastBackup(6)/DateAndTime/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+         */
+/*   char   rdbmsDbInfoLastBackup[255];
+size_t      rdbmsDbInfoLastBackup_len; *//* # of char elements, not bytes */
+   int lastBackupYear;
+   int lastBackupMonth;
+   int lastBackupDay;
+   int lastBackupHour;
+   int lastBackupMinutes;
+   int lastBackupSeconds;
+   /* the terminology here was stolen from net-snmp */
+   int lastBackupDeciSeconds;
+
+   int utc_offset_direction;
+   int utc_offset_hours;
+   int utc_offset_minutes;
+} rdbmsDbInfoTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review rdbmsDbInfoTable mib index.
+ * This structure is used to represent the index for rdbmsDbInfoTable.
+ */
+typedef struct rdbmsDbInfoTable_mib_index_s {
+
+        /*
+         * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   rdbmsDbIndex;
+
+
+} rdbmsDbInfoTable_mib_index;
+
+    /*
+     * TODO:121:r: |   |-> Review rdbmsDbInfoTable max index length.
+     * If you KNOW that your indexes will never exceed a certain
+     * length, update this macro to that length.
+*/
+#define MAX_rdbmsDbInfoTable_IDX_LEN     1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review rdbmsDbInfoTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * rdbmsDbInfoTable_rowreq_ctx pointer.
+ */
+typedef struct rdbmsDbInfoTable_rowreq_ctx_s {
+
+    /** this must be first for container compare to work */
+    netsnmp_index        oid_idx;
+    oid                  oid_tmp[MAX_rdbmsDbInfoTable_IDX_LEN];
+    
+    rdbmsDbInfoTable_mib_index        tbl_idx;
+    
+    rdbmsDbInfoTable_data              data;
+
+    /*
+     * flags per row. Currently, the first (lower) 8 bits are reserved
+     * for the user. See mfd.h for other flags.
+     */
+    u_int                       rowreq_flags;
+
+    /*
+     * implementor's context pointer (provided during registration)
+     */
+    rdbmsDbInfoTable_registration_ptr rdbmsDbInfoTable_reg;
+
+    /*
+     * TODO:131:o: |   |-> Add useful data to rdbmsDbInfoTable rowreq context.
+     */
+    
+    /*
+     * storage for future expansion
+     */
+    netsnmp_data_list             *rdbmsDbInfoTable_data_list;
+
+} rdbmsDbInfoTable_rowreq_ctx;
+
+typedef struct rdbmsDbInfoTable_ref_rowreq_ctx_s {
+    rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx;
+} rdbmsDbInfoTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+    int rdbmsDbInfoTable_pre_request(rdbmsDbInfoTable_registration_ptr user_context);
+    int rdbmsDbInfoTable_post_request(rdbmsDbInfoTable_registration_ptr user_context);
+
+
+extern oid rdbmsDbInfoTable_oid[];
+extern int rdbmsDbInfoTable_oid_size;
+
+
+#include "rdbmsDbInfoTable_interface.h"
+#include "rdbmsDbInfoTable_data_access.h"
+#include "rdbmsDbInfoTable_data_get.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBINFOTABLE_H */
diff --git a/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_access.c b/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_access.c
new file mode 100644 (file)
index 0000000..00755f1
--- /dev/null
@@ -0,0 +1,418 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbInfoTable_data_access.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbInfoTable_data_access.c,v 1.9 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbInfoTable.h"
+#include "rdbmsDbInfoTable_data_access.h"
+
+const char *rdbmsDbInfoProductName = { "PostgreSQL" };
+
+/** @defgroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ * 
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbInfoTable is subid 2 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.2, length: 9
+*/
+
+/**
+ * initialization for rdbmsDbInfoTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param rdbmsDbInfoTable_reg
+ *        Pointer to rdbmsDbInfoTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : unrecoverable error.
+ */
+int
+rdbmsDbInfoTable_init_data(rdbmsDbInfoTable_registration_ptr rdbmsDbInfoTable_reg)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_init_data","called\n"));
+
+    /*
+     * TODO:303:o: Initialize rdbmsDbInfoTable data.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoTable_init_data */
+
+/**
+ * container-cached overview
+ *
+ */
+
+/***********************************************************************
+ *
+ * cache
+ *
+ ***********************************************************************/
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ *        create a custom container, use this parameter to return it
+ *        to the MFD helper. If set to NULL, the MFD helper will
+ *        allocate a container for you.
+ * @param  cache A pointer to a cache structure. You can set the timeout
+ *         and other cache flags using this pointer.
+ *
+ *  This function is called at startup to allow you to customize certain
+ *  aspects of the access method. For the most part, it is for advanced
+ *  users. The default code should suffice for most cases. If no custom
+ *  container is allocated, the MFD code will create one for your.
+ *
+ *  This is also the place to set up cache behavior. The default, to
+ *  simply set the cache timeout, will work well with the default
+ *  container. If you are using a custom container, you may want to
+ *  look at the cache helper documentation to see if there are any
+ *  flags you want to set.
+ *
+ * @remark
+ *  This would also be a good place to do any initialization needed
+ *  for you data source. For example, opening a connection to another
+ *  process that will supply the data, opening a database, etc.
+ */
+void
+rdbmsDbInfoTable_container_init(netsnmp_container **container_ptr_ptr,
+                        netsnmp_cache *cache)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_container_init","called\n"));
+    
+    if((NULL == cache) || (NULL == container_ptr_ptr)) {
+        snmp_log(LOG_ERR,"bad params to rdbmsDbInfoTable_container_init\n");
+        return;
+    }
+
+    /*
+     * For advanced users, you can use a custom container. If you
+     * do not create one, one will be created for you.
+     */
+    *container_ptr_ptr = NULL;
+
+    /*
+     * TODO:345:A: Set up rdbmsDbInfoTable cache properties.
+     *
+     * Also for advanced users, you can set parameters for the
+     * cache. Do not change the magic pointer, as it is used
+     * by the MFD helper. To completely disable caching, set
+     * cache->enabled to 0.
+     */
+    cache->timeout = RDBMSDBINFOTABLE_CACHE_TIMEOUT; /* seconds */
+} /* rdbmsDbInfoTable_container_init */
+
+/**
+ * load cache data
+ *
+ * TODO:350:M: Implement rdbmsDbInfoTable cache load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR                : other error.
+ *
+ *  This function is called to cache the index(es) (and data, optionally)
+ *  for the every row in the data set.
+ *
+ * @remark
+ *  While loading the cache, the only important thing is the indexes.
+ *  If access to your data is cheap/fast (e.g. you have a pointer to a
+ *  structure in memory), it would make sense to update the data here.
+ *  If, however, the accessing the data invovles more work (e.g. parsing
+ *  some other existing data, or peforming calculations to derive the data),
+ *  then you can limit yourself to setting the indexes and saving any
+ *  information you will need later. Then use the saved information in
+ *  rdbmsDbInfoTable_row_prep() for populating data.
+ *
+ * @note
+ *  If you need consistency between rows (like you want statistics
+ *  for each row to be from the same time frame), you should set all
+ *  data here.
+ *
+ */
+int
+rdbmsDbInfoTable_cache_load(netsnmp_container *container)
+{
+    rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx;
+    size_t count = 0;
+    int i, resultCount, errorCode = MFD_SUCCESS, tmpInt;
+    PGresult *pg_db_qry, *pgsnmpd_tbl_qry;
+    char *db_oid, *tmpString;
+
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_cache_load","called\n"));
+
+    if (PQstatus(dbconn) == CONNECTION_OK) 
+           if (PQserverVersion(dbconn) < 80100)
+                   pg_db_qry = PQexec(dbconn, "SELECT oid, version(), 0 FROM pg_database");
+            else
+                   pg_db_qry = PQexec(dbconn, "SELECT oid, version(), pg_database_size(datname) FROM pg_database");
+    else {
+           snmp_log(LOG_ERR, "Can't get connected to the database");
+           return MFD_RESOURCE_UNAVAILABLE;
+    }
+    if (PQresultStatus(pg_db_qry) != PGRES_TUPLES_OK) {
+           snmp_log(LOG_ERR, "Didn't get any results from the database");
+           PQclear(pg_db_qry);
+           /* It's probably an error if I didn't find *any* information */
+           return MFD_RESOURCE_UNAVAILABLE;
+    }
+
+    resultCount = PQntuples(pg_db_qry);
+
+
+    /*
+     * TODO:351:M: |-> Load/update data in the rdbmsDbInfoTable container.
+     * loop over your rdbmsDbInfoTable data, allocate a rowreq context,
+     * set the index(es) [and data, optionally] and insert into
+     * the container.
+     */
+    for (i = 0; i < resultCount; i++) {
+
+        /*
+         * TODO:352:M: |   |-> set indexes in new rdbmsDbInfoTable rowreq context.
+         */
+        rowreq_ctx = rdbmsDbInfoTable_allocate_rowreq_ctx();
+        if (NULL == rowreq_ctx) {
+            snmp_log(LOG_ERR, "memory allocation failed\n");
+            return MFD_RESOURCE_UNAVAILABLE;
+        }
+       db_oid = PQgetvalue(pg_db_qry, i, 0);
+        if(MFD_SUCCESS != rdbmsDbInfoTable_indexes_set(rowreq_ctx
+                               , atol(db_oid)
+               )) {
+            snmp_log(LOG_ERR,"error setting index while loading "
+                     "rdbmsDbInfoTable cache.\n");
+            rdbmsDbInfoTable_release_rowreq_ctx(rowreq_ctx);
+            continue;
+        }
+
+        /*
+         * TODO:352:r: |   |-> populate rdbmsDbInfoTable data context.
+         * Populate data context here. (optionally, delay until row prep)
+         */
+
+       rowreq_ctx->data.rdbmsDbInfoProductName_len = 255;
+       rowreq_ctx->data.rdbmsDbInfoVersion_len = 255;
+
+       pgsnmpd_tbl_qry = NULL;
+       tmpInt = sizeof("SELECT EXTRACT(YEAR FROM last_backup), EXTRACT(MONTH FROM last_backup), EXTRACT(DAY FROM last_backup), EXTRACT(HOUR FROM last_backup), EXTRACT(MINUTE FROM last_backup), EXTRACT(SECOND FROM last_backup), EXTRACT(MILLISECOND FROM last_backup), EXTRACT(TIMEZONE_HOUR FROM last_backup), EXTRACT(TIMEZONE_MINUTE FROM last_backup) FROM pgsnmpd_rdbmsDbTable WHERE database_oid = %s") + sizeof(*db_oid);
+       tmpString = calloc(tmpInt, sizeof(char*));
+       if (tmpString == NULL) snmp_log(LOG_ERR, "Couldn't allocate memory to query pgsnmpd-specific database table\n");
+       else {
+               snmp_log(LOG_INFO, "Gathering rdbmsDbTable information from pgsnmpd_rdbmsDbTable\n");
+               snprintf(tmpString, sizeof(char*) * tmpInt, "SELECT EXTRACT(YEAR FROM last_backup), EXTRACT(MONTH FROM last_backup), EXTRACT(DAY FROM last_backup), EXTRACT(HOUR FROM last_backup), EXTRACT(MINUTE FROM last_backup), EXTRACT(SECOND FROM last_backup), EXTRACT(MILLISECOND FROM last_backup), EXTRACT(TIMEZONE_HOUR FROM last_backup), EXTRACT(TIMEZONE_MINUTE FROM last_backup) FROM pgsnmpd_rdbmsDbTable WHERE database_oid = %s", db_oid);
+               pgsnmpd_tbl_qry = PQexec(dbconn, tmpString);
+               /* Ignore errors so that pgsnmpd will run without this table being available. Note that this error is INFO level,
+                * instead of something higher, because we're designed to work without this table */
+
+                if (PQresultStatus(pgsnmpd_tbl_qry) == PGRES_TUPLES_OK && PQntuples(pgsnmpd_tbl_qry) > 0) {
+                   rowreq_ctx->data.lastBackupYear = atoi(PQgetvalue(pgsnmpd_tbl_qry, 0, 0));
+                   rowreq_ctx->data.lastBackupMonth = atoi(PQgetvalue(pgsnmpd_tbl_qry, 0, 1));
+                   rowreq_ctx->data.lastBackupDay = atoi(PQgetvalue(pgsnmpd_tbl_qry, 0, 2));
+                   rowreq_ctx->data.lastBackupHour = atoi(PQgetvalue(pgsnmpd_tbl_qry, 0, 3));
+                   rowreq_ctx->data.lastBackupMinutes = atoi(PQgetvalue(pgsnmpd_tbl_qry, 0, 4));
+                   rowreq_ctx->data.lastBackupSeconds = atoi(PQgetvalue(pgsnmpd_tbl_qry, 0, 5));
+                   rowreq_ctx->data.lastBackupDeciSeconds = atoi(PQgetvalue(pgsnmpd_tbl_qry, 0, 6));
+                   rowreq_ctx->data.utc_offset_hours = abs(atoi(PQgetvalue(pgsnmpd_tbl_qry, 0, 7)));
+                   rowreq_ctx->data.utc_offset_minutes = atoi(PQgetvalue(pgsnmpd_tbl_qry, 0, 8));
+                   tmpInt = rowreq_ctx->data.utc_offset_hours * 60 + rowreq_ctx->data.utc_offset_minutes;
+                   if (tmpInt == 0) rowreq_ctx->data.utc_offset_direction = 0;
+                   else 
+                       rowreq_ctx->data.utc_offset_direction = (tmpInt > 0 ? 1 : -1);
+               }
+               else snmp_log(LOG_INFO, "Unable to find relevant data in pgsnmpd_rdbmsDbTable\n");
+               free(tmpString);
+       }
+
+    /*
+     * TRANSIENT or semi-TRANSIENT data:
+     * copy data or save any info needed to do it in row_prep.
+     */
+    /*
+     * setup/save data for rdbmsDbInfoProductName
+     * rdbmsDbInfoProductName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+     */
+    /*
+     * TODO:246:r: |-> Define rdbmsDbInfoProductName mapping.
+     * Map values between raw/native values and MIB values
+     *
+     * if(MFD_SUCCESS !=
+     *    rdbmsDbInfoProductName_map(&rowreq_ctx->data.rdbmsDbInfoProductName, &rowreq_ctx->data.rdbmsDbInfoProductName_len,
+     *                rdbmsDbInfoProductName, rdbmsDbInfoProductName_len, 0)) {
+     *    return MFD_ERROR;
+     * }
+     */
+    /*
+     * make sure there is enough space for rdbmsDbInfoProductName data
+     */
+    if ((NULL == rowreq_ctx->data.rdbmsDbInfoProductName) ||
+        (rowreq_ctx->data.rdbmsDbInfoProductName_len < (strlen(rdbmsDbInfoProductName) * sizeof(rowreq_ctx->data.rdbmsDbInfoProductName[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+        errorCode = MFD_ERROR;
+       break;
+    }
+    rowreq_ctx->data.rdbmsDbInfoProductName_len = strlen(rdbmsDbInfoProductName) * sizeof(rowreq_ctx->data.rdbmsDbInfoProductName[0]);
+    memcpy( rowreq_ctx->data.rdbmsDbInfoProductName, rdbmsDbInfoProductName, rowreq_ctx->data.rdbmsDbInfoProductName_len );
+    
+    /*
+     * setup/save data for rdbmsDbInfoVersion
+     * rdbmsDbInfoVersion(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+     */
+    /*
+     * TODO:246:r: |-> Define rdbmsDbInfoVersion mapping.
+     * Map values between raw/native values and MIB values
+     *
+     * if(MFD_SUCCESS !=
+     *    rdbmsDbInfoVersion_map(&rowreq_ctx->data.rdbmsDbInfoVersion, &rowreq_ctx->data.rdbmsDbInfoVersion_len,
+     *                rdbmsDbInfoVersion, rdbmsDbInfoVersion_len, 0)) {
+     *    return MFD_ERROR;
+     * }
+     */
+    /*
+     * make sure there is enough space for rdbmsDbInfoVersion data
+     */
+    tmpString = PQgetvalue(pg_db_qry, i, 1);
+    tmpInt = strlen(tmpString);
+    if ((NULL == rowreq_ctx->data.rdbmsDbInfoVersion) ||
+        (rowreq_ctx->data.rdbmsDbInfoVersion_len < (tmpInt * sizeof(rowreq_ctx->data.rdbmsDbInfoVersion[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+       errorCode = MFD_ERROR;
+       break;
+    }
+    rowreq_ctx->data.rdbmsDbInfoVersion_len = tmpInt * sizeof(rowreq_ctx->data.rdbmsDbInfoVersion[0]);
+    memcpy( rowreq_ctx->data.rdbmsDbInfoVersion, tmpString, rowreq_ctx->data.rdbmsDbInfoVersion_len );
+    
+    /*
+     * setup/save data for rdbmsDbInfoSizeUnits
+     * rdbmsDbInfoSizeUnits(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+     */
+    /*
+     * TODO:246:r: |-> Define rdbmsDbInfoSizeUnits mapping.
+     * Map values between raw/native values and MIB values
+     *
+    * enums usually need mapping.
+    */
+    if(MFD_SUCCESS !=
+       rdbmsDbInfoSizeUnits_map(&rowreq_ctx->data.rdbmsDbInfoSizeUnits, INTERNAL_RDBMSDBINFOSIZEUNITS_BYTES)) {
+       errorCode = MFD_ERROR;
+       break;
+    }
+    
+    /*
+     * setup/save data for rdbmsDbInfoSizeAllocated
+     * rdbmsDbInfoSizeAllocated(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+     */
+    /*
+     * TODO:246:r: |-> Define rdbmsDbInfoSizeAllocated mapping.
+     * Map values between raw/native values and MIB values
+     *
+     * Integer based value can usually just do a direct copy.
+     */
+    rowreq_ctx->data.rdbmsDbInfoSizeAllocated = strtoul(PQgetvalue(pg_db_qry, i, 2), NULL, 10);
+    
+    /*
+     * setup/save data for rdbmsDbInfoSizeUsed
+     * rdbmsDbInfoSizeUsed(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+     */
+    /*
+     * TODO:246:r: |-> Define rdbmsDbInfoSizeUsed mapping.
+     * Map values between raw/native values and MIB values
+     *
+     * Integer based value can usually just do a direct copy.
+     */
+    rowreq_ctx->data.rdbmsDbInfoSizeUsed = strtoul(PQgetvalue(pg_db_qry, i, 2), NULL, 10);
+        
+        /*
+         * insert into table container
+         */
+        CONTAINER_INSERT(container, rowreq_ctx);
+        ++count;
+       PQclear(pgsnmpd_tbl_qry);
+    }
+
+    DEBUGMSGT(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_cache_load",
+               "inserted %d records\n", count));
+
+    PQclear(pg_db_qry);
+    return errorCode;
+} /* rdbmsDbInfoTable_cache_load */
+
+/**
+ * cache clean up
+ *
+ * @param container container with all current items
+ *
+ *  This optional callback is called prior to all
+ *  item's being removed from the container. If you
+ *  need to do any processing before that, do it here.
+ *
+ * @note
+ *  The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+rdbmsDbInfoTable_cache_free(netsnmp_container *container)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_cache_free","called\n"));
+
+    /*
+     * TODO:380:M: Free rdbmsDbInfoTable cache.
+     */
+} /* rdbmsDbInfoTable_cache_free */
+
+/**
+ * prepare row for processing.
+ *
+ *  When the agent has located the row for a request, this function is
+ *  called to prepare the row for processing. If you fully populated
+ *  the data context during the index setup phase, you may not need to
+ *  do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ */
+int
+rdbmsDbInfoTable_row_prep( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_row_prep","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:390:o: Prepare row for request.
+     * If populating row data was delayed, this is the place to
+     * fill in the row for this request.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoTable_row_prep */
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_access.h b/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_access.h
new file mode 100644 (file)
index 0000000..5931bcf
--- /dev/null
@@ -0,0 +1,77 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbInfoTable_data_access.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbInfoTable_data_access.h,v 1.3 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBINFOTABLE_DATA_ACCESS_H
+#define RDBMSDBINFOTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbInfoTable is subid 2 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.2, length: 9
+*/
+
+
+    int rdbmsDbInfoTable_init_data(rdbmsDbInfoTable_registration_ptr rdbmsDbInfoTable_reg);
+
+
+/*
+ * TODO:180:o: Review rdbmsDbInfoTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define RDBMSDBINFOTABLE_CACHE_TIMEOUT   60
+
+void rdbmsDbInfoTable_container_init(netsnmp_container **container_ptr_ptr,
+                             netsnmp_cache *cache);
+int rdbmsDbInfoTable_cache_load(netsnmp_container *container);
+void rdbmsDbInfoTable_cache_free(netsnmp_container *container);
+
+    /*
+    ***************************************************
+    ***             START EXAMPLE CODE              ***
+    ***---------------------------------------------***/
+/* *********************************************************************
+ * Since we have no idea how you really access your data, we'll go with
+ * a worst case example: a flat text file.
+ */
+#define MAX_LINE_SIZE 256
+    /*
+    ***---------------------------------------------***
+    ***              END  EXAMPLE CODE              ***
+    ***************************************************/
+    int rdbmsDbInfoTable_row_prep( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBINFOTABLE_DATA_ACCESS_H */
diff --git a/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_get.c b/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_get.c
new file mode 100644 (file)
index 0000000..5da7220
--- /dev/null
@@ -0,0 +1,847 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbInfoTable_data_get.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbInfoTable_data_get.c,v 1.5 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsDbInfoTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement rdbmsDbInfoTable get routines.
+ * TODO:240:M: Implement rdbmsDbInfoTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbInfoTable is subid 2 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.2, length: 9
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement rdbmsDbInfoTable data context functions.
+ */
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This convenience function is useful for setting all the MIB index
+ *  components with a single function call. It is assume that the C values
+ *  have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+rdbmsDbInfoTable_indexes_set_tbl_idx(rdbmsDbInfoTable_mib_index *tbl_idx, long rdbmsDbIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_indexes_set_tbl_idx","called\n"));
+
+    /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->rdbmsDbIndex = rdbmsDbIndex_val;
+    
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This function sets the mib indexs, then updates the oid indexs
+ *  from the mib index.
+ */
+int
+rdbmsDbInfoTable_indexes_set(rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, long rdbmsDbIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_indexes_set","called\n"));
+
+    if(MFD_SUCCESS != rdbmsDbInfoTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+                                   , rdbmsDbIndex_val
+           ))
+        return MFD_ERROR;
+
+    /*
+     * convert mib index to oid index
+     */
+    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+    if(0 != rdbmsDbInfoTable_index_to_oid(&rowreq_ctx->oid_idx,
+                                    &rowreq_ctx->tbl_idx)) {
+        return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbInfoEntry.rdbmsDbInfoProductName
+ * rdbmsDbInfoProductName is subid 1 of rdbmsDbInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.2.1.1
+ * Description:
+The textual product name of the server that created or last
+           restructured this database.  The format is product specific.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbInfoProductName.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbInfoProductName_map(char **mib_rdbmsDbInfoProductName_val_ptr_ptr, size_t *mib_rdbmsDbInfoProductName_val_ptr_len_ptr, char *raw_rdbmsDbInfoProductName_val_ptr, size_t raw_rdbmsDbInfoProductName_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbInfoProductName_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbInfoProductName_val_ptr_ptr) && (NULL != mib_rdbmsDbInfoProductName_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoProductName_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbInfoProductName non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbInfoProductName_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbInfoProductName_val_ptr_ptr) || (*mib_rdbmsDbInfoProductName_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbInfoProductName_val_ptr_ptr = realloc( *mib_rdbmsDbInfoProductName_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbInfoProductName_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbInfoProductName_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbInfoProductName_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbInfoProductName_val_ptr_ptr, raw_rdbmsDbInfoProductName_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoProductName_map */
+
+/**
+ * Extract the current value of the rdbmsDbInfoProductName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbInfoProductName_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsDbInfoProductName_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbInfoProductName.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbInfoProductName_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbInfoProductName_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbInfoProductName_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbInfoProductName_val_ptr_ptr, size_t *rdbmsDbInfoProductName_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsDbInfoProductName_val_ptr_ptr) && (NULL != *rdbmsDbInfoProductName_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsDbInfoProductName_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoProductName_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbInfoProductName data.
+ * set (* rdbmsDbInfoProductName_val_ptr_ptr ) and (* rdbmsDbInfoProductName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsDbInfoProductName data
+     */
+    if ((NULL == (* rdbmsDbInfoProductName_val_ptr_ptr )) ||
+        ((* rdbmsDbInfoProductName_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsDbInfoProductName_len * sizeof((* rdbmsDbInfoProductName_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsDbInfoProductName data
+         */
+        (* rdbmsDbInfoProductName_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsDbInfoProductName_len * sizeof((* rdbmsDbInfoProductName_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsDbInfoProductName_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsDbInfoProductName_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsDbInfoProductName_len * sizeof((* rdbmsDbInfoProductName_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsDbInfoProductName_val_ptr_ptr ), rowreq_ctx->data.rdbmsDbInfoProductName, (* rdbmsDbInfoProductName_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoProductName_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbInfoEntry.rdbmsDbInfoVersion
+ * rdbmsDbInfoVersion is subid 2 of rdbmsDbInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.2.1.2
+ * Description:
+The version number of the server that created or last
+           restructured this database.  The format is product specific.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbInfoVersion.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbInfoVersion_map(char **mib_rdbmsDbInfoVersion_val_ptr_ptr, size_t *mib_rdbmsDbInfoVersion_val_ptr_len_ptr, char *raw_rdbmsDbInfoVersion_val_ptr, size_t raw_rdbmsDbInfoVersion_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbInfoVersion_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbInfoVersion_val_ptr_ptr) && (NULL != mib_rdbmsDbInfoVersion_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoVersion_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbInfoVersion non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbInfoVersion_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbInfoVersion_val_ptr_ptr) || (*mib_rdbmsDbInfoVersion_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbInfoVersion_val_ptr_ptr = realloc( *mib_rdbmsDbInfoVersion_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbInfoVersion_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbInfoVersion_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbInfoVersion_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbInfoVersion_val_ptr_ptr, raw_rdbmsDbInfoVersion_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoVersion_map */
+
+/**
+ * Extract the current value of the rdbmsDbInfoVersion data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbInfoVersion_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsDbInfoVersion_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbInfoVersion.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbInfoVersion_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbInfoVersion_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbInfoVersion_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbInfoVersion_val_ptr_ptr, size_t *rdbmsDbInfoVersion_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsDbInfoVersion_val_ptr_ptr) && (NULL != *rdbmsDbInfoVersion_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsDbInfoVersion_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoVersion_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbInfoVersion data.
+ * set (* rdbmsDbInfoVersion_val_ptr_ptr ) and (* rdbmsDbInfoVersion_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsDbInfoVersion data
+     */
+    if ((NULL == (* rdbmsDbInfoVersion_val_ptr_ptr )) ||
+        ((* rdbmsDbInfoVersion_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsDbInfoVersion_len * sizeof((* rdbmsDbInfoVersion_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsDbInfoVersion data
+         */
+        (* rdbmsDbInfoVersion_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsDbInfoVersion_len * sizeof((* rdbmsDbInfoVersion_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsDbInfoVersion_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsDbInfoVersion_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsDbInfoVersion_len * sizeof((* rdbmsDbInfoVersion_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsDbInfoVersion_val_ptr_ptr ), rowreq_ctx->data.rdbmsDbInfoVersion, (* rdbmsDbInfoVersion_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoVersion_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbInfoEntry.rdbmsDbInfoSizeUnits
+ * rdbmsDbInfoSizeUnits is subid 3 of rdbmsDbInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.2.1.3
+ * Description:
+Identification of the units used to measure the size of this
+           database in rdbmsDbInfoSizeAllocated and rdbmsDbInfoSizeUsed.
+           bytes(1) indicates individual bytes, kbytes(2) indicates
+           units of kilobytes, mbytes(3) indicates units of megabytes,
+           gbytes(4) indicates units of gigabytes, and tbytes(5)
+           indicates units of terabytes.  All are binary multiples -- 1K
+           = 1024.  If writable, changes here are reflected in the get
+           values of the associated objects.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  1      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ * Enum range: 4/8. Values:  bytes(1), kbytes(2), mbytes(3), gbytes(4), tbytes(5)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbInfoSizeUnits.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbInfoSizeUnits_map(u_long *mib_rdbmsDbInfoSizeUnits_val_ptr, u_long raw_rdbmsDbInfoSizeUnits_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsDbInfoSizeUnits_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoSizeUnits_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsDbInfoSizeUnits enum mapping.
+     * uses INTERNAL_* macros defined in the header files
+     */
+    switch(raw_rdbmsDbInfoSizeUnits_val) {
+        case INTERNAL_RDBMSDBINFOSIZEUNITS_BYTES:
+             *mib_rdbmsDbInfoSizeUnits_val_ptr = RDBMSDBINFOSIZEUNITS_BYTES;
+             break;
+
+        case INTERNAL_RDBMSDBINFOSIZEUNITS_KBYTES:
+             *mib_rdbmsDbInfoSizeUnits_val_ptr = RDBMSDBINFOSIZEUNITS_KBYTES;
+             break;
+
+        case INTERNAL_RDBMSDBINFOSIZEUNITS_MBYTES:
+             *mib_rdbmsDbInfoSizeUnits_val_ptr = RDBMSDBINFOSIZEUNITS_MBYTES;
+             break;
+
+        case INTERNAL_RDBMSDBINFOSIZEUNITS_GBYTES:
+             *mib_rdbmsDbInfoSizeUnits_val_ptr = RDBMSDBINFOSIZEUNITS_GBYTES;
+             break;
+
+        case INTERNAL_RDBMSDBINFOSIZEUNITS_TBYTES:
+             *mib_rdbmsDbInfoSizeUnits_val_ptr = RDBMSDBINFOSIZEUNITS_TBYTES;
+             break;
+
+             default:
+                 snmp_log(LOG_ERR, "couldn't map value %ld for rdbmsDbInfoSizeUnits\n", raw_rdbmsDbInfoSizeUnits_val );
+                 return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoSizeUnits_map */
+
+/**
+ * Extract the current value of the rdbmsDbInfoSizeUnits data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbInfoSizeUnits_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsDbInfoSizeUnits_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsDbInfoSizeUnits_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsDbInfoSizeUnits_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoSizeUnits_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbInfoSizeUnits data.
+ * set (* rdbmsDbInfoSizeUnits_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsDbInfoSizeUnits_val_ptr ) = rowreq_ctx->data.rdbmsDbInfoSizeUnits;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoSizeUnits_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbInfoEntry.rdbmsDbInfoSizeAllocated
+ * rdbmsDbInfoSizeAllocated is subid 4 of rdbmsDbInfoEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.39.1.2.1.4
+ * Description:
+The estimated size of this database (in
+           rdbmsDbInfoSizeUnits), which is the disk space that has been
+           allocated to it and is no longer available to users on this
+           host.  rdbmsDbInfoSize does not necessarily indicate the
+           amount of space actually in use for database data.  Some
+           databases may support extending allocated size, and others
+           may not.
+
+           Note that a compliant agent does not need to
+           allow write access to this object.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   0
+ *   settable   1
+ *
+ * Ranges:  1 - 2147483647;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbInfoSizeAllocated.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbInfoSizeAllocated_map(long *mib_rdbmsDbInfoSizeAllocated_val_ptr, long raw_rdbmsDbInfoSizeAllocated_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsDbInfoSizeAllocated_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoSizeAllocated_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsDbInfoSizeAllocated mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsDbInfoSizeAllocated_val_ptr) = raw_rdbmsDbInfoSizeAllocated_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoSizeAllocated_map */
+
+/**
+ * Extract the current value of the rdbmsDbInfoSizeAllocated data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbInfoSizeAllocated_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsDbInfoSizeAllocated_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, long * rdbmsDbInfoSizeAllocated_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsDbInfoSizeAllocated_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoSizeAllocated_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbInfoSizeAllocated data.
+ * set (* rdbmsDbInfoSizeAllocated_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsDbInfoSizeAllocated_val_ptr ) = rowreq_ctx->data.rdbmsDbInfoSizeAllocated;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoSizeAllocated_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbInfoEntry.rdbmsDbInfoSizeUsed
+ * rdbmsDbInfoSizeUsed is subid 5 of rdbmsDbInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.2.1.5
+ * Description:
+The estimated size of this database, in rdbmsDbInfoSizeUnits,
+           which is actually in use for database data.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   0
+ *   settable   0
+ *
+ * Ranges:  1 - 2147483647;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbInfoSizeUsed.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbInfoSizeUsed_map(long *mib_rdbmsDbInfoSizeUsed_val_ptr, long raw_rdbmsDbInfoSizeUsed_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsDbInfoSizeUsed_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoSizeUsed_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsDbInfoSizeUsed mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsDbInfoSizeUsed_val_ptr) = raw_rdbmsDbInfoSizeUsed_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoSizeUsed_map */
+
+/**
+ * Extract the current value of the rdbmsDbInfoSizeUsed data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbInfoSizeUsed_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsDbInfoSizeUsed_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, long * rdbmsDbInfoSizeUsed_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsDbInfoSizeUsed_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoSizeUsed_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbInfoSizeUsed data.
+ * set (* rdbmsDbInfoSizeUsed_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsDbInfoSizeUsed_val_ptr ) = rowreq_ctx->data.rdbmsDbInfoSizeUsed;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoSizeUsed_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbInfoEntry.rdbmsDbInfoLastBackup
+ * rdbmsDbInfoLastBackup is subid 6 of rdbmsDbInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.2.1.6
+ * Description:
+The date and time that the latest complete or partial backup
+           of the database was taken. If a database has never been
+           backed up, then attempts to access this object will
+           result in either noSuchName (SNMPv1) or noSuchInstance
+           (SNMPv2).
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 2d-1d-1d,1d:1d:1d.1d,1a1d:1d
+ *
+ * Ranges:  8, 11;
+ *
+ * Its syntax is DateAndTime (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 11)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbInfoLastBackup.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbInfoLastBackup_map(char **mib_rdbmsDbInfoLastBackup_val_ptr_ptr, size_t *mib_rdbmsDbInfoLastBackup_val_ptr_len_ptr, char *raw_rdbmsDbInfoLastBackup_val_ptr, size_t raw_rdbmsDbInfoLastBackup_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbInfoLastBackup_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbInfoLastBackup_val_ptr_ptr) && (NULL != mib_rdbmsDbInfoLastBackup_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoLastBackup_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbInfoLastBackup non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbInfoLastBackup_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbInfoLastBackup_val_ptr_ptr) || (*mib_rdbmsDbInfoLastBackup_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbInfoLastBackup_val_ptr_ptr = realloc( *mib_rdbmsDbInfoLastBackup_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbInfoLastBackup_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbInfoLastBackup_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbInfoLastBackup_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbInfoLastBackup_val_ptr_ptr, raw_rdbmsDbInfoLastBackup_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoLastBackup_map */
+
+/**
+ * Extract the current value of the rdbmsDbInfoLastBackup data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbInfoLastBackup_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsDbInfoLastBackup_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbInfoLastBackup.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbInfoLastBackup_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbInfoLastBackup_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbInfoLastBackup_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbInfoLastBackup_val_ptr_ptr, size_t *rdbmsDbInfoLastBackup_val_ptr_len_ptr )
+{
+   /* temporary storage for date. If you have any of this data available
+      directly, use it instead. */
+/*   int year, month, day, hour, minutes, seconds, deci_seconds;
+ *   int rc, utc_offset_direction, utc_offset_hours, utc_offset_minutes; */
+   int rc;
+
+   /** we should have a pointer and enough storage */
+   /* Josh changed mib2c's template from rdbmsDbInfoLastBackup_ptr_ptr and rdbmsDbInfoLastBackup_len_ptr to rdbmsDbInfoLastBackup_val_ptr_ptr and
+    * rdbmsDbInfoLastBackup_val_ptr_len_ptr respectively, both here and in the call to netsnmp_dateandtime_set_buf_from_vars. I'm not sure this was
+    * the right thing to do, but it does appear to work */
+   netsnmp_assert( (NULL != rdbmsDbInfoLastBackup_val_ptr_ptr) && (NULL != *rdbmsDbInfoLastBackup_val_ptr_ptr));
+   netsnmp_assert( (NULL != rdbmsDbInfoLastBackup_val_ptr_len_ptr) && ((* rdbmsDbInfoLastBackup_val_ptr_len_ptr) >= 11));
+
+   /*
+    * TODO:231:o: |-> copy rdbmsDbInfoLastBackup data.
+    * get the date from your context pointer.
+    */
+   /*return MFD_SKIP; * TODO:234:M: |-> Remove SKIP once you've set rdbmsDbInfoLastBackup data */
+
+   /* call convenience function to set data */
+   rc = netsnmp_dateandtime_set_buf_from_vars((u_char *)*rdbmsDbInfoLastBackup_val_ptr_ptr, rdbmsDbInfoLastBackup_val_ptr_len_ptr,
+   rowreq_ctx->data.lastBackupYear, 
+   rowreq_ctx->data.lastBackupMonth, 
+   rowreq_ctx->data.lastBackupDay, 
+   rowreq_ctx->data.lastBackupHour, 
+   rowreq_ctx->data.lastBackupMinutes, 
+   rowreq_ctx->data.lastBackupSeconds, 
+   rowreq_ctx->data.lastBackupDeciSeconds, 
+   rowreq_ctx->data.utc_offset_direction, 
+   rowreq_ctx->data.utc_offset_hours, 
+   rowreq_ctx->data.utc_offset_minutes );
+   if(rc != SNMP_ERR_NOERROR)
+      return rc;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbInfoLastBackup_get */
+
+
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_get.h b/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_data_get.h
new file mode 100644 (file)
index 0000000..ba9adf3
--- /dev/null
@@ -0,0 +1,70 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbInfoTable_data_get.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbInfoTable_data_get.h,v 1.3 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBINFOTABLE_DATA_GET_H
+#define RDBMSDBINFOTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbInfoTable is subid 2 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.2, length: 9
+*/
+    /*
+     * indexes
+     */
+    int rdbmsDbIndex_map(long *mib_rdbmsDbIndex_val_ptr, long raw_rdbmsDbIndex_val);
+
+    int rdbmsDbInfoProductName_map(char **mib_rdbmsDbInfoProductName_val_ptr_ptr, size_t *mib_rdbmsDbInfoProductName_val_ptr_len_ptr, char *raw_rdbmsDbInfoProductName_val_ptr, size_t raw_rdbmsDbInfoProductName_val_ptr_len, int allow_realloc);
+    int rdbmsDbInfoProductName_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbInfoProductName_val_ptr_ptr, size_t *rdbmsDbInfoProductName_val_ptr_len_ptr );
+    int rdbmsDbInfoVersion_map(char **mib_rdbmsDbInfoVersion_val_ptr_ptr, size_t *mib_rdbmsDbInfoVersion_val_ptr_len_ptr, char *raw_rdbmsDbInfoVersion_val_ptr, size_t raw_rdbmsDbInfoVersion_val_ptr_len, int allow_realloc);
+    int rdbmsDbInfoVersion_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbInfoVersion_val_ptr_ptr, size_t *rdbmsDbInfoVersion_val_ptr_len_ptr );
+    int rdbmsDbInfoSizeUnits_map(u_long *mib_rdbmsDbInfoSizeUnits_val_ptr, u_long raw_rdbmsDbInfoSizeUnits_val);
+    int rdbmsDbInfoSizeUnits_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsDbInfoSizeUnits_val_ptr );
+    int rdbmsDbInfoSizeAllocated_map(long *mib_rdbmsDbInfoSizeAllocated_val_ptr, long raw_rdbmsDbInfoSizeAllocated_val);
+    int rdbmsDbInfoSizeAllocated_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, long * rdbmsDbInfoSizeAllocated_val_ptr );
+    int rdbmsDbInfoSizeUsed_map(long *mib_rdbmsDbInfoSizeUsed_val_ptr, long raw_rdbmsDbInfoSizeUsed_val);
+    int rdbmsDbInfoSizeUsed_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, long * rdbmsDbInfoSizeUsed_val_ptr );
+    int rdbmsDbInfoLastBackup_map(char **mib_rdbmsDbInfoLastBackup_val_ptr_ptr, size_t *mib_rdbmsDbInfoLastBackup_val_ptr_len_ptr, char *raw_rdbmsDbInfoLastBackup_val_ptr, size_t raw_rdbmsDbInfoLastBackup_val_ptr_len, int allow_realloc);
+    int rdbmsDbInfoLastBackup_get( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbInfoLastBackup_val_ptr_ptr, size_t *rdbmsDbInfoLastBackup_val_ptr_len_ptr );
+
+
+int rdbmsDbInfoTable_indexes_set_tbl_idx(rdbmsDbInfoTable_mib_index *tbl_idx, long rdbmsDbIndex_val);
+int rdbmsDbInfoTable_indexes_set(rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, long rdbmsDbIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBINFOTABLE_DATA_GET_H */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_enums.h b/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_enums.h
new file mode 100644 (file)
index 0000000..30b62bb
--- /dev/null
@@ -0,0 +1,76 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbInfoTable_enums.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbInfoTable_enums.h,v 1.3 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBINFOTABLE_ENUMS_H
+#define RDBMSDBINFOTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table rdbmsDbInfoTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * rdbmsDbInfoSizeUnits (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef RDBMSDBINFOSIZEUNITS_ENUMS
+#define RDBMSDBINFOSIZEUNITS_ENUMS
+
+#define RDBMSDBINFOSIZEUNITS_BYTES  1 
+#define RDBMSDBINFOSIZEUNITS_KBYTES  2 
+#define RDBMSDBINFOSIZEUNITS_MBYTES  3 
+#define RDBMSDBINFOSIZEUNITS_GBYTES  4 
+#define RDBMSDBINFOSIZEUNITS_TBYTES  5 
+
+
+#endif /* RDBMSDBINFOSIZEUNITS_ENUMS */
+
+    /*
+     * TODO:140:o: Define interal representation of rdbmsDbInfoSizeUnits enums.
+     * (used for value mapping; see notes at top of file)
+     */
+#define INTERNAL_RDBMSDBINFOSIZEUNITS_BYTES  1 
+#define INTERNAL_RDBMSDBINFOSIZEUNITS_KBYTES  2 
+#define INTERNAL_RDBMSDBINFOSIZEUNITS_MBYTES  3 
+#define INTERNAL_RDBMSDBINFOSIZEUNITS_GBYTES  4 
+#define INTERNAL_RDBMSDBINFOSIZEUNITS_TBYTES  5 
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBINFOTABLE_ENUMS_H */
diff --git a/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_interface.c b/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_interface.c
new file mode 100644 (file)
index 0000000..5de7a4d
--- /dev/null
@@ -0,0 +1,716 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbInfoTable_interface.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbInfoTable_interface.c,v 1.3 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbInfoTable.h"
+#include "rdbmsDbInfoTable_interface.h"
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbInfoTable is subid 2 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.2, length: 9
+*/
+typedef struct rdbmsDbInfoTable_interface_ctx_s {
+
+   netsnmp_container              *container;
+   netsnmp_cache                  *cache; /* optional cache */
+
+   rdbmsDbInfoTable_registration_ptr      user_ctx;
+   
+   netsnmp_table_registration_info  tbl_info;
+
+   netsnmp_baby_steps_access_methods access_multiplexer;
+
+} rdbmsDbInfoTable_interface_ctx;
+
+static rdbmsDbInfoTable_interface_ctx rdbmsDbInfoTable_if_ctx;
+
+static void _rdbmsDbInfoTable_container_init(
+    rdbmsDbInfoTable_interface_ctx *if_ctx);
+
+
+static Netsnmp_Node_Handler _mfd_rdbmsDbInfoTable_pre_request;
+static Netsnmp_Node_Handler _mfd_rdbmsDbInfoTable_post_request;
+static Netsnmp_Node_Handler _mfd_rdbmsDbInfoTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_rdbmsDbInfoTable_get_values;
+/**
+ * @internal
+ * Initialize the table rdbmsDbInfoTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+_rdbmsDbInfoTable_initialize_interface(rdbmsDbInfoTable_registration_ptr reg_ptr,  u_long flags)
+{
+    netsnmp_baby_steps_access_methods *access_multiplexer =
+        &rdbmsDbInfoTable_if_ctx.access_multiplexer;
+    netsnmp_table_registration_info *tbl_info = &rdbmsDbInfoTable_if_ctx.tbl_info;
+    netsnmp_handler_registration *reginfo;
+    netsnmp_mib_handler *handler;
+    int    mfd_modes = 0;
+
+    DEBUGMSGTL(("internal:rdbmsDbInfoTable:_rdbmsDbInfoTable_initialize_interface","called\n"));
+
+
+    /*************************************************
+     *
+     * save interface context for rdbmsDbInfoTable
+     */
+    /*
+     * Setting up the table's definition
+     */
+    netsnmp_table_helper_add_indexes(tbl_info,
+                                  ASN_INTEGER, /** index: rdbmsDbIndex */
+                             0);
+
+    /*  Define the minimum and maximum accessible columns.  This
+        optimizes retrival. */
+    tbl_info->min_column = RDBMSDBINFOTABLE_MIN_COL;
+    tbl_info->max_column = RDBMSDBINFOTABLE_MAX_COL;
+
+    /*
+     * save users context
+     */
+    rdbmsDbInfoTable_if_ctx.user_ctx = reg_ptr;
+
+    /*
+     * call data access initialization code
+     */
+    rdbmsDbInfoTable_init_data(reg_ptr);
+
+    /*
+     * set up the container
+     */
+    _rdbmsDbInfoTable_container_init(&rdbmsDbInfoTable_if_ctx);
+    if (NULL == rdbmsDbInfoTable_if_ctx.container) {
+        snmp_log(LOG_ERR,"could not initialize container for rdbmsDbInfoTable\n");
+        return;
+    }
+    
+    /*
+     * access_multiplexer: REQUIRED wrapper for get request handling
+     */
+    access_multiplexer->object_lookup = _mfd_rdbmsDbInfoTable_object_lookup;
+    access_multiplexer->get_values = _mfd_rdbmsDbInfoTable_get_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->pre_request = _mfd_rdbmsDbInfoTable_pre_request;
+    access_multiplexer->post_request = _mfd_rdbmsDbInfoTable_post_request;
+
+
+    /*************************************************
+     *
+     * Create a registration, save our reg data, register table.
+     */
+    DEBUGMSGTL(("rdbmsDbInfoTable:init_rdbmsDbInfoTable",
+                "Registering rdbmsDbInfoTable as a mibs-for-dummies table.\n"));                
+    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+    reginfo = netsnmp_handler_registration_create("rdbmsDbInfoTable", handler,
+                                                  rdbmsDbInfoTable_oid,
+                                                  rdbmsDbInfoTable_oid_size,
+                                                  HANDLER_CAN_BABY_STEP |
+                                                  HANDLER_CAN_RONLY
+                                                  );
+    if(NULL == reginfo) {
+        snmp_log(LOG_ERR,"error registering table rdbmsDbInfoTable\n");
+        return;
+    }
+    reginfo->my_reg_void = &rdbmsDbInfoTable_if_ctx;
+
+    /*************************************************
+     *
+     * set up baby steps handler, create it and inject it
+     */
+    if( access_multiplexer->object_lookup )
+        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+    if( access_multiplexer->set_values )
+        mfd_modes |= BABY_STEP_SET_VALUES;
+    if( access_multiplexer->irreversible_commit )
+        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+    if( access_multiplexer->object_syntax_checks )
+        mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+    if( access_multiplexer->pre_request )
+        mfd_modes |= BABY_STEP_PRE_REQUEST;
+    if( access_multiplexer->post_request )
+        mfd_modes |= BABY_STEP_POST_REQUEST;
+    
+    if( access_multiplexer->undo_setup )
+        mfd_modes |= BABY_STEP_UNDO_SETUP;
+    if( access_multiplexer->undo_cleanup )
+        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+    if( access_multiplexer->undo_sets )
+        mfd_modes |= BABY_STEP_UNDO_SETS;
+    
+    if( access_multiplexer->row_creation )
+        mfd_modes |= BABY_STEP_ROW_CREATE;
+    if( access_multiplexer->consistency_checks )
+        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+    if( access_multiplexer->commit )
+        mfd_modes |= BABY_STEP_COMMIT;
+    if( access_multiplexer->undo_commit )
+        mfd_modes |= BABY_STEP_UNDO_COMMIT;
+    
+    handler = netsnmp_baby_steps_handler_get(mfd_modes);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+     */
+    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject container_table helper
+     */
+    handler =
+        netsnmp_container_table_handler_get(tbl_info,
+                                            rdbmsDbInfoTable_if_ctx.container,
+                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+    netsnmp_inject_handler( reginfo, handler );
+
+    /*************************************************
+     *
+     * inject cache helper
+     */
+    if(NULL != rdbmsDbInfoTable_if_ctx.cache) {
+        handler = netsnmp_cache_handler_get(rdbmsDbInfoTable_if_ctx.cache);
+        netsnmp_inject_handler( reginfo, handler );
+    }
+
+    /*
+     * register table
+     */
+    netsnmp_register_table(reginfo, tbl_info);
+} /* _rdbmsDbInfoTable_initialize_interface */
+
+void
+rdbmsDbInfoTable_valid_columns_set(netsnmp_column_info *vc)
+{
+    rdbmsDbInfoTable_if_ctx.tbl_info.valid_columns = vc;
+} /* rdbmsDbInfoTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+rdbmsDbInfoTable_index_to_oid(netsnmp_index *oid_idx,
+                         rdbmsDbInfoTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_rdbmsDbIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_index_to_oid","called\n"));
+
+        /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_rdbmsDbIndex, (u_char*)&mib_idx->rdbmsDbIndex,
+                       sizeof(mib_idx->rdbmsDbIndex));
+
+
+    err = build_oid_noalloc(oid_idx->oids, oid_idx->len, (size_t *)&oid_idx->len,
+                           NULL, 0, &var_rdbmsDbIndex);
+    if(err)
+        snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_rdbmsDbIndex );
+
+    return err;
+} /* rdbmsDbInfoTable_index_to_oid */
+
+/**
+ * extract rdbmsDbInfoTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR  : no error
+ * @retval SNMP_ERR_GENERR   : error
+ */
+int
+rdbmsDbInfoTable_index_from_oid(netsnmp_index *oid_idx,
+                         rdbmsDbInfoTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_rdbmsDbIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbInfoTable:rdbmsDbInfoTable_index_from_oid","called\n"));
+
+    /*
+     * parse the oid into the individual index components
+     */
+    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+                             &var_rdbmsDbIndex );
+    if (err == SNMP_ERR_NOERROR) {
+        /*
+         * copy out values
+         */
+    mib_idx->rdbmsDbIndex = *((long *)var_rdbmsDbIndex.val.string);
+
+
+    }
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_rdbmsDbIndex );
+
+    return err;
+} /* rdbmsDbInfoTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a rdbmsDbInfoTable_rowreq_ctx
+ */
+rdbmsDbInfoTable_rowreq_ctx *
+rdbmsDbInfoTable_allocate_rowreq_ctx(void)
+{
+    rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx =
+                  SNMP_MALLOC_TYPEDEF(rdbmsDbInfoTable_rowreq_ctx);
+
+    DEBUGMSGTL(("internal:rdbmsDbInfoTable:rdbmsDbInfoTable_allocate_rowreq_ctx","called\n"));
+
+    if(NULL == rowreq_ctx) {
+        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+                 "rdbmsDbInfoTable_rowreq_ctx.\n");
+    }
+
+    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+    rowreq_ctx->rdbmsDbInfoTable_data_list = NULL;
+    rowreq_ctx->rdbmsDbInfoTable_reg = rdbmsDbInfoTable_if_ctx.user_ctx;
+
+
+    return rowreq_ctx;
+} /* rdbmsDbInfoTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a rdbmsDbInfoTable_rowreq_ctx
+ */
+void
+rdbmsDbInfoTable_release_rowreq_ctx(rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsDbInfoTable:rdbmsDbInfoTable_release_rowreq_ctx","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+
+    /*
+     * free index oid pointer
+     */
+    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+        free(rowreq_ctx->oid_idx.oids);
+
+    SNMP_FREE(rowreq_ctx);
+} /* rdbmsDbInfoTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbInfoTable_pre_request(netsnmp_mib_handler *handler,
+                            netsnmp_handler_registration *reginfo,
+                            netsnmp_agent_request_info *agtreq_info,
+                            netsnmp_request_info *requests)
+{
+    int rc = rdbmsDbInfoTable_pre_request(rdbmsDbInfoTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsDbInfoTable","error %d from "
+                    "rdbmsDbInfoTable_pre_request\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbInfoTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbInfoTable_post_request(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx;
+    int rc = rdbmsDbInfoTable_post_request(rdbmsDbInfoTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsDbInfoTable","error %d from "
+                    "rdbmsDbInfoTable_post_request\n", rc));
+    }
+    
+    /*
+     * if there are no errors, check for and handle row creation/deletion
+     */
+    rc = netsnmp_check_requests_error(requests);
+    if ((SNMP_ERR_NOERROR == rc) &&
+        (NULL !=
+         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
+        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+            CONTAINER_INSERT(rdbmsDbInfoTable_if_ctx.container, rowreq_ctx);
+        }
+        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+            CONTAINER_REMOVE(rdbmsDbInfoTable_if_ctx.container, rowreq_ctx);
+            rdbmsDbInfoTable_release_rowreq_ctx(rowreq_ctx);
+        }
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbInfoTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbInfoTable_object_lookup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    
+    DEBUGMSGTL(("internal:rdbmsDbInfoTable:_mfd_rdbmsDbInfoTable_object_lookup","called\n"));
+
+    /*
+     * get our context from mfd
+     * rdbmsDbInfoTable_interface_ctx *if_ctx =
+     *             (rdbmsDbInfoTable_interface_ctx *)reginfo->my_reg_void;
+     */
+
+    if(NULL == rowreq_ctx) {
+        netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
+    }
+    else {
+        rdbmsDbInfoTable_row_prep(rowreq_ctx);
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbInfoTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsDbInfoTable_get_column( rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsDbInfoTable:_mfd_rdbmsDbInfoTable_get_column","called\n"));
+
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsDbInfoProductName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+    case COLUMN_RDBMSDBINFOPRODUCTNAME:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsDbInfoProductName_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsDbInfoVersion(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+    case COLUMN_RDBMSDBINFOVERSION:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsDbInfoVersion_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsDbInfoSizeUnits(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+    case COLUMN_RDBMSDBINFOSIZEUNITS:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_INTEGER;
+rc = rdbmsDbInfoSizeUnits_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsDbInfoSizeAllocated(4)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+    case COLUMN_RDBMSDBINFOSIZEALLOCATED:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = rdbmsDbInfoSizeAllocated_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* rdbmsDbInfoSizeUsed(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+    case COLUMN_RDBMSDBINFOSIZEUSED:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = rdbmsDbInfoSizeUsed_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* rdbmsDbInfoLastBackup(6)/DateAndTime/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+    case COLUMN_RDBMSDBINFOLASTBACKUP:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsDbInfoLastBackup_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _rdbmsDbInfoTable_get_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _rdbmsDbInfoTable_get_column */
+
+int
+_mfd_rdbmsDbInfoTable_get_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    u_char                     * old_string;
+    void                      (*dataFreeHook)(void *);
+    int                        rc;
+
+    DEBUGMSGTL(("internal:rdbmsDbInfoTable:_mfd_rdbmsDbInfoTable_get_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * save old pointer, so we can free it if replaced
+         */
+        old_string = requests->requestvb->val.string;
+        dataFreeHook = requests->requestvb->dataFreeHook;
+        if(NULL == requests->requestvb->val.string) {
+            requests->requestvb->val.string = requests->requestvb->buf;
+            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+        else if(requests->requestvb->buf == requests->requestvb->val.string) {
+            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+
+        /*
+         * get column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _rdbmsDbInfoTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            if(MFD_SKIP == rc) {
+                requests->requestvb->type = ASN_PRIV_RETRY;
+                rc = SNMP_ERR_NOERROR;
+            }
+        }
+        else if (NULL == requests->requestvb->val.string) {
+            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+            rc = SNMP_ERR_GENERR;
+        }
+        if(rc)
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+        /*
+         * if the buffer wasn't used previously for the old data (i.e. it
+         * was allcoated memory)  and the get routine replaced the pointer,
+         * we need to free the previous pointer.
+         */
+        if(old_string && (old_string != requests->requestvb->buf) &&
+           (requests->requestvb->val.string != old_string)) {
+            if(dataFreeHook)
+                (*dataFreeHook)(old_string);
+            else
+                free(old_string);
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbInfoTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+    DEBUGMSGTL(("internal:rdbmsDbInfoTable:_cache_load","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache for rdbmsDbInfoTable_cache_load\n");
+        return -1;
+    }
+
+    /** should only be called for an invalid or expired cache */
+    netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+    
+    /*
+     * call user code
+     */
+    return rdbmsDbInfoTable_cache_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_item_free(rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+    DEBUGMSGTL(("internal:rdbmsDbInfoTable:_cache_item_free","called\n"));
+
+    if(NULL == rowreq_ctx)
+        return;
+
+    rdbmsDbInfoTable_release_rowreq_ctx(rowreq_ctx);
+} /* _cache_item_free */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+    netsnmp_container *container;
+
+    DEBUGMSGTL(("internal:rdbmsDbInfoTable:_cache_free","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache in rdbmsDbInfoTable_cache_free\n");
+        return;
+    }
+
+    container = (netsnmp_container*)cache->magic;
+
+    /*
+     * call user code
+     */
+    rdbmsDbInfoTable_cache_free(container);
+    
+    /*
+     * free all items. inefficient, but easy.
+     */
+    CONTAINER_CLEAR(container,
+                    (netsnmp_container_obj_func *)_cache_item_free,
+                    NULL);
+} /* _cache_free */
+
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_rdbmsDbInfoTable_container_init(rdbmsDbInfoTable_interface_ctx *if_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsDbInfoTable:_rdbmsDbInfoTable_container_init","called\n"));
+    
+    /*
+     * set up the cache
+     */
+    if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+                                         _cache_load, _cache_free,
+                                         rdbmsDbInfoTable_oid,
+                                         rdbmsDbInfoTable_oid_size);
+
+    if(NULL == if_ctx->cache) {
+        snmp_log(LOG_ERR, "error creating cache for rdbmsDbInfoTable\n");
+        return;
+    }
+
+    if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+    rdbmsDbInfoTable_container_init(&if_ctx->container, if_ctx->cache);
+    if(NULL == if_ctx->container)
+        if_ctx->container = netsnmp_container_find("rdbmsDbInfoTable:table_container");
+    if(NULL == if_ctx->container) {
+        snmp_log(LOG_ERR,"error creating container in "
+                 "rdbmsDbInfoTable_container_init\n");
+        return;
+    }
+    if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _rdbmsDbInfoTable_container_init */
+
diff --git a/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_interface.h b/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_interface.h
new file mode 100644 (file)
index 0000000..ff9df1b
--- /dev/null
@@ -0,0 +1,50 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbInfoTable_interface.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbInfoTable_interface.h,v 1.3 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBINFOTABLE_INTERFACE_H
+#define RDBMSDBINFOTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "rdbmsDbInfoTable.h"
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _rdbmsDbInfoTable_initialize_interface(rdbmsDbInfoTable_registration_ptr user_ctx,
+                                    u_long flags);
+
+    rdbmsDbInfoTable_rowreq_ctx * rdbmsDbInfoTable_allocate_rowreq_ctx(void);
+void rdbmsDbInfoTable_release_rowreq_ctx(rdbmsDbInfoTable_rowreq_ctx *rowreq_ctx);
+
+int rdbmsDbInfoTable_index_to_oid(netsnmp_index *oid_idx,
+                            rdbmsDbInfoTable_mib_index *mib_idx);
+int rdbmsDbInfoTable_index_from_oid(netsnmp_index *oid_idx,
+                              rdbmsDbInfoTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void rdbmsDbInfoTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBINFOTABLE_INTERFACE_H */
diff --git a/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_oids.h b/RDBMS-MIB_src/rdbmsDbInfoTable/rdbmsDbInfoTable_oids.h
new file mode 100644 (file)
index 0000000..9333aef
--- /dev/null
@@ -0,0 +1,39 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbInfoTable_oids.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbInfoTable_oids.h,v 1.3 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBINFOTABLE_OIDS_H
+#define RDBMSDBINFOTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table rdbmsDbInfoTable */
+#define RDBMSDBINFOTABLE_OID              1,3,6,1,2,1,39,1,2
+#define COLUMN_RDBMSDBINFOPRODUCTNAME          1
+#define COLUMN_RDBMSDBINFOVERSION              2
+#define COLUMN_RDBMSDBINFOSIZEUNITS            3
+#define COLUMN_RDBMSDBINFOSIZEALLOCATED                4
+#define COLUMN_RDBMSDBINFOSIZEUSED             5
+#define COLUMN_RDBMSDBINFOLASTBACKUP           6
+
+#define RDBMSDBINFOTABLE_MIN_COL               COLUMN_RDBMSDBINFOPRODUCTNAME
+#define RDBMSDBINFOTABLE_MAX_COL               COLUMN_RDBMSDBINFOLASTBACKUP
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBINFOTABLE_OIDS_H */
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable.c b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable.c
new file mode 100644 (file)
index 0000000..f5864d0
--- /dev/null
@@ -0,0 +1,130 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable.c,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsDbLimitedResourceTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "rdbmsDbLimitedResourceTable_interface.h"
+
+oid rdbmsDbLimitedResourceTable_oid[] = { RDBMSDBLIMITEDRESOURCETABLE_OID };
+int rdbmsDbLimitedResourceTable_oid_size = OID_LENGTH(rdbmsDbLimitedResourceTable_oid);
+
+void initialize_table_rdbmsDbLimitedResourceTable(void);
+
+
+/**
+ * Initializes the rdbmsDbLimitedResourceTable module
+ */
+void
+init_rdbmsDbLimitedResourceTable(void)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:init_rdbmsDbLimitedResourceTable","called\n"));
+
+    /*
+     * TODO:300:o: Perform rdbmsDbLimitedResourceTable one-time module initialization.
+     */
+     
+    /*
+     * here we initialize all the tables we're planning on supporting
+     */
+    if (should_init("rdbmsDbLimitedResourceTable"))
+        initialize_table_rdbmsDbLimitedResourceTable();
+
+} /* init_rdbmsDbLimitedResourceTable */
+
+/**
+ * Initialize the table rdbmsDbLimitedResourceTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+initialize_table_rdbmsDbLimitedResourceTable(void)
+{
+    rdbmsDbLimitedResourceTable_registration_ptr user_context;
+    u_long flags;
+
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:initialize_table_rdbmsDbLimitedResourceTable","called\n"));
+
+    /*
+     * TODO:301:o: Perform rdbmsDbLimitedResourceTable one-time table initialization.
+     */
+
+    /*
+     * TODO:302:o: |->Initialize rdbmsDbLimitedResourceTable user context
+     * if you'd like to pass in a pointer to some data for this
+     * table, allocate or set it up here.
+     */
+    /*
+     * a netsnmp_data_list is a simple way to store void pointers. A simple
+     * string token is used to add, find or remove pointers.
+     */
+    user_context = netsnmp_create_data_list("rdbmsDbLimitedResourceTable", NULL, NULL);
+    
+    /*
+     * No support for any flags yet, but in the future you would
+     * set any flags here.
+     */
+    flags = 0;
+    
+    /*
+     * call interface initialization code
+     */
+    _rdbmsDbLimitedResourceTable_initialize_interface(user_context, flags);
+} /* initialize_table_rdbmsDbLimitedResourceTable */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_ERROR                : other error
+ */
+int
+rdbmsDbLimitedResourceTable_pre_request(rdbmsDbLimitedResourceTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_pre_request","called\n"));
+
+    /*
+     * TODO:510:o: Perform rdbmsDbLimitedResourceTable pre-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : other error (ignored)
+ */
+int
+rdbmsDbLimitedResourceTable_post_request(rdbmsDbLimitedResourceTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_post_request","called\n"));
+
+    /*
+     * TODO:511:o: Perform rdbmsDbLimitedResourceTable pos-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceTable_post_request */
+
+
+/** @{ */
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable.h b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable.h
new file mode 100644 (file)
index 0000000..952db46
--- /dev/null
@@ -0,0 +1,224 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBLIMITEDRESOURCETABLE_H
+#define RDBMSDBLIMITEDRESOURCETABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @defgroup misc misc: Miscelaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+    /* *INDENT-OFF*  */
+config_require(RDBMS-MIB/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_interface);
+config_require(RDBMS-MIB/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_access);
+config_require(RDBMS-MIB/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_get);
+config_require(RDBMS-MIB/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_set);
+    /* *INDENT-ON*  */
+
+/* OID and column number definitions for  */
+#include "rdbmsDbLimitedResourceTable_oids.h"
+
+/* enum definions */
+#include "rdbmsDbLimitedResourceTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_rdbmsDbLimitedResourceTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbLimitedResourceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbLimitedResourceTable is subid 4 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.4, length: 9
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+    /*
+     * TODO:101:o: |-> Review rdbmsDbLimitedResourceTable registration context.
+     */
+typedef netsnmp_data_list * rdbmsDbLimitedResourceTable_registration_ptr;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review rdbmsDbLimitedResourceTable data context structure.
+ * This structure is used to represent the data for rdbmsDbLimitedResourceTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * rdbmsDbLimitedResourceTable.
+ */
+typedef struct rdbmsDbLimitedResourceTable_data_s {
+    
+        /*
+         * rdbmsDbLimitedResourceID(2)/AutonomousType/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+         */
+   oid   rdbmsDbLimitedResourceID[128];
+size_t      rdbmsDbLimitedResourceID_len; /* # of oid elements, not bytes */
+    
+        /*
+         * rdbmsDbLimitedResourceLimit(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h
+         */
+   long   rdbmsDbLimitedResourceLimit;
+    
+        /*
+         * rdbmsDbLimitedResourceCurrent(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+         */
+   long   rdbmsDbLimitedResourceCurrent;
+    
+        /*
+         * rdbmsDbLimitedResourceHighwater(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+         */
+   long   rdbmsDbLimitedResourceHighwater;
+    
+        /*
+         * rdbmsDbLimitedResourceFailures(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsDbLimitedResourceFailures;
+    
+        /*
+         * rdbmsDbLimitedResourceDescription(7)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+         */
+   char   rdbmsDbLimitedResourceDescription[255];
+size_t      rdbmsDbLimitedResourceDescription_len; /* # of char elements, not bytes */
+    
+} rdbmsDbLimitedResourceTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review rdbmsDbLimitedResourceTable mib index.
+ * This structure is used to represent the index for rdbmsDbLimitedResourceTable.
+ */
+typedef struct rdbmsDbLimitedResourceTable_mib_index_s {
+
+        /*
+         * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   rdbmsDbIndex;
+
+        /*
+         * rdbmsDbLimitedResourceName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+         */
+        /** 128 - 1(other indexes) - oid length(11) = 115 */
+   char   rdbmsDbLimitedResourceName[115];
+   size_t      rdbmsDbLimitedResourceName_len;
+
+
+} rdbmsDbLimitedResourceTable_mib_index;
+
+    /*
+     * TODO:121:r: |   |-> Review rdbmsDbLimitedResourceTable max index length.
+     * If you KNOW that your indexes will never exceed a certain
+     * length, update this macro to that length.
+     *
+     * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+     * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+     * Guessing 128 - col/entry(2)  - oid len(9)
+*/
+#define MAX_rdbmsDbLimitedResourceTable_IDX_LEN     117
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review rdbmsDbLimitedResourceTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * rdbmsDbLimitedResourceTable_rowreq_ctx pointer.
+ */
+typedef struct rdbmsDbLimitedResourceTable_rowreq_ctx_s {
+
+    /** this must be first for container compare to work */
+    netsnmp_index        oid_idx;
+    oid                  oid_tmp[MAX_rdbmsDbLimitedResourceTable_IDX_LEN];
+    
+    rdbmsDbLimitedResourceTable_mib_index        tbl_idx;
+    
+    rdbmsDbLimitedResourceTable_data              data;
+
+    /*
+     * flags per row. Currently, the first (lower) 8 bits are reserved
+     * for the user. See mfd.h for other flags.
+     */
+    u_int                       rowreq_flags;
+
+    /*
+     * implementor's context pointer (provided during registration)
+     */
+    rdbmsDbLimitedResourceTable_registration_ptr rdbmsDbLimitedResourceTable_reg;
+
+    /*
+     * TODO:131:o: |   |-> Add useful data to rdbmsDbLimitedResourceTable rowreq context.
+     */
+    
+    /*
+     * storage for future expansion
+     */
+    netsnmp_data_list             *rdbmsDbLimitedResourceTable_data_list;
+
+} rdbmsDbLimitedResourceTable_rowreq_ctx;
+
+typedef struct rdbmsDbLimitedResourceTable_ref_rowreq_ctx_s {
+    rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx;
+} rdbmsDbLimitedResourceTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+    int rdbmsDbLimitedResourceTable_pre_request(rdbmsDbLimitedResourceTable_registration_ptr user_context);
+    int rdbmsDbLimitedResourceTable_post_request(rdbmsDbLimitedResourceTable_registration_ptr user_context);
+
+
+extern oid rdbmsDbLimitedResourceTable_oid[];
+extern int rdbmsDbLimitedResourceTable_oid_size;
+
+
+#include "rdbmsDbLimitedResourceTable_interface.h"
+#include "rdbmsDbLimitedResourceTable_data_access.h"
+#include "rdbmsDbLimitedResourceTable_data_get.h"
+#include "rdbmsDbLimitedResourceTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBLIMITEDRESOURCETABLE_H */
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_access.c b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_access.c
new file mode 100644 (file)
index 0000000..e36e3ac
--- /dev/null
@@ -0,0 +1,307 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable_data_access.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable_data_access.c,v 1.3 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbLimitedResourceTable.h"
+#include "rdbmsDbLimitedResourceTable_data_access.h"
+
+/** @defgroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ * 
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbLimitedResourceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbLimitedResourceTable is subid 4 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.4, length: 9
+*/
+
+/**
+ * initialization for rdbmsDbLimitedResourceTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param rdbmsDbLimitedResourceTable_reg
+ *        Pointer to rdbmsDbLimitedResourceTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : unrecoverable error.
+ */
+int
+rdbmsDbLimitedResourceTable_init_data(rdbmsDbLimitedResourceTable_registration_ptr rdbmsDbLimitedResourceTable_reg)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_init_data","called\n"));
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceTable_init_data */
+
+/**
+ * container-cached overview
+ *
+ */
+
+/***********************************************************************
+ *
+ * cache
+ *
+ ***********************************************************************/
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ *        create a custom container, use this parameter to return it
+ *        to the MFD helper. If set to NULL, the MFD helper will
+ *        allocate a container for you.
+ * @param  cache A pointer to a cache structure. You can set the timeout
+ *         and other cache flags using this pointer.
+ *
+ *  This function is called at startup to allow you to customize certain
+ *  aspects of the access method. For the most part, it is for advanced
+ *  users. The default code should suffice for most cases. If no custom
+ *  container is allocated, the MFD code will create one for your.
+ *
+ *  This is also the place to set up cache behavior. The default, to
+ *  simply set the cache timeout, will work well with the default
+ *  container. If you are using a custom container, you may want to
+ *  look at the cache helper documentation to see if there are any
+ *  flags you want to set.
+ *
+ * @remark
+ *  This would also be a good place to do any initialization needed
+ *  for you data source. For example, opening a connection to another
+ *  process that will supply the data, opening a database, etc.
+ */
+void
+rdbmsDbLimitedResourceTable_container_init(netsnmp_container **container_ptr_ptr,
+                        netsnmp_cache *cache)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_container_init","called\n"));
+    
+    if((NULL == cache) || (NULL == container_ptr_ptr)) {
+        snmp_log(LOG_ERR,"bad params to rdbmsDbLimitedResourceTable_container_init\n");
+        return;
+    }
+
+    /*
+     * For advanced users, you can use a custom container. If you
+     * do not create one, one will be created for you.
+     */
+    *container_ptr_ptr = NULL;
+
+    /*
+     * TODO:345:A: Set up rdbmsDbLimitedResourceTable cache properties.
+     *
+     * Also for advanced users, you can set parameters for the
+     * cache. Do not change the magic pointer, as it is used
+     * by the MFD helper. To completely disable caching, set
+     * cache->enabled to 0.
+     */
+    cache->timeout = RDBMSDBLIMITEDRESOURCETABLE_CACHE_TIMEOUT; /* seconds */
+} /* rdbmsDbLimitedResourceTable_container_init */
+
+/**
+ * load cache data
+ *
+ * TODO:350:M: Implement rdbmsDbLimitedResourceTable cache load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR                : other error.
+ *
+ *  This function is called to cache the index(es) (and data, optionally)
+ *  for the every row in the data set.
+ *
+ * @remark
+ *  While loading the cache, the only important thing is the indexes.
+ *  If access to your data is cheap/fast (e.g. you have a pointer to a
+ *  structure in memory), it would make sense to update the data here.
+ *  If, however, the accessing the data invovles more work (e.g. parsing
+ *  some other existing data, or peforming calculations to derive the data),
+ *  then you can limit yourself to setting the indexes and saving any
+ *  information you will need later. Then use the saved information in
+ *  rdbmsDbLimitedResourceTable_row_prep() for populating data.
+ *
+ * @note
+ *  If you need consistency between rows (like you want statistics
+ *  for each row to be from the same time frame), you should set all
+ *  data here.
+ *
+ */
+int
+rdbmsDbLimitedResourceTable_cache_load(netsnmp_container *container)
+{
+    rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx;
+    size_t                 count = 0;
+    PGresult *pg_db_qry;
+    int i, resultCount, errorCode = MFD_SUCCESS, tmpInt;
+    char *tmpString;
+
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_cache_load","called\n"));
+
+    if (PQstatus(dbconn) == CONNECTION_OK) 
+           /* We can probably add new data to the rdbmsDbLimitedResourceTable by UNION-ing new queries with this one 
+            * SELECT <db_oid>, <item_name>, <item_limit>, <current>, <high_water>, <failures>, <description> */
+           pg_db_qry = PQexec(dbconn, "SELECT oid, 'XID', 2000000000, AGE(datfrozenxid), 0, 0, 'Transactions since last vacuum' FROM pg_database");
+    else {
+           snmp_log(LOG_ERR, "Can't get connected to the database");
+           return -1;
+    }
+    if (PQresultStatus(pg_db_qry) != PGRES_TUPLES_OK) {
+           snmp_log(LOG_ERR, "Didn't get any results from the database");
+           PQclear(pg_db_qry);
+           /*PQfinish(dbconn);*/
+           return -1;
+    }
+
+    resultCount = PQntuples(pg_db_qry);
+
+    /*
+     * TODO:351:M: |-> Load/update data in the rdbmsDbLimitedResourceTable container.
+     * loop over your rdbmsDbLimitedResourceTable data, allocate a rowreq context,
+     * set the index(es) [and data, optionally] and insert into
+     * the container.
+     */
+    for (i = 0; i < resultCount; i++) {
+
+        /*
+         * TODO:352:M: |   |-> set indexes in new rdbmsDbLimitedResourceTable rowreq context.
+         */
+        rowreq_ctx = rdbmsDbLimitedResourceTable_allocate_rowreq_ctx();
+        if (NULL == rowreq_ctx) {
+            snmp_log(LOG_ERR, "memory allocation failed\n");
+            errorCode = MFD_RESOURCE_UNAVAILABLE;
+           break;
+        }
+       tmpInt = atoi(PQgetvalue(pg_db_qry, i, 0));
+       tmpString = PQgetvalue(pg_db_qry, i, 1);
+        if(MFD_SUCCESS != rdbmsDbLimitedResourceTable_indexes_set(rowreq_ctx
+                               , tmpInt
+                               , tmpString, strlen(tmpString)
+               )) {
+            snmp_log(LOG_ERR,"error setting index while loading "
+                     "rdbmsDbLimitedResourceTable cache.\n");
+            rdbmsDbLimitedResourceTable_release_rowreq_ctx(rowreq_ctx);
+            continue;
+        }
+       rowreq_ctx->data.rdbmsDbLimitedResourceDescription_len = 255;
+
+    /* COMMENTED OUT UNTIL WE HAVE PGSNMPD-MIB SO THIS VALUE CAN POINT TO SOMETING 
+      if ((NULL == rowreq_ctx->data.rdbmsDbLimitedResourceID) ||
+        (rowreq_ctx->data.rdbmsDbLimitedResourceID_len < (rdbmsDbLimitedResourceID_len * sizeof(rowreq_ctx->data.rdbmsDbLimitedResourceID[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+        return MFD_ERROR;
+    }
+    rowreq_ctx->data.rdbmsDbLimitedResourceID_len = rdbmsDbLimitedResourceID_len * sizeof(rowreq_ctx->data.rdbmsDbLimitedResourceID[0]);
+    memcpy( rowreq_ctx->data.rdbmsDbLimitedResourceID, rdbmsDbLimitedResourceID, rowreq_ctx->data.rdbmsDbLimitedResourceID_len ); */
+    
+    rowreq_ctx->data.rdbmsDbLimitedResourceLimit = atoi(PQgetvalue(pg_db_qry, i, 2));
+    
+    rowreq_ctx->data.rdbmsDbLimitedResourceCurrent = atoi(PQgetvalue(pg_db_qry, i, 3));
+
+    rowreq_ctx->data.rdbmsDbLimitedResourceHighwater = atoi(PQgetvalue(pg_db_qry, i, 4));
+    
+    rowreq_ctx->data.rdbmsDbLimitedResourceFailures = atoi(PQgetvalue(pg_db_qry, i, 5));
+    
+    tmpString = PQgetvalue(pg_db_qry, i, 6);
+    tmpInt = strlen(tmpString);
+    if ((NULL == rowreq_ctx->data.rdbmsDbLimitedResourceDescription) ||
+        (rowreq_ctx->data.rdbmsDbLimitedResourceDescription_len < (tmpInt * sizeof(rowreq_ctx->data.rdbmsDbLimitedResourceDescription[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+        errorCode = MFD_ERROR;
+       break;
+    }
+    rowreq_ctx->data.rdbmsDbLimitedResourceDescription_len = tmpInt * sizeof(rowreq_ctx->data.rdbmsDbLimitedResourceDescription[0]);
+    memcpy( rowreq_ctx->data.rdbmsDbLimitedResourceDescription, tmpString, rowreq_ctx->data.rdbmsDbLimitedResourceDescription_len );
+    
+        
+        /*
+         * insert into table container
+         */
+        CONTAINER_INSERT(container, rowreq_ctx);
+        ++count;
+    }
+
+    DEBUGMSGT(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_cache_load",
+               "inserted %d records\n", count));
+
+    PQclear(pg_db_qry);
+    return errorCode;
+} /* rdbmsDbLimitedResourceTable_cache_load */
+
+/**
+ * cache clean up
+ *
+ * @param container container with all current items
+ *
+ *  This optional callback is called prior to all
+ *  item's being removed from the container. If you
+ *  need to do any processing before that, do it here.
+ *
+ * @note
+ *  The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+rdbmsDbLimitedResourceTable_cache_free(netsnmp_container *container)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_cache_free","called\n"));
+
+    /*
+     * TODO:380:M: Free rdbmsDbLimitedResourceTable cache.
+     */
+} /* rdbmsDbLimitedResourceTable_cache_free */
+
+/**
+ * prepare row for processing.
+ *
+ *  When the agent has located the row for a request, this function is
+ *  called to prepare the row for processing. If you fully populated
+ *  the data context during the index setup phase, you may not need to
+ *  do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ */
+int
+rdbmsDbLimitedResourceTable_row_prep( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_row_prep","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:390:o: Prepare row for request.
+     * If populating row data was delayed, this is the place to
+     * fill in the row for this request.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceTable_row_prep */
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_access.h b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_access.h
new file mode 100644 (file)
index 0000000..6e24990
--- /dev/null
@@ -0,0 +1,64 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable_data_access.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable_data_access.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBLIMITEDRESOURCETABLE_DATA_ACCESS_H
+#define RDBMSDBLIMITEDRESOURCETABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbLimitedResourceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbLimitedResourceTable is subid 4 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.4, length: 9
+*/
+
+
+    int rdbmsDbLimitedResourceTable_init_data(rdbmsDbLimitedResourceTable_registration_ptr rdbmsDbLimitedResourceTable_reg);
+
+
+/*
+ * TODO:180:o: Review rdbmsDbLimitedResourceTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define RDBMSDBLIMITEDRESOURCETABLE_CACHE_TIMEOUT   60
+
+void rdbmsDbLimitedResourceTable_container_init(netsnmp_container **container_ptr_ptr,
+                             netsnmp_cache *cache);
+int rdbmsDbLimitedResourceTable_cache_load(netsnmp_container *container);
+void rdbmsDbLimitedResourceTable_cache_free(netsnmp_container *container);
+
+    int rdbmsDbLimitedResourceTable_row_prep( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBLIMITEDRESOURCETABLE_DATA_ACCESS_H */
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_get.c b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_get.c
new file mode 100644 (file)
index 0000000..606fb3e
--- /dev/null
@@ -0,0 +1,868 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable_data_get.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable_data_get.c,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsDbLimitedResourceTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement rdbmsDbLimitedResourceTable get routines.
+ * TODO:240:M: Implement rdbmsDbLimitedResourceTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbLimitedResourceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbLimitedResourceTable is subid 4 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.4, length: 9
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement rdbmsDbLimitedResourceTable data context functions.
+ */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbLimitedResourceEntry.rdbmsDbLimitedResourceName
+ * rdbmsDbLimitedResourceName is subid 1 of rdbmsDbLimitedResourceEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.39.1.4.1.1
+ * Description:
+The name of the resource, for instance 'global locks' or
+           'locks for the FOO database', or 'data space on /dev/rdsk/5s0
+           for FOO'. The length is limited to 64 characters to constrain
+           the number of sub-identifiers needed for instance
+           identification (and to minimize network traffic).
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ *
+ *
+ *
+ * NOTE: NODE rdbmsDbLimitedResourceName IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbLimitedResourceName.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbLimitedResourceName_map(char **mib_rdbmsDbLimitedResourceName_val_ptr_ptr, size_t *mib_rdbmsDbLimitedResourceName_val_ptr_len_ptr, char *raw_rdbmsDbLimitedResourceName_val_ptr, size_t raw_rdbmsDbLimitedResourceName_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbLimitedResourceName_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbLimitedResourceName_val_ptr_ptr) && (NULL != mib_rdbmsDbLimitedResourceName_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceName_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbLimitedResourceName non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbLimitedResourceName_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbLimitedResourceName_val_ptr_ptr) || (*mib_rdbmsDbLimitedResourceName_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbLimitedResourceName_val_ptr_ptr = realloc( *mib_rdbmsDbLimitedResourceName_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbLimitedResourceName_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbLimitedResourceName_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbLimitedResourceName_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbLimitedResourceName_val_ptr_ptr, raw_rdbmsDbLimitedResourceName_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceName_map */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This convenience function is useful for setting all the MIB index
+ *  components with a single function call. It is assume that the C values
+ *  have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+rdbmsDbLimitedResourceTable_indexes_set_tbl_idx(rdbmsDbLimitedResourceTable_mib_index *tbl_idx, long rdbmsDbIndex_val, char *rdbmsDbLimitedResourceName_val_ptr,  size_t rdbmsDbLimitedResourceName_val_ptr_len)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_indexes_set_tbl_idx","called\n"));
+
+    /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->rdbmsDbIndex = rdbmsDbIndex_val;
+    
+    /* rdbmsDbLimitedResourceName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+     tbl_idx->rdbmsDbLimitedResourceName_len = sizeof(tbl_idx->rdbmsDbLimitedResourceName);
+    /*
+     * make sure there is enough space for rdbmsDbLimitedResourceName data
+     */
+    if ((NULL == tbl_idx->rdbmsDbLimitedResourceName) ||
+        (tbl_idx->rdbmsDbLimitedResourceName_len < (rdbmsDbLimitedResourceName_val_ptr_len * sizeof(tbl_idx->rdbmsDbLimitedResourceName[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+        return MFD_ERROR;
+    }
+    tbl_idx->rdbmsDbLimitedResourceName_len = rdbmsDbLimitedResourceName_val_ptr_len * sizeof(tbl_idx->rdbmsDbLimitedResourceName[0]);
+    memcpy( tbl_idx->rdbmsDbLimitedResourceName, rdbmsDbLimitedResourceName_val_ptr, tbl_idx->rdbmsDbLimitedResourceName_len );
+    
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This function sets the mib indexs, then updates the oid indexs
+ *  from the mib index.
+ */
+int
+rdbmsDbLimitedResourceTable_indexes_set(rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, long rdbmsDbIndex_val, char *rdbmsDbLimitedResourceName_val_ptr,  size_t rdbmsDbLimitedResourceName_val_ptr_len)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_indexes_set","called\n"));
+
+    if(MFD_SUCCESS != rdbmsDbLimitedResourceTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+                                   , rdbmsDbIndex_val
+                                   , rdbmsDbLimitedResourceName_val_ptr, rdbmsDbLimitedResourceName_val_ptr_len
+           ))
+        return MFD_ERROR;
+
+    /*
+     * convert mib index to oid index
+     */
+    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+    if(0 != rdbmsDbLimitedResourceTable_index_to_oid(&rowreq_ctx->oid_idx,
+                                    &rowreq_ctx->tbl_idx)) {
+        return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbLimitedResourceEntry.rdbmsDbLimitedResourceID
+ * rdbmsDbLimitedResourceID is subid 2 of rdbmsDbLimitedResourceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.4.1.2
+ * Description:
+The ID of the resource which may be described in some other
+           MIB (e.g., an enterprise-specific MIB module).  If there is
+           no ID for this rdbmsDbLimitedResourceName, attempts to access
+           this object will return noSuchName (SNMPv1) or noSuchInstance
+           (SNMPv2).
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is AutonomousType (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbLimitedResourceID.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbLimitedResourceID_map(oid **mib_rdbmsDbLimitedResourceID_val_ptr_ptr, size_t *mib_rdbmsDbLimitedResourceID_val_ptr_len_ptr, oid *raw_rdbmsDbLimitedResourceID_val_ptr, size_t raw_rdbmsDbLimitedResourceID_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbLimitedResourceID_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbLimitedResourceID_val_ptr_ptr) && (NULL != mib_rdbmsDbLimitedResourceID_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceID_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbLimitedResourceID non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbLimitedResourceID_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbLimitedResourceID_val_ptr_ptr) || (*mib_rdbmsDbLimitedResourceID_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbLimitedResourceID_val_ptr_ptr = realloc( *mib_rdbmsDbLimitedResourceID_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbLimitedResourceID_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbLimitedResourceID_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbLimitedResourceID_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbLimitedResourceID_val_ptr_ptr, raw_rdbmsDbLimitedResourceID_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceID_map */
+
+/**
+ * Extract the current value of the rdbmsDbLimitedResourceID data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbLimitedResourceID_val_ptr_ptr
+ *        Pointer to storage for a oid variable
+ * @param rdbmsDbLimitedResourceID_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbLimitedResourceID.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbLimitedResourceID_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbLimitedResourceID_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbLimitedResourceID_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, oid **rdbmsDbLimitedResourceID_val_ptr_ptr, size_t *rdbmsDbLimitedResourceID_val_ptr_len_ptr )
+{
+       /* Until PGSNMPD-MIB exists, there's nothing to see here */
+       return MFD_SKIP;
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsDbLimitedResourceID_val_ptr_ptr) && (NULL != *rdbmsDbLimitedResourceID_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsDbLimitedResourceID_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceID_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbLimitedResourceID data.
+ * set (* rdbmsDbLimitedResourceID_val_ptr_ptr ) and (* rdbmsDbLimitedResourceID_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsDbLimitedResourceID data
+     */
+    if ((NULL == (* rdbmsDbLimitedResourceID_val_ptr_ptr )) ||
+        ((* rdbmsDbLimitedResourceID_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsDbLimitedResourceID_len * sizeof((* rdbmsDbLimitedResourceID_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsDbLimitedResourceID data
+         */
+        (* rdbmsDbLimitedResourceID_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsDbLimitedResourceID_len * sizeof((* rdbmsDbLimitedResourceID_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsDbLimitedResourceID_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsDbLimitedResourceID_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsDbLimitedResourceID_len * sizeof((* rdbmsDbLimitedResourceID_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsDbLimitedResourceID_val_ptr_ptr ), rowreq_ctx->data.rdbmsDbLimitedResourceID, (* rdbmsDbLimitedResourceID_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceID_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbLimitedResourceEntry.rdbmsDbLimitedResourceLimit
+ * rdbmsDbLimitedResourceLimit is subid 3 of rdbmsDbLimitedResourceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.39.1.4.1.3
+ * Description:
+The maximum value the resource use may attain.
+
+           Note that a compliant agent does not need to
+           allow write access to this object.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   0
+ *   settable   1
+ *
+ * Ranges:  1 - 2147483647;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbLimitedResourceLimit.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbLimitedResourceLimit_map(long *mib_rdbmsDbLimitedResourceLimit_val_ptr, long raw_rdbmsDbLimitedResourceLimit_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsDbLimitedResourceLimit_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceLimit_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsDbLimitedResourceLimit mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsDbLimitedResourceLimit_val_ptr) = raw_rdbmsDbLimitedResourceLimit_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceLimit_map */
+
+/**
+ * Extract the current value of the rdbmsDbLimitedResourceLimit data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbLimitedResourceLimit_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsDbLimitedResourceLimit_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, long * rdbmsDbLimitedResourceLimit_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsDbLimitedResourceLimit_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceLimit_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbLimitedResourceLimit data.
+ * set (* rdbmsDbLimitedResourceLimit_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsDbLimitedResourceLimit_val_ptr ) = rowreq_ctx->data.rdbmsDbLimitedResourceLimit;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceLimit_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbLimitedResourceEntry.rdbmsDbLimitedResourceCurrent
+ * rdbmsDbLimitedResourceCurrent is subid 4 of rdbmsDbLimitedResourceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.4.1.4
+ * Description:
+The current value for the resource.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   0
+ *   settable   0
+ *
+ * Ranges:  1 - 2147483647;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbLimitedResourceCurrent.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbLimitedResourceCurrent_map(long *mib_rdbmsDbLimitedResourceCurrent_val_ptr, long raw_rdbmsDbLimitedResourceCurrent_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsDbLimitedResourceCurrent_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceCurrent_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsDbLimitedResourceCurrent mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsDbLimitedResourceCurrent_val_ptr) = raw_rdbmsDbLimitedResourceCurrent_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceCurrent_map */
+
+/**
+ * Extract the current value of the rdbmsDbLimitedResourceCurrent data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbLimitedResourceCurrent_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsDbLimitedResourceCurrent_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, long * rdbmsDbLimitedResourceCurrent_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsDbLimitedResourceCurrent_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceCurrent_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbLimitedResourceCurrent data.
+ * set (* rdbmsDbLimitedResourceCurrent_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsDbLimitedResourceCurrent_val_ptr ) = rowreq_ctx->data.rdbmsDbLimitedResourceCurrent;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceCurrent_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbLimitedResourceEntry.rdbmsDbLimitedResourceHighwater
+ * rdbmsDbLimitedResourceHighwater is subid 5 of rdbmsDbLimitedResourceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.4.1.5
+ * Description:
+The maximum value of the resource seen since applUpTime
+           was reset for the earliest server which has the database
+           actively opened.
+
+           If there are two servers with the database open, and the
+           oldest one dies, the proper way to invalidate the value is by
+           resetting sysUpTime.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   0
+ *   settable   0
+ *
+ * Ranges:  1 - 2147483647;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbLimitedResourceHighwater.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbLimitedResourceHighwater_map(long *mib_rdbmsDbLimitedResourceHighwater_val_ptr, long raw_rdbmsDbLimitedResourceHighwater_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsDbLimitedResourceHighwater_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceHighwater_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsDbLimitedResourceHighwater mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsDbLimitedResourceHighwater_val_ptr) = raw_rdbmsDbLimitedResourceHighwater_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceHighwater_map */
+
+/**
+ * Extract the current value of the rdbmsDbLimitedResourceHighwater data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbLimitedResourceHighwater_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsDbLimitedResourceHighwater_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, long * rdbmsDbLimitedResourceHighwater_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsDbLimitedResourceHighwater_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceHighwater_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbLimitedResourceHighwater data.
+ * set (* rdbmsDbLimitedResourceHighwater_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsDbLimitedResourceHighwater_val_ptr ) = rowreq_ctx->data.rdbmsDbLimitedResourceHighwater;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceHighwater_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbLimitedResourceEntry.rdbmsDbLimitedResourceFailures
+ * rdbmsDbLimitedResourceFailures is subid 6 of rdbmsDbLimitedResourceEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.4.1.6
+ * Description:
+The number of times the system wanted to exceed the limit of
+           the resource since applUpTime was reset for the earliest
+           server which has the database actively opened.
+
+           If there are two servers with the DB open, and the
+           oldest one dies, the proper way to invalidate the value is by
+           resetting sysUpTime.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbLimitedResourceFailures.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbLimitedResourceFailures_map(u_long *mib_rdbmsDbLimitedResourceFailures_val_ptr, u_long raw_rdbmsDbLimitedResourceFailures_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsDbLimitedResourceFailures_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceFailures_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsDbLimitedResourceFailures mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsDbLimitedResourceFailures_val_ptr) = raw_rdbmsDbLimitedResourceFailures_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceFailures_map */
+
+/**
+ * Extract the current value of the rdbmsDbLimitedResourceFailures data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbLimitedResourceFailures_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsDbLimitedResourceFailures_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsDbLimitedResourceFailures_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsDbLimitedResourceFailures_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceFailures_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbLimitedResourceFailures data.
+ * set (* rdbmsDbLimitedResourceFailures_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsDbLimitedResourceFailures_val_ptr ) = rowreq_ctx->data.rdbmsDbLimitedResourceFailures;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceFailures_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbLimitedResourceEntry.rdbmsDbLimitedResourceDescription
+ * rdbmsDbLimitedResourceDescription is subid 7 of rdbmsDbLimitedResourceEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.39.1.4.1.7
+ * Description:
+A description of the resource and the meaning of the integer
+           units used for Limit, Current, and Highwater.
+
+           Note that a compliant agent does not need to
+           allow write access to this object.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   1
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbLimitedResourceDescription.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbLimitedResourceDescription_map(char **mib_rdbmsDbLimitedResourceDescription_val_ptr_ptr, size_t *mib_rdbmsDbLimitedResourceDescription_val_ptr_len_ptr, char *raw_rdbmsDbLimitedResourceDescription_val_ptr, size_t raw_rdbmsDbLimitedResourceDescription_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbLimitedResourceDescription_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbLimitedResourceDescription_val_ptr_ptr) && (NULL != mib_rdbmsDbLimitedResourceDescription_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceDescription_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbLimitedResourceDescription non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbLimitedResourceDescription_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbLimitedResourceDescription_val_ptr_ptr) || (*mib_rdbmsDbLimitedResourceDescription_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbLimitedResourceDescription_val_ptr_ptr = realloc( *mib_rdbmsDbLimitedResourceDescription_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbLimitedResourceDescription_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbLimitedResourceDescription_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbLimitedResourceDescription_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbLimitedResourceDescription_val_ptr_ptr, raw_rdbmsDbLimitedResourceDescription_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceDescription_map */
+
+/**
+ * Extract the current value of the rdbmsDbLimitedResourceDescription data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbLimitedResourceDescription_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsDbLimitedResourceDescription_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbLimitedResourceDescription.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbLimitedResourceDescription_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbLimitedResourceDescription_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbLimitedResourceDescription_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbLimitedResourceDescription_val_ptr_ptr, size_t *rdbmsDbLimitedResourceDescription_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsDbLimitedResourceDescription_val_ptr_ptr) && (NULL != *rdbmsDbLimitedResourceDescription_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsDbLimitedResourceDescription_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceDescription_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbLimitedResourceDescription data.
+ * set (* rdbmsDbLimitedResourceDescription_val_ptr_ptr ) and (* rdbmsDbLimitedResourceDescription_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsDbLimitedResourceDescription data
+     */
+    if ((NULL == (* rdbmsDbLimitedResourceDescription_val_ptr_ptr )) ||
+        ((* rdbmsDbLimitedResourceDescription_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsDbLimitedResourceDescription_len * sizeof((* rdbmsDbLimitedResourceDescription_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsDbLimitedResourceDescription data
+         */
+        (* rdbmsDbLimitedResourceDescription_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsDbLimitedResourceDescription_len * sizeof((* rdbmsDbLimitedResourceDescription_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsDbLimitedResourceDescription_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsDbLimitedResourceDescription_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsDbLimitedResourceDescription_len * sizeof((* rdbmsDbLimitedResourceDescription_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsDbLimitedResourceDescription_val_ptr_ptr ), rowreq_ctx->data.rdbmsDbLimitedResourceDescription, (* rdbmsDbLimitedResourceDescription_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbLimitedResourceDescription_get */
+
+
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_get.h b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_get.h
new file mode 100644 (file)
index 0000000..896e133
--- /dev/null
@@ -0,0 +1,71 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable_data_get.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable_data_get.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBLIMITEDRESOURCETABLE_DATA_GET_H
+#define RDBMSDBLIMITEDRESOURCETABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbLimitedResourceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbLimitedResourceTable is subid 4 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.4, length: 9
+*/
+    /*
+     * indexes
+     */
+    int rdbmsDbIndex_map(long *mib_rdbmsDbIndex_val_ptr, long raw_rdbmsDbIndex_val);
+    int rdbmsDbLimitedResourceName_map(char **mib_rdbmsDbLimitedResourceName_val_ptr_ptr, size_t *mib_rdbmsDbLimitedResourceName_val_ptr_len_ptr, char *raw_rdbmsDbLimitedResourceName_val_ptr, size_t raw_rdbmsDbLimitedResourceName_val_ptr_len, int allow_realloc);
+
+    int rdbmsDbLimitedResourceID_map(oid **mib_rdbmsDbLimitedResourceID_val_ptr_ptr, size_t *mib_rdbmsDbLimitedResourceID_val_ptr_len_ptr, oid *raw_rdbmsDbLimitedResourceID_val_ptr, size_t raw_rdbmsDbLimitedResourceID_val_ptr_len, int allow_realloc);
+    int rdbmsDbLimitedResourceID_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, oid **rdbmsDbLimitedResourceID_val_ptr_ptr, size_t *rdbmsDbLimitedResourceID_val_ptr_len_ptr );
+    int rdbmsDbLimitedResourceLimit_map(long *mib_rdbmsDbLimitedResourceLimit_val_ptr, long raw_rdbmsDbLimitedResourceLimit_val);
+    int rdbmsDbLimitedResourceLimit_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, long * rdbmsDbLimitedResourceLimit_val_ptr );
+    int rdbmsDbLimitedResourceCurrent_map(long *mib_rdbmsDbLimitedResourceCurrent_val_ptr, long raw_rdbmsDbLimitedResourceCurrent_val);
+    int rdbmsDbLimitedResourceCurrent_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, long * rdbmsDbLimitedResourceCurrent_val_ptr );
+    int rdbmsDbLimitedResourceHighwater_map(long *mib_rdbmsDbLimitedResourceHighwater_val_ptr, long raw_rdbmsDbLimitedResourceHighwater_val);
+    int rdbmsDbLimitedResourceHighwater_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, long * rdbmsDbLimitedResourceHighwater_val_ptr );
+    int rdbmsDbLimitedResourceFailures_map(u_long *mib_rdbmsDbLimitedResourceFailures_val_ptr, u_long raw_rdbmsDbLimitedResourceFailures_val);
+    int rdbmsDbLimitedResourceFailures_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsDbLimitedResourceFailures_val_ptr );
+    int rdbmsDbLimitedResourceDescription_map(char **mib_rdbmsDbLimitedResourceDescription_val_ptr_ptr, size_t *mib_rdbmsDbLimitedResourceDescription_val_ptr_len_ptr, char *raw_rdbmsDbLimitedResourceDescription_val_ptr, size_t raw_rdbmsDbLimitedResourceDescription_val_ptr_len, int allow_realloc);
+    int rdbmsDbLimitedResourceDescription_get( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbLimitedResourceDescription_val_ptr_ptr, size_t *rdbmsDbLimitedResourceDescription_val_ptr_len_ptr );
+
+
+int rdbmsDbLimitedResourceTable_indexes_set_tbl_idx(rdbmsDbLimitedResourceTable_mib_index *tbl_idx, long rdbmsDbIndex_val, char *rdbmsDbLimitedResourceName_val_ptr,  size_t rdbmsDbLimitedResourceName_val_ptr_len);
+int rdbmsDbLimitedResourceTable_indexes_set(rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, long rdbmsDbIndex_val, char *rdbmsDbLimitedResourceName_val_ptr,  size_t rdbmsDbLimitedResourceName_val_ptr_len);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBLIMITEDRESOURCETABLE_DATA_GET_H */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_set.c b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_set.c
new file mode 100644 (file)
index 0000000..cfbcb24
--- /dev/null
@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable_data_set.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable_data_set.c,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsDbLimitedResourceTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ * 
+ * @{
+ */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_set.h b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_data_set.h
new file mode 100644 (file)
index 0000000..36b90b9
--- /dev/null
@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable_data_set.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable_data_set.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBLIMITEDRESOURCETABLE_DATA_SET_H
+#define RDBMSDBLIMITEDRESOURCETABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBLIMITEDRESOURCETABLE_DATA_SET_H */
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_enums.h b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_enums.h
new file mode 100644 (file)
index 0000000..6a25754
--- /dev/null
@@ -0,0 +1,47 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable_enums.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable_enums.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBLIMITEDRESOURCETABLE_ENUMS_H
+#define RDBMSDBLIMITEDRESOURCETABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table rdbmsDbLimitedResourceTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBLIMITEDRESOURCETABLE_ENUMS_H */
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_interface.c b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_interface.c
new file mode 100644 (file)
index 0000000..28eb874
--- /dev/null
@@ -0,0 +1,747 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable_interface.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable_interface.c,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbLimitedResourceTable.h"
+
+
+#include <net-snmp/library/container.h>
+
+#include "rdbmsDbLimitedResourceTable_interface.h"
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbLimitedResourceTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbLimitedResourceTable is subid 4 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.4, length: 9
+*/
+typedef struct rdbmsDbLimitedResourceTable_interface_ctx_s {
+
+   netsnmp_container              *container;
+   netsnmp_cache                  *cache; /* optional cache */
+
+   rdbmsDbLimitedResourceTable_registration_ptr      user_ctx;
+   
+   netsnmp_table_registration_info  tbl_info;
+
+   netsnmp_baby_steps_access_methods access_multiplexer;
+
+} rdbmsDbLimitedResourceTable_interface_ctx;
+
+static rdbmsDbLimitedResourceTable_interface_ctx rdbmsDbLimitedResourceTable_if_ctx;
+
+static void _rdbmsDbLimitedResourceTable_container_init(
+    rdbmsDbLimitedResourceTable_interface_ctx *if_ctx);
+
+
+static Netsnmp_Node_Handler _mfd_rdbmsDbLimitedResourceTable_pre_request;
+static Netsnmp_Node_Handler _mfd_rdbmsDbLimitedResourceTable_post_request;
+static Netsnmp_Node_Handler _mfd_rdbmsDbLimitedResourceTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_rdbmsDbLimitedResourceTable_get_values;
+/**
+ * @internal
+ * Initialize the table rdbmsDbLimitedResourceTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+_rdbmsDbLimitedResourceTable_initialize_interface(rdbmsDbLimitedResourceTable_registration_ptr reg_ptr,  u_long flags)
+{
+    netsnmp_baby_steps_access_methods *access_multiplexer =
+        &rdbmsDbLimitedResourceTable_if_ctx.access_multiplexer;
+    netsnmp_table_registration_info *tbl_info = &rdbmsDbLimitedResourceTable_if_ctx.tbl_info;
+    netsnmp_handler_registration *reginfo;
+    netsnmp_mib_handler *handler;
+    int    mfd_modes = 0;
+
+    DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable:_rdbmsDbLimitedResourceTable_initialize_interface","called\n"));
+
+
+    /*************************************************
+     *
+     * save interface context for rdbmsDbLimitedResourceTable
+     */
+    /*
+     * Setting up the table's definition
+     */
+    netsnmp_table_helper_add_indexes(tbl_info,
+                                  ASN_INTEGER, /** index: rdbmsDbIndex */
+                                  ASN_OCTET_STR, /** index: rdbmsDbLimitedResourceName */
+                             0);
+
+    /*  Define the minimum and maximum accessible columns.  This
+        optimizes retrival. */
+    tbl_info->min_column = RDBMSDBLIMITEDRESOURCETABLE_MIN_COL;
+    tbl_info->max_column = RDBMSDBLIMITEDRESOURCETABLE_MAX_COL;
+
+    /*
+     * save users context
+     */
+    rdbmsDbLimitedResourceTable_if_ctx.user_ctx = reg_ptr;
+
+    /*
+     * call data access initialization code
+     */
+    rdbmsDbLimitedResourceTable_init_data(reg_ptr);
+
+    /*
+     * set up the container
+     */
+    _rdbmsDbLimitedResourceTable_container_init(&rdbmsDbLimitedResourceTable_if_ctx);
+    if (NULL == rdbmsDbLimitedResourceTable_if_ctx.container) {
+        snmp_log(LOG_ERR,"could not initialize container for rdbmsDbLimitedResourceTable\n");
+        return;
+    }
+    
+    /*
+     * access_multiplexer: REQUIRED wrapper for get request handling
+     */
+    access_multiplexer->object_lookup = _mfd_rdbmsDbLimitedResourceTable_object_lookup;
+    access_multiplexer->get_values = _mfd_rdbmsDbLimitedResourceTable_get_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->pre_request = _mfd_rdbmsDbLimitedResourceTable_pre_request;
+    access_multiplexer->post_request = _mfd_rdbmsDbLimitedResourceTable_post_request;
+
+
+    /*************************************************
+     *
+     * Create a registration, save our reg data, register table.
+     */
+    DEBUGMSGTL(("rdbmsDbLimitedResourceTable:init_rdbmsDbLimitedResourceTable",
+                "Registering rdbmsDbLimitedResourceTable as a mibs-for-dummies table.\n"));             
+    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+    reginfo = netsnmp_handler_registration_create("rdbmsDbLimitedResourceTable", handler,
+                                                  rdbmsDbLimitedResourceTable_oid,
+                                                  rdbmsDbLimitedResourceTable_oid_size,
+                                                  HANDLER_CAN_BABY_STEP |
+                                                  HANDLER_CAN_RONLY
+                                                  );
+    if(NULL == reginfo) {
+        snmp_log(LOG_ERR,"error registering table rdbmsDbLimitedResourceTable\n");
+        return;
+    }
+    reginfo->my_reg_void = &rdbmsDbLimitedResourceTable_if_ctx;
+
+    /*************************************************
+     *
+     * set up baby steps handler, create it and inject it
+     */
+    if( access_multiplexer->object_lookup )
+        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+    if( access_multiplexer->set_values )
+        mfd_modes |= BABY_STEP_SET_VALUES;
+    if( access_multiplexer->irreversible_commit )
+        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+    if( access_multiplexer->object_syntax_checks )
+        mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+    if( access_multiplexer->pre_request )
+        mfd_modes |= BABY_STEP_PRE_REQUEST;
+    if( access_multiplexer->post_request )
+        mfd_modes |= BABY_STEP_POST_REQUEST;
+    
+    if( access_multiplexer->undo_setup )
+        mfd_modes |= BABY_STEP_UNDO_SETUP;
+    if( access_multiplexer->undo_cleanup )
+        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+    if( access_multiplexer->undo_sets )
+        mfd_modes |= BABY_STEP_UNDO_SETS;
+    
+    if( access_multiplexer->row_creation )
+        mfd_modes |= BABY_STEP_ROW_CREATE;
+    if( access_multiplexer->consistency_checks )
+        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+    if( access_multiplexer->commit )
+        mfd_modes |= BABY_STEP_COMMIT;
+    if( access_multiplexer->undo_commit )
+        mfd_modes |= BABY_STEP_UNDO_COMMIT;
+    
+    handler = netsnmp_baby_steps_handler_get(mfd_modes);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+     */
+    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject container_table helper
+     */
+    handler =
+        netsnmp_container_table_handler_get(tbl_info,
+                                            rdbmsDbLimitedResourceTable_if_ctx.container,
+                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+    netsnmp_inject_handler( reginfo, handler );
+
+    /*************************************************
+     *
+     * inject cache helper
+     */
+    if(NULL != rdbmsDbLimitedResourceTable_if_ctx.cache) {
+        handler = netsnmp_cache_handler_get(rdbmsDbLimitedResourceTable_if_ctx.cache);
+        netsnmp_inject_handler( reginfo, handler );
+    }
+
+    /*
+     * register table
+     */
+    netsnmp_register_table(reginfo, tbl_info);
+} /* _rdbmsDbLimitedResourceTable_initialize_interface */
+
+void
+rdbmsDbLimitedResourceTable_valid_columns_set(netsnmp_column_info *vc)
+{
+    rdbmsDbLimitedResourceTable_if_ctx.tbl_info.valid_columns = vc;
+} /* rdbmsDbLimitedResourceTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+rdbmsDbLimitedResourceTable_index_to_oid(netsnmp_index *oid_idx,
+                         rdbmsDbLimitedResourceTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+    /*
+     * rdbmsDbLimitedResourceName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_rdbmsDbLimitedResourceName;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+    memset( &var_rdbmsDbLimitedResourceName, 0x00, sizeof(var_rdbmsDbLimitedResourceName) );
+    var_rdbmsDbLimitedResourceName.type = ASN_OCTET_STR;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_rdbmsDbIndex.next_variable =  &var_rdbmsDbLimitedResourceName; var_rdbmsDbLimitedResourceName.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_index_to_oid","called\n"));
+
+        /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_rdbmsDbIndex, (u_char*)&mib_idx->rdbmsDbIndex,
+                       sizeof(mib_idx->rdbmsDbIndex));
+
+        /* rdbmsDbLimitedResourceName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+    snmp_set_var_value(&var_rdbmsDbLimitedResourceName, (u_char*)&mib_idx->rdbmsDbLimitedResourceName,
+                       mib_idx->rdbmsDbLimitedResourceName_len * sizeof(mib_idx->rdbmsDbLimitedResourceName[0]));
+
+
+    err = build_oid_noalloc(oid_idx->oids, oid_idx->len, (size_t *)&oid_idx->len,
+                           NULL, 0, &var_rdbmsDbIndex);
+    if(err)
+        snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_rdbmsDbIndex );
+
+    return err;
+} /* rdbmsDbLimitedResourceTable_index_to_oid */
+
+/**
+ * extract rdbmsDbLimitedResourceTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR  : no error
+ * @retval SNMP_ERR_GENERR   : error
+ */
+int
+rdbmsDbLimitedResourceTable_index_from_oid(netsnmp_index *oid_idx,
+                         rdbmsDbLimitedResourceTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+    /*
+     * rdbmsDbLimitedResourceName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_rdbmsDbLimitedResourceName;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+    memset( &var_rdbmsDbLimitedResourceName, 0x00, sizeof(var_rdbmsDbLimitedResourceName) );
+    var_rdbmsDbLimitedResourceName.type = ASN_OCTET_STR;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_rdbmsDbIndex.next_variable =  &var_rdbmsDbLimitedResourceName; var_rdbmsDbLimitedResourceName.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_index_from_oid","called\n"));
+
+    /*
+     * parse the oid into the individual index components
+     */
+    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+                             &var_rdbmsDbIndex );
+    if (err == SNMP_ERR_NOERROR) {
+        /*
+         * copy out values
+         */
+    mib_idx->rdbmsDbIndex = *((long *)var_rdbmsDbIndex.val.string);
+    /*
+     * NOTE: val_len is in bytes, rdbmsDbLimitedResourceName_len might not be
+     */
+         if(var_rdbmsDbLimitedResourceName.val_len > sizeof(mib_idx->rdbmsDbLimitedResourceName))
+             err = SNMP_ERR_GENERR;
+         else {
+             memcpy(mib_idx->rdbmsDbLimitedResourceName, var_rdbmsDbLimitedResourceName.val.string, var_rdbmsDbLimitedResourceName.val_len);
+             mib_idx->rdbmsDbLimitedResourceName_len = var_rdbmsDbLimitedResourceName.val_len / sizeof(mib_idx->rdbmsDbLimitedResourceName[0]);
+         }
+
+
+    }
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_rdbmsDbIndex );
+
+    return err;
+} /* rdbmsDbLimitedResourceTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a rdbmsDbLimitedResourceTable_rowreq_ctx
+ */
+rdbmsDbLimitedResourceTable_rowreq_ctx *
+rdbmsDbLimitedResourceTable_allocate_rowreq_ctx(void)
+{
+    rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx =
+                  SNMP_MALLOC_TYPEDEF(rdbmsDbLimitedResourceTable_rowreq_ctx);
+
+    DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_allocate_rowreq_ctx","called\n"));
+
+    if(NULL == rowreq_ctx) {
+        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+                 "rdbmsDbLimitedResourceTable_rowreq_ctx.\n");
+    }
+
+    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+    rowreq_ctx->rdbmsDbLimitedResourceTable_data_list = NULL;
+    rowreq_ctx->rdbmsDbLimitedResourceTable_reg = rdbmsDbLimitedResourceTable_if_ctx.user_ctx;
+
+
+    return rowreq_ctx;
+} /* rdbmsDbLimitedResourceTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a rdbmsDbLimitedResourceTable_rowreq_ctx
+ */
+void
+rdbmsDbLimitedResourceTable_release_rowreq_ctx(rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable:rdbmsDbLimitedResourceTable_release_rowreq_ctx","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+
+    /*
+     * free index oid pointer
+     */
+    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+        free(rowreq_ctx->oid_idx.oids);
+
+    SNMP_FREE(rowreq_ctx);
+} /* rdbmsDbLimitedResourceTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbLimitedResourceTable_pre_request(netsnmp_mib_handler *handler,
+                            netsnmp_handler_registration *reginfo,
+                            netsnmp_agent_request_info *agtreq_info,
+                            netsnmp_request_info *requests)
+{
+    int rc = rdbmsDbLimitedResourceTable_pre_request(rdbmsDbLimitedResourceTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable","error %d from "
+                    "rdbmsDbLimitedResourceTable_pre_request\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbLimitedResourceTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbLimitedResourceTable_post_request(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx;
+    int rc = rdbmsDbLimitedResourceTable_post_request(rdbmsDbLimitedResourceTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable","error %d from "
+                    "rdbmsDbLimitedResourceTable_post_request\n", rc));
+    }
+    
+    /*
+     * if there are no errors, check for and handle row creation/deletion
+     */
+    rc = netsnmp_check_requests_error(requests);
+    if ((SNMP_ERR_NOERROR == rc) &&
+        (NULL !=
+         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
+        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+            CONTAINER_INSERT(rdbmsDbLimitedResourceTable_if_ctx.container, rowreq_ctx);
+        }
+        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+            CONTAINER_REMOVE(rdbmsDbLimitedResourceTable_if_ctx.container, rowreq_ctx);
+            rdbmsDbLimitedResourceTable_release_rowreq_ctx(rowreq_ctx);
+        }
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbLimitedResourceTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbLimitedResourceTable_object_lookup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    
+    DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable:_mfd_rdbmsDbLimitedResourceTable_object_lookup","called\n"));
+
+    /*
+     * get our context from mfd
+     * rdbmsDbLimitedResourceTable_interface_ctx *if_ctx =
+     *             (rdbmsDbLimitedResourceTable_interface_ctx *)reginfo->my_reg_void;
+     */
+
+    if(NULL == rowreq_ctx) {
+        netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
+    }
+    else {
+        rdbmsDbLimitedResourceTable_row_prep(rowreq_ctx);
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbLimitedResourceTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsDbLimitedResourceTable_get_column( rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable:_mfd_rdbmsDbLimitedResourceTable_get_column","called\n"));
+
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsDbLimitedResourceID(2)/AutonomousType/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h */
+    case COLUMN_RDBMSDBLIMITEDRESOURCEID:
+    var->type = ASN_OBJECT_ID;
+rc = rdbmsDbLimitedResourceID_get(rowreq_ctx, (oid **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsDbLimitedResourceLimit(3)/INTEGER/ASN_INTEGER/long(long)//l/A/W/e/R/d/h */
+    case COLUMN_RDBMSDBLIMITEDRESOURCELIMIT:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = rdbmsDbLimitedResourceLimit_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* rdbmsDbLimitedResourceCurrent(4)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+    case COLUMN_RDBMSDBLIMITEDRESOURCECURRENT:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = rdbmsDbLimitedResourceCurrent_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* rdbmsDbLimitedResourceHighwater(5)/INTEGER/ASN_INTEGER/long(long)//l/A/w/e/R/d/h */
+    case COLUMN_RDBMSDBLIMITEDRESOURCEHIGHWATER:
+    var->val_len = sizeof(long);
+    var->type = ASN_INTEGER;
+rc = rdbmsDbLimitedResourceHighwater_get(rowreq_ctx, (long *)var->val.string );
+        break;
+
+    /* rdbmsDbLimitedResourceFailures(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSDBLIMITEDRESOURCEFAILURES:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_COUNTER;
+rc = rdbmsDbLimitedResourceFailures_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsDbLimitedResourceDescription(7)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+    case COLUMN_RDBMSDBLIMITEDRESOURCEDESCRIPTION:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsDbLimitedResourceDescription_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _rdbmsDbLimitedResourceTable_get_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _rdbmsDbLimitedResourceTable_get_column */
+
+int
+_mfd_rdbmsDbLimitedResourceTable_get_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    u_char                     * old_string;
+    void                      (*dataFreeHook)(void *);
+    int                        rc;
+
+    DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable:_mfd_rdbmsDbLimitedResourceTable_get_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * save old pointer, so we can free it if replaced
+         */
+        old_string = requests->requestvb->val.string;
+        dataFreeHook = requests->requestvb->dataFreeHook;
+        if(NULL == requests->requestvb->val.string) {
+            requests->requestvb->val.string = requests->requestvb->buf;
+            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+        else if(requests->requestvb->buf == requests->requestvb->val.string) {
+            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+
+        /*
+         * get column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _rdbmsDbLimitedResourceTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            if(MFD_SKIP == rc) {
+                requests->requestvb->type = ASN_PRIV_RETRY;
+                rc = SNMP_ERR_NOERROR;
+            }
+        }
+        else if (NULL == requests->requestvb->val.string) {
+            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+            rc = SNMP_ERR_GENERR;
+        }
+        if(rc)
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+        /*
+         * if the buffer wasn't used previously for the old data (i.e. it
+         * was allcoated memory)  and the get routine replaced the pointer,
+         * we need to free the previous pointer.
+         */
+        if(old_string && (old_string != requests->requestvb->buf) &&
+           (requests->requestvb->val.string != old_string)) {
+            if(dataFreeHook)
+                (*dataFreeHook)(old_string);
+            else
+                free(old_string);
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbLimitedResourceTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+    DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable:_cache_load","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache for rdbmsDbLimitedResourceTable_cache_load\n");
+        return -1;
+    }
+
+    /** should only be called for an invalid or expired cache */
+    netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+    
+    /*
+     * call user code
+     */
+    return rdbmsDbLimitedResourceTable_cache_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_item_free(rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+    DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable:_cache_item_free","called\n"));
+
+    if(NULL == rowreq_ctx)
+        return;
+
+    rdbmsDbLimitedResourceTable_release_rowreq_ctx(rowreq_ctx);
+} /* _cache_item_free */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+    netsnmp_container *container;
+
+    DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable:_cache_free","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache in rdbmsDbLimitedResourceTable_cache_free\n");
+        return;
+    }
+
+    container = (netsnmp_container*)cache->magic;
+
+    /*
+     * call user code
+     */
+    rdbmsDbLimitedResourceTable_cache_free(container);
+    
+    /*
+     * free all items. inefficient, but easy.
+     */
+    CONTAINER_CLEAR(container,
+                    (netsnmp_container_obj_func *)_cache_item_free,
+                    NULL);
+} /* _cache_free */
+
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_rdbmsDbLimitedResourceTable_container_init(rdbmsDbLimitedResourceTable_interface_ctx *if_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsDbLimitedResourceTable:_rdbmsDbLimitedResourceTable_container_init","called\n"));
+    
+    /*
+     * set up the cache
+     */
+    if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+                                         _cache_load, _cache_free,
+                                         rdbmsDbLimitedResourceTable_oid,
+                                         rdbmsDbLimitedResourceTable_oid_size);
+
+    if(NULL == if_ctx->cache) {
+        snmp_log(LOG_ERR, "error creating cache for rdbmsDbLimitedResourceTable\n");
+        return;
+    }
+
+    if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+    rdbmsDbLimitedResourceTable_container_init(&if_ctx->container, if_ctx->cache);
+    if(NULL == if_ctx->container)
+        if_ctx->container = netsnmp_container_find("rdbmsDbLimitedResourceTable:table_container");
+    if(NULL == if_ctx->container) {
+        snmp_log(LOG_ERR,"error creating container in "
+                 "rdbmsDbLimitedResourceTable_container_init\n");
+        return;
+    }
+    if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _rdbmsDbLimitedResourceTable_container_init */
+
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_interface.h b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_interface.h
new file mode 100644 (file)
index 0000000..c76fd43
--- /dev/null
@@ -0,0 +1,50 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable_interface.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable_interface.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBLIMITEDRESOURCETABLE_INTERFACE_H
+#define RDBMSDBLIMITEDRESOURCETABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "rdbmsDbLimitedResourceTable.h"
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _rdbmsDbLimitedResourceTable_initialize_interface(rdbmsDbLimitedResourceTable_registration_ptr user_ctx,
+                                    u_long flags);
+
+    rdbmsDbLimitedResourceTable_rowreq_ctx * rdbmsDbLimitedResourceTable_allocate_rowreq_ctx(void);
+void rdbmsDbLimitedResourceTable_release_rowreq_ctx(rdbmsDbLimitedResourceTable_rowreq_ctx *rowreq_ctx);
+
+int rdbmsDbLimitedResourceTable_index_to_oid(netsnmp_index *oid_idx,
+                            rdbmsDbLimitedResourceTable_mib_index *mib_idx);
+int rdbmsDbLimitedResourceTable_index_from_oid(netsnmp_index *oid_idx,
+                              rdbmsDbLimitedResourceTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void rdbmsDbLimitedResourceTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBLIMITEDRESOURCETABLE_INTERFACE_H */
diff --git a/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_oids.h b/RDBMS-MIB_src/rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable_oids.h
new file mode 100644 (file)
index 0000000..2d50d40
--- /dev/null
@@ -0,0 +1,40 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbLimitedResourceTable_oids.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbLimitedResourceTable_oids.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBLIMITEDRESOURCETABLE_OIDS_H
+#define RDBMSDBLIMITEDRESOURCETABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table rdbmsDbLimitedResourceTable */
+#define RDBMSDBLIMITEDRESOURCETABLE_OID              1,3,6,1,2,1,39,1,4
+#define COLUMN_RDBMSDBLIMITEDRESOURCENAME              1
+#define COLUMN_RDBMSDBLIMITEDRESOURCEID                2
+#define COLUMN_RDBMSDBLIMITEDRESOURCELIMIT             3
+#define COLUMN_RDBMSDBLIMITEDRESOURCECURRENT           4
+#define COLUMN_RDBMSDBLIMITEDRESOURCEHIGHWATER         5
+#define COLUMN_RDBMSDBLIMITEDRESOURCEFAILURES          6
+#define COLUMN_RDBMSDBLIMITEDRESOURCEDESCRIPTION               7
+
+#define RDBMSDBLIMITEDRESOURCETABLE_MIN_COL            COLUMN_RDBMSDBLIMITEDRESOURCEID
+#define RDBMSDBLIMITEDRESOURCETABLE_MAX_COL            COLUMN_RDBMSDBLIMITEDRESOURCEDESCRIPTION
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBLIMITEDRESOURCETABLE_OIDS_H */
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable.c b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable.c
new file mode 100644 (file)
index 0000000..5082c83
--- /dev/null
@@ -0,0 +1,130 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable.c,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsDbParamTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "rdbmsDbParamTable_interface.h"
+
+oid rdbmsDbParamTable_oid[] = { RDBMSDBPARAMTABLE_OID };
+int rdbmsDbParamTable_oid_size = OID_LENGTH(rdbmsDbParamTable_oid);
+
+void initialize_table_rdbmsDbParamTable(void);
+
+
+/**
+ * Initializes the rdbmsDbParamTable module
+ */
+void
+init_rdbmsDbParamTable(void)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:init_rdbmsDbParamTable","called\n"));
+
+    /*
+     * TODO:300:o: Perform rdbmsDbParamTable one-time module initialization.
+     */
+     
+    /*
+     * here we initialize all the tables we're planning on supporting
+     */
+    if (should_init("rdbmsDbParamTable"))
+        initialize_table_rdbmsDbParamTable();
+
+} /* init_rdbmsDbParamTable */
+
+/**
+ * Initialize the table rdbmsDbParamTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+initialize_table_rdbmsDbParamTable(void)
+{
+    rdbmsDbParamTable_registration_ptr user_context;
+    u_long flags;
+
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:initialize_table_rdbmsDbParamTable","called\n"));
+
+    /*
+     * TODO:301:o: Perform rdbmsDbParamTable one-time table initialization.
+     */
+
+    /*
+     * TODO:302:o: |->Initialize rdbmsDbParamTable user context
+     * if you'd like to pass in a pointer to some data for this
+     * table, allocate or set it up here.
+     */
+    /*
+     * a netsnmp_data_list is a simple way to store void pointers. A simple
+     * string token is used to add, find or remove pointers.
+     */
+    user_context = netsnmp_create_data_list("rdbmsDbParamTable", NULL, NULL);
+    
+    /*
+     * No support for any flags yet, but in the future you would
+     * set any flags here.
+     */
+    flags = 0;
+    
+    /*
+     * call interface initialization code
+     */
+    _rdbmsDbParamTable_initialize_interface(user_context, flags);
+} /* initialize_table_rdbmsDbParamTable */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_ERROR                : other error
+ */
+int
+rdbmsDbParamTable_pre_request(rdbmsDbParamTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_pre_request","called\n"));
+
+    /*
+     * TODO:510:o: Perform rdbmsDbParamTable pre-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : other error (ignored)
+ */
+int
+rdbmsDbParamTable_post_request(rdbmsDbParamTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_post_request","called\n"));
+
+    /*
+     * TODO:511:o: Perform rdbmsDbParamTable pos-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamTable_post_request */
+
+
+/** @{ */
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable.h b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable.h
new file mode 100644 (file)
index 0000000..bfcf5fd
--- /dev/null
@@ -0,0 +1,214 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBPARAMTABLE_H
+#define RDBMSDBPARAMTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @defgroup misc misc: Miscelaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+    /* *INDENT-OFF*  */
+config_require(RDBMS-MIB/rdbmsDbParamTable/rdbmsDbParamTable_interface);
+config_require(RDBMS-MIB/rdbmsDbParamTable/rdbmsDbParamTable_data_access);
+config_require(RDBMS-MIB/rdbmsDbParamTable/rdbmsDbParamTable_data_get);
+config_require(RDBMS-MIB/rdbmsDbParamTable/rdbmsDbParamTable_data_set);
+    /* *INDENT-ON*  */
+
+/* OID and column number definitions for  */
+#include "rdbmsDbParamTable_oids.h"
+
+/* enum definions */
+#include "rdbmsDbParamTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_rdbmsDbParamTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbParamTable is subid 3 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.3, length: 9
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+    /*
+     * TODO:101:o: |-> Review rdbmsDbParamTable registration context.
+     */
+typedef netsnmp_data_list * rdbmsDbParamTable_registration_ptr;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review rdbmsDbParamTable data context structure.
+ * This structure is used to represent the data for rdbmsDbParamTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * rdbmsDbParamTable.
+ */
+typedef struct rdbmsDbParamTable_data_s {
+    
+        /*
+         * rdbmsDbParamID(3)/AutonomousType/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+         */
+   oid   rdbmsDbParamID[128];
+size_t      rdbmsDbParamID_len; /* # of oid elements, not bytes */
+    
+        /*
+         * rdbmsDbParamCurrValue(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+         */
+   char   rdbmsDbParamCurrValue[255];
+size_t      rdbmsDbParamCurrValue_len; /* # of char elements, not bytes */
+    
+        /*
+         * rdbmsDbParamComment(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+         */
+   char   rdbmsDbParamComment[255];
+size_t      rdbmsDbParamComment_len; /* # of char elements, not bytes */
+    
+} rdbmsDbParamTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review rdbmsDbParamTable mib index.
+ * This structure is used to represent the index for rdbmsDbParamTable.
+ */
+typedef struct rdbmsDbParamTable_mib_index_s {
+
+        /*
+         * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   rdbmsDbIndex;
+
+        /*
+         * rdbmsDbParamName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+         */
+   char   rdbmsDbParamName[64];
+   size_t      rdbmsDbParamName_len;
+
+        /*
+         * rdbmsDbParamSubIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   rdbmsDbParamSubIndex;
+
+
+} rdbmsDbParamTable_mib_index;
+
+    /*
+     * TODO:121:r: |   |-> Review rdbmsDbParamTable max index length.
+     * If you KNOW that your indexes will never exceed a certain
+     * length, update this macro to that length.
+     *
+     * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+     * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+     * Guessing 128 - col/entry(2)  - oid len(9)
+*/
+#define MAX_rdbmsDbParamTable_IDX_LEN     67
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review rdbmsDbParamTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * rdbmsDbParamTable_rowreq_ctx pointer.
+ */
+typedef struct rdbmsDbParamTable_rowreq_ctx_s {
+
+    /** this must be first for container compare to work */
+    netsnmp_index        oid_idx;
+    oid                  oid_tmp[MAX_rdbmsDbParamTable_IDX_LEN];
+    
+    rdbmsDbParamTable_mib_index        tbl_idx;
+    
+    rdbmsDbParamTable_data              data;
+
+    /*
+     * flags per row. Currently, the first (lower) 8 bits are reserved
+     * for the user. See mfd.h for other flags.
+     */
+    u_int                       rowreq_flags;
+
+    /*
+     * implementor's context pointer (provided during registration)
+     */
+    rdbmsDbParamTable_registration_ptr rdbmsDbParamTable_reg;
+
+    /*
+     * TODO:131:o: |   |-> Add useful data to rdbmsDbParamTable rowreq context.
+     */
+    
+    /*
+     * storage for future expansion
+     */
+    netsnmp_data_list             *rdbmsDbParamTable_data_list;
+
+} rdbmsDbParamTable_rowreq_ctx;
+
+typedef struct rdbmsDbParamTable_ref_rowreq_ctx_s {
+    rdbmsDbParamTable_rowreq_ctx *rowreq_ctx;
+} rdbmsDbParamTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+    int rdbmsDbParamTable_pre_request(rdbmsDbParamTable_registration_ptr user_context);
+    int rdbmsDbParamTable_post_request(rdbmsDbParamTable_registration_ptr user_context);
+
+
+extern oid rdbmsDbParamTable_oid[];
+extern int rdbmsDbParamTable_oid_size;
+
+
+#include "rdbmsDbParamTable_interface.h"
+#include "rdbmsDbParamTable_data_access.h"
+#include "rdbmsDbParamTable_data_get.h"
+#include "rdbmsDbParamTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBPARAMTABLE_H */
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_access.c b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_access.c
new file mode 100644 (file)
index 0000000..e8d09cd
--- /dev/null
@@ -0,0 +1,394 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable_data_access.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable_data_access.c,v 1.6 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbParamTable.h"
+#include "rdbmsDbParamTable_data_access.h"
+#include "pg_array.h"
+
+/** @defgroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ * 
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbParamTable is subid 3 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.3, length: 9
+*/
+
+/**
+ * initialization for rdbmsDbParamTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param rdbmsDbParamTable_reg
+ *        Pointer to rdbmsDbParamTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : unrecoverable error.
+ */
+int
+rdbmsDbParamTable_init_data(rdbmsDbParamTable_registration_ptr rdbmsDbParamTable_reg)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_init_data","called\n"));
+
+    /*
+     * TODO:303:o: Initialize rdbmsDbParamTable data.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamTable_init_data */
+
+/**
+ * container-cached overview
+ *
+ */
+
+/***********************************************************************
+ *
+ * cache
+ *
+ ***********************************************************************/
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ *        create a custom container, use this parameter to return it
+ *        to the MFD helper. If set to NULL, the MFD helper will
+ *        allocate a container for you.
+ * @param  cache A pointer to a cache structure. You can set the timeout
+ *         and other cache flags using this pointer.
+ *
+ *  This function is called at startup to allow you to customize certain
+ *  aspects of the access method. For the most part, it is for advanced
+ *  users. The default code should suffice for most cases. If no custom
+ *  container is allocated, the MFD code will create one for your.
+ *
+ *  This is also the place to set up cache behavior. The default, to
+ *  simply set the cache timeout, will work well with the default
+ *  container. If you are using a custom container, you may want to
+ *  look at the cache helper documentation to see if there are any
+ *  flags you want to set.
+ *
+ * @remark
+ *  This would also be a good place to do any initialization needed
+ *  for you data source. For example, opening a connection to another
+ *  process that will supply the data, opening a database, etc.
+ */
+void
+rdbmsDbParamTable_container_init(netsnmp_container **container_ptr_ptr,
+                        netsnmp_cache *cache)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_container_init","called\n"));
+    
+    if((NULL == cache) || (NULL == container_ptr_ptr)) {
+        snmp_log(LOG_ERR,"bad params to rdbmsDbParamTable_container_init\n");
+        return;
+    }
+
+    /*
+     * For advanced users, you can use a custom container. If you
+     * do not create one, one will be created for you.
+     */
+    *container_ptr_ptr = NULL;
+
+    /*
+     * TODO:345:A: Set up rdbmsDbParamTable cache properties.
+     *
+     * Also for advanced users, you can set parameters for the
+     * cache. Do not change the magic pointer, as it is used
+     * by the MFD helper. To completely disable caching, set
+     * cache->enabled to 0.
+     */
+    cache->timeout = RDBMSDBPARAMTABLE_CACHE_TIMEOUT; /* seconds */
+} /* rdbmsDbParamTable_container_init */
+
+/**
+ * load cache data
+ *
+ * TODO:350:M: Implement rdbmsDbParamTable cache load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR                : other error.
+ *
+ *  This function is called to cache the index(es) (and data, optionally)
+ *  for the every row in the data set.
+ *
+ * @remark
+ *  While loading the cache, the only important thing is the indexes.
+ *  If access to your data is cheap/fast (e.g. you have a pointer to a
+ *  structure in memory), it would make sense to update the data here.
+ *  If, however, the accessing the data invovles more work (e.g. parsing
+ *  some other existing data, or peforming calculations to derive the data),
+ *  then you can limit yourself to setting the indexes and saving any
+ *  information you will need later. Then use the saved information in
+ *  rdbmsDbParamTable_row_prep() for populating data.
+ *
+ * @note
+ *  If you need consistency between rows (like you want statistics
+ *  for each row to be from the same time frame), you should set all
+ *  data here.
+ *
+ */
+int
+rdbmsDbParamTable_cache_load(netsnmp_container *container)
+{
+    rdbmsDbParamTable_rowreq_ctx *rowreq_ctx;
+    size_t                 count = 0;
+    int i, j, resultCount, errorCode = MFD_SUCCESS, elements;
+    
+   long   rdbmsDbParamSubIndex = 0;
+   PGresult *qryRes;
+   char **array;
+
+   int rdbmsDbIndex;
+   int rdbmsDbParamCurrValue_len, rdbmsDbParamComment_len = 0, rdbmsDbParamName_len;
+   char rdbmsDbParamCurrValue[255], rdbmsDbParamComment[255] = { "" }, *tmp, rdbmsDbParamName[64];
+
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_cache_load","called\n"));
+
+    /*
+     * TODO:351:M: |-> Load/update data in the rdbmsDbParamTable container.
+     * loop over your rdbmsDbParamTable data, allocate a rowreq context,
+     * set the index(es) [and data, optionally] and insert into
+     * the container.
+     */
+
+    if (PQstatus(dbconn) == CONNECTION_OK) 
+           qryRes = PQexec(dbconn, "SELECT oid, datname, datconfig FROM pg_database");
+    else {
+           snmp_log(LOG_ERR, "Can't get connected to the database");
+           return MFD_RESOURCE_UNAVAILABLE;
+    }
+    if (PQresultStatus(qryRes) != PGRES_TUPLES_OK) {
+           snmp_log(LOG_ERR, "Didn't get any results from the database");
+           PQclear(qryRes);
+           /*PQfinish(dbconn);*/
+           /* It's probably an error if I didn't find *any* databases */
+           return MFD_RESOURCE_UNAVAILABLE;
+    }
+
+    resultCount = PQntuples(qryRes);
+    for (i = 0; i < resultCount; i++) {
+           rdbmsDbIndex = atoi(PQgetvalue(qryRes, i, 0));
+           array = pg_text_array_parse(PQgetvalue(qryRes, i, 2), &elements);
+           if (!array) {
+                   snmp_log(LOG_INFO, "No rdbmsDbParamTable values found for database %s\n", PQgetvalue(qryRes, i, 1));
+                   continue;
+           }
+           for (j = 0; j < elements; j++)  {
+                   tmp = strchr(array[j], '=');
+                   if (!tmp) continue;
+                   memset(rdbmsDbParamName, 0, 64);
+                   strncpy(rdbmsDbParamName, array[j], ((tmp - array[j]) < 64 ? (tmp - array[j]) : 64));
+                   strncpy(rdbmsDbParamCurrValue, tmp+1, 255);
+                   rdbmsDbParamName_len = strlen(rdbmsDbParamName);
+                   rdbmsDbParamCurrValue_len = strlen(rdbmsDbParamCurrValue);
+
+               /*
+                * TODO:352:M: |   |-> set indexes in new rdbmsDbParamTable rowreq context.
+                */
+               rowreq_ctx = rdbmsDbParamTable_allocate_rowreq_ctx();
+               if (NULL == rowreq_ctx) {
+                   snmp_log(LOG_ERR, "memory allocation failed\n");
+                   errorCode = MFD_RESOURCE_UNAVAILABLE;
+                   break;
+               }
+               if(MFD_SUCCESS != rdbmsDbParamTable_indexes_set(rowreq_ctx
+                                      , rdbmsDbIndex
+                                      , rdbmsDbParamName, rdbmsDbParamName_len
+                                      , rdbmsDbParamSubIndex
+                      )) {
+                   snmp_log(LOG_ERR,"error setting index while loading "
+                            "rdbmsDbParamTable cache.\n");
+                   rdbmsDbParamTable_release_rowreq_ctx(rowreq_ctx);
+                   continue;
+               }
+
+               /*
+                * TODO:352:r: |   |-> populate rdbmsDbParamTable data context.
+                * Populate data context here. (optionally, delay until row prep)
+                */
+               rowreq_ctx->data.rdbmsDbParamID_len = 128;
+               rowreq_ctx->data.rdbmsDbParamCurrValue_len = 255;
+               rowreq_ctx->data.rdbmsDbParamComment_len = 255;
+           /*
+            * TRANSIENT or semi-TRANSIENT data:
+            * copy data or save any info needed to do it in row_prep.
+            */
+           /*
+            * setup/save data for rdbmsDbParamID
+            * rdbmsDbParamID(3)/AutonomousType/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+            */
+           /*
+            * TODO:246:r: |-> Define rdbmsDbParamID mapping.
+            * Map values between raw/native values and MIB values
+            *
+            * if(MFD_SUCCESS !=
+            *    rdbmsDbParamID_map(&rowreq_ctx->data.rdbmsDbParamID, &rowreq_ctx->data.rdbmsDbParamID_len,
+            *                rdbmsDbParamID, rdbmsDbParamID_len, 0)) {
+            *    return MFD_ERROR;
+            * }
+            */
+           /*
+            * make sure there is enough space for rdbmsDbParamID data
+            */
+           /* See comment in rdbmsDbParamID_get() -- we don't need this value 
+           if ((NULL == rowreq_ctx->data.rdbmsDbParamID) ||
+               (rowreq_ctx->data.rdbmsDbParamID_len < (rdbmsDbParamID_len * sizeof(rowreq_ctx->data.rdbmsDbParamID[0])))) {
+               snmp_log(LOG_ERR,"not enough space for value\n");
+               errorCode = MFD_ERROR;
+               break;
+           }
+           rowreq_ctx->data.rdbmsDbParamID_len = rdbmsDbParamID_len * sizeof(rowreq_ctx->data.rdbmsDbParamID[0]);
+           memcpy( rowreq_ctx->data.rdbmsDbParamID, rdbmsDbParamID, rowreq_ctx->data.rdbmsDbParamID_len );
+           */
+           
+           /*
+            * setup/save data for rdbmsDbParamCurrValue
+            * rdbmsDbParamCurrValue(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+            */
+           /*
+            * TODO:246:r: |-> Define rdbmsDbParamCurrValue mapping.
+            * Map values between raw/native values and MIB values
+            *
+            * if(MFD_SUCCESS !=
+            *    rdbmsDbParamCurrValue_map(&rowreq_ctx->data.rdbmsDbParamCurrValue, &rowreq_ctx->data.rdbmsDbParamCurrValue_len,
+            *                rdbmsDbParamCurrValue, rdbmsDbParamCurrValue_len, 0)) {
+            *    return MFD_ERROR;
+            * }
+            */
+           /*
+            * make sure there is enough space for rdbmsDbParamCurrValue data
+            */
+           if ((NULL == rowreq_ctx->data.rdbmsDbParamCurrValue) ||
+               (rowreq_ctx->data.rdbmsDbParamCurrValue_len < (rdbmsDbParamCurrValue_len * sizeof(rowreq_ctx->data.rdbmsDbParamCurrValue[0])))) {
+               snmp_log(LOG_ERR,"not enough space for value\n");
+               errorCode = MFD_ERROR;
+               break;
+           }
+           rowreq_ctx->data.rdbmsDbParamCurrValue_len = rdbmsDbParamCurrValue_len * sizeof(rowreq_ctx->data.rdbmsDbParamCurrValue[0]);
+           memcpy( rowreq_ctx->data.rdbmsDbParamCurrValue, rdbmsDbParamCurrValue, rowreq_ctx->data.rdbmsDbParamCurrValue_len );
+           
+           /*
+            * setup/save data for rdbmsDbParamComment
+            * rdbmsDbParamComment(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+            */
+           /*
+            * TODO:246:r: |-> Define rdbmsDbParamComment mapping.
+            * Map values between raw/native values and MIB values
+            *
+            * if(MFD_SUCCESS !=
+            *    rdbmsDbParamComment_map(&rowreq_ctx->data.rdbmsDbParamComment, &rowreq_ctx->data.rdbmsDbParamComment_len,
+            *                rdbmsDbParamComment, rdbmsDbParamComment_len, 0)) {
+            *    return MFD_ERROR;
+            * }
+            */
+           /*
+            * make sure there is enough space for rdbmsDbParamComment data
+            */
+           if ((NULL == rowreq_ctx->data.rdbmsDbParamComment) ||
+               (rowreq_ctx->data.rdbmsDbParamComment_len < (rdbmsDbParamComment_len * sizeof(rowreq_ctx->data.rdbmsDbParamComment[0])))) {
+               snmp_log(LOG_ERR,"not enough space for value\n");
+               errorCode = MFD_ERROR;
+               break;
+           }
+           rowreq_ctx->data.rdbmsDbParamComment_len = rdbmsDbParamComment_len * sizeof(rowreq_ctx->data.rdbmsDbParamComment[0]);
+           memcpy( rowreq_ctx->data.rdbmsDbParamComment, rdbmsDbParamComment, rowreq_ctx->data.rdbmsDbParamComment_len );
+           
+               
+               /*
+                * insert into table container
+                */
+               CONTAINER_INSERT(container, rowreq_ctx);
+               ++count;
+           }
+           pg_text_array_free(array, elements);
+    }
+
+    DEBUGMSGT(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_cache_load",
+               "inserted %d records\n", count));
+
+    PQclear(qryRes);
+    return errorCode;
+} /* rdbmsDbParamTable_cache_load */
+
+/**
+ * cache clean up
+ *
+ * @param container container with all current items
+ *
+ *  This optional callback is called prior to all
+ *  item's being removed from the container. If you
+ *  need to do any processing before that, do it here.
+ *
+ * @note
+ *  The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+rdbmsDbParamTable_cache_free(netsnmp_container *container)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_cache_free","called\n"));
+
+    /*
+     * TODO:380:M: Free rdbmsDbParamTable cache.
+     */
+} /* rdbmsDbParamTable_cache_free */
+
+/**
+ * prepare row for processing.
+ *
+ *  When the agent has located the row for a request, this function is
+ *  called to prepare the row for processing. If you fully populated
+ *  the data context during the index setup phase, you may not need to
+ *  do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ */
+int
+rdbmsDbParamTable_row_prep( rdbmsDbParamTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_row_prep","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:390:o: Prepare row for request.
+     * If populating row data was delayed, this is the place to
+     * fill in the row for this request.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamTable_row_prep */
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_access.h b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_access.h
new file mode 100644 (file)
index 0000000..5bdccf1
--- /dev/null
@@ -0,0 +1,77 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable_data_access.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable_data_access.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBPARAMTABLE_DATA_ACCESS_H
+#define RDBMSDBPARAMTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbParamTable is subid 3 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.3, length: 9
+*/
+
+
+    int rdbmsDbParamTable_init_data(rdbmsDbParamTable_registration_ptr rdbmsDbParamTable_reg);
+
+
+/*
+ * TODO:180:o: Review rdbmsDbParamTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define RDBMSDBPARAMTABLE_CACHE_TIMEOUT   60
+
+void rdbmsDbParamTable_container_init(netsnmp_container **container_ptr_ptr,
+                             netsnmp_cache *cache);
+int rdbmsDbParamTable_cache_load(netsnmp_container *container);
+void rdbmsDbParamTable_cache_free(netsnmp_container *container);
+
+    /*
+    ***************************************************
+    ***             START EXAMPLE CODE              ***
+    ***---------------------------------------------***/
+/* *********************************************************************
+ * Since we have no idea how you really access your data, we'll go with
+ * a worst case example: a flat text file.
+ */
+#define MAX_LINE_SIZE 256
+    /*
+    ***---------------------------------------------***
+    ***              END  EXAMPLE CODE              ***
+    ***************************************************/
+    int rdbmsDbParamTable_row_prep( rdbmsDbParamTable_rowreq_ctx *rowreq_ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBPARAMTABLE_DATA_ACCESS_H */
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_get.c b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_get.c
new file mode 100644 (file)
index 0000000..77537a2
--- /dev/null
@@ -0,0 +1,732 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable_data_get.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable_data_get.c,v 1.3 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsDbParamTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement rdbmsDbParamTable get routines.
+ * TODO:240:M: Implement rdbmsDbParamTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbParamTable is subid 3 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.3, length: 9
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement rdbmsDbParamTable data context functions.
+ */
+
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbParamEntry.rdbmsDbParamName
+ * rdbmsDbParamName is subid 1 of rdbmsDbParamEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.39.1.3.1.1
+ * Description:
+The name of a configuration parameter for a database.  This
+           name is product-specific.  The length is limited to 64
+           characters to constrain the number of sub-identifiers needed
+           for instance identification (and to minimize network
+           traffic).
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  1 - 64;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 64)
+ *
+ *
+ *
+ * NOTE: NODE rdbmsDbParamName IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbParamName.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbParamName_map(char **mib_rdbmsDbParamName_val_ptr_ptr, size_t *mib_rdbmsDbParamName_val_ptr_len_ptr, char *raw_rdbmsDbParamName_val_ptr, size_t raw_rdbmsDbParamName_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbParamName_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbParamName_val_ptr_ptr) && (NULL != mib_rdbmsDbParamName_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamName_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbParamName non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbParamName_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbParamName_val_ptr_ptr) || (*mib_rdbmsDbParamName_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbParamName_val_ptr_ptr = realloc( *mib_rdbmsDbParamName_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbParamName_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbParamName_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbParamName_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbParamName_val_ptr_ptr, raw_rdbmsDbParamName_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamName_map */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbParamEntry.rdbmsDbParamSubIndex
+ * rdbmsDbParamSubIndex is subid 2 of rdbmsDbParamEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.39.1.3.1.2
+ * Description:
+The subindex value for this parameter.  If the parameter is
+           naturally considered to contain a variable number of members
+           of a class, e.g.  members of the DBA user group, or files
+           which are part of the database, then it must be presented as
+           a set of rows.  If, on the other hand, the parameter
+           represents a set of choices from a class, e.g. the
+           permissions on a file or the options chosen out of the set of
+           all options allowed, AND is guaranteed to always fit in the
+           255 character length of a DisplayString, then it may be
+           presented as a comma separated list with a subindex value of
+           one.  Zero may not be used as a value.
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   0
+ *   settable   0
+ *
+ * Ranges:  1 - 2147483647;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE rdbmsDbParamSubIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbParamSubIndex.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbParamSubIndex_map(long *mib_rdbmsDbParamSubIndex_val_ptr, long raw_rdbmsDbParamSubIndex_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsDbParamSubIndex_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamSubIndex_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsDbParamSubIndex mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsDbParamSubIndex_val_ptr) = raw_rdbmsDbParamSubIndex_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamSubIndex_map */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This convenience function is useful for setting all the MIB index
+ *  components with a single function call. It is assume that the C values
+ *  have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+rdbmsDbParamTable_indexes_set_tbl_idx(rdbmsDbParamTable_mib_index *tbl_idx, long rdbmsDbIndex_val, char *rdbmsDbParamName_val_ptr,  size_t rdbmsDbParamName_val_ptr_len, long rdbmsDbParamSubIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_indexes_set_tbl_idx","called\n"));
+
+    /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->rdbmsDbIndex = rdbmsDbIndex_val;
+    
+    /* rdbmsDbParamName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+     tbl_idx->rdbmsDbParamName_len = sizeof(tbl_idx->rdbmsDbParamName);
+    /*
+     * make sure there is enough space for rdbmsDbParamName data
+     */
+    if ((NULL == tbl_idx->rdbmsDbParamName) ||
+        (tbl_idx->rdbmsDbParamName_len < (rdbmsDbParamName_val_ptr_len * sizeof(tbl_idx->rdbmsDbParamName[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+        return MFD_ERROR;
+    }
+    tbl_idx->rdbmsDbParamName_len = rdbmsDbParamName_val_ptr_len * sizeof(tbl_idx->rdbmsDbParamName[0]);
+    memcpy( tbl_idx->rdbmsDbParamName, rdbmsDbParamName_val_ptr, tbl_idx->rdbmsDbParamName_len );
+    
+    /* rdbmsDbParamSubIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->rdbmsDbParamSubIndex = rdbmsDbParamSubIndex_val;
+    
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This function sets the mib indexs, then updates the oid indexs
+ *  from the mib index.
+ */
+int
+rdbmsDbParamTable_indexes_set(rdbmsDbParamTable_rowreq_ctx *rowreq_ctx, long rdbmsDbIndex_val, char *rdbmsDbParamName_val_ptr,  size_t rdbmsDbParamName_val_ptr_len, long rdbmsDbParamSubIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_indexes_set","called\n"));
+
+    if(MFD_SUCCESS != rdbmsDbParamTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+                                   , rdbmsDbIndex_val
+                                   , rdbmsDbParamName_val_ptr, rdbmsDbParamName_val_ptr_len
+                                   , rdbmsDbParamSubIndex_val
+           ))
+        return MFD_ERROR;
+
+    /*
+     * convert mib index to oid index
+     */
+    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+    if(0 != rdbmsDbParamTable_index_to_oid(&rowreq_ctx->oid_idx,
+                                    &rowreq_ctx->tbl_idx)) {
+        return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbParamEntry.rdbmsDbParamID
+ * rdbmsDbParamID is subid 3 of rdbmsDbParamEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.3.1.3
+ * Description:
+The ID of the parameter which may be described in some other
+           MIB (e.g., an enterprise-specific MIB module).  If there is
+           no ID for this rdbmsDbParamName, attempts to access this
+           object will return noSuchName (SNMPv1) or noSuchInstance
+           (SNMPv2).
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is AutonomousType (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length.  (Max 2147483647)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbParamID.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbParamID_map(oid **mib_rdbmsDbParamID_val_ptr_ptr, size_t *mib_rdbmsDbParamID_val_ptr_len_ptr, oid *raw_rdbmsDbParamID_val_ptr, size_t raw_rdbmsDbParamID_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbParamID_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbParamID_val_ptr_ptr) && (NULL != mib_rdbmsDbParamID_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamID_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbParamID non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbParamID_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbParamID_val_ptr_ptr) || (*mib_rdbmsDbParamID_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbParamID_val_ptr_ptr = realloc( *mib_rdbmsDbParamID_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbParamID_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbParamID_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbParamID_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbParamID_val_ptr_ptr, raw_rdbmsDbParamID_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamID_map */
+
+/**
+ * Extract the current value of the rdbmsDbParamID data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbParamID_val_ptr_ptr
+ *        Pointer to storage for a oid variable
+ * @param rdbmsDbParamID_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbParamID.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbParamID_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbParamID_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbParamID_get( rdbmsDbParamTable_rowreq_ctx *rowreq_ctx, oid **rdbmsDbParamID_val_ptr_ptr, size_t *rdbmsDbParamID_val_ptr_len_ptr )
+{
+   /* Until we have a parameter with multiple values that won't fit into
+    * a 255 character string when rendered as a comma-separated list, we 
+    * don't need a value at this OID */
+   return MFD_SKIP;
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsDbParamID_val_ptr_ptr) && (NULL != *rdbmsDbParamID_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsDbParamID_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamID_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbParamID data.
+ * set (* rdbmsDbParamID_val_ptr_ptr ) and (* rdbmsDbParamID_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsDbParamID data
+     */
+    if ((NULL == (* rdbmsDbParamID_val_ptr_ptr )) ||
+        ((* rdbmsDbParamID_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsDbParamID_len * sizeof((* rdbmsDbParamID_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsDbParamID data
+         */
+        (* rdbmsDbParamID_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsDbParamID_len * sizeof((* rdbmsDbParamID_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsDbParamID_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsDbParamID_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsDbParamID_len * sizeof((* rdbmsDbParamID_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsDbParamID_val_ptr_ptr ), rowreq_ctx->data.rdbmsDbParamID, (* rdbmsDbParamID_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamID_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbParamEntry.rdbmsDbParamCurrValue
+ * rdbmsDbParamCurrValue is subid 4 of rdbmsDbParamEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.39.1.3.1.4
+ * Description:
+The value for a configuration parameter now in effect, the
+           actual setting for the database.  While there may multiple
+           values in the temporal domain of interest (for instance, the
+
+           value to take effect at the next restart), this is the
+           current setting.
+
+           Note that a compliant agent does not need to
+           allow write access to this object.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   1
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbParamCurrValue.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbParamCurrValue_map(char **mib_rdbmsDbParamCurrValue_val_ptr_ptr, size_t *mib_rdbmsDbParamCurrValue_val_ptr_len_ptr, char *raw_rdbmsDbParamCurrValue_val_ptr, size_t raw_rdbmsDbParamCurrValue_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbParamCurrValue_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbParamCurrValue_val_ptr_ptr) && (NULL != mib_rdbmsDbParamCurrValue_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamCurrValue_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbParamCurrValue non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbParamCurrValue_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbParamCurrValue_val_ptr_ptr) || (*mib_rdbmsDbParamCurrValue_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbParamCurrValue_val_ptr_ptr = realloc( *mib_rdbmsDbParamCurrValue_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbParamCurrValue_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbParamCurrValue_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbParamCurrValue_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbParamCurrValue_val_ptr_ptr, raw_rdbmsDbParamCurrValue_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamCurrValue_map */
+
+/**
+ * Extract the current value of the rdbmsDbParamCurrValue data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbParamCurrValue_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsDbParamCurrValue_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbParamCurrValue.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbParamCurrValue_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbParamCurrValue_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbParamCurrValue_get( rdbmsDbParamTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbParamCurrValue_val_ptr_ptr, size_t *rdbmsDbParamCurrValue_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsDbParamCurrValue_val_ptr_ptr) && (NULL != *rdbmsDbParamCurrValue_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsDbParamCurrValue_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamCurrValue_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbParamCurrValue data.
+ * set (* rdbmsDbParamCurrValue_val_ptr_ptr ) and (* rdbmsDbParamCurrValue_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsDbParamCurrValue data
+     */
+    if ((NULL == (* rdbmsDbParamCurrValue_val_ptr_ptr )) ||
+        ((* rdbmsDbParamCurrValue_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsDbParamCurrValue_len * sizeof((* rdbmsDbParamCurrValue_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsDbParamCurrValue data
+         */
+        (* rdbmsDbParamCurrValue_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsDbParamCurrValue_len * sizeof((* rdbmsDbParamCurrValue_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsDbParamCurrValue_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsDbParamCurrValue_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsDbParamCurrValue_len * sizeof((* rdbmsDbParamCurrValue_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsDbParamCurrValue_val_ptr_ptr ), rowreq_ctx->data.rdbmsDbParamCurrValue, (* rdbmsDbParamCurrValue_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamCurrValue_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbParamEntry.rdbmsDbParamComment
+ * rdbmsDbParamComment is subid 5 of rdbmsDbParamEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.39.1.3.1.5
+ * Description:
+Annotation which describes the purpose of a configuration
+           parameter or the reason for a particular parameter's
+           setting.
+
+           Note that a compliant agent does not need to
+           allow write access to this object.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   1
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbParamComment.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbParamComment_map(char **mib_rdbmsDbParamComment_val_ptr_ptr, size_t *mib_rdbmsDbParamComment_val_ptr_len_ptr, char *raw_rdbmsDbParamComment_val_ptr, size_t raw_rdbmsDbParamComment_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbParamComment_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbParamComment_val_ptr_ptr) && (NULL != mib_rdbmsDbParamComment_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamComment_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbParamComment non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbParamComment_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbParamComment_val_ptr_ptr) || (*mib_rdbmsDbParamComment_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbParamComment_val_ptr_ptr = realloc( *mib_rdbmsDbParamComment_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbParamComment_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbParamComment_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbParamComment_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbParamComment_val_ptr_ptr, raw_rdbmsDbParamComment_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamComment_map */
+
+/**
+ * Extract the current value of the rdbmsDbParamComment data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbParamComment_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsDbParamComment_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbParamComment.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbParamComment_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbParamComment_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbParamComment_get( rdbmsDbParamTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbParamComment_val_ptr_ptr, size_t *rdbmsDbParamComment_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsDbParamComment_val_ptr_ptr) && (NULL != *rdbmsDbParamComment_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsDbParamComment_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamComment_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbParamComment data.
+ * set (* rdbmsDbParamComment_val_ptr_ptr ) and (* rdbmsDbParamComment_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsDbParamComment data
+     */
+    if ((NULL == (* rdbmsDbParamComment_val_ptr_ptr )) ||
+        ((* rdbmsDbParamComment_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsDbParamComment_len * sizeof((* rdbmsDbParamComment_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsDbParamComment data
+         */
+        (* rdbmsDbParamComment_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsDbParamComment_len * sizeof((* rdbmsDbParamComment_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsDbParamComment_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsDbParamComment_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsDbParamComment_len * sizeof((* rdbmsDbParamComment_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsDbParamComment_val_ptr_ptr ), rowreq_ctx->data.rdbmsDbParamComment, (* rdbmsDbParamComment_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbParamComment_get */
+
+
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_get.h b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_get.h
new file mode 100644 (file)
index 0000000..d9ac635
--- /dev/null
@@ -0,0 +1,65 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable_data_get.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable_data_get.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBPARAMTABLE_DATA_GET_H
+#define RDBMSDBPARAMTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbParamTable is subid 3 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.3, length: 9
+*/
+    /*
+     * indexes
+     */
+    int rdbmsDbParamName_map(char **mib_rdbmsDbParamName_val_ptr_ptr, size_t *mib_rdbmsDbParamName_val_ptr_len_ptr, char *raw_rdbmsDbParamName_val_ptr, size_t raw_rdbmsDbParamName_val_ptr_len, int allow_realloc);
+    int rdbmsDbParamSubIndex_map(long *mib_rdbmsDbParamSubIndex_val_ptr, long raw_rdbmsDbParamSubIndex_val);
+
+    int rdbmsDbParamID_map(oid **mib_rdbmsDbParamID_val_ptr_ptr, size_t *mib_rdbmsDbParamID_val_ptr_len_ptr, oid *raw_rdbmsDbParamID_val_ptr, size_t raw_rdbmsDbParamID_val_ptr_len, int allow_realloc);
+    int rdbmsDbParamID_get( rdbmsDbParamTable_rowreq_ctx *rowreq_ctx, oid **rdbmsDbParamID_val_ptr_ptr, size_t *rdbmsDbParamID_val_ptr_len_ptr );
+    int rdbmsDbParamCurrValue_map(char **mib_rdbmsDbParamCurrValue_val_ptr_ptr, size_t *mib_rdbmsDbParamCurrValue_val_ptr_len_ptr, char *raw_rdbmsDbParamCurrValue_val_ptr, size_t raw_rdbmsDbParamCurrValue_val_ptr_len, int allow_realloc);
+    int rdbmsDbParamCurrValue_get( rdbmsDbParamTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbParamCurrValue_val_ptr_ptr, size_t *rdbmsDbParamCurrValue_val_ptr_len_ptr );
+    int rdbmsDbParamComment_map(char **mib_rdbmsDbParamComment_val_ptr_ptr, size_t *mib_rdbmsDbParamComment_val_ptr_len_ptr, char *raw_rdbmsDbParamComment_val_ptr, size_t raw_rdbmsDbParamComment_val_ptr_len, int allow_realloc);
+    int rdbmsDbParamComment_get( rdbmsDbParamTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbParamComment_val_ptr_ptr, size_t *rdbmsDbParamComment_val_ptr_len_ptr );
+
+
+int rdbmsDbParamTable_indexes_set_tbl_idx(rdbmsDbParamTable_mib_index *tbl_idx, long rdbmsDbIndex_val, char *rdbmsDbParamName_val_ptr,  size_t rdbmsDbParamName_val_ptr_len, long rdbmsDbParamSubIndex_val);
+int rdbmsDbParamTable_indexes_set(rdbmsDbParamTable_rowreq_ctx *rowreq_ctx, long rdbmsDbIndex_val, char *rdbmsDbParamName_val_ptr,  size_t rdbmsDbParamName_val_ptr_len, long rdbmsDbParamSubIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBPARAMTABLE_DATA_GET_H */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_set.c b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_set.c
new file mode 100644 (file)
index 0000000..073d8c9
--- /dev/null
@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable_data_set.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable_data_set.c,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsDbParamTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ * 
+ * @{
+ */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_set.h b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_data_set.h
new file mode 100644 (file)
index 0000000..228dfeb
--- /dev/null
@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable_data_set.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable_data_set.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBPARAMTABLE_DATA_SET_H
+#define RDBMSDBPARAMTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBPARAMTABLE_DATA_SET_H */
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_enums.h b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_enums.h
new file mode 100644 (file)
index 0000000..8423de9
--- /dev/null
@@ -0,0 +1,47 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable_enums.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable_enums.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBPARAMTABLE_ENUMS_H
+#define RDBMSDBPARAMTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table rdbmsDbParamTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBPARAMTABLE_ENUMS_H */
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_interface.c b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_interface.c
new file mode 100644 (file)
index 0000000..0603155
--- /dev/null
@@ -0,0 +1,739 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable_interface.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable_interface.c,v 1.3 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbParamTable.h"
+#include "rdbmsDbParamTable_interface.h"
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbParamTable is subid 3 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.3, length: 9
+*/
+typedef struct rdbmsDbParamTable_interface_ctx_s {
+
+   netsnmp_container              *container;
+   netsnmp_cache                  *cache; /* optional cache */
+
+   rdbmsDbParamTable_registration_ptr      user_ctx;
+   
+   netsnmp_table_registration_info  tbl_info;
+
+   netsnmp_baby_steps_access_methods access_multiplexer;
+
+} rdbmsDbParamTable_interface_ctx;
+
+static rdbmsDbParamTable_interface_ctx rdbmsDbParamTable_if_ctx;
+
+static void _rdbmsDbParamTable_container_init(
+    rdbmsDbParamTable_interface_ctx *if_ctx);
+
+
+static Netsnmp_Node_Handler _mfd_rdbmsDbParamTable_pre_request;
+static Netsnmp_Node_Handler _mfd_rdbmsDbParamTable_post_request;
+static Netsnmp_Node_Handler _mfd_rdbmsDbParamTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_rdbmsDbParamTable_get_values;
+/**
+ * @internal
+ * Initialize the table rdbmsDbParamTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+_rdbmsDbParamTable_initialize_interface(rdbmsDbParamTable_registration_ptr reg_ptr,  u_long flags)
+{
+    netsnmp_baby_steps_access_methods *access_multiplexer =
+        &rdbmsDbParamTable_if_ctx.access_multiplexer;
+    netsnmp_table_registration_info *tbl_info = &rdbmsDbParamTable_if_ctx.tbl_info;
+    netsnmp_handler_registration *reginfo;
+    netsnmp_mib_handler *handler;
+    int    mfd_modes = 0;
+
+    DEBUGMSGTL(("internal:rdbmsDbParamTable:_rdbmsDbParamTable_initialize_interface","called\n"));
+
+
+    /*************************************************
+     *
+     * save interface context for rdbmsDbParamTable
+     */
+    /*
+     * Setting up the table's definition
+     */
+    netsnmp_table_helper_add_indexes(tbl_info,
+                                  ASN_INTEGER, /** index: rdbmsDbIndex */
+                                  ASN_OCTET_STR, /** index: rdbmsDbParamName */
+                                  ASN_INTEGER, /** index: rdbmsDbParamSubIndex */
+                             0);
+
+    /*  Define the minimum and maximum accessible columns.  This
+        optimizes retrival. */
+    tbl_info->min_column = RDBMSDBPARAMTABLE_MIN_COL;
+    tbl_info->max_column = RDBMSDBPARAMTABLE_MAX_COL;
+
+    /*
+     * save users context
+     */
+    rdbmsDbParamTable_if_ctx.user_ctx = reg_ptr;
+
+    /*
+     * call data access initialization code
+     */
+    rdbmsDbParamTable_init_data(reg_ptr);
+
+    /*
+     * set up the container
+     */
+    _rdbmsDbParamTable_container_init(&rdbmsDbParamTable_if_ctx);
+    if (NULL == rdbmsDbParamTable_if_ctx.container) {
+        snmp_log(LOG_ERR,"could not initialize container for rdbmsDbParamTable\n");
+        return;
+    }
+    
+    /*
+     * access_multiplexer: REQUIRED wrapper for get request handling
+     */
+    access_multiplexer->object_lookup = _mfd_rdbmsDbParamTable_object_lookup;
+    access_multiplexer->get_values = _mfd_rdbmsDbParamTable_get_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->pre_request = _mfd_rdbmsDbParamTable_pre_request;
+    access_multiplexer->post_request = _mfd_rdbmsDbParamTable_post_request;
+
+
+    /*************************************************
+     *
+     * Create a registration, save our reg data, register table.
+     */
+    DEBUGMSGTL(("rdbmsDbParamTable:init_rdbmsDbParamTable",
+                "Registering rdbmsDbParamTable as a mibs-for-dummies table.\n"));               
+    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+    reginfo = netsnmp_handler_registration_create("rdbmsDbParamTable", handler,
+                                                  rdbmsDbParamTable_oid,
+                                                  rdbmsDbParamTable_oid_size,
+                                                  HANDLER_CAN_BABY_STEP |
+                                                  HANDLER_CAN_RONLY
+                                                  );
+    if(NULL == reginfo) {
+        snmp_log(LOG_ERR,"error registering table rdbmsDbParamTable\n");
+        return;
+    }
+    reginfo->my_reg_void = &rdbmsDbParamTable_if_ctx;
+
+    /*************************************************
+     *
+     * set up baby steps handler, create it and inject it
+     */
+    if( access_multiplexer->object_lookup )
+        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+    if( access_multiplexer->set_values )
+        mfd_modes |= BABY_STEP_SET_VALUES;
+    if( access_multiplexer->irreversible_commit )
+        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+    if( access_multiplexer->object_syntax_checks )
+        mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+    if( access_multiplexer->pre_request )
+        mfd_modes |= BABY_STEP_PRE_REQUEST;
+    if( access_multiplexer->post_request )
+        mfd_modes |= BABY_STEP_POST_REQUEST;
+    
+    if( access_multiplexer->undo_setup )
+        mfd_modes |= BABY_STEP_UNDO_SETUP;
+    if( access_multiplexer->undo_cleanup )
+        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+    if( access_multiplexer->undo_sets )
+        mfd_modes |= BABY_STEP_UNDO_SETS;
+    
+    if( access_multiplexer->row_creation )
+        mfd_modes |= BABY_STEP_ROW_CREATE;
+    if( access_multiplexer->consistency_checks )
+        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+    if( access_multiplexer->commit )
+        mfd_modes |= BABY_STEP_COMMIT;
+    if( access_multiplexer->undo_commit )
+        mfd_modes |= BABY_STEP_UNDO_COMMIT;
+    
+    handler = netsnmp_baby_steps_handler_get(mfd_modes);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+     */
+    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject container_table helper
+     */
+    handler =
+        netsnmp_container_table_handler_get(tbl_info,
+                                            rdbmsDbParamTable_if_ctx.container,
+                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+    netsnmp_inject_handler( reginfo, handler );
+
+    /*************************************************
+     *
+     * inject cache helper
+     */
+    if(NULL != rdbmsDbParamTable_if_ctx.cache) {
+        handler = netsnmp_cache_handler_get(rdbmsDbParamTable_if_ctx.cache);
+        netsnmp_inject_handler( reginfo, handler );
+    }
+
+    /*
+     * register table
+     */
+    netsnmp_register_table(reginfo, tbl_info);
+} /* _rdbmsDbParamTable_initialize_interface */
+
+void
+rdbmsDbParamTable_valid_columns_set(netsnmp_column_info *vc)
+{
+    rdbmsDbParamTable_if_ctx.tbl_info.valid_columns = vc;
+} /* rdbmsDbParamTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+rdbmsDbParamTable_index_to_oid(netsnmp_index *oid_idx,
+                         rdbmsDbParamTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+    /*
+     * rdbmsDbParamName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_rdbmsDbParamName;
+    /*
+     * rdbmsDbParamSubIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbParamSubIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+    memset( &var_rdbmsDbParamName, 0x00, sizeof(var_rdbmsDbParamName) );
+    var_rdbmsDbParamName.type = ASN_OCTET_STR;
+    memset( &var_rdbmsDbParamSubIndex, 0x00, sizeof(var_rdbmsDbParamSubIndex) );
+    var_rdbmsDbParamSubIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_rdbmsDbIndex.next_variable =  &var_rdbmsDbParamName; var_rdbmsDbParamName.next_variable =  &var_rdbmsDbParamSubIndex; var_rdbmsDbParamSubIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_index_to_oid","called\n"));
+
+        /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_rdbmsDbIndex, (u_char*)&mib_idx->rdbmsDbIndex,
+                       sizeof(mib_idx->rdbmsDbIndex));
+
+        /* rdbmsDbParamName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+    snmp_set_var_value(&var_rdbmsDbParamName, (u_char*)&mib_idx->rdbmsDbParamName,
+                       mib_idx->rdbmsDbParamName_len * sizeof(mib_idx->rdbmsDbParamName[0]));
+
+        /* rdbmsDbParamSubIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_rdbmsDbParamSubIndex, (u_char*)&mib_idx->rdbmsDbParamSubIndex,
+                       sizeof(mib_idx->rdbmsDbParamSubIndex));
+
+
+    err = build_oid_noalloc(oid_idx->oids, oid_idx->len, (size_t *)&oid_idx->len,
+                           NULL, 0, &var_rdbmsDbIndex);
+    if(err)
+        snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_rdbmsDbIndex );
+
+    return err;
+} /* rdbmsDbParamTable_index_to_oid */
+
+/**
+ * extract rdbmsDbParamTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR  : no error
+ * @retval SNMP_ERR_GENERR   : error
+ */
+int
+rdbmsDbParamTable_index_from_oid(netsnmp_index *oid_idx,
+                         rdbmsDbParamTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+    /*
+     * rdbmsDbParamName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_rdbmsDbParamName;
+    /*
+     * rdbmsDbParamSubIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbParamSubIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+    memset( &var_rdbmsDbParamName, 0x00, sizeof(var_rdbmsDbParamName) );
+    var_rdbmsDbParamName.type = ASN_OCTET_STR;
+    memset( &var_rdbmsDbParamSubIndex, 0x00, sizeof(var_rdbmsDbParamSubIndex) );
+    var_rdbmsDbParamSubIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_rdbmsDbIndex.next_variable =  &var_rdbmsDbParamName; var_rdbmsDbParamName.next_variable =  &var_rdbmsDbParamSubIndex; var_rdbmsDbParamSubIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbParamTable:rdbmsDbParamTable_index_from_oid","called\n"));
+
+    /*
+     * parse the oid into the individual index components
+     */
+    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+                             &var_rdbmsDbIndex );
+    if (err == SNMP_ERR_NOERROR) {
+        /*
+         * copy out values
+         */
+    mib_idx->rdbmsDbIndex = *((long *)var_rdbmsDbIndex.val.string);
+    /*
+     * NOTE: val_len is in bytes, rdbmsDbParamName_len might not be
+     */
+         if(var_rdbmsDbParamName.val_len > sizeof(mib_idx->rdbmsDbParamName))
+             err = SNMP_ERR_GENERR;
+         else {
+             memcpy(mib_idx->rdbmsDbParamName, var_rdbmsDbParamName.val.string, var_rdbmsDbParamName.val_len);
+             mib_idx->rdbmsDbParamName_len = var_rdbmsDbParamName.val_len / sizeof(mib_idx->rdbmsDbParamName[0]);
+         }
+    mib_idx->rdbmsDbParamSubIndex = *((long *)var_rdbmsDbParamSubIndex.val.string);
+
+
+    }
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_rdbmsDbIndex );
+
+    return err;
+} /* rdbmsDbParamTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a rdbmsDbParamTable_rowreq_ctx
+ */
+rdbmsDbParamTable_rowreq_ctx *
+rdbmsDbParamTable_allocate_rowreq_ctx(void)
+{
+    rdbmsDbParamTable_rowreq_ctx *rowreq_ctx =
+                  SNMP_MALLOC_TYPEDEF(rdbmsDbParamTable_rowreq_ctx);
+
+    DEBUGMSGTL(("internal:rdbmsDbParamTable:rdbmsDbParamTable_allocate_rowreq_ctx","called\n"));
+
+    if(NULL == rowreq_ctx) {
+        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+                 "rdbmsDbParamTable_rowreq_ctx.\n");
+    }
+
+    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+    rowreq_ctx->rdbmsDbParamTable_data_list = NULL;
+    rowreq_ctx->rdbmsDbParamTable_reg = rdbmsDbParamTable_if_ctx.user_ctx;
+
+
+    return rowreq_ctx;
+} /* rdbmsDbParamTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a rdbmsDbParamTable_rowreq_ctx
+ */
+void
+rdbmsDbParamTable_release_rowreq_ctx(rdbmsDbParamTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsDbParamTable:rdbmsDbParamTable_release_rowreq_ctx","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+
+    /*
+     * free index oid pointer
+     */
+    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+        free(rowreq_ctx->oid_idx.oids);
+
+    SNMP_FREE(rowreq_ctx);
+} /* rdbmsDbParamTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbParamTable_pre_request(netsnmp_mib_handler *handler,
+                            netsnmp_handler_registration *reginfo,
+                            netsnmp_agent_request_info *agtreq_info,
+                            netsnmp_request_info *requests)
+{
+    int rc = rdbmsDbParamTable_pre_request(rdbmsDbParamTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsDbParamTable","error %d from "
+                    "rdbmsDbParamTable_pre_request\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbParamTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbParamTable_post_request(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    rdbmsDbParamTable_rowreq_ctx *rowreq_ctx;
+    int rc = rdbmsDbParamTable_post_request(rdbmsDbParamTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsDbParamTable","error %d from "
+                    "rdbmsDbParamTable_post_request\n", rc));
+    }
+    
+    /*
+     * if there are no errors, check for and handle row creation/deletion
+     */
+    rc = netsnmp_check_requests_error(requests);
+    if ((SNMP_ERR_NOERROR == rc) &&
+        (NULL !=
+         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
+        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+            CONTAINER_INSERT(rdbmsDbParamTable_if_ctx.container, rowreq_ctx);
+        }
+        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+            CONTAINER_REMOVE(rdbmsDbParamTable_if_ctx.container, rowreq_ctx);
+            rdbmsDbParamTable_release_rowreq_ctx(rowreq_ctx);
+        }
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbParamTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbParamTable_object_lookup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsDbParamTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    
+    DEBUGMSGTL(("internal:rdbmsDbParamTable:_mfd_rdbmsDbParamTable_object_lookup","called\n"));
+
+    /*
+     * get our context from mfd
+     * rdbmsDbParamTable_interface_ctx *if_ctx =
+     *             (rdbmsDbParamTable_interface_ctx *)reginfo->my_reg_void;
+     */
+
+    if(NULL == rowreq_ctx) {
+        netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
+    }
+    else {
+        rdbmsDbParamTable_row_prep(rowreq_ctx);
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbParamTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsDbParamTable_get_column( rdbmsDbParamTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsDbParamTable:_mfd_rdbmsDbParamTable_get_column","called\n"));
+
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsDbParamID(3)/AutonomousType/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h */
+    case COLUMN_RDBMSDBPARAMID:
+    var->type = ASN_OBJECT_ID;
+rc = rdbmsDbParamID_get(rowreq_ctx, (oid **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsDbParamCurrValue(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+    case COLUMN_RDBMSDBPARAMCURRVALUE:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsDbParamCurrValue_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsDbParamComment(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+    case COLUMN_RDBMSDBPARAMCOMMENT:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsDbParamComment_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _rdbmsDbParamTable_get_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _rdbmsDbParamTable_get_column */
+
+int
+_mfd_rdbmsDbParamTable_get_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsDbParamTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    u_char                     * old_string;
+    void                      (*dataFreeHook)(void *);
+    int                        rc;
+
+    DEBUGMSGTL(("internal:rdbmsDbParamTable:_mfd_rdbmsDbParamTable_get_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * save old pointer, so we can free it if replaced
+         */
+        old_string = requests->requestvb->val.string;
+        dataFreeHook = requests->requestvb->dataFreeHook;
+        if(NULL == requests->requestvb->val.string) {
+            requests->requestvb->val.string = requests->requestvb->buf;
+            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+        else if(requests->requestvb->buf == requests->requestvb->val.string) {
+            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+
+        /*
+         * get column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _rdbmsDbParamTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            if(MFD_SKIP == rc) {
+                requests->requestvb->type = ASN_PRIV_RETRY;
+                rc = SNMP_ERR_NOERROR;
+            }
+        }
+        else if (NULL == requests->requestvb->val.string) {
+            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+            rc = SNMP_ERR_GENERR;
+        }
+        if(rc)
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+        /*
+         * if the buffer wasn't used previously for the old data (i.e. it
+         * was allcoated memory)  and the get routine replaced the pointer,
+         * we need to free the previous pointer.
+         */
+        if(old_string && (old_string != requests->requestvb->buf) &&
+           (requests->requestvb->val.string != old_string)) {
+            if(dataFreeHook)
+                (*dataFreeHook)(old_string);
+            else
+                free(old_string);
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbParamTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+    DEBUGMSGTL(("internal:rdbmsDbParamTable:_cache_load","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache for rdbmsDbParamTable_cache_load\n");
+        return -1;
+    }
+
+    /** should only be called for an invalid or expired cache */
+    netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+    
+    /*
+     * call user code
+     */
+    return rdbmsDbParamTable_cache_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_item_free(rdbmsDbParamTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+    DEBUGMSGTL(("internal:rdbmsDbParamTable:_cache_item_free","called\n"));
+
+    if(NULL == rowreq_ctx)
+        return;
+
+    rdbmsDbParamTable_release_rowreq_ctx(rowreq_ctx);
+} /* _cache_item_free */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+    netsnmp_container *container;
+
+    DEBUGMSGTL(("internal:rdbmsDbParamTable:_cache_free","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache in rdbmsDbParamTable_cache_free\n");
+        return;
+    }
+
+    container = (netsnmp_container*)cache->magic;
+
+    /*
+     * call user code
+     */
+    rdbmsDbParamTable_cache_free(container);
+    
+    /*
+     * free all items. inefficient, but easy.
+     */
+    CONTAINER_CLEAR(container,
+                    (netsnmp_container_obj_func *)_cache_item_free,
+                    NULL);
+} /* _cache_free */
+
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_rdbmsDbParamTable_container_init(rdbmsDbParamTable_interface_ctx *if_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsDbParamTable:_rdbmsDbParamTable_container_init","called\n"));
+    
+    /*
+     * set up the cache
+     */
+    if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+                                         _cache_load, _cache_free,
+                                         rdbmsDbParamTable_oid,
+                                         rdbmsDbParamTable_oid_size);
+
+    if(NULL == if_ctx->cache) {
+        snmp_log(LOG_ERR, "error creating cache for rdbmsDbParamTable\n");
+        return;
+    }
+
+    if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+    rdbmsDbParamTable_container_init(&if_ctx->container, if_ctx->cache);
+    if(NULL == if_ctx->container)
+        if_ctx->container = netsnmp_container_find("rdbmsDbParamTable:table_container");
+    if(NULL == if_ctx->container) {
+        snmp_log(LOG_ERR,"error creating container in "
+                 "rdbmsDbParamTable_container_init\n");
+        return;
+    }
+    if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _rdbmsDbParamTable_container_init */
+
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_interface.h b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_interface.h
new file mode 100644 (file)
index 0000000..444939c
--- /dev/null
@@ -0,0 +1,50 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable_interface.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable_interface.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBPARAMTABLE_INTERFACE_H
+#define RDBMSDBPARAMTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "rdbmsDbParamTable.h"
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _rdbmsDbParamTable_initialize_interface(rdbmsDbParamTable_registration_ptr user_ctx,
+                                    u_long flags);
+
+    rdbmsDbParamTable_rowreq_ctx * rdbmsDbParamTable_allocate_rowreq_ctx(void);
+void rdbmsDbParamTable_release_rowreq_ctx(rdbmsDbParamTable_rowreq_ctx *rowreq_ctx);
+
+int rdbmsDbParamTable_index_to_oid(netsnmp_index *oid_idx,
+                            rdbmsDbParamTable_mib_index *mib_idx);
+int rdbmsDbParamTable_index_from_oid(netsnmp_index *oid_idx,
+                              rdbmsDbParamTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void rdbmsDbParamTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBPARAMTABLE_INTERFACE_H */
diff --git a/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_oids.h b/RDBMS-MIB_src/rdbmsDbParamTable/rdbmsDbParamTable_oids.h
new file mode 100644 (file)
index 0000000..92c43de
--- /dev/null
@@ -0,0 +1,38 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbParamTable_oids.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbParamTable_oids.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBPARAMTABLE_OIDS_H
+#define RDBMSDBPARAMTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table rdbmsDbParamTable */
+#define RDBMSDBPARAMTABLE_OID              1,3,6,1,2,1,39,1,3
+#define COLUMN_RDBMSDBPARAMNAME                1
+#define COLUMN_RDBMSDBPARAMSUBINDEX            2
+#define COLUMN_RDBMSDBPARAMID          3
+#define COLUMN_RDBMSDBPARAMCURRVALUE           4
+#define COLUMN_RDBMSDBPARAMCOMMENT             5
+
+#define RDBMSDBPARAMTABLE_MIN_COL              COLUMN_RDBMSDBPARAMID
+#define RDBMSDBPARAMTABLE_MAX_COL              COLUMN_RDBMSDBPARAMCOMMENT
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBPARAMTABLE_OIDS_H */
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable.c b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable.c
new file mode 100644 (file)
index 0000000..aac7c37
--- /dev/null
@@ -0,0 +1,124 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable.c,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbTable.h"
+#include "rdbmsDbTable_interface.h"
+
+oid rdbmsDbTable_oid[] = { RDBMSDBTABLE_OID };
+int rdbmsDbTable_oid_size = OID_LENGTH(rdbmsDbTable_oid);
+
+void initialize_table_rdbmsDbTable(void);
+
+
+/**
+ * Initializes the rdbmsDbTable module
+ */
+void
+init_rdbmsDbTable(void)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:init_rdbmsDbTable","called\n"));
+
+    /*
+     * TODO:300:o: Perform rdbmsDbTable one-time module initialization.
+     */
+     
+    /*
+     * here we initialize all the tables we're planning on supporting
+     */
+    if (should_init("rdbmsDbTable"))
+        initialize_table_rdbmsDbTable();
+
+} /* init_rdbmsDbTable */
+
+/**
+ * Initialize the table rdbmsDbTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+initialize_table_rdbmsDbTable(void)
+{
+    rdbmsDbTable_registration_ptr user_context;
+    u_long flags;
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:initialize_table_rdbmsDbTable","called\n"));
+
+    /*
+     * TODO:301:o: Perform rdbmsDbTable one-time table initialization.
+     */
+
+    /*
+     * TODO:302:o: |->Initialize rdbmsDbTable user context
+     * if you'd like to pass in a pointer to some data for this
+     * table, allocate or set it up here.
+     */
+    /*
+     * a netsnmp_data_list is a simple way to store void pointers. A simple
+     * string token is used to add, find or remove pointers.
+     */
+    user_context = netsnmp_create_data_list("rdbmsDbTable", NULL, NULL);
+    
+    /*
+     * No support for any flags yet, but in the future you would
+     * set any flags here.
+     */
+    flags = 0;
+    
+    /*
+     * call interface initialization code
+     */
+    _rdbmsDbTable_initialize_interface(user_context, flags);
+} /* initialize_table_rdbmsDbTable */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_ERROR                : other error
+ */
+int
+rdbmsDbTable_pre_request(rdbmsDbTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_pre_request","called\n"));
+
+    /*
+     * TODO:510:o: Perform rdbmsDbTable pre-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : other error (ignored)
+ */
+int
+rdbmsDbTable_post_request(rdbmsDbTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_post_request","called\n"));
+
+    /*
+     * TODO:511:o: Perform rdbmsDbTable pos-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbTable_post_request */
+
+
+/** @{ */
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable.h b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable.h
new file mode 100644 (file)
index 0000000..1dbdbe2
--- /dev/null
@@ -0,0 +1,220 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBTABLE_H
+#define RDBMSDBTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @defgroup misc misc: Miscelaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+    /* *INDENT-OFF*  */
+config_require(RDBMS-MIB/rdbmsDbTable/rdbmsDbTable_interface);
+config_require(RDBMS-MIB/rdbmsDbTable/rdbmsDbTable_data_access);
+config_require(RDBMS-MIB/rdbmsDbTable/rdbmsDbTable_data_get);
+config_require(RDBMS-MIB/rdbmsDbTable/rdbmsDbTable_data_set);
+    /* *INDENT-ON*  */
+
+/* OID and column number definitions for  */
+#include "rdbmsDbTable_oids.h"
+
+/* enum definions */
+#include "rdbmsDbTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_rdbmsDbTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbTable is subid 1 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.1, length: 9
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+    /*
+     * TODO:101:o: |-> Review rdbmsDbTable registration context.
+     */
+typedef netsnmp_data_list * rdbmsDbTable_registration_ptr;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review rdbmsDbTable data context structure.
+ * This structure is used to represent the data for rdbmsDbTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * rdbmsDbTable.
+ */
+typedef struct rdbmsDbTable_data_s {
+    
+        /*
+         * rdbmsDbPrivateMibOID(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+         */
+   oid   rdbmsDbPrivateMibOID[128];
+size_t      rdbmsDbPrivateMibOID_len; /* # of oid elements, not bytes */
+    
+        /*
+         * rdbmsDbVendorName(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+         */
+   char   rdbmsDbVendorName[255];
+size_t      rdbmsDbVendorName_len; /* # of char elements, not bytes */
+    
+        /*
+         * rdbmsDbName(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+         */
+   char   rdbmsDbName[255];
+size_t      rdbmsDbName_len; /* # of char elements, not bytes */
+    
+        /*
+         * rdbmsDbContact(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+         */
+   char   rdbmsDbContact[255];
+size_t      rdbmsDbContact_len; /* # of char elements, not bytes */
+    
+} rdbmsDbTable_data;
+
+
+/* *********************************************************************
+ * TODO:115:o: |-> Review rdbmsDbTable undo context.
+ * We're just going to use the same data structure for our
+ * undo_context. If you want to do something more efficent,
+ * define your typedef here.
+ */
+typedef rdbmsDbTable_data rdbmsDbTable_undo_data;
+
+/*
+ * TODO:120:r: |-> Review rdbmsDbTable mib index.
+ * This structure is used to represent the index for rdbmsDbTable.
+ */
+typedef struct rdbmsDbTable_mib_index_s {
+
+        /*
+         * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   rdbmsDbIndex;
+
+
+} rdbmsDbTable_mib_index;
+
+    /*
+     * TODO:121:r: |   |-> Review rdbmsDbTable max index length.
+     * If you KNOW that your indexes will never exceed a certain
+     * length, update this macro to that length.
+*/
+#define MAX_rdbmsDbTable_IDX_LEN     1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review rdbmsDbTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * rdbmsDbTable_rowreq_ctx pointer.
+ */
+typedef struct rdbmsDbTable_rowreq_ctx_s {
+
+    /** this must be first for container compare to work */
+    netsnmp_index        oid_idx;
+    oid                  oid_tmp[MAX_rdbmsDbTable_IDX_LEN];
+    
+    rdbmsDbTable_mib_index        tbl_idx;
+    
+    rdbmsDbTable_data              data;
+    rdbmsDbTable_undo_data       * undo;
+    unsigned int                column_set_flags; /* flags for set columns */
+
+
+    /*
+     * flags per row. Currently, the first (lower) 8 bits are reserved
+     * for the user. See mfd.h for other flags.
+     */
+    u_int                       rowreq_flags;
+
+    /*
+     * implementor's context pointer (provided during registration)
+     */
+    rdbmsDbTable_registration_ptr rdbmsDbTable_reg;
+
+    /*
+     * TODO:131:o: |   |-> Add useful data to rdbmsDbTable rowreq context.
+     */
+    
+    /*
+     * storage for future expansion
+     */
+    netsnmp_data_list             *rdbmsDbTable_data_list;
+
+} rdbmsDbTable_rowreq_ctx;
+
+typedef struct rdbmsDbTable_ref_rowreq_ctx_s {
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx;
+} rdbmsDbTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+    int rdbmsDbTable_pre_request(rdbmsDbTable_registration_ptr user_context);
+    int rdbmsDbTable_post_request(rdbmsDbTable_registration_ptr user_context);
+
+    int rdbmsDbTable_check_dependencies(rdbmsDbTable_rowreq_ctx * rowreq_ctx); 
+    int rdbmsDbTable_commit(rdbmsDbTable_rowreq_ctx * rowreq_ctx);
+
+    void initialize_table_rdbmsDbTable(void);
+
+extern oid rdbmsDbTable_oid[];
+extern int rdbmsDbTable_oid_size;
+
+
+#include "rdbmsDbTable_interface.h"
+#include "rdbmsDbTable_data_access.h"
+#include "rdbmsDbTable_data_get.h"
+#include "rdbmsDbTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBTABLE_H */
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_access.c b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_access.c
new file mode 100644 (file)
index 0000000..d15c924
--- /dev/null
@@ -0,0 +1,377 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable_data_access.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable_data_access.c,v 1.5 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbTable.h"
+#include "rdbmsDbTable_data_access.h"
+
+/** @defgroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ * 
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbTable is subid 1 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.1, length: 9
+*/
+
+/**
+ * initialization for rdbmsDbTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param rdbmsDbTable_reg
+ *        Pointer to rdbmsDbTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : unrecoverable error.
+ */
+int
+rdbmsDbTable_init_data(rdbmsDbTable_registration_ptr rdbmsDbTable_reg)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_init_data","called\n"));
+
+    return MFD_SUCCESS;
+} /* rdbmsDbTable_init_data */
+
+/**
+ * container-cached overview
+ *
+ */
+
+/***********************************************************************
+ *
+ * cache
+ *
+ ***********************************************************************/
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ *        create a custom container, use this parameter to return it
+ *        to the MFD helper. If set to NULL, the MFD helper will
+ *        allocate a container for you.
+ * @param  cache A pointer to a cache structure. You can set the timeout
+ *         and other cache flags using this pointer.
+ *
+ *  This function is called at startup to allow you to customize certain
+ *  aspects of the access method. For the most part, it is for advanced
+ *  users. The default code should suffice for most cases. If no custom
+ *  container is allocated, the MFD code will create one for your.
+ *
+ *  This is also the place to set up cache behavior. The default, to
+ *  simply set the cache timeout, will work well with the default
+ *  container. If you are using a custom container, you may want to
+ *  look at the cache helper documentation to see if there are any
+ *  flags you want to set.
+ *
+ * @remark
+ *  This would also be a good place to do any initialization needed
+ *  for you data source. For example, opening a connection to another
+ *  process that will supply the data, opening a database, etc.
+ */
+void
+rdbmsDbTable_container_init(netsnmp_container **container_ptr_ptr,
+                        netsnmp_cache *cache)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_container_init","called\n"));
+    
+    if((NULL == cache) || (NULL == container_ptr_ptr)) {
+        snmp_log(LOG_ERR,"bad params to rdbmsDbTable_container_init\n");
+        return;
+    }
+
+    /*
+     * For advanced users, you can use a custom container. If you
+     * do not create one, one will be created for you.
+     */
+    *container_ptr_ptr = NULL;
+
+    /*
+     * TODO:345:A: Set up rdbmsDbTable cache properties.
+     *
+     * Also for advanced users, you can set parameters for the
+     * cache. Do not change the magic pointer, as it is used
+     * by the MFD helper. To completely disable caching, set
+     * cache->enabled to 0.
+     */
+    cache->timeout = RDBMSDBTABLE_CACHE_TIMEOUT; /* seconds */
+
+    /* JWT-TODO: Initialize cache with cache->flags here */
+} /* rdbmsDbTable_container_init */
+
+/**
+ * load cache data
+ *
+ * TODO:350:M: Implement rdbmsDbTable cache load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR                : other error.
+ *
+ *  This function is called to cache the index(es) (and data, optionally)
+ *  for the every row in the data set.
+ *
+ * @remark
+ *  While loading the cache, the only important thing is the indexes.
+ *  If access to your data is cheap/fast (e.g. you have a pointer to a
+ *  structure in memory), it would make sense to update the data here.
+ *  If, however, the accessing the data invovles more work (e.g. parsing
+ *  some other existing data, or peforming calculations to derive the data),
+ *  then you can limit yourself to setting the indexes and saving any
+ *  information you will need later. Then use the saved information in
+ *  rdbmsDbTable_row_prep() for populating data.
+ *
+ * @note
+ *  If you need consistency between rows (like you want statistics
+ *  for each row to be from the same time frame), you should set all
+ *  data here.
+ *
+ */
+int
+rdbmsDbTable_cache_load(netsnmp_container *container)
+{
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx;
+    oid rdbmsDbPrivateMibOID[128] = { 1,3,6,1,4,1,27645 };
+    int i, resultCount, errorcode = MFD_SUCCESS, tmpInt;
+    PGresult *pg_db_qry, *pgsnmpd_tbl_qry;
+    char *tmpString, *db_oid, *vendor_name, *contact_name;
+    int vendor_name_len, contact_name_len;
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_cache_load","called\n"));
+
+    /*
+     * TODO:351:M: |-> Load/update data in the rdbmsDbTable container.
+     * loop over your rdbmsDbTable data, allocate a rowreq context,
+     * set the index(es) [and data, optionally] and insert into
+     * the container. */
+
+    if (PQstatus(dbconn) == CONNECTION_OK) 
+           pg_db_qry = PQexec(dbconn, "SELECT oid, datname FROM pg_database");
+    else {
+           snmp_log(LOG_ERR, "Can't get connected to the database");
+           return MFD_RESOURCE_UNAVAILABLE;
+    }
+    if (PQresultStatus(pg_db_qry) != PGRES_TUPLES_OK) {
+           snmp_log(LOG_ERR, "Didn't get any results from the database");
+           PQclear(pg_db_qry);
+           /*PQfinish(dbconn); */
+           /* It's probably an error if I didn't find *any* databases */
+           return MFD_RESOURCE_UNAVAILABLE;
+    }
+
+    resultCount = PQntuples(pg_db_qry);
+
+    for (i = 0; i < resultCount; i++) {
+
+        /*
+         * TODO:352:M: |   |-> set indexes in new rdbmsDbTable rowreq context.
+         */
+        rowreq_ctx = rdbmsDbTable_allocate_rowreq_ctx();
+        if (NULL == rowreq_ctx) {
+            snmp_log(LOG_ERR, "memory allocation failed\n");
+            errorcode = MFD_RESOURCE_UNAVAILABLE;
+           break;
+        }
+       db_oid = PQgetvalue(pg_db_qry, i, 0);
+        if(MFD_SUCCESS != rdbmsDbTable_indexes_set(rowreq_ctx
+                               ,atol(db_oid)
+               )) {
+            snmp_log(LOG_ERR,"error setting index while loading "
+                     "rdbmsDbTable cache.\n");
+            rdbmsDbTable_release_rowreq_ctx(rowreq_ctx);
+            continue;
+        }
+
+        /*
+         * TODO:352:r: |   |-> populate rdbmsDbTable data context.
+         * Populate data context here. (optionally, delay until row prep)
+         */
+
+       rowreq_ctx->data.rdbmsDbPrivateMibOID_len = 128;
+       rowreq_ctx->data.rdbmsDbVendorName_len    = 255;
+       rowreq_ctx->data.rdbmsDbName_len          = 255;
+       rowreq_ctx->data.rdbmsDbContact_len       = 255;
+
+       contact_name = NULL;
+       contact_name_len = 0;
+       vendor_name = NULL;
+       vendor_name_len = 0;
+
+       /* Note that this queries pgsnmpd_rdbmsDbTable once per database. This could
+        * be more efficient by only querying once if it can't find the table (being
+        * sure that the table didn't exist, as opposed to simply an entry for that 
+        * database not existing in the table). It could also be rewritten so that 
+        * only one query is issued, joining pg_database and pgsnmpd_rdbmsDbTable, but 
+        * that would have to be smart enough to know of the pgsnmpd table existed
+        * and not do the join if it didn't */
+       pgsnmpd_tbl_qry = NULL;
+       tmpInt = sizeof("SELECT vendor_name, contact_name FROM pgsnmpd_rdbmsDbTable WHERE database_oid = ") + sizeof(*db_oid);
+       tmpString = calloc(tmpInt, sizeof(char*));
+       if (tmpString == NULL) snmp_log(LOG_ERR, "Couldn't allocate memory to query pgsnmpd-specific database table\n");
+       else {
+               snmp_log(LOG_INFO, "Gathering rdbmsDbTable information from pgsnmpd_rdbmsDbTable\n");
+               snprintf(tmpString, sizeof(char*) * tmpInt, "SELECT vendor_name, contact_name FROM pgsnmpd_rdbmsDbTable WHERE database_oid = %s", db_oid);
+               pgsnmpd_tbl_qry = PQexec(dbconn, tmpString);
+               /* Ignore errors so that pgsnmpd will run without this table being available */
+               if (PQresultStatus(pgsnmpd_tbl_qry) == PGRES_TUPLES_OK && PQntuples(pgsnmpd_tbl_qry) > 0) {
+                       vendor_name = PQgetvalue(pgsnmpd_tbl_qry, 0, 0);
+                       vendor_name_len = strlen(vendor_name);
+                       contact_name = PQgetvalue(pgsnmpd_tbl_qry, 0, 1);
+                       contact_name_len = strlen(contact_name);
+               }
+               /* Note that this error is INFO level, instead of something higher, because we're designed to work without this table */
+               else snmp_log(LOG_INFO, "Unable to find relevant data in pgsnmpd_rdbmsDbTable\n");
+       }
+
+    /*
+     * TODO:246:r: |-> Define rdbmsDbPrivateMibOID mapping.
+     * Map values between raw/native values and MIB values
+     *
+     * if(MFD_SUCCESS !=
+     *    rdbmsDbPrivateMibOID_map(&rowreq_ctx->data.rdbmsDbPrivateMibOID, &rowreq_ctx->data.rdbmsDbPrivateMibOID_len,
+     *                rdbmsDbPrivateMibOID, rdbmsDbPrivateMibOID_len, 0)) {
+     *    return MFD_ERROR;
+     * }
+     */
+    if ((NULL == rowreq_ctx->data.rdbmsDbPrivateMibOID) ||
+        (rowreq_ctx->data.rdbmsDbPrivateMibOID_len < (1 * sizeof(rowreq_ctx->data.rdbmsDbPrivateMibOID[0])))) {
+        snmp_log(LOG_ERR,"not enough space for rdbmsDbTable.rdbmsDbPrivateMibOID value.\n");
+        errorcode = MFD_ERROR;
+       break;
+    }
+    rowreq_ctx->data.rdbmsDbPrivateMibOID_len = 8;
+    rdbmsDbPrivateMibOID[7] = (oid) atoi(PQgetvalue(pg_db_qry, i, 0));
+    memcpy( rowreq_ctx->data.rdbmsDbPrivateMibOID, rdbmsDbPrivateMibOID, 8 * sizeof(rdbmsDbPrivateMibOID[0]));
+    
+    /*
+     * TODO:246:r: |-> Define rdbmsDbVendorName mapping.
+     */
+    if ((NULL == rowreq_ctx->data.rdbmsDbVendorName) ||
+        (rowreq_ctx->data.rdbmsDbVendorName_len < (10 * sizeof(rowreq_ctx->data.rdbmsDbVendorName[0])))) {
+        snmp_log(LOG_ERR,"not enough space for rdbmsDbTable.rdbmsDbVendorName value\n");
+        errorcode = MFD_ERROR;
+       break;
+    }
+    rowreq_ctx->data.rdbmsDbVendorName_len = vendor_name_len;
+    memcpy( rowreq_ctx->data.rdbmsDbVendorName, vendor_name, vendor_name_len);
+    
+    /*
+     * TODO:246:r: |-> Define rdbmsDbName mapping.
+     */
+    if ((NULL == rowreq_ctx->data.rdbmsDbName) ||
+        (rowreq_ctx->data.rdbmsDbName_len < (100 * sizeof(rowreq_ctx->data.rdbmsDbName[0])))) {
+        snmp_log(LOG_ERR,"not enough space for rdbmsDbTable.rdbmsDbName value\n");
+        errorcode = MFD_ERROR;
+       break;
+    }
+    tmpString = PQgetvalue(pg_db_qry, i, 1);
+    rowreq_ctx->data.rdbmsDbName_len = strlen(tmpString) * sizeof(rowreq_ctx->data.rdbmsDbName[0]);
+    strncpy(rowreq_ctx->data.rdbmsDbName, tmpString, rowreq_ctx->data.rdbmsDbName_len);
+    
+    /*
+     * TODO:246:r: |-> Define rdbmsDbContact mapping.
+     */
+    if ((NULL == rowreq_ctx->data.rdbmsDbContact) ||
+        (rowreq_ctx->data.rdbmsDbContact_len < (100 * sizeof(rowreq_ctx->data.rdbmsDbContact[0])))) {
+        snmp_log(LOG_ERR,"not enough space for rdbmsDbTable.rdbmsDbContact value\n");
+        errorcode = MFD_ERROR;
+       break;
+    }
+    rowreq_ctx->data.rdbmsDbContact_len = contact_name_len;
+    memcpy( rowreq_ctx->data.rdbmsDbContact, contact_name, contact_name_len);
+    
+        
+        /*
+         * insert into table container
+         */
+        CONTAINER_INSERT(container, rowreq_ctx);
+
+       if (pgsnmpd_tbl_qry != NULL) PQclear(pgsnmpd_tbl_qry);
+    }
+
+    DEBUGMSGT(("verbose:rdbmsDbTable:rdbmsDbTable_cache_load",
+               "inserted some records\n"));
+
+    PQclear(pg_db_qry);
+    return errorcode;
+} /* rdbmsDbTable_cache_load */
+
+/**
+ * cache clean up
+ *
+ * @param container container with all current items
+ *
+ *  This optional callback is called prior to all
+ *  item's being removed from the container. If you
+ *  need to do any processing before that, do it here.
+ *
+ * @note
+ *  The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+rdbmsDbTable_cache_free(netsnmp_container *container)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_cache_free","called\n"));
+
+    /*
+     * TODO:380:M: Free rdbmsDbTable cache.
+     */
+} /* rdbmsDbTable_cache_free */
+
+/**
+ * prepare row for processing.
+ *
+ *  When the agent has located the row for a request, this function is
+ *  called to prepare the row for processing. If you fully populated
+ *  the data context during the index setup phase, you may not need to
+ *  do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ */
+int
+rdbmsDbTable_row_prep( rdbmsDbTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_row_prep","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:390:o: Prepare row for request.
+     * If populating row data was delayed, this is the place to
+     * fill in the row for this request.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsDbTable_row_prep */
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_access.h b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_access.h
new file mode 100644 (file)
index 0000000..cdf1cac
--- /dev/null
@@ -0,0 +1,64 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable_data_access.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable_data_access.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBTABLE_DATA_ACCESS_H
+#define RDBMSDBTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbTable is subid 1 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.1, length: 9
+*/
+
+
+    int rdbmsDbTable_init_data(rdbmsDbTable_registration_ptr rdbmsDbTable_reg);
+
+
+/*
+ * TODO:180:o: Review rdbmsDbTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define RDBMSDBTABLE_CACHE_TIMEOUT   60
+
+void rdbmsDbTable_container_init(netsnmp_container **container_ptr_ptr,
+                             netsnmp_cache *cache);
+int rdbmsDbTable_cache_load(netsnmp_container *container);
+void rdbmsDbTable_cache_free(netsnmp_container *container);
+
+int rdbmsDbTable_row_prep( rdbmsDbTable_rowreq_ctx *rowreq_ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBTABLE_DATA_ACCESS_H */
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_get.c b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_get.c
new file mode 100644 (file)
index 0000000..b6a7207
--- /dev/null
@@ -0,0 +1,763 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable_data_get.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable_data_get.c,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement rdbmsDbTable get routines.
+ * TODO:240:M: Implement rdbmsDbTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbTable is subid 1 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.1, length: 9
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement rdbmsDbTable data context functions.
+ */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbEntry.rdbmsDbIndex
+ * rdbmsDbIndex is subid 1 of rdbmsDbEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.39.1.1.1.1
+ * Description:
+A numeric index, unique among all the databases from all
+           products on this host.  This value is a surrogate for the
+           conceptually unique key, which is {PrivateMibOID,
+           databasename}
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   0
+ *   settable   0
+ *
+ * Ranges:  1 - 2147483647;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE rdbmsDbIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbIndex.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbIndex_map(long *mib_rdbmsDbIndex_val_ptr, long raw_rdbmsDbIndex_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsDbIndex_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbIndex_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsDbIndex mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsDbIndex_val_ptr) = raw_rdbmsDbIndex_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsDbIndex_map */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This convenience function is useful for setting all the MIB index
+ *  components with a single function call. It is assume that the C values
+ *  have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+rdbmsDbTable_indexes_set_tbl_idx(rdbmsDbTable_mib_index *tbl_idx, long rdbmsDbIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_indexes_set_tbl_idx","called\n"));
+
+    /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->rdbmsDbIndex = rdbmsDbIndex_val;
+    
+
+    return MFD_SUCCESS;
+} /* rdbmsDbTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This function sets the mib indexs, then updates the oid indexs
+ *  from the mib index.
+ */
+int
+rdbmsDbTable_indexes_set(rdbmsDbTable_rowreq_ctx *rowreq_ctx, long rdbmsDbIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_indexes_set","called\n"));
+
+    if(MFD_SUCCESS != rdbmsDbTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+                                   , rdbmsDbIndex_val
+           ))
+        return MFD_ERROR;
+
+    /*
+     * convert mib index to oid index
+     */
+    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+    if(0 != rdbmsDbTable_index_to_oid(&rowreq_ctx->oid_idx,
+                                    &rowreq_ctx->tbl_idx)) {
+        return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* rdbmsDbTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbEntry.rdbmsDbPrivateMibOID
+ * rdbmsDbPrivateMibOID is subid 2 of rdbmsDbEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.1.1.2
+ * Description:
+The authoritative identification for the private MIB for
+          this database, presumably based on the vendor, e.g., {
+          enterprises 111 <optional subidentifiers>} for Oracle
+          databases, {enterprises 757 <optional subidentifiers>} for
+          Ingres databases, { enterprises 897 <optional
+          subidentifiers>} for Sybase databases, etc.
+
+          If no OBJECT IDENTIFIER exists for the private MIB, attempts
+
+          to access this object will return noSuchName (SNMPv1)
+          or noSuchInstance (SNMPv2).
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is OBJECTID (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length.  (Max 2147483647)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbPrivateMibOID.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbPrivateMibOID_map(oid **mib_rdbmsDbPrivateMibOID_val_ptr_ptr, size_t *mib_rdbmsDbPrivateMibOID_val_ptr_len_ptr,
+ oid *raw_rdbmsDbPrivateMibOID_val_ptr, size_t raw_rdbmsDbPrivateMibOID_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbPrivateMibOID_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbPrivateMibOID_val_ptr_ptr) && (NULL != mib_rdbmsDbPrivateMibOID_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbPrivateMibOID_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbPrivateMibOID non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbPrivateMibOID_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbPrivateMibOID_val_ptr_ptr) || (*mib_rdbmsDbPrivateMibOID_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbPrivateMibOID_val_ptr_ptr = realloc( *mib_rdbmsDbPrivateMibOID_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbPrivateMibOID_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbPrivateMibOID_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbPrivateMibOID_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbPrivateMibOID_val_ptr_ptr, raw_rdbmsDbPrivateMibOID_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbPrivateMibOID_map */
+
+/**
+ * Extract the current value of the rdbmsDbPrivateMibOID data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbPrivateMibOID_val_ptr_ptr
+ *        Pointer to storage for a oid variable
+ * @param rdbmsDbPrivateMibOID_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbPrivateMibOID.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbPrivateMibOID_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbPrivateMibOID_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbPrivateMibOID_get( rdbmsDbTable_rowreq_ctx *rowreq_ctx, oid **rdbmsDbPrivateMibOID_val_ptr_ptr, size_t *rdbmsDbPrivateMibOID_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsDbPrivateMibOID_val_ptr_ptr) && (NULL != *rdbmsDbPrivateMibOID_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsDbPrivateMibOID_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbPrivateMibOID_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbPrivateMibOID data.
+ * set (* rdbmsDbPrivateMibOID_val_ptr_ptr ) and (* rdbmsDbPrivateMibOID_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsDbPrivateMibOID data
+     */
+    if ((NULL == (* rdbmsDbPrivateMibOID_val_ptr_ptr )) ||
+        ((* rdbmsDbPrivateMibOID_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsDbPrivateMibOID_len * sizeof((* rdbmsDbPrivateMibOID_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsDbPrivateMibOID data
+         */
+        (* rdbmsDbPrivateMibOID_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsDbPrivateMibOID_len * sizeof((* rdbmsDbPrivateMibOID_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsDbPrivateMibOID_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsDbPrivateMibOID_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsDbPrivateMibOID_len * sizeof((* rdbmsDbPrivateMibOID_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsDbPrivateMibOID_val_ptr_ptr ), rowreq_ctx->data.rdbmsDbPrivateMibOID, (* rdbmsDbPrivateMibOID_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbPrivateMibOID_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbEntry.rdbmsDbVendorName
+ * rdbmsDbVendorName is subid 3 of rdbmsDbEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.1.1.3
+ * Description:
+The name of the vendor whose RDBMS manages this database,
+           for informational purposes.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbVendorName.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbVendorName_map(char **mib_rdbmsDbVendorName_val_ptr_ptr, size_t *mib_rdbmsDbVendorName_val_ptr_len_ptr, char *raw_rdbmsDbVendorName_val_ptr, size_t raw_rdbmsDbVendorName_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbVendorName_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbVendorName_val_ptr_ptr) && (NULL != mib_rdbmsDbVendorName_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbVendorName_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbVendorName non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbVendorName_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbVendorName_val_ptr_ptr) || (*mib_rdbmsDbVendorName_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbVendorName_val_ptr_ptr = realloc( *mib_rdbmsDbVendorName_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbVendorName_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbVendorName_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbVendorName_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbVendorName_val_ptr_ptr, raw_rdbmsDbVendorName_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbVendorName_map */
+
+/**
+ * Extract the current value of the rdbmsDbVendorName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbVendorName_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsDbVendorName_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbVendorName.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbVendorName_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbVendorName_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbVendorName_get( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbVendorName_val_ptr_ptr, size_t *rdbmsDbVendorName_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsDbVendorName_val_ptr_ptr) && (NULL != *rdbmsDbVendorName_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsDbVendorName_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbVendorName_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbVendorName data.
+ * set (* rdbmsDbVendorName_val_ptr_ptr ) and (* rdbmsDbVendorName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsDbVendorName data
+     */
+    if ((NULL == (* rdbmsDbVendorName_val_ptr_ptr )) ||
+        ((* rdbmsDbVendorName_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsDbVendorName_len * sizeof((* rdbmsDbVendorName_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsDbVendorName data
+         */
+        (* rdbmsDbVendorName_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsDbVendorName_len * sizeof((* rdbmsDbVendorName_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsDbVendorName_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsDbVendorName_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsDbVendorName_len * sizeof((* rdbmsDbVendorName_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsDbVendorName_val_ptr_ptr ), rowreq_ctx->data.rdbmsDbVendorName, (* rdbmsDbVendorName_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbVendorName_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbEntry.rdbmsDbName
+ * rdbmsDbName is subid 4 of rdbmsDbEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.1.1.4
+ * Description:
+The name of this database, in a product specific format.  The
+           product may need to qualify the name in some way to resolve
+           conflicts if it is possible for a database name to be
+           duplicated on a host.  It might be necessary to construct a
+           hierarchical name embedding the RDBMS instance/installation
+           on the host, and/or the owner of the database.  For instance,
+           '/test-installation/database-owner/database-name'.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbName.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbName_map(char **mib_rdbmsDbName_val_ptr_ptr, size_t *mib_rdbmsDbName_val_ptr_len_ptr, char *raw_rdbmsDbName_val_ptr, size_t raw_rdbmsDbName_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbName_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbName_val_ptr_ptr) && (NULL != mib_rdbmsDbName_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbName_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbName non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbName_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbName_val_ptr_ptr) || (*mib_rdbmsDbName_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbName_val_ptr_ptr = realloc( *mib_rdbmsDbName_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbName_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbName_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbName_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbName_val_ptr_ptr, raw_rdbmsDbName_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbName_map */
+
+/**
+ * Extract the current value of the rdbmsDbName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbName_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsDbName_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbName.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbName_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbName_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbName_get( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbName_val_ptr_ptr, size_t *rdbmsDbName_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsDbName_val_ptr_ptr) && (NULL != *rdbmsDbName_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsDbName_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbName_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbName data.
+ * set (* rdbmsDbName_val_ptr_ptr ) and (* rdbmsDbName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsDbName data
+     */
+    if ((NULL == (* rdbmsDbName_val_ptr_ptr )) ||
+        ((* rdbmsDbName_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsDbName_len * sizeof((* rdbmsDbName_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsDbName data
+         */
+        (* rdbmsDbName_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsDbName_len * sizeof((* rdbmsDbName_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsDbName_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsDbName_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsDbName_len * sizeof((* rdbmsDbName_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsDbName_val_ptr_ptr ), rowreq_ctx->data.rdbmsDbName, (* rdbmsDbName_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbName_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbEntry.rdbmsDbContact
+ * rdbmsDbContact is subid 5 of rdbmsDbEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.39.1.1.1.5
+ * Description:
+The textual identification of the contact person for this
+           managed database, together with information on how to contact
+           this person.
+
+           Note: if there is no server associated with this database, an
+           agent may need to keep this in other persistent storage,
+           e.g., a configuration file.
+
+           Note that a compliant agent does not need to
+           allow write access to this object.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   1
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsDbContact.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsDbContact_map(char **mib_rdbmsDbContact_val_ptr_ptr, size_t *mib_rdbmsDbContact_val_ptr_len_ptr, char *raw_rdbmsDbContact_val_ptr, size_t raw_rdbmsDbContact_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsDbContact_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsDbContact_val_ptr_ptr) && (NULL != mib_rdbmsDbContact_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbContact_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsDbContact non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsDbContact_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsDbContact_val_ptr_ptr) || (*mib_rdbmsDbContact_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsDbContact_val_ptr_ptr = realloc( *mib_rdbmsDbContact_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsDbContact_val_ptr_ptr));
+        if(NULL == *mib_rdbmsDbContact_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsDbContact_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsDbContact_val_ptr_ptr, raw_rdbmsDbContact_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbContact_map */
+
+/**
+ * Extract the current value of the rdbmsDbContact data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbContact_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsDbContact_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsDbContact.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsDbContact_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsDbContact_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsDbContact_get( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbContact_val_ptr_ptr, size_t *rdbmsDbContact_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsDbContact_val_ptr_ptr) && (NULL != *rdbmsDbContact_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsDbContact_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbContact_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsDbContact data.
+ * set (* rdbmsDbContact_val_ptr_ptr ) and (* rdbmsDbContact_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsDbContact data
+     */
+    if ((NULL == (* rdbmsDbContact_val_ptr_ptr )) ||
+        ((* rdbmsDbContact_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsDbContact_len * sizeof((* rdbmsDbContact_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsDbContact data
+         */
+        (* rdbmsDbContact_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsDbContact_len * sizeof((* rdbmsDbContact_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsDbContact_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsDbContact_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsDbContact_len * sizeof((* rdbmsDbContact_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsDbContact_val_ptr_ptr ), rowreq_ctx->data.rdbmsDbContact, (* rdbmsDbContact_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsDbContact_get */
+
+
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_get.h b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_get.h
new file mode 100644 (file)
index 0000000..a4af810
--- /dev/null
@@ -0,0 +1,66 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable_data_get.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable_data_get.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBTABLE_DATA_GET_H
+#define RDBMSDBTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbTable is subid 1 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.1, length: 9
+*/
+    /*
+     * indexes
+     */
+    int rdbmsDbIndex_map(long *mib_rdbmsDbIndex_val_ptr, long raw_rdbmsDbIndex_val);
+
+    int rdbmsDbPrivateMibOID_map(oid **mib_rdbmsDbPrivateMibOID_val_ptr_ptr, size_t *mib_rdbmsDbPrivateMibOID_val_ptr_len_ptr, oid *raw_rdbmsDbPrivateMibOID_val_ptr, size_t raw_rdbmsDbPrivateMibOID_val_ptr_len, int allow_realloc);
+    int rdbmsDbPrivateMibOID_get( rdbmsDbTable_rowreq_ctx *rowreq_ctx, oid **rdbmsDbPrivateMibOID_val_ptr_ptr, size_t *rdbmsDbPrivateMibOID_val_ptr_len_ptr );
+    int rdbmsDbVendorName_map(char **mib_rdbmsDbVendorName_val_ptr_ptr, size_t *mib_rdbmsDbVendorName_val_ptr_len_ptr, char *raw_rdbmsDbVendorName_val_ptr, size_t raw_rdbmsDbVendorName_val_ptr_len, int allow_realloc);
+    int rdbmsDbVendorName_get( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbVendorName_val_ptr_ptr, size_t *rdbmsDbVendorName_val_ptr_len_ptr );
+    int rdbmsDbName_map(char **mib_rdbmsDbName_val_ptr_ptr, size_t *mib_rdbmsDbName_val_ptr_len_ptr, char *raw_rdbmsDbName_val_ptr, size_t raw_rdbmsDbName_val_ptr_len, int allow_realloc);
+    int rdbmsDbName_get( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbName_val_ptr_ptr, size_t *rdbmsDbName_val_ptr_len_ptr );
+    int rdbmsDbContact_map(char **mib_rdbmsDbContact_val_ptr_ptr, size_t *mib_rdbmsDbContact_val_ptr_len_ptr, char *raw_rdbmsDbContact_val_ptr, size_t raw_rdbmsDbContact_val_ptr_len, int allow_realloc);
+    int rdbmsDbContact_get( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char **rdbmsDbContact_val_ptr_ptr, size_t *rdbmsDbContact_val_ptr_len_ptr );
+
+
+int rdbmsDbTable_indexes_set_tbl_idx(rdbmsDbTable_mib_index *tbl_idx, long rdbmsDbIndex_val);
+int rdbmsDbTable_indexes_set(rdbmsDbTable_rowreq_ctx *rowreq_ctx, long rdbmsDbIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBTABLE_DATA_GET_H */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_set.c b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_set.c
new file mode 100644 (file)
index 0000000..5293811
--- /dev/null
@@ -0,0 +1,517 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable_data_set.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable_data_set.c,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ * 
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbTable is subid 1 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.1, length: 9
+*/
+    /*
+     * 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
+     *                        +==============+
+     *       +----------------||  object    ||
+     *       |              E ||  lookup    ||
+     *       |                +==============+
+     *       |                       | 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
+     *                        +--------------+
+     *                        |    post      |
+     *                        |   request    |
+     *                        +--------------+
+     *
+     */
+
+/**
+ * Setup up context with information needed to undo a set request.
+ *
+ * This function will be called before the individual node undo setup
+ * functions are called. If you need to do any undo setup that is not
+ * related to a specific column, you can do it here.
+ *
+ * Note that an individual node's undo_setup function will only be called
+ * if that node is being set to a new value.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in the node's undo_setup
+ * function, so it won't be done unless it is necessary.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the table context (rdbmsDbTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR   : error. set will fail.
+ */
+int
+rdbmsDbTable_undo_setup( rdbmsDbTable_rowreq_ctx *rowreq_ctx)
+{
+    int rc = MFD_SUCCESS;
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_undo_setup","called\n"));
+
+    /** we should have a non-NULL pointer */
+    netsnmp_assert( NULL != rowreq_ctx );
+
+    /*
+     * TODO:451:M: |-> Setup rdbmsDbTable undo.
+     * set up rdbmsDbTable undo information, in preparation for a set.
+     */
+
+    return rc;
+} /* rdbmsDbTable_undo_setup */
+
+/**
+ * Cleanup up context undo information.
+ *
+ * This function will be called after set/commit processing. If you
+ * allocated any resources in undo_setup, this is the place to release
+ * those resources.
+ *
+ * This function is called regardless of the success or failure of the set
+ * request. If you need to perform different steps for cleanup depending
+ * on success or failure, you can add a flag to the rowreq_ctx.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the table context (rdbmsDbTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR   : error
+ */
+int
+rdbmsDbTable_undo_cleanup( rdbmsDbTable_rowreq_ctx *rowreq_ctx)
+{
+    int rc = MFD_SUCCESS;
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_undo_cleanup","called\n"));
+
+    /** we should have a non-NULL pointer */
+    netsnmp_assert( NULL != rowreq_ctx );
+
+    /*
+     * TODO:452:M: |-> Cleanup rdbmsDbTable undo.
+     */
+
+    return rc;
+} /* rdbmsDbTable_undo_cleanup */
+
+/**
+ * commit new values.
+ *
+ * At this point, you should have done everything you can to ensure that
+ * this commit will not fail.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the FLAG_* bits can be found in
+ * rdbmsDbTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rdbmsDbTable_rowreq_ctx
+ *        Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR   : error
+ */
+int
+rdbmsDbTable_commit( rdbmsDbTable_rowreq_ctx *rowreq_ctx)
+{
+    int rc = MFD_SUCCESS;
+    int             save_flags;
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_commit","called\n"));
+
+    /** we should have a non-NULL pointer */
+    netsnmp_assert( NULL != rowreq_ctx );
+
+    /*
+     * save flags, then clear until we actually do something
+     */
+    save_flags = rowreq_ctx->column_set_flags;
+    rowreq_ctx->column_set_flags = 0;
+
+    /*
+     * commit rdbmsDbTable data
+     * 1) check the column's flag in save_flags to see if it was set.
+     * 2) clear the flag when you handle that column
+     * 3) set the column's flag in column_set_flags if it needs undo
+     *    processing in case of a failure.
+     */
+    if (save_flags & FLAG_RDBMSDBCONTACT) {
+       save_flags &= ~FLAG_RDBMSDBCONTACT; /* clear rdbmsDbContact */
+       /*
+        * TODO:482:o: |-> commit column rdbmsDbContact.
+        */
+       rc = -1;
+       if(-1 == rc) {
+           snmp_log(LOG_ERR,"rdbmsDbTable column rdbmsDbContact commit failed\n");
+       }
+       else {
+            /*
+             * set flag, in case we need to undo rdbmsDbContact
+             */
+            rowreq_ctx->column_set_flags |= FLAG_RDBMSDBCONTACT;
+       }
+    }
+
+    if (save_flags) {
+       snmp_log(LOG_ERR, "unhandled columns (0x%x) in commit\n", save_flags);
+       return MFD_ERROR;
+    }
+
+    return rc;
+} /* rdbmsDbTable_commit */
+
+/**
+ * undo commit new values.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the FLAG_* bits can be found in
+ * rdbmsDbTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @param rdbmsDbTable_rowreq_ctx
+ *        Pointer to the users context.
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR   : error
+ */
+int
+rdbmsDbTable_undo_commit( rdbmsDbTable_rowreq_ctx *rowreq_ctx)
+{
+    int rc = MFD_SUCCESS;
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_undo_commit","called\n"));
+
+    /** we should have a non-NULL pointer */
+    netsnmp_assert( NULL != rowreq_ctx );
+
+    /*
+     * TODO:485:M: |-> Undo rdbmsDbTable commit.
+     * check the column's flag in rowreq_ctx->column_set_flags to see
+     * if it was set during commit, then undo it.
+     *
+     * eg: if (rowreq_ctx->column_set_flags & FLAG_) {}
+     */
+
+    return rc;
+} /* rdbmsDbTable_undo_commit */
+
+/*
+ * TODO:420:r: Implement rdbmsDbTable index validation.
+ */
+/*
+ * TODO:440:M: Implement rdbmsDbTable node value checks.
+ * TODO:450:M: Implement rdbmsDbTable undo functions.
+ * TODO:460:M: Implement rdbmsDbTable set functions.
+ * TODO:480:M: Implement rdbmsDbTable commit functions.
+ */
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsDbEntry.rdbmsDbContact
+ * rdbmsDbContact is subid 5 of rdbmsDbEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.39.1.1.1.5
+ * Description:
+The textual identification of the contact person for this
+           managed database, together with information on how to contact
+           this person.
+
+           Note: if there is no server associated with this database, an
+           agent may need to keep this in other persistent storage,
+           e.g., a configuration file.
+
+           Note that a compliant agent does not need to
+           allow write access to this object.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   1
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * Check that the proposed new value is potentially valid.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsDbContact_val_ptr
+ *        A char containing the new value.
+ * @param rdbmsDbContact_val_ptr_len
+ *        The size (in bytes) of the data pointed to by rdbmsDbContact_val_ptr
+ *
+ * @retval MFD_SUCCESS        : incoming value is legal
+ * @retval MFD_NOT_VALID_NOW  : incoming value is not valid now
+ * @retval MFD_NOT_VALID_EVER : incoming value is never valid
+ *
+ * This is the place to check for requirements that are not
+ * expressed in the mib syntax (for example, a requirement that
+ * is detailed in the description for an object).
+ *
+ * You should check that the requested change between the undo value and the
+ * new value is legal (ie, the transistion from one value to another
+ * is legal).
+ *      
+ *@note
+ * This check is only to determine if the new value
+ * is \b potentially valid. This is the first check of many, and
+ * is one of the simplest ones.
+ * 
+ *@note
+ * this is not the place to do any checks for values
+ * which depend on some other value in the mib. Those
+ * types of checks should be done in the
+ * rdbmsDbTable_check_dependencies() function.
+ *
+ * The following checks have already been done for you:
+ *    The syntax is ASN_OCTET_STR
+ *    The length is in (one of) the range set(s):  0 - 255
+ *
+ * If there a no other checks you need to do, simply return MFD_SUCCESS.
+ *
+ */
+int
+rdbmsDbContact_check_value( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char *rdbmsDbContact_val_ptr,  size_t rdbmsDbContact_val_ptr_len)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbContact_check_value","called\n"));
+
+    /** should never get a NULL pointer */
+    netsnmp_assert(NULL != rowreq_ctx);
+    netsnmp_assert(NULL != rdbmsDbContact_val_ptr);
+
+    /*
+     * TODO:441:o: |-> Check for valid rdbmsDbContact value.
+     */
+
+    return MFD_SUCCESS; /* rdbmsDbContact value not illegal */
+} /* rdbmsDbContact_check_value */
+
+/**
+ * Save old value information
+ *
+ * @param rowreq_ctx
+ *        Pointer to the table context (rdbmsDbTable_rowreq_ctx)
+ *
+ * @retval MFD_SUCCESS : success
+ * @retval MFD_ERROR   : error. set will fail.
+ *
+ * This function will be called after the table level undo setup function
+ * rdbmsDbTable_undo_setup has been called.
+ *
+ *@note
+ * this function will only be called if a new value is set for this column.
+ *
+ * If there is any setup specific to a particular column (e.g. allocating
+ * memory for a string), you should do that setup in this function, so it
+ * won't be done unless it is necessary.
+ */
+int
+rdbmsDbContact_undo_setup( rdbmsDbTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbContact_undo_setup","called\n"));
+
+    /** should never get a NULL pointer */
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:455:o: |-> Setup rdbmsDbContact undo.
+     */
+    /*
+     * copy rdbmsDbContact and rdbmsDbContact_len data
+     * set rowreq_ctx->undo->rdbmsDbContact from rowreq_ctx->data.rdbmsDbContact
+     */
+    memcpy( rowreq_ctx->undo->rdbmsDbContact, rowreq_ctx->data.rdbmsDbContact,
+            (rowreq_ctx->data.rdbmsDbContact_len * sizeof(rowreq_ctx->undo->rdbmsDbContact[0])));
+    rowreq_ctx->undo->rdbmsDbContact_len = rowreq_ctx->data.rdbmsDbContact_len;
+
+
+    return MFD_SUCCESS;
+} /* rdbmsDbContact_undo_setup */
+
+/**
+ * Set the new value.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the users context. You should know how to
+ *        manipulate the value from this object.
+ * @param rdbmsDbContact_val_ptr
+ *        A char containing the new value.
+ * @param rdbmsDbContact_val_ptr_len
+ *        The size (in bytes) of the data pointed to by rdbmsDbContact_val_ptr
+ */
+int
+rdbmsDbContact_set( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char *rdbmsDbContact_val_ptr,  size_t rdbmsDbContact_val_ptr_len )
+{
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbContact_set","called\n"));
+
+    /** should never get a NULL pointer */
+    netsnmp_assert(NULL != rowreq_ctx);
+    netsnmp_assert(NULL != rdbmsDbContact_val_ptr);
+
+/*
+ * TODO:245:o: |-> Implement rdbmsDbContact reverse mapping.
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them here.
+ */
+    /*
+     * TODO:461:M: |-> Set rdbmsDbContact value.
+     * set rdbmsDbContact value in rowreq_ctx->data
+     */
+    memcpy( rowreq_ctx->data.rdbmsDbContact, rdbmsDbContact_val_ptr, rdbmsDbContact_val_ptr_len );
+    rowreq_ctx->data.rdbmsDbContact_len = rdbmsDbContact_val_ptr_len / sizeof(rdbmsDbContact_val_ptr[0]);
+
+    return MFD_SUCCESS;
+} /* rdbmsDbContact_set */
+
+/**
+ * undo the previous set.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the users context.
+ */
+int
+rdbmsDbContact_undo( rdbmsDbTable_rowreq_ctx *rowreq_ctx)
+{
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbContact_undo","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:456:o: |-> Clean up rdbmsDbContact undo.
+     */
+    /*
+     * copy rdbmsDbContact and rdbmsDbContact_len data
+     * set rowreq_ctx->data.rdbmsDbContact from rowreq_ctx->undo->rdbmsDbContact
+     */
+    memcpy( rowreq_ctx->data.rdbmsDbContact, rowreq_ctx->undo->rdbmsDbContact,
+            (rowreq_ctx->undo->rdbmsDbContact_len * sizeof(rowreq_ctx->data.rdbmsDbContact[0])));
+    rowreq_ctx->data.rdbmsDbContact_len = rowreq_ctx->undo->rdbmsDbContact_len;
+
+    
+    return MFD_SUCCESS;
+} /* rdbmsDbContact_undo */
+
+/**
+ * check dependencies
+ *
+ * This is useful for for tables which have dependencies between columns
+ * (or rows, or tables). For example, two columns allocating a percentage
+ * of something add up 100%.
+ *
+ * Should you need different behavior depending on which columns were
+ * set, rowreq_ctx->column_set_flags will indicate which writeable columns were
+ * set. The definitions for the FLAG_* bits can be found in
+ * rdbmsDbTable_oids.h.
+ * A new row will have the MFD_ROW_CREATED bit set in rowreq_flags.
+ *
+ * @retval MFD_SUCCESS all the changes to the row are legal
+ * @retval MFD_ERROR   one or more changes are not legal
+ *
+ * (see README-table-rdbmsDbTable if you don't have dependencies)
+ */
+int
+rdbmsDbTable_check_dependencies(rdbmsDbTable_rowreq_ctx *rowreq_ctx)
+{
+    int rc = MFD_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsDbTable:rdbmsDbTable_check_dependencies","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:470:o: Check rdbmsDbTable row dependencies.
+     * check that all new value are legal and consistent with each other
+     */
+    return rc;
+} /* rdbmsDbTable_check_dependencies */
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_set.h b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_data_set.h
new file mode 100644 (file)
index 0000000..06cd026
--- /dev/null
@@ -0,0 +1,77 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable_data_set.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable_data_set.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBTABLE_DATA_SET_H
+#define RDBMSDBTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbTable is subid 1 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.1, length: 9
+*/
+int rdbmsDbIndex_check_index( rdbmsDbTable_rowreq_ctx *rowreq_ctx ); /* internal */
+
+
+int rdbmsDbTable_undo_setup( rdbmsDbTable_rowreq_ctx *rowreq_ctx);
+int rdbmsDbTable_undo_cleanup( rdbmsDbTable_rowreq_ctx *rowreq_ctx);
+int rdbmsDbTable_commit( rdbmsDbTable_rowreq_ctx *rowreq_ctx);
+int rdbmsDbTable_undo_commit( rdbmsDbTable_rowreq_ctx *rowreq_ctx);
+
+
+int rdbmsDbPrivateMibOID_check_value( rdbmsDbTable_rowreq_ctx *rowreq_ctx, oid *rdbmsDbPrivateMibOID_val_ptr,  size_t rdbmsDbPrivateMibOID_val_ptr_len);
+int rdbmsDbPrivateMibOID_undo_setup( rdbmsDbTable_rowreq_ctx *rowreq_ctx );
+int rdbmsDbPrivateMibOID_set( rdbmsDbTable_rowreq_ctx *rowreq_ctx, oid *rdbmsDbPrivateMibOID_val_ptr,  size_t rdbmsDbPrivateMibOID_val_ptr_len );
+int rdbmsDbPrivateMibOID_undo( rdbmsDbTable_rowreq_ctx *rowreq_ctx );
+
+int rdbmsDbVendorName_check_value( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char *rdbmsDbVendorName_val_ptr,  size_t rdbmsDbVendorName_val_ptr_len);
+int rdbmsDbVendorName_undo_setup( rdbmsDbTable_rowreq_ctx *rowreq_ctx );
+int rdbmsDbVendorName_set( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char *rdbmsDbVendorName_val_ptr,  size_t rdbmsDbVendorName_val_ptr_len );
+int rdbmsDbVendorName_undo( rdbmsDbTable_rowreq_ctx *rowreq_ctx );
+
+int rdbmsDbName_check_value( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char *rdbmsDbName_val_ptr,  size_t rdbmsDbName_val_ptr_len);
+int rdbmsDbName_undo_setup( rdbmsDbTable_rowreq_ctx *rowreq_ctx );
+int rdbmsDbName_set( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char *rdbmsDbName_val_ptr,  size_t rdbmsDbName_val_ptr_len );
+int rdbmsDbName_undo( rdbmsDbTable_rowreq_ctx *rowreq_ctx );
+
+int rdbmsDbContact_check_value( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char *rdbmsDbContact_val_ptr,  size_t rdbmsDbContact_val_ptr_len);
+int rdbmsDbContact_undo_setup( rdbmsDbTable_rowreq_ctx *rowreq_ctx );
+int rdbmsDbContact_set( rdbmsDbTable_rowreq_ctx *rowreq_ctx, char *rdbmsDbContact_val_ptr,  size_t rdbmsDbContact_val_ptr_len );
+int rdbmsDbContact_undo( rdbmsDbTable_rowreq_ctx *rowreq_ctx );
+
+
+int rdbmsDbTable_check_dependencies(rdbmsDbTable_rowreq_ctx *ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBTABLE_DATA_SET_H */
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_enums.h b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_enums.h
new file mode 100644 (file)
index 0000000..676d383
--- /dev/null
@@ -0,0 +1,47 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable_enums.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable_enums.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBTABLE_ENUMS_H
+#define RDBMSDBTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table rdbmsDbTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBTABLE_ENUMS_H */
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_interface.c b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_interface.c
new file mode 100644 (file)
index 0000000..8711c2c
--- /dev/null
@@ -0,0 +1,1238 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable_interface.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable_interface.c,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsDbTable.h"
+#include "rdbmsDbTable_interface.h"
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsDbTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsDbTable is subid 1 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.1, length: 9
+*/
+typedef struct rdbmsDbTable_interface_ctx_s {
+
+   netsnmp_container              *container;
+   netsnmp_cache                  *cache; /* optional cache */
+
+   rdbmsDbTable_registration_ptr      user_ctx;
+   
+   netsnmp_table_registration_info  tbl_info;
+
+   netsnmp_baby_steps_access_methods access_multiplexer;
+
+} rdbmsDbTable_interface_ctx;
+
+static rdbmsDbTable_interface_ctx rdbmsDbTable_if_ctx;
+
+static void _rdbmsDbTable_container_init(
+    rdbmsDbTable_interface_ctx *if_ctx);
+
+
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_pre_request;
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_post_request;
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_get_values;
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_check_objects;
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_undo_setup;
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_set_values;
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_undo_cleanup;
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_undo_values;
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_commit;
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_undo_commit;
+static Netsnmp_Node_Handler _mfd_rdbmsDbTable_check_dependencies;
+
+NETSNMP_STATIC_INLINE int _rdbmsDbTable_undo_column( rdbmsDbTable_rowreq_ctx *rowreq_ctx,
+                                                   netsnmp_variable_list *var, int column );
+
+rdbmsDbTable_data *rdbmsDbTable_allocate_data(void);
+void rdbmsDbTable_release_data(rdbmsDbTable_data *data);
+
+/**
+ * @internal
+ * Initialize the table rdbmsDbTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+_rdbmsDbTable_initialize_interface(rdbmsDbTable_registration_ptr reg_ptr,  u_long flags)
+{
+    netsnmp_baby_steps_access_methods *access_multiplexer =
+        &rdbmsDbTable_if_ctx.access_multiplexer;
+    netsnmp_table_registration_info *tbl_info = &rdbmsDbTable_if_ctx.tbl_info;
+    netsnmp_handler_registration *reginfo;
+    netsnmp_mib_handler *handler;
+    int    mfd_modes = 0;
+
+    DEBUGMSGTL(("internal:rdbmsDbTable:_rdbmsDbTable_initialize_interface","called\n"));
+
+
+    /*************************************************
+     *
+     * save interface context for rdbmsDbTable
+     */
+    /*
+     * Setting up the table's definition
+     */
+    netsnmp_table_helper_add_indexes(tbl_info,
+                                  ASN_INTEGER, /** index: rdbmsDbIndex */
+                             0);
+
+    /*  Define the minimum and maximum accessible columns.  This
+        optimizes retrival. */
+    tbl_info->min_column = RDBMSDBTABLE_MIN_COL;
+    tbl_info->max_column = RDBMSDBTABLE_MAX_COL;
+
+    /*
+     * save users context
+     */
+    rdbmsDbTable_if_ctx.user_ctx = reg_ptr;
+
+    /*
+     * call data access initialization code
+     */
+    rdbmsDbTable_init_data(reg_ptr);
+
+    /*
+     * set up the container
+     */
+    _rdbmsDbTable_container_init(&rdbmsDbTable_if_ctx);
+    if (NULL == rdbmsDbTable_if_ctx.container) {
+        snmp_log(LOG_ERR,"could not initialize container for rdbmsDbTable\n");
+        return;
+    }
+    
+    /*
+     * access_multiplexer: REQUIRED wrapper for get request handling
+     */
+    access_multiplexer->object_lookup = _mfd_rdbmsDbTable_object_lookup;
+    access_multiplexer->get_values = _mfd_rdbmsDbTable_get_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->pre_request = _mfd_rdbmsDbTable_pre_request;
+    access_multiplexer->post_request = _mfd_rdbmsDbTable_post_request;
+
+
+    /*
+     * REQUIRED wrappers for set request handling
+     */
+    access_multiplexer->object_syntax_checks = _mfd_rdbmsDbTable_check_objects;
+    access_multiplexer->undo_setup = _mfd_rdbmsDbTable_undo_setup;
+    access_multiplexer->undo_cleanup = _mfd_rdbmsDbTable_undo_cleanup;
+    access_multiplexer->set_values = _mfd_rdbmsDbTable_set_values;
+    access_multiplexer->undo_sets = _mfd_rdbmsDbTable_undo_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->commit = _mfd_rdbmsDbTable_commit;
+    access_multiplexer->undo_commit = _mfd_rdbmsDbTable_undo_commit;
+    
+    /*
+     * REQUIRED for tables with dependencies
+     */
+    access_multiplexer->consistency_checks = _mfd_rdbmsDbTable_check_dependencies;
+
+    /*************************************************
+     *
+     * Create a registration, save our reg data, register table.
+     */
+    DEBUGMSGTL(("rdbmsDbTable:init_rdbmsDbTable",
+                "Registering rdbmsDbTable as a mibs-for-dummies table.\n"));            
+    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+    reginfo = netsnmp_handler_registration_create("rdbmsDbTable", handler,
+                                                  rdbmsDbTable_oid,
+                                                  rdbmsDbTable_oid_size,
+                                                  HANDLER_CAN_BABY_STEP |
+                                                  HANDLER_CAN_RWRITE
+                                                  );
+    if(NULL == reginfo) {
+        snmp_log(LOG_ERR,"error registering table rdbmsDbTable\n");
+        return;
+    }
+    reginfo->my_reg_void = &rdbmsDbTable_if_ctx;
+
+    /*************************************************
+     *
+     * set up baby steps handler, create it and inject it
+     */
+    if( access_multiplexer->object_lookup )
+        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+    if( access_multiplexer->set_values )
+        mfd_modes |= BABY_STEP_SET_VALUES;
+    if( access_multiplexer->irreversible_commit )
+        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+    if( access_multiplexer->object_syntax_checks )
+        mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+    if( access_multiplexer->pre_request )
+        mfd_modes |= BABY_STEP_PRE_REQUEST;
+    if( access_multiplexer->post_request )
+        mfd_modes |= BABY_STEP_POST_REQUEST;
+    
+    if( access_multiplexer->undo_setup )
+        mfd_modes |= BABY_STEP_UNDO_SETUP;
+    if( access_multiplexer->undo_cleanup )
+        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+    if( access_multiplexer->undo_sets )
+        mfd_modes |= BABY_STEP_UNDO_SETS;
+    
+    if( access_multiplexer->row_creation )
+        mfd_modes |= BABY_STEP_ROW_CREATE;
+    if( access_multiplexer->consistency_checks )
+        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+    if( access_multiplexer->commit )
+        mfd_modes |= BABY_STEP_COMMIT;
+    if( access_multiplexer->undo_commit )
+        mfd_modes |= BABY_STEP_UNDO_COMMIT;
+    
+    handler = netsnmp_baby_steps_handler_get(mfd_modes);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+     */
+    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject container_table helper
+     */
+    handler =
+        netsnmp_container_table_handler_get(tbl_info,
+                                            rdbmsDbTable_if_ctx.container,
+                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+    netsnmp_inject_handler( reginfo, handler );
+
+    /*************************************************
+     *
+     * inject cache helper
+     */
+    if(NULL != rdbmsDbTable_if_ctx.cache) {
+        handler = netsnmp_cache_handler_get(rdbmsDbTable_if_ctx.cache);
+        netsnmp_inject_handler( reginfo, handler );
+    }
+
+    /*
+     * register table
+     */
+    netsnmp_register_table(reginfo, tbl_info);
+} /* _rdbmsDbTable_initialize_interface */
+
+void
+rdbmsDbTable_valid_columns_set(netsnmp_column_info *vc)
+{
+    rdbmsDbTable_if_ctx.tbl_info.valid_columns = vc;
+} /* rdbmsDbTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+rdbmsDbTable_index_to_oid(netsnmp_index *oid_idx,
+                         rdbmsDbTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_rdbmsDbIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_index_to_oid","called\n"));
+
+        /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_rdbmsDbIndex, (u_char*)&mib_idx->rdbmsDbIndex,
+                       sizeof(mib_idx->rdbmsDbIndex));
+
+
+    err = build_oid_noalloc(oid_idx->oids, oid_idx->len, (size_t *)&oid_idx->len,
+                           NULL, 0, &var_rdbmsDbIndex);
+    if(err)
+        snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_rdbmsDbIndex );
+
+    return err;
+} /* rdbmsDbTable_index_to_oid */
+
+/**
+ * extract rdbmsDbTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR  : no error
+ * @retval SNMP_ERR_GENERR   : error
+ */
+int
+rdbmsDbTable_index_from_oid(netsnmp_index *oid_idx,
+                         rdbmsDbTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_rdbmsDbIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_index_from_oid","called\n"));
+
+    /*
+     * parse the oid into the individual index components
+     */
+    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+                             &var_rdbmsDbIndex );
+    if (err == SNMP_ERR_NOERROR) {
+        /*
+         * copy out values
+         */
+    mib_idx->rdbmsDbIndex = *((long *)var_rdbmsDbIndex.val.string);
+
+
+    }
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_rdbmsDbIndex );
+
+    return err;
+} /* rdbmsDbTable_index_from_oid */
+
+
+/*
+ * rdbmsDbTable_allocate_data
+ *
+ * Purpose: create new rdbmsDbTable_data.
+ */
+rdbmsDbTable_data *
+rdbmsDbTable_allocate_data(void)
+{
+    rdbmsDbTable_data *rtn = SNMP_MALLOC_TYPEDEF(rdbmsDbTable_data);
+
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_allocate_data","called\n"));
+
+    if(NULL == rtn) {
+        snmp_log(LOG_ERR, "unable to malloc memory for new "
+                 "rdbmsDbTable_data.\n");
+    }
+
+    return rtn;
+} /* rdbmsDbTable_allocate_data */
+
+/*
+ * rdbmsDbTable_release_data
+ *
+ * Purpose: release rdbmsDbTable data.
+ */
+void
+rdbmsDbTable_release_data(rdbmsDbTable_data *data)
+{
+    DEBUGMSGTL(("verbose:rdbmsDbTable:rdbmsDbTable_release_data","called\n"));
+
+    free(data);
+} /* rdbmsDbTable_release_data */
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a rdbmsDbTable_rowreq_ctx
+ */
+rdbmsDbTable_rowreq_ctx *
+rdbmsDbTable_allocate_rowreq_ctx(void)
+{
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx =
+                  SNMP_MALLOC_TYPEDEF(rdbmsDbTable_rowreq_ctx);
+
+    DEBUGMSGTL(("internal:rdbmsDbTable:rdbmsDbTable_allocate_rowreq_ctx","called\n"));
+
+    if(NULL == rowreq_ctx) {
+        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+                 "rdbmsDbTable_rowreq_ctx.\n");
+    }
+
+    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+    rowreq_ctx->rdbmsDbTable_data_list = NULL;
+    rowreq_ctx->rdbmsDbTable_reg = rdbmsDbTable_if_ctx.user_ctx;
+
+
+    return rowreq_ctx;
+} /* rdbmsDbTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a rdbmsDbTable_rowreq_ctx
+ */
+void
+rdbmsDbTable_release_rowreq_ctx(rdbmsDbTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsDbTable:rdbmsDbTable_release_rowreq_ctx","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+
+    if(rowreq_ctx->undo)
+        rdbmsDbTable_release_data(rowreq_ctx->undo);
+    /*
+     * free index oid pointer
+     */
+    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+        free(rowreq_ctx->oid_idx.oids);
+
+    SNMP_FREE(rowreq_ctx);
+} /* rdbmsDbTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbTable_pre_request(netsnmp_mib_handler *handler,
+                            netsnmp_handler_registration *reginfo,
+                            netsnmp_agent_request_info *agtreq_info,
+                            netsnmp_request_info *requests)
+{
+    int rc = rdbmsDbTable_pre_request(rdbmsDbTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsDbTable","error %d from "
+                    "rdbmsDbTable_pre_request\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbTable_post_request(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx;
+    int rc = rdbmsDbTable_post_request(rdbmsDbTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsDbTable","error %d from "
+                    "rdbmsDbTable_post_request\n", rc));
+    }
+    
+    /*
+     * if there are no errors, check for and handle row creation/deletion
+     */
+    rc = netsnmp_check_requests_error(requests);
+    if ((SNMP_ERR_NOERROR == rc) &&
+        (NULL !=
+         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
+        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+            CONTAINER_INSERT(rdbmsDbTable_if_ctx.container, rowreq_ctx);
+        }
+        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+            CONTAINER_REMOVE(rdbmsDbTable_if_ctx.container, rowreq_ctx);
+            rdbmsDbTable_release_rowreq_ctx(rowreq_ctx);
+        }
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsDbTable_object_lookup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    
+    DEBUGMSGTL(("internal:rdbmsDbTable:_mfd_rdbmsDbTable_object_lookup","called\n"));
+
+    /*
+     * get our context from mfd
+     * rdbmsDbTable_interface_ctx *if_ctx =
+     *             (rdbmsDbTable_interface_ctx *)reginfo->my_reg_void;
+     */
+
+    if(NULL == rowreq_ctx) {
+        netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
+    }
+    else {
+        rdbmsDbTable_row_prep(rowreq_ctx);
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsDbTable_get_column( rdbmsDbTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsDbTable:_mfd_rdbmsDbTable_get_column","called\n"));
+
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsDbPrivateMibOID(2)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h */
+    case COLUMN_RDBMSDBPRIVATEMIBOID:
+    var->type = ASN_OBJECT_ID;
+rc = rdbmsDbPrivateMibOID_get(rowreq_ctx, (oid **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsDbVendorName(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+    case COLUMN_RDBMSDBVENDORNAME:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsDbVendorName_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsDbName(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+    case COLUMN_RDBMSDBNAME:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsDbName_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsDbContact(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+    case COLUMN_RDBMSDBCONTACT:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsDbContact_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _rdbmsDbTable_get_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _rdbmsDbTable_get_column */
+
+int
+_mfd_rdbmsDbTable_get_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    u_char                     * old_string;
+    void                      (*dataFreeHook)(void *);
+    int                        rc;
+
+    DEBUGMSGTL(("internal:rdbmsDbTable:_mfd_rdbmsDbTable_get_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * save old pointer, so we can free it if replaced
+         */
+        old_string = requests->requestvb->val.string;
+        dataFreeHook = requests->requestvb->dataFreeHook;
+        if(NULL == requests->requestvb->val.string) {
+            requests->requestvb->val.string = requests->requestvb->buf;
+            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+        else if(requests->requestvb->buf == requests->requestvb->val.string) {
+            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+
+        /*
+         * get column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _rdbmsDbTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            if(MFD_SKIP == rc) {
+                requests->requestvb->type = ASN_PRIV_RETRY;
+                rc = SNMP_ERR_NOERROR;
+            }
+        }
+        else if (NULL == requests->requestvb->val.string) {
+            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+            rc = SNMP_ERR_GENERR;
+        }
+        if(rc)
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+        /*
+         * if the buffer wasn't used previously for the old data (i.e. it
+         * was allcoated memory)  and the get routine replaced the pointer,
+         * we need to free the previous pointer.
+         */
+        if(old_string && (old_string != requests->requestvb->buf) &&
+           (requests->requestvb->val.string != old_string)) {
+            if(dataFreeHook)
+                (*dataFreeHook)(old_string);
+            else
+                free(old_string);
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Syntax checks
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check the syntax for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsDbTable_check_column( rdbmsDbTable_rowreq_ctx *rowreq_ctx,
+                         netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsDbTable:_rdbmsDbTable_check_column","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsDbContact(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+    case COLUMN_RDBMSDBCONTACT:
+    rc = netsnmp_check_vb_type( var, ASN_OCTET_STR );
+    if(SNMPERR_SUCCESS == rc) {
+    /* check that the value is in the defined range(s); inefficent
+     * but keeps rc value knowledge in libarary where it belongs. */
+    if( 1
+       && ((rc = netsnmp_check_vb_size_range(var, 0,255)) != SNMP_ERR_NOERROR)
+     ) {
+        ; /* rc set in condition */
+    }
+   }
+    if(SNMPERR_SUCCESS == rc) {
+        rc = rdbmsDbContact_check_value( rowreq_ctx, (char *)var->val.string, var->val_len );
+        if((MFD_SUCCESS != rc) && (MFD_NOT_VALID_EVER != rc) &&
+           (MFD_NOT_VALID_NOW != rc)) {
+            snmp_log(LOG_ERR, "bad rc %d from rdbmsDbContact_check_value\n", rc);
+            rc = SNMP_ERR_GENERR;
+        }
+    }
+        break;
+
+        default: /** We shouldn't get here */
+            rc = SNMP_ERR_GENERR;
+            snmp_log(LOG_ERR, "unknown column %d in _rdbmsDbTable_check_column\n", column);
+    }
+
+    return rc;
+} /* _rdbmsDbTable_check_column */
+
+int
+_mfd_rdbmsDbTable_check_objects(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    int                          rc;
+
+    DEBUGMSGTL(("internal:rdbmsDbTable:_mfd_rdbmsDbTable_check_objects","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+
+        /*
+         * get column number from table request info, and check that column
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+
+        rc = _rdbmsDbTable_check_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+            break;
+        }
+
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbTable_check_objects */
+
+
+
+/*----------------------------------------------------------------------
+ *
+ * SET: check dependencies
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Check dependencies wrapper
+ */
+static int
+_mfd_rdbmsDbTable_check_dependencies(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    int                    rc;
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    DEBUGMSGTL(("internal:rdbmsDbTable:_mfd_rdbmsDbTable_check_dependencies","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    rc = rdbmsDbTable_check_dependencies(rowreq_ctx);
+    if(rc){
+        DEBUGMSGTL(("verbose:rdbmsDbTable:mfd","error %d from "
+                    "rdbmsDbTable_check_dependencies\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbTable_check_dependencies */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo setup
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsDbTable_undo_setup_column( rdbmsDbTable_rowreq_ctx *rowreq_ctx, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsDbTable:_rdbmsDbTable_undo_setup_column","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsDbContact(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+    case COLUMN_RDBMSDBCONTACT:
+        rowreq_ctx->column_set_flags |= FLAG_RDBMSDBCONTACT;
+        rc = rdbmsDbContact_undo_setup(rowreq_ctx );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _rdbmsDbTable_undo_setup_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _rdbmsDbTable_undo_setup_column */
+
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_rdbmsDbTable_undo_setup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    int                    rc;
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+
+    DEBUGMSGTL(("internal:rdbmsDbTable:_mfd_rdbmsDbTable_undo_setup","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * allocate undo context
+     */
+    rowreq_ctx->undo = rdbmsDbTable_allocate_data();
+    if(NULL == rowreq_ctx->undo) {
+        /** msg already logged */
+        netsnmp_request_set_error_all(requests, SNMP_ERR_RESOURCEUNAVAILABLE);
+        return SNMP_ERR_NOERROR;
+    }
+
+    /*
+     * row undo setup
+     */
+    rowreq_ctx->column_set_flags = 0;
+    rc = rdbmsDbTable_undo_setup(rowreq_ctx);
+    if (MFD_SUCCESS != rc)  {
+        DEBUGMSGTL(("verbose:rdbmsDbTable:mfd","error %d from "
+                    "rdbmsDbTable_undo_setup\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    else {
+        /*
+         * column undo setup
+         */
+        netsnmp_table_request_info * tri;
+        for(;requests; requests = requests->next) {
+            /*
+             * set column data
+             */
+            tri = netsnmp_extract_table_info(requests);
+            if(NULL == tri)
+                continue;
+            
+            rc = _rdbmsDbTable_undo_setup_column(rowreq_ctx, tri->colnum);
+            if(MFD_SUCCESS != rc)  {
+                DEBUGMSGTL(("verbose:rdbmsDbTable:mfd","error %d from "
+                            "rdbmsDbTable_undo_setup_column\n", rc));
+                netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+            }
+        } /* for results */
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbTable_undo_setup */
+
+/**
+ * @internal
+ * undo setup
+ */
+int
+_mfd_rdbmsDbTable_undo_cleanup(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    int rc;
+
+    DEBUGMSGTL(("internal:rdbmsDbTable:_mfd_rdbmsDbTable_undo_cleanup","called\n"));
+
+    /*
+     * failed row create in early stages has no rowreq_ctx
+     */
+    if (NULL == rowreq_ctx)
+        return MFD_SUCCESS;
+
+    /*
+     * call user cleanup
+     */
+    rc = rdbmsDbTable_undo_cleanup(rowreq_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("verbose:rdbmsDbTable:mfd","error %d from "
+                    "rdbmsDbTable_undo_cleanup\n", rc));
+    }
+
+    /*
+     * release undo context, if needed
+     */
+    if(rowreq_ctx->undo) {
+         rdbmsDbTable_release_data(rowreq_ctx->undo);
+         rowreq_ctx->undo = NULL;
+    }
+
+    /*
+     * clear set flags
+     */
+    rowreq_ctx->column_set_flags = 0;
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbTable_undo_cleanup */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Set values
+ *
+ *---------------------------------------------------------------------*/
+/*
+ * @internal
+ * Set the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsDbTable_set_column( rdbmsDbTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsDbTable:_rdbmsDbTable_set_column","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsDbContact(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+    case COLUMN_RDBMSDBCONTACT:
+        rowreq_ctx->column_set_flags |= FLAG_RDBMSDBCONTACT;
+        rc = rdbmsDbContact_set(rowreq_ctx, (char *)var->val.string, var->val_len );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _rdbmsDbTable_set_column\n", column);
+         break;
+    }
+    
+    return rc;
+} /* _rdbmsDbTable_set_column */
+
+int
+_mfd_rdbmsDbTable_set_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    int                          rc = SNMP_ERR_NOERROR;
+
+    DEBUGMSGTL(("internal:rdbmsDbTable:_mfd_rdbmsDbTable_set_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    rowreq_ctx->column_set_flags = 0;
+    for(;requests; requests = requests->next) {
+        /*
+         * set column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _rdbmsDbTable_set_column(rowreq_ctx,
+                                    requests->requestvb, tri->colnum);
+        if(MFD_SUCCESS != rc)  {
+            DEBUGMSGTL(("verbose:rdbmsDbTable:mfd","error %d from "
+                        "rdbmsDbTable_set_column\n", rc));
+            netsnmp_set_request_error(agtreq_info, requests, SNMP_VALIDATE_ERR(rc));
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbTable_set_values */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: commit
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * commit the values
+ */
+int
+_mfd_rdbmsDbTable_commit(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    int                    rc;
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+
+    DEBUGMSGTL(("internal:rdbmsDbTable:_mfd_rdbmsDbTable_commit","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    rc = rdbmsDbTable_commit(rowreq_ctx);
+    if (MFD_SUCCESS != rc) {
+        DEBUGMSGTL(("verbose:rdbmsDbTable:mfd","error %d from "
+                    "rdbmsDbTable_commit\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+
+    return SNMP_ERR_NOERROR;
+}
+
+int
+_mfd_rdbmsDbTable_undo_commit(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    int                    rc;
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+
+    DEBUGMSGTL(("internal:rdbmsDbTable:_mfd_rdbmsDbTable_undo_commit","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    rc = rdbmsDbTable_undo_commit(rowreq_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("verbose:rdbmsDbTable:mfd","error %d from "
+                    "rdbmsDbTable_undo_commit\n", rc));
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbTable_commit */
+
+/*----------------------------------------------------------------------
+ *
+ * SET: Undo
+ *
+ *---------------------------------------------------------------------*/
+/**
+ * @internal
+ * undo the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsDbTable_undo_column( rdbmsDbTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsDbTable:_rdbmsDbTable_undo_column","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsDbContact(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+    case COLUMN_RDBMSDBCONTACT:
+        rc = rdbmsDbContact_undo(rowreq_ctx);
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _rdbmsDbTable_undo_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _rdbmsDbTable_undo_column */
+
+int
+_mfd_rdbmsDbTable_undo_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    int                    rc;
+    rdbmsDbTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+
+    DEBUGMSGTL(("internal:rdbmsDbTable:_mfd_rdbmsDbTable_undo_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * set column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _rdbmsDbTable_undo_column(rowreq_ctx, requests->requestvb,
+                                     tri->colnum);
+        if (MFD_SUCCESS != rc) {
+            /*
+             * nothing we can do about it but log it
+             */
+            DEBUGMSGTL(("verbose:rdbmsDbTable:mfd","error %d from "
+                        "rdbmsDbTable_undo_column\n", rc));
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsDbTable_undo_values */
+
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+    DEBUGMSGTL(("internal:rdbmsDbTable:_cache_load","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache for rdbmsDbTable_cache_load\n");
+        return -1;
+    }
+
+    /** should only be called for an invalid or expired cache */
+    netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+    
+    /*
+     * call user code
+     */
+    return rdbmsDbTable_cache_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_item_free(rdbmsDbTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+    DEBUGMSGTL(("internal:rdbmsDbTable:_cache_item_free","called\n"));
+
+    if(NULL == rowreq_ctx)
+        return;
+
+    rdbmsDbTable_release_rowreq_ctx(rowreq_ctx);
+} /* _cache_item_free */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+    netsnmp_container *container;
+
+    DEBUGMSGTL(("internal:rdbmsDbTable:_cache_free","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache in rdbmsDbTable_cache_free\n");
+        return;
+    }
+
+    container = (netsnmp_container*)cache->magic;
+
+    /*
+     * call user code
+     */
+    rdbmsDbTable_cache_free(container);
+    
+    /*
+     * free all items. inefficient, but easy.
+     */
+    CONTAINER_CLEAR(container,
+                    (netsnmp_container_obj_func *)_cache_item_free,
+                    NULL);
+} /* _cache_free */
+
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_rdbmsDbTable_container_init(rdbmsDbTable_interface_ctx *if_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsDbTable:_rdbmsDbTable_container_init","called\n"));
+    
+    /*
+     * set up the cache
+     */
+    if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+                                         _cache_load, _cache_free,
+                                         rdbmsDbTable_oid,
+                                         rdbmsDbTable_oid_size);
+
+    if(NULL == if_ctx->cache) {
+        snmp_log(LOG_ERR, "error creating cache for rdbmsDbTable\n");
+        return;
+    }
+
+    if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+    rdbmsDbTable_container_init(&if_ctx->container, if_ctx->cache);
+    if(NULL == if_ctx->container)
+        if_ctx->container = netsnmp_container_find("rdbmsDbTable:table_container");
+    if(NULL == if_ctx->container) {
+        snmp_log(LOG_ERR,"error creating container in "
+                 "rdbmsDbTable_container_init\n");
+        return;
+    }
+    if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _rdbmsDbTable_container_init */
+
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_interface.h b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_interface.h
new file mode 100644 (file)
index 0000000..2d74fdc
--- /dev/null
@@ -0,0 +1,50 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable_interface.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable_interface.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBTABLE_INTERFACE_H
+#define RDBMSDBTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "rdbmsDbTable.h"
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _rdbmsDbTable_initialize_interface(rdbmsDbTable_registration_ptr user_ctx,
+                                    u_long flags);
+
+    rdbmsDbTable_rowreq_ctx * rdbmsDbTable_allocate_rowreq_ctx(void);
+void rdbmsDbTable_release_rowreq_ctx(rdbmsDbTable_rowreq_ctx *rowreq_ctx);
+
+int rdbmsDbTable_index_to_oid(netsnmp_index *oid_idx,
+                            rdbmsDbTable_mib_index *mib_idx);
+int rdbmsDbTable_index_from_oid(netsnmp_index *oid_idx,
+                              rdbmsDbTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void rdbmsDbTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBTABLE_INTERFACE_H */
diff --git a/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_oids.h b/RDBMS-MIB_src/rdbmsDbTable/rdbmsDbTable_oids.h
new file mode 100644 (file)
index 0000000..8d80497
--- /dev/null
@@ -0,0 +1,46 @@
+/*-------------------------------------------------------------------------
+ * rdbmsDbTable_oids.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsDbTable_oids.h,v 1.2 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSDBTABLE_OIDS_H
+#define RDBMSDBTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table rdbmsDbTable */
+#define RDBMSDBTABLE_OID              1,3,6,1,2,1,39,1,1
+#define COLUMN_RDBMSDBINDEX            1
+#define COLUMN_RDBMSDBPRIVATEMIBOID            2
+#define COLUMN_RDBMSDBVENDORNAME               3
+#define COLUMN_RDBMSDBNAME             4
+#define COLUMN_RDBMSDBCONTACT          5
+
+#define RDBMSDBTABLE_MIN_COL           COLUMN_RDBMSDBPRIVATEMIBOID
+#define RDBMSDBTABLE_MAX_COL           COLUMN_RDBMSDBCONTACT
+
+    /*
+     * change flags for writable columns
+     */
+#define FLAG_RDBMSDBCONTACT       (0x1 << 0)
+
+#define FLAG_MAX_RDBMSDBTABLE 1
+
+    
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSDBTABLE_OIDS_H */
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable.c b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable.c
new file mode 100644 (file)
index 0000000..a911d5d
--- /dev/null
@@ -0,0 +1,130 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable.c,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsRelTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "rdbmsRelTable_interface.h"
+
+oid rdbmsRelTable_oid[] = { RDBMSRELTABLE_OID };
+int rdbmsRelTable_oid_size = OID_LENGTH(rdbmsRelTable_oid);
+
+void initialize_table_rdbmsRelTable(void);
+
+
+/**
+ * Initializes the rdbmsRelTable module
+ */
+void
+init_rdbmsRelTable(void)
+{
+    DEBUGMSGTL(("verbose:rdbmsRelTable:init_rdbmsRelTable","called\n"));
+
+    /*
+     * TODO:300:o: Perform rdbmsRelTable one-time module initialization.
+     */
+     
+    /*
+     * here we initialize all the tables we're planning on supporting
+     */
+    if (should_init("rdbmsRelTable"))
+        initialize_table_rdbmsRelTable();
+
+} /* init_rdbmsRelTable */
+
+/**
+ * Initialize the table rdbmsRelTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+initialize_table_rdbmsRelTable(void)
+{
+    rdbmsRelTable_registration_ptr user_context;
+    u_long flags;
+
+    DEBUGMSGTL(("verbose:rdbmsRelTable:initialize_table_rdbmsRelTable","called\n"));
+
+    /*
+     * TODO:301:o: Perform rdbmsRelTable one-time table initialization.
+     */
+
+    /*
+     * TODO:302:o: |->Initialize rdbmsRelTable user context
+     * if you'd like to pass in a pointer to some data for this
+     * table, allocate or set it up here.
+     */
+    /*
+     * a netsnmp_data_list is a simple way to store void pointers. A simple
+     * string token is used to add, find or remove pointers.
+     */
+    user_context = netsnmp_create_data_list("rdbmsRelTable", NULL, NULL);
+    
+    /*
+     * No support for any flags yet, but in the future you would
+     * set any flags here.
+     */
+    flags = 0;
+    
+    /*
+     * call interface initialization code
+     */
+    _rdbmsRelTable_initialize_interface(user_context, flags);
+} /* initialize_table_rdbmsRelTable */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_ERROR                : other error
+ */
+int
+rdbmsRelTable_pre_request(rdbmsRelTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelTable_pre_request","called\n"));
+
+    /*
+     * TODO:510:o: Perform rdbmsRelTable pre-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsRelTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : other error (ignored)
+ */
+int
+rdbmsRelTable_post_request(rdbmsRelTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelTable_post_request","called\n"));
+
+    /*
+     * TODO:511:o: Perform rdbmsRelTable pos-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsRelTable_post_request */
+
+
+/** @{ */
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable.h b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable.h
new file mode 100644 (file)
index 0000000..1c44b8d
--- /dev/null
@@ -0,0 +1,205 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSRELTABLE_H
+#define RDBMSRELTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @defgroup misc misc: Miscelaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+    /* *INDENT-OFF*  */
+config_require(RDBMS-MIB/rdbmsRelTable/rdbmsRelTable_interface);
+config_require(RDBMS-MIB/rdbmsRelTable/rdbmsRelTable_data_access);
+config_require(RDBMS-MIB/rdbmsRelTable/rdbmsRelTable_data_get);
+config_require(RDBMS-MIB/rdbmsRelTable/rdbmsRelTable_data_set);
+    /* *INDENT-ON*  */
+
+/* OID and column number definitions for  */
+#include "rdbmsRelTable_oids.h"
+
+/* enum definions */
+#include "rdbmsRelTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_rdbmsRelTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsRelTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsRelTable is subid 9 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.9, length: 9
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+    /*
+     * TODO:101:o: |-> Review rdbmsRelTable registration context.
+     */
+typedef netsnmp_data_list * rdbmsRelTable_registration_ptr;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review rdbmsRelTable data context structure.
+ * This structure is used to represent the data for rdbmsRelTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * rdbmsRelTable.
+ */
+typedef struct rdbmsRelTable_data_s {
+    
+        /*
+         * rdbmsRelState(1)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h
+         */
+   u_long   rdbmsRelState;
+    
+        /*
+         * rdbmsRelActiveTime(2)/DateAndTime/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+         */
+       int activeTimeYear;
+       int activeTimeMonth;
+       int activeTimeDay;
+       int activeTimeHour;
+       int activeTimeMinutes;
+       int activeTimeSeconds;
+       int activeTimeDeciSeconds;
+       int activeTimeUtcOffsetDirection;
+       int activeTimeUtcOffsetHours;
+       int activeTimeUtcOffsetMinutes;
+    
+} rdbmsRelTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review rdbmsRelTable mib index.
+ * This structure is used to represent the index for rdbmsRelTable.
+ */
+typedef struct rdbmsRelTable_mib_index_s {
+
+        /*
+         * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   rdbmsDbIndex;
+
+        /*
+         * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   applIndex;
+
+
+} rdbmsRelTable_mib_index;
+
+    /*
+     * TODO:121:r: |   |-> Review rdbmsRelTable max index length.
+     * If you KNOW that your indexes will never exceed a certain
+     * length, update this macro to that length.
+*/
+#define MAX_rdbmsRelTable_IDX_LEN     2
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review rdbmsRelTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * rdbmsRelTable_rowreq_ctx pointer.
+ */
+typedef struct rdbmsRelTable_rowreq_ctx_s {
+
+    /** this must be first for container compare to work */
+    netsnmp_index        oid_idx;
+    oid                  oid_tmp[MAX_rdbmsRelTable_IDX_LEN];
+    
+    rdbmsRelTable_mib_index        tbl_idx;
+    
+    rdbmsRelTable_data              data;
+
+    /*
+     * flags per row. Currently, the first (lower) 8 bits are reserved
+     * for the user. See mfd.h for other flags.
+     */
+    u_int                       rowreq_flags;
+
+    /*
+     * implementor's context pointer (provided during registration)
+     */
+    rdbmsRelTable_registration_ptr rdbmsRelTable_reg;
+
+    /*
+     * TODO:131:o: |   |-> Add useful data to rdbmsRelTable rowreq context.
+     */
+    
+    /*
+     * storage for future expansion
+     */
+    netsnmp_data_list             *rdbmsRelTable_data_list;
+
+} rdbmsRelTable_rowreq_ctx;
+
+typedef struct rdbmsRelTable_ref_rowreq_ctx_s {
+    rdbmsRelTable_rowreq_ctx *rowreq_ctx;
+} rdbmsRelTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+    int rdbmsRelTable_pre_request(rdbmsRelTable_registration_ptr user_context);
+    int rdbmsRelTable_post_request(rdbmsRelTable_registration_ptr user_context);
+
+
+extern oid rdbmsRelTable_oid[];
+extern int rdbmsRelTable_oid_size;
+
+
+#include "rdbmsRelTable_interface.h"
+#include "rdbmsRelTable_data_access.h"
+#include "rdbmsRelTable_data_get.h"
+#include "rdbmsRelTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSRELTABLE_H */
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_access.c b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_access.c
new file mode 100644 (file)
index 0000000..e2b6327
--- /dev/null
@@ -0,0 +1,322 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable_data_access.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable_data_access.c,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsRelTable.h"
+#include "rdbmsRelTable_data_access.h"
+
+/** @defgroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ * 
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsRelTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsRelTable is subid 9 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.9, length: 9
+*/
+
+/**
+ * initialization for rdbmsRelTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param rdbmsRelTable_reg
+ *        Pointer to rdbmsRelTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : unrecoverable error.
+ */
+int
+rdbmsRelTable_init_data(rdbmsRelTable_registration_ptr rdbmsRelTable_reg)
+{
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelTable_init_data","called\n"));
+
+    /*
+     * TODO:303:o: Initialize rdbmsRelTable data.
+     */
+    /*
+    ***************************************************
+    ***             START EXAMPLE CODE              ***
+    ***---------------------------------------------***/
+    /*
+     * if you are the sole writer for the file, you could
+     * open it here. However, as stated earlier, we are assuming
+     * the worst case, which in this case means that the file is
+     * written to by someone else, and might not even exist when
+     * we start up. So we can't do anything here.
+     */
+    /*
+    ***---------------------------------------------***
+    ***              END  EXAMPLE CODE              ***
+    ***************************************************/
+
+    return MFD_SUCCESS;
+} /* rdbmsRelTable_init_data */
+
+/**
+ * container-cached overview
+ *
+ */
+
+/***********************************************************************
+ *
+ * cache
+ *
+ ***********************************************************************/
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ *        create a custom container, use this parameter to return it
+ *        to the MFD helper. If set to NULL, the MFD helper will
+ *        allocate a container for you.
+ * @param  cache A pointer to a cache structure. You can set the timeout
+ *         and other cache flags using this pointer.
+ *
+ *  This function is called at startup to allow you to customize certain
+ *  aspects of the access method. For the most part, it is for advanced
+ *  users. The default code should suffice for most cases. If no custom
+ *  container is allocated, the MFD code will create one for your.
+ *
+ *  This is also the place to set up cache behavior. The default, to
+ *  simply set the cache timeout, will work well with the default
+ *  container. If you are using a custom container, you may want to
+ *  look at the cache helper documentation to see if there are any
+ *  flags you want to set.
+ *
+ * @remark
+ *  This would also be a good place to do any initialization needed
+ *  for you data source. For example, opening a connection to another
+ *  process that will supply the data, opening a database, etc.
+ */
+void
+rdbmsRelTable_container_init(netsnmp_container **container_ptr_ptr,
+                        netsnmp_cache *cache)
+{
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelTable_container_init","called\n"));
+    
+    if((NULL == cache) || (NULL == container_ptr_ptr)) {
+        snmp_log(LOG_ERR,"bad params to rdbmsRelTable_container_init\n");
+        return;
+    }
+
+    /*
+     * For advanced users, you can use a custom container. If you
+     * do not create one, one will be created for you.
+     */
+    *container_ptr_ptr = NULL;
+
+    /*
+     * TODO:345:A: Set up rdbmsRelTable cache properties.
+     *
+     * Also for advanced users, you can set parameters for the
+     * cache. Do not change the magic pointer, as it is used
+     * by the MFD helper. To completely disable caching, set
+     * cache->enabled to 0.
+     */
+    cache->timeout = RDBMSRELTABLE_CACHE_TIMEOUT; /* seconds */
+} /* rdbmsRelTable_container_init */
+
+/**
+ * load cache data
+ *
+ * TODO:350:M: Implement rdbmsRelTable cache load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR                : other error.
+ *
+ *  This function is called to cache the index(es) (and data, optionally)
+ *  for the every row in the data set.
+ *
+ * @remark
+ *  While loading the cache, the only important thing is the indexes.
+ *  If access to your data is cheap/fast (e.g. you have a pointer to a
+ *  structure in memory), it would make sense to update the data here.
+ *  If, however, the accessing the data invovles more work (e.g. parsing
+ *  some other existing data, or peforming calculations to derive the data),
+ *  then you can limit yourself to setting the indexes and saving any
+ *  information you will need later. Then use the saved information in
+ *  rdbmsRelTable_row_prep() for populating data.
+ *
+ * @note
+ *  If you need consistency between rows (like you want statistics
+ *  for each row to be from the same time frame), you should set all
+ *  data here.
+ *
+ */
+int
+rdbmsRelTable_cache_load(netsnmp_container *container)
+{
+    rdbmsRelTable_rowreq_ctx *rowreq_ctx;
+   long   applIndex = 1;
+   int resultCount, errorCode = MFD_SUCCESS, i, tmpInt, count = 0;
+   PGresult *pg_db_qry;
+
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelTable_cache_load","called\n"));
+
+    /*
+     * TODO:351:M: |-> Load/update data in the rdbmsRelTable container.
+     * loop over your rdbmsRelTable data, allocate a rowreq context,
+     * set the index(es) [and data, optionally] and insert into
+     * the container.
+     */
+
+    if (PQstatus(dbconn) == CONNECTION_OK) 
+           pg_db_qry = PQexec(dbconn, "SELECT datid, EXTRACT(YEAR FROM pg_postmaster_start_time()), EXTRACT(MONTH FROM pg_postmaster_start_time()), EXTRACT(DAY FROM pg_postmaster_start_time()), EXTRACT(HOUR FROM pg_postmaster_start_time()), EXTRACT(MINUTE FROM pg_postmaster_start_time()), EXTRACT(SECOND FROM pg_postmaster_start_time()), EXTRACT(MILLISECOND FROM pg_postmaster_start_time()), EXTRACT(TIMEZONE_HOUR FROM pg_postmaster_start_time()), EXTRACT(TIMEZONE_MINUTE FROM pg_postmaster_start_time()) FROM pg_stat_database");
+    else {
+           snmp_log(LOG_ERR, "Can't get connected to the database");
+           return MFD_RESOURCE_UNAVAILABLE;
+    }
+    if (PQresultStatus(pg_db_qry) != PGRES_TUPLES_OK) {
+           snmp_log(LOG_ERR, "Didn't get any results from the database");
+           PQclear(pg_db_qry);
+           /*PQfinish(dbconn);*/
+           /* It's probably an error if I didn't find *any* databases */
+           return MFD_RESOURCE_UNAVAILABLE;
+    }
+
+    resultCount = PQntuples(pg_db_qry);
+
+    for(i = 0; i < resultCount; i++) {
+
+        /*
+         * TODO:352:M: |   |-> set indexes in new rdbmsRelTable rowreq context.
+         */
+        rowreq_ctx = rdbmsRelTable_allocate_rowreq_ctx();
+        if (NULL == rowreq_ctx) {
+            snmp_log(LOG_ERR, "memory allocation failed\n");
+            errorCode = MFD_RESOURCE_UNAVAILABLE;
+           break;
+        }
+       tmpInt = atoi(PQgetvalue(pg_db_qry, i, 0));
+        if(MFD_SUCCESS != rdbmsRelTable_indexes_set(rowreq_ctx
+                               , tmpInt
+                               , applIndex
+               )) {
+            snmp_log(LOG_ERR,"error setting index while loading "
+                     "rdbmsRelTable cache.\n");
+            rdbmsRelTable_release_rowreq_ctx(rowreq_ctx);
+            continue;
+        }
+
+        /*
+         * TODO:352:r: |   |-> populate rdbmsRelTable data context.
+         * Populate data context here. (optionally, delay until row prep)
+         */
+
+    /* All databases are active */
+    if(MFD_SUCCESS !=
+       rdbmsRelState_map(&rowreq_ctx->data.rdbmsRelState, INTERNAL_RDBMSRELSTATE_ACTIVE)) {
+        return MFD_ERROR;
+    }
+    
+       rowreq_ctx->data.activeTimeYear = atoi(PQgetvalue(pg_db_qry, i, 1));
+       rowreq_ctx->data.activeTimeMonth = atoi(PQgetvalue(pg_db_qry, i, 2));
+       rowreq_ctx->data.activeTimeDay = atoi(PQgetvalue(pg_db_qry, i, 3));
+       rowreq_ctx->data.activeTimeHour = atoi(PQgetvalue(pg_db_qry, i, 4));
+       rowreq_ctx->data.activeTimeMinutes = atoi(PQgetvalue(pg_db_qry, i, 5));
+       rowreq_ctx->data.activeTimeSeconds = atoi(PQgetvalue(pg_db_qry, i, 6));
+       rowreq_ctx->data.activeTimeDeciSeconds = atoi(PQgetvalue(pg_db_qry, i, 7));
+       rowreq_ctx->data.activeTimeUtcOffsetHours = atoi(PQgetvalue(pg_db_qry, i, 8));
+       rowreq_ctx->data.activeTimeUtcOffsetMinutes = atoi(PQgetvalue(pg_db_qry, i, 9));
+       tmpInt = rowreq_ctx->data.activeTimeUtcOffsetHours * 60 + rowreq_ctx->data.activeTimeUtcOffsetMinutes;
+       if (tmpInt == 0)
+               rowreq_ctx->data.activeTimeUtcOffsetDirection = 0;
+       else 
+               rowreq_ctx->data.activeTimeUtcOffsetDirection = (tmpInt > 0 ? 1 : -1);
+    
+        
+        /*
+         * insert into table container
+         */
+        CONTAINER_INSERT(container, rowreq_ctx);
+        ++count;
+    }
+
+    DEBUGMSGT(("verbose:rdbmsRelTable:rdbmsRelTable_cache_load",
+               "inserted %d records\n", count));
+
+    PQclear(pg_db_qry);
+
+    return errorCode;
+} /* rdbmsRelTable_cache_load */
+
+/**
+ * cache clean up
+ *
+ * @param container container with all current items
+ *
+ *  This optional callback is called prior to all
+ *  item's being removed from the container. If you
+ *  need to do any processing before that, do it here.
+ *
+ * @note
+ *  The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+rdbmsRelTable_cache_free(netsnmp_container *container)
+{
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelTable_cache_free","called\n"));
+
+    /*
+     * TODO:380:M: Free rdbmsRelTable cache.
+     */
+} /* rdbmsRelTable_cache_free */
+
+/**
+ * prepare row for processing.
+ *
+ *  When the agent has located the row for a request, this function is
+ *  called to prepare the row for processing. If you fully populated
+ *  the data context during the index setup phase, you may not need to
+ *  do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ */
+int
+rdbmsRelTable_row_prep( rdbmsRelTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelTable_row_prep","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:390:o: Prepare row for request.
+     * If populating row data was delayed, this is the place to
+     * fill in the row for this request.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsRelTable_row_prep */
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_access.h b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_access.h
new file mode 100644 (file)
index 0000000..195fa5f
--- /dev/null
@@ -0,0 +1,77 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable_data_access.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable_data_access.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSRELTABLE_DATA_ACCESS_H
+#define RDBMSRELTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsRelTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsRelTable is subid 9 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.9, length: 9
+*/
+
+
+    int rdbmsRelTable_init_data(rdbmsRelTable_registration_ptr rdbmsRelTable_reg);
+
+
+/*
+ * TODO:180:o: Review rdbmsRelTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define RDBMSRELTABLE_CACHE_TIMEOUT   60
+
+void rdbmsRelTable_container_init(netsnmp_container **container_ptr_ptr,
+                             netsnmp_cache *cache);
+int rdbmsRelTable_cache_load(netsnmp_container *container);
+void rdbmsRelTable_cache_free(netsnmp_container *container);
+
+    /*
+    ***************************************************
+    ***             START EXAMPLE CODE              ***
+    ***---------------------------------------------***/
+/* *********************************************************************
+ * Since we have no idea how you really access your data, we'll go with
+ * a worst case example: a flat text file.
+ */
+#define MAX_LINE_SIZE 256
+    /*
+    ***---------------------------------------------***
+    ***              END  EXAMPLE CODE              ***
+    ***************************************************/
+    int rdbmsRelTable_row_prep( rdbmsRelTable_rowreq_ctx *rowreq_ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSRELTABLE_DATA_ACCESS_H */
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_get.c b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_get.c
new file mode 100644 (file)
index 0000000..9895a63
--- /dev/null
@@ -0,0 +1,378 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable_data_get.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable_data_get.c,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsRelTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement rdbmsRelTable get routines.
+ * TODO:240:M: Implement rdbmsRelTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsRelTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsRelTable is subid 9 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.9, length: 9
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement rdbmsRelTable data context functions.
+ */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This convenience function is useful for setting all the MIB index
+ *  components with a single function call. It is assume that the C values
+ *  have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+rdbmsRelTable_indexes_set_tbl_idx(rdbmsRelTable_mib_index *tbl_idx, long rdbmsDbIndex_val, long applIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelTable_indexes_set_tbl_idx","called\n"));
+
+    /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->rdbmsDbIndex = rdbmsDbIndex_val;
+    
+    /* applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->applIndex = applIndex_val;
+    
+
+    return MFD_SUCCESS;
+} /* rdbmsRelTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This function sets the mib indexs, then updates the oid indexs
+ *  from the mib index.
+ */
+int
+rdbmsRelTable_indexes_set(rdbmsRelTable_rowreq_ctx *rowreq_ctx, long rdbmsDbIndex_val, long applIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelTable_indexes_set","called\n"));
+
+    if(MFD_SUCCESS != rdbmsRelTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+                                   , rdbmsDbIndex_val
+                                   , applIndex_val
+           ))
+        return MFD_ERROR;
+
+    /*
+     * convert mib index to oid index
+     */
+    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+    if(0 != rdbmsRelTable_index_to_oid(&rowreq_ctx->oid_idx,
+                                    &rowreq_ctx->tbl_idx)) {
+        return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* rdbmsRelTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsRelEntry.rdbmsRelState
+ * rdbmsRelState is subid 1 of rdbmsRelEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.9.1.1
+ * Description:
+The state of this server's access to this database.
+           Active(2) means the server is actively using the database.
+           Available(3) means the server could use the database if
+           necessary.  Restricted(4) means the database is in some
+           administratively determined state of less-than-complete
+           availability.  Unavailable(5) means the database is not
+           available through this server.  Other(1) means the
+           database/server is in some other condition, possibly
+           described in the vendor private MIB.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  1      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ * Enum range: 3/8. Values:  other(1), active(2), available(3), restricted(4), unavailable(5)
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsRelState.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsRelState_map(u_long *mib_rdbmsRelState_val_ptr, u_long raw_rdbmsRelState_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsRelState_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelState_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsRelState enum mapping.
+     * uses INTERNAL_* macros defined in the header files
+     */
+    switch(raw_rdbmsRelState_val) {
+        case INTERNAL_RDBMSRELSTATE_OTHER:
+             *mib_rdbmsRelState_val_ptr = RDBMSRELSTATE_OTHER;
+             break;
+
+        case INTERNAL_RDBMSRELSTATE_ACTIVE:
+             *mib_rdbmsRelState_val_ptr = RDBMSRELSTATE_ACTIVE;
+             break;
+
+        case INTERNAL_RDBMSRELSTATE_AVAILABLE:
+             *mib_rdbmsRelState_val_ptr = RDBMSRELSTATE_AVAILABLE;
+             break;
+
+        case INTERNAL_RDBMSRELSTATE_RESTRICTED:
+             *mib_rdbmsRelState_val_ptr = RDBMSRELSTATE_RESTRICTED;
+             break;
+
+        case INTERNAL_RDBMSRELSTATE_UNAVAILABLE:
+             *mib_rdbmsRelState_val_ptr = RDBMSRELSTATE_UNAVAILABLE;
+             break;
+
+             default:
+                 snmp_log(LOG_ERR, "couldn't map value %ld for rdbmsRelState\n", raw_rdbmsRelState_val );
+                 return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* rdbmsRelState_map */
+
+/**
+ * Extract the current value of the rdbmsRelState data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsRelState_val_ptr
+ *        Pointer to storage for a long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsRelState_get( rdbmsRelTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsRelState_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsRelState_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelState_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsRelState data.
+ * set (* rdbmsRelState_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsRelState_val_ptr ) = rowreq_ctx->data.rdbmsRelState;
+
+    return MFD_SUCCESS;
+} /* rdbmsRelState_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsRelEntry.rdbmsRelActiveTime
+ * rdbmsRelActiveTime is subid 2 of rdbmsRelEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.9.1.2
+ * Description:
+The time the database was made active by the server.  If an
+           instance of rdbmsRelState is not active(1), then attempts to
+           access the corresponding instance of this object may result
+           in either noSuchName (SNMPv1) or noSuchInstance (SNMPv2)
+           being returned by the agent.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 2d-1d-1d,1d:1d:1d.1d,1a1d:1d
+ *
+ * Ranges:  8, 11;
+ *
+ * Its syntax is DateAndTime (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 11)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsRelActiveTime.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsRelActiveTime_map(char **mib_rdbmsRelActiveTime_val_ptr_ptr, size_t *mib_rdbmsRelActiveTime_val_ptr_len_ptr, char *raw_rdbmsRelActiveTime_val_ptr, size_t raw_rdbmsRelActiveTime_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsRelActiveTime_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsRelActiveTime_val_ptr_ptr) && (NULL != mib_rdbmsRelActiveTime_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelActiveTime_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsRelActiveTime non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsRelActiveTime_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsRelActiveTime_val_ptr_ptr) || (*mib_rdbmsRelActiveTime_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsRelActiveTime_val_ptr_ptr = realloc( *mib_rdbmsRelActiveTime_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsRelActiveTime_val_ptr_ptr));
+        if(NULL == *mib_rdbmsRelActiveTime_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsRelActiveTime_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsRelActiveTime_val_ptr_ptr, raw_rdbmsRelActiveTime_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsRelActiveTime_map */
+
+/**
+ * Extract the current value of the rdbmsRelActiveTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsRelActiveTime_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsRelActiveTime_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsRelActiveTime.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsRelActiveTime_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsRelActiveTime_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsRelActiveTime_get( rdbmsRelTable_rowreq_ctx *rowreq_ctx, char **rdbmsRelActiveTime_val_ptr_ptr, size_t *rdbmsRelActiveTime_val_ptr_len_ptr )
+{
+       int rc;
+   /** we should have a pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsRelActiveTime_val_ptr_ptr) && (NULL != *rdbmsRelActiveTime_val_ptr_ptr));
+   netsnmp_assert( (NULL != rdbmsRelActiveTime_val_ptr_len_ptr) && ((* rdbmsRelActiveTime_val_ptr_len_ptr) >= 11));
+
+   /*
+    * TODO:231:o: |-> copy rdbmsRelActiveTime data.
+    * get the date from your context pointer.
+    */
+
+   /* call convenience function to set data */
+   rc = netsnmp_dateandtime_set_buf_from_vars((u_char *)*rdbmsRelActiveTime_val_ptr_ptr, rdbmsRelActiveTime_val_ptr_len_ptr,
+       rowreq_ctx->data.activeTimeYear,
+       rowreq_ctx->data.activeTimeMonth,
+       rowreq_ctx->data.activeTimeDay,
+       rowreq_ctx->data.activeTimeHour,
+       rowreq_ctx->data.activeTimeMinutes,
+       rowreq_ctx->data.activeTimeSeconds,
+       rowreq_ctx->data.activeTimeDeciSeconds,
+       rowreq_ctx->data.activeTimeUtcOffsetDirection,
+       rowreq_ctx->data.activeTimeUtcOffsetHours,
+       rowreq_ctx->data.activeTimeUtcOffsetMinutes);
+   if(rc != SNMP_ERR_NOERROR)
+      return rc;
+
+
+    return MFD_SUCCESS;
+} /* rdbmsRelActiveTime_get */
+
+
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_get.h b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_get.h
new file mode 100644 (file)
index 0000000..2f86b58
--- /dev/null
@@ -0,0 +1,63 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable_data_get.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable_data_get.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSRELTABLE_DATA_GET_H
+#define RDBMSRELTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsRelTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsRelTable is subid 9 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.9, length: 9
+*/
+    /*
+     * indexes
+     */
+    int rdbmsDbIndex_map(long *mib_rdbmsDbIndex_val_ptr, long raw_rdbmsDbIndex_val);
+    int applIndex_map(long *mib_applIndex_val_ptr, long raw_applIndex_val);
+
+    int rdbmsRelState_map(u_long *mib_rdbmsRelState_val_ptr, u_long raw_rdbmsRelState_val);
+    int rdbmsRelState_get( rdbmsRelTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsRelState_val_ptr );
+    int rdbmsRelActiveTime_map(char **mib_rdbmsRelActiveTime_val_ptr_ptr, size_t *mib_rdbmsRelActiveTime_val_ptr_len_ptr, char *raw_rdbmsRelActiveTime_val_ptr, size_t raw_rdbmsRelActiveTime_val_ptr_len, int allow_realloc);
+    int rdbmsRelActiveTime_get( rdbmsRelTable_rowreq_ctx *rowreq_ctx, char **rdbmsRelActiveTime_val_ptr_ptr, size_t *rdbmsRelActiveTime_val_ptr_len_ptr );
+
+
+int rdbmsRelTable_indexes_set_tbl_idx(rdbmsRelTable_mib_index *tbl_idx, long rdbmsDbIndex_val, long applIndex_val);
+int rdbmsRelTable_indexes_set(rdbmsRelTable_rowreq_ctx *rowreq_ctx, long rdbmsDbIndex_val, long applIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSRELTABLE_DATA_GET_H */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_set.c b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_set.c
new file mode 100644 (file)
index 0000000..a2de409
--- /dev/null
@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable_data_set.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable_data_set.c,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsRelTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ * 
+ * @{
+ */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_set.h b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_data_set.h
new file mode 100644 (file)
index 0000000..3b62de5
--- /dev/null
@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable_data_set.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable_data_set.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSRELTABLE_DATA_SET_H
+#define RDBMSRELTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSRELTABLE_DATA_SET_H */
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_enums.h b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_enums.h
new file mode 100644 (file)
index 0000000..7415b02
--- /dev/null
@@ -0,0 +1,76 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable_enums.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable_enums.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSRELTABLE_ENUMS_H
+#define RDBMSRELTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table rdbmsRelTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+/*************************************************************
+ * constants for enums for the MIB node
+ * rdbmsRelState (INTEGER / ASN_INTEGER)
+ *
+ * since a Textual Convention may be referenced more than once in a
+ * MIB, protect againt redefinitions of the enum values.
+ */
+#ifndef RDBMSRELSTATE_ENUMS
+#define RDBMSRELSTATE_ENUMS
+
+#define RDBMSRELSTATE_OTHER  1 
+#define RDBMSRELSTATE_ACTIVE  2 
+#define RDBMSRELSTATE_AVAILABLE  3 
+#define RDBMSRELSTATE_RESTRICTED  4 
+#define RDBMSRELSTATE_UNAVAILABLE  5 
+
+
+#endif /* RDBMSRELSTATE_ENUMS */
+
+    /*
+     * TODO:140:o: Define interal representation of rdbmsRelState enums.
+     * (used for value mapping; see notes at top of file)
+     */
+#define INTERNAL_RDBMSRELSTATE_OTHER  1 
+#define INTERNAL_RDBMSRELSTATE_ACTIVE  2 
+#define INTERNAL_RDBMSRELSTATE_AVAILABLE  3 
+#define INTERNAL_RDBMSRELSTATE_RESTRICTED  4 
+#define INTERNAL_RDBMSRELSTATE_UNAVAILABLE  5 
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSRELTABLE_ENUMS_H */
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_interface.c b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_interface.c
new file mode 100644 (file)
index 0000000..6329fac
--- /dev/null
@@ -0,0 +1,712 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable_interface.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable_interface.c,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsRelTable.h"
+
+
+#include <net-snmp/library/container.h>
+
+#include "rdbmsRelTable_interface.h"
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsRelTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsRelTable is subid 9 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.9, length: 9
+*/
+typedef struct rdbmsRelTable_interface_ctx_s {
+
+   netsnmp_container              *container;
+   netsnmp_cache                  *cache; /* optional cache */
+
+   rdbmsRelTable_registration_ptr      user_ctx;
+   
+   netsnmp_table_registration_info  tbl_info;
+
+   netsnmp_baby_steps_access_methods access_multiplexer;
+
+} rdbmsRelTable_interface_ctx;
+
+static rdbmsRelTable_interface_ctx rdbmsRelTable_if_ctx;
+
+static void _rdbmsRelTable_container_init(
+    rdbmsRelTable_interface_ctx *if_ctx);
+
+
+static Netsnmp_Node_Handler _mfd_rdbmsRelTable_pre_request;
+static Netsnmp_Node_Handler _mfd_rdbmsRelTable_post_request;
+static Netsnmp_Node_Handler _mfd_rdbmsRelTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_rdbmsRelTable_get_values;
+/**
+ * @internal
+ * Initialize the table rdbmsRelTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+_rdbmsRelTable_initialize_interface(rdbmsRelTable_registration_ptr reg_ptr,  u_long flags)
+{
+    netsnmp_baby_steps_access_methods *access_multiplexer =
+        &rdbmsRelTable_if_ctx.access_multiplexer;
+    netsnmp_table_registration_info *tbl_info = &rdbmsRelTable_if_ctx.tbl_info;
+    netsnmp_handler_registration *reginfo;
+    netsnmp_mib_handler *handler;
+    int    mfd_modes = 0;
+
+    DEBUGMSGTL(("internal:rdbmsRelTable:_rdbmsRelTable_initialize_interface","called\n"));
+
+
+    /*************************************************
+     *
+     * save interface context for rdbmsRelTable
+     */
+    /*
+     * Setting up the table's definition
+     */
+    netsnmp_table_helper_add_indexes(tbl_info,
+                                  ASN_INTEGER, /** index: rdbmsDbIndex */
+                                  ASN_INTEGER, /** index: applIndex */
+                             0);
+
+    /*  Define the minimum and maximum accessible columns.  This
+        optimizes retrival. */
+    tbl_info->min_column = RDBMSRELTABLE_MIN_COL;
+    tbl_info->max_column = RDBMSRELTABLE_MAX_COL;
+
+    /*
+     * save users context
+     */
+    rdbmsRelTable_if_ctx.user_ctx = reg_ptr;
+
+    /*
+     * call data access initialization code
+     */
+    rdbmsRelTable_init_data(reg_ptr);
+
+    /*
+     * set up the container
+     */
+    _rdbmsRelTable_container_init(&rdbmsRelTable_if_ctx);
+    if (NULL == rdbmsRelTable_if_ctx.container) {
+        snmp_log(LOG_ERR,"could not initialize container for rdbmsRelTable\n");
+        return;
+    }
+    
+    /*
+     * access_multiplexer: REQUIRED wrapper for get request handling
+     */
+    access_multiplexer->object_lookup = _mfd_rdbmsRelTable_object_lookup;
+    access_multiplexer->get_values = _mfd_rdbmsRelTable_get_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->pre_request = _mfd_rdbmsRelTable_pre_request;
+    access_multiplexer->post_request = _mfd_rdbmsRelTable_post_request;
+
+
+    /*************************************************
+     *
+     * Create a registration, save our reg data, register table.
+     */
+    DEBUGMSGTL(("rdbmsRelTable:init_rdbmsRelTable",
+                "Registering rdbmsRelTable as a mibs-for-dummies table.\n"));           
+    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+    reginfo = netsnmp_handler_registration_create("rdbmsRelTable", handler,
+                                                  rdbmsRelTable_oid,
+                                                  rdbmsRelTable_oid_size,
+                                                  HANDLER_CAN_BABY_STEP |
+                                                  HANDLER_CAN_RONLY
+                                                  );
+    if(NULL == reginfo) {
+        snmp_log(LOG_ERR,"error registering table rdbmsRelTable\n");
+        return;
+    }
+    reginfo->my_reg_void = &rdbmsRelTable_if_ctx;
+
+    /*************************************************
+     *
+     * set up baby steps handler, create it and inject it
+     */
+    if( access_multiplexer->object_lookup )
+        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+    if( access_multiplexer->set_values )
+        mfd_modes |= BABY_STEP_SET_VALUES;
+    if( access_multiplexer->irreversible_commit )
+        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+    if( access_multiplexer->object_syntax_checks )
+        mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+    if( access_multiplexer->pre_request )
+        mfd_modes |= BABY_STEP_PRE_REQUEST;
+    if( access_multiplexer->post_request )
+        mfd_modes |= BABY_STEP_POST_REQUEST;
+    
+    if( access_multiplexer->undo_setup )
+        mfd_modes |= BABY_STEP_UNDO_SETUP;
+    if( access_multiplexer->undo_cleanup )
+        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+    if( access_multiplexer->undo_sets )
+        mfd_modes |= BABY_STEP_UNDO_SETS;
+    
+    if( access_multiplexer->row_creation )
+        mfd_modes |= BABY_STEP_ROW_CREATE;
+    if( access_multiplexer->consistency_checks )
+        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+    if( access_multiplexer->commit )
+        mfd_modes |= BABY_STEP_COMMIT;
+    if( access_multiplexer->undo_commit )
+        mfd_modes |= BABY_STEP_UNDO_COMMIT;
+    
+    handler = netsnmp_baby_steps_handler_get(mfd_modes);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+     */
+    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject container_table helper
+     */
+    handler =
+        netsnmp_container_table_handler_get(tbl_info,
+                                            rdbmsRelTable_if_ctx.container,
+                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+    netsnmp_inject_handler( reginfo, handler );
+
+    /*************************************************
+     *
+     * inject cache helper
+     */
+    if(NULL != rdbmsRelTable_if_ctx.cache) {
+        handler = netsnmp_cache_handler_get(rdbmsRelTable_if_ctx.cache);
+        netsnmp_inject_handler( reginfo, handler );
+    }
+
+    /*
+     * register table
+     */
+    netsnmp_register_table(reginfo, tbl_info);
+} /* _rdbmsRelTable_initialize_interface */
+
+void
+rdbmsRelTable_valid_columns_set(netsnmp_column_info *vc)
+{
+    rdbmsRelTable_if_ctx.tbl_info.valid_columns = vc;
+} /* rdbmsRelTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+rdbmsRelTable_index_to_oid(netsnmp_index *oid_idx,
+                         rdbmsRelTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+    /*
+     * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_applIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+    memset( &var_applIndex, 0x00, sizeof(var_applIndex) );
+    var_applIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_rdbmsDbIndex.next_variable =  &var_applIndex; var_applIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelTable_index_to_oid","called\n"));
+
+        /* rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_rdbmsDbIndex, (u_char*)&mib_idx->rdbmsDbIndex,
+                       sizeof(mib_idx->rdbmsDbIndex));
+
+        /* applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_applIndex, (u_char*)&mib_idx->applIndex,
+                       sizeof(mib_idx->applIndex));
+
+
+    err = build_oid_noalloc(oid_idx->oids, oid_idx->len, (size_t *)&oid_idx->len,
+                           NULL, 0, &var_rdbmsDbIndex);
+    if(err)
+        snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_rdbmsDbIndex );
+
+    return err;
+} /* rdbmsRelTable_index_to_oid */
+
+/**
+ * extract rdbmsRelTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR  : no error
+ * @retval SNMP_ERR_GENERR   : error
+ */
+int
+rdbmsRelTable_index_from_oid(netsnmp_index *oid_idx,
+                         rdbmsRelTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * rdbmsDbIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsDbIndex;
+    /*
+     * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_applIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+    memset( &var_applIndex, 0x00, sizeof(var_applIndex) );
+    var_applIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_rdbmsDbIndex.next_variable =  &var_applIndex; var_applIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsRelTable:rdbmsRelTable_index_from_oid","called\n"));
+
+    /*
+     * parse the oid into the individual index components
+     */
+    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+                             &var_rdbmsDbIndex );
+    if (err == SNMP_ERR_NOERROR) {
+        /*
+         * copy out values
+         */
+    mib_idx->rdbmsDbIndex = *((long *)var_rdbmsDbIndex.val.string);
+    mib_idx->applIndex = *((long *)var_applIndex.val.string);
+
+
+    }
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_rdbmsDbIndex );
+
+    return err;
+} /* rdbmsRelTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a rdbmsRelTable_rowreq_ctx
+ */
+rdbmsRelTable_rowreq_ctx *
+rdbmsRelTable_allocate_rowreq_ctx(void)
+{
+    rdbmsRelTable_rowreq_ctx *rowreq_ctx =
+                  SNMP_MALLOC_TYPEDEF(rdbmsRelTable_rowreq_ctx);
+
+    DEBUGMSGTL(("internal:rdbmsRelTable:rdbmsRelTable_allocate_rowreq_ctx","called\n"));
+
+    if(NULL == rowreq_ctx) {
+        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+                 "rdbmsRelTable_rowreq_ctx.\n");
+    }
+
+    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+    rowreq_ctx->rdbmsRelTable_data_list = NULL;
+    rowreq_ctx->rdbmsRelTable_reg = rdbmsRelTable_if_ctx.user_ctx;
+
+
+    return rowreq_ctx;
+} /* rdbmsRelTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a rdbmsRelTable_rowreq_ctx
+ */
+void
+rdbmsRelTable_release_rowreq_ctx(rdbmsRelTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsRelTable:rdbmsRelTable_release_rowreq_ctx","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+
+    /*
+     * free index oid pointer
+     */
+    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+        free(rowreq_ctx->oid_idx.oids);
+
+    SNMP_FREE(rowreq_ctx);
+} /* rdbmsRelTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsRelTable_pre_request(netsnmp_mib_handler *handler,
+                            netsnmp_handler_registration *reginfo,
+                            netsnmp_agent_request_info *agtreq_info,
+                            netsnmp_request_info *requests)
+{
+    int rc = rdbmsRelTable_pre_request(rdbmsRelTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsRelTable","error %d from "
+                    "rdbmsRelTable_pre_request\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsRelTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsRelTable_post_request(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    rdbmsRelTable_rowreq_ctx *rowreq_ctx;
+    int rc = rdbmsRelTable_post_request(rdbmsRelTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsRelTable","error %d from "
+                    "rdbmsRelTable_post_request\n", rc));
+    }
+    
+    /*
+     * if there are no errors, check for and handle row creation/deletion
+     */
+    rc = netsnmp_check_requests_error(requests);
+    if ((SNMP_ERR_NOERROR == rc) &&
+        (NULL !=
+         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
+        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+            CONTAINER_INSERT(rdbmsRelTable_if_ctx.container, rowreq_ctx);
+        }
+        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+            CONTAINER_REMOVE(rdbmsRelTable_if_ctx.container, rowreq_ctx);
+            rdbmsRelTable_release_rowreq_ctx(rowreq_ctx);
+        }
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsRelTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsRelTable_object_lookup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsRelTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    
+    DEBUGMSGTL(("internal:rdbmsRelTable:_mfd_rdbmsRelTable_object_lookup","called\n"));
+
+    /*
+     * get our context from mfd
+     * rdbmsRelTable_interface_ctx *if_ctx =
+     *             (rdbmsRelTable_interface_ctx *)reginfo->my_reg_void;
+     */
+
+    if(NULL == rowreq_ctx) {
+        netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
+    }
+    else {
+        rdbmsRelTable_row_prep(rowreq_ctx);
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsRelTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsRelTable_get_column( rdbmsRelTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsRelTable:_mfd_rdbmsRelTable_get_column","called\n"));
+
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsRelState(1)/INTEGER/ASN_INTEGER/long(u_long)//l/A/w/E/r/d/h */
+    case COLUMN_RDBMSRELSTATE:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_INTEGER;
+rc = rdbmsRelState_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsRelActiveTime(2)/DateAndTime/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+    case COLUMN_RDBMSRELACTIVETIME:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsRelActiveTime_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _rdbmsRelTable_get_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _rdbmsRelTable_get_column */
+
+int
+_mfd_rdbmsRelTable_get_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsRelTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    u_char                     * old_string;
+    void                      (*dataFreeHook)(void *);
+    int                        rc;
+
+    DEBUGMSGTL(("internal:rdbmsRelTable:_mfd_rdbmsRelTable_get_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * save old pointer, so we can free it if replaced
+         */
+        old_string = requests->requestvb->val.string;
+        dataFreeHook = requests->requestvb->dataFreeHook;
+        if(NULL == requests->requestvb->val.string) {
+            requests->requestvb->val.string = requests->requestvb->buf;
+            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+        else if(requests->requestvb->buf == requests->requestvb->val.string) {
+            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+
+        /*
+         * get column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _rdbmsRelTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            if(MFD_SKIP == rc) {
+                requests->requestvb->type = ASN_PRIV_RETRY;
+                rc = SNMP_ERR_NOERROR;
+            }
+        }
+        else if (NULL == requests->requestvb->val.string) {
+            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+            rc = SNMP_ERR_GENERR;
+        }
+        if(rc)
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+        /*
+         * if the buffer wasn't used previously for the old data (i.e. it
+         * was allcoated memory)  and the get routine replaced the pointer,
+         * we need to free the previous pointer.
+         */
+        if(old_string && (old_string != requests->requestvb->buf) &&
+           (requests->requestvb->val.string != old_string)) {
+            if(dataFreeHook)
+                (*dataFreeHook)(old_string);
+            else
+                free(old_string);
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsRelTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+    DEBUGMSGTL(("internal:rdbmsRelTable:_cache_load","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache for rdbmsRelTable_cache_load\n");
+        return -1;
+    }
+
+    /** should only be called for an invalid or expired cache */
+    netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+    
+    /*
+     * call user code
+     */
+    return rdbmsRelTable_cache_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_item_free(rdbmsRelTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+    DEBUGMSGTL(("internal:rdbmsRelTable:_cache_item_free","called\n"));
+
+    if(NULL == rowreq_ctx)
+        return;
+
+    rdbmsRelTable_release_rowreq_ctx(rowreq_ctx);
+} /* _cache_item_free */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+    netsnmp_container *container;
+
+    DEBUGMSGTL(("internal:rdbmsRelTable:_cache_free","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache in rdbmsRelTable_cache_free\n");
+        return;
+    }
+
+    container = (netsnmp_container*)cache->magic;
+
+    /*
+     * call user code
+     */
+    rdbmsRelTable_cache_free(container);
+    
+    /*
+     * free all items. inefficient, but easy.
+     */
+    CONTAINER_CLEAR(container,
+                    (netsnmp_container_obj_func *)_cache_item_free,
+                    NULL);
+} /* _cache_free */
+
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_rdbmsRelTable_container_init(rdbmsRelTable_interface_ctx *if_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsRelTable:_rdbmsRelTable_container_init","called\n"));
+    
+    /*
+     * set up the cache
+     */
+    if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+                                         _cache_load, _cache_free,
+                                         rdbmsRelTable_oid,
+                                         rdbmsRelTable_oid_size);
+
+    if(NULL == if_ctx->cache) {
+        snmp_log(LOG_ERR, "error creating cache for rdbmsRelTable\n");
+        return;
+    }
+
+    if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+    rdbmsRelTable_container_init(&if_ctx->container, if_ctx->cache);
+    if(NULL == if_ctx->container)
+        if_ctx->container = netsnmp_container_find("rdbmsRelTable:table_container");
+    if(NULL == if_ctx->container) {
+        snmp_log(LOG_ERR,"error creating container in "
+                 "rdbmsRelTable_container_init\n");
+        return;
+    }
+    if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _rdbmsRelTable_container_init */
+
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_interface.h b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_interface.h
new file mode 100644 (file)
index 0000000..148c92d
--- /dev/null
@@ -0,0 +1,50 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable_interface.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable_interface.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSRELTABLE_INTERFACE_H
+#define RDBMSRELTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "rdbmsRelTable.h"
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _rdbmsRelTable_initialize_interface(rdbmsRelTable_registration_ptr user_ctx,
+                                    u_long flags);
+
+    rdbmsRelTable_rowreq_ctx * rdbmsRelTable_allocate_rowreq_ctx(void);
+void rdbmsRelTable_release_rowreq_ctx(rdbmsRelTable_rowreq_ctx *rowreq_ctx);
+
+int rdbmsRelTable_index_to_oid(netsnmp_index *oid_idx,
+                            rdbmsRelTable_mib_index *mib_idx);
+int rdbmsRelTable_index_from_oid(netsnmp_index *oid_idx,
+                              rdbmsRelTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void rdbmsRelTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSRELTABLE_INTERFACE_H */
diff --git a/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_oids.h b/RDBMS-MIB_src/rdbmsRelTable/rdbmsRelTable_oids.h
new file mode 100644 (file)
index 0000000..371f101
--- /dev/null
@@ -0,0 +1,35 @@
+/*-------------------------------------------------------------------------
+ * rdbmsRelTable_oids.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsRelTable_oids.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSRELTABLE_OIDS_H
+#define RDBMSRELTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table rdbmsRelTable */
+#define RDBMSRELTABLE_OID              1,3,6,1,2,1,39,1,9
+#define COLUMN_RDBMSRELSTATE           1
+#define COLUMN_RDBMSRELACTIVETIME              2
+
+#define RDBMSRELTABLE_MIN_COL          COLUMN_RDBMSRELSTATE
+#define RDBMSRELTABLE_MAX_COL          COLUMN_RDBMSRELACTIVETIME
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSRELTABLE_OIDS_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/README b/RDBMS-MIB_src/rdbmsSrvInfoTable/README
new file mode 100644 (file)
index 0000000..d2cd2fe
--- /dev/null
@@ -0,0 +1 @@
+For PostgreSQL version 8.0.x, rdbmsSrvInfoStartupTime is not properly reported, because that information is unavailable.
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable.c b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable.c
new file mode 100644 (file)
index 0000000..264eb69
--- /dev/null
@@ -0,0 +1,127 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable.c,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsSrvInfoTable.h"
+
+/*#include <net-snmp/agent/mib_modules.h> */
+
+#include "rdbmsSrvInfoTable_interface.h"
+
+oid rdbmsSrvInfoTable_oid[] = { RDBMSSRVINFOTABLE_OID };
+int rdbmsSrvInfoTable_oid_size = OID_LENGTH(rdbmsSrvInfoTable_oid);
+
+void initialize_table_rdbmsSrvInfoTable(void);
+
+
+/**
+ * Initializes the rdbmsSrvInfoTable module
+ */
+void
+init_rdbmsSrvInfoTable(void)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:init_rdbmsSrvInfoTable","called\n"));
+
+    /*
+     * TODO:300:o: Perform rdbmsSrvInfoTable one-time module initialization.
+     */
+     
+    /*
+     * here we initialize all the tables we're planning on supporting
+     */
+    if (should_init("rdbmsSrvInfoTable"))
+        initialize_table_rdbmsSrvInfoTable();
+
+} /* init_rdbmsSrvInfoTable */
+
+/**
+ * Initialize the table rdbmsSrvInfoTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+initialize_table_rdbmsSrvInfoTable(void)
+{
+    rdbmsSrvInfoTable_registration_ptr user_context;
+    u_long flags;
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:initialize_table_rdbmsSrvInfoTable","called\n"));
+
+    /*
+     * TODO:301:o: Perform rdbmsSrvInfoTable one-time table initialization.
+     */
+
+    /*
+     * TODO:302:o: |->Initialize rdbmsSrvInfoTable user context
+     * if you'd like to pass in a pointer to some data for this
+     * table, allocate or set it up here.
+     */
+    /*
+     * a netsnmp_data_list is a simple way to store void pointers. A simple
+     * string token is used to add, find or remove pointers.
+     */
+    user_context = netsnmp_create_data_list("rdbmsSrvInfoTable", NULL, NULL);
+    
+    /*
+     * No support for any flags yet, but in the future you would
+     * set any flags here.
+     */
+    flags = 0;
+    
+    /*
+     * call interface initialization code
+     */
+    _rdbmsSrvInfoTable_initialize_interface(user_context, flags);
+} /* initialize_table_rdbmsSrvInfoTable */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_ERROR                : other error
+ */
+int
+rdbmsSrvInfoTable_pre_request(rdbmsSrvInfoTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_pre_request","called\n"));
+
+    /*
+     * TODO:510:o: Perform rdbmsSrvInfoTable pre-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : other error (ignored)
+ */
+int
+rdbmsSrvInfoTable_post_request(rdbmsSrvInfoTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_post_request","called\n"));
+
+    /*
+     * TODO:511:o: Perform rdbmsSrvInfoTable pos-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoTable_post_request */
+
+
+/** @{ */
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable.h b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable.h
new file mode 100644 (file)
index 0000000..77389c6
--- /dev/null
@@ -0,0 +1,262 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVINFOTABLE_H
+#define RDBMSSRVINFOTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @defgroup misc misc: Miscelaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+    /* *INDENT-OFF*  */
+config_require(RDBMS-MIB/rdbmsSrvInfoTable/rdbmsSrvInfoTable_interface);
+config_require(RDBMS-MIB/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_access);
+config_require(RDBMS-MIB/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_get);
+config_require(RDBMS-MIB/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_set);
+    /* *INDENT-ON*  */
+
+/* OID and column number definitions for  */
+#include "rdbmsSrvInfoTable_oids.h"
+
+/* enum definions */
+#include "rdbmsSrvInfoTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_rdbmsSrvInfoTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvInfoTable is subid 6 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.6, length: 9
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+    /*
+     * TODO:101:o: |-> Review rdbmsSrvInfoTable registration context.
+     */
+typedef netsnmp_data_list * rdbmsSrvInfoTable_registration_ptr;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review rdbmsSrvInfoTable data context structure.
+ * This structure is used to represent the data for rdbmsSrvInfoTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * rdbmsSrvInfoTable.
+ */
+typedef struct rdbmsSrvInfoTable_data_s {
+    
+        /*
+         * rdbmsSrvInfoStartupTime(1)/DateAndTime/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+         */
+/*   char   rdbmsSrvInfoStartupTime[11];
+size_t      rdbmsSrvInfoStartupTime_len; *//* # of char elements, not bytes */
+       int startupYear;
+       int startupMonth;
+       int startupDay;
+       int startupHour;
+       int startupMinutes;
+       int startupSeconds;
+       int startupDeciSeconds;
+       int startupUtcOffsetDirection;
+       int startupUtcOffsetHours;
+       int startupUtcOffsetMinutes;
+
+        /*
+         * rdbmsSrvInfoFinishedTransactions(2)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoFinishedTransactions;
+    
+        /*
+         * rdbmsSrvInfoDiskReads(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoDiskReads;
+    
+        /*
+         * rdbmsSrvInfoLogicalReads(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoLogicalReads;
+    
+        /*
+         * rdbmsSrvInfoDiskWrites(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoDiskWrites;
+    
+        /*
+         * rdbmsSrvInfoLogicalWrites(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoLogicalWrites;
+    
+        /*
+         * rdbmsSrvInfoPageReads(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoPageReads;
+    
+        /*
+         * rdbmsSrvInfoPageWrites(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoPageWrites;
+    
+        /*
+         * rdbmsSrvInfoDiskOutOfSpaces(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoDiskOutOfSpaces;
+    
+        /*
+         * rdbmsSrvInfoHandledRequests(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoHandledRequests;
+    
+        /*
+         * rdbmsSrvInfoRequestRecvs(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoRequestRecvs;
+    
+        /*
+         * rdbmsSrvInfoRequestSends(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoRequestSends;
+    
+        /*
+         * rdbmsSrvInfoHighwaterInboundAssociations(13)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoHighwaterInboundAssociations;
+    
+        /*
+         * rdbmsSrvInfoMaxInboundAssociations(14)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/W/e/r/d/h
+         */
+   u_long   rdbmsSrvInfoMaxInboundAssociations;
+    
+} rdbmsSrvInfoTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review rdbmsSrvInfoTable mib index.
+ * This structure is used to represent the index for rdbmsSrvInfoTable.
+ */
+typedef struct rdbmsSrvInfoTable_mib_index_s {
+
+        /*
+         * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   applIndex;
+
+
+} rdbmsSrvInfoTable_mib_index;
+
+    /*
+     * TODO:121:r: |   |-> Review rdbmsSrvInfoTable max index length.
+     * If you KNOW that your indexes will never exceed a certain
+     * length, update this macro to that length.
+*/
+#define MAX_rdbmsSrvInfoTable_IDX_LEN     1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review rdbmsSrvInfoTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * rdbmsSrvInfoTable_rowreq_ctx pointer.
+ */
+typedef struct rdbmsSrvInfoTable_rowreq_ctx_s {
+
+    /** this must be first for container compare to work */
+    netsnmp_index        oid_idx;
+    oid                  oid_tmp[MAX_rdbmsSrvInfoTable_IDX_LEN];
+    
+    rdbmsSrvInfoTable_mib_index        tbl_idx;
+    
+    rdbmsSrvInfoTable_data              data;
+
+    /*
+     * flags per row. Currently, the first (lower) 8 bits are reserved
+     * for the user. See mfd.h for other flags.
+     */
+    u_int                       rowreq_flags;
+
+    /*
+     * implementor's context pointer (provided during registration)
+     */
+    rdbmsSrvInfoTable_registration_ptr rdbmsSrvInfoTable_reg;
+
+    /*
+     * TODO:131:o: |   |-> Add useful data to rdbmsSrvInfoTable rowreq context.
+     */
+    
+    /*
+     * storage for future expansion
+     */
+    netsnmp_data_list             *rdbmsSrvInfoTable_data_list;
+
+} rdbmsSrvInfoTable_rowreq_ctx;
+
+typedef struct rdbmsSrvInfoTable_ref_rowreq_ctx_s {
+    rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx;
+} rdbmsSrvInfoTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+    int rdbmsSrvInfoTable_pre_request(rdbmsSrvInfoTable_registration_ptr user_context);
+    int rdbmsSrvInfoTable_post_request(rdbmsSrvInfoTable_registration_ptr user_context);
+
+
+extern oid rdbmsSrvInfoTable_oid[];
+extern int rdbmsSrvInfoTable_oid_size;
+
+
+#include "rdbmsSrvInfoTable_interface.h"
+#include "rdbmsSrvInfoTable_data_access.h"
+#include "rdbmsSrvInfoTable_data_get.h"
+#include "rdbmsSrvInfoTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVINFOTABLE_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_access.c b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_access.c
new file mode 100644 (file)
index 0000000..af424be
--- /dev/null
@@ -0,0 +1,340 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable_data_access.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable_data_access.c,v 1.7 2009/06/06 04:12:10 eggyknap Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsSrvInfoTable.h"
+
+
+#include "rdbmsSrvInfoTable_data_access.h"
+
+/** @defgroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ * 
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvInfoTable is subid 6 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.6, length: 9
+*/
+
+/**
+ * initialization for rdbmsSrvInfoTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param rdbmsSrvInfoTable_reg
+ *        Pointer to rdbmsSrvInfoTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : unrecoverable error.
+ */
+int
+rdbmsSrvInfoTable_init_data(rdbmsSrvInfoTable_registration_ptr rdbmsSrvInfoTable_reg)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_init_data","called\n"));
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoTable_init_data */
+
+/**
+ * container-cached overview
+ *
+ */
+
+/***********************************************************************
+ *
+ * cache
+ *
+ ***********************************************************************/
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ *        create a custom container, use this parameter to return it
+ *        to the MFD helper. If set to NULL, the MFD helper will
+ *        allocate a container for you.
+ * @param  cache A pointer to a cache structure. You can set the timeout
+ *         and other cache flags using this pointer.
+ *
+ *  This function is called at startup to allow you to customize certain
+ *  aspects of the access method. For the most part, it is for advanced
+ *  users. The default code should suffice for most cases. If no custom
+ *  container is allocated, the MFD code will create one for your.
+ *
+ *  This is also the place to set up cache behavior. The default, to
+ *  simply set the cache timeout, will work well with the default
+ *  container. If you are using a custom container, you may want to
+ *  look at the cache helper documentation to see if there are any
+ *  flags you want to set.
+ *
+ * @remark
+ *  This would also be a good place to do any initialization needed
+ *  for you data source. For example, opening a connection to another
+ *  process that will supply the data, opening a database, etc.
+ */
+void
+rdbmsSrvInfoTable_container_init(netsnmp_container **container_ptr_ptr,
+                        netsnmp_cache *cache)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_container_init","called\n"));
+    
+    if((NULL == cache) || (NULL == container_ptr_ptr)) {
+        snmp_log(LOG_ERR,"bad params to rdbmsSrvInfoTable_container_init\n");
+        return;
+    }
+
+    /*
+     * For advanced users, you can use a custom container. If you
+     * do not create one, one will be created for you.
+     */
+    *container_ptr_ptr = NULL;
+
+    /*
+     * TODO:345:A: Set up rdbmsSrvInfoTable cache properties.
+     *
+     * Also for advanced users, you can set parameters for the
+     * cache. Do not change the magic pointer, as it is used
+     * by the MFD helper. To completely disable caching, set
+     * cache->enabled to 0.
+     */
+    cache->timeout = RDBMSSRVINFOTABLE_CACHE_TIMEOUT; /* seconds */
+} /* rdbmsSrvInfoTable_container_init */
+
+/**
+ * load cache data
+ *
+ * TODO:350:M: Implement rdbmsSrvInfoTable cache load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR                : other error.
+ *
+ *  This function is called to cache the index(es) (and data, optionally)
+ *  for the every row in the data set.
+ *
+ * @remark
+ *  While loading the cache, the only important thing is the indexes.
+ *  If access to your data is cheap/fast (e.g. you have a pointer to a
+ *  structure in memory), it would make sense to update the data here.
+ *  If, however, the accessing the data invovles more work (e.g. parsing
+ *  some other existing data, or peforming calculations to derive the data),
+ *  then you can limit yourself to setting the indexes and saving any
+ *  information you will need later. Then use the saved information in
+ *  rdbmsSrvInfoTable_row_prep() for populating data.
+ *
+ * @note
+ *  If you need consistency between rows (like you want statistics
+ *  for each row to be from the same time frame), you should set all
+ *  data here.
+ *
+ */
+int
+rdbmsSrvInfoTable_cache_load(netsnmp_container *container)
+{
+    rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx;
+    size_t                 count = 0;
+    PGresult *pg_db_qry;
+    static int maxAssociations = 0;
+    
+   long   applIndex;
+   int resultCount, tmpInt, rdbmsSrvInfoMaxInboundAssociations = 0, i, errorCode = MFD_SUCCESS;
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_cache_load","called\n"));
+
+    if (PQstatus(dbconn) == CONNECTION_OK) {
+           pg_db_qry = PQexec(dbconn, "SELECT setting FROM pg_settings WHERE name = 'max_connections'");
+           if (PQresultStatus(pg_db_qry) == PGRES_TUPLES_OK) 
+                   rdbmsSrvInfoMaxInboundAssociations = atoi(PQgetvalue(pg_db_qry, 0, 0));
+           PQclear(pg_db_qry);
+           pg_db_qry = PQexec(dbconn, "SELECT setting FROM pg_settings WHERE name = 'superuser_reserved_connections'");
+           if (PQresultStatus(pg_db_qry) == PGRES_TUPLES_OK) 
+                   rdbmsSrvInfoMaxInboundAssociations -= atoi(PQgetvalue(pg_db_qry, 0, 0));
+           PQclear(pg_db_qry);
+           pg_db_qry = PQexec(dbconn, "SELECT count(1) FROM pg_stat_activity");
+           if (PQresultStatus(pg_db_qry) == PGRES_TUPLES_OK) {
+                   tmpInt = atoi(PQgetvalue(pg_db_qry, 0, 0));
+                   maxAssociations = (tmpInt > maxAssociations) ? tmpInt : maxAssociations;
+           }
+           PQclear(pg_db_qry);
+           if (PQserverVersion(dbconn) < 80100)
+                   pg_db_qry = PQexec(dbconn, "SELECT datid, EXTRACT(YEAR FROM now()), EXTRACT(MONTH FROM now()), EXTRACT(DAY FROM now()), EXTRACT(HOUR FROM now()), EXTRACT(MINUTE FROM now()), EXTRACT(SECOND FROM now()), EXTRACT(MILLISECOND FROM now()), EXTRACT(TIMEZONE_HOUR FROM now()), EXTRACT(TIMEZONE_MINUTE FROM now()), xact_commit, blks_read, blks_read + blks_hit  FROM pg_stat_database");
+            else
+                   pg_db_qry = PQexec(dbconn, "SELECT datid, EXTRACT(YEAR FROM pg_postmaster_start_time()), EXTRACT(MONTH FROM pg_postmaster_start_time()), EXTRACT(DAY FROM pg_postmaster_start_time()), EXTRACT(HOUR FROM pg_postmaster_start_time()), EXTRACT(MINUTE FROM pg_postmaster_start_time()), EXTRACT(SECOND FROM pg_postmaster_start_time()), EXTRACT(MILLISECOND FROM pg_postmaster_start_time()), EXTRACT(TIMEZONE_HOUR FROM pg_postmaster_start_time()), EXTRACT(TIMEZONE_MINUTE FROM pg_postmaster_start_time()), xact_commit, blks_read, blks_read + blks_hit  FROM pg_stat_database");
+    }
+    else {
+           snmp_log(LOG_ERR, "Can't get connected to the database");
+           return -1;
+    }
+    if (PQresultStatus(pg_db_qry) != PGRES_TUPLES_OK) {
+           snmp_log(LOG_ERR, "Didn't get any results from the database");
+           PQclear(pg_db_qry);
+           /*PQfinish(dbconn);*/
+           return -1;
+    }
+
+    resultCount = PQntuples(pg_db_qry);
+
+    /*
+     * TODO:351:M: |-> Load/update data in the rdbmsSrvInfoTable container.
+     * loop over your rdbmsSrvInfoTable data, allocate a rowreq context,
+     * set the index(es) [and data, optionally] and insert into
+     * the container.
+     */
+    for (i = 0; i < resultCount; i++) {
+
+        /*
+         * TODO:352:M: |   |-> set indexes in new rdbmsSrvInfoTable rowreq context.
+         */
+        rowreq_ctx = rdbmsSrvInfoTable_allocate_rowreq_ctx();
+        if (NULL == rowreq_ctx) {
+            snmp_log(LOG_ERR, "memory allocation failed\n");
+           errorCode = MFD_RESOURCE_UNAVAILABLE;
+           break;
+        }
+       applIndex = atoi(PQgetvalue(pg_db_qry, i, 0));
+        if(MFD_SUCCESS != rdbmsSrvInfoTable_indexes_set(rowreq_ctx
+                               , applIndex
+               )) {
+            snmp_log(LOG_ERR,"error setting index while loading "
+                     "rdbmsSrvInfoTable cache.\n");
+            rdbmsSrvInfoTable_release_rowreq_ctx(rowreq_ctx);
+            continue;
+        }
+
+       rowreq_ctx->data.startupYear = atoi(PQgetvalue(pg_db_qry, i, 1));
+       rowreq_ctx->data.startupMonth = atoi(PQgetvalue(pg_db_qry, i, 2));
+       rowreq_ctx->data.startupDay = atoi(PQgetvalue(pg_db_qry, i, 3));
+       rowreq_ctx->data.startupHour = atoi(PQgetvalue(pg_db_qry, i, 4));
+       rowreq_ctx->data.startupMinutes = atoi(PQgetvalue(pg_db_qry, i, 5));
+       rowreq_ctx->data.startupSeconds = atoi(PQgetvalue(pg_db_qry, i, 6));
+       rowreq_ctx->data.startupDeciSeconds = atoi(PQgetvalue(pg_db_qry, i, 7));
+       rowreq_ctx->data.startupUtcOffsetHours = atoi(PQgetvalue(pg_db_qry, i, 8));
+       rowreq_ctx->data.startupUtcOffsetMinutes = atoi(PQgetvalue(pg_db_qry, i, 9));
+       tmpInt = rowreq_ctx->data.startupUtcOffsetHours * 60 + rowreq_ctx->data.startupUtcOffsetMinutes;
+       if (tmpInt == 0)
+               rowreq_ctx->data.startupUtcOffsetDirection = 0;
+       else 
+               rowreq_ctx->data.startupUtcOffsetDirection = (tmpInt > 0 ? 1 : -1);
+    
+    rowreq_ctx->data.rdbmsSrvInfoFinishedTransactions = atoi(PQgetvalue(pg_db_qry, i, 10));
+    
+    rowreq_ctx->data.rdbmsSrvInfoDiskReads = atoi(PQgetvalue(pg_db_qry, i, 11));
+    
+    rowreq_ctx->data.rdbmsSrvInfoLogicalReads = atoi(PQgetvalue(pg_db_qry, i, 12));
+    
+    /* Skip this unless someone comes up with a way to get these data */
+    /*rowreq_ctx->data.rdbmsSrvInfoDiskWrites = rdbmsSrvInfoDiskWrites;
+
+    rowreq_ctx->data.rdbmsSrvInfoLogicalWrites = rdbmsSrvInfoLogicalWrites;  */
+    
+    rowreq_ctx->data.rdbmsSrvInfoPageReads = rowreq_ctx->data.rdbmsSrvInfoDiskReads;
+    
+    /*rowreq_ctx->data.rdbmsSrvInfoPageWrites = rdbmsSrvInfoPageWrites; */
+    
+    /* pgsql will have a fatal error if this happens, so the value must be 0 if we're connected to a db server */
+    rowreq_ctx->data.rdbmsSrvInfoDiskOutOfSpaces = 0; 
+    
+    /* rowreq_ctx->data.rdbmsSrvInfoHandledRequests = rdbmsSrvInfoHandledRequests;
+    
+    rowreq_ctx->data.rdbmsSrvInfoRequestRecvs = rdbmsSrvInfoRequestRecvs;
+    
+    rowreq_ctx->data.rdbmsSrvInfoRequestSends = rdbmsSrvInfoRequestSends; */
+    
+    rowreq_ctx->data.rdbmsSrvInfoHighwaterInboundAssociations = maxAssociations; 
+    
+    rowreq_ctx->data.rdbmsSrvInfoMaxInboundAssociations = rdbmsSrvInfoMaxInboundAssociations;
+    
+        
+        /*
+         * insert into table container
+         */
+        CONTAINER_INSERT(container, rowreq_ctx);
+        ++count;
+    }
+
+
+    DEBUGMSGT(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_cache_load",
+               "inserted %d records\n", count));
+
+    PQclear(pg_db_qry);
+    return errorCode;
+} /* rdbmsSrvInfoTable_cache_load */
+
+/**
+ * cache clean up
+ *
+ * @param container container with all current items
+ *
+ *  This optional callback is called prior to all
+ *  item's being removed from the container. If you
+ *  need to do any processing before that, do it here.
+ *
+ * @note
+ *  The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+rdbmsSrvInfoTable_cache_free(netsnmp_container *container)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_cache_free","called\n"));
+
+    /*
+     * TODO:380:M: Free rdbmsSrvInfoTable cache.
+     */
+} /* rdbmsSrvInfoTable_cache_free */
+
+/**
+ * prepare row for processing.
+ *
+ *  When the agent has located the row for a request, this function is
+ *  called to prepare the row for processing. If you fully populated
+ *  the data context during the index setup phase, you may not need to
+ *  do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ */
+int
+rdbmsSrvInfoTable_row_prep( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_row_prep","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:390:o: Prepare row for request.
+     * If populating row data was delayed, this is the place to
+     * fill in the row for this request.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoTable_row_prep */
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_access.h b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_access.h
new file mode 100644 (file)
index 0000000..51b463b
--- /dev/null
@@ -0,0 +1,77 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable_data_access.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable_data_access.h,v 1.3 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVINFOTABLE_DATA_ACCESS_H
+#define RDBMSSRVINFOTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvInfoTable is subid 6 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.6, length: 9
+*/
+
+
+    int rdbmsSrvInfoTable_init_data(rdbmsSrvInfoTable_registration_ptr rdbmsSrvInfoTable_reg);
+
+
+/*
+ * TODO:180:o: Review rdbmsSrvInfoTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define RDBMSSRVINFOTABLE_CACHE_TIMEOUT   10
+
+void rdbmsSrvInfoTable_container_init(netsnmp_container **container_ptr_ptr,
+                             netsnmp_cache *cache);
+int rdbmsSrvInfoTable_cache_load(netsnmp_container *container);
+void rdbmsSrvInfoTable_cache_free(netsnmp_container *container);
+
+    /*
+    ***************************************************
+    ***             START EXAMPLE CODE              ***
+    ***---------------------------------------------***/
+/* *********************************************************************
+ * Since we have no idea how you really access your data, we'll go with
+ * a worst case example: a flat text file.
+ */
+#define MAX_LINE_SIZE 256
+    /*
+    ***---------------------------------------------***
+    ***              END  EXAMPLE CODE              ***
+    ***************************************************/
+    int rdbmsSrvInfoTable_row_prep( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVINFOTABLE_DATA_ACCESS_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_get.c b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_get.c
new file mode 100644 (file)
index 0000000..e0ff3bc
--- /dev/null
@@ -0,0 +1,1429 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable_data_get.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable_data_get.c,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsSrvInfoTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement rdbmsSrvInfoTable get routines.
+ * TODO:240:M: Implement rdbmsSrvInfoTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvInfoTable is subid 6 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.6, length: 9
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement rdbmsSrvInfoTable data context functions.
+ */
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This convenience function is useful for setting all the MIB index
+ *  components with a single function call. It is assume that the C values
+ *  have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+rdbmsSrvInfoTable_indexes_set_tbl_idx(rdbmsSrvInfoTable_mib_index *tbl_idx, long applIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_indexes_set_tbl_idx","called\n"));
+
+    /* applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->applIndex = applIndex_val;
+    
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This function sets the mib indexs, then updates the oid indexs
+ *  from the mib index.
+ */
+int
+rdbmsSrvInfoTable_indexes_set(rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, long applIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_indexes_set","called\n"));
+
+    if(MFD_SUCCESS != rdbmsSrvInfoTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+                                   , applIndex_val
+           ))
+        return MFD_ERROR;
+
+    /*
+     * convert mib index to oid index
+     */
+    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+    if(0 != rdbmsSrvInfoTable_index_to_oid(&rowreq_ctx->oid_idx,
+                                    &rowreq_ctx->tbl_idx)) {
+        return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoStartupTime
+ * rdbmsSrvInfoStartupTime is subid 1 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.1
+ * Description:
+The date and time at which this server was last started.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 2d-1d-1d,1d:1d:1d.1d,1a1d:1d
+ *
+ * Ranges:  8, 11;
+ *
+ * Its syntax is DateAndTime (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 11)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoStartupTime.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoStartupTime_map(char **mib_rdbmsSrvInfoStartupTime_val_ptr_ptr, size_t *mib_rdbmsSrvInfoStartupTime_val_ptr_len_ptr, char *raw_rdbmsSrvInfoStartupTime_val_ptr, size_t raw_rdbmsSrvInfoStartupTime_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsSrvInfoStartupTime_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsSrvInfoStartupTime_val_ptr_ptr) && (NULL != mib_rdbmsSrvInfoStartupTime_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoStartupTime_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsSrvInfoStartupTime non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsSrvInfoStartupTime_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsSrvInfoStartupTime_val_ptr_ptr) || (*mib_rdbmsSrvInfoStartupTime_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsSrvInfoStartupTime_val_ptr_ptr = realloc( *mib_rdbmsSrvInfoStartupTime_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsSrvInfoStartupTime_val_ptr_ptr));
+        if(NULL == *mib_rdbmsSrvInfoStartupTime_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsSrvInfoStartupTime_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsSrvInfoStartupTime_val_ptr_ptr, raw_rdbmsSrvInfoStartupTime_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoStartupTime_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoStartupTime data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoStartupTime_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsSrvInfoStartupTime_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsSrvInfoStartupTime.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsSrvInfoStartupTime_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsSrvInfoStartupTime_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsSrvInfoStartupTime_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvInfoStartupTime_val_ptr_ptr, size_t *rdbmsSrvInfoStartupTime_val_ptr_len_ptr )
+{
+       int rc;
+   /** we should have a pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsSrvInfoStartupTime_val_ptr_ptr) && (NULL != *rdbmsSrvInfoStartupTime_val_ptr_ptr));
+   netsnmp_assert( (NULL != rdbmsSrvInfoStartupTime_val_ptr_len_ptr) && ((* rdbmsSrvInfoStartupTime_val_ptr_len_ptr) >= 11));
+
+   /* call convenience function to set data */
+   rc = netsnmp_dateandtime_set_buf_from_vars((u_char *)*rdbmsSrvInfoStartupTime_val_ptr_ptr, rdbmsSrvInfoStartupTime_val_ptr_len_ptr,
+       rowreq_ctx->data.startupYear,
+       rowreq_ctx->data.startupMonth,
+       rowreq_ctx->data.startupDay,
+       rowreq_ctx->data.startupHour,
+       rowreq_ctx->data.startupMinutes,
+       rowreq_ctx->data.startupSeconds,
+       rowreq_ctx->data.startupDeciSeconds,
+       rowreq_ctx->data.startupUtcOffsetDirection,
+       rowreq_ctx->data.startupUtcOffsetHours,
+       rowreq_ctx->data.startupUtcOffsetMinutes);
+   if(rc != SNMP_ERR_NOERROR)
+      return rc;
+
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoStartupTime_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoFinishedTransactions
+ * rdbmsSrvInfoFinishedTransactions is subid 2 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.2
+ * Description:
+The number of transactions visible to this server that have
+           been completed by either commit or abort.  Some database
+           operations, such as read-only queries, may not result in the
+           creation of a transaction.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is GAUGE (based on perltype GAUGE)
+ * The net-snmp type is ASN_GAUGE. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoFinishedTransactions.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoFinishedTransactions_map(u_long *mib_rdbmsSrvInfoFinishedTransactions_val_ptr, u_long raw_rdbmsSrvInfoFinishedTransactions_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoFinishedTransactions_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoFinishedTransactions_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoFinishedTransactions mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoFinishedTransactions_val_ptr) = raw_rdbmsSrvInfoFinishedTransactions_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoFinishedTransactions_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoFinishedTransactions data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoFinishedTransactions_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoFinishedTransactions_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoFinishedTransactions_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoFinishedTransactions_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoFinishedTransactions_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoFinishedTransactions data.
+ * set (* rdbmsSrvInfoFinishedTransactions_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoFinishedTransactions_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoFinishedTransactions;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoFinishedTransactions_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoDiskReads
+ * rdbmsSrvInfoDiskReads is subid 3 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.3
+ * Description:
+The total number of reads of database files issued to the
+           operating system by this server since startup.  Numbers are
+           not comparable between products.  What constitutes a
+           readand how it is accounted is product-specific.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoDiskReads.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoDiskReads_map(u_long *mib_rdbmsSrvInfoDiskReads_val_ptr, u_long raw_rdbmsSrvInfoDiskReads_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoDiskReads_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoDiskReads_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoDiskReads mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoDiskReads_val_ptr) = raw_rdbmsSrvInfoDiskReads_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoDiskReads_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoDiskReads data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoDiskReads_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoDiskReads_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoDiskReads_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoDiskReads_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoDiskReads_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoDiskReads data.
+ * set (* rdbmsSrvInfoDiskReads_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoDiskReads_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoDiskReads;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoDiskReads_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoLogicalReads
+ * rdbmsSrvInfoLogicalReads is subid 4 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.4
+ * Description:
+The total number of logical reads of database files made
+           internally by this server since startup.  The values of this
+           object and those of rdbmsSrvInfoDiskReads reveal the effect
+           of caching on read operation. Numbers are not comparable
+           between products, and may only be meaningful when aggregated
+           across all servers sharing a common cache.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoLogicalReads.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoLogicalReads_map(u_long *mib_rdbmsSrvInfoLogicalReads_val_ptr, u_long raw_rdbmsSrvInfoLogicalReads_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoLogicalReads_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoLogicalReads_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoLogicalReads mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoLogicalReads_val_ptr) = raw_rdbmsSrvInfoLogicalReads_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoLogicalReads_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoLogicalReads data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoLogicalReads_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoLogicalReads_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoLogicalReads_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoLogicalReads_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoLogicalReads_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoLogicalReads data.
+ * set (* rdbmsSrvInfoLogicalReads_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoLogicalReads_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoLogicalReads;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoLogicalReads_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoDiskWrites
+ * rdbmsSrvInfoDiskWrites is subid 5 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.5
+ * Description:
+The total number of writes to database files issued to the
+           operating system by this server since startup.  Numbers are
+           not comparable between products.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoDiskWrites.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoDiskWrites_map(u_long *mib_rdbmsSrvInfoDiskWrites_val_ptr, u_long raw_rdbmsSrvInfoDiskWrites_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoDiskWrites_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoDiskWrites_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoDiskWrites mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoDiskWrites_val_ptr) = raw_rdbmsSrvInfoDiskWrites_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoDiskWrites_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoDiskWrites data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoDiskWrites_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoDiskWrites_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoDiskWrites_val_ptr )
+{
+       return MFD_SKIP;
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoDiskWrites_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoDiskWrites_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoDiskWrites data.
+ * set (* rdbmsSrvInfoDiskWrites_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoDiskWrites_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoDiskWrites;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoDiskWrites_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoLogicalWrites
+ * rdbmsSrvInfoLogicalWrites is subid 6 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.6
+ * Description:
+The total number of times parts of the database files have
+           been marked 'dirty' and in need of writing to the disk.  This
+           value and rdbmsSrvInfoDiskWrites give some indication of the
+           effect of 'write-behind' strategies in reducing the number of
+           disk writes compared to database operations.  Because the
+           writes may be done by servers other than those marking the
+           parts of the database files dirty, these values may only be
+           meaningful when aggregated across all servers sharing a
+           common cache.  Numbers are not comparable between products.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoLogicalWrites.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoLogicalWrites_map(u_long *mib_rdbmsSrvInfoLogicalWrites_val_ptr, u_long raw_rdbmsSrvInfoLogicalWrites_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoLogicalWrites_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoLogicalWrites_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoLogicalWrites mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoLogicalWrites_val_ptr) = raw_rdbmsSrvInfoLogicalWrites_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoLogicalWrites_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoLogicalWrites data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoLogicalWrites_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoLogicalWrites_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoLogicalWrites_val_ptr )
+{
+       return MFD_SKIP;
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoLogicalWrites_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoLogicalWrites_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoLogicalWrites data.
+ * set (* rdbmsSrvInfoLogicalWrites_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoLogicalWrites_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoLogicalWrites;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoLogicalWrites_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoPageReads
+ * rdbmsSrvInfoPageReads is subid 7 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.7
+ * Description:
+The total number of pages in database files read by this
+           server since startup.  'Pages' are product specific units of
+           disk i/o operations.  This value, along with
+           rdbmsSrvInfoDiskReads, reveals the effect of any grouping
+           read-ahead that may be used to enhance performance of some
+           queries, such as scans.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoPageReads.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoPageReads_map(u_long *mib_rdbmsSrvInfoPageReads_val_ptr, u_long raw_rdbmsSrvInfoPageReads_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoPageReads_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoPageReads_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoPageReads mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoPageReads_val_ptr) = raw_rdbmsSrvInfoPageReads_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoPageReads_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoPageReads data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoPageReads_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoPageReads_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoPageReads_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoPageReads_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoPageReads_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoPageReads data.
+ * set (* rdbmsSrvInfoPageReads_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoPageReads_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoPageReads;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoPageReads_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoPageWrites
+ * rdbmsSrvInfoPageWrites is subid 8 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.8
+ * Description:
+The total number of pages in database files written by this
+           server since startup.  Pages are product-specific units of
+           disk I/O.  This value, with rdbmsSrvInfoDiskWrites, shows the
+           effect of write strategies that collapse logical writes of
+           contiguous pages into single calls to the operating system.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoPageWrites.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoPageWrites_map(u_long *mib_rdbmsSrvInfoPageWrites_val_ptr, u_long raw_rdbmsSrvInfoPageWrites_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoPageWrites_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoPageWrites_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoPageWrites mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoPageWrites_val_ptr) = raw_rdbmsSrvInfoPageWrites_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoPageWrites_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoPageWrites data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoPageWrites_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoPageWrites_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoPageWrites_val_ptr )
+{
+       return MFD_SKIP;
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoPageWrites_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoPageWrites_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoPageWrites data.
+ * set (* rdbmsSrvInfoPageWrites_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoPageWrites_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoPageWrites;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoPageWrites_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoDiskOutOfSpaces
+ * rdbmsSrvInfoDiskOutOfSpaces is subid 9 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.9
+ * Description:
+The total number of times the server has been unable to
+           obtain disk space that it wanted, since server startup.  This
+           would be inspected by an agent on receipt of an
+           rdbmsOutOfSpace trap.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoDiskOutOfSpaces.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoDiskOutOfSpaces_map(u_long *mib_rdbmsSrvInfoDiskOutOfSpaces_val_ptr, u_long raw_rdbmsSrvInfoDiskOutOfSpaces_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoDiskOutOfSpaces_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoDiskOutOfSpaces_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoDiskOutOfSpaces mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoDiskOutOfSpaces_val_ptr) = raw_rdbmsSrvInfoDiskOutOfSpaces_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoDiskOutOfSpaces_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoDiskOutOfSpaces data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoDiskOutOfSpaces_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoDiskOutOfSpaces_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoDiskOutOfSpaces_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoDiskOutOfSpaces_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoDiskOutOfSpaces_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoDiskOutOfSpaces data.
+ * set (* rdbmsSrvInfoDiskOutOfSpaces_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoDiskOutOfSpaces_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoDiskOutOfSpaces;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoDiskOutOfSpaces_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoHandledRequests
+ * rdbmsSrvInfoHandledRequests is subid 10 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.10
+ * Description:
+The total number of requests made to the server on inbound
+           associations.  The meaning of 'requests' is product specific,
+           and is not comparable between products.
+
+           This is intended to encapsulate high level semantic
+           operations between clients and servers, or between peers.
+           For instance, one request might correspond to a 'select' or
+           an 'insert' statement.  It is not intended to capture disk
+           i/o described in rdbmsSrvInfoDiskReads and
+           rdbmsSrvInfoDiskWrites.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoHandledRequests.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoHandledRequests_map(u_long *mib_rdbmsSrvInfoHandledRequests_val_ptr, u_long raw_rdbmsSrvInfoHandledRequests_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoHandledRequests_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoHandledRequests_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoHandledRequests mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoHandledRequests_val_ptr) = raw_rdbmsSrvInfoHandledRequests_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoHandledRequests_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoHandledRequests data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoHandledRequests_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoHandledRequests_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoHandledRequests_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoHandledRequests_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoHandledRequests_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoHandledRequests data.
+ * set (* rdbmsSrvInfoHandledRequests_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoHandledRequests_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoHandledRequests;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoHandledRequests_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoRequestRecvs
+ * rdbmsSrvInfoRequestRecvs is subid 11 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.11
+ * Description:
+The number of receive operations made processing any requests
+           on inbound associations. The meaning of operations is product
+           specific, and is not comparable between products.
+
+           This is intended to capture lower-level i/o operations than
+           shown by HandledRequests, between clients and servers, or
+           between peers.  For instance, it might roughly correspond to
+           the amount of data given with an 'insert' statement.  It is
+           not intended to capture disk i/o described in
+           rdbmsSrvInfoDiskReads and rdbmsSrvInfoDiskWrites.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoRequestRecvs.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoRequestRecvs_map(u_long *mib_rdbmsSrvInfoRequestRecvs_val_ptr, u_long raw_rdbmsSrvInfoRequestRecvs_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoRequestRecvs_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoRequestRecvs_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoRequestRecvs mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoRequestRecvs_val_ptr) = raw_rdbmsSrvInfoRequestRecvs_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoRequestRecvs_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoRequestRecvs data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoRequestRecvs_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoRequestRecvs_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoRequestRecvs_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoRequestRecvs_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoRequestRecvs_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoRequestRecvs data.
+ * set (* rdbmsSrvInfoRequestRecvs_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoRequestRecvs_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoRequestRecvs;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoRequestRecvs_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoRequestSends
+ * rdbmsSrvInfoRequestSends is subid 12 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.12
+ * Description:
+The number of send operations made processing requests
+           handled on inbound associations.  The meaning of operations
+           is product specific, and is not comparable between products.
+
+           This is intended to capture lower-level i/o operations than
+           shown by HandledRequests, between between clients and
+           servers, or between peers.  It might roughly correspond to
+           the number of rows returned by a 'select' statement.  It is
+           not intended to capture disk i/o described in DiskReads.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is COUNTER (based on perltype COUNTER)
+ * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoRequestSends.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoRequestSends_map(u_long *mib_rdbmsSrvInfoRequestSends_val_ptr, u_long raw_rdbmsSrvInfoRequestSends_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoRequestSends_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoRequestSends_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoRequestSends mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoRequestSends_val_ptr) = raw_rdbmsSrvInfoRequestSends_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoRequestSends_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoRequestSends data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoRequestSends_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoRequestSends_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoRequestSends_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoRequestSends_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoRequestSends_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoRequestSends data.
+ * set (* rdbmsSrvInfoRequestSends_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoRequestSends_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoRequestSends;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoRequestSends_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoHighwaterInboundAssociations
+ * rdbmsSrvInfoHighwaterInboundAssociations is subid 13 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.6.1.13
+ * Description:
+The greatest number of inbound associations that have been
+           simultaneously open to this server since startup.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is GAUGE (based on perltype GAUGE)
+ * The net-snmp type is ASN_GAUGE. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoHighwaterInboundAssociations.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoHighwaterInboundAssociations_map(u_long *mib_rdbmsSrvInfoHighwaterInboundAssociations_val_ptr, u_long raw_rdbmsSrvInfoHighwaterInboundAssociations_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoHighwaterInboundAssociations_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoHighwaterInboundAssociations_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoHighwaterInboundAssociations mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoHighwaterInboundAssociations_val_ptr) = raw_rdbmsSrvInfoHighwaterInboundAssociations_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoHighwaterInboundAssociations_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoHighwaterInboundAssociations data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoHighwaterInboundAssociations_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoHighwaterInboundAssociations_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoHighwaterInboundAssociations_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoHighwaterInboundAssociations_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoHighwaterInboundAssociations_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoHighwaterInboundAssociations data.
+ * set (* rdbmsSrvInfoHighwaterInboundAssociations_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoHighwaterInboundAssociations_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoHighwaterInboundAssociations;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoHighwaterInboundAssociations_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvInfoEntry.rdbmsSrvInfoMaxInboundAssociations
+ * rdbmsSrvInfoMaxInboundAssociations is subid 14 of rdbmsSrvInfoEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.39.1.6.1.14
+ * Description:
+The greatest number of inbound associations that can be
+           simultaneously open with this server.  If there is no limit,
+           then the value should be zero.
+
+           Note that a compliant agent does not need to
+           allow write access to this object.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   1
+ *
+ *
+ * Its syntax is GAUGE (based on perltype GAUGE)
+ * The net-snmp type is ASN_GAUGE. The C type decl is u_long (u_long)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvInfoMaxInboundAssociations.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvInfoMaxInboundAssociations_map(u_long *mib_rdbmsSrvInfoMaxInboundAssociations_val_ptr, u_long raw_rdbmsSrvInfoMaxInboundAssociations_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvInfoMaxInboundAssociations_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoMaxInboundAssociations_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvInfoMaxInboundAssociations mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvInfoMaxInboundAssociations_val_ptr) = raw_rdbmsSrvInfoMaxInboundAssociations_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoMaxInboundAssociations_map */
+
+/**
+ * Extract the current value of the rdbmsSrvInfoMaxInboundAssociations data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvInfoMaxInboundAssociations_val_ptr
+ *        Pointer to storage for a u_long variable
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+ */
+int
+rdbmsSrvInfoMaxInboundAssociations_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoMaxInboundAssociations_val_ptr )
+{
+   /** we should have a non-NULL pointer */
+   netsnmp_assert( NULL != rdbmsSrvInfoMaxInboundAssociations_val_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoMaxInboundAssociations_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvInfoMaxInboundAssociations data.
+ * set (* rdbmsSrvInfoMaxInboundAssociations_val_ptr ) from rowreq_ctx->data
+ */
+    (* rdbmsSrvInfoMaxInboundAssociations_val_ptr ) = rowreq_ctx->data.rdbmsSrvInfoMaxInboundAssociations;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvInfoMaxInboundAssociations_get */
+
+
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_get.h b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_get.h
new file mode 100644 (file)
index 0000000..68b5b5e
--- /dev/null
@@ -0,0 +1,86 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable_data_get.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable_data_get.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVINFOTABLE_DATA_GET_H
+#define RDBMSSRVINFOTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvInfoTable is subid 6 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.6, length: 9
+*/
+    /*
+     * indexes
+     */
+    int applIndex_map(long *mib_applIndex_val_ptr, long raw_applIndex_val);
+
+    int rdbmsSrvInfoStartupTime_map(char **mib_rdbmsSrvInfoStartupTime_val_ptr_ptr, size_t *mib_rdbmsSrvInfoStartupTime_val_ptr_len_ptr, char *raw_rdbmsSrvInfoStartupTime_val_ptr, size_t raw_rdbmsSrvInfoStartupTime_val_ptr_len, int allow_realloc);
+    int rdbmsSrvInfoStartupTime_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvInfoStartupTime_val_ptr_ptr, size_t *rdbmsSrvInfoStartupTime_val_ptr_len_ptr );
+    int rdbmsSrvInfoFinishedTransactions_map(u_long *mib_rdbmsSrvInfoFinishedTransactions_val_ptr, u_long raw_rdbmsSrvInfoFinishedTransactions_val);
+    int rdbmsSrvInfoFinishedTransactions_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoFinishedTransactions_val_ptr );
+    int rdbmsSrvInfoDiskReads_map(u_long *mib_rdbmsSrvInfoDiskReads_val_ptr, u_long raw_rdbmsSrvInfoDiskReads_val);
+    int rdbmsSrvInfoDiskReads_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoDiskReads_val_ptr );
+    int rdbmsSrvInfoLogicalReads_map(u_long *mib_rdbmsSrvInfoLogicalReads_val_ptr, u_long raw_rdbmsSrvInfoLogicalReads_val);
+    int rdbmsSrvInfoLogicalReads_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoLogicalReads_val_ptr );
+    int rdbmsSrvInfoDiskWrites_map(u_long *mib_rdbmsSrvInfoDiskWrites_val_ptr, u_long raw_rdbmsSrvInfoDiskWrites_val);
+    int rdbmsSrvInfoDiskWrites_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoDiskWrites_val_ptr );
+    int rdbmsSrvInfoLogicalWrites_map(u_long *mib_rdbmsSrvInfoLogicalWrites_val_ptr, u_long raw_rdbmsSrvInfoLogicalWrites_val);
+    int rdbmsSrvInfoLogicalWrites_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoLogicalWrites_val_ptr );
+    int rdbmsSrvInfoPageReads_map(u_long *mib_rdbmsSrvInfoPageReads_val_ptr, u_long raw_rdbmsSrvInfoPageReads_val);
+    int rdbmsSrvInfoPageReads_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoPageReads_val_ptr );
+    int rdbmsSrvInfoPageWrites_map(u_long *mib_rdbmsSrvInfoPageWrites_val_ptr, u_long raw_rdbmsSrvInfoPageWrites_val);
+    int rdbmsSrvInfoPageWrites_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoPageWrites_val_ptr );
+    int rdbmsSrvInfoDiskOutOfSpaces_map(u_long *mib_rdbmsSrvInfoDiskOutOfSpaces_val_ptr, u_long raw_rdbmsSrvInfoDiskOutOfSpaces_val);
+    int rdbmsSrvInfoDiskOutOfSpaces_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoDiskOutOfSpaces_val_ptr );
+    int rdbmsSrvInfoHandledRequests_map(u_long *mib_rdbmsSrvInfoHandledRequests_val_ptr, u_long raw_rdbmsSrvInfoHandledRequests_val);
+    int rdbmsSrvInfoHandledRequests_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoHandledRequests_val_ptr );
+    int rdbmsSrvInfoRequestRecvs_map(u_long *mib_rdbmsSrvInfoRequestRecvs_val_ptr, u_long raw_rdbmsSrvInfoRequestRecvs_val);
+    int rdbmsSrvInfoRequestRecvs_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoRequestRecvs_val_ptr );
+    int rdbmsSrvInfoRequestSends_map(u_long *mib_rdbmsSrvInfoRequestSends_val_ptr, u_long raw_rdbmsSrvInfoRequestSends_val);
+    int rdbmsSrvInfoRequestSends_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoRequestSends_val_ptr );
+    int rdbmsSrvInfoHighwaterInboundAssociations_map(u_long *mib_rdbmsSrvInfoHighwaterInboundAssociations_val_ptr, u_long raw_rdbmsSrvInfoHighwaterInboundAssociations_val);
+    int rdbmsSrvInfoHighwaterInboundAssociations_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoHighwaterInboundAssociations_val_ptr );
+    int rdbmsSrvInfoMaxInboundAssociations_map(u_long *mib_rdbmsSrvInfoMaxInboundAssociations_val_ptr, u_long raw_rdbmsSrvInfoMaxInboundAssociations_val);
+    int rdbmsSrvInfoMaxInboundAssociations_get( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, u_long * rdbmsSrvInfoMaxInboundAssociations_val_ptr );
+
+
+int rdbmsSrvInfoTable_indexes_set_tbl_idx(rdbmsSrvInfoTable_mib_index *tbl_idx, long applIndex_val);
+int rdbmsSrvInfoTable_indexes_set(rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, long applIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVINFOTABLE_DATA_GET_H */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_set.c b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_set.c
new file mode 100644 (file)
index 0000000..8422736
--- /dev/null
@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable_data_set.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable_data_set.c,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsSrvInfoTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ * 
+ * @{
+ */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_set.h b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_data_set.h
new file mode 100644 (file)
index 0000000..1383e6e
--- /dev/null
@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable_data_set.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable_data_set.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVINFOTABLE_DATA_SET_H
+#define RDBMSSRVINFOTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVINFOTABLE_DATA_SET_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_enums.h b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_enums.h
new file mode 100644 (file)
index 0000000..16b2302
--- /dev/null
@@ -0,0 +1,47 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable_enums.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable_enums.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVINFOTABLE_ENUMS_H
+#define RDBMSSRVINFOTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table rdbmsSrvInfoTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVINFOTABLE_ENUMS_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_interface.c b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_interface.c
new file mode 100644 (file)
index 0000000..3ed81dc
--- /dev/null
@@ -0,0 +1,777 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable_interface.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable_interface.c,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+/* include our parent header */
+#include "rdbmsSrvInfoTable.h"
+
+
+#include <net-snmp/library/container.h>
+
+#include "rdbmsSrvInfoTable_interface.h"
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvInfoTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvInfoTable is subid 6 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.6, length: 9
+*/
+typedef struct rdbmsSrvInfoTable_interface_ctx_s {
+
+   netsnmp_container              *container;
+   netsnmp_cache                  *cache; /* optional cache */
+
+   rdbmsSrvInfoTable_registration_ptr      user_ctx;
+   
+   netsnmp_table_registration_info  tbl_info;
+
+   netsnmp_baby_steps_access_methods access_multiplexer;
+
+} rdbmsSrvInfoTable_interface_ctx;
+
+static rdbmsSrvInfoTable_interface_ctx rdbmsSrvInfoTable_if_ctx;
+
+static void _rdbmsSrvInfoTable_container_init(
+    rdbmsSrvInfoTable_interface_ctx *if_ctx);
+
+
+static Netsnmp_Node_Handler _mfd_rdbmsSrvInfoTable_pre_request;
+static Netsnmp_Node_Handler _mfd_rdbmsSrvInfoTable_post_request;
+static Netsnmp_Node_Handler _mfd_rdbmsSrvInfoTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_rdbmsSrvInfoTable_get_values;
+/**
+ * @internal
+ * Initialize the table rdbmsSrvInfoTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+_rdbmsSrvInfoTable_initialize_interface(rdbmsSrvInfoTable_registration_ptr reg_ptr,  u_long flags)
+{
+    netsnmp_baby_steps_access_methods *access_multiplexer =
+        &rdbmsSrvInfoTable_if_ctx.access_multiplexer;
+    netsnmp_table_registration_info *tbl_info = &rdbmsSrvInfoTable_if_ctx.tbl_info;
+    netsnmp_handler_registration *reginfo;
+    netsnmp_mib_handler *handler;
+    int    mfd_modes = 0;
+
+    DEBUGMSGTL(("internal:rdbmsSrvInfoTable:_rdbmsSrvInfoTable_initialize_interface","called\n"));
+
+
+    /*************************************************
+     *
+     * save interface context for rdbmsSrvInfoTable
+     */
+    /*
+     * Setting up the table's definition
+     */
+    netsnmp_table_helper_add_indexes(tbl_info,
+                                  ASN_INTEGER, /** index: applIndex */
+                             0);
+
+    /*  Define the minimum and maximum accessible columns.  This
+        optimizes retrival. */
+    tbl_info->min_column = RDBMSSRVINFOTABLE_MIN_COL;
+    tbl_info->max_column = RDBMSSRVINFOTABLE_MAX_COL;
+
+    /*
+     * save users context
+     */
+    rdbmsSrvInfoTable_if_ctx.user_ctx = reg_ptr;
+
+    /*
+     * call data access initialization code
+     */
+    rdbmsSrvInfoTable_init_data(reg_ptr);
+
+    /*
+     * set up the container
+     */
+    _rdbmsSrvInfoTable_container_init(&rdbmsSrvInfoTable_if_ctx);
+    if (NULL == rdbmsSrvInfoTable_if_ctx.container) {
+        snmp_log(LOG_ERR,"could not initialize container for rdbmsSrvInfoTable\n");
+        return;
+    }
+    
+    /*
+     * access_multiplexer: REQUIRED wrapper for get request handling
+     */
+    access_multiplexer->object_lookup = _mfd_rdbmsSrvInfoTable_object_lookup;
+    access_multiplexer->get_values = _mfd_rdbmsSrvInfoTable_get_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->pre_request = _mfd_rdbmsSrvInfoTable_pre_request;
+    access_multiplexer->post_request = _mfd_rdbmsSrvInfoTable_post_request;
+
+
+    /*************************************************
+     *
+     * Create a registration, save our reg data, register table.
+     */
+    DEBUGMSGTL(("rdbmsSrvInfoTable:init_rdbmsSrvInfoTable",
+                "Registering rdbmsSrvInfoTable as a mibs-for-dummies table.\n"));               
+    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+    reginfo = netsnmp_handler_registration_create("rdbmsSrvInfoTable", handler,
+                                                  rdbmsSrvInfoTable_oid,
+                                                  rdbmsSrvInfoTable_oid_size,
+                                                  HANDLER_CAN_BABY_STEP |
+                                                  HANDLER_CAN_RONLY
+                                                  );
+    if(NULL == reginfo) {
+        snmp_log(LOG_ERR,"error registering table rdbmsSrvInfoTable\n");
+        return;
+    }
+    reginfo->my_reg_void = &rdbmsSrvInfoTable_if_ctx;
+
+    /*************************************************
+     *
+     * set up baby steps handler, create it and inject it
+     */
+    if( access_multiplexer->object_lookup )
+        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+    if( access_multiplexer->set_values )
+        mfd_modes |= BABY_STEP_SET_VALUES;
+    if( access_multiplexer->irreversible_commit )
+        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+    if( access_multiplexer->object_syntax_checks )
+        mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+    if( access_multiplexer->pre_request )
+        mfd_modes |= BABY_STEP_PRE_REQUEST;
+    if( access_multiplexer->post_request )
+        mfd_modes |= BABY_STEP_POST_REQUEST;
+    
+    if( access_multiplexer->undo_setup )
+        mfd_modes |= BABY_STEP_UNDO_SETUP;
+    if( access_multiplexer->undo_cleanup )
+        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+    if( access_multiplexer->undo_sets )
+        mfd_modes |= BABY_STEP_UNDO_SETS;
+    
+    if( access_multiplexer->row_creation )
+        mfd_modes |= BABY_STEP_ROW_CREATE;
+    if( access_multiplexer->consistency_checks )
+        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+    if( access_multiplexer->commit )
+        mfd_modes |= BABY_STEP_COMMIT;
+    if( access_multiplexer->undo_commit )
+        mfd_modes |= BABY_STEP_UNDO_COMMIT;
+    
+    handler = netsnmp_baby_steps_handler_get(mfd_modes);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+     */
+    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject container_table helper
+     */
+    handler =
+        netsnmp_container_table_handler_get(tbl_info,
+                                            rdbmsSrvInfoTable_if_ctx.container,
+                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+    netsnmp_inject_handler( reginfo, handler );
+
+    /*************************************************
+     *
+     * inject cache helper
+     */
+    if(NULL != rdbmsSrvInfoTable_if_ctx.cache) {
+        handler = netsnmp_cache_handler_get(rdbmsSrvInfoTable_if_ctx.cache);
+        netsnmp_inject_handler( reginfo, handler );
+    }
+
+    /*
+     * register table
+     */
+    netsnmp_register_table(reginfo, tbl_info);
+} /* _rdbmsSrvInfoTable_initialize_interface */
+
+void
+rdbmsSrvInfoTable_valid_columns_set(netsnmp_column_info *vc)
+{
+    rdbmsSrvInfoTable_if_ctx.tbl_info.valid_columns = vc;
+} /* rdbmsSrvInfoTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+rdbmsSrvInfoTable_index_to_oid(netsnmp_index *oid_idx,
+                         rdbmsSrvInfoTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_applIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_applIndex, 0x00, sizeof(var_applIndex) );
+    var_applIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_applIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_index_to_oid","called\n"));
+
+        /* applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_applIndex, (u_char*)&mib_idx->applIndex,
+                       sizeof(mib_idx->applIndex));
+
+
+    err = build_oid_noalloc(oid_idx->oids, oid_idx->len, (size_t *)&oid_idx->len,
+                           NULL, 0, &var_applIndex);
+    if(err)
+        snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_applIndex );
+
+    return err;
+} /* rdbmsSrvInfoTable_index_to_oid */
+
+/**
+ * extract rdbmsSrvInfoTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR  : no error
+ * @retval SNMP_ERR_GENERR   : error
+ */
+int
+rdbmsSrvInfoTable_index_from_oid(netsnmp_index *oid_idx,
+                         rdbmsSrvInfoTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_applIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_applIndex, 0x00, sizeof(var_applIndex) );
+    var_applIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_applIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvInfoTable:rdbmsSrvInfoTable_index_from_oid","called\n"));
+
+    /*
+     * parse the oid into the individual index components
+     */
+    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+                             &var_applIndex );
+    if (err == SNMP_ERR_NOERROR) {
+        /*
+         * copy out values
+         */
+    mib_idx->applIndex = *((long *)var_applIndex.val.string);
+
+
+    }
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_applIndex );
+
+    return err;
+} /* rdbmsSrvInfoTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a rdbmsSrvInfoTable_rowreq_ctx
+ */
+rdbmsSrvInfoTable_rowreq_ctx *
+rdbmsSrvInfoTable_allocate_rowreq_ctx(void)
+{
+    rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx =
+                  SNMP_MALLOC_TYPEDEF(rdbmsSrvInfoTable_rowreq_ctx);
+
+    DEBUGMSGTL(("internal:rdbmsSrvInfoTable:rdbmsSrvInfoTable_allocate_rowreq_ctx","called\n"));
+
+    if(NULL == rowreq_ctx) {
+        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+                 "rdbmsSrvInfoTable_rowreq_ctx.\n");
+    }
+
+    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+    rowreq_ctx->rdbmsSrvInfoTable_data_list = NULL;
+    rowreq_ctx->rdbmsSrvInfoTable_reg = rdbmsSrvInfoTable_if_ctx.user_ctx;
+
+
+    return rowreq_ctx;
+} /* rdbmsSrvInfoTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a rdbmsSrvInfoTable_rowreq_ctx
+ */
+void
+rdbmsSrvInfoTable_release_rowreq_ctx(rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvInfoTable:rdbmsSrvInfoTable_release_rowreq_ctx","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+
+    /*
+     * free index oid pointer
+     */
+    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+        free(rowreq_ctx->oid_idx.oids);
+
+    SNMP_FREE(rowreq_ctx);
+} /* rdbmsSrvInfoTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsSrvInfoTable_pre_request(netsnmp_mib_handler *handler,
+                            netsnmp_handler_registration *reginfo,
+                            netsnmp_agent_request_info *agtreq_info,
+                            netsnmp_request_info *requests)
+{
+    int rc = rdbmsSrvInfoTable_pre_request(rdbmsSrvInfoTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsSrvInfoTable","error %d from "
+                    "rdbmsSrvInfoTable_pre_request\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvInfoTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsSrvInfoTable_post_request(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx;
+    int rc = rdbmsSrvInfoTable_post_request(rdbmsSrvInfoTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsSrvInfoTable","error %d from "
+                    "rdbmsSrvInfoTable_post_request\n", rc));
+    }
+    
+    /*
+     * if there are no errors, check for and handle row creation/deletion
+     */
+    rc = netsnmp_check_requests_error(requests);
+    if ((SNMP_ERR_NOERROR == rc) &&
+        (NULL !=
+         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
+        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+            CONTAINER_INSERT(rdbmsSrvInfoTable_if_ctx.container, rowreq_ctx);
+        }
+        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+            CONTAINER_REMOVE(rdbmsSrvInfoTable_if_ctx.container, rowreq_ctx);
+            rdbmsSrvInfoTable_release_rowreq_ctx(rowreq_ctx);
+        }
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvInfoTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsSrvInfoTable_object_lookup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    
+    DEBUGMSGTL(("internal:rdbmsSrvInfoTable:_mfd_rdbmsSrvInfoTable_object_lookup","called\n"));
+
+    /*
+     * get our context from mfd
+     * rdbmsSrvInfoTable_interface_ctx *if_ctx =
+     *             (rdbmsSrvInfoTable_interface_ctx *)reginfo->my_reg_void;
+     */
+
+    if(NULL == rowreq_ctx) {
+        netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
+    }
+    else {
+        rdbmsSrvInfoTable_row_prep(rowreq_ctx);
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvInfoTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsSrvInfoTable_get_column( rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsSrvInfoTable:_mfd_rdbmsSrvInfoTable_get_column","called\n"));
+
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsSrvInfoStartupTime(1)/DateAndTime/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+    case COLUMN_RDBMSSRVINFOSTARTUPTIME:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsSrvInfoStartupTime_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsSrvInfoFinishedTransactions(2)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFOFINISHEDTRANSACTIONS:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_GAUGE;
+rc = rdbmsSrvInfoFinishedTransactions_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoDiskReads(3)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFODISKREADS:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_COUNTER;
+rc = rdbmsSrvInfoDiskReads_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoLogicalReads(4)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFOLOGICALREADS:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_COUNTER;
+rc = rdbmsSrvInfoLogicalReads_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoDiskWrites(5)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFODISKWRITES:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_COUNTER;
+rc = rdbmsSrvInfoDiskWrites_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoLogicalWrites(6)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFOLOGICALWRITES:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_COUNTER;
+rc = rdbmsSrvInfoLogicalWrites_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoPageReads(7)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFOPAGEREADS:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_COUNTER;
+rc = rdbmsSrvInfoPageReads_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoPageWrites(8)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFOPAGEWRITES:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_COUNTER;
+rc = rdbmsSrvInfoPageWrites_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoDiskOutOfSpaces(9)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFODISKOUTOFSPACES:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_COUNTER;
+rc = rdbmsSrvInfoDiskOutOfSpaces_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoHandledRequests(10)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFOHANDLEDREQUESTS:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_COUNTER;
+rc = rdbmsSrvInfoHandledRequests_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoRequestRecvs(11)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFOREQUESTRECVS:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_COUNTER;
+rc = rdbmsSrvInfoRequestRecvs_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoRequestSends(12)/COUNTER/ASN_COUNTER/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFOREQUESTSENDS:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_COUNTER;
+rc = rdbmsSrvInfoRequestSends_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoHighwaterInboundAssociations(13)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVINFOHIGHWATERINBOUNDASSOCIATIONS:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_GAUGE;
+rc = rdbmsSrvInfoHighwaterInboundAssociations_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+    /* rdbmsSrvInfoMaxInboundAssociations(14)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/W/e/r/d/h */
+    case COLUMN_RDBMSSRVINFOMAXINBOUNDASSOCIATIONS:
+    var->val_len = sizeof(u_long);
+    var->type = ASN_GAUGE;
+rc = rdbmsSrvInfoMaxInboundAssociations_get(rowreq_ctx, (u_long *)var->val.string );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _rdbmsSrvInfoTable_get_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _rdbmsSrvInfoTable_get_column */
+
+int
+_mfd_rdbmsSrvInfoTable_get_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    u_char                     * old_string;
+    void                      (*dataFreeHook)(void *);
+    int                        rc;
+
+    DEBUGMSGTL(("internal:rdbmsSrvInfoTable:_mfd_rdbmsSrvInfoTable_get_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * save old pointer, so we can free it if replaced
+         */
+        old_string = requests->requestvb->val.string;
+        dataFreeHook = requests->requestvb->dataFreeHook;
+        if(NULL == requests->requestvb->val.string) {
+            requests->requestvb->val.string = requests->requestvb->buf;
+            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+        else if(requests->requestvb->buf == requests->requestvb->val.string) {
+            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+
+        /*
+         * get column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _rdbmsSrvInfoTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            if(MFD_SKIP == rc) {
+                requests->requestvb->type = ASN_PRIV_RETRY;
+                rc = SNMP_ERR_NOERROR;
+            }
+        }
+        else if (NULL == requests->requestvb->val.string) {
+            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+            rc = SNMP_ERR_GENERR;
+        }
+        if(rc)
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+        /*
+         * if the buffer wasn't used previously for the old data (i.e. it
+         * was allcoated memory)  and the get routine replaced the pointer,
+         * we need to free the previous pointer.
+         */
+        if(old_string && (old_string != requests->requestvb->buf) &&
+           (requests->requestvb->val.string != old_string)) {
+            if(dataFreeHook)
+                (*dataFreeHook)(old_string);
+            else
+                free(old_string);
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvInfoTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvInfoTable:_cache_load","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache for rdbmsSrvInfoTable_cache_load\n");
+        return -1;
+    }
+
+    /** should only be called for an invalid or expired cache */
+    netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+    
+    /*
+     * call user code
+     */
+    return rdbmsSrvInfoTable_cache_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_item_free(rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvInfoTable:_cache_item_free","called\n"));
+
+    if(NULL == rowreq_ctx)
+        return;
+
+    rdbmsSrvInfoTable_release_rowreq_ctx(rowreq_ctx);
+} /* _cache_item_free */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+    netsnmp_container *container;
+
+    DEBUGMSGTL(("internal:rdbmsSrvInfoTable:_cache_free","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache in rdbmsSrvInfoTable_cache_free\n");
+        return;
+    }
+
+    container = (netsnmp_container*)cache->magic;
+
+    /*
+     * call user code
+     */
+    rdbmsSrvInfoTable_cache_free(container);
+    
+    /*
+     * free all items. inefficient, but easy.
+     */
+    CONTAINER_CLEAR(container,
+                    (netsnmp_container_obj_func *)_cache_item_free,
+                    NULL);
+} /* _cache_free */
+
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_rdbmsSrvInfoTable_container_init(rdbmsSrvInfoTable_interface_ctx *if_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvInfoTable:_rdbmsSrvInfoTable_container_init","called\n"));
+    
+    /*
+     * set up the cache
+     */
+    if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+                                         _cache_load, _cache_free,
+                                         rdbmsSrvInfoTable_oid,
+                                         rdbmsSrvInfoTable_oid_size);
+
+    if(NULL == if_ctx->cache) {
+        snmp_log(LOG_ERR, "error creating cache for rdbmsSrvInfoTable\n");
+        return;
+    }
+
+    if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+    rdbmsSrvInfoTable_container_init(&if_ctx->container, if_ctx->cache);
+    if(NULL == if_ctx->container)
+        if_ctx->container = netsnmp_container_find("rdbmsSrvInfoTable:table_container");
+    if(NULL == if_ctx->container) {
+        snmp_log(LOG_ERR,"error creating container in "
+                 "rdbmsSrvInfoTable_container_init\n");
+        return;
+    }
+    if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _rdbmsSrvInfoTable_container_init */
+
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_interface.h b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_interface.h
new file mode 100644 (file)
index 0000000..6fa8668
--- /dev/null
@@ -0,0 +1,50 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable_interface.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable_interface.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVINFOTABLE_INTERFACE_H
+#define RDBMSSRVINFOTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "rdbmsSrvInfoTable.h"
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _rdbmsSrvInfoTable_initialize_interface(rdbmsSrvInfoTable_registration_ptr user_ctx,
+                                    u_long flags);
+
+    rdbmsSrvInfoTable_rowreq_ctx * rdbmsSrvInfoTable_allocate_rowreq_ctx(void);
+void rdbmsSrvInfoTable_release_rowreq_ctx(rdbmsSrvInfoTable_rowreq_ctx *rowreq_ctx);
+
+int rdbmsSrvInfoTable_index_to_oid(netsnmp_index *oid_idx,
+                            rdbmsSrvInfoTable_mib_index *mib_idx);
+int rdbmsSrvInfoTable_index_from_oid(netsnmp_index *oid_idx,
+                              rdbmsSrvInfoTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void rdbmsSrvInfoTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVINFOTABLE_INTERFACE_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_oids.h b/RDBMS-MIB_src/rdbmsSrvInfoTable/rdbmsSrvInfoTable_oids.h
new file mode 100644 (file)
index 0000000..c61920e
--- /dev/null
@@ -0,0 +1,47 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvInfoTable_oids.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvInfoTable_oids.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVINFOTABLE_OIDS_H
+#define RDBMSSRVINFOTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table rdbmsSrvInfoTable */
+#define RDBMSSRVINFOTABLE_OID              1,3,6,1,2,1,39,1,6
+#define COLUMN_RDBMSSRVINFOSTARTUPTIME         1
+#define COLUMN_RDBMSSRVINFOFINISHEDTRANSACTIONS                2
+#define COLUMN_RDBMSSRVINFODISKREADS           3
+#define COLUMN_RDBMSSRVINFOLOGICALREADS                4
+#define COLUMN_RDBMSSRVINFODISKWRITES          5
+#define COLUMN_RDBMSSRVINFOLOGICALWRITES               6
+#define COLUMN_RDBMSSRVINFOPAGEREADS           7
+#define COLUMN_RDBMSSRVINFOPAGEWRITES          8
+#define COLUMN_RDBMSSRVINFODISKOUTOFSPACES             9
+#define COLUMN_RDBMSSRVINFOHANDLEDREQUESTS             10
+#define COLUMN_RDBMSSRVINFOREQUESTRECVS                11
+#define COLUMN_RDBMSSRVINFOREQUESTSENDS                12
+#define COLUMN_RDBMSSRVINFOHIGHWATERINBOUNDASSOCIATIONS                13
+#define COLUMN_RDBMSSRVINFOMAXINBOUNDASSOCIATIONS              14
+
+#define RDBMSSRVINFOTABLE_MIN_COL              COLUMN_RDBMSSRVINFOSTARTUPTIME
+#define RDBMSSRVINFOTABLE_MAX_COL              COLUMN_RDBMSSRVINFOMAXINBOUNDASSOCIATIONS
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVINFOTABLE_OIDS_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvLimitedResource/README b/RDBMS-MIB_src/rdbmsSrvLimitedResource/README
new file mode 100644 (file)
index 0000000..f8fb831
--- /dev/null
@@ -0,0 +1,11 @@
+Note: about SrvLimitedResource
+
+SrvLimitedResource is supposed to contain server-specific limited
+resources. We tried to think of all the limited resources we could,
+and didn't find any that belonged in this table. Things like memory,
+disk space, etc. are already available through the default net-snmp
+implementation, and it didn't seem like a good idea to re-implement
+them here. XIDs are database-specific, so they're in the
+DbLimitedResource table. So the SrvLimitedResource table was left
+empty until we came up with useful information we could put in it.
+
diff --git a/RDBMS-MIB_src/rdbmsSrvLimitedResource/rdbmsSrvLimitedResource.h b/RDBMS-MIB_src/rdbmsSrvLimitedResource/rdbmsSrvLimitedResource.h
new file mode 100644 (file)
index 0000000..45302df
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+
+Note: about SrvLimitedResource
+
+SrvLimitedResource is supposed to contain server-specific limited
+resources. We tried to think of all the limited resources we could,
+and didn't find any that belonged in this table. Things like memory,
+disk space, etc. are already available through the default net-snmp
+implementation, and it didn't seem like a good idea to re-implement
+them here. XIDs are database-specific, so they're in the
+DbLimitedResource table. So the SrvLimitedResource table was left
+empty until we came up with useful information we could put in it.
+
+*/
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable.c b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable.c
new file mode 100644 (file)
index 0000000..3fd3799
--- /dev/null
@@ -0,0 +1,130 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable.c,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsSrvParamTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "rdbmsSrvParamTable_interface.h"
+
+oid rdbmsSrvParamTable_oid[] = { RDBMSSRVPARAMTABLE_OID };
+int rdbmsSrvParamTable_oid_size = OID_LENGTH(rdbmsSrvParamTable_oid);
+
+void initialize_table_rdbmsSrvParamTable(void);
+
+
+/**
+ * Initializes the rdbmsSrvParamTable module
+ */
+void
+init_rdbmsSrvParamTable(void)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:init_rdbmsSrvParamTable","called\n"));
+
+    /*
+     * TODO:300:o: Perform rdbmsSrvParamTable one-time module initialization.
+     */
+     
+    /*
+     * here we initialize all the tables we're planning on supporting
+     */
+    if (should_init("rdbmsSrvParamTable"))
+        initialize_table_rdbmsSrvParamTable();
+
+} /* init_rdbmsSrvParamTable */
+
+/**
+ * Initialize the table rdbmsSrvParamTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+initialize_table_rdbmsSrvParamTable(void)
+{
+    rdbmsSrvParamTable_registration_ptr user_context;
+    u_long flags;
+
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:initialize_table_rdbmsSrvParamTable","called\n"));
+
+    /*
+     * TODO:301:o: Perform rdbmsSrvParamTable one-time table initialization.
+     */
+
+    /*
+     * TODO:302:o: |->Initialize rdbmsSrvParamTable user context
+     * if you'd like to pass in a pointer to some data for this
+     * table, allocate or set it up here.
+     */
+    /*
+     * a netsnmp_data_list is a simple way to store void pointers. A simple
+     * string token is used to add, find or remove pointers.
+     */
+    user_context = netsnmp_create_data_list("rdbmsSrvParamTable", NULL, NULL);
+    
+    /*
+     * No support for any flags yet, but in the future you would
+     * set any flags here.
+     */
+    flags = 0;
+    
+    /*
+     * call interface initialization code
+     */
+    _rdbmsSrvParamTable_initialize_interface(user_context, flags);
+} /* initialize_table_rdbmsSrvParamTable */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_ERROR                : other error
+ */
+int
+rdbmsSrvParamTable_pre_request(rdbmsSrvParamTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_pre_request","called\n"));
+
+    /*
+     * TODO:510:o: Perform rdbmsSrvParamTable pre-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : other error (ignored)
+ */
+int
+rdbmsSrvParamTable_post_request(rdbmsSrvParamTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_post_request","called\n"));
+
+    /*
+     * TODO:511:o: Perform rdbmsSrvParamTable pos-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamTable_post_request */
+
+
+/** @{ */
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable.h b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable.h
new file mode 100644 (file)
index 0000000..71c728f
--- /dev/null
@@ -0,0 +1,214 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVPARAMTABLE_H
+#define RDBMSSRVPARAMTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @defgroup misc misc: Miscelaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+    /* *INDENT-OFF*  */
+config_require(RDBMS-MIB/rdbmsSrvParamTable/rdbmsSrvParamTable_interface);
+config_require(RDBMS-MIB/rdbmsSrvParamTable/rdbmsSrvParamTable_data_access);
+config_require(RDBMS-MIB/rdbmsSrvParamTable/rdbmsSrvParamTable_data_get);
+config_require(RDBMS-MIB/rdbmsSrvParamTable/rdbmsSrvParamTable_data_set);
+    /* *INDENT-ON*  */
+
+/* OID and column number definitions for  */
+#include "rdbmsSrvParamTable_oids.h"
+
+/* enum definions */
+#include "rdbmsSrvParamTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_rdbmsSrvParamTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvParamTable is subid 7 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.7, length: 9
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+    /*
+     * TODO:101:o: |-> Review rdbmsSrvParamTable registration context.
+     */
+typedef netsnmp_data_list * rdbmsSrvParamTable_registration_ptr;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review rdbmsSrvParamTable data context structure.
+ * This structure is used to represent the data for rdbmsSrvParamTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * rdbmsSrvParamTable.
+ */
+typedef struct rdbmsSrvParamTable_data_s {
+    
+        /*
+         * rdbmsSrvParamID(3)/AutonomousType/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+         */
+   oid   rdbmsSrvParamID[128];
+size_t      rdbmsSrvParamID_len; /* # of oid elements, not bytes */
+    
+        /*
+         * rdbmsSrvParamCurrValue(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+         */
+   char   rdbmsSrvParamCurrValue[255];
+size_t      rdbmsSrvParamCurrValue_len; /* # of char elements, not bytes */
+    
+        /*
+         * rdbmsSrvParamComment(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+         */
+   char   rdbmsSrvParamComment[255];
+size_t      rdbmsSrvParamComment_len; /* # of char elements, not bytes */
+    
+} rdbmsSrvParamTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review rdbmsSrvParamTable mib index.
+ * This structure is used to represent the index for rdbmsSrvParamTable.
+ */
+typedef struct rdbmsSrvParamTable_mib_index_s {
+
+        /*
+         * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   applIndex;
+
+        /*
+         * rdbmsSrvParamName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+         */
+   char   rdbmsSrvParamName[64];
+   size_t      rdbmsSrvParamName_len;
+
+        /*
+         * rdbmsSrvParamSubIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   rdbmsSrvParamSubIndex;
+
+
+} rdbmsSrvParamTable_mib_index;
+
+    /*
+     * TODO:121:r: |   |-> Review rdbmsSrvParamTable max index length.
+     * If you KNOW that your indexes will never exceed a certain
+     * length, update this macro to that length.
+     *
+     * BE VERY CAREFUL TO TAKE INTO ACCOUNT THE MAXIMUM
+     * POSSIBLE LENGHT FOR EVERY VARIABLE LENGTH INDEX!
+     * Guessing 128 - col/entry(2)  - oid len(9)
+*/
+#define MAX_rdbmsSrvParamTable_IDX_LEN     67
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review rdbmsSrvParamTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * rdbmsSrvParamTable_rowreq_ctx pointer.
+ */
+typedef struct rdbmsSrvParamTable_rowreq_ctx_s {
+
+    /** this must be first for container compare to work */
+    netsnmp_index        oid_idx;
+    oid                  oid_tmp[MAX_rdbmsSrvParamTable_IDX_LEN];
+    
+    rdbmsSrvParamTable_mib_index        tbl_idx;
+    
+    rdbmsSrvParamTable_data              data;
+
+    /*
+     * flags per row. Currently, the first (lower) 8 bits are reserved
+     * for the user. See mfd.h for other flags.
+     */
+    u_int                       rowreq_flags;
+
+    /*
+     * implementor's context pointer (provided during registration)
+     */
+    rdbmsSrvParamTable_registration_ptr rdbmsSrvParamTable_reg;
+
+    /*
+     * TODO:131:o: |   |-> Add useful data to rdbmsSrvParamTable rowreq context.
+     */
+    
+    /*
+     * storage for future expansion
+     */
+    netsnmp_data_list             *rdbmsSrvParamTable_data_list;
+
+} rdbmsSrvParamTable_rowreq_ctx;
+
+typedef struct rdbmsSrvParamTable_ref_rowreq_ctx_s {
+    rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx;
+} rdbmsSrvParamTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+    int rdbmsSrvParamTable_pre_request(rdbmsSrvParamTable_registration_ptr user_context);
+    int rdbmsSrvParamTable_post_request(rdbmsSrvParamTable_registration_ptr user_context);
+
+
+extern oid rdbmsSrvParamTable_oid[];
+extern int rdbmsSrvParamTable_oid_size;
+
+
+#include "rdbmsSrvParamTable_interface.h"
+#include "rdbmsSrvParamTable_data_access.h"
+#include "rdbmsSrvParamTable_data_get.h"
+#include "rdbmsSrvParamTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVPARAMTABLE_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_access.c b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_access.c
new file mode 100644 (file)
index 0000000..74e0c76
--- /dev/null
@@ -0,0 +1,308 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable_data_access.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable_data_access.c,v 1.3 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsSrvParamTable.h"
+#include "rdbmsSrvParamTable_data_access.h"
+
+/** @defgroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ * 
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvParamTable is subid 7 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.7, length: 9
+*/
+
+/**
+ * initialization for rdbmsSrvParamTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param rdbmsSrvParamTable_reg
+ *        Pointer to rdbmsSrvParamTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : unrecoverable error.
+ */
+int
+rdbmsSrvParamTable_init_data(rdbmsSrvParamTable_registration_ptr rdbmsSrvParamTable_reg)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_init_data","called\n"));
+
+    /*
+     * TODO:303:o: Initialize rdbmsSrvParamTable data.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamTable_init_data */
+
+/**
+ * container-cached overview
+ *
+ */
+
+/***********************************************************************
+ *
+ * cache
+ *
+ ***********************************************************************/
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ *        create a custom container, use this parameter to return it
+ *        to the MFD helper. If set to NULL, the MFD helper will
+ *        allocate a container for you.
+ * @param  cache A pointer to a cache structure. You can set the timeout
+ *         and other cache flags using this pointer.
+ *
+ *  This function is called at startup to allow you to customize certain
+ *  aspects of the access method. For the most part, it is for advanced
+ *  users. The default code should suffice for most cases. If no custom
+ *  container is allocated, the MFD code will create one for your.
+ *
+ *  This is also the place to set up cache behavior. The default, to
+ *  simply set the cache timeout, will work well with the default
+ *  container. If you are using a custom container, you may want to
+ *  look at the cache helper documentation to see if there are any
+ *  flags you want to set.
+ *
+ * @remark
+ *  This would also be a good place to do any initialization needed
+ *  for you data source. For example, opening a connection to another
+ *  process that will supply the data, opening a database, etc.
+ */
+void
+rdbmsSrvParamTable_container_init(netsnmp_container **container_ptr_ptr,
+                        netsnmp_cache *cache)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_container_init","called\n"));
+    
+    if((NULL == cache) || (NULL == container_ptr_ptr)) {
+        snmp_log(LOG_ERR,"bad params to rdbmsSrvParamTable_container_init\n");
+        return;
+    }
+
+    /*
+     * For advanced users, you can use a custom container. If you
+     * do not create one, one will be created for you.
+     */
+    *container_ptr_ptr = NULL;
+
+    /*
+     * TODO:345:A: Set up rdbmsSrvParamTable cache properties.
+     *
+     * Also for advanced users, you can set parameters for the
+     * cache. Do not change the magic pointer, as it is used
+     * by the MFD helper. To completely disable caching, set
+     * cache->enabled to 0.
+     */
+    cache->timeout = RDBMSSRVPARAMTABLE_CACHE_TIMEOUT; /* seconds */
+} /* rdbmsSrvParamTable_container_init */
+
+/**
+ * load cache data
+ *
+ * TODO:350:M: Implement rdbmsSrvParamTable cache load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR                : other error.
+ *
+ *  This function is called to cache the index(es) (and data, optionally)
+ *  for the every row in the data set.
+ *
+ * @remark
+ *  While loading the cache, the only important thing is the indexes.
+ *  If access to your data is cheap/fast (e.g. you have a pointer to a
+ *  structure in memory), it would make sense to update the data here.
+ *  If, however, the accessing the data invovles more work (e.g. parsing
+ *  some other existing data, or peforming calculations to derive the data),
+ *  then you can limit yourself to setting the indexes and saving any
+ *  information you will need later. Then use the saved information in
+ *  rdbmsSrvParamTable_row_prep() for populating data.
+ *
+ * @note
+ *  If you need consistency between rows (like you want statistics
+ *  for each row to be from the same time frame), you should set all
+ *  data here.
+ *
+ */
+int
+rdbmsSrvParamTable_cache_load(netsnmp_container *container)
+{
+    rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx;
+    size_t                 count = 0;
+    char   rdbmsSrvParamName[64];
+    size_t      rdbmsSrvParamName_len;
+    int i, resultCount, errorCode = MFD_SUCCESS, tmpInt, rdbmsSrvParamID = 1;
+    PGresult *pg_db_qry;
+    char *tmpString;
+
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_cache_load","called\n"));
+
+    if (PQstatus(dbconn) == CONNECTION_OK) 
+           pg_db_qry = PQexec(dbconn, "SELECT name, setting, SUBSTRING(short_desc FROM 1 FOR 63) FROM pg_settings");
+    else {
+           snmp_log(LOG_ERR, "Can't get connected to the database");
+           return -1;
+    }
+    if (PQresultStatus(pg_db_qry) != PGRES_TUPLES_OK) {
+           snmp_log(LOG_ERR, "Didn't get any results from the database");
+           PQclear(pg_db_qry);
+           /*PQfinish(dbconn);*/
+           return -1;
+    }
+
+    resultCount = PQntuples(pg_db_qry);
+    for (i = 0; i < resultCount; i++) {
+
+        rowreq_ctx = rdbmsSrvParamTable_allocate_rowreq_ctx();
+        if (NULL == rowreq_ctx) {
+            snmp_log(LOG_ERR, "memory allocation failed\n");
+            return MFD_RESOURCE_UNAVAILABLE;
+        }
+       strncpy(rdbmsSrvParamName, PQgetvalue(pg_db_qry, i, 0), 64);
+       rdbmsSrvParamName[63] = '\0';
+       rdbmsSrvParamName_len = strlen(rdbmsSrvParamName);
+        if(MFD_SUCCESS != rdbmsSrvParamTable_indexes_set(rowreq_ctx
+                               , 1
+                               , rdbmsSrvParamName, rdbmsSrvParamName_len
+                               , 1
+               )) {
+            snmp_log(LOG_ERR,"error setting index while loading "
+                     "rdbmsSrvParamTable cache.\n");
+            rdbmsSrvParamTable_release_rowreq_ctx(rowreq_ctx);
+            continue;
+        }
+       rowreq_ctx->data.rdbmsSrvParamID_len = 128;
+       rowreq_ctx->data.rdbmsSrvParamCurrValue_len = 255;
+       rowreq_ctx->data.rdbmsSrvParamComment_len = 255;
+
+    if ((NULL == rowreq_ctx->data.rdbmsSrvParamID) ||
+        (rowreq_ctx->data.rdbmsSrvParamID_len < sizeof(rowreq_ctx->data.rdbmsSrvParamID[0]))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+       errorCode = MFD_ERROR;
+       break;
+    }
+    rowreq_ctx->data.rdbmsSrvParamID_len = sizeof(rowreq_ctx->data.rdbmsSrvParamID[0]);
+    memcpy( rowreq_ctx->data.rdbmsSrvParamID, &rdbmsSrvParamID, rowreq_ctx->data.rdbmsSrvParamID_len );
+    
+    tmpString = PQgetvalue(pg_db_qry, i, 1);
+    tmpInt = strlen(tmpString);
+    if ((NULL == rowreq_ctx->data.rdbmsSrvParamCurrValue) ||
+        (rowreq_ctx->data.rdbmsSrvParamCurrValue_len < (tmpInt * sizeof(rowreq_ctx->data.rdbmsSrvParamCurrValue[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+       errorCode = MFD_ERROR;
+       break;
+    }
+    rowreq_ctx->data.rdbmsSrvParamCurrValue_len = tmpInt * sizeof(rowreq_ctx->data.rdbmsSrvParamCurrValue[0]);
+    memcpy( rowreq_ctx->data.rdbmsSrvParamCurrValue, tmpString, rowreq_ctx->data.rdbmsSrvParamCurrValue_len );
+    
+    tmpString = PQgetvalue(pg_db_qry, i, 2);
+    tmpInt = strlen(tmpString);
+    if ((NULL == rowreq_ctx->data.rdbmsSrvParamComment) ||
+        (rowreq_ctx->data.rdbmsSrvParamComment_len < (tmpInt * sizeof(rowreq_ctx->data.rdbmsSrvParamComment[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+       errorCode = MFD_ERROR;
+       break;
+    }
+    rowreq_ctx->data.rdbmsSrvParamComment_len = tmpInt * sizeof(rowreq_ctx->data.rdbmsSrvParamComment[0]);
+    memcpy( rowreq_ctx->data.rdbmsSrvParamComment, tmpString, rowreq_ctx->data.rdbmsSrvParamComment_len );
+    
+        
+        /*
+         * insert into table container
+         */
+        CONTAINER_INSERT(container, rowreq_ctx);
+        ++count;
+    }
+
+
+    DEBUGMSGT(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_cache_load",
+               "inserted %d records\n", count));
+    PQclear(pg_db_qry);
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamTable_cache_load */
+
+/**
+ * cache clean up
+ *
+ * @param container container with all current items
+ *
+ *  This optional callback is called prior to all
+ *  item's being removed from the container. If you
+ *  need to do any processing before that, do it here.
+ *
+ * @note
+ *  The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+rdbmsSrvParamTable_cache_free(netsnmp_container *container)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_cache_free","called\n"));
+
+    /*
+     * TODO:380:M: Free rdbmsSrvParamTable cache.
+     */
+} /* rdbmsSrvParamTable_cache_free */
+
+/**
+ * prepare row for processing.
+ *
+ *  When the agent has located the row for a request, this function is
+ *  called to prepare the row for processing. If you fully populated
+ *  the data context during the index setup phase, you may not need to
+ *  do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ */
+int
+rdbmsSrvParamTable_row_prep( rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_row_prep","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:390:o: Prepare row for request.
+     * If populating row data was delayed, this is the place to
+     * fill in the row for this request.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamTable_row_prep */
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_access.h b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_access.h
new file mode 100644 (file)
index 0000000..9a51cf9
--- /dev/null
@@ -0,0 +1,64 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable_data_access.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable_data_access.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVPARAMTABLE_DATA_ACCESS_H
+#define RDBMSSRVPARAMTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvParamTable is subid 7 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.7, length: 9
+*/
+
+
+    int rdbmsSrvParamTable_init_data(rdbmsSrvParamTable_registration_ptr rdbmsSrvParamTable_reg);
+
+
+/*
+ * TODO:180:o: Review rdbmsSrvParamTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define RDBMSSRVPARAMTABLE_CACHE_TIMEOUT   60
+
+void rdbmsSrvParamTable_container_init(netsnmp_container **container_ptr_ptr,
+                             netsnmp_cache *cache);
+int rdbmsSrvParamTable_cache_load(netsnmp_container *container);
+void rdbmsSrvParamTable_cache_free(netsnmp_container *container);
+
+    int rdbmsSrvParamTable_row_prep( rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVPARAMTABLE_DATA_ACCESS_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_get.c b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_get.c
new file mode 100644 (file)
index 0000000..2a4dc8b
--- /dev/null
@@ -0,0 +1,726 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable_data_get.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable_data_get.c,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsSrvParamTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement rdbmsSrvParamTable get routines.
+ * TODO:240:M: Implement rdbmsSrvParamTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvParamTable is subid 7 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.7, length: 9
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement rdbmsSrvParamTable data context functions.
+ */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvParamEntry.rdbmsSrvParamName
+ * rdbmsSrvParamName is subid 1 of rdbmsSrvParamEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.39.1.7.1.1
+ * Description:
+The name of a configuration parameter for a server.  This
+           name is product-specific. The length is limited to 64
+           characters to constrain the number of sub-identifiers needed
+           for instance identification (and to minimize network
+           traffic).
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  1 - 64;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 64)
+ *
+ *
+ *
+ * NOTE: NODE rdbmsSrvParamName IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvParamName.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvParamName_map(char **mib_rdbmsSrvParamName_val_ptr_ptr, size_t *mib_rdbmsSrvParamName_val_ptr_len_ptr, char *raw_rdbmsSrvParamName_val_ptr, size_t raw_rdbmsSrvParamName_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsSrvParamName_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsSrvParamName_val_ptr_ptr) && (NULL != mib_rdbmsSrvParamName_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamName_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsSrvParamName non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsSrvParamName_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsSrvParamName_val_ptr_ptr) || (*mib_rdbmsSrvParamName_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsSrvParamName_val_ptr_ptr = realloc( *mib_rdbmsSrvParamName_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsSrvParamName_val_ptr_ptr));
+        if(NULL == *mib_rdbmsSrvParamName_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsSrvParamName_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsSrvParamName_val_ptr_ptr, raw_rdbmsSrvParamName_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamName_map */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvParamEntry.rdbmsSrvParamSubIndex
+ * rdbmsSrvParamSubIndex is subid 2 of rdbmsSrvParamEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.39.1.7.1.2
+ * Description:
+The subindex value for this parameter.  If the parameter is
+           naturally considered to contain a variable number of members
+           of a class, e.g.  members of the DBA user group, or files
+           which are part of the database, then it must be presented as
+           a set of rows.  If, on the other hand, the parameter
+           represents a set of choices from a class, e.g. the
+           permissions on a file or the options chosen out of the set of
+           all options allowed, AND is guaranteed to always fit in the
+           255 character length of a DisplayString, then it may be
+           presented as a comma separated list with a subindex value of
+           one.  Zero may not be used as a value.
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   0
+ *   settable   0
+ *
+ * Ranges:  1 - 2147483647;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE rdbmsSrvParamSubIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvParamSubIndex.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvParamSubIndex_map(long *mib_rdbmsSrvParamSubIndex_val_ptr, long raw_rdbmsSrvParamSubIndex_val)
+{
+    netsnmp_assert(NULL != mib_rdbmsSrvParamSubIndex_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamSubIndex_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement rdbmsSrvParamSubIndex mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_rdbmsSrvParamSubIndex_val_ptr) = raw_rdbmsSrvParamSubIndex_val;
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamSubIndex_map */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This convenience function is useful for setting all the MIB index
+ *  components with a single function call. It is assume that the C values
+ *  have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+rdbmsSrvParamTable_indexes_set_tbl_idx(rdbmsSrvParamTable_mib_index *tbl_idx, long applIndex_val, char *rdbmsSrvParamName_val_ptr,  size_t rdbmsSrvParamName_val_ptr_len, long rdbmsSrvParamSubIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_indexes_set_tbl_idx","called\n"));
+
+    /* applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->applIndex = applIndex_val;
+    
+    /* rdbmsSrvParamName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+     tbl_idx->rdbmsSrvParamName_len = sizeof(tbl_idx->rdbmsSrvParamName);
+    /*
+     * make sure there is enough space for rdbmsSrvParamName data
+     */
+    if ((NULL == tbl_idx->rdbmsSrvParamName) ||
+        (tbl_idx->rdbmsSrvParamName_len < (rdbmsSrvParamName_val_ptr_len * sizeof(tbl_idx->rdbmsSrvParamName[0])))) {
+        snmp_log(LOG_ERR,"not enough space for value\n");
+        return MFD_ERROR;
+    }
+    tbl_idx->rdbmsSrvParamName_len = rdbmsSrvParamName_val_ptr_len * sizeof(tbl_idx->rdbmsSrvParamName[0]);
+    memcpy( tbl_idx->rdbmsSrvParamName, rdbmsSrvParamName_val_ptr, tbl_idx->rdbmsSrvParamName_len );
+    
+    /* rdbmsSrvParamSubIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->rdbmsSrvParamSubIndex = rdbmsSrvParamSubIndex_val;
+    
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This function sets the mib indexs, then updates the oid indexs
+ *  from the mib index.
+ */
+int
+rdbmsSrvParamTable_indexes_set(rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx, long applIndex_val, char *rdbmsSrvParamName_val_ptr,  size_t rdbmsSrvParamName_val_ptr_len, long rdbmsSrvParamSubIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_indexes_set","called\n"));
+
+    if(MFD_SUCCESS != rdbmsSrvParamTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+                                   , applIndex_val
+                                   , rdbmsSrvParamName_val_ptr, rdbmsSrvParamName_val_ptr_len
+                                   , rdbmsSrvParamSubIndex_val
+           ))
+        return MFD_ERROR;
+
+    /*
+     * convert mib index to oid index
+     */
+    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+    if(0 != rdbmsSrvParamTable_index_to_oid(&rowreq_ctx->oid_idx,
+                                    &rowreq_ctx->tbl_idx)) {
+        return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvParamEntry.rdbmsSrvParamID
+ * rdbmsSrvParamID is subid 3 of rdbmsSrvParamEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.7.1.3
+ * Description:
+The ID of the parameter which may be described in some
+           other MIB.  If there is no ID for this rdbmsSrvParamName,
+           attempts to access this object will return noSuchName
+           (SNMPv1) or noSuchInstance (SNMPv2).
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is AutonomousType (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length.  (Max 2147483647)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvParamID.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvParamID_map(oid **mib_rdbmsSrvParamID_val_ptr_ptr, size_t *mib_rdbmsSrvParamID_val_ptr_len_ptr, oid *raw_rdbmsSrvParamID_val_ptr, size_t raw_rdbmsSrvParamID_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsSrvParamID_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsSrvParamID_val_ptr_ptr) && (NULL != mib_rdbmsSrvParamID_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamID_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsSrvParamID non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsSrvParamID_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsSrvParamID_val_ptr_ptr) || (*mib_rdbmsSrvParamID_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsSrvParamID_val_ptr_ptr = realloc( *mib_rdbmsSrvParamID_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsSrvParamID_val_ptr_ptr));
+        if(NULL == *mib_rdbmsSrvParamID_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsSrvParamID_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsSrvParamID_val_ptr_ptr, raw_rdbmsSrvParamID_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamID_map */
+
+/**
+ * Extract the current value of the rdbmsSrvParamID data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvParamID_val_ptr_ptr
+ *        Pointer to storage for a oid variable
+ * @param rdbmsSrvParamID_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsSrvParamID.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsSrvParamID_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsSrvParamID_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsSrvParamID_get( rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx, oid **rdbmsSrvParamID_val_ptr_ptr, size_t *rdbmsSrvParamID_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   return MFD_SKIP;
+   netsnmp_assert( (NULL != rdbmsSrvParamID_val_ptr_ptr) && (NULL != *rdbmsSrvParamID_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsSrvParamID_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamID_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvParamID data.
+ * set (* rdbmsSrvParamID_val_ptr_ptr ) and (* rdbmsSrvParamID_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsSrvParamID data
+     */
+    if ((NULL == (* rdbmsSrvParamID_val_ptr_ptr )) ||
+        ((* rdbmsSrvParamID_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsSrvParamID_len * sizeof((* rdbmsSrvParamID_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsSrvParamID data
+         */
+        (* rdbmsSrvParamID_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsSrvParamID_len * sizeof((* rdbmsSrvParamID_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsSrvParamID_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsSrvParamID_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsSrvParamID_len * sizeof((* rdbmsSrvParamID_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsSrvParamID_val_ptr_ptr ), rowreq_ctx->data.rdbmsSrvParamID, (* rdbmsSrvParamID_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamID_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvParamEntry.rdbmsSrvParamCurrValue
+ * rdbmsSrvParamCurrValue is subid 4 of rdbmsSrvParamEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.39.1.7.1.4
+ * Description:
+The value for a configuration parameter now in effect, the
+           actual setting for the server.  While there may multiple
+           values in the temporal domain of interest (for instance, the
+           value to take effect at the next restart), this is the
+           current setting.
+
+           Note that a compliant agent does not need to
+           allow write access to this object.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   1
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvParamCurrValue.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvParamCurrValue_map(char **mib_rdbmsSrvParamCurrValue_val_ptr_ptr, size_t *mib_rdbmsSrvParamCurrValue_val_ptr_len_ptr, char *raw_rdbmsSrvParamCurrValue_val_ptr, size_t raw_rdbmsSrvParamCurrValue_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsSrvParamCurrValue_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsSrvParamCurrValue_val_ptr_ptr) && (NULL != mib_rdbmsSrvParamCurrValue_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamCurrValue_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsSrvParamCurrValue non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsSrvParamCurrValue_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsSrvParamCurrValue_val_ptr_ptr) || (*mib_rdbmsSrvParamCurrValue_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsSrvParamCurrValue_val_ptr_ptr = realloc( *mib_rdbmsSrvParamCurrValue_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsSrvParamCurrValue_val_ptr_ptr));
+        if(NULL == *mib_rdbmsSrvParamCurrValue_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsSrvParamCurrValue_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsSrvParamCurrValue_val_ptr_ptr, raw_rdbmsSrvParamCurrValue_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamCurrValue_map */
+
+/**
+ * Extract the current value of the rdbmsSrvParamCurrValue data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvParamCurrValue_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsSrvParamCurrValue_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsSrvParamCurrValue.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsSrvParamCurrValue_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsSrvParamCurrValue_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsSrvParamCurrValue_get( rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvParamCurrValue_val_ptr_ptr, size_t *rdbmsSrvParamCurrValue_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsSrvParamCurrValue_val_ptr_ptr) && (NULL != *rdbmsSrvParamCurrValue_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsSrvParamCurrValue_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamCurrValue_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvParamCurrValue data.
+ * set (* rdbmsSrvParamCurrValue_val_ptr_ptr ) and (* rdbmsSrvParamCurrValue_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsSrvParamCurrValue data
+     */
+    if ((NULL == (* rdbmsSrvParamCurrValue_val_ptr_ptr )) ||
+        ((* rdbmsSrvParamCurrValue_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsSrvParamCurrValue_len * sizeof((* rdbmsSrvParamCurrValue_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsSrvParamCurrValue data
+         */
+        (* rdbmsSrvParamCurrValue_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsSrvParamCurrValue_len * sizeof((* rdbmsSrvParamCurrValue_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsSrvParamCurrValue_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsSrvParamCurrValue_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsSrvParamCurrValue_len * sizeof((* rdbmsSrvParamCurrValue_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsSrvParamCurrValue_val_ptr_ptr ), rowreq_ctx->data.rdbmsSrvParamCurrValue, (* rdbmsSrvParamCurrValue_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamCurrValue_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvParamEntry.rdbmsSrvParamComment
+ * rdbmsSrvParamComment is subid 5 of rdbmsSrvParamEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.39.1.7.1.5
+ * Description:
+Annotation which describes the purpose of a configuration
+           parameter or the reason for a particular parameter's
+           setting.
+
+           Note that a compliant agent does not need to
+           allow write access to this object.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   1
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvParamComment.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvParamComment_map(char **mib_rdbmsSrvParamComment_val_ptr_ptr, size_t *mib_rdbmsSrvParamComment_val_ptr_len_ptr, char *raw_rdbmsSrvParamComment_val_ptr, size_t raw_rdbmsSrvParamComment_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsSrvParamComment_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsSrvParamComment_val_ptr_ptr) && (NULL != mib_rdbmsSrvParamComment_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamComment_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsSrvParamComment non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsSrvParamComment_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsSrvParamComment_val_ptr_ptr) || (*mib_rdbmsSrvParamComment_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsSrvParamComment_val_ptr_ptr = realloc( *mib_rdbmsSrvParamComment_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsSrvParamComment_val_ptr_ptr));
+        if(NULL == *mib_rdbmsSrvParamComment_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsSrvParamComment_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsSrvParamComment_val_ptr_ptr, raw_rdbmsSrvParamComment_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamComment_map */
+
+/**
+ * Extract the current value of the rdbmsSrvParamComment data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvParamComment_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsSrvParamComment_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsSrvParamComment.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsSrvParamComment_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsSrvParamComment_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsSrvParamComment_get( rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvParamComment_val_ptr_ptr, size_t *rdbmsSrvParamComment_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsSrvParamComment_val_ptr_ptr) && (NULL != *rdbmsSrvParamComment_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsSrvParamComment_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamComment_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvParamComment data.
+ * set (* rdbmsSrvParamComment_val_ptr_ptr ) and (* rdbmsSrvParamComment_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsSrvParamComment data
+     */
+    if ((NULL == (* rdbmsSrvParamComment_val_ptr_ptr )) ||
+        ((* rdbmsSrvParamComment_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsSrvParamComment_len * sizeof((* rdbmsSrvParamComment_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsSrvParamComment data
+         */
+        (* rdbmsSrvParamComment_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsSrvParamComment_len * sizeof((* rdbmsSrvParamComment_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsSrvParamComment_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsSrvParamComment_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsSrvParamComment_len * sizeof((* rdbmsSrvParamComment_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsSrvParamComment_val_ptr_ptr ), rowreq_ctx->data.rdbmsSrvParamComment, (* rdbmsSrvParamComment_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvParamComment_get */
+
+
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_get.h b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_get.h
new file mode 100644 (file)
index 0000000..7b57da8
--- /dev/null
@@ -0,0 +1,66 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable_data_get.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable_data_get.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVPARAMTABLE_DATA_GET_H
+#define RDBMSSRVPARAMTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvParamTable is subid 7 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.7, length: 9
+*/
+    /*
+     * indexes
+     */
+    int applIndex_map(long *mib_applIndex_val_ptr, long raw_applIndex_val);
+    int rdbmsSrvParamName_map(char **mib_rdbmsSrvParamName_val_ptr_ptr, size_t *mib_rdbmsSrvParamName_val_ptr_len_ptr, char *raw_rdbmsSrvParamName_val_ptr, size_t raw_rdbmsSrvParamName_val_ptr_len, int allow_realloc);
+    int rdbmsSrvParamSubIndex_map(long *mib_rdbmsSrvParamSubIndex_val_ptr, long raw_rdbmsSrvParamSubIndex_val);
+
+    int rdbmsSrvParamID_map(oid **mib_rdbmsSrvParamID_val_ptr_ptr, size_t *mib_rdbmsSrvParamID_val_ptr_len_ptr, oid *raw_rdbmsSrvParamID_val_ptr, size_t raw_rdbmsSrvParamID_val_ptr_len, int allow_realloc);
+    int rdbmsSrvParamID_get( rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx, oid **rdbmsSrvParamID_val_ptr_ptr, size_t *rdbmsSrvParamID_val_ptr_len_ptr );
+    int rdbmsSrvParamCurrValue_map(char **mib_rdbmsSrvParamCurrValue_val_ptr_ptr, size_t *mib_rdbmsSrvParamCurrValue_val_ptr_len_ptr, char *raw_rdbmsSrvParamCurrValue_val_ptr, size_t raw_rdbmsSrvParamCurrValue_val_ptr_len, int allow_realloc);
+    int rdbmsSrvParamCurrValue_get( rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvParamCurrValue_val_ptr_ptr, size_t *rdbmsSrvParamCurrValue_val_ptr_len_ptr );
+    int rdbmsSrvParamComment_map(char **mib_rdbmsSrvParamComment_val_ptr_ptr, size_t *mib_rdbmsSrvParamComment_val_ptr_len_ptr, char *raw_rdbmsSrvParamComment_val_ptr, size_t raw_rdbmsSrvParamComment_val_ptr_len, int allow_realloc);
+    int rdbmsSrvParamComment_get( rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvParamComment_val_ptr_ptr, size_t *rdbmsSrvParamComment_val_ptr_len_ptr );
+
+
+int rdbmsSrvParamTable_indexes_set_tbl_idx(rdbmsSrvParamTable_mib_index *tbl_idx, long applIndex_val, char *rdbmsSrvParamName_val_ptr,  size_t rdbmsSrvParamName_val_ptr_len, long rdbmsSrvParamSubIndex_val);
+int rdbmsSrvParamTable_indexes_set(rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx, long applIndex_val, char *rdbmsSrvParamName_val_ptr,  size_t rdbmsSrvParamName_val_ptr_len, long rdbmsSrvParamSubIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVPARAMTABLE_DATA_GET_H */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_set.c b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_set.c
new file mode 100644 (file)
index 0000000..296bc83
--- /dev/null
@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable_data_set.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable_data_set.c,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsSrvParamTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ * 
+ * @{
+ */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_set.h b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_data_set.h
new file mode 100644 (file)
index 0000000..f4248b6
--- /dev/null
@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable_data_set.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable_data_set.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVPARAMTABLE_DATA_SET_H
+#define RDBMSSRVPARAMTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVPARAMTABLE_DATA_SET_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_enums.h b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_enums.h
new file mode 100644 (file)
index 0000000..58bce16
--- /dev/null
@@ -0,0 +1,47 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable_enums.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable_enums.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVPARAMTABLE_ENUMS_H
+#define RDBMSSRVPARAMTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table rdbmsSrvParamTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVPARAMTABLE_ENUMS_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_interface.c b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_interface.c
new file mode 100644 (file)
index 0000000..bf54b5c
--- /dev/null
@@ -0,0 +1,743 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable_interface.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable_interface.c,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsSrvParamTable.h"
+
+
+#include <net-snmp/library/container.h>
+
+#include "rdbmsSrvParamTable_interface.h"
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvParamTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvParamTable is subid 7 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.7, length: 9
+*/
+typedef struct rdbmsSrvParamTable_interface_ctx_s {
+
+   netsnmp_container              *container;
+   netsnmp_cache                  *cache; /* optional cache */
+
+   rdbmsSrvParamTable_registration_ptr      user_ctx;
+   
+   netsnmp_table_registration_info  tbl_info;
+
+   netsnmp_baby_steps_access_methods access_multiplexer;
+
+} rdbmsSrvParamTable_interface_ctx;
+
+static rdbmsSrvParamTable_interface_ctx rdbmsSrvParamTable_if_ctx;
+
+static void _rdbmsSrvParamTable_container_init(
+    rdbmsSrvParamTable_interface_ctx *if_ctx);
+
+
+static Netsnmp_Node_Handler _mfd_rdbmsSrvParamTable_pre_request;
+static Netsnmp_Node_Handler _mfd_rdbmsSrvParamTable_post_request;
+static Netsnmp_Node_Handler _mfd_rdbmsSrvParamTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_rdbmsSrvParamTable_get_values;
+/**
+ * @internal
+ * Initialize the table rdbmsSrvParamTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+_rdbmsSrvParamTable_initialize_interface(rdbmsSrvParamTable_registration_ptr reg_ptr,  u_long flags)
+{
+    netsnmp_baby_steps_access_methods *access_multiplexer =
+        &rdbmsSrvParamTable_if_ctx.access_multiplexer;
+    netsnmp_table_registration_info *tbl_info = &rdbmsSrvParamTable_if_ctx.tbl_info;
+    netsnmp_handler_registration *reginfo;
+    netsnmp_mib_handler *handler;
+    int    mfd_modes = 0;
+
+    DEBUGMSGTL(("internal:rdbmsSrvParamTable:_rdbmsSrvParamTable_initialize_interface","called\n"));
+
+
+    /*************************************************
+     *
+     * save interface context for rdbmsSrvParamTable
+     */
+    /*
+     * Setting up the table's definition
+     */
+    netsnmp_table_helper_add_indexes(tbl_info,
+                                  ASN_INTEGER, /** index: applIndex */
+                                  ASN_OCTET_STR, /** index: rdbmsSrvParamName */
+                                  ASN_INTEGER, /** index: rdbmsSrvParamSubIndex */
+                             0);
+
+    /*  Define the minimum and maximum accessible columns.  This
+        optimizes retrival. */
+    tbl_info->min_column = RDBMSSRVPARAMTABLE_MIN_COL;
+    tbl_info->max_column = RDBMSSRVPARAMTABLE_MAX_COL;
+
+    /*
+     * save users context
+     */
+    rdbmsSrvParamTable_if_ctx.user_ctx = reg_ptr;
+
+    /*
+     * call data access initialization code
+     */
+    rdbmsSrvParamTable_init_data(reg_ptr);
+
+    /*
+     * set up the container
+     */
+    _rdbmsSrvParamTable_container_init(&rdbmsSrvParamTable_if_ctx);
+    if (NULL == rdbmsSrvParamTable_if_ctx.container) {
+        snmp_log(LOG_ERR,"could not initialize container for rdbmsSrvParamTable\n");
+        return;
+    }
+    
+    /*
+     * access_multiplexer: REQUIRED wrapper for get request handling
+     */
+    access_multiplexer->object_lookup = _mfd_rdbmsSrvParamTable_object_lookup;
+    access_multiplexer->get_values = _mfd_rdbmsSrvParamTable_get_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->pre_request = _mfd_rdbmsSrvParamTable_pre_request;
+    access_multiplexer->post_request = _mfd_rdbmsSrvParamTable_post_request;
+
+
+    /*************************************************
+     *
+     * Create a registration, save our reg data, register table.
+     */
+    DEBUGMSGTL(("rdbmsSrvParamTable:init_rdbmsSrvParamTable",
+                "Registering rdbmsSrvParamTable as a mibs-for-dummies table.\n"));              
+    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+    reginfo = netsnmp_handler_registration_create("rdbmsSrvParamTable", handler,
+                                                  rdbmsSrvParamTable_oid,
+                                                  rdbmsSrvParamTable_oid_size,
+                                                  HANDLER_CAN_BABY_STEP |
+                                                  HANDLER_CAN_RONLY
+                                                  );
+    if(NULL == reginfo) {
+        snmp_log(LOG_ERR,"error registering table rdbmsSrvParamTable\n");
+        return;
+    }
+    reginfo->my_reg_void = &rdbmsSrvParamTable_if_ctx;
+
+    /*************************************************
+     *
+     * set up baby steps handler, create it and inject it
+     */
+    if( access_multiplexer->object_lookup )
+        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+    if( access_multiplexer->set_values )
+        mfd_modes |= BABY_STEP_SET_VALUES;
+    if( access_multiplexer->irreversible_commit )
+        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+    if( access_multiplexer->object_syntax_checks )
+        mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+    if( access_multiplexer->pre_request )
+        mfd_modes |= BABY_STEP_PRE_REQUEST;
+    if( access_multiplexer->post_request )
+        mfd_modes |= BABY_STEP_POST_REQUEST;
+    
+    if( access_multiplexer->undo_setup )
+        mfd_modes |= BABY_STEP_UNDO_SETUP;
+    if( access_multiplexer->undo_cleanup )
+        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+    if( access_multiplexer->undo_sets )
+        mfd_modes |= BABY_STEP_UNDO_SETS;
+    
+    if( access_multiplexer->row_creation )
+        mfd_modes |= BABY_STEP_ROW_CREATE;
+    if( access_multiplexer->consistency_checks )
+        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+    if( access_multiplexer->commit )
+        mfd_modes |= BABY_STEP_COMMIT;
+    if( access_multiplexer->undo_commit )
+        mfd_modes |= BABY_STEP_UNDO_COMMIT;
+    
+    handler = netsnmp_baby_steps_handler_get(mfd_modes);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+     */
+    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject container_table helper
+     */
+    handler =
+        netsnmp_container_table_handler_get(tbl_info,
+                                            rdbmsSrvParamTable_if_ctx.container,
+                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+    netsnmp_inject_handler( reginfo, handler );
+
+    /*************************************************
+     *
+     * inject cache helper
+     */
+    if(NULL != rdbmsSrvParamTable_if_ctx.cache) {
+        handler = netsnmp_cache_handler_get(rdbmsSrvParamTable_if_ctx.cache);
+        netsnmp_inject_handler( reginfo, handler );
+    }
+
+    /*
+     * register table
+     */
+    netsnmp_register_table(reginfo, tbl_info);
+} /* _rdbmsSrvParamTable_initialize_interface */
+
+void
+rdbmsSrvParamTable_valid_columns_set(netsnmp_column_info *vc)
+{
+    rdbmsSrvParamTable_if_ctx.tbl_info.valid_columns = vc;
+} /* rdbmsSrvParamTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+rdbmsSrvParamTable_index_to_oid(netsnmp_index *oid_idx,
+                         rdbmsSrvParamTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_applIndex;
+    /*
+     * rdbmsSrvParamName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_rdbmsSrvParamName;
+    /*
+     * rdbmsSrvParamSubIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsSrvParamSubIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_applIndex, 0x00, sizeof(var_applIndex) );
+    var_applIndex.type = ASN_INTEGER;
+    memset( &var_rdbmsSrvParamName, 0x00, sizeof(var_rdbmsSrvParamName) );
+    var_rdbmsSrvParamName.type = ASN_OCTET_STR;
+    memset( &var_rdbmsSrvParamSubIndex, 0x00, sizeof(var_rdbmsSrvParamSubIndex) );
+    var_rdbmsSrvParamSubIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_applIndex.next_variable =  &var_rdbmsSrvParamName; var_rdbmsSrvParamName.next_variable =  &var_rdbmsSrvParamSubIndex; var_rdbmsSrvParamSubIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_index_to_oid","called\n"));
+
+        /* applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_applIndex, (u_char*)&mib_idx->applIndex,
+                       sizeof(mib_idx->applIndex));
+
+        /* rdbmsSrvParamName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
+    snmp_set_var_value(&var_rdbmsSrvParamName, (u_char*)&mib_idx->rdbmsSrvParamName,
+                       mib_idx->rdbmsSrvParamName_len * sizeof(mib_idx->rdbmsSrvParamName[0]));
+
+        /* rdbmsSrvParamSubIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_rdbmsSrvParamSubIndex, (u_char*)&mib_idx->rdbmsSrvParamSubIndex,
+                       sizeof(mib_idx->rdbmsSrvParamSubIndex));
+
+
+    err = build_oid_noalloc(oid_idx->oids, oid_idx->len, (size_t *) &oid_idx->len,
+                           NULL, 0, &var_applIndex);
+    if(err)
+        snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_applIndex );
+
+    return err;
+} /* rdbmsSrvParamTable_index_to_oid */
+
+/**
+ * extract rdbmsSrvParamTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR  : no error
+ * @retval SNMP_ERR_GENERR   : error
+ */
+int
+rdbmsSrvParamTable_index_from_oid(netsnmp_index *oid_idx,
+                         rdbmsSrvParamTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_applIndex;
+    /*
+     * rdbmsSrvParamName(1)/DisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H
+     */
+    netsnmp_variable_list var_rdbmsSrvParamName;
+    /*
+     * rdbmsSrvParamSubIndex(2)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_rdbmsSrvParamSubIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_applIndex, 0x00, sizeof(var_applIndex) );
+    var_applIndex.type = ASN_INTEGER;
+    memset( &var_rdbmsSrvParamName, 0x00, sizeof(var_rdbmsSrvParamName) );
+    var_rdbmsSrvParamName.type = ASN_OCTET_STR;
+    memset( &var_rdbmsSrvParamSubIndex, 0x00, sizeof(var_rdbmsSrvParamSubIndex) );
+    var_rdbmsSrvParamSubIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_applIndex.next_variable =  &var_rdbmsSrvParamName; var_rdbmsSrvParamName.next_variable =  &var_rdbmsSrvParamSubIndex; var_rdbmsSrvParamSubIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvParamTable:rdbmsSrvParamTable_index_from_oid","called\n"));
+
+    /*
+     * parse the oid into the individual index components
+     */
+    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+                             &var_applIndex );
+    if (err == SNMP_ERR_NOERROR) {
+        /*
+         * copy out values
+         */
+    mib_idx->applIndex = *((long *)var_applIndex.val.string);
+    /*
+     * NOTE: val_len is in bytes, rdbmsSrvParamName_len might not be
+     */
+         if(var_rdbmsSrvParamName.val_len > sizeof(mib_idx->rdbmsSrvParamName))
+             err = SNMP_ERR_GENERR;
+         else {
+             memcpy(mib_idx->rdbmsSrvParamName, var_rdbmsSrvParamName.val.string, var_rdbmsSrvParamName.val_len);
+             mib_idx->rdbmsSrvParamName_len = var_rdbmsSrvParamName.val_len / sizeof(mib_idx->rdbmsSrvParamName[0]);
+         }
+    mib_idx->rdbmsSrvParamSubIndex = *((long *)var_rdbmsSrvParamSubIndex.val.string);
+
+
+    }
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_applIndex );
+
+    return err;
+} /* rdbmsSrvParamTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a rdbmsSrvParamTable_rowreq_ctx
+ */
+rdbmsSrvParamTable_rowreq_ctx *
+rdbmsSrvParamTable_allocate_rowreq_ctx(void)
+{
+    rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx =
+                  SNMP_MALLOC_TYPEDEF(rdbmsSrvParamTable_rowreq_ctx);
+
+    DEBUGMSGTL(("internal:rdbmsSrvParamTable:rdbmsSrvParamTable_allocate_rowreq_ctx","called\n"));
+
+    if(NULL == rowreq_ctx) {
+        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+                 "rdbmsSrvParamTable_rowreq_ctx.\n");
+    }
+
+    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+    rowreq_ctx->rdbmsSrvParamTable_data_list = NULL;
+    rowreq_ctx->rdbmsSrvParamTable_reg = rdbmsSrvParamTable_if_ctx.user_ctx;
+
+
+    return rowreq_ctx;
+} /* rdbmsSrvParamTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a rdbmsSrvParamTable_rowreq_ctx
+ */
+void
+rdbmsSrvParamTable_release_rowreq_ctx(rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvParamTable:rdbmsSrvParamTable_release_rowreq_ctx","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+
+    /*
+     * free index oid pointer
+     */
+    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+        free(rowreq_ctx->oid_idx.oids);
+
+    SNMP_FREE(rowreq_ctx);
+} /* rdbmsSrvParamTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsSrvParamTable_pre_request(netsnmp_mib_handler *handler,
+                            netsnmp_handler_registration *reginfo,
+                            netsnmp_agent_request_info *agtreq_info,
+                            netsnmp_request_info *requests)
+{
+    int rc = rdbmsSrvParamTable_pre_request(rdbmsSrvParamTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsSrvParamTable","error %d from "
+                    "rdbmsSrvParamTable_pre_request\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvParamTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsSrvParamTable_post_request(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx;
+    int rc = rdbmsSrvParamTable_post_request(rdbmsSrvParamTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsSrvParamTable","error %d from "
+                    "rdbmsSrvParamTable_post_request\n", rc));
+    }
+    
+    /*
+     * if there are no errors, check for and handle row creation/deletion
+     */
+    rc = netsnmp_check_requests_error(requests);
+    if ((SNMP_ERR_NOERROR == rc) &&
+        (NULL !=
+         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
+        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+            CONTAINER_INSERT(rdbmsSrvParamTable_if_ctx.container, rowreq_ctx);
+        }
+        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+            CONTAINER_REMOVE(rdbmsSrvParamTable_if_ctx.container, rowreq_ctx);
+            rdbmsSrvParamTable_release_rowreq_ctx(rowreq_ctx);
+        }
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvParamTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsSrvParamTable_object_lookup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    
+    DEBUGMSGTL(("internal:rdbmsSrvParamTable:_mfd_rdbmsSrvParamTable_object_lookup","called\n"));
+
+    /*
+     * get our context from mfd
+     * rdbmsSrvParamTable_interface_ctx *if_ctx =
+     *             (rdbmsSrvParamTable_interface_ctx *)reginfo->my_reg_void;
+     */
+
+    if(NULL == rowreq_ctx) {
+        netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
+    }
+    else {
+        rdbmsSrvParamTable_row_prep(rowreq_ctx);
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvParamTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsSrvParamTable_get_column( rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsSrvParamTable:_mfd_rdbmsSrvParamTable_get_column","called\n"));
+
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsSrvParamID(3)/AutonomousType/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVPARAMID:
+    var->type = ASN_OBJECT_ID;
+rc = rdbmsSrvParamID_get(rowreq_ctx, (oid **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsSrvParamCurrValue(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+    case COLUMN_RDBMSSRVPARAMCURRVALUE:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsSrvParamCurrValue_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsSrvParamComment(5)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+    case COLUMN_RDBMSSRVPARAMCOMMENT:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsSrvParamComment_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _rdbmsSrvParamTable_get_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _rdbmsSrvParamTable_get_column */
+
+int
+_mfd_rdbmsSrvParamTable_get_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    u_char                     * old_string;
+    void                      (*dataFreeHook)(void *);
+    int                        rc;
+
+    DEBUGMSGTL(("internal:rdbmsSrvParamTable:_mfd_rdbmsSrvParamTable_get_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * save old pointer, so we can free it if replaced
+         */
+        old_string = requests->requestvb->val.string;
+        dataFreeHook = requests->requestvb->dataFreeHook;
+        if(NULL == requests->requestvb->val.string) {
+            requests->requestvb->val.string = requests->requestvb->buf;
+            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+        else if(requests->requestvb->buf == requests->requestvb->val.string) {
+            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+
+        /*
+         * get column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _rdbmsSrvParamTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            if(MFD_SKIP == rc) {
+                requests->requestvb->type = ASN_PRIV_RETRY;
+                rc = SNMP_ERR_NOERROR;
+            }
+        }
+        else if (NULL == requests->requestvb->val.string) {
+            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+            rc = SNMP_ERR_GENERR;
+        }
+        if(rc)
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+        /*
+         * if the buffer wasn't used previously for the old data (i.e. it
+         * was allcoated memory)  and the get routine replaced the pointer,
+         * we need to free the previous pointer.
+         */
+        if(old_string && (old_string != requests->requestvb->buf) &&
+           (requests->requestvb->val.string != old_string)) {
+            if(dataFreeHook)
+                (*dataFreeHook)(old_string);
+            else
+                free(old_string);
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvParamTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvParamTable:_cache_load","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache for rdbmsSrvParamTable_cache_load\n");
+        return -1;
+    }
+
+    /** should only be called for an invalid or expired cache */
+    netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+    
+    /*
+     * call user code
+     */
+    return rdbmsSrvParamTable_cache_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_item_free(rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvParamTable:_cache_item_free","called\n"));
+
+    if(NULL == rowreq_ctx)
+        return;
+
+    rdbmsSrvParamTable_release_rowreq_ctx(rowreq_ctx);
+} /* _cache_item_free */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+    netsnmp_container *container;
+
+    DEBUGMSGTL(("internal:rdbmsSrvParamTable:_cache_free","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache in rdbmsSrvParamTable_cache_free\n");
+        return;
+    }
+
+    container = (netsnmp_container*)cache->magic;
+
+    /*
+     * call user code
+     */
+    rdbmsSrvParamTable_cache_free(container);
+    
+    /*
+     * free all items. inefficient, but easy.
+     */
+    CONTAINER_CLEAR(container,
+                    (netsnmp_container_obj_func *)_cache_item_free,
+                    NULL);
+} /* _cache_free */
+
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_rdbmsSrvParamTable_container_init(rdbmsSrvParamTable_interface_ctx *if_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvParamTable:_rdbmsSrvParamTable_container_init","called\n"));
+    
+    /*
+     * set up the cache
+     */
+    if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+                                         _cache_load, _cache_free,
+                                         rdbmsSrvParamTable_oid,
+                                         rdbmsSrvParamTable_oid_size);
+
+    if(NULL == if_ctx->cache) {
+        snmp_log(LOG_ERR, "error creating cache for rdbmsSrvParamTable\n");
+        return;
+    }
+
+    if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+    rdbmsSrvParamTable_container_init(&if_ctx->container, if_ctx->cache);
+    if(NULL == if_ctx->container)
+        if_ctx->container = netsnmp_container_find("rdbmsSrvParamTable:table_container");
+    if(NULL == if_ctx->container) {
+        snmp_log(LOG_ERR,"error creating container in "
+                 "rdbmsSrvParamTable_container_init\n");
+        return;
+    }
+    if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _rdbmsSrvParamTable_container_init */
+
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_interface.h b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_interface.h
new file mode 100644 (file)
index 0000000..b96523b
--- /dev/null
@@ -0,0 +1,50 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable_interface.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable_interface.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVPARAMTABLE_INTERFACE_H
+#define RDBMSSRVPARAMTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "rdbmsSrvParamTable.h"
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _rdbmsSrvParamTable_initialize_interface(rdbmsSrvParamTable_registration_ptr user_ctx,
+                                    u_long flags);
+
+    rdbmsSrvParamTable_rowreq_ctx * rdbmsSrvParamTable_allocate_rowreq_ctx(void);
+void rdbmsSrvParamTable_release_rowreq_ctx(rdbmsSrvParamTable_rowreq_ctx *rowreq_ctx);
+
+int rdbmsSrvParamTable_index_to_oid(netsnmp_index *oid_idx,
+                            rdbmsSrvParamTable_mib_index *mib_idx);
+int rdbmsSrvParamTable_index_from_oid(netsnmp_index *oid_idx,
+                              rdbmsSrvParamTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void rdbmsSrvParamTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVPARAMTABLE_INTERFACE_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_oids.h b/RDBMS-MIB_src/rdbmsSrvParamTable/rdbmsSrvParamTable_oids.h
new file mode 100644 (file)
index 0000000..6c7903b
--- /dev/null
@@ -0,0 +1,38 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvParamTable_oids.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvParamTable_oids.h,v 1.2 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVPARAMTABLE_OIDS_H
+#define RDBMSSRVPARAMTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table rdbmsSrvParamTable */
+#define RDBMSSRVPARAMTABLE_OID              1,3,6,1,2,1,39,1,7
+#define COLUMN_RDBMSSRVPARAMNAME               1
+#define COLUMN_RDBMSSRVPARAMSUBINDEX           2
+#define COLUMN_RDBMSSRVPARAMID         3
+#define COLUMN_RDBMSSRVPARAMCURRVALUE          4
+#define COLUMN_RDBMSSRVPARAMCOMMENT            5
+
+#define RDBMSSRVPARAMTABLE_MIN_COL             COLUMN_RDBMSSRVPARAMID
+#define RDBMSSRVPARAMTABLE_MAX_COL             COLUMN_RDBMSSRVPARAMCOMMENT
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVPARAMTABLE_OIDS_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable.c b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable.c
new file mode 100644 (file)
index 0000000..f713244
--- /dev/null
@@ -0,0 +1,130 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable.c,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsSrvTable.h"
+
+#include <net-snmp/agent/mib_modules.h>
+
+#include "rdbmsSrvTable_interface.h"
+
+oid rdbmsSrvTable_oid[] = { RDBMSSRVTABLE_OID };
+int rdbmsSrvTable_oid_size = OID_LENGTH(rdbmsSrvTable_oid);
+
+void initialize_table_rdbmsSrvTable(void);
+
+
+/**
+ * Initializes the rdbmsSrvTable module
+ */
+void
+init_rdbmsSrvTable(void)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:init_rdbmsSrvTable","called\n"));
+
+    /*
+     * TODO:300:o: Perform rdbmsSrvTable one-time module initialization.
+     */
+     
+    /*
+     * here we initialize all the tables we're planning on supporting
+     */
+    if (should_init("rdbmsSrvTable"))
+        initialize_table_rdbmsSrvTable();
+
+} /* init_rdbmsSrvTable */
+
+/**
+ * Initialize the table rdbmsSrvTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+initialize_table_rdbmsSrvTable(void)
+{
+    rdbmsSrvTable_registration_ptr user_context;
+    u_long flags;
+
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:initialize_table_rdbmsSrvTable","called\n"));
+
+    /*
+     * TODO:301:o: Perform rdbmsSrvTable one-time table initialization.
+     */
+
+    /*
+     * TODO:302:o: |->Initialize rdbmsSrvTable user context
+     * if you'd like to pass in a pointer to some data for this
+     * table, allocate or set it up here.
+     */
+    /*
+     * a netsnmp_data_list is a simple way to store void pointers. A simple
+     * string token is used to add, find or remove pointers.
+     */
+    user_context = netsnmp_create_data_list("rdbmsSrvTable", NULL, NULL);
+    
+    /*
+     * No support for any flags yet, but in the future you would
+     * set any flags here.
+     */
+    flags = 0;
+    
+    /*
+     * call interface initialization code
+     */
+    _rdbmsSrvTable_initialize_interface(user_context, flags);
+} /* initialize_table_rdbmsSrvTable */
+
+/**
+ * pre-request callback
+ *
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_ERROR                : other error
+ */
+int
+rdbmsSrvTable_pre_request(rdbmsSrvTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvTable_pre_request","called\n"));
+
+    /*
+     * TODO:510:o: Perform rdbmsSrvTable pre-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvTable_pre_request */
+
+/**
+ * post-request callback
+ *
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : other error (ignored)
+ */
+int
+rdbmsSrvTable_post_request(rdbmsSrvTable_registration_ptr user_context)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvTable_post_request","called\n"));
+
+    /*
+     * TODO:511:o: Perform rdbmsSrvTable pos-request actions.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvTable_post_request */
+
+
+/** @{ */
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable.h b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable.h
new file mode 100644 (file)
index 0000000..c2c6553
--- /dev/null
@@ -0,0 +1,205 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable.h,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVTABLE_H
+#define RDBMSSRVTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/** @defgroup misc misc: Miscelaneous routines
+ *
+ * @{
+ */
+#include <net-snmp/library/asn1.h>
+
+/* other required module components */
+    /* *INDENT-OFF*  */
+config_require(RDBMS-MIB/rdbmsSrvTable/rdbmsSrvTable_interface);
+config_require(RDBMS-MIB/rdbmsSrvTable/rdbmsSrvTable_data_access);
+config_require(RDBMS-MIB/rdbmsSrvTable/rdbmsSrvTable_data_get);
+config_require(RDBMS-MIB/rdbmsSrvTable/rdbmsSrvTable_data_set);
+    /* *INDENT-ON*  */
+
+/* OID and column number definitions for  */
+#include "rdbmsSrvTable_oids.h"
+
+/* enum definions */
+#include "rdbmsSrvTable_enums.h"
+
+/* *********************************************************************
+ * function declarations
+ */
+void init_rdbmsSrvTable(void);
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvTable is subid 5 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.5, length: 9
+*/
+/* *********************************************************************
+ * When you register your mib, you get to provide a generic
+ * pointer that will be passed back to you for most of the
+ * functions calls.
+ *
+ * TODO:100:r: Review all context structures
+ */
+    /*
+     * TODO:101:o: |-> Review rdbmsSrvTable registration context.
+     */
+typedef netsnmp_data_list * rdbmsSrvTable_registration_ptr;
+
+/**********************************************************************/
+/*
+ * TODO:110:r: |-> Review rdbmsSrvTable data context structure.
+ * This structure is used to represent the data for rdbmsSrvTable.
+ */
+/*
+ * This structure contains storage for all the columns defined in the
+ * rdbmsSrvTable.
+ */
+typedef struct rdbmsSrvTable_data_s {
+    
+        /*
+         * rdbmsSrvPrivateMibOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h
+         */
+   oid   rdbmsSrvPrivateMibOID[128];
+size_t      rdbmsSrvPrivateMibOID_len; /* # of oid elements, not bytes */
+    
+        /*
+         * rdbmsSrvVendorName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+         */
+   char   rdbmsSrvVendorName[255];
+size_t      rdbmsSrvVendorName_len; /* # of char elements, not bytes */
+    
+        /*
+         * rdbmsSrvProductName(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H
+         */
+   char   rdbmsSrvProductName[255];
+size_t      rdbmsSrvProductName_len; /* # of char elements, not bytes */
+    
+        /*
+         * rdbmsSrvContact(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H
+         */
+   char   rdbmsSrvContact[255];
+size_t      rdbmsSrvContact_len; /* # of char elements, not bytes */
+    
+} rdbmsSrvTable_data;
+
+
+/*
+ * TODO:120:r: |-> Review rdbmsSrvTable mib index.
+ * This structure is used to represent the index for rdbmsSrvTable.
+ */
+typedef struct rdbmsSrvTable_mib_index_s {
+
+        /*
+         * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+   long   applIndex;
+
+
+} rdbmsSrvTable_mib_index;
+
+    /*
+     * TODO:121:r: |   |-> Review rdbmsSrvTable max index length.
+     * If you KNOW that your indexes will never exceed a certain
+     * length, update this macro to that length.
+*/
+#define MAX_rdbmsSrvTable_IDX_LEN     1
+
+
+/* *********************************************************************
+ * TODO:130:o: |-> Review rdbmsSrvTable Row request (rowreq) context.
+ * When your functions are called, you will be passed a
+ * rdbmsSrvTable_rowreq_ctx pointer.
+ */
+typedef struct rdbmsSrvTable_rowreq_ctx_s {
+
+    /** this must be first for container compare to work */
+    netsnmp_index        oid_idx;
+    oid                  oid_tmp[MAX_rdbmsSrvTable_IDX_LEN];
+    
+    rdbmsSrvTable_mib_index        tbl_idx;
+    
+    rdbmsSrvTable_data              data;
+
+    /*
+     * flags per row. Currently, the first (lower) 8 bits are reserved
+     * for the user. See mfd.h for other flags.
+     */
+    u_int                       rowreq_flags;
+
+    /*
+     * implementor's context pointer (provided during registration)
+     */
+    rdbmsSrvTable_registration_ptr rdbmsSrvTable_reg;
+
+    /*
+     * TODO:131:o: |   |-> Add useful data to rdbmsSrvTable rowreq context.
+     */
+    
+    /*
+     * storage for future expansion
+     */
+    netsnmp_data_list             *rdbmsSrvTable_data_list;
+
+} rdbmsSrvTable_rowreq_ctx;
+
+typedef struct rdbmsSrvTable_ref_rowreq_ctx_s {
+    rdbmsSrvTable_rowreq_ctx *rowreq_ctx;
+} rdbmsSrvTable_ref_rowreq_ctx;
+
+/* *********************************************************************
+ * function prototypes
+ */
+    int rdbmsSrvTable_pre_request(rdbmsSrvTable_registration_ptr user_context);
+    int rdbmsSrvTable_post_request(rdbmsSrvTable_registration_ptr user_context);
+
+
+extern oid rdbmsSrvTable_oid[];
+extern int rdbmsSrvTable_oid_size;
+
+
+#include "rdbmsSrvTable_interface.h"
+#include "rdbmsSrvTable_data_access.h"
+#include "rdbmsSrvTable_data_get.h"
+#include "rdbmsSrvTable_data_set.h"
+
+/*
+ * DUMMY markers, ignore
+ *
+ * TODO:099:x: *************************************************************
+ * TODO:199:x: *************************************************************
+ * TODO:299:x: *************************************************************
+ * TODO:399:x: *************************************************************
+ * TODO:499:x: *************************************************************
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVTABLE_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_access.c b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_access.c
new file mode 100644 (file)
index 0000000..6345766
--- /dev/null
@@ -0,0 +1,306 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable_data_access.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable_data_access.c,v 1.9 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsSrvTable.h"
+#include "rdbmsSrvTable_data_access.h"
+
+/** @defgroup data_access data_access: Routines to access data
+ *
+ * These routines are used to locate the data used to satisfy
+ * requests.
+ * 
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvTable is subid 5 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.5, length: 9
+*/
+
+/**
+ * initialization for rdbmsSrvTable data access
+ *
+ * This function is called during startup to allow you to
+ * allocate any resources you need for the data table.
+ *
+ * @param rdbmsSrvTable_reg
+ *        Pointer to rdbmsSrvTable_registration
+ *
+ * @retval MFD_SUCCESS : success.
+ * @retval MFD_ERROR   : unrecoverable error.
+ */
+int
+rdbmsSrvTable_init_data(rdbmsSrvTable_registration_ptr rdbmsSrvTable_reg)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvTable_init_data","called\n"));
+
+    /*
+     * TODO:303:o: Initialize rdbmsSrvTable data.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvTable_init_data */
+
+/**
+ * container-cached overview
+ *
+ */
+
+/***********************************************************************
+ *
+ * cache
+ *
+ ***********************************************************************/
+/**
+ * container initialization
+ *
+ * @param container_ptr_ptr A pointer to a container pointer. If you
+ *        create a custom container, use this parameter to return it
+ *        to the MFD helper. If set to NULL, the MFD helper will
+ *        allocate a container for you.
+ * @param  cache A pointer to a cache structure. You can set the timeout
+ *         and other cache flags using this pointer.
+ *
+ *  This function is called at startup to allow you to customize certain
+ *  aspects of the access method. For the most part, it is for advanced
+ *  users. The default code should suffice for most cases. If no custom
+ *  container is allocated, the MFD code will create one for your.
+ *
+ *  This is also the place to set up cache behavior. The default, to
+ *  simply set the cache timeout, will work well with the default
+ *  container. If you are using a custom container, you may want to
+ *  look at the cache helper documentation to see if there are any
+ *  flags you want to set.
+ *
+ * @remark
+ *  This would also be a good place to do any initialization needed
+ *  for you data source. For example, opening a connection to another
+ *  process that will supply the data, opening a database, etc.
+ */
+void
+rdbmsSrvTable_container_init(netsnmp_container **container_ptr_ptr,
+                        netsnmp_cache *cache)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvTable_container_init","called\n"));
+    
+    if((NULL == cache) || (NULL == container_ptr_ptr)) {
+        snmp_log(LOG_ERR,"bad params to rdbmsSrvTable_container_init\n");
+        return;
+    }
+
+    /*
+     * For advanced users, you can use a custom container. If you
+     * do not create one, one will be created for you.
+     */
+    *container_ptr_ptr = NULL;
+
+    /*
+     * TODO:345:A: Set up rdbmsSrvTable cache properties.
+     *
+     * Also for advanced users, you can set parameters for the
+     * cache. Do not change the magic pointer, as it is used
+     * by the MFD helper. To completely disable caching, set
+     * cache->enabled to 0.
+     */
+    cache->timeout = RDBMSSRVTABLE_CACHE_TIMEOUT; /* seconds */
+} /* rdbmsSrvTable_container_init */
+
+/**
+ * load cache data
+ *
+ * TODO:350:M: Implement rdbmsSrvTable cache load
+ *
+ * @param container container to which items should be inserted
+ *
+ * @retval MFD_SUCCESS              : success.
+ * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
+ * @retval MFD_ERROR                : other error.
+ *
+ *  This function is called to cache the index(es) (and data, optionally)
+ *  for the every row in the data set.
+ *
+ * @remark
+ *  While loading the cache, the only important thing is the indexes.
+ *  If access to your data is cheap/fast (e.g. you have a pointer to a
+ *  structure in memory), it would make sense to update the data here.
+ *  If, however, the accessing the data invovles more work (e.g. parsing
+ *  some other existing data, or peforming calculations to derive the data),
+ *  then you can limit yourself to setting the indexes and saving any
+ *  information you will need later. Then use the saved information in
+ *  rdbmsSrvTable_row_prep() for populating data.
+ *
+ * @note
+ *  If you need consistency between rows (like you want statistics
+ *  for each row to be from the same time frame), you should set all
+ *  data here.
+ *
+ */
+int
+rdbmsSrvTable_cache_load(netsnmp_container *container)
+{
+    rdbmsSrvTable_rowreq_ctx *rowreq_ctx;
+    oid rdbmsSrvPrivateMibOID[128] = { 1,3,6,1,4,1,27645 };
+    size_t                 count = 0;
+    
+        /*
+         * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+         */
+
+       /* Eventually we'll probably want to make this actually pay attention to 
+        * APPLICATION-MIB. For now, I'm ignoring it. When we make that change, we'll need to
+        * modify the other files that use applIndex (the one I'm thinking of now is rdbmsRelTable */
+   long   applIndex = 1;
+   PGresult *pgsnmpd_tbl_qry;
+   int vendor_len, contact_len, product_len;
+   char *vendor_name, *contact_name, *product_name;
+
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvTable_cache_load","called\n"));
+
+    /*
+     * TODO:351:M: |-> Load/update data in the rdbmsSrvTable container.
+     * loop over your rdbmsSrvTable data, allocate a rowreq context,
+     * set the index(es) [and data, optionally] and insert into
+     * the container.
+     */
+    
+    /* There's only one server, so we only need to create one row */
+        /*
+         * TODO:352:M: |   |-> set indexes in new rdbmsSrvTable rowreq context.
+         */
+        rowreq_ctx = rdbmsSrvTable_allocate_rowreq_ctx();
+        if (NULL == rowreq_ctx) {
+            snmp_log(LOG_ERR, "memory allocation failed\n");
+            return MFD_RESOURCE_UNAVAILABLE;
+        }
+        if(MFD_SUCCESS != rdbmsSrvTable_indexes_set(rowreq_ctx
+                               , applIndex
+               )) {
+            snmp_log(LOG_ERR,"error setting index while loading "
+                     "rdbmsSrvTable cache.\n");
+            rdbmsSrvTable_release_rowreq_ctx(rowreq_ctx);
+           return MFD_ERROR;
+        }
+
+       pgsnmpd_tbl_qry = PQexec(dbconn, "SELECT vendor_name, product_name, contact_name FROM pgsnmpd_rdbmsSrvTable");
+       if (PQresultStatus(pgsnmpd_tbl_qry) == PGRES_TUPLES_OK && PQntuples(pgsnmpd_tbl_qry) > 0) {
+               vendor_name  = PQgetvalue(pgsnmpd_tbl_qry, 0, 0);
+               product_name = PQgetvalue(pgsnmpd_tbl_qry, 0, 1);
+               contact_name = PQgetvalue(pgsnmpd_tbl_qry, 0, 2);
+               vendor_len = strlen(vendor_name);
+               product_len = strlen(product_name);
+               contact_len = strlen(contact_name);
+       }
+       else {
+               product_name = NULL;
+               vendor_name = NULL;
+               contact_name = NULL;
+               product_len = 0;
+               vendor_len = 0;
+               contact_len = 0;
+       }
+
+       rowreq_ctx->data.rdbmsSrvVendorName_len = 255;
+       rowreq_ctx->data.rdbmsSrvContact_len = 255;
+       rowreq_ctx->data.rdbmsSrvProductName_len = 255;
+
+    rowreq_ctx->data.rdbmsSrvPrivateMibOID_len = 8 * sizeof(rowreq_ctx->data.rdbmsSrvPrivateMibOID[0]);
+    memcpy( rowreq_ctx->data.rdbmsSrvPrivateMibOID, rdbmsSrvPrivateMibOID, rowreq_ctx->data.rdbmsSrvPrivateMibOID_len );
+
+    rowreq_ctx->data.rdbmsSrvVendorName_len = vendor_len * sizeof(rowreq_ctx->data.rdbmsSrvVendorName[0]);
+    memcpy( rowreq_ctx->data.rdbmsSrvVendorName, vendor_name, rowreq_ctx->data.rdbmsSrvVendorName_len );
+    
+    rowreq_ctx->data.rdbmsSrvProductName_len = product_len * sizeof(rowreq_ctx->data.rdbmsSrvProductName[0]);
+    memcpy( rowreq_ctx->data.rdbmsSrvProductName, product_name, rowreq_ctx->data.rdbmsSrvProductName_len );
+    
+    rowreq_ctx->data.rdbmsSrvContact_len = contact_len * sizeof(rowreq_ctx->data.rdbmsSrvContact[0]);
+    memcpy( rowreq_ctx->data.rdbmsSrvContact, contact_name, rowreq_ctx->data.rdbmsSrvContact_len );
+
+    PQclear(pgsnmpd_tbl_qry);
+    
+        
+        /*
+         * insert into table container
+         */
+        CONTAINER_INSERT(container, rowreq_ctx);
+        ++count;
+
+
+    DEBUGMSGT(("verbose:rdbmsSrvTable:rdbmsSrvTable_cache_load",
+               "inserted %d records\n", count));
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvTable_cache_load */
+
+/**
+ * cache clean up
+ *
+ * @param container container with all current items
+ *
+ *  This optional callback is called prior to all
+ *  item's being removed from the container. If you
+ *  need to do any processing before that, do it here.
+ *
+ * @note
+ *  The MFD helper will take care of releasing all the row contexts.
+ *
+ */
+void
+rdbmsSrvTable_cache_free(netsnmp_container *container)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvTable_cache_free","called\n"));
+
+    /*
+     * TODO:380:M: Free rdbmsSrvTable cache.
+     */
+} /* rdbmsSrvTable_cache_free */
+
+/**
+ * prepare row for processing.
+ *
+ *  When the agent has located the row for a request, this function is
+ *  called to prepare the row for processing. If you fully populated
+ *  the data context during the index setup phase, you may not need to
+ *  do anything.
+ *
+ * @param rowreq_ctx pointer to a context.
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ */
+int
+rdbmsSrvTable_row_prep( rdbmsSrvTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvTable_row_prep","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    /*
+     * TODO:390:o: Prepare row for request.
+     * If populating row data was delayed, this is the place to
+     * fill in the row for this request.
+     */
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvTable_row_prep */
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_access.h b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_access.h
new file mode 100644 (file)
index 0000000..a074ba0
--- /dev/null
@@ -0,0 +1,64 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable_data_access.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable_data_access.h,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVTABLE_DATA_ACCESS_H
+#define RDBMSSRVTABLE_DATA_ACCESS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* *********************************************************************
+ * function declarations
+ */
+
+/* *********************************************************************
+ * Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvTable is subid 5 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.5, length: 9
+*/
+
+
+    int rdbmsSrvTable_init_data(rdbmsSrvTable_registration_ptr rdbmsSrvTable_reg);
+
+
+/*
+ * TODO:180:o: Review rdbmsSrvTable cache timeout.
+ * The number of seconds before the cache times out
+ */
+#define RDBMSSRVTABLE_CACHE_TIMEOUT   60
+
+void rdbmsSrvTable_container_init(netsnmp_container **container_ptr_ptr,
+                             netsnmp_cache *cache);
+int rdbmsSrvTable_cache_load(netsnmp_container *container);
+void rdbmsSrvTable_cache_free(netsnmp_container *container);
+
+    int rdbmsSrvTable_row_prep( rdbmsSrvTable_rowreq_ctx *rowreq_ctx);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVTABLE_DATA_ACCESS_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_get.c b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_get.c
new file mode 100644 (file)
index 0000000..ce0fa3d
--- /dev/null
@@ -0,0 +1,758 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable_data_get.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable_data_get.c,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsSrvTable.h"
+
+
+/** @defgroup data_get data_get: Routines to get data
+ *
+ * TODO:230:M: Implement rdbmsSrvTable get routines.
+ * TODO:240:M: Implement rdbmsSrvTable mapping routines (if any).
+ *
+ * These routine are used to get the value for individual objects. The
+ * row context is passed, along with a pointer to the memory where the
+ * value should be copied.
+ *
+ * @{
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvTable is subid 5 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.5, length: 9
+*/
+
+/* ---------------------------------------------------------------------
+ * TODO:200:r: Implement rdbmsSrvTable data context functions.
+ */
+
+/*---------------------------------------------------------------------
+ * APPLICATION-MIB::applEntry.applIndex
+ * applIndex is subid 1 of applEntry.
+ * Its status is Current, and its access level is NoAccess.
+ * OID: .1.3.6.1.2.1.27.1.1.1
+ * Description:
+An index to uniquely identify the network service
+          application.
+ *
+ * Attributes:
+ *   accessible 0     isscalar 0     enums  0      hasdefval 0
+ *   readable   0     iscolumn 1     ranges 1      hashint   0
+ *   settable   0
+ *
+ * Ranges:  1 - 2147483647;
+ *
+ * Its syntax is INTEGER (based on perltype INTEGER)
+ * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
+ *
+ *
+ *
+ * NOTE: NODE applIndex IS NOT ACCESSIBLE
+ *
+ *
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-applIndex.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+applIndex_map(long *mib_applIndex_val_ptr, long raw_applIndex_val)
+{
+    netsnmp_assert(NULL != mib_applIndex_val_ptr);
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:applIndex_map","called\n"));
+    
+    /*
+     * TODO:241:o: |-> Implement applIndex mapping.
+     * If the values for your data type don't exactly match the
+     * possible values defined by the mib, you should map them here.
+     */
+    (*mib_applIndex_val_ptr) = raw_applIndex_val;
+
+    return MFD_SUCCESS;
+} /* applIndex_map */
+
+
+/**
+ * set mib index(es)
+ *
+ * @param tbl_idx mib index structure
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This convenience function is useful for setting all the MIB index
+ *  components with a single function call. It is assume that the C values
+ *  have already been mapped from their native/rawformat to the MIB format.
+ */
+int
+rdbmsSrvTable_indexes_set_tbl_idx(rdbmsSrvTable_mib_index *tbl_idx, long applIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvTable_indexes_set_tbl_idx","called\n"));
+
+    /* applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    tbl_idx->applIndex = applIndex_val;
+    
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvTable_indexes_set_tbl_idx */
+
+/**
+ * @internal
+ * set row context indexes
+ *
+ * @param reqreq_ctx the row context that needs updated indexes
+ *
+ * @retval MFD_SUCCESS     : success.
+ * @retval MFD_ERROR       : other error.
+ *
+ * @remark
+ *  This function sets the mib indexs, then updates the oid indexs
+ *  from the mib index.
+ */
+int
+rdbmsSrvTable_indexes_set(rdbmsSrvTable_rowreq_ctx *rowreq_ctx, long applIndex_val)
+{
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvTable_indexes_set","called\n"));
+
+    if(MFD_SUCCESS != rdbmsSrvTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
+                                   , applIndex_val
+           ))
+        return MFD_ERROR;
+
+    /*
+     * convert mib index to oid index
+     */
+    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
+    if(0 != rdbmsSrvTable_index_to_oid(&rowreq_ctx->oid_idx,
+                                    &rowreq_ctx->tbl_idx)) {
+        return MFD_ERROR;
+    }
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvTable_indexes_set */
+
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvEntry.rdbmsSrvPrivateMibOID
+ * rdbmsSrvPrivateMibOID is subid 1 of rdbmsSrvEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.5.1.1
+ * Description:
+The authoritative identification for the private MIB for this
+           server, presumably based on the vendor, e.g., { enterprises
+           111 <optional subidentifiers>} for Oracle servers, {
+           enterprises 757 <optional subidentifiers>} for Ingres
+           servers, { enterprises 897 <optional subidentifiers>} for
+           Sybase servers, etc.
+
+           If no OBJECT IDENTIFIER exists for the private MIB, attempts
+           to access this object will return noSuchName (SNMPv1)
+           or noSuchInstance (SNMPv2).
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 0      hashint   0
+ *   settable   0
+ *
+ *
+ * Its syntax is OBJECTID (based on perltype OBJECTID)
+ * The net-snmp type is ASN_OBJECT_ID. The C type decl is oid (oid)
+ * This data type requires a length.  (Max 2147483647)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvPrivateMibOID.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvPrivateMibOID_map(oid **mib_rdbmsSrvPrivateMibOID_val_ptr_ptr, size_t *mib_rdbmsSrvPrivateMibOID_val_ptr_len_ptr, oid *raw_rdbmsSrvPrivateMibOID_val_ptr, size_t raw_rdbmsSrvPrivateMibOID_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsSrvPrivateMibOID_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsSrvPrivateMibOID_val_ptr_ptr) && (NULL != mib_rdbmsSrvPrivateMibOID_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvPrivateMibOID_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsSrvPrivateMibOID non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsSrvPrivateMibOID_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsSrvPrivateMibOID_val_ptr_ptr) || (*mib_rdbmsSrvPrivateMibOID_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsSrvPrivateMibOID_val_ptr_ptr = realloc( *mib_rdbmsSrvPrivateMibOID_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsSrvPrivateMibOID_val_ptr_ptr));
+        if(NULL == *mib_rdbmsSrvPrivateMibOID_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsSrvPrivateMibOID_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsSrvPrivateMibOID_val_ptr_ptr, raw_rdbmsSrvPrivateMibOID_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvPrivateMibOID_map */
+
+/**
+ * Extract the current value of the rdbmsSrvPrivateMibOID data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvPrivateMibOID_val_ptr_ptr
+ *        Pointer to storage for a oid variable
+ * @param rdbmsSrvPrivateMibOID_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsSrvPrivateMibOID.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsSrvPrivateMibOID_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsSrvPrivateMibOID_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsSrvPrivateMibOID_get( rdbmsSrvTable_rowreq_ctx *rowreq_ctx, oid **rdbmsSrvPrivateMibOID_val_ptr_ptr, size_t *rdbmsSrvPrivateMibOID_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsSrvPrivateMibOID_val_ptr_ptr) && (NULL != *rdbmsSrvPrivateMibOID_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsSrvPrivateMibOID_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvPrivateMibOID_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvPrivateMibOID data.
+ * set (* rdbmsSrvPrivateMibOID_val_ptr_ptr ) and (* rdbmsSrvPrivateMibOID_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsSrvPrivateMibOID data
+     */
+    if ((NULL == (* rdbmsSrvPrivateMibOID_val_ptr_ptr )) ||
+        ((* rdbmsSrvPrivateMibOID_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsSrvPrivateMibOID_len * sizeof((* rdbmsSrvPrivateMibOID_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsSrvPrivateMibOID data
+         */
+        (* rdbmsSrvPrivateMibOID_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsSrvPrivateMibOID_len * sizeof((* rdbmsSrvPrivateMibOID_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsSrvPrivateMibOID_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsSrvPrivateMibOID_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsSrvPrivateMibOID_len * sizeof((* rdbmsSrvPrivateMibOID_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsSrvPrivateMibOID_val_ptr_ptr ), rowreq_ctx->data.rdbmsSrvPrivateMibOID, (* rdbmsSrvPrivateMibOID_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvPrivateMibOID_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvEntry.rdbmsSrvVendorName
+ * rdbmsSrvVendorName is subid 2 of rdbmsSrvEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.5.1.2
+ * Description:
+The name of the vendor whose RDBMS manages this database,
+           for informational purposes.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvVendorName.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvVendorName_map(char **mib_rdbmsSrvVendorName_val_ptr_ptr, size_t *mib_rdbmsSrvVendorName_val_ptr_len_ptr, char *raw_rdbmsSrvVendorName_val_ptr, size_t raw_rdbmsSrvVendorName_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsSrvVendorName_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsSrvVendorName_val_ptr_ptr) && (NULL != mib_rdbmsSrvVendorName_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvVendorName_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsSrvVendorName non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsSrvVendorName_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsSrvVendorName_val_ptr_ptr) || (*mib_rdbmsSrvVendorName_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsSrvVendorName_val_ptr_ptr = realloc( *mib_rdbmsSrvVendorName_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsSrvVendorName_val_ptr_ptr));
+        if(NULL == *mib_rdbmsSrvVendorName_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsSrvVendorName_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsSrvVendorName_val_ptr_ptr, raw_rdbmsSrvVendorName_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvVendorName_map */
+
+/**
+ * Extract the current value of the rdbmsSrvVendorName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvVendorName_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsSrvVendorName_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsSrvVendorName.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsSrvVendorName_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsSrvVendorName_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsSrvVendorName_get( rdbmsSrvTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvVendorName_val_ptr_ptr, size_t *rdbmsSrvVendorName_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsSrvVendorName_val_ptr_ptr) && (NULL != *rdbmsSrvVendorName_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsSrvVendorName_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvVendorName_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvVendorName data.
+ * set (* rdbmsSrvVendorName_val_ptr_ptr ) and (* rdbmsSrvVendorName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsSrvVendorName data
+     */
+    if ((NULL == (* rdbmsSrvVendorName_val_ptr_ptr )) ||
+        ((* rdbmsSrvVendorName_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsSrvVendorName_len * sizeof((* rdbmsSrvVendorName_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsSrvVendorName data
+         */
+        (* rdbmsSrvVendorName_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsSrvVendorName_len * sizeof((* rdbmsSrvVendorName_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsSrvVendorName_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsSrvVendorName_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsSrvVendorName_len * sizeof((* rdbmsSrvVendorName_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsSrvVendorName_val_ptr_ptr ), rowreq_ctx->data.rdbmsSrvVendorName, (* rdbmsSrvVendorName_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvVendorName_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvEntry.rdbmsSrvProductName
+ * rdbmsSrvProductName is subid 3 of rdbmsSrvEntry.
+ * Its status is Current, and its access level is ReadOnly.
+ * OID: .1.3.6.1.2.1.39.1.5.1.3
+ * Description:
+The product name of this server.  This is normally the
+           vendor's formal name for the product, in product specific
+           format.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   0
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvProductName.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvProductName_map(char **mib_rdbmsSrvProductName_val_ptr_ptr, size_t *mib_rdbmsSrvProductName_val_ptr_len_ptr, char *raw_rdbmsSrvProductName_val_ptr, size_t raw_rdbmsSrvProductName_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsSrvProductName_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsSrvProductName_val_ptr_ptr) && (NULL != mib_rdbmsSrvProductName_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvProductName_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsSrvProductName non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsSrvProductName_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsSrvProductName_val_ptr_ptr) || (*mib_rdbmsSrvProductName_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsSrvProductName_val_ptr_ptr = realloc( *mib_rdbmsSrvProductName_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsSrvProductName_val_ptr_ptr));
+        if(NULL == *mib_rdbmsSrvProductName_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsSrvProductName_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsSrvProductName_val_ptr_ptr, raw_rdbmsSrvProductName_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvProductName_map */
+
+/**
+ * Extract the current value of the rdbmsSrvProductName data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvProductName_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsSrvProductName_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsSrvProductName.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsSrvProductName_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsSrvProductName_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsSrvProductName_get( rdbmsSrvTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvProductName_val_ptr_ptr, size_t *rdbmsSrvProductName_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsSrvProductName_val_ptr_ptr) && (NULL != *rdbmsSrvProductName_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsSrvProductName_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvProductName_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvProductName data.
+ * set (* rdbmsSrvProductName_val_ptr_ptr ) and (* rdbmsSrvProductName_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsSrvProductName data
+     */
+    if ((NULL == (* rdbmsSrvProductName_val_ptr_ptr )) ||
+        ((* rdbmsSrvProductName_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsSrvProductName_len * sizeof((* rdbmsSrvProductName_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsSrvProductName data
+         */
+        (* rdbmsSrvProductName_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsSrvProductName_len * sizeof((* rdbmsSrvProductName_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsSrvProductName_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsSrvProductName_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsSrvProductName_len * sizeof((* rdbmsSrvProductName_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsSrvProductName_val_ptr_ptr ), rowreq_ctx->data.rdbmsSrvProductName, (* rdbmsSrvProductName_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvProductName_get */
+
+/*---------------------------------------------------------------------
+ * RDBMS-MIB::rdbmsSrvEntry.rdbmsSrvContact
+ * rdbmsSrvContact is subid 4 of rdbmsSrvEntry.
+ * Its status is Current, and its access level is ReadWrite.
+ * OID: .1.3.6.1.2.1.39.1.5.1.4
+ * Description:
+The textual identification of the contact person for this
+           managed server, together with information on how to contact
+           this person.
+
+           Note: if there is no active server associated with this
+           object, an agent may need to keep this in other persistent
+           storage, e.g., a configuration file.
+
+           Note that a compliant agent does not need to
+           allow write access to this object.
+ *
+ * Attributes:
+ *   accessible 1     isscalar 0     enums  0      hasdefval 0
+ *   readable   1     iscolumn 1     ranges 1      hashint   1
+ *   settable   1
+ *   hint: 255a
+ *
+ * Ranges:  0 - 255;
+ *
+ * Its syntax is DisplayString (based on perltype OCTETSTR)
+ * The net-snmp type is ASN_OCTET_STR. The C type decl is char (char)
+ * This data type requires a length.  (Max 255)
+ */
+/**
+ * map a value from its original native format to the MIB format.
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_ERROR           : Any other error
+ *
+ * @note parameters follow the memset convention (dest, src).
+ *
+ * @note generation and use of this function can be turned off by re-running
+ * mib2c after adding the following line to the file
+ * default-node-rdbmsSrvContact.m2d :
+ *   @eval $m2c_node_skip_mapping = 1@
+ *
+ * @remark
+ *  If the values for your data type don't exactly match the
+ *  possible values defined by the mib, you should map them here.
+ *  Otherwise, just do a direct copy.
+ */
+int
+rdbmsSrvContact_map(char **mib_rdbmsSrvContact_val_ptr_ptr, size_t *mib_rdbmsSrvContact_val_ptr_len_ptr, char *raw_rdbmsSrvContact_val_ptr, size_t raw_rdbmsSrvContact_val_ptr_len, int allow_realloc)
+{
+    int converted_len;
+
+    netsnmp_assert(NULL != raw_rdbmsSrvContact_val_ptr);
+    netsnmp_assert((NULL != mib_rdbmsSrvContact_val_ptr_ptr) && (NULL != mib_rdbmsSrvContact_val_ptr_len_ptr));
+    
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvContact_map","called\n"));
+    
+    /*
+     * TODO:241:r: |-> Implement rdbmsSrvContact non-integer mapping
+     * it is hard to autogenerate code for mapping types that are not simple
+     * integers, so here is an idea of what you might need to do. It will
+     * probably need some tweaking to get right.
+     */
+    /*
+     * if the length of the raw data doesn't directly correspond with
+     * the length of the mib data, set converted_len to the
+     * space required.
+     */
+    converted_len = raw_rdbmsSrvContact_val_ptr_len; /* assume equal */
+    if((NULL == *mib_rdbmsSrvContact_val_ptr_ptr) || (*mib_rdbmsSrvContact_val_ptr_len_ptr < converted_len)) {
+        if(! allow_realloc) {
+            snmp_log(LOG_ERR,"not enough space for value mapping\n");
+            return SNMP_ERR_GENERR;
+        }
+        *mib_rdbmsSrvContact_val_ptr_ptr = realloc( *mib_rdbmsSrvContact_val_ptr_ptr, converted_len * sizeof(**mib_rdbmsSrvContact_val_ptr_ptr));
+        if(NULL == *mib_rdbmsSrvContact_val_ptr_ptr) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return SNMP_ERR_GENERR;
+        }
+    }
+    *mib_rdbmsSrvContact_val_ptr_len_ptr = converted_len;
+    memcpy( *mib_rdbmsSrvContact_val_ptr_ptr, raw_rdbmsSrvContact_val_ptr, converted_len );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvContact_map */
+
+/**
+ * Extract the current value of the rdbmsSrvContact data.
+ *
+ * Set a value using the data context for the row.
+ *
+ * @param rowreq_ctx
+ *        Pointer to the row request context.
+ * @param rdbmsSrvContact_val_ptr_ptr
+ *        Pointer to storage for a char variable
+ * @param rdbmsSrvContact_val_ptr_len_ptr
+ *        Pointer to a size_t. On entry, it will contain the size (in bytes)
+ *        pointed to by rdbmsSrvContact.
+ *        On exit, this value should contain the data size (in bytes).
+ *
+ * @retval MFD_SUCCESS         : success
+ * @retval MFD_SKIP            : skip this node (no value for now)
+ * @retval MFD_ERROR           : Any other error
+*
+ * @note If you need more than (*rdbmsSrvContact_val_ptr_len_ptr) bytes of memory,
+ *       allocate it using malloc() and update rdbmsSrvContact_val_ptr_ptr.
+ *       <b>DO NOT</b> free the previous pointer.
+ *       The MFD helper will release the memory you allocate.
+ *
+ * @remark If you call this function yourself, you are responsible
+ *         for checking if the pointer changed, and freeing any
+ *         previously allocated memory. (Not necessary if you pass
+ *         in a pointer to static memory, obviously.)
+ */
+int
+rdbmsSrvContact_get( rdbmsSrvTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvContact_val_ptr_ptr, size_t *rdbmsSrvContact_val_ptr_len_ptr )
+{
+   /** we should have a non-NULL pointer and enough storage */
+   netsnmp_assert( (NULL != rdbmsSrvContact_val_ptr_ptr) && (NULL != *rdbmsSrvContact_val_ptr_ptr));
+   netsnmp_assert( NULL != rdbmsSrvContact_val_ptr_len_ptr );
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvContact_get","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+/*
+ * TODO:231:o: |-> Extract the current value of the rdbmsSrvContact data.
+ * set (* rdbmsSrvContact_val_ptr_ptr ) and (* rdbmsSrvContact_val_ptr_len_ptr ) from rowreq_ctx->data
+ */
+    /*
+     * make sure there is enough space for rdbmsSrvContact data
+     */
+    if ((NULL == (* rdbmsSrvContact_val_ptr_ptr )) ||
+        ((* rdbmsSrvContact_val_ptr_len_ptr ) < (rowreq_ctx->data.rdbmsSrvContact_len * sizeof((* rdbmsSrvContact_val_ptr_ptr )[0])))) {
+        /*
+         * allocate space for rdbmsSrvContact data
+         */
+        (* rdbmsSrvContact_val_ptr_ptr ) = malloc(rowreq_ctx->data.rdbmsSrvContact_len * sizeof((* rdbmsSrvContact_val_ptr_ptr )[0]));
+        if(NULL == (* rdbmsSrvContact_val_ptr_ptr )) {
+            snmp_log(LOG_ERR,"could not allocate memory\n");
+            return MFD_ERROR;
+        }
+    }
+    (* rdbmsSrvContact_val_ptr_len_ptr ) = rowreq_ctx->data.rdbmsSrvContact_len * sizeof((* rdbmsSrvContact_val_ptr_ptr )[0]);
+    memcpy( (* rdbmsSrvContact_val_ptr_ptr ), rowreq_ctx->data.rdbmsSrvContact, (* rdbmsSrvContact_val_ptr_len_ptr ) );
+
+    return MFD_SUCCESS;
+} /* rdbmsSrvContact_get */
+
+
+
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_get.h b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_get.h
new file mode 100644 (file)
index 0000000..f2d17f9
--- /dev/null
@@ -0,0 +1,66 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable_data_get.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable_data_get.h,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVTABLE_DATA_GET_H
+#define RDBMSSRVTABLE_DATA_GET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * GET function declarations
+ */
+
+/* *********************************************************************
+ * GET Table declarations
+ */
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvTable is subid 5 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.5, length: 9
+*/
+    /*
+     * indexes
+     */
+    int applIndex_map(long *mib_applIndex_val_ptr, long raw_applIndex_val);
+
+    int rdbmsSrvPrivateMibOID_map(oid **mib_rdbmsSrvPrivateMibOID_val_ptr_ptr, size_t *mib_rdbmsSrvPrivateMibOID_val_ptr_len_ptr, oid *raw_rdbmsSrvPrivateMibOID_val_ptr, size_t raw_rdbmsSrvPrivateMibOID_val_ptr_len, int allow_realloc);
+    int rdbmsSrvPrivateMibOID_get( rdbmsSrvTable_rowreq_ctx *rowreq_ctx, oid **rdbmsSrvPrivateMibOID_val_ptr_ptr, size_t *rdbmsSrvPrivateMibOID_val_ptr_len_ptr );
+    int rdbmsSrvVendorName_map(char **mib_rdbmsSrvVendorName_val_ptr_ptr, size_t *mib_rdbmsSrvVendorName_val_ptr_len_ptr, char *raw_rdbmsSrvVendorName_val_ptr, size_t raw_rdbmsSrvVendorName_val_ptr_len, int allow_realloc);
+    int rdbmsSrvVendorName_get( rdbmsSrvTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvVendorName_val_ptr_ptr, size_t *rdbmsSrvVendorName_val_ptr_len_ptr );
+    int rdbmsSrvProductName_map(char **mib_rdbmsSrvProductName_val_ptr_ptr, size_t *mib_rdbmsSrvProductName_val_ptr_len_ptr, char *raw_rdbmsSrvProductName_val_ptr, size_t raw_rdbmsSrvProductName_val_ptr_len, int allow_realloc);
+    int rdbmsSrvProductName_get( rdbmsSrvTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvProductName_val_ptr_ptr, size_t *rdbmsSrvProductName_val_ptr_len_ptr );
+    int rdbmsSrvContact_map(char **mib_rdbmsSrvContact_val_ptr_ptr, size_t *mib_rdbmsSrvContact_val_ptr_len_ptr, char *raw_rdbmsSrvContact_val_ptr, size_t raw_rdbmsSrvContact_val_ptr_len, int allow_realloc);
+    int rdbmsSrvContact_get( rdbmsSrvTable_rowreq_ctx *rowreq_ctx, char **rdbmsSrvContact_val_ptr_ptr, size_t *rdbmsSrvContact_val_ptr_len_ptr );
+
+
+int rdbmsSrvTable_indexes_set_tbl_idx(rdbmsSrvTable_mib_index *tbl_idx, long applIndex_val);
+int rdbmsSrvTable_indexes_set(rdbmsSrvTable_rowreq_ctx *rowreq_ctx, long applIndex_val);
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVTABLE_DATA_GET_H */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_set.c b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_set.c
new file mode 100644 (file)
index 0000000..3fb2e10
--- /dev/null
@@ -0,0 +1,30 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable_data_set.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable_data_set.c,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* standard Net-SNMP includes */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/* include our parent header */
+#include "rdbmsSrvTable.h"
+
+
+/** @defgroup data_set data_set: Routines to set data
+ *
+ * These routines are used to set the value for individual objects. The
+ * row context is passed, along with the new value.
+ * 
+ * @{
+ */
+/** @} */
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_set.h b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_data_set.h
new file mode 100644 (file)
index 0000000..e2b982f
--- /dev/null
@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable_data_set.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable_data_set.h,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVTABLE_DATA_SET_H
+#define RDBMSSRVTABLE_DATA_SET_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* *********************************************************************
+ * SET function declarations
+ */
+
+/* *********************************************************************
+ * SET Table declarations
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVTABLE_DATA_SET_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_enums.h b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_enums.h
new file mode 100644 (file)
index 0000000..c2686ce
--- /dev/null
@@ -0,0 +1,47 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable_enums.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable_enums.h,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVTABLE_ENUMS_H
+#define RDBMSSRVTABLE_ENUMS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /*
+ * NOTES on enums
+ * ==============
+ *
+ * Value Mapping
+ * -------------
+ * If the values for your data type don't exactly match the
+ * possible values defined by the mib, you should map them
+ * below. For example, a boolean flag (1/0) is usually represented
+ * as a TruthValue in a MIB, which maps to the values (1/2).
+ *
+ */
+/*************************************************************************
+ *************************************************************************
+ *
+ * enum definitions for table rdbmsSrvTable
+ *
+ *************************************************************************
+ *************************************************************************/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVTABLE_ENUMS_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_interface.c b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_interface.c
new file mode 100644 (file)
index 0000000..50567f7
--- /dev/null
@@ -0,0 +1,701 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable_interface.c
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable_interface.c,v 1.5 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pgsnmpd.h"
+
+/* include our parent header */
+#include "rdbmsSrvTable.h"
+#include "rdbmsSrvTable_interface.h"
+
+/**********************************************************************
+ **********************************************************************
+ ***
+ *** Table rdbmsSrvTable
+ ***
+ **********************************************************************
+ **********************************************************************/
+/*
+ * rdbmsSrvTable is subid 5 of rdbmsObjects.
+ * Its status is Current.
+ * OID: .1.3.6.1.2.1.39.1.5, length: 9
+*/
+typedef struct rdbmsSrvTable_interface_ctx_s {
+
+   netsnmp_container              *container;
+   netsnmp_cache                  *cache; /* optional cache */
+
+   rdbmsSrvTable_registration_ptr      user_ctx;
+   
+   netsnmp_table_registration_info  tbl_info;
+
+   netsnmp_baby_steps_access_methods access_multiplexer;
+
+} rdbmsSrvTable_interface_ctx;
+
+static rdbmsSrvTable_interface_ctx rdbmsSrvTable_if_ctx;
+
+static void _rdbmsSrvTable_container_init(
+    rdbmsSrvTable_interface_ctx *if_ctx);
+
+
+static Netsnmp_Node_Handler _mfd_rdbmsSrvTable_pre_request;
+static Netsnmp_Node_Handler _mfd_rdbmsSrvTable_post_request;
+static Netsnmp_Node_Handler _mfd_rdbmsSrvTable_object_lookup;
+static Netsnmp_Node_Handler _mfd_rdbmsSrvTable_get_values;
+/**
+ * @internal
+ * Initialize the table rdbmsSrvTable 
+ *    (Define its contents and how it's structured)
+ */
+void
+_rdbmsSrvTable_initialize_interface(rdbmsSrvTable_registration_ptr reg_ptr,  u_long flags)
+{
+    netsnmp_baby_steps_access_methods *access_multiplexer =
+        &rdbmsSrvTable_if_ctx.access_multiplexer;
+    netsnmp_table_registration_info *tbl_info = &rdbmsSrvTable_if_ctx.tbl_info;
+    netsnmp_handler_registration *reginfo;
+    netsnmp_mib_handler *handler;
+    int    mfd_modes = 0;
+
+    DEBUGMSGTL(("internal:rdbmsSrvTable:_rdbmsSrvTable_initialize_interface","called\n"));
+
+
+    /*************************************************
+     *
+     * save interface context for rdbmsSrvTable
+     */
+    /*
+     * Setting up the table's definition
+     */
+    netsnmp_table_helper_add_indexes(tbl_info,
+                                  ASN_INTEGER, /** index: applIndex */
+                             0);
+
+    /*  Define the minimum and maximum accessible columns.  This
+        optimizes retrival. */
+    tbl_info->min_column = RDBMSSRVTABLE_MIN_COL;
+    tbl_info->max_column = RDBMSSRVTABLE_MAX_COL;
+
+    /*
+     * save users context
+     */
+    rdbmsSrvTable_if_ctx.user_ctx = reg_ptr;
+
+    /*
+     * call data access initialization code
+     */
+    rdbmsSrvTable_init_data(reg_ptr);
+
+    /*
+     * set up the container
+     */
+    _rdbmsSrvTable_container_init(&rdbmsSrvTable_if_ctx);
+    if (NULL == rdbmsSrvTable_if_ctx.container) {
+        snmp_log(LOG_ERR,"could not initialize container for rdbmsSrvTable\n");
+        return;
+    }
+    
+    /*
+     * access_multiplexer: REQUIRED wrapper for get request handling
+     */
+    access_multiplexer->object_lookup = _mfd_rdbmsSrvTable_object_lookup;
+    access_multiplexer->get_values = _mfd_rdbmsSrvTable_get_values;
+
+    /*
+     * no wrappers yet
+     */
+    access_multiplexer->pre_request = _mfd_rdbmsSrvTable_pre_request;
+    access_multiplexer->post_request = _mfd_rdbmsSrvTable_post_request;
+
+
+    /*************************************************
+     *
+     * Create a registration, save our reg data, register table.
+     */
+    DEBUGMSGTL(("rdbmsSrvTable:init_rdbmsSrvTable",
+                "Registering rdbmsSrvTable as a mibs-for-dummies table.\n"));           
+    handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer);
+    reginfo = netsnmp_handler_registration_create("rdbmsSrvTable", handler,
+                                                  rdbmsSrvTable_oid,
+                                                  rdbmsSrvTable_oid_size,
+                                                  HANDLER_CAN_BABY_STEP |
+                                                  HANDLER_CAN_RONLY
+                                                  );
+    if(NULL == reginfo) {
+        snmp_log(LOG_ERR,"error registering table rdbmsSrvTable\n");
+        return;
+    }
+    reginfo->my_reg_void = &rdbmsSrvTable_if_ctx;
+
+    /*************************************************
+     *
+     * set up baby steps handler, create it and inject it
+     */
+    if( access_multiplexer->object_lookup )
+        mfd_modes |= BABY_STEP_OBJECT_LOOKUP;
+    if( access_multiplexer->set_values )
+        mfd_modes |= BABY_STEP_SET_VALUES;
+    if( access_multiplexer->irreversible_commit )
+        mfd_modes |= BABY_STEP_IRREVERSIBLE_COMMIT;
+    if( access_multiplexer->object_syntax_checks )
+        mfd_modes |= BABY_STEP_CHECK_OBJECT;
+
+    if( access_multiplexer->pre_request )
+        mfd_modes |= BABY_STEP_PRE_REQUEST;
+    if( access_multiplexer->post_request )
+        mfd_modes |= BABY_STEP_POST_REQUEST;
+    
+    if( access_multiplexer->undo_setup )
+        mfd_modes |= BABY_STEP_UNDO_SETUP;
+    if( access_multiplexer->undo_cleanup )
+        mfd_modes |= BABY_STEP_UNDO_CLEANUP;
+    if( access_multiplexer->undo_sets )
+        mfd_modes |= BABY_STEP_UNDO_SETS;
+    
+    if( access_multiplexer->row_creation )
+        mfd_modes |= BABY_STEP_ROW_CREATE;
+    if( access_multiplexer->consistency_checks )
+        mfd_modes |= BABY_STEP_CHECK_CONSISTENCY;
+    if( access_multiplexer->commit )
+        mfd_modes |= BABY_STEP_COMMIT;
+    if( access_multiplexer->undo_commit )
+        mfd_modes |= BABY_STEP_UNDO_COMMIT;
+    
+    handler = netsnmp_baby_steps_handler_get(mfd_modes);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject row_merge helper with prefix rootoid_len + 2 (entry.col)
+     */
+    handler = netsnmp_get_row_merge_handler(reginfo->rootoid_len + 2);
+    netsnmp_inject_handler(reginfo, handler);
+
+    /*************************************************
+     *
+     * inject container_table helper
+     */
+    handler =
+        netsnmp_container_table_handler_get(tbl_info,
+                                            rdbmsSrvTable_if_ctx.container,
+                                            TABLE_CONTAINER_KEY_NETSNMP_INDEX);
+    netsnmp_inject_handler( reginfo, handler );
+
+    /*************************************************
+     *
+     * inject cache helper
+     */
+    if(NULL != rdbmsSrvTable_if_ctx.cache) {
+        handler = netsnmp_cache_handler_get(rdbmsSrvTable_if_ctx.cache);
+        netsnmp_inject_handler( reginfo, handler );
+    }
+
+    /*
+     * register table
+     */
+    netsnmp_register_table(reginfo, tbl_info);
+} /* _rdbmsSrvTable_initialize_interface */
+
+void
+rdbmsSrvTable_valid_columns_set(netsnmp_column_info *vc)
+{
+    rdbmsSrvTable_if_ctx.tbl_info.valid_columns = vc;
+} /* rdbmsSrvTable_valid_columns_set */
+
+/**
+ * @internal
+ * convert the index component stored in the context to an oid
+ */
+int
+rdbmsSrvTable_index_to_oid(netsnmp_index *oid_idx,
+                         rdbmsSrvTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_applIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_applIndex, 0x00, sizeof(var_applIndex) );
+    var_applIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_applIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvTable_index_to_oid","called\n"));
+
+        /* applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h */
+    snmp_set_var_value(&var_applIndex, (u_char*)&mib_idx->applIndex,
+                       sizeof(mib_idx->applIndex));
+
+
+    err = build_oid_noalloc(oid_idx->oids, oid_idx->len, (size_t *)&oid_idx->len,
+                           NULL, 0, &var_applIndex);
+    if(err)
+        snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_applIndex );
+
+    return err;
+} /* rdbmsSrvTable_index_to_oid */
+
+/**
+ * extract rdbmsSrvTable indexes from a netsnmp_index
+ *
+ * @retval SNMP_ERR_NOERROR  : no error
+ * @retval SNMP_ERR_GENERR   : error
+ */
+int
+rdbmsSrvTable_index_from_oid(netsnmp_index *oid_idx,
+                         rdbmsSrvTable_mib_index *mib_idx)
+{
+    int err = SNMP_ERR_NOERROR;
+    
+    /*
+     * temp storage for parsing indexes
+     */
+    /*
+     * applIndex(1)/INTEGER/ASN_INTEGER/long(long)//l/a/w/e/R/d/h
+     */
+    netsnmp_variable_list var_applIndex;
+
+    /*
+     * set up varbinds
+     */
+    memset( &var_applIndex, 0x00, sizeof(var_applIndex) );
+    var_applIndex.type = ASN_INTEGER;
+
+    /*
+     * chain temp index varbinds together
+     */
+    var_applIndex.next_variable =  NULL;
+
+
+    DEBUGMSGTL(("verbose:rdbmsSrvTable:rdbmsSrvTable_index_from_oid","called\n"));
+
+    /*
+     * parse the oid into the individual index components
+     */
+    err = parse_oid_indexes( oid_idx->oids, oid_idx->len,
+                             &var_applIndex );
+    if (err == SNMP_ERR_NOERROR) {
+        /*
+         * copy out values
+         */
+    mib_idx->applIndex = *((long *)var_applIndex.val.string);
+
+
+    }
+
+    /*
+     * parsing may have allocated memory. free it.
+     */
+    snmp_reset_var_buffers( &var_applIndex );
+
+    return err;
+} /* rdbmsSrvTable_index_from_oid */
+
+
+/* *********************************************************************
+ * @internal
+ * allocate resources for a rdbmsSrvTable_rowreq_ctx
+ */
+rdbmsSrvTable_rowreq_ctx *
+rdbmsSrvTable_allocate_rowreq_ctx(void)
+{
+    rdbmsSrvTable_rowreq_ctx *rowreq_ctx =
+                  SNMP_MALLOC_TYPEDEF(rdbmsSrvTable_rowreq_ctx);
+
+    DEBUGMSGTL(("internal:rdbmsSrvTable:rdbmsSrvTable_allocate_rowreq_ctx","called\n"));
+
+    if(NULL == rowreq_ctx) {
+        snmp_log(LOG_ERR,"Couldn't allocate memory for a "
+                 "rdbmsSrvTable_rowreq_ctx.\n");
+    }
+
+    rowreq_ctx->oid_idx.oids = rowreq_ctx->oid_tmp;
+
+    rowreq_ctx->rdbmsSrvTable_data_list = NULL;
+    rowreq_ctx->rdbmsSrvTable_reg = rdbmsSrvTable_if_ctx.user_ctx;
+
+
+    return rowreq_ctx;
+} /* rdbmsSrvTable_allocate_rowreq_ctx */
+
+/*
+ * @internal
+ * release resources for a rdbmsSrvTable_rowreq_ctx
+ */
+void
+rdbmsSrvTable_release_rowreq_ctx(rdbmsSrvTable_rowreq_ctx *rowreq_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvTable:rdbmsSrvTable_release_rowreq_ctx","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+
+    /*
+     * free index oid pointer
+     */
+    if(rowreq_ctx->oid_idx.oids != rowreq_ctx->oid_tmp)
+        free(rowreq_ctx->oid_idx.oids);
+
+    SNMP_FREE(rowreq_ctx);
+} /* rdbmsSrvTable_release_rowreq_ctx */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsSrvTable_pre_request(netsnmp_mib_handler *handler,
+                            netsnmp_handler_registration *reginfo,
+                            netsnmp_agent_request_info *agtreq_info,
+                            netsnmp_request_info *requests)
+{
+    int rc = rdbmsSrvTable_pre_request(rdbmsSrvTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsSrvTable","error %d from "
+                    "rdbmsSrvTable_pre_request\n", rc));
+        netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
+    }
+    
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvTable_pre_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsSrvTable_post_request(netsnmp_mib_handler *handler,
+                             netsnmp_handler_registration *reginfo,
+                             netsnmp_agent_request_info *agtreq_info,
+                             netsnmp_request_info *requests)
+{
+    rdbmsSrvTable_rowreq_ctx *rowreq_ctx;
+    int rc = rdbmsSrvTable_post_request(rdbmsSrvTable_if_ctx.user_ctx);
+    if (MFD_SUCCESS != rc) {
+        /*
+         * nothing we can do about it but log it
+         */
+        DEBUGMSGTL(("internal:rdbmsSrvTable","error %d from "
+                    "rdbmsSrvTable_post_request\n", rc));
+    }
+    
+    /*
+     * if there are no errors, check for and handle row creation/deletion
+     */
+    rc = netsnmp_check_requests_error(requests);
+    if ((SNMP_ERR_NOERROR == rc) &&
+        (NULL !=
+         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
+        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
+            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
+            CONTAINER_INSERT(rdbmsSrvTable_if_ctx.container, rowreq_ctx);
+        }
+        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
+            CONTAINER_REMOVE(rdbmsSrvTable_if_ctx.container, rowreq_ctx);
+            rdbmsSrvTable_release_rowreq_ctx(rowreq_ctx);
+        }
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvTable_post_request */
+
+/**
+ * @internal
+ * wrapper
+ */
+static int
+_mfd_rdbmsSrvTable_object_lookup(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsSrvTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    
+    DEBUGMSGTL(("internal:rdbmsSrvTable:_mfd_rdbmsSrvTable_object_lookup","called\n"));
+
+    /*
+     * get our context from mfd
+     * rdbmsSrvTable_interface_ctx *if_ctx =
+     *             (rdbmsSrvTable_interface_ctx *)reginfo->my_reg_void;
+     */
+
+    if(NULL == rowreq_ctx) {
+        netsnmp_request_set_error_all(requests, SNMP_ERR_NOCREATION);
+    }
+    else {
+        rdbmsSrvTable_row_prep(rowreq_ctx);
+    }
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvTable_object_lookup */
+
+/***********************************************************************
+ *
+ * GET processing
+ *
+ ***********************************************************************/
+/*
+ * @internal
+ * Retrieve the value for a particular column
+ */
+NETSNMP_STATIC_INLINE int
+_rdbmsSrvTable_get_column( rdbmsSrvTable_rowreq_ctx *rowreq_ctx,
+                       netsnmp_variable_list *var, int column )
+{
+    int rc = SNMPERR_SUCCESS;
+    
+    DEBUGMSGTL(("internal:rdbmsSrvTable:_mfd_rdbmsSrvTable_get_column","called\n"));
+
+
+    netsnmp_assert(NULL != rowreq_ctx);
+
+    switch(column) {
+
+    /* rdbmsSrvPrivateMibOID(1)/OBJECTID/ASN_OBJECT_ID/oid(oid)//L/A/w/e/r/d/h */
+    case COLUMN_RDBMSSRVPRIVATEMIBOID:
+    var->type = ASN_OBJECT_ID;
+rc = rdbmsSrvPrivateMibOID_get(rowreq_ctx, (oid **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsSrvVendorName(2)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+    case COLUMN_RDBMSSRVVENDORNAME:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsSrvVendorName_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsSrvProductName(3)/DisplayString/ASN_OCTET_STR/char(char)//L/A/w/e/R/d/H */
+    case COLUMN_RDBMSSRVPRODUCTNAME:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsSrvProductName_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+    /* rdbmsSrvContact(4)/DisplayString/ASN_OCTET_STR/char(char)//L/A/W/e/R/d/H */
+    case COLUMN_RDBMSSRVCONTACT:
+    var->type = ASN_OCTET_STR;
+rc = rdbmsSrvContact_get(rowreq_ctx, (char **)&var->val.string, &var->val_len );
+        break;
+
+     default:
+         snmp_log(LOG_ERR,"unknown column %d in _rdbmsSrvTable_get_column\n", column);
+         break;
+    }
+
+    return rc;
+} /* _rdbmsSrvTable_get_column */
+
+int
+_mfd_rdbmsSrvTable_get_values(netsnmp_mib_handler *handler,
+                         netsnmp_handler_registration *reginfo,
+                         netsnmp_agent_request_info *agtreq_info,
+                         netsnmp_request_info *requests)
+{
+    rdbmsSrvTable_rowreq_ctx *rowreq_ctx =
+                  netsnmp_container_table_row_extract(requests);
+    netsnmp_table_request_info * tri;
+    u_char                     * old_string;
+    void                      (*dataFreeHook)(void *);
+    int                        rc;
+
+    DEBUGMSGTL(("internal:rdbmsSrvTable:_mfd_rdbmsSrvTable_get_values","called\n"));
+
+    netsnmp_assert(NULL != rowreq_ctx);
+    
+    for(;requests; requests = requests->next) {
+        /*
+         * save old pointer, so we can free it if replaced
+         */
+        old_string = requests->requestvb->val.string;
+        dataFreeHook = requests->requestvb->dataFreeHook;
+        if(NULL == requests->requestvb->val.string) {
+            requests->requestvb->val.string = requests->requestvb->buf;
+            requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+        else if(requests->requestvb->buf == requests->requestvb->val.string) {
+            if(requests->requestvb->val_len != sizeof(requests->requestvb->buf))
+                requests->requestvb->val_len = sizeof(requests->requestvb->buf);
+        }
+
+        /*
+         * get column data
+         */
+        tri = netsnmp_extract_table_info(requests);
+        if(NULL == tri)
+            continue;
+        
+        rc = _rdbmsSrvTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum);
+        if(rc) {
+            if(MFD_SKIP == rc) {
+                requests->requestvb->type = ASN_PRIV_RETRY;
+                rc = SNMP_ERR_NOERROR;
+            }
+        }
+        else if (NULL == requests->requestvb->val.string) {
+            snmp_log(LOG_ERR,"NULL varbind data pointer!\n");
+            rc = SNMP_ERR_GENERR;
+        }
+        if(rc)
+            netsnmp_request_set_error(requests, SNMP_VALIDATE_ERR(rc));
+
+        /*
+         * if the buffer wasn't used previously for the old data (i.e. it
+         * was allcoated memory)  and the get routine replaced the pointer,
+         * we need to free the previous pointer.
+         */
+        if(old_string && (old_string != requests->requestvb->buf) &&
+           (requests->requestvb->val.string != old_string)) {
+            if(dataFreeHook)
+                (*dataFreeHook)(old_string);
+            else
+                free(old_string);
+        }
+    } /* for results */
+
+    return SNMP_ERR_NOERROR;
+} /* _mfd_rdbmsSrvTable_get_values */
+
+/***********************************************************************
+ *
+ * SET processing
+ *
+ ***********************************************************************/
+
+/*
+ * NOT APPLICABLE (per MIB or user setting)
+ */
+/***********************************************************************
+ *
+ * DATA ACCESS
+ *
+ ***********************************************************************/
+/**
+ * @internal
+ */
+static int
+_cache_load(netsnmp_cache *cache, void *vmagic)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvTable:_cache_load","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache for rdbmsSrvTable_cache_load\n");
+        return -1;
+    }
+
+    /** should only be called for an invalid or expired cache */
+    netsnmp_assert((0 == cache->valid) || (1 == cache->expired));
+    
+    /*
+     * call user code
+     */
+    return rdbmsSrvTable_cache_load((netsnmp_container*)cache->magic);
+} /* _cache_load */
+
+/**
+ * @internal
+ */
+static void
+_cache_item_free(rdbmsSrvTable_rowreq_ctx *rowreq_ctx, void *context)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvTable:_cache_item_free","called\n"));
+
+    if(NULL == rowreq_ctx)
+        return;
+
+    rdbmsSrvTable_release_rowreq_ctx(rowreq_ctx);
+} /* _cache_item_free */
+
+/**
+ * @internal
+ */
+static void
+_cache_free(netsnmp_cache *cache, void *magic)
+{
+    netsnmp_container *container;
+
+    DEBUGMSGTL(("internal:rdbmsSrvTable:_cache_free","called\n"));
+
+    if((NULL == cache) || (NULL == cache->magic)) {
+        snmp_log(LOG_ERR, "invalid cache in rdbmsSrvTable_cache_free\n");
+        return;
+    }
+
+    container = (netsnmp_container*)cache->magic;
+
+    /*
+     * call user code
+     */
+    rdbmsSrvTable_cache_free(container);
+    
+    /*
+     * free all items. inefficient, but easy.
+     */
+    CONTAINER_CLEAR(container,
+                    (netsnmp_container_obj_func *)_cache_item_free,
+                    NULL);
+} /* _cache_free */
+
+/**
+ * @internal
+ * initialize the iterator container with functions or wrappers
+ */
+void
+_rdbmsSrvTable_container_init(rdbmsSrvTable_interface_ctx *if_ctx)
+{
+    DEBUGMSGTL(("internal:rdbmsSrvTable:_rdbmsSrvTable_container_init","called\n"));
+    
+    /*
+     * set up the cache
+     */
+    if_ctx->cache = netsnmp_cache_create(30, /* timeout in seconds */
+                                         _cache_load, _cache_free,
+                                         rdbmsSrvTable_oid,
+                                         rdbmsSrvTable_oid_size);
+
+    if(NULL == if_ctx->cache) {
+        snmp_log(LOG_ERR, "error creating cache for rdbmsSrvTable\n");
+        return;
+    }
+
+    if_ctx->cache->flags = NETSNMP_CACHE_DONT_INVALIDATE_ON_SET;
+
+    rdbmsSrvTable_container_init(&if_ctx->container, if_ctx->cache);
+    if(NULL == if_ctx->container)
+        if_ctx->container = netsnmp_container_find("rdbmsSrvTable:table_container");
+    if(NULL == if_ctx->container) {
+        snmp_log(LOG_ERR,"error creating container in "
+                 "rdbmsSrvTable_container_init\n");
+        return;
+    }
+    if_ctx->cache->magic = (void*)if_ctx->container;
+} /* _rdbmsSrvTable_container_init */
+
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_interface.h b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_interface.h
new file mode 100644 (file)
index 0000000..640efb4
--- /dev/null
@@ -0,0 +1,50 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable_interface.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable_interface.h,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVTABLE_INTERFACE_H
+#define RDBMSSRVTABLE_INTERFACE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "rdbmsSrvTable.h"
+
+/* ********************************************************************
+ * Table declarations
+ */
+
+/* PUBLIC interface initialization routine */
+void _rdbmsSrvTable_initialize_interface(rdbmsSrvTable_registration_ptr user_ctx,
+                                    u_long flags);
+
+    rdbmsSrvTable_rowreq_ctx * rdbmsSrvTable_allocate_rowreq_ctx(void);
+void rdbmsSrvTable_release_rowreq_ctx(rdbmsSrvTable_rowreq_ctx *rowreq_ctx);
+
+int rdbmsSrvTable_index_to_oid(netsnmp_index *oid_idx,
+                            rdbmsSrvTable_mib_index *mib_idx);
+int rdbmsSrvTable_index_from_oid(netsnmp_index *oid_idx,
+                              rdbmsSrvTable_mib_index *mib_idx);
+
+/*
+ * access to certain internals. use with caution!
+ */
+void rdbmsSrvTable_valid_columns_set(netsnmp_column_info *vc);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVTABLE_INTERFACE_H */
diff --git a/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_oids.h b/RDBMS-MIB_src/rdbmsSrvTable/rdbmsSrvTable_oids.h
new file mode 100644 (file)
index 0000000..4cf34de
--- /dev/null
@@ -0,0 +1,37 @@
+/*-------------------------------------------------------------------------
+ * rdbmsSrvTable_oids.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: rdbmsSrvTable_oids.h,v 1.4 2007/09/13 14:20:44 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef RDBMSSRVTABLE_OIDS_H
+#define RDBMSSRVTABLE_OIDS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* column number definitions for table rdbmsSrvTable */
+#define RDBMSSRVTABLE_OID              1,3,6,1,2,1,39,1,5
+#define COLUMN_RDBMSSRVPRIVATEMIBOID           1
+#define COLUMN_RDBMSSRVVENDORNAME              2
+#define COLUMN_RDBMSSRVPRODUCTNAME             3
+#define COLUMN_RDBMSSRVCONTACT         4
+
+#define RDBMSSRVTABLE_MIN_COL          COLUMN_RDBMSSRVPRIVATEMIBOID
+#define RDBMSSRVTABLE_MAX_COL          COLUMN_RDBMSSRVCONTACT
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RDBMSSRVTABLE_OIDS_H */
diff --git a/README.pgsnmpd b/README.pgsnmpd
new file mode 100644 (file)
index 0000000..3a43d58
--- /dev/null
@@ -0,0 +1,87 @@
+PGSNMPD Version 1.0 Release.
+
+===== Abstract =====
+
+SNMP (Simple Network Management Protocol) is a protocol for supervising 
+the apparatus connected to the network via a network.
+The version 1 of SNMP is defined by RFC1157 and the version 2 is carried
+out by RFC1441. 
+
+Network management by SNMP is realized by the UDP communication between 
+a manager and the agent who resides in the apparatus for management 
+permanently. An agent returns a response to the request from a manager.
+when special phenomena apparatus rebooted occur, a trap is sent to a 
+manager from an agent.
+
+MIB (Management Information Base) is the database of the management 
+information about the network apparatus which exists in the network 
+apparatus corresponding to SNMP. The thing of each management information 
+stored in MIB is called object (Object).OID (Object IDentifier),it is the
+discernment child rejected in order to distinguish each object,and is also
+called an object discernment child. the object is managed by the tree 
+structure.
+
+Community name is the exchange between a manager and an agent, and has a 
+role like a password. That is, if the right community name is not specified 
+when publishing a request from a manager to an agent, in an agent side,
+it will be interpreted as unlawful access.
+
+
+1.) How to Compile.
+
+Please develop this to the contrib directory of PostgreSQL Version 8.x
+And it only gmake.
+However, it is necessary to have net-snmp before it.
+http://net-snmp.sourceforge.net/
+This is checking operation by Version 5.2.1.
+
+
+2.) Usage.
+
+usage: pgsnmpd [-s] [-b] [-c FILE ] [-x address ] [-g] [-C "Connect String"]
+   -s : SNMP subagent running
+   -b : run in the background
+   -c : configuration file name
+   -g : use syslog
+   -C : libpq connect strings
+   -x : address:port of a network interface.
+   -V : display version strings
+
+You need to become the superuser of PostgreSQL as connection of libpq.
+
+(MIB TUTORIAL SMAPLE)
+RDBMS-MIB
+
+agent running sample.
+#pgsnmpd -c `pwd`/pgsnmpd.conf -x 192.168.1.0
+
+sub agent running sample.
+#pgsnmpd -s -c `pwd`/pgsnmpd.conf -x 192.168.1.0
+
+
+3.) Client Manager.
+
+Surveillance managers, such as RMON, can be used.
+
+for sample.
+#snmpwalk -v1 -c public localhost RDBMS-MIB::rdbmsDbTable
+
+4.) enterprise-numbers of PostgreSQL
+--
+http://www.iana.org/assignments/enterprise-numbers
+
+27645
+  PostgreSQL Global Development Group
+    Dave Page
+      dpage&postgresql.org
+--
+
+-------------------------------------------
+-- pgsnmpd team(pgsnmpd-devel@pgfoundry.org)
+-------------------------------------------
+Josh Tolley
+Hiroshi Saito
+Magnus Hagander
+Dave Page
+Francisco Figueiredo Jr
+-------------------------------------------
diff --git a/TODO.txt b/TODO.txt
new file mode 100644 (file)
index 0000000..e3a3757
--- /dev/null
+++ b/TODO.txt
@@ -0,0 +1,27 @@
+TODO
+Names in parentheses indicate the developer working on the TODO item
+
+- General
+       - Get db password off of the command line
+       - Update FAQ to specify agent type
+       - Command line option for location of snmpd config file
+       - Config options for tcp wrappers to find hosts.{allow|deny} files
+       - Config option to pass a config string to snmpd or tcp wrappers
+       - Possibly use pg_config VERSION string to determine for which version the agent has been compiled, to compare against server version
+
+- RDBMS-MIB
+       - Make regression test support SNMP v3
+       - Fix getopts code in pgsnmpd.c to support all snmpd command-line options
+       - Implement APPLICATION-MIB enough to index the rbdmsSrv* tables and rdbmsRelTable (Waiting until after May)
+       - Implement rdbmsWellKnownLimitedResources (maybe this isn't worth it... the only data point in there is "rdbmsLogSpace", which talks about remaining space allocated for "redo and undo logs", which doesn't mean a whole lot to pgsql)
+       - Figure out what the rdbmsConformance section of the MIB tree is supposed to do
+       - Send traps. This will take finding a nice way to poll for trap values, or have some other notification in place
+       - Review cache timeout settings for each table and adjust appropriately (it's in <table_name>_data_access.h, namely #define <TABLE_NAME>_CACHE_TIMEOUT, and defaults to 60 sec)
+               - Note that even if the timeout expires, the cache only updates when the table is polled for data. Some values (perhaps rdbmsSrvInfoHighwaterInboundAssociations, for instance) maybe ought to be updated periodically whether the OID is queried or not.
+
+- PGSQL-MIB
+       - Come up with a useful MIB, and implement it
+       - Extension of surveillance information.
+       - Server GUC management.
+       - Traps on NOTIFY
+       - Investigate possibility of reporting on standby systems of various flavors (minimally PITR, possibly others)
diff --git a/customquery.c b/customquery.c
new file mode 100644 (file)
index 0000000..9828718
--- /dev/null
@@ -0,0 +1,490 @@
+#include "pgsnmpd.h"
+#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/library/snmp_assert.h>
+#include <time.h>
+#include "customquery.h"
+#include "query_reader.h"
+
+    /* TODO: if this works, move it to pgsnmpd.h */
+#define CQ_MAX_LEN   255
+/* TODO: change this when we support multiple connections */
+const int pgsnmpdConnID = 1;
+/* TODO: change this when we support row slices in rdbmsDbTable */
+const int rdbmsDbIndex = 1;
+
+char *custom_query_config_file = NULL;
+
+/* This makes it easier to account for rdbmsDbIndex and pgsnmpdConnID */
+const int extra_idx_count = 2;
+
+    /*
+     * Note: this code uses net-snmp containers. See
+     * http://net-snmp.sourceforge.net/wiki/index.php/Containers for a helpful
+     * reference on the subject
+     */
+
+oid *
+parse_oid(const char *oid_str_orig, int *oid_len) {
+    int len = strlen(oid_str_orig), i;
+    char *a, *b, *oid_str;
+    oid *result;
+
+    oid_str = strdup((char *)oid_str_orig);
+    if (oid_str == NULL) {
+        snmp_log(LOG_ERR, "Couldn't allocate copy of OID string\n");
+        exit(1);
+    }
+    a = oid_str;
+
+    result = malloc(len * sizeof(oid));
+    if (result == NULL) {
+        snmp_log(LOG_ERR, "Couldn't allocate array of %d OIDs\n", *oid_len);
+        exit(1);
+    }
+    i = 0;
+
+    a = oid_str;
+    *oid_len = 0;
+    while (a - oid_str < len) {
+        b = strpbrk(a, ".");
+        if (b == NULL) {
+            result[i] = atoi(a);
+            (*oid_len)++;
+            break;
+        }
+        else {
+            *b = '\0';
+            result[i++] = atoi(a);
+            a = b+1;
+            (*oid_len)++;
+        }
+    }
+    free(oid_str);
+    return result;
+}
+
+typedef struct cust_query_row {
+    netsnmp_index row_index;
+    oid *myoids;
+    pgsnmpd_query *query;
+    int rownum;
+} cust_query_row;
+
+pgsnmpd_query *head;
+
+pgsnmpd_query *read_custom_queries(void);
+void free_query(pgsnmpd_query *query);
+void fill_query_column_types(pgsnmpd_query *query);
+void fill_query_container(pgsnmpd_query *query);
+
+int custom_query_get_value(
+            netsnmp_request_info *request,
+            netsnmp_index *item,
+            netsnmp_table_request_info *table_info );
+
+int run_query(pgsnmpd_query *query);
+int set_val_from_string(netsnmp_variable_list *var, u_char type, char *val);
+
+/* 
+ * Frees memory associated with an allocated (or partially allocated)
+ * pgsnmpd_query structure, and all such structures following it in the 
+ * query list
+*/
+void free_query(pgsnmpd_query *query) {
+    if (query == NULL) return;
+    if (query->table_name != NULL) free(query->table_name);
+    if (query->query_text != NULL) free(query->query_text);
+    if (query->table_oid  != NULL) free(query->table_oid);
+    if (query->types      != NULL) free(query->types);
+    if (query->result     != NULL) PQclear(query->result);
+    if (query->next       != NULL) free_query(query->next);
+    free(query);
+}
+
+/* Allocates a pgsnmpd_query struct */
+pgsnmpd_query *
+alloc_custom_query(char *table_name, char *query_text, oid *table_oid, int oid_len) {
+    pgsnmpd_query *query;
+    int i;
+
+    query = malloc(sizeof(pgsnmpd_query));
+    if (query == NULL) return NULL;
+    query->result = NULL;
+    query->next = NULL;
+    query->last_refresh = 0;
+    query->cache_timeout = -1;
+    query->my_handler = NULL;
+    query->typeslen = 0;
+
+    i = strnlen(table_name, CQ_MAX_LEN);
+    query->table_name = strndup(table_name, i);
+    if (query->table_name == NULL) {
+        free_query(query);
+        return NULL;
+    }
+
+    i = strnlen(query_text, CQ_MAX_LEN);
+    query->query_text = strndup(query_text, i);
+    if (query->query_text == NULL) {
+        free_query(query);
+        return NULL;
+    }
+
+    query->table_oid = malloc(sizeof(oid) * oid_len);
+    if (query->table_oid == NULL) {
+        free_query(query);
+        return NULL;
+    }
+    for (i = 0; i < oid_len; i++) {
+        query->table_oid[i] = table_oid[i];
+    }
+    query->oid_len = oid_len;
+
+    return query;
+}
+
+int run_query(pgsnmpd_query *query) {
+    /* TODO: remember to destroy all old rows when updating query. */
+    time_t curtime;
+
+    if (query == NULL) return -1;
+    if (PQstatus(dbconn) != CONNECTION_OK) 
+        return -1;
+    if (query->result != NULL)
+        PQclear(query->result);
+
+    query->result = PQexec(dbconn, query->query_text);
+    if (PQresultStatus(query->result) != PGRES_TUPLES_OK) {
+        snmp_log(LOG_ERR, "Failed to run query \"%s\"\n", query->query_text);
+        PQclear(query->result);
+        return -1;
+    }
+    curtime = time(NULL);
+    query->last_refresh = curtime;
+    query->colcount = PQnfields(query->result);
+    query->rowcount = PQntuples(query->result);
+
+    return 1;
+}
+
+void fill_query_column_types(pgsnmpd_query *query)
+{
+    int i;
+    Oid type;  /* NB! PostgreSQL's Oid, not Net-SNMP's oid */
+    PGresult *res;
+    const char *values[1];
+    char param[10];
+    
+    /* This translates SQL types to SNMP types, as follows:
+     * Conversions for these four types are obvious
+     * ASN_INTEGER
+     * ASN_FLOAT
+     * ASN_BOOLEAN
+     * ASN_OBJECT_ID
+     * 
+     * Everything else becomes a string:
+     * ASN_OCTET_STR
+     * 
+     * Perhaps one day we'll also use ASN_DOUBLE
+     */
+
+    if (query->result == NULL)
+        return;
+
+    values[0] = param;
+
+    for (i = 0; i < query->colcount; i++) {
+        if (query->types[i] != 255) {
+            continue;
+        }
+        type = PQftype(query->result, i);
+        /* 
+         * TODO: query pg_type table (including pg_type.h to use builtin
+         * constants got all kinds of errors I'd rather not deal with
+         */
+        sprintf(param, "%d", type);
+        res = PQexecPrepared(dbconn, "TYPEQUERY", 1, values, NULL, NULL, 0);
+        if (PQresultStatus(res) != PGRES_TUPLES_OK)
+            snmp_log(LOG_ERR, "Couldn't determine column type\n");
+        else {
+            switch (atoi(PQgetvalue(res, 0, 0))) {
+                case 0:
+                    query->types[i] = ASN_INTEGER;
+                    break;
+                case 1:
+                    query->types[i] = ASN_FLOAT;
+                    break;
+                case 2: 
+                    query->types[i] = ASN_BOOLEAN;
+                    break;
+                case 3: 
+                    query->types[i] = ASN_OCTET_STR;
+                    break;
+                default: /* If we get here, it's because the TYPEQUERY is b0rken */
+                    snmp_log(LOG_ERR, "Unknown column type translation. This is a bug.\n");
+            }
+        }
+        PQclear(res);
+    }
+}
+
+void
+init_types_array(u_char *types, int start, int end) {
+    int i = (start < 0 ? 0 : start);
+
+    for (; i <= end; i++)
+        types[i] = 255;
+}
+
+/* General initialization */
+void init_custom_queries(void)
+{
+    netsnmp_table_registration_info *table_info;
+    pgsnmpd_query *curquery;
+    int i;
+    PGresult *res;
+
+    if (custom_query_config_file == NULL) 
+        return;
+
+    /*
+        ASN_INTEGER = 0
+        ASN_FLOAT = 1
+        ASN_BOOLEAN = 2
+        ASN_OCTET_STR = 3
+    */
+
+    res = PQprepare(dbconn, "TYPEQUERY", 
+        "SELECT CASE "
+            "WHEN typname LIKE 'int%' OR typname = 'xid' OR typname = 'oid'"
+                "THEN 0 "
+            "WHEN typname LIKE 'float%' THEN 1 "
+            "WHEN typname = 'bool' THEN 2 "
+            "ELSE 3 "
+        "END "
+        "FROM pg_catalog.pg_type WHERE oid = $1", 1, NULL);
+    if (PQresultStatus(res) != PGRES_COMMAND_OK) {
+        snmp_log(LOG_ERR, "Failed to prepare statement (error: %s)\n", PQresStatus(PQresultStatus(res)));
+        return;
+    }
+    PQclear(res);
+
+    head = parse_config(custom_query_config_file);
+    if (head == NULL) {
+        snmp_log(LOG_INFO, "No custom queries initialized\n");
+        return;
+    }
+
+    for (curquery = head; curquery != NULL; curquery = curquery->next) {
+        run_query(curquery);
+        if (curquery->typeslen < curquery->colcount)
+            curquery->types = realloc(curquery->types, sizeof(u_char) * curquery->colcount);
+        if (curquery->types == NULL) {
+            snmp_log(LOG_ERR, "Memory allocation problem");
+            return;
+        }
+        init_types_array(curquery->types, curquery->typeslen, curquery->colcount);
+        fill_query_column_types(curquery);
+        if (curquery->my_handler) {
+            snmp_log(LOG_ERR,
+                "init_custom_queries called again for query %s\n",
+                curquery->table_name);
+            return;
+        }
+
+        memset(&(curquery->cb), 0x00, sizeof(curquery->cb));
+
+        /** create the table structure itself */
+        snmp_log(LOG_INFO, "Initializing table name %s\n", curquery->table_name);
+        table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+        curquery->my_handler = netsnmp_create_handler_registration(
+            curquery->table_name,
+            netsnmp_table_array_helper_handler,
+            curquery->table_oid,
+            curquery->oid_len,
+            HANDLER_CAN_RONLY
+        );
+
+        if (!curquery->my_handler || !table_info) {
+            snmp_log(LOG_ERR, "malloc failed in init_custom_queries\n");
+            return; /** mallocs failed */
+        }
+
+        netsnmp_table_helper_add_index(table_info, ASN_INTEGER); /* pgsnmpdConnID */
+        netsnmp_table_helper_add_index(table_info, ASN_INTEGER); /* rdbmsDbIndex */
+        for (i = 0; i < curquery->num_indexes; i++)
+            netsnmp_table_helper_add_index(table_info, curquery->types[i]);
+
+        table_info->min_column = curquery->min_colnum;
+        table_info->max_column = curquery->colcount;
+
+        curquery->cb.get_value = custom_query_get_value;
+        curquery->cb.container = netsnmp_container_find("table_container");
+
+        DEBUGMSGTL(("init_custom_queries",
+                    "Registering table for query "
+                    "as a table array\n"));
+        switch (netsnmp_table_container_register(curquery->my_handler,
+                    table_info, &curquery->cb,
+                    curquery->cb.container, 1)) {
+            case MIB_REGISTRATION_FAILED:
+                snmp_log(LOG_INFO, "Failed to register table %s\n", curquery->table_name);
+                break;
+            case MIB_DUPLICATE_REGISTRATION:
+                snmp_log(LOG_INFO, "Duplicate registration for table %s\n", curquery->table_name);
+                break;
+            case MIB_REGISTERED_OK:
+                DEBUGMSGTL(("init_custom_queries",
+                            "Successfully registered table %s\n", curquery->table_name));
+                break;
+            default:
+                snmp_log(LOG_INFO, "Unknown registration result for table %s\n", curquery->table_name);
+        }
+
+        /* Having set everything up, fill the table's container with data */
+        fill_query_container(curquery);
+    }
+    snmp_log(LOG_DEBUG, "Finished intializing queries\n");
+}
+
+void fill_query_container(pgsnmpd_query *query)
+{
+    /* TODO: Make this work */
+    cust_query_row *row;
+    int i, j, string_idx_count, string_idx_len;
+    netsnmp_variable_list var_rdbmsDbIndex, var_pgsnmpdConnID, *var_otherIndexes;
+    int err = SNMP_ERR_NOERROR;
+    char *val;
+
+    memset( &var_pgsnmpdConnID, 0x00, sizeof(var_pgsnmpdConnID) );
+    var_pgsnmpdConnID.type = ASN_INTEGER;
+    memset( &var_rdbmsDbIndex, 0x00, sizeof(var_rdbmsDbIndex) );
+    var_rdbmsDbIndex.type = ASN_INTEGER;
+
+    var_otherIndexes = malloc(sizeof(netsnmp_variable_list) * query->num_indexes);
+    if (var_otherIndexes == NULL) {
+        snmp_log(LOG_ERR, "Memory allocation error\n");
+        return;
+    }
+    memset(var_otherIndexes, 0, sizeof(netsnmp_variable_list) * query->num_indexes);
+
+    string_idx_count = 0;
+    for (i = 0; i < query->num_indexes; i++) {
+        if (i < query->num_indexes - 1)
+            var_otherIndexes[i].next_variable = &var_otherIndexes[i+1];
+        var_otherIndexes[i].type = query->types[i];
+        if (query->types[i] == ASN_OCTET_STR)
+            string_idx_count++;
+    }
+
+    var_pgsnmpdConnID.next_variable    = &var_rdbmsDbIndex;
+    var_rdbmsDbIndex.next_variable     = var_otherIndexes;
+
+    snmp_set_var_typed_value(&var_rdbmsDbIndex, ASN_INTEGER, (u_char *) &rdbmsDbIndex, sizeof(int));
+    snmp_set_var_typed_value(&var_pgsnmpdConnID, ASN_INTEGER, (u_char *) &pgsnmpdConnID, sizeof(int));
+
+    for (i = 0; i < query->rowcount; i++) {
+        string_idx_len = 0;
+        for (j = 0; j < query->num_indexes; j++) {
+            val = PQgetvalue(query->result, i, j);
+            /* TODO: Floats and OIDs also need more than the usual memory.
+             * Learn to handle them. Until then we can expect problems using
+             * OIDs and Floats as indexes  */
+            if (query->types[j] == ASN_OCTET_STR) string_idx_len += strlen(val);
+            set_val_from_string(&var_otherIndexes[j], query->types[j], val);
+        }
+        row = SNMP_MALLOC_TYPEDEF(cust_query_row);
+        row->myoids = malloc(sizeof(oid) * 
+            (query->num_indexes + extra_idx_count + string_idx_count + string_idx_len));
+        if (row->myoids == NULL) {
+            snmp_log(LOG_ERR, "memory allocation problem \n");
+            return;
+        }
+
+        row->row_index.len = query->num_indexes + extra_idx_count + string_idx_len + string_idx_count;
+        row->row_index.oids = row->myoids;
+
+        err = build_oid_noalloc(row->row_index.oids, row->row_index.len,
+                     (size_t *) &(row->row_index.len), NULL, 0, &var_pgsnmpdConnID);
+        if (err)
+            snmp_log(LOG_ERR,"error %d converting index to oid, query %s\n", err,
+                query->table_name);
+
+        row->query = query;
+        row->rownum = i;
+
+        CONTAINER_INSERT(query->cb.container, row);
+    }
+}
+
+/*
+ * custom_query_get_value
+ *
+ * This routine is called for get requests to copy the data
+ * from the context to the varbind for the request. If the
+ * context has been properly maintained, you don't need to
+ * change in code in this fuction.
+ */
+int custom_query_get_value(
+            netsnmp_request_info *request,
+            netsnmp_index *item,
+            netsnmp_table_request_info *table_info )
+{
+    int column = table_info->colnum;
+    netsnmp_variable_list *var = request->requestvb;
+    cust_query_row *context = (cust_query_row *)item;
+
+    if (context->query->result == NULL) {
+        snmp_log(LOG_ERR, "No valid result for table\n");
+        /* TODO: Make this less fatal? */
+        return SNMP_ERR_GENERR;
+    }
+    if (column > context->query->colcount + extra_idx_count) {
+        snmp_log(LOG_ERR, "Unknown column in requested table\n");
+        return SNMP_ERR_GENERR;
+    }
+
+    return 
+        set_val_from_string(var, context->query->types[column - context->query->min_colnum],
+            PQgetvalue(context->query->result, context->rownum, column - context->query->min_colnum));
+}
+
+int set_val_from_string(netsnmp_variable_list *var, u_char type, char *val) {
+    int i;
+    float f;
+    u_char myoid[] = { 1, 3, 6, 1, 3, 1 };
+
+    switch (type) {
+        case ASN_INTEGER:
+            i = atoi(val);
+            snmp_set_var_typed_value(var, ASN_INTEGER,
+                    (u_char *) &i, sizeof(int));
+            break;
+        case ASN_FLOAT:
+            f = strtof(val, NULL);
+            snmp_set_var_typed_value(var, ASN_OPAQUE_FLOAT,
+                    (u_char *) &f, sizeof(float));
+            break;
+        case ASN_BOOLEAN:
+            if (val[0] == 't')
+                i = 1;
+            else i = 2;
+            snmp_set_var_typed_value(var, ASN_INTEGER,
+                    (u_char *) &i, sizeof(int));
+            break;
+        case ASN_OCTET_STR:
+            snmp_set_var_typed_value(var, type,
+                    (u_char *) val, strlen(val) * sizeof(char));
+            break;
+        case ASN_OBJECT_ID:
+            snmp_log(LOG_ERR, "Passing back an OBJECT_ID\n");
+            snmp_set_var_typed_value(var, type, myoid, sizeof(u_char) * 6); /* (u_char *) val, 5); strlen(val) * sizeof(char)); */
+            break;
+        default:
+            snmp_log(LOG_ERR, "Unknown data type returning result. This is a bug.\n");
+            return SNMP_ERR_GENERR;
+    }
+    return SNMP_ERR_NOERROR;
+}
diff --git a/customquery.h b/customquery.h
new file mode 100644 (file)
index 0000000..d9ce461
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef CUSTHANDLER_H
+#define CUSTHANDLER_H
+
+#include "pgsnmpd.h"
+
+void init_custom_queries(void);
+
+typedef struct pgsnmpd_query pgsnmpd_query;
+
+extern char *custom_query_config_file;
+
+struct pgsnmpd_query {
+    char  *table_name;
+    char  *query_text;
+    oid   *table_oid;
+    size_t oid_len;
+
+    int      num_indexes;
+    int      min_colnum;
+    u_char  *types;
+    int      typeslen;
+
+    /* Number of rows and columns returned by the query */
+    int rowcount;
+    int colcount;
+
+    PGresult *result;
+
+    /* How long (sec) before I need to refresh this result */
+    int cache_timeout;
+    /* When the result was last refreshed */
+    time_t last_refresh;
+
+    netsnmp_table_array_callbacks cb;
+    netsnmp_handler_registration *my_handler;
+
+    pgsnmpd_query *next;
+};
+
+pgsnmpd_query *alloc_custom_query(char *table_name, char *query_text,
+                                    oid *table_oid, int oid_len);
+
+void init_types_array(u_char *types, int start, int end);
+
+oid *parse_oid(const char *oid_str_orig, int *oid_len);
+
+#endif /* CUSTHANDLER_H */
diff --git a/doc/pgsnmpd.htm b/doc/pgsnmpd.htm
new file mode 100644 (file)
index 0000000..ee62a7e
--- /dev/null
@@ -0,0 +1,337 @@
+<html>
+  <title>pgsnmpd</title>
+  <style type="text/css">
+  <!--
+       body {
+               font-family: sans-serif;
+               font-size: 14;
+               width: 800px;
+       }
+       h2 {
+               color: #AA0000;
+               font-weight: bold;
+               border-bottom: 1px solid #AA0000;
+       }
+       div.desc {
+               padding-left: 20px;
+       }
+       div.codeblock {
+               font-family: monospace;
+               font-size: 12;
+               border: 2px solid #999999;
+               padding: 5px;
+               margin-top: 8px;
+               margin-bottom: 8px;
+               margin-left: 15px;
+               margin-right: 15px;
+               font-weight: bold;
+       }
+       .codeblock p {
+               padding: 1px;
+               margin: 1px;
+       }
+       li {
+               font-style: italic;
+       }
+  -->
+  </style>
+<body>
+  <h2>About pgsnmpd</h2>
+    <div class="desc">
+  <p>pgsnmpd is an SNMP agent for PostgreSQL which implements RDBMS-MIB, as
+  defined in <a href="http://www.faqs.org/rfcs/rfc1697.html">RFC 1697</a>.
+  This MIB was developed by a group of representatives from different database
+  manufacturers, and describes various attributes common to most relational
+  database management systems. Because it was designed as the least common
+  denominator, it doesn't show very much detail and there are definitely a
+  number of things RDBMS-MIB doesn't cover that PostgreSQL administrators would
+  be very interested in. Future versions of pgsnmpd will support a second MIB,
+  tentatively called PGSQL-MIB, in addition to RDBMS-MIB. This PGSQL-MIB will
+  be PostgreSQL-specific, and will include many more data points of interest to
+  PostgreSQL users and administrators.</p> <p>pgsnmpd has been used on Linux,
+  OpenBSD, and FreeBSD, and perhaps other systems. Future versions will likely
+  also work on Windows-based platforms.</p>
+    </div>
+  <h2>Compiling pgsnmpd</h2>
+    <div class="desc">
+  <p>PostgreSQL can be compiled within the PostgreSQL source tree, by putting
+  the pgsnmpd distribution into the postgresql-XXX/contrib directory and
+  running "make" (note: GNU make, referred to as gmake on some platforms, is
+  required for the build).</p>
+      <div class="codeblock">
+<p>jtolley@uber:~/devel/postgresql-8.2.3/contrib$ tar -zxf pgsnmpd.tgz</p>
+<p>jtolley@uber:~/devel/postgresql-8.2.3/contrib$ cd pgsnmpd</p>
+<p>jtolley@uber:~/devel/postgresql-8.2.3/contrib/pgsnmpd$ make</p>
+<p>...</p>
+      </div>
+  <p>Alternatively, pgsnmpd can also be built without the postgresql source
+  tree. This will probably require installation of a postgresql-dev package,
+  though that depends on the operating system and distribution. In this case,
+  the user must first set the USE_PGXS variable to tell the make process how to
+  behave, as follows:</p>
+    <div class="codeblock">
+<p>jtolley@uber:~/devel$ tar -zxf pgsnmpd.tgz</p>
+<p>jtolley@uber:~/devel$ cd pgsnmpd/</p>
+<p>jtolley@uber:~/devel/pgsnmpd$ env USE_PGXS=1 make</p>
+      </div>
+      <p>Note that building pgsnmpd requires Net-SNMP development files.</p>
+    </div>
+  <h2>Running pgsnmpd</h2>
+    <div class="desc">
+  <p>pgsnmpd can run in one of three different modes:</p>
+  <ul>
+    <li>Standalone SNMP agent</li>
+    <li>Pass-through sub-agent</li>
+    <li>AgentX sub-agent</li>
+  </ul>
+  <p>As a standalone SNMP agent, pgsnmpd itself listens on a network socket for
+  SNMP queries, and requires the same configuration as the Net-SNMP SNMP
+  daemon. SNMP is sometimes difficult to configure, and Net-SNMP provides a
+  program called snmpconf to help the user create a suitable configuration
+  file.</p> <p>pgsnmpd can also run as a sub-agent in two different ways. A
+  sub-agent is like a slave to a master agent; when it starts, the sub-agent
+  registers itself with the master to tell the master which parts of the MIB it
+  knows about.  The master communicates with the SNMP client, and forwards
+  requests for appropriate sections of the MIB to the sub-agent. Pass-through
+  agents are actually identical to standalone agents &mdash; the only
+  difference is that the master is configured to pass queries through to the
+  sub-agent. AgentX sub-agents, on the other hand, don't listen to the network
+  at all, and instead communicate with the master agent through UNIX
+  sockets.</p>
+  <p>pgsnmpd is implemented using net-snmp and libpq, and most of the
+  command-line options available are intended to control those libraries. pgsnmpd
+  supports the following options:</p>
+      <div class="codeblocK">
+<p>jtolley@uber:~/devel/pgsnmpd$ ./pgsnmpd  -?</p>
+<p>./pgsnmpd: invalid option -- ?</p>
+<p>Version PGSQL-SNMP-1.0beta</p>
+<p>usage: pgsnmpd [-s] [-b] [-c FILE ] [-x address ] [-g] [-C "Connect String"]</p>
+<p style="text-indent: 3em">   -s : run as AgentX sub-agent of an existing snmpd process</p>
+<p style="text-indent: 3em">   -b : run in the background</p>
+<p style="text-indent: 3em">   -c : configuration file name</p>
+<p style="text-indent: 3em">   -g : use syslog</p>
+<p style="text-indent: 3em">   -C : libpq connect strings</p>
+<p style="text-indent: 3em">   -x : address:port of a network interface</p>
+<p style="text-indent: 3em">   -V : display version strings</p>
+      </div>
+    <p>Perhaps the simplest way to run pgsnmpd is as a standalone SNMP agent,
+    as described below. The most difficult part is to write a proper
+    configuration file. The pgsnmpd regression tester, pgsnmpd_regress.pl,
+    contains a workable sample configuration file, shown here:</p>
+      <div class="codeblock">
+<p>com2sec readwrite default public</p>
+<p>group MyRWGroup v2c readwrite</p>
+<p>view all included .1 80</p>
+<p>access MyRWGroup "" any noauth exact all all none</p>
+<p>agentaddress localhost:10161</p>
+      </div>
+    <p>Users interested in making more complex configuration files are
+    encouraged to read the snmpd.conf(5) manpage. This configuration file will
+    create one SNMP community called "public" and grant it read-only access on
+    the entire MIB. It will also tell the SNMP agent to listen on port 10161
+    instead of the default 161. This is useful for pgsnmpd_regress.pl because
+    listening on port 161 would require root privileges.</p>
+    <p>pgsnmpd also requires a libpq connection string, so it can connect to
+    PostgreSQL. Note that nothing requires pgsnmpd to run on the same machine
+    as PostgreSQL &mdash; the agent can easily monitor a remote PostgreSQL
+    instance, if the network configuration allows it to connect. The
+    configuration string can contain the database name, the host name, the
+    port number, the username, the password, and other information where
+    needed. One sample configuration string could say "dbname=pgsnmpd
+    host=localhost user=pgsnmpd password=pgsnnmpd".</p>
+    <p>Still using pgsnmpd_regress.pl as an example, one way to start pgsnmpd as a standalone agent is as follows:</p>
+      <div class="codeblock">
+<p>jtolley@uber:~/devel/pgsnmpd$ ./pgsnmpd -c pgsnmpd.conf -C "dbname=jtolley host=localhost user=jtolley password=jtolley"</p>
+<p>PGSQL-SNMP-1.0beta is up and running.</p>
+      </div>
+    <p>A user could then query pgsnmpd with a Net-SNMP client program such as snmpwalk:</p>
+      <div class="codeblock">
+<p>jtolley@uber:~$ snmpwalk -v 2c -c public localhost:10161 .1</p>
+<p>SNMPv2-SMI::mib-2.39.1.1.1.2.1 = OID: SNMPv2-SMI::enterprises.27645.1</p>
+<p>SNMPv2-SMI::mib-2.39.1.1.1.2.10818 = OID: SNMPv2-SMI::enterprises.27645.10818</p>
+<p>SNMPv2-SMI::mib-2.39.1.1.1.2.10819 = OID: SNMPv2-SMI::enterprises.27645.10819</p>
+<p>SNMPv2-SMI::mib-2.39.1.1.1.2.16384 = OID: SNMPv2-SMI::enterprises.27645.16384</p>
+<p>SNMPv2-SMI::mib-2.39.1.1.1.3.1 = STRING: "PostgreSQL"</p>
+<p>...</p>
+      </div>
+    </div>
+  <h2>pgsnmpd_regress.pl - a pgsnmpd regression test</h2>
+    <div class="desc">
+  pgsnmpd includes a Perl-based regression test script, pgsnmpd_regress.pl. A sample run is below
+      <div class="codeblock">
+<p>jtolley@uber:~/devel/postgresql-8.2.3/contrib/pgsnmpd$ perl pgsnmpd_regress.pl </p>
+<p>1..7</p>
+<p>NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "pgsnmpd_rdbmsdbtable_pkey" for table "pgsnmpd_rdbmsdbtable"</p>
+<p>&nbsp;&nbsp;&nbsp;** Redirecting pgsnmpd child process STDOUT and STDERR to /dev/null</p>
+<p>ok 1 - Found OID for this database</p>
+<p>&nbsp;&nbsp;&nbsp;** Getting DbInfoTable</p>
+<p>&nbsp;&nbsp;&nbsp;** Getting rdbmsDbParamTable</p>
+<p>Can't parse: .1.3.6.1.2.1.39.1.3.1.5.16384.4.103.101.113.111.0</p>
+<p>***** ERROR parsing .1.3.6.1.2.1.39.1.3.1.5.16384.4.103.101.113.111.0 MIB OID</p>
+<p>Can't parse: .1.3.6.1.2.1.39.1.3.1.5.18033.4.103.101.113.111.0</p>
+<p>***** ERROR parsing .1.3.6.1.2.1.39.1.3.1.5.18033.4.103.101.113.111.0 MIB OID</p>
+<p>&nbsp;&nbsp;&nbsp;** Getting rdbmsDbLimitedResourceTable</p>
+<p>&nbsp;&nbsp;&nbsp;** Getting rdbmsSrvTable</p>
+<p>&nbsp;&nbsp;&nbsp;** Getting rdbmsSrvInfoTable</p>
+<p>&nbsp;&nbsp;&nbsp;** Getting rdbmsSrvParamTable</p>
+<p>ok 2 - rdbmsDbInfoTable has a row for this database</p>
+<p>ok 3 - geqo should be off</p>
+<p>ok 4 - XID should be reported in rdbmsDbLimitedResourceTable</p>
+<p>ok 5 - Contact name should be set to pgsnmpd_regress</p>
+<p>ok 6 - Finished transactions should be reported</p>
+<p>ok 7 - Lots of server parameters should be defined</p>
+<p>&nbsp;&nbsp;&nbsp;** Killing pgsnmpd</p>
+<p>&nbsp;&nbsp;&nbsp;** Dropping test database pgsnmpd_regress</p>
+      </div>
+  The test simply checks a test database and checks each of the seven major
+  tables defined in RDBMS-MIB and supported by pgsnmpd for values related to
+  that database. The first table checked, rdbmsDbTable, is indexed by the OID
+  of the test database in the pg_database catalog table, and that same index
+  value gets repeated throughout RDBMS-MIB. pgsnmpd_regress.pl searches
+  rdbmsDbTable for the OID of the test database, and then uses it to test the
+  other tables.
+      <ul>
+        <li>rdbmsDbInfoTable</li>
+  rdbmsDbTable contains relatively few details about each database, and
+  rdbmsDbInfoTable fills out the rest of the details. There will be one line in
+  this table for each database, indexed by OID. pgsnmpd_regress.pl makes sure
+  this line exists for the test database.
+        <li>rdbmsDbParamTable</li>
+  rdbmsDbParamTable contains database-specific parameters taken from
+  pg_database.datconfig and indexed by database OID. The regression test turns
+  off the Genetic Query Optimizer in the test database, which creates an entry
+  in the datconfig column. pgsnmpd_regress.pl tests to see if that entry
+  exists. 
+        <li>rdbmsDbLimitedResourceTable</li>
+  rdbmsDbLimitedResourceTable contains the current XID for each database, also
+  indexed by OID. pgsnmpd_regress.pl checks this table for an entry for the
+  test database
+       <li>rdbmsSrvTable</li>
+  rdbmsSrvTable contains one entry per database server on the system. RDBMS-MIB
+  supports multiple database server instances being monitored via SNMP from the
+  same agent at the same time. Unfortunately, pgsnmpd doesn't yet support
+  monitoring multiple PostgreSQL clusters simultaneously, so this table always
+  only contains one entry, which describes the one PostgreSQL instance being
+  monitored. pgsnmpd_regress.pl looks for this one entry, specifically checking
+  the contact name field, which it set when creating the database.
+        <li>rdbmsSrvInfoTable</li>
+  Much like rdbmsDbInfoTable contains information to supplement rdbmsDbTable,
+  rdbmsSrvInfoTable supplements rdbmsSrvTable with things like disk usage and
+  uptime information. pgsnmpd_regress.pl makes sure a line exists in this table
+  for the test database, checking for the number of finished transactions to be
+  reported.
+        <li>rdbmsSrvParamTable</li>
+  rdbmsSrvParamTable contains an entry for all server-specific configuration
+  parameters &mdash; in other words, approximately the contents of the
+  pg_settings table. This should always contain many entries per database,
+  because PostgreSQL has many configuration parameters, and pgsnmpd_regress.pl
+  just checks to see that there are several lines in this table.
+      </ul>
+    </div>
+  <h2>Implementation details and other information</h2>
+    <div class="desc">
+  <p>pgsnmpd is implemented using libpq and Net-SNMP, which includes a templating
+  system to generate a C implementation of an SNMP table given the MIB
+  definition of that table. Net-SNMP includes all the SNMP protocol code,
+  network code, authentication and access control code, etc., and leaves the
+  implementer with only the job of gathering the data published in the MIB. One
+  important feature of the system used to obtain the SNMP data is that Net-SNMP
+  provides a cache for each table implemented in an agent, and each cache has
+  an expiration timeout. For most tables in pgsnmpd, this timeout is 60
+  seconds, meaning that the data published by the agent are updated at most
+  every 60 seconds. Note also that pgsnmpd will only refresh cached values if
+  both the timeout is past <b>and</b> someone queries the table in question, so
+  a table might go much longer than the timeout value without refreshing, if it
+  isn't queried for a long period of time.</p>
+  <p>The current version of pgsnmpd implements only RDBMS-MIB, but future
+  versions will implement a PGSQL-MIB (which needs to be defined still) which
+  will describe a PostgreSQL instance in much greater detail than is possible
+  with RDBMS-MIB. RDBMS-MIB describes nine tables, as follows:</p>
+  <ul>
+    <li>rdbmsDbTable</li>
+    Describes each database monitored by the SNMP agent, including vendor name
+    and contact information
+    <li>rdbmsDbInfoTable</li>
+    Describes version, size, and backup information for each database the SNMP
+    agent monitors
+    <li>rdbmsDbParamTable</li>
+    Describes configuration parameters specific to each database
+    <li>rdbmsDbLimitedResourceTable</li>
+    Describes resources that are known to be limited, specific to a particular
+    database
+    <li>rdbmsSrvTable</li>
+    Describes each server monitored by the SNMP agent (a "server" is, for
+    instance, a PostgreSQL cluster) including its vendor name, contact person,
+    and version information
+    <li>rdbmsSrvInfoTable</li>
+    Describes disk, connection, startup, and transaction information for each
+    server monitored by the SNMP agent
+    <li>rdbmsSrvParamTable</li>
+    Describes server-specific configuration parameters indexed by server
+    <li>rdbmsSrvLimitedResourceTable</li>
+    Describes limited resources specific to each server
+    <li>rdbmsRelTable</li>
+    Relates each database to its respective server
+  </ul>
+  <p>Some comments on the above are in order. First, since some of the tables
+  contain contact information, vendor names, or other data not normally tracked
+  by PostgreSQL, pgsnmpd supports a set of supplementary tables, by default
+  kept in a schema called "pgsnmpd", which will track this information. One
+  table contains database information, and is indexed by OID from pg_database,
+  and the other tracks server specific information.</p>
+  <p>Second, since pgsnmpd supports only one libpq connection, it only supports
+  one PostgreSQL server in its current version. It is not possible to monitor
+  multiple PostgreSQL clusters with one pgsnmpd instance. It is, however,
+  possible to run multiple instances of pgsnmpd on one machine to monitor
+  multiple PostgreSQL clusters, however the pgsnmpd instances will need to be
+  configured so as not to conflict (for instance, configuring each to listen on
+  a different UDP port). This limitation means that rdbmsSrvTable and
+  rdbmsSrvInfoTable are fairly boring, containing only one entry each, and
+  rdbmsRelTable is similarly boring, since each database must necessarily be
+  connected to the one server pgsnmpd knows about.</p>
+  <p>RDBMS-MIB refers to another MIB defined in an RFC, specifically
+  APPLICATION-MIB from <a href="http://www.faqs.org/rfcs/rfc1565.html">RFC
+  1565</a>. pgsnmpd doesn't implement this yet. Specifically, entries in
+  rdbmsSrvTable are supposed to be indexed to match indices in
+  APPLICATION-MIB::applTable, and the corresponding entry in applTable would
+  contain further information about the server, specifically related to
+  connections from clients. Because of particular complexities associated with
+  implementing this part of the MIB, the connection between rdbmsSrvTable and
+  applTable is unimplemented in the current version of pgsnmpd.</p>
+  <p>RDBMS-MIB contains two tables to describe limited resources, one for
+  database-specific resources and one for server-specific ones.
+  rdbmsSrvLimitedResourceTable is empty in the current implementation of
+  pgsnmpd, and rdbmsDbLimitedResourceTable contains only one row per database.
+  This is because the only limited resource the authors could think of was
+  transaction ID (xid). Since xid is database-specific, it went in the database
+  limited resource table. Other limited resources, such as disk space, memory,
+  etc. are instrumented elsewhere in the MIB, and weren't copied into
+  pgsnmpd.</p>
+  <p>rdbmsSrvInfoTable contains a row to instrument the maximum number of
+  incoming connections seen. Each time the cached rdbmsSrvInfoTable values are
+  updated, the number of connections to the database at the time is recorded,
+  compared against the recorded maximum, and kept as the new maximum when
+  appropriate. But this only occurs when the cached data are updated, meaning
+  that the value in this column is not necessarily particularly accurate.
+  Future versions will hopefully correct this problem.</p>
+  <p>Finally, RDBMS-MIB describes two SNMP traps which RDBMS-MIB agents can
+  optionally implement. pgsnmpd does not implement these.</p>
+    </div>
+  <h2>Future plans</h2>
+    <div class="desc">
+  pgsnmpd would benefit greatly from more PostgreSQL-specific data, so the next
+  major task is to write and implement a PGSQL-MIB which instruments more of
+  the PostgreSQL database. This will likely include all the system catalog
+  tables, as well as many other data points. Also, none of the data in pgsnmpd
+  is writeable yet, though SNMP could be an extremely powerful method of
+  configuring the database if some of the values were read-write. If some of
+  the configuration parameters that do not require a database restart were
+  modifiable via SNMP, third-party administration tools could be used for
+  configuration of PostgreSQL as well as other network devices and
+  applications. Perhaps most interesting are the things pgsnmpd could do with
+  SNMP traps, properly implemented. For instance, users could configure pgsnmpd
+  to use LISTEN/NOTIFY to signal an SNMP trap. Finally, pgsnmpd should support
+  APPLICAION-MIB, as well as connections to multiple PostgreSQL databases.</p>
+    </div>
+</body>
+</html>
diff --git a/doc/pgsnmpd_faq.html b/doc/pgsnmpd_faq.html
new file mode 100644 (file)
index 0000000..9c4d778
--- /dev/null
@@ -0,0 +1,29 @@
+<h2>FAQ, or rather, QTWBAFIAAUQ,WTD (Questions that would be asked frequently if anyone asked any questions, which they don't)</h2>
+
+<p><b>What is pgsnmpd?</b></p>
+
+<p>pgsnmpd is an SNMP agent for PostgreSQL. See "What is SNMP", "What is a MIB", "What is an SNMP agent", and "What MIB(s) does pgsnmpd implement" for further information.</p>
+
+<p><b>What is SNMP?</b></p>
+
+<p>SNMP (Simple Network Management Protocol) is a protocol designed to allow monitoring and configuration of devices or applications using a network. It's a standard, defined by an RFC (for instance, RFC 1157), and fairly widely spoken by all sorts of monitoring applications (for instance, see http://www.cacti.net and http://oss.oetiker.ch/mrtg/). SNMP allows an SNMP client to query information from a virtual tree, called a MIB (Management information base -- see "What is a MIB"), which organizes the data published by an SNMP agent into something comprehensible. </p>
+
+<p><b>What is a MIB?</b></p>
+
+<p>A MIB is a document that defines a tree structure where each node is numbered. These numbers are called OIDs, or Object Identifiers. SNMP agents fetch data from a data source and plug data values into spaces in this tree so clients querying the SNMP for the corresponding OID can get back the information they're looking for.</p>
+
+<p><b>What is an SNMP agent?</b></p>
+
+<p>An SNMP agent responds to SNMP requests from a client. This includes the network communications involved in talking to an SNMP client as well as whatever is needed to fetch the data the agent says it will make available. This also includes handling things like access control and threading and all the other stuff daemons have to deal with. pgsnmpd can function as a standalone SNMP agent, or it can be a sort of plugin to a pre-existing net-snmp server.</p>
+
+<p><b>What MIB(s) does pgsnmpd implement?</b></p>
+
+<p>The initial goal for pgsnmpd is to implement rfc 1697, which is a MIB designed to publish data about a generic database instance. The MIB is supposed to work with basically any relational database system, so the information contained therein is necessarily pretty generic. Once this RFC is implemented, the plan is to come up with a PostgreSQL-specific MIB that will contain more useful information, and to implement it.</p>
+
+<p><b>What can I do with pgsnmpd?</b></p>
+
+<p>Right now, not a whole lot. Eventually, as the implemented MIB(s) grow, you'll be able to do things like make pretty graphs of various performance characteristics you're interested in on a PostgreSQL server, receive notifications when values exceed certain thresholds, using generic monitoring software packages that support SNMP.</p>
+
+<p><b>How is pgsnmpd implemented?</b></p>
+
+<p>pgsnmpd is based on net-snmp (http://net-snmp.sourceforge.net). Eventually we may manage to get it turned into something forked from the postmaster process, but right now it's a standalone daemon that has to use libpq to talk to PostgreSQL.</p>
diff --git a/pg_array.c b/pg_array.c
new file mode 100644 (file)
index 0000000..7b1cd23
--- /dev/null
@@ -0,0 +1,151 @@
+/*-------------------------------------------------------------------------
+ * pg_array.c
+ *
+ *      Functions for libpq array manipulation
+ *      This is intended to contain functions to manage libpq arrays.
+ *      This isn't likely to be comprehensive
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: pg_array.c,v 1.6 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#include "pg_array.h"
+
+/* Text array format consists of leading and trailing curly braces. Values containing
+ * characters that might be confusing (backslashes, double-quotes, etc.) are double-
+ * quoted, and confusing characters are backslash-escaped */
+
+/* pg_text_array_parse()
+* Takes an input string as returned by PQgetvalue(), parses it as a text array, and
+ * builds an array of strings, which it returns, or NULL on error. pg_text_array also
+ * sets len to the number of strings in the array. THE USER IS RESPONSIBLE
+ * FOR FREEING CHAR ***OUTPUT, perhaps by calling pg_text_array_free. */
+
+/* TODO: Add debugging/logging */
+
+char ** pg_text_array_parse(char *input, int *len) {
+       char **results = NULL, **tmp;
+       char *incursor, *outcursor, *output, *start_element;
+       int escaped = 0, done_single_element = 0, done_all_elements = 0, i,
+                cursorlen, inputlen, elements = 0, outputlen, error = 0, in_quotes = 0;
+
+       inputlen = strlen(input);
+       if (!inputlen || inputlen < 3 || SIZE_MAX / inputlen < sizeof(char*)) return NULL;
+       incursor = input + 1;
+       while (!done_all_elements) {
+               in_quotes = 0;
+               if (*incursor == '"') {
+                       incursor++;
+                       in_quotes = 1;
+               }
+/*             else if (*incursor == ',') break; */
+               start_element = incursor;
+               outcursor = strpbrk(incursor, ",}");
+               if (!outcursor) return NULL;
+               /* FACT: outcursor - incursor >= 1 */
+               outputlen = outcursor - incursor + 1;
+               output = calloc(outputlen, sizeof(char));
+               if (!output) return NULL;
+               outcursor = output;
+               done_single_element = 0;
+               while (!done_single_element) {
+                       if (!escaped) {
+                               switch (*incursor) {
+                                       case '}': 
+                                               done_single_element = 1;
+                                               done_all_elements = 1;
+                                               break;
+                                       case ',':
+                                               if (!in_quotes) done_single_element = 1;
+                                               break;
+                                       case '"':
+                                               in_quotes = 0;
+                                               done_single_element = 1;
+                                               incursor++;
+                                               if (*incursor == '}') done_all_elements = 1;
+                                               break;
+                               }
+                       }
+                       if (!done_single_element) {
+                               if (!escaped && *incursor == '\\') escaped = 1;
+                               else {
+                                       if (outcursor - output >= outputlen) {
+                                               cursorlen = outcursor - output;
+                                               outcursor = strpbrk(incursor + 1, ",}");
+                                               if (!outcursor) {
+                                                       error = 1;
+                                                       break;
+                                               }
+                                               outputlen = outcursor - start_element;
+                                               outcursor = realloc(output, outputlen * sizeof(char));
+                                               if (!outcursor) {
+                                                       error = 1;
+                                                       break;
+                                               }
+                                               output = outcursor;
+                                               outcursor = output + cursorlen;
+                                       }
+                                       if (escaped) {
+                                               escaped = 0;
+                                               *outcursor = *incursor;
+                                               outcursor++;
+                                       }
+                                       else {
+                                               *outcursor = *incursor;
+                                               outcursor++;
+                                       }
+                               }
+                       }
+                       if (done_single_element) {
+                               elements++;
+                               memset(outcursor, 0, outputlen - (outcursor - output));
+                               if (results) {
+                                       tmp = realloc(results, elements * sizeof(char*));
+                                       if (!tmp) {
+                                               error = 1;
+                                               break;
+                                       }
+                                       results = tmp;
+                               }
+                               else {
+                                       results = calloc(1, sizeof(char*));
+                                       if (!results) {
+                                               error = 1;
+                                               break;
+                                       }
+                               }
+                               results[elements - 1] = output;
+                       }
+                       if (!done_all_elements) {
+                               incursor++;
+                               if (incursor - input >= inputlen) {
+                                       error = 1;
+                                       break;
+                               }
+                       }
+               }
+               if (error) break;
+       }
+       if (error) {
+               for (i = 0; i < elements; i++)
+                       free(results[i]);
+               free(results);
+               free(output);
+               return NULL;
+       }
+       *len = elements;
+       return results;
+}
+
+/* pg_text_array_free() 
+ * Frees an array of strings such as is returned by pg_text_array_parse() */
+void pg_text_array_free(char **array, int len) {
+       int i;
+       for (i = 0; i < len; i++)
+               free(array[i]);
+       free(array);
+}
diff --git a/pg_array.h b/pg_array.h
new file mode 100644 (file)
index 0000000..9bb0925
--- /dev/null
@@ -0,0 +1,24 @@
+/*-------------------------------------------------------------------------
+ * pg_array.h
+ *
+ *      RDBMSMIB mib module.
+ *
+ *      Copyright (c) 2004-2007, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ * $Id: pg_array.h,v 1.5 2007/09/13 14:20:43 h-saito Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef PG_ARRAY_H
+#define PG_ARRAY_H
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+
+char **pg_text_array_parse(char* input, int *len);
+void pg_text_array_free(char **array, int len);
+
+#endif
diff --git a/pgsnmpd.c b/pgsnmpd.c
new file mode 100644 (file)
index 0000000..7302dd2
--- /dev/null
+++ b/pgsnmpd.c
@@ -0,0 +1,371 @@
+/*-------------------------------------------------------------------------
+ * pgsnmpd.c
+ *
+ *      Global definitions for the main PostgreSQL SNMP Daemon.
+ *
+ *      Copyright (c) 2004-2005, PostgreSQL Global Development Group
+ *      Author: Hiroshi Saito
+ *
+ *      $Id: pgsnmpd.c,v 1.30 2009/12/24 21:04:40 eggyknap Exp $
+ *-------------------------------------------------------------------------
+ */
+
+
+/* TODO: Make this respond to all snmpd command opts when called as a standalone daemon */
+
+#include "pgsnmpd.h"
+ #include "rdbmsDbTable/rdbmsDbTable.h"
+#include "rdbmsDbInfoTable/rdbmsDbInfoTable.h"
+#include "rdbmsDbParamTable/rdbmsDbParamTable.h"
+#include "rdbmsDbLimitedResourceTable/rdbmsDbLimitedResourceTable.h"
+#include "rdbmsSrvTable/rdbmsSrvTable.h"
+#include "rdbmsSrvParamTable/rdbmsSrvParamTable.h"
+#include "rdbmsSrvInfoTable/rdbmsSrvInfoTable.h"
+#include "rdbmsRelTable/rdbmsRelTable.h"
+
+/*#include "PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAggregateTable/pgsqlPgAggregateTable.h"
+#include "PGSQL-MIB_src/pgsqlCatalogTables/pgsqlPgAmopTable/pgsqlPgAmopTable.h" */
+
+#include "customquery.h"
+
+#include <signal.h>
+#include <ctype.h>
+
+/*
+ * define strings
+ */
+
+#define PGSNMP_DAEMON "PGSQL-SNMP-Ver1.0"
+
+#define SUB_AGENT    1
+
+char *pgsnmp_version = PG_VERSION_STR;
+
+/* Official MIB object 
+http://www.iana.org/assignments/enterprise-numbers
+
+27645
+  PostgreSQL Global Development Group
+    Dave Page
+      dpage&postgresql.org
+*/
+
+/*
+ * PostgreSQL Connection
+ */
+PGconn     *dbconn = NULL;
+char       *conninfo = {"dbname=template1"};
+#define     SEARCH_PATH "set search_path to pgsnmpd"
+
+static int keep_running = 0;
+struct timeval snmp_boottime;
+static int   pgsqlState = 0;
+
+static PGconn
+*db_connect(char *constring)
+{
+    PGconn     *dbconn;
+    dbconn = PQconnectdb(constring);
+    if (dbconn == NULL)
+    {
+        return NULL;
+    }
+    if (PQstatus(dbconn) != CONNECTION_OK)
+    {
+        snmp_log(LOG_ERR,"%s\n",PQerrorMessage(dbconn));
+        PQfinish(dbconn);
+        return NULL;
+    }
+
+    return dbconn;
+}    
+
+bool IsAlive()
+{
+    PGresult *qryRes;
+
+    if (!pgsqlState)
+    {
+        if ((dbconn = db_connect(conninfo)))
+            pgsqlState = 1;
+        else
+            return false;
+    }
+
+    /* TODO: Deal with setting the schema properly here */
+    qryRes = PQexec(dbconn, "SELECT 1;");
+    if (PQresultStatus(qryRes) != PGRES_TUPLES_OK)
+    {
+        PQclear(qryRes);
+        PQfinish(dbconn);
+        pgsqlState = 0;
+        dbconn = NULL;
+        return false;
+    }
+
+    PQclear(qryRes);
+    return true;
+}
+
+static void
+stop_server(int signo) 
+{
+    pgsqlState = keep_running = 0;
+    snmp_log(LOG_ERR, "\nExiting on signal %d\n", signo);
+}
+
+
+static void init_mibs(void) {
+    /* This initializes the table MIB.  */
+
+    initialize_table_rdbmsDbTable();
+    init_rdbmsDbInfoTable();
+    init_rdbmsDbParamTable();
+    init_rdbmsDbLimitedResourceTable();
+    init_rdbmsSrvTable();
+    init_rdbmsSrvParamTable();
+    init_rdbmsSrvInfoTable();
+    init_rdbmsRelTable();
+/*    init_pgsqlPgAggregateTable();
+     init_pgsqlPgAmopTable(); */
+    init_custom_queries();
+}
+
+static void
+usage(void)
+{
+    fprintf(stderr, "Version %s\n", PGSNMP_DAEMON);
+    fprintf(stderr, "usage: pgsnmpd [-s] [-b] [-c FILE ] [-x address ] [-g] [-C \"Connect String\"]\n");
+    fprintf(stderr, "   -s : run as AgentX sub-agent of an existing snmpd process\n");
+    fprintf(stderr, "   -b : run in the background\n");
+    fprintf(stderr, "   -c : configuration file name\n");
+    fprintf(stderr, "   -g : use syslog\n");
+    fprintf(stderr, "   -C : libpq connect strings\n");
+    fprintf(stderr, "   -Q : custom query configuration file\n");
+    fprintf(stderr, "   -x : address:port of a network interface\n");
+/*    fprintf(stderr, "   -n : database search_path to use for pgsnmpd-specific tables (default: $user, public)\n"); */
+    fprintf(stderr, "   -V : display version strings\n");
+}
+
+int
+main(int argc, char *argv[]) 
+{
+    int agentx_subagent=0;    /* SNMP master agent */
+    int background = 0;    /* run the background */
+    int syslog = 0;        /* use syslog */
+
+    int    arg;
+/*    char *set_search_path, *escaped_search_path; 
+    int errorval;*/
+
+#ifdef DEBUG
+    char *strv;
+#endif
+
+    char     options[128] = "sbc:gC:x:V-:Q:";
+    /*char     options[128] = "sbc:gC:x:V-:n:"; */
+    PGresult *qryRes;
+
+    while ((arg = getopt(argc, argv, options)) != EOF)
+    {
+        switch (arg)
+        {
+        case 'V':
+        case '?':
+            usage();
+            exit(0);
+        case 'Q':
+            if (optarg != NULL)
+                custom_query_config_file = optarg;
+            else {
+                usage();
+                exit(-1);
+            }
+        case 'c':
+            if (optarg != NULL) {
+                        netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
+                                      NETSNMP_DS_LIB_OPTIONALCONFIG, optarg);
+            } else {
+                usage();
+                exit(-1);
+            }
+            break;
+        case 'g':
+            syslog = 1;
+            break;
+        case 'b':
+            background = 1;
+            break;
+        case 's':
+            agentx_subagent = 1;
+            break;
+        case 'x':
+            if (optarg != NULL) {
+                printf("-x option: %s\n", optarg);
+                netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+                                    NETSNMP_DS_AGENT_X_SOCKET, optarg);
+            } else {
+                usage();
+                exit(-1);
+            }
+            break;
+/*        case 'n':
+            if (optarg != NULL) search_path = optarg;
+            else {
+                usage();
+                exit(1);
+            } */
+        case 'C':
+            if (optarg != NULL) {
+                conninfo = optarg;
+            } else {
+                usage();
+                exit(1);
+            }
+            break;
+/*            default:
+                    usage(); 
+                    exit(1); */
+        }
+    }
+
+      gettimeofday(&snmp_boottime, (struct timezone *)0);
+
+      if (syslog)
+        /* Some problems are contained.
+            snmp_enable_calllog(); */
+            snmp_enable_syslog();
+      else
+            snmp_enable_stderrlog();
+
+        if (getuid() !=0)
+              netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, 
+             NETSNMP_DS_AGENT_NO_ROOT_ACCESS, 1);
+
+      if ((dbconn = db_connect(conninfo))) {
+             pgsqlState = 1;
+        qryRes = PQexec(dbconn, SEARCH_PATH);
+        if (PQresultStatus(qryRes) != PGRES_COMMAND_OK) snmp_log(LOG_ERR, "Could not set search path because of some problem with the set query\n");
+#if 0
+        if (strncmp(search_path, "$user, public", 13) != 0) {;
+            escaped_search_path = calloc(sizeof(*search_path) * 2 + 1, sizeof(char*));
+            if (escaped_search_path == NULL) {
+                snmp_log(LOG_ERR, "Could not allocate memory to escape search_path value\n");
+                exit(1);
+            }
+            PQescapeStringConn(dbconn, escaped_search_path, search_path, strlen(search_path), &errorval); */
+            /* This initialization is to avoid a compiler warning */
+            set_search_path = NULL;
+            if (errorval != 0)
+                snmp_log(LOG_ERR, "Could not escape search path string\n"); 
+                /* Note: I'm not exiting after this error. The only problem with not setting the 
+                 * search_path is not having the database tables available, which right now isn't
+                 * a really big deal */
+            else {
+                set_search_path = calloc(sizeof(*escaped_search_path) + sizeof("SET search_path TO "), sizeof(char*));
+                if (set_search_path == NULL) 
+                    snmp_log(LOG_ERR, "Could not allocate memory to set search_path\n");
+                else {
+                    snmp_log(LOG_INFO, set_search_path);
+                    sprintf(set_search_path, "SET search_path TO %s", escaped_search_path);
+                    qryRes = PQexec(dbconn, set_search_path);
+                    if (PQresultStatus(qryRes) != PGRES_COMMAND_OK) snmp_log(LOG_ERR, "Could not set search path because of some problem with the set query\n");
+                    PQclear(qryRes);
+                }
+            }
+            free(escaped_search_path); free(set_search_path);
+        } 
+#endif
+    }
+    else {
+        printf("Failure connecting to PostgreSQL. pgsnmpd will exit\n");
+        exit(1);
+    }
+
+      if (agentx_subagent)
+      {
+            /* make us a agentx client. */
+            netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+                           NETSNMP_DS_AGENT_ROLE, SUB_AGENT);
+
+#if 0
+            netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, 
+               NETSNMP_DS_AGENT_AGENTX_MASTER, 0);
+
+#endif
+#ifdef DEBUG
+            if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, 
+                               NETSNMP_DS_AGENT_ROLE)) 
+              snmp_log(LOG_INFO,"SUB_AGENT running.\n");
+#endif
+
+    }
+#if 0
+      netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+                       NETSNMP_DS_AGENT_AGENTX_TIMEOUT, -1);
+      netsnmp_ds_set_int(NETSNMP_DS_APPLICATION_ID,
+                       NETSNMP_DS_AGENT_AGENTX_RETRIES, -1);
+
+      netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "public",
+               NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_COMMUNITY);
+
+#endif
+#ifdef DEBUG
+    if(netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, 
+            NETSNMP_DS_AGENT_X_SOCKET))
+
+        snmp_log(LOG_INFO,"AGENT_X_SOCKET:%s\n",
+            netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, 
+                        NETSNMP_DS_AGENT_X_SOCKET));
+     if(netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, 
+            NETSNMP_DS_AGENT_PORTS))
+            snmp_log(LOG_INFO,"AGENT_PORTS:%s\n",
+            netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, 
+                        NETSNMP_DS_AGENT_PORTS));
+#endif
+
+    /* run in background */
+    if (background && netsnmp_daemonize(1, !syslog))
+        exit(1);
+
+/* initialize tcpip */
+SOCK_STARTUP;
+
+    init_agent(PGSNMP_DAEMON);
+
+    init_mibs();
+
+    init_snmp(PGSNMP_DAEMON);
+
+    if (!agentx_subagent)
+        init_master_agent();
+
+    keep_running = 1;
+
+    signal(SIGTERM, stop_server);
+    signal(SIGINT, stop_server);
+
+    snmp_log(LOG_INFO,"%s is running.\n", PGSNMP_DAEMON);
+
+    while(keep_running)
+    {
+
+        agent_check_and_process(1);
+#ifdef DEBUG
+        strv = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+                NETSNMP_DS_LIB_COMMUNITY );
+        if (strv)
+            snmp_log(LOG_INFO, strv);
+#endif
+
+    }
+
+    /* shutdown */
+    if (!agentx_subagent)
+        snmp_shutdown(PGSNMP_DAEMON);
+
+SOCK_CLEANUP;
+
+    return 0;
+
+}
diff --git a/pgsnmpd.conf b/pgsnmpd.conf
new file mode 100644 (file)
index 0000000..f071988
--- /dev/null
@@ -0,0 +1,5 @@
+com2sec        readwrite       default         public
+group          MyRWGroup       v2c             readwrite
+view           all             included        .1              80
+access                 MyRWGroup       ""              any             noauth  exact   all     all     none
+agentaddress   localhost:10161
diff --git a/pgsnmpd.h b/pgsnmpd.h
new file mode 100644 (file)
index 0000000..1ac9236
--- /dev/null
+++ b/pgsnmpd.h
@@ -0,0 +1,57 @@
+/*-------------------------------------------------------------------------
+ * pgsnmpd.h
+ *
+ *      Global definitions for the main PostgreSQL SNMP Daemon.
+ *      This file should be included first in all pgsnmpd source files.
+ *
+ *      Copyright (c) 2006, PostgreSQL Global Development Group
+ *      Author: Joshua Tolley
+ *
+ *      $Id: pgsnmpd.h,v 1.6 2007/12/12 01:24:06 h-saito Exp $
+ *-------------------------------------------------------------------------
+ */
+
+#ifndef PGSNMPD_H
+#define PGSNMPD_H
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include "postgres_fe.h"
+#include "libpq-fe.h"
+
+/* snmp include files expose the autoconf variables about the package, and
+ * so does the pg includes. Oops. 
+ */ 
+#ifdef PACKAGE_BUGREPORT
+#undef PACKAGE_BUGREPORT
+#endif
+#ifdef PACKAGE_NAME
+#undef PACKAGE_NAME
+#endif
+#ifdef PACKAGE_STRING
+#undef PACKAGE_STRING
+#endif
+#ifdef PACKAGE_TARNAME
+#undef PACKAGE_TARNAME
+#endif
+#ifdef PACKAGE_VERSION
+#undef PACKAGE_VERSION
+#endif
+
+
+/*
+ * Global includes from net-snmp.
+ */
+#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/mib_modules.h>
+
+
+extern char *conninfo;
+extern PGconn *dbconn;
+bool IsAlive(void);
+
+#endif
diff --git a/pgsnmpd.sql b/pgsnmpd.sql
new file mode 100644 (file)
index 0000000..c38dfca
--- /dev/null
@@ -0,0 +1,11 @@
+CREATE TABLE pgsnmpd_rdbmsDbTable (
+       -- ideally this would reference pg_database.oid, but pgsql won't allow such a reference
+       database_oid OID PRIMARY KEY,
+       vendor_name VARCHAR(255) DEFAULT 'PostgreSQL Global Development Group',
+       contact_name VARCHAR(255),
+       last_backup TIMESTAMPTZ);
+
+CREATE TABLE pgsnmpd_rdbmsSrvTable (
+       vendor_name VARCHAR(255) DEFAULT 'PostgreSQL Global Development Group',
+       product_name VARCHAR(255) DEFAULT 'PostgreSQL',
+       contact_name VARCHAR(255));
diff --git a/pgsnmpd.yaml b/pgsnmpd.yaml
new file mode 100644 (file)
index 0000000..c891dbc
--- /dev/null
@@ -0,0 +1,148 @@
+queries:
+    -
+        name: pgsqlPgAggregateTable
+        query: SELECT aggfnoid::integer, aggtransfn, aggfinalfn, aggsortop, aggtranstype, agginitval FROM pg_aggregate
+        oid: 1.3.6.1.4.1.27645.1.2.1
+        indexes: 1
+        min_column: 1
+    -
+        name: pgsqlPgAmTable
+        query: SELECT oid, * from pg_am
+        oid: 1.3.6.1.4.1.27645.1.2.2
+        indexes: 1
+        min_column: 1
+
+##    -
+##        name: rdbmsDbTable
+##        query: SELECT oid, '1.3.6.1.4.1', 'PostgreSQL', datname, 'josh@pgsnmpd' FROM pg_database
+##        oid: 1.3.6.1.2.1.39.1.1
+##        indexes: 1
+##        min_column: 1
+##    -
+##        name: rdbmsDbInfoTable
+##        query: SELECT oid, version(), pg_database_size(datname) FROM pg_database
+##        oid: 1.3.6.1.2.1.39.1.2
+##        indexes: 1
+##        min_column: 1
+##    -
+##        name: rdbmsDbParamTable
+##        query: SELECT oid, datname, datconfig FROM pg_database
+##        oid: 1.3.6.1.2.1.39.1.3
+##        indexes: 1
+##        min_column: 1
+##    -
+##        name: pg_database
+##        query: SELECT oid, encoding, datdba, * FROM pg_database
+##        oid: 1.3.6.1.4.1.27645.1.3.1
+##        indexes: 1
+##        min_column: 1
+##        types:
+##            -
+##                colnum: 1
+##                type: oid
+#            -
+##                colnum: 2
+##                type: string
+#    -
+#        name: random
+#        query: SELECT 1, '1.3.6.1.3.11', 2, floor(100 * random()) union select 2, '1.3.6.1.2.1', floor(random() * 10), 5
+#        oid: 1.3.6.1.4.1.27645.1.3.2
+#        indexes: 1
+#        min_column: 1
+#        types:
+#            -
+#                1: ASN_INTEGER
+#                #2: ASN_OBJECT_ID
+#                2: ASN_OCTET_STR
+#                3: ASN_INTEGER
+#    -
+#        name: pg_class
+#        query: SELECT oid, reltuples, reltoastrelid, 'test string', * FROM pg_class
+#        oid: 1.3.6.1.4.1.27645.1.3.3
+#        indexes: 1
+#        min_column: 1
+#    -
+#        name: test
+#        query: SELECT 'test', 't'::boolean, 14
+#        oid: 1.3.6.1.4.1.27646.1.1
+#        indexes: 1
+#        min_column: 1
+#    -
+#        name: easytest
+#        query: SELECT 1, 'test', 't'::boolean, random() UNION SELECT 2, 'test2', 'f'::boolean, random()
+#        oid: 1.3.6.1.4.1.27646.1.2
+#        indexes: 1
+#        min_column: 1
+##    -
+##        name: pgsqlPgAmopTable
+##        query: SELECT oid, amopfamily, amoplefttype, amoprighttype , amopstrategy , amopreqcheck , amopopr, amopmethod FROM pg_amop LIMIT 4
+##        oid: 1.3.6.1.4.1.27645.1.2.3
+##        indexes: 1
+##        min_column: 1
+##    -
+##        name: rdbmsDbTable
+##        query: SELECT oid, '1.3.6.1.4.1', 'PostgreSQL', datname, 'josh@pgsnmpd' FROM pg_database
+##        oid: 1.3.6.1.2.1.39.1.1
+##        indexes: 1
+##        min_column: 1
+##    -
+##        name: rdbmsDbInfoTable
+##        query: SELECT oid, version(), pg_database_size(datname) FROM pg_database
+##        oid: 1.3.6.1.2.1.39.1.2
+##        indexes: 1
+##        min_column: 1
+##    -
+##        name: rdbmsDbParamTable
+##        query: SELECT oid, datname, datconfig FROM pg_database
+##        oid: 1.3.6.1.2.1.39.1.3
+##        indexes: 1
+##        min_column: 1
+##    -
+##        name: pg_database
+##        query: SELECT oid, encoding, datdba, * FROM pg_database
+##        oid: 1.3.6.1.4.1.27645.1.3.1
+##        indexes: 1
+##        min_column: 1
+##        types:
+##            -
+##                colnum: 1
+##                type: oid
+#            -
+##                colnum: 2
+##                type: string
+#    -
+#        name: random
+#        query: SELECT 1, '1.3.6.1.3.11', 2, floor(100 * random()) union select 2, '1.3.6.1.2.1', floor(random() * 10), 5
+#        oid: 1.3.6.1.4.1.27645.1.3.2
+#        indexes: 1
+#        min_column: 1
+#        types:
+#            -
+#                1: ASN_INTEGER
+#                #2: ASN_OBJECT_ID
+#                2: ASN_OCTET_STR
+#                3: ASN_INTEGER
+#    -
+#        name: pg_class
+#        query: SELECT oid, reltuples, reltoastrelid, 'test string', * FROM pg_class
+#        oid: 1.3.6.1.4.1.27645.1.3.3
+#        indexes: 1
+#        min_column: 1
+#    -
+#        name: test
+#        query: SELECT 'test', 't'::boolean, 14
+#        oid: 1.3.6.1.4.1.27646.1.1
+#        indexes: 1
+#        min_column: 1
+#    -
+#        name: easytest
+#        query: SELECT 1, 'test', 't'::boolean, random() UNION SELECT 2, 'test2', 'f'::boolean, random()
+#        oid: 1.3.6.1.4.1.27646.1.2
+#        indexes: 1
+#        min_column: 1
+##    -
+##        name: pgsqlPgAmopTable
+##        query: SELECT oid, amopfamily, amoplefttype, amoprighttype , amopstrategy , amopreqcheck , amopopr, amopmethod FROM pg_amop LIMIT 4
+##        oid: 1.3.6.1.4.1.27645.1.2.3
+##        indexes: 1
+##        min_column: 1
diff --git a/pgsnmpd_regress.pl b/pgsnmpd_regress.pl
new file mode 100644 (file)
index 0000000..b620d9e
--- /dev/null
@@ -0,0 +1,276 @@
+#! /usr/bin/perl
+
+# PGSNMPD REGRESSION TEST -- pgsnmpd_regress.pl
+# $Id: pgsnmpd_regress.pl,v 1.11 2007/08/07 02:33:22 eggyknap Exp $
+
+use File::Temp qw( tempfile );
+use Test::More tests => 7;
+use POSIX;
+use strict;
+
+my $tmp;
+my @tmp;
+my @psqlToolCmds;
+my %opt;
+
+sub usage() {
+       print <<EOF
+DESCRIPTION
+       pgsnmpd_regress.pl creates a new database on the specified host, popu-
+       lates a few tables (including pgsnmpd-specific tables), starts pgsnmpd,
+       and queries a bunch of stuff from it. It compares those results with
+       various expected results to see that pgsnmpd works as expected. Note
+       that it *will* drop the database after it is finished testing, unless
+       explicitly told not to.
+
+       pgsnmpd_regress.pl assumes it is running from a directory with
+       pgsnmpd.sql and the pgsnmpd binary in it.
+
+USAGE:
+       pgsnmpd_regress.pl [ -U <user> ] [ -W <password> ] [ -h <host> ]
+           [ -p <port> ] [ -d <dbname> ] [ -c <createdb_path ]
+           [ -P <psql_path> ] [ -D <dropdb_path> ] [ -n ] [ -? ]
+
+OPTIONS
+       -U      Username to connect to an existing database cluster. This user
+               should have permissions to create and drop databases on the
+               cluster. This will default to the current user name if
+               unspecified.
+
+       -W      Password for PostgreSQL account. Note: pgsnmpd_regress.pl will
+               prompt for this password a few times if this option is set,
+               even though the specified password is correct, because it uses
+               the createdb and psql binaries to run the regression test, and
+               they won't take passwords automatically. pgsnmpd_regress.pl
+               doesn't really want to create a password file and mess with any
+               the user might already have set up. Sorry for the extra typing.
+
+       -h      Hostname or IP address of the server to test; defaults to
+               localhost. If this begins with a slash character, it will be
+               interpreted as the directory of the Unix domain socket for this
+               server
+
+       -p      Port of the server to test; defaults to 5432. If the -h para-
+               meter begins with a slash, this will be interpreted as the
+               filename of the Unix domain socket
+       
+       -d      Name of the database to create; defaults to pgsnmpd_regress
+
+       -c      Path to createdb, if required
+
+       -P      Path to psql, if required
+
+       -D      Path to dropdb, if required
+
+       -n      Do not drop the test database after creation
+
+       -v      Verbose mode
+
+       -?      Show this help
+
+EOF
+;
+       exit;
+}
+
+{
+       use Getopt::Std;
+       getopts( "U:W:h:p:d:c:P:D:n?v", \%opt ) or usage();
+       usage() if $opt{'?'};
+}
+
+my $createdb = $opt{c} ? $opt{c} : 'createdb';
+my $dbname   = $opt{d} ? $opt{d} : 'pgsnmpd_regress' ;
+my $psql     = $opt{P} ? $opt{P} : 'psql';
+my $dropdb   = $opt{D} ? $opt{D} : 'dropdb';
+
+#print "c: $createdb\nu: $user\np: $pwd\nh: $host\np: $port\nd: $dbname\np: $psql\n";
+
+
+sub TesterProc() {
+       use SNMP;
+
+       my $dbOID;
+
+       SNMP::addMibDirs('.');
+       SNMP::addMibFiles('RDBMS-MIB');
+
+       sleep 5;        # give pgsnmpd a chance to start up. There are better ways of doing this (e.g. wait for the port to start listening, perhaps), but this should do
+       my $sess = new SNMP::Session(Version => '2c', DestHost => 'localhost', Community => 'public', RemotePort => '10161');
+       my $rdbmsDbTable = $sess->gettable('RDBMS-MIB::rdbmsDbTable');
+
+       # Get Database OID (rdbmsDbIndex value for this database from rdbmsDbTable)
+       foreach my $key (keys %{$rdbmsDbTable}) {
+               $tmp = $rdbmsDbTable->{$key};
+               if ($tmp->{'rdbmsDbName'} eq $dbname) { 
+                       $dbOID = $key;
+                       last;
+               }
+       }
+
+       # Test that OID exists
+       ok( defined $dbOID, 'Found OID for this database');
+
+       print "   ** Getting DbInfoTable\n";
+       my $rdbmsDbInfoTable            = $sess->gettable('RDBMS-MIB::rdbmsDbInfoTable');
+       print "   ** Getting rdbmsDbParamTable\n";
+       my $rdbmsDbParamTable           = $sess->gettable('RDBMS-MIB::rdbmsDbParamTable');
+       print "   ** Getting rdbmsDbLimitedResourceTable\n";
+       my $rdbmsDbLimitedResourceTable = $sess->gettable('RDBMS-MIB::rdbmsDbLimitedResourceTable');
+       print "   ** Getting rdbmsSrvTable\n";
+       my $rdbmsSrvTable               = $sess->gettable('RDBMS-MIB::rdbmsSrvTable');
+       print "   ** Getting rdbmsSrvInfoTable\n";
+       my $rdbmsSrvInfoTable           = $sess->gettable('RDBMS-MIB::rdbmsSrvInfoTable');
+       print "   ** Getting rdbmsSrvParamTable\n";
+       my $rdbmsSrvParamTable          = $sess->gettable('RDBMS-MIB::rdbmsSrvParamTable');
+
+       SKIP: {
+               skip ("Database OID is undefined -- other tests are meaningless, because they'll all fail", 6) if (!defined $dbOID);
+
+               # Test rdbmsDbInfoTable -- Make sure a row is present for this database OID
+               ok( defined $rdbmsDbInfoTable->{$dbOID}, 'rdbmsDbInfoTable has a row for this database');
+
+               # rdbmsDbParamTable -- geqo should be off in this database
+               is(${$rdbmsDbParamTable->{$dbOID.".4.103.101.113.111.0"}}{"rdbmsDbParamCurrValue"}, 'off', 'geqo should be off');
+
+               # rdbmsDbLimitedResourceTable -- row should exist for XID
+               ok( defined ${$rdbmsDbLimitedResourceTable->{$dbOID.".3.88.73.68"}}{"rdbmsDbLimitedResourceCurrent"}, 'XID should be reported in rdbmsDbLimitedResourceTable');
+
+               # rdbmsSrvTable -- contact name should be pgsnmpd_regress
+               is ( ${$rdbmsSrvTable->{"1"}}{"rdbmsSrvContact"}, "pgsnmpd_regress", "Contact name should be set to pgsnmpd_regress");
+
+               # rdbmsSrvInfoTable -- finished transactions should be reported
+               ok ( defined ${$rdbmsSrvInfoTable->{$dbOID}}{"rdbmsSrvInfoFinishedTransactions"}, "Finished transactions should be reported");
+
+               # rdbmsSrvParamTable -- lots of parameters should exist
+               my @paramKeys = keys %{$rdbmsSrvParamTable};
+               cmp_ok( $#paramKeys, '>', 0, 'Lots of server parameters should be defined');
+       }
+
+       # Kill pgsnmpd now that we're done
+       {
+               print "   ** Killing pgsnmpd\n";
+               local $SIG{TERM} = 'IGNORE';
+               kill -(POSIX::SIGTERM) => $$;
+       }
+}
+
+# Create the database
+@psqlToolCmds = ();
+push @psqlToolCmds, ('-U', $opt{U}) if $opt{U};
+push @psqlToolCmds, ('-h', $opt{h}) if $opt{h};
+push @psqlToolCmds, ('-p', $opt{p}) if $opt{p};
+
+{
+       if (!defined($opt{v})) {
+               open OLDOUT, ">&STDOUT";
+               open STDOUT, "/dev/null" || warn "STDOUT can't be redirected -- pgsnmpd_regress.pl might be a bit verbose...\n";
+       }
+       my @tmpCmds = @psqlToolCmds;
+       push @tmpCmds, $dbname;
+       print "   ** Creating database $dbname\n";
+       system $createdb, @tmpCmds;
+
+       # Populate tables
+       open INFILE, 'pgsnmpd.sql';
+       $tmp = <<EOF
+       CREATE SCHEMA pgsnmpd;
+       SET SEARCH_PATH TO pgsnmpd, public;
+EOF
+;
+       while (<INFILE>) {
+               $tmp .= $_;
+       }
+       close INFILE;
+       $tmp .= <<EOF
+       INSERT INTO pgsnmpd_rdbmsSrvTable (contact_name) VALUES ('pgsnmpd_regress');
+       INSERT INTO pgsnmpd_rdbmsDbTable (database_oid, vendor_name, contact_name, last_backup)
+               SELECT oid, 'PostgreSQL Global Development Group', 'pgsnmpd_regress', CURRENT_TIMESTAMP - (INTERVAL '1 second' * oid::INTEGER)
+                       FROM pg_database;
+       ALTER DATABASE $dbname SET geqo TO off;
+EOF
+;
+
+       @tmpCmds = @psqlToolCmds;
+       push @tmpCmds, ("-c", $tmp, $dbname);
+       system $psql, @tmpCmds;
+       if (!defined($opt{v})) {
+               close STDOUT;
+               open STDOUT, ">&OLDOUT";
+       }
+}
+
+# Create config file and fire up pgsnmpd
+my ($tmpHandle, $tmpName) = tempfile('pgsnmpd_regress_tmp_XXXX', UNLINK => 1);
+while (<DATA>) {
+       print $tmpHandle $_;
+}
+close DATA;
+
+$| = 1;                # Make sure stuff flushes properly when we fork. This really shouldn't matter much, but this is just to be safe
+
+my $pid;
+
+if ($pid = fork()) {
+       # Parent process
+
+       TesterProc();
+}
+else {
+       # Child process
+
+       use Cwd;
+
+       if (!defined($opt{v})) {
+               print "   ** Redirecting pgsnmpd child process STDOUT and STDERR to /dev/null\n";
+               open STDOUT, "> /dev/null" || warn "Can't direct STDOUT of child process -- pgsnmpd_regress.pl might be a bit verbose...\n";
+               open STDERR, "> /dev/null" || warn "Can't direct STDERR of child process -- pgsnmpd_regress.pl might be a bit verbose...\n";
+       }
+
+       @tmp = ();
+       $tmp = "dbname=$dbname";
+       $tmp .= " user=$opt{U}" if ($opt{U} ne '');
+       $tmp .= " password=$opt{W}" if ($opt{W} ne '');
+       $tmp .= " host=$opt{h}" if ($opt{h} ne '');
+       $tmp .= " port=$opt{p}" if ($opt{p} ne '');
+       push @tmp, ('-c', $tmpName, '-C', $tmp);
+       print "Running pgsnmpd with command line $tmp\n";
+
+       $tmp = getcwd . "/pgsnmpd";
+       print "Child process running $tmp\n";
+       system $tmp, @tmp;
+       if ($? == -1) {
+               print "failed to execute: $!\n";
+       }
+       elsif ($? & 127) {
+               printf "child died with signal %d, %s coredump\n",
+               ($? & 127),  ($? & 128) ? 'with' : 'without';
+       }
+       else {
+               printf "child exited with value %d\n", $? >> 8;
+       }
+
+       die "Child pgsnmpd process killed\n";
+}
+
+if (! $opt{'n'}) {
+       print "   ** Dropping test database $dbname\n";
+       if (!defined($opt{v})) {
+               open OLDOUT, ">&STDOUT";
+               open STDOUT, "> /dev/null" || warn "Can't direct STDOUT of child process -- pgsnmpd_regress.pl might be a bit verbose...\n";
+       }
+       my @tmpCmds = @psqlToolCmds;
+       push @tmpCmds, $dbname;
+       system $dropdb, @tmpCmds;
+       if (!defined($opt{v})) {
+               close STDOUT;
+               open STDOUT, ">&OLDOUT";
+       }
+}
+
+__DATA__
+com2sec        readwrite       default         public
+group          MyRWGroup       v2c             readwrite
+view           all             included        .1              80
+access                 MyRWGroup       ""              any             noauth  exact   all     all     none
+agentaddress   localhost:10161
diff --git a/pgsqlMibWriter.pl b/pgsqlMibWriter.pl
new file mode 100644 (file)
index 0000000..7762d62
--- /dev/null
@@ -0,0 +1,154 @@
+#!/usr/bin/perl
+
+# MIB WRITER -- takes a description of a table (or a sequence thereof) in the
+# following format and turns it into an SNMP MIB
+
+# -- Lines beginning with -- are comments
+# -- Fields are tab-delimited
+# -- All fields can be double-quote-delimited, entering "" means the field is empty, and will default to whatever its default is, if it has one
+# tablename    "description, can be double-quote-delimited"    parentObject    tableOID        indexField1[,indexField2,...indexFieldN]        max-access      status
+# -- since I'm expecting these tables to come from PostgreSQL, I'll make this script translate pg_class into pgClass, for instance
+# -- max-access and status default to "not-accessible" and "current" if not supplied
+# fieldName1   fieldType1      "description1"  OID1    max-access1     status1
+# fieldName2   fieldType2      "description2"  OID2    max-access2     status2
+# fieldName3   fieldType3      "description3"  OID3    max-access3     status3
+# ...
+# fieldNameN   fieldTypeN      "descriptionN"  OIDN    max-accessN     statusN
+# -- max-access defaults to read-only; status defaults as for a table. OID defaults to the next avaliable OID starting with 1
+# 
+# -- multiple tables may be defined at once, if separated by a blank line
+
+# The definition file should be piped into this script as STDIN
+
+use strict;
+
+my $tableDef = 1;
+my $lineNum = 0;
+my ($finalTableName, $tableName, $tableDesc, $rowDesc, $tableParent, $tableOID, $tableIndexList, $tableMaxAccess, $tableStatus);
+my ($fieldName, $fieldType, $fieldDesc, $fieldOID, $fieldMaxAccess, $fieldStatus);
+my @fields;
+
+sub printTable {
+# Convert _[a-z] to [A-Z], remove all underscores that are left somehow, and
+# capitalize the first letter
+       my $entryType = "pgsql".$tableName."Entry";
+       my $singleEntryType = "Pgsql".$tableName."Entry";
+# TODO : Should pgsql<name>MaxAccess and status be the same as the table's entries?
+       print <<EOF
+$finalTableName                OBJECT-TYPE
+       SYNTAX          SEQUENCE OF $entryType
+       MAX-ACCESS      $tableMaxAccess
+       STATUS          $tableStatus
+       DESCRIPTION
+               "$tableDesc"
+       ::= { $tableParent $tableOID }
+
+$entryType             OBJECT-TYPE
+       SYNTAX          $singleEntryType
+       MAX-ACCESS      $tableMaxAccess
+       STATUS          $tableStatus
+       DESCRIPTION
+               "$rowDesc"
+       INDEX  { $tableIndexList }
+       ::= { $finalTableName 1 }
+
+$singleEntryType ::=
+       SEQUENCE {
+EOF
+;
+       my $tmp = 0;
+       foreach my $i (@fields) {
+               print "\t\t". $i->{NAME}. "\t\t". $i->{TYPE};
+               if ($tmp == $#fields) { print "\n"; }
+               else { print ",\n"; }
+               $tmp++;
+       }
+       print "\t}\n\n";
+
+       $tmp = 1;
+       foreach my $i (@fields) {
+               my ($fname, $fma, $fsyn, $fstat, $fdesc, $foid) =
+                       ($i->{NAME}, $i->{MA}, $i->{TYPE}, $i->{STATUS}, $i->{DESC}, $i->{OID});
+               print <<EOF2
+$fname                 OBJECT-TYPE
+       SYNTAX          $fsyn
+       MAX-ACCESS      $fma
+       STATUS          $fstat
+       DESCRIPTION
+               "$fdesc"
+       ::= { $entryType $foid }
+
+EOF2
+;
+       }
+
+       print "\n---------------------------------------\n";
+}
+
+while (<STDIN>) {
+       chomp;
+       $lineNum++;
+       if (/^$/) {
+               &printTable if ($tableName ne "");
+               $tableDef = 1;
+               undef $tableName;
+               undef @fields;
+               next;
+       }
+       if (/^\s*--/) { print $_."\n"; next; }
+       if ($tableDef) {
+               die "Invalid table definition at line $lineNum\n"
+                       if (!m/^"?([^"\t]+)"?\t"?([^"\t]+)"?\t"?([^"\t]+)"?\t"?([^"\t]+)"?\t"?([^"\t]+)"?(\t"?([^"\t]+)"?)?(\t"?([^"\t]+)"?)?/);
+               ($tableName, $tableDesc, $rowDesc, $tableParent, $tableOID, $tableIndexList, $tableMaxAccess, $tableStatus) =
+                       ($1, $2, $3, $4, $5, $7, $9, $11);
+
+               while ($tableName =~ /_(\w)/) {
+                       my $tmp = uc $1;
+                       $tableName =~ s/_$1/$tmp/;
+               }
+               $tableName =~ s/_//g;
+               $tableName =~ /^(\w)/;
+               my $tmp = uc $1;
+               $tableName =~ s/^\w/$tmp/;
+
+               $finalTableName = "pgsql".$tableName."Table";
+               $tableMaxAccess = "not-accessible" if ($tableMaxAccess eq "");
+               $tableStatus = "current" if ($tableStatus eq "");
+               $tableDef = 0;
+
+               $tmp = 'pgsql' . $tableName . 'EntryOID';
+               $tableIndexList =~ s/entryOID/$tmp/;
+               next;
+       }
+       die "Invalid field definition at line $lineNum\n"
+               if (!m/^"?([^"\t]+)"?\t"?([^"\t]+)"?\t"?([^"\t]+)"?(\t"?([^"\t]+)"?)?(\t"?([^"\t]+)"?)?(\t"?([^"\t]+)"?)?/);
+       ($fieldName, $fieldType, $fieldDesc, $fieldOID, $fieldMaxAccess, $fieldStatus) =
+               ($1, $2, $3, $5, $7, $9);
+       $fieldMaxAccess = "read-only" if ($fieldMaxAccess eq "");
+       $fieldStatus = "current" if ($fieldStatus eq "");
+       if ($fieldOID eq "") {
+               $fieldOID = $#fields + 2 if ($fieldOID eq "");
+               if ($fieldOID < 1) {
+                       $fieldOID = 1;
+               }
+       }
+       while ($fieldName =~ /_(\w)/) {
+               my $tmp = uc $1;
+               $fieldName =~ s/_$1/$tmp/;
+       }
+       $fieldName =~ /^(\w)/;
+       my $tmp = "pgsql" . $tableName . uc $1;
+       $fieldName =~ s/^\w/$tmp/;
+
+       push @fields,
+               {
+                       NAME => $fieldName,
+                       TYPE => $fieldType,
+                       DESC => $fieldDesc,
+                       OID => $fieldOID,
+                       MA => $fieldMaxAccess,
+                       STATUS => $fieldStatus
+               };
+}
+
+&printTable if ($tableName ne "");
diff --git a/pgsql_mib_pieces/PGSQL-MIB b/pgsql_mib_pieces/PGSQL-MIB
new file mode 100644 (file)
index 0000000..4a796a8
--- /dev/null
@@ -0,0 +1,4481 @@
+  PGSQL-MIB DEFINITIONS ::= BEGIN
+
+  IMPORTS
+     MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
+      Counter32, Gauge32, Integer32, enterprises
+          FROM SNMPv2-SMI
+      Float
+          FROM UCD-SNMP-MIB
+      DisplayString, DateAndTime, TruthValue
+          FROM SNMPv2-TC
+      rdbmsDbIndex
+          FROM RDBMS-MIB;
+
+  pgsql MODULE-IDENTITY
+      LAST-UPDATED "200708152113Z"
+      ORGANIZATION "pgsnmpd Development Team"
+      CONTACT-INFO
+              "E-mail: pgsnmpd-devel@pgfoundry.org
+              WWW: http://pgsnmpd.projects.postgresql.org"
+      DESCRIPTION
+          "MIB to describe a PostgreSQL database"
+
+      ::= { enterprises 27645 }
+
+  pgsqlObjects        OBJECT IDENTIFIER ::= { pgsql 1 }
+
+  pgsnmpdTables                OBJECT IDENTIFIER ::= { pgsqlObjects 1 }
+
+  pgsqlCatalogTables   OBJECT IDENTIFIER ::= { pgsqlObjects 2 }
+
+  ----------------------------------------------------------------
+
+pgsnmpdConnectionsTable                OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsnmpdConnectionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The table of connections this SNMP agent has to PostgreSQL databases"
+       ::= { pgsnmpdTables 1 }
+
+pgsnmpdConnectionEntry                 OBJECT-TYPE
+       SYNTAX          PgsnmpdConnectionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "A single connection from pgsnmpd to a PostgreSQL database in a
+               database cluster"
+       INDEX   { pgsnmpdConnID }
+       ::= { pgsnmpdConnectionsTable 1 }
+
+PgsnmpdConnectionEntry ::=
+       SEQUENCE {
+               pgsnmpdConnID           INTEGER
+        pgsnmpdConnDesc     DisplayString
+               pgsnmpdConnHost         DisplayString
+               pgsnmpdConnPort         DisplayString
+               pgsnmpdConnDbName       DisplayString
+       }
+
+pgsnmpdConnID          OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Identifying integer for this connection."
+       ::= { pgsnmpdConnectionEntry 1 }
+
+pgsnmpdConnDesc     OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  not-accessible
+    STATUS      current
+    DESCRIPTION
+        "User-generated decriptive string for this connection."
+    ::= { pgsnmpdConnectionEntry 2 }
+
+pgsnmpdConnHost                OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Host name, IP address, or other identifier of the host PostgreSQL server for this connection"
+       ::= { pgsnmpdConnectionEntry 3 }
+
+pgsnmpdConnPort                OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "PostgreSQL server port number for this connection"
+       ::= { pgsnmpdConnectionEntry 4 }
+
+pgsnmpdConnDbName      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Name of the database this connection is connected to"
+       ::= { pgsnmpdConnectionEntry 5 }
+
+  ----------------------------------------------------------------
+pgsqlPgAggregateTable          OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAggregateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_aggregate stores information about aggregate functions. An aggregate function is a function that operates on a set of values (typically one column from each row that matches a query condition) and returns a single value computed from all these values. Typical aggregate functions are sum, count, and max. Each entry in pg_aggregate is an extension of an entry in pg_proc. The pg_proc entry carries the aggregate's name, input and output data types, and other information that is similar to ordinary functions.The catalog pg_aggregate stores information about aggregate functions. An aggregate function is a function that operates on a set of values (typically one column from each row that matches a query condition) and returns a single value computed from all these values. Typical aggregate functions are sum, count, and max. Each entry in pg_aggregate is an extension of an entry in pg_proc. The pg_proc entry carries the aggregate's name, input and output data types, and other information that is similar to ordinary functions."
+       ::= { pgsqlCatalogTables 1 }
+
+pgsqlPgAggregateEntry          OBJECT-TYPE
+       SYNTAX          PgsqlPgAggregateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "A pg_aggregate entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAggregateEntryOID }
+       ::= { pgsqlPgAggregateTable 1 }
+
+PgsqlPgAggregateEntry ::=
+       SEQUENCE {
+               pgsqlPgAggregateEntryOID                INTEGER,
+               pgsqlPgAggregateAggfnoid                INTEGER,
+               pgsqlPgAggregateAggtransfn              INTEGER,
+               pgsqlPgAggregateAggfinalfn              INTEGER,
+               pgsqlPgAggregateAggsortop               INTEGER,
+               pgsqlPgAggregateAggtranstype            INTEGER,
+               pgsqlPgAggregateAgginitval              DisplayString
+       }
+
+pgsqlPgAggregateEntryOID                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAggregateEntry 1 }
+
+pgsqlPgAggregateAggfnoid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "pg_proc OID of the aggregate function"
+       ::= { pgsqlPgAggregateEntry 2 }
+
+pgsqlPgAggregateAggtransfn                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Transition function"
+       ::= { pgsqlPgAggregateEntry 3 }
+
+pgsqlPgAggregateAggfinalfn                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Final function (zero if none)"
+       ::= { pgsqlPgAggregateEntry 4 }
+
+pgsqlPgAggregateAggsortop                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Associated sort operator (zero if none)"
+       ::= { pgsqlPgAggregateEntry 5 }
+
+pgsqlPgAggregateAggtranstype                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Data type of the aggregate function's internal transition (state) data"
+       ::= { pgsqlPgAggregateEntry 6 }
+
+pgsqlPgAggregateAgginitval                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The initial value of the transition state. This is a text field containing the initial value in its external string representation. If this field is NULL, the transition state value starts out NULL"
+       ::= { pgsqlPgAggregateEntry 7 }
+
+
+---------------------------------------
+pgsqlPgAmTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAmEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_am stores information about index access methods. There is one row for each index access method supported by the system."
+       ::= { pgsqlCatalogTables 2 }
+
+pgsqlPgAmEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgAmEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "An access method"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAmEntryOID }
+       ::= { pgsqlPgAmTable 1 }
+
+PgsqlPgAmEntry ::=
+       SEQUENCE {
+               pgsqlPgAmEntryOID               INTEGER,
+               pgsqlPgAmAmname         DisplayString,
+               pgsqlPgAmAmstrategies           INTEGER,
+               pgsqlPgAmAmsupport              INTEGER,
+               pgsqlPgAmAmorderstrategy                INTEGER,
+               pgsqlPgAmAmcanunique            TruthValue,
+               pgsqlPgAmAmcanmulticol          TruthValue,
+               pgsqlPgAmAmoptionalkey          TruthValue,
+               pgsqlPgAmAmindexnulls           TruthValue,
+               pgsqlPgAmAmstorage              TruthValue,
+               pgsqlPgAmAmclusterable          TruthValue,
+               pgsqlPgAmAminsert               INTEGER,
+               pgsqlPgAmAmbeginscan            INTEGER,
+               pgsqlPgAmAmgettuple             INTEGER,
+               pgsqlPgAmAmgetmulti             INTEGER,
+               pgsqlPgAmAmrescan               INTEGER,
+               pgsqlPgAmAmendscan              INTEGER,
+               pgsqlPgAmAmmarkpos              INTEGER,
+               pgsqlPgAmAmrestrpos             INTEGER,
+               pgsqlPgAmAmbuild                INTEGER,
+               pgsqlPgAmAmbulkdelete           INTEGER,
+               pgsqlPgAmAmvacuumcleanup                INTEGER,
+               pgsqlPgAmAmcostestimate         INTEGER,
+               pgsqlPgAmAmoptions              INTEGER
+       }
+
+pgsqlPgAmEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAmEntry 1 }
+
+pgsqlPgAmAmname                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the access method"
+       ::= { pgsqlPgAmEntry 2 }
+
+pgsqlPgAmAmstrategies                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of operator strategies for this access method"
+       ::= { pgsqlPgAmEntry 3 }
+
+pgsqlPgAmAmsupport                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of support routines for this access method"
+       ::= { pgsqlPgAmEntry 4 }
+
+pgsqlPgAmAmorderstrategy                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Zero if the index offers no sort order, otherwise the strategy number of the strategy operator that describes the sort order"
+       ::= { pgsqlPgAmEntry 5 }
+
+pgsqlPgAmAmcanunique                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Does the access method support unique indexes?"
+       ::= { pgsqlPgAmEntry 6 }
+
+pgsqlPgAmAmcanmulticol                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Does the access method support multicolumn indexes?"
+       ::= { pgsqlPgAmEntry 7 }
+
+pgsqlPgAmAmoptionalkey                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Does the access method support a scan without any constraint for the first index column?"
+       ::= { pgsqlPgAmEntry 8 }
+
+pgsqlPgAmAmindexnulls                  OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Does the access method support null index entries?"
+       ::= { pgsqlPgAmEntry 9 }
+
+pgsqlPgAmAmstorage                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Can index storage data type differ from column data type?"
+       ::= { pgsqlPgAmEntry 10 }
+
+pgsqlPgAmAmclusterable                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Can an index of this type be clustered on?"
+       ::= { pgsqlPgAmEntry 11 }
+
+pgsqlPgAmAminsert                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Insert this tuple"
+       ::= { pgsqlPgAmEntry 12 }
+
+pgsqlPgAmAmbeginscan                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Start new scan"
+       ::= { pgsqlPgAmEntry 13 }
+
+pgsqlPgAmAmgettuple                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Next valid tuple"
+       ::= { pgsqlPgAmEntry 14 }
+
+pgsqlPgAmAmgetmulti                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Fetch multiple tuples"
+       ::= { pgsqlPgAmEntry 15 }
+
+pgsqlPgAmAmrescan                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Restart this scan"
+       ::= { pgsqlPgAmEntry 16 }
+
+pgsqlPgAmAmendscan                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "End this scan"
+       ::= { pgsqlPgAmEntry 17 }
+
+pgsqlPgAmAmmarkpos                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Mark current scan position"
+       ::= { pgsqlPgAmEntry 18 }
+
+pgsqlPgAmAmrestrpos                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Restore marked scan position"
+       ::= { pgsqlPgAmEntry 19 }
+
+pgsqlPgAmAmbuild                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Build new index"
+       ::= { pgsqlPgAmEntry 20 }
+
+pgsqlPgAmAmbulkdelete                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Bulk-delete function"
+       ::= { pgsqlPgAmEntry 21 }
+
+pgsqlPgAmAmvacuumcleanup                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Post- VACUUM cleanup function"
+       ::= { pgsqlPgAmEntry 22 }
+
+pgsqlPgAmAmcostestimate                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function to estimate cost of an index scan"
+       ::= { pgsqlPgAmEntry 23 }
+
+pgsqlPgAmAmoptions                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function to parse and validate reloptions for an index"
+       ::= { pgsqlPgAmEntry 24 }
+
+
+---------------------------------------
+pgsqlPgAmopTable               OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAmopEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_amop stores information about operators associated with index access method operator classes. There is one row for each operator that is a member of an operator class."
+       ::= { pgsqlCatalogTables 3 }
+
+pgsqlPgAmopEntry               OBJECT-TYPE
+       SYNTAX          PgsqlPgAmopEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_amop entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAmopEntryOID }
+       ::= { pgsqlPgAmopTable 1 }
+
+PgsqlPgAmopEntry ::=
+       SEQUENCE {
+               pgsqlPgAmopEntryOID             INTEGER,
+               pgsqlPgAmopAmopfamily           INTEGER,
+               pgsqlPgAmopAmoplefttype         INTEGER,
+               pgsqlPgAmopAmoprighttype                INTEGER,
+               pgsqlPgAmopAmopstrategy         INTEGER,
+               pgsqlPgAmopAmopreqcheck         TruthValue,
+               pgsqlPgAmopAmopopr              INTEGER,
+               pgsqlPgAmopAmopmethod           INTEGER
+       }
+
+pgsqlPgAmopEntryOID                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAmopEntry 1 }
+
+pgsqlPgAmopAmopfamily                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The operator family this entry is for"
+       ::= { pgsqlPgAmopEntry 2 }
+
+pgsqlPgAmopAmoplefttype                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Left-hand input data type of operator"
+       ::= { pgsqlPgAmopEntry 3 }
+
+pgsqlPgAmopAmoprighttype                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Right-hand input data type of operator"
+       ::= { pgsqlPgAmopEntry 4 }
+
+pgsqlPgAmopAmopstrategy                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Operator strategy number"
+       ::= { pgsqlPgAmopEntry 5 }
+
+pgsqlPgAmopAmopreqcheck                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Index hit must be rechecked"
+       ::= { pgsqlPgAmopEntry 6 }
+
+pgsqlPgAmopAmopopr                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the operator"
+       ::= { pgsqlPgAmopEntry 7 }
+
+pgsqlPgAmopAmopmethod                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Index access method operator family is for"
+       ::= { pgsqlPgAmopEntry 8 }
+
+
+---------------------------------------
+pgsqlPgAmprocTable             OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAmprocEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_amproc stores information about support procedures associated with index access method operator classes. There is one row for each support procedure belonging to an operator class."
+       ::= { pgsqlCatalogTables 4 }
+
+pgsqlPgAmprocEntry             OBJECT-TYPE
+       SYNTAX          PgsqlPgAmprocEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_amproc entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAmprocEntryOID }
+       ::= { pgsqlPgAmprocTable 1 }
+
+PgsqlPgAmprocEntry ::=
+       SEQUENCE {
+               pgsqlPgAmprocEntryOID           INTEGER,
+               pgsqlPgAmprocAmopclaid          INTEGER,
+               pgsqlPgAmprocAmprocsubtype              INTEGER,
+               pgsqlPgAmprocAmprocnum          INTEGER,
+               pgsqlPgAmprocAmproc             INTEGER
+       }
+
+pgsqlPgAmprocEntryOID                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAmprocEntry 1 }
+
+pgsqlPgAmprocAmopclaid                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The index operator class this entry is for"
+       ::= { pgsqlPgAmprocEntry 2 }
+
+pgsqlPgAmprocAmprocsubtype                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Subtype, if cross-type routine, else zero"
+       ::= { pgsqlPgAmprocEntry 3 }
+
+pgsqlPgAmprocAmprocnum                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Support procedure number"
+       ::= { pgsqlPgAmprocEntry 4 }
+
+pgsqlPgAmprocAmproc                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the procedure"
+       ::= { pgsqlPgAmprocEntry 5 }
+
+
+---------------------------------------
+pgsqlPgAttrdefTable            OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAttrdefEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_attrdef stores column default values. The main information about columns is stored in pg_attribute (see below). Only columns that explicitly specify a default value (when the table is created or the column is added) will have an entry here."
+       ::= { pgsqlCatalogTables 5 }
+
+pgsqlPgAttrdefEntry            OBJECT-TYPE
+       SYNTAX          PgsqlPgAttrdefEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_attrdef entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAttrdefEntryOID }
+       ::= { pgsqlPgAttrdefTable 1 }
+
+PgsqlPgAttrdefEntry ::=
+       SEQUENCE {
+               pgsqlPgAttrdefEntryOID          INTEGER,
+               pgsqlPgAttrdefAdrelid           INTEGER,
+               pgsqlPgAttrdefAdnum             INTEGER,
+               pgsqlPgAttrdefAdbin             DisplayString,
+               pgsqlPgAttrdefAdsrc             DisplayString
+       }
+
+pgsqlPgAttrdefEntryOID                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAttrdefEntry 1 }
+
+pgsqlPgAttrdefAdrelid                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this column belongs to"
+       ::= { pgsqlPgAttrdefEntry 2 }
+
+pgsqlPgAttrdefAdnum                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of the column"
+       ::= { pgsqlPgAttrdefEntry 3 }
+
+pgsqlPgAttrdefAdbin                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The internal representation of the column default value"
+       ::= { pgsqlPgAttrdefEntry 4 }
+
+pgsqlPgAttrdefAdsrc                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A human-readable representation of the default value"
+       ::= { pgsqlPgAttrdefEntry 5 }
+
+
+---------------------------------------
+pgsqlPgAttributeTable          OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAttributeEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_attribute stores information about table columns. There will be exactly one pg_attribute row for every column in every table in the database. (There will also be attribute entries for indexes, and indeed all objects that have pg_class entries.) The term attribute is equivalent to column and is used for historical reasons."
+       ::= { pgsqlCatalogTables 6 }
+
+pgsqlPgAttributeEntry          OBJECT-TYPE
+       SYNTAX          PgsqlPgAttributeEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_attribute entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAttributeEntryOID }
+       ::= { pgsqlPgAttributeTable 1 }
+
+PgsqlPgAttributeEntry ::=
+       SEQUENCE {
+               pgsqlPgAttributeEntryOID                INTEGER,
+               pgsqlPgAttributeAttrelid                INTEGER,
+               pgsqlPgAttributeAttname         DisplayString,
+               pgsqlPgAttributeAtttypid                INTEGER,
+               pgsqlPgAttributeAttstattarget           INTEGER,
+               pgsqlPgAttributeAttlen          INTEGER,
+               pgsqlPgAttributeAttnum          INTEGER,
+               pgsqlPgAttributeAttndims                INTEGER,
+               pgsqlPgAttributeAttcacheoff             INTEGER,
+               pgsqlPgAttributeAtttypmod               INTEGER,
+               pgsqlPgAttributeAttbyval                TruthValue,
+               pgsqlPgAttributeAttstorage              DisplayString,
+               pgsqlPgAttributeAttalign                DisplayString,
+               pgsqlPgAttributeAttnotnull              TruthValue,
+               pgsqlPgAttributeAtthasdef               TruthValue,
+               pgsqlPgAttributeAttisdropped            TruthValue,
+               pgsqlPgAttributeAttislocal              INTEGER,
+               pgsqlPgAttributeAttinhcount             INTEGER
+       }
+
+pgsqlPgAttributeEntryOID                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAttributeEntry 1 }
+
+pgsqlPgAttributeAttrelid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this column belongs to"
+       ::= { pgsqlPgAttributeEntry 2 }
+
+pgsqlPgAttributeAttname                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The column name"
+       ::= { pgsqlPgAttributeEntry 3 }
+
+pgsqlPgAttributeAtttypid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The data type of this column"
+       ::= { pgsqlPgAttributeEntry 4 }
+
+pgsqlPgAttributeAttstattarget                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE . A zero value indicates that no statistics should be collected. A negative value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of "
+       ::= { pgsqlPgAttributeEntry 5 }
+
+pgsqlPgAttributeAttlen                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A copy of pg_type.typlen of this column's type"
+       ::= { pgsqlPgAttributeEntry 6 }
+
+pgsqlPgAttributeAttnum                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of the column. Ordinary columns are numbered from 1 up. System columns, such as oid , have (arbitrary) negative numbers"
+       ::= { pgsqlPgAttributeEntry 7 }
+
+pgsqlPgAttributeAttndims                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means "
+       ::= { pgsqlPgAttributeEntry 8 }
+
+pgsqlPgAttributeAttcacheoff                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Always -1 in storage, but when loaded into a row descriptor in memory this may be updated to cache the offset of the attribute within the row"
+       ::= { pgsqlPgAttributeEntry 9 }
+
+pgsqlPgAttributeAtttypmod                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "atttypmod records type-specific data supplied at table creation time (for example, the maximum length of a varchar column). It is passed to type-specific input functions and length coercion functions. The value will generally be -1 for types that do not need atttypmod"
+       ::= { pgsqlPgAttributeEntry 10 }
+
+pgsqlPgAttributeAttbyval                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A copy of pg_type.typbyval of this column's type"
+       ::= { pgsqlPgAttributeEntry 11 }
+
+pgsqlPgAttributeAttstorage                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Normally a copy of pg_type.typstorage of this column's type. For TOAST-able data types, this can be altered after column creation to control storage policy"
+       ::= { pgsqlPgAttributeEntry 12 }
+
+pgsqlPgAttributeAttalign                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A copy of pg_type.typalign of this column's type"
+       ::= { pgsqlPgAttributeEntry 13 }
+
+pgsqlPgAttributeAttnotnull                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This represents a not-null constraint. It is possible to change this column to enable or disable the constraint"
+       ::= { pgsqlPgAttributeEntry 14 }
+
+pgsqlPgAttributeAtthasdef                      OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This column has a default value, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the value"
+       ::= { pgsqlPgAttributeEntry 15 }
+
+pgsqlPgAttributeAttisdropped                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This column has been dropped and is no longer valid. A dropped column is still physically present in the table, but is ignored by the parser and so cannot be accessed via SQL"
+       ::= { pgsqlPgAttributeEntry 16 }
+
+pgsqlPgAttributeAttislocal                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This column is defined locally in the relation. Note that a column may be locally defined and inherited simultaneously"
+       ::= { pgsqlPgAttributeEntry 17 }
+
+pgsqlPgAttributeAttinhcount                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of direct ancestors this column has. A column with a nonzero number of ancestors cannot be dropped nor renamed"
+       ::= { pgsqlPgAttributeEntry 18 }
+
+
+---------------------------------------
+-- TODO: Because pg_authid is shared across databases, find a way to ensure I cover all configured connections exactly once
+pgsqlPgAuthMembersTable                OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAuthMembersEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_auth_members shows the membership relations between roles. Any non-circular set of relationships is allowed. Because user identities are cluster-wide, pg_auth_members is shared across all databases of a cluster: there is only one copy of pg_auth_members per cluster, not one per database."
+       ::= { pgsqlCatalogTables 8 }
+
+pgsqlPgAuthMembersEntry                OBJECT-TYPE
+       SYNTAX          PgsqlPgAuthMembersEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_auth_members entry"
+       INDEX  { pgsnmpdConnID, pgsqlPgAuthMembersEntryOID }
+       ::= { pgsqlPgAuthMembersTable 1 }
+
+PgsqlPgAuthMembersEntry ::=
+       SEQUENCE {
+               pgsqlPgAuthMembersEntryOID              INTEGER,
+               pgsqlPgAuthMembersRoleid                INTEGER,
+               pgsqlPgAuthMembersMember                INTEGER,
+               pgsqlPgAuthMembersGrantor               INTEGER,
+               pgsqlPgAuthMembersAdminOption           TruthValue
+       }
+
+pgsqlPgAuthMembersEntryOID                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAuthMembersEntry 1 }
+
+pgsqlPgAuthMembersRoleid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "ID of a role that has a member"
+       ::= { pgsqlPgAuthMembersEntry 2 }
+
+pgsqlPgAuthMembersMember                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "ID of a role that is a member of roleid"
+       ::= { pgsqlPgAuthMembersEntry 3 }
+
+pgsqlPgAuthMembersGrantor                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "ID of the role that granted this membership"
+       ::= { pgsqlPgAuthMembersEntry 4 }
+
+pgsqlPgAuthMembersAdminOption                  OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if member may grant membership in roleid to others"
+       ::= { pgsqlPgAuthMembersEntry 5 }
+
+
+---------------------------------------
+-- TODO: Because pg_authid is shared across databases, find a way to ensure I cover all configured connections exactly once
+pgsqlPgAuthidTable             OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAuthidEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_authid contains information about database authorization identifiers (roles). A role subsumes the concepts of 'users' and 'groups'. A user is essentially just a role with the rolcanlogin flag set. Any role (with or without rolcanlogin) may have other roles as members; see pg_auth_members. Since this catalog contains passwords, it must not be publicly readable. pg_roles is a publicly readable view on pg_authid that blanks out the password field. Because user identities are cluster-wide, pg_authid is shared across all databases of a cluster: there is only one copy of pg_authid per cluster, not one per database."
+       ::= { pgsqlCatalogTables 7 }
+
+pgsqlPgAuthidEntry             OBJECT-TYPE
+       SYNTAX          PgsqlPgAuthidEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_authid entry"
+       INDEX  { pgsnmpdConnID, pgsqlPgAuthidEntryOID }
+       ::= { pgsqlPgAuthidTable 1 }
+
+PgsqlPgAuthidEntry ::=
+       SEQUENCE {
+               pgsqlPgAuthidEntryOID           INTEGER,
+               pgsqlPgAuthidRolname            INTEGER,
+               pgsqlPgAuthidRolsuper           TruthValue,
+               pgsqlPgAuthidRolinherit         TruthValue,
+               pgsqlPgAuthidRolcreaterole              TruthValue,
+               pgsqlPgAuthidRolcreatedb                TruthValue,
+               pgsqlPgAuthidRolcatupdate               TruthValue,
+               pgsqlPgAuthidRolcanlogin                TruthValue,
+               pgsqlPgAuthidRolconnlimit               INTEGER,
+               pgsqlPgAuthidRolpassword                DisplayString,
+               pgsqlPgAuthidRolvaliduntil              DateAndTime,
+               pgsqlPgAuthidRolconfig          DisplayString
+       }
+
+pgsqlPgAuthidEntryOID                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAuthidEntry 1 }
+
+pgsqlPgAuthidRolname                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role name"
+       ::= { pgsqlPgAuthidEntry 2 }
+
+pgsqlPgAuthidRolsuper                  OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role has superuser privileges"
+       ::= { pgsqlPgAuthidEntry 3 }
+
+pgsqlPgAuthidRolinherit                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role automatically inherits privileges of roles it is a member of"
+       ::= { pgsqlPgAuthidEntry 4 }
+
+pgsqlPgAuthidRolcreaterole                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role may create more roles"
+       ::= { pgsqlPgAuthidEntry 5 }
+
+pgsqlPgAuthidRolcreatedb                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role may create databases"
+       ::= { pgsqlPgAuthidEntry 6 }
+
+pgsqlPgAuthidRolcatupdate                      OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role may update system catalogs directly. (Even a superuser may not do this unless this column is true)"
+       ::= { pgsqlPgAuthidEntry 7 }
+
+pgsqlPgAuthidRolcanlogin                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role may log in. That is, this role can be given as the initial session authorization identifier"
+       ::= { pgsqlPgAuthidEntry 8 }
+
+pgsqlPgAuthidRolconnlimit                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For roles that can log in, this sets maximum number of concurrent connections this role can make. -1 means no limit"
+       ::= { pgsqlPgAuthidEntry 9 }
+
+pgsqlPgAuthidRolpassword                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Password (possibly encrypted); NULL if none"
+       ::= { pgsqlPgAuthidEntry 10 }
+
+pgsqlPgAuthidRolvaliduntil                     OBJECT-TYPE
+       SYNTAX          DateAndTime
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Password expiry time (only used for password authentication); NULL if no expiration"
+       ::= { pgsqlPgAuthidEntry 11 }
+
+pgsqlPgAuthidRolconfig                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Session defaults for run-time configuration variables"
+       ::= { pgsqlPgAuthidEntry 12 }
+
+
+---------------------------------------
+pgsqlPgAutovacuumTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAutovacuumEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_autovacuum stores optional per-relation configuration parameters for the autovacuum daemon. If there is an entry here for a particular relation, the given parameters will be used for autovacuuming that table. If no entry is present, the system-wide defaults will be used."
+       ::= { pgsqlCatalogTables 9 }
+
+pgsqlPgAutovacuumEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgAutovacuumEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Autovacuum settings for a relation"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAutovacuumEntryOID }
+       ::= { pgsqlPgAutovacuumTable 1 }
+
+PgsqlPgAutovacuumEntry ::=
+       SEQUENCE {
+               pgsqlPgAutovacuumEntryOID               INTEGER,
+               pgsqlPgAutovacuumVacrelid               INTEGER,
+               pgsqlPgAutovacuumEnabled                TruthValue,
+               pgsqlPgAutovacuumVacBaseThresh          INTEGER,
+               pgsqlPgAutovacuumVacScaleFactor         Float,
+               pgsqlPgAutovacuumAnlBaseThresh          INTEGER,
+               pgsqlPgAutovacuumAnlScaleFactor         Float,
+               pgsqlPgAutovacuumVacCostDelay           INTEGER,
+               pgsqlPgAutovacuumVacCostLimit           INTEGER,
+               pgsqlPgAutovacuumFreezeMinAge           INTEGER,
+               pgsqlPgAutovacuumFreezeMaxAge           INTEGER
+       }
+
+pgsqlPgAutovacuumEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAutovacuumEntry 1 }
+
+pgsqlPgAutovacuumVacrelid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this entry is for"
+       ::= { pgsqlPgAutovacuumEntry 2 }
+
+pgsqlPgAutovacuumEnabled                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If false, this table is never autovacuumed"
+       ::= { pgsqlPgAutovacuumEntry 3 }
+
+pgsqlPgAutovacuumVacBaseThresh                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Minimum number of modified tuples before vacuum"
+       ::= { pgsqlPgAutovacuumEntry 4 }
+
+pgsqlPgAutovacuumVacScaleFactor                        OBJECT-TYPE
+       SYNTAX          Float
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Multiplier for reltuples to add to vac_base_thresh"
+       ::= { pgsqlPgAutovacuumEntry 5 }
+
+pgsqlPgAutovacuumAnlBaseThresh                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Minimum number of modified tuples before analyze"
+       ::= { pgsqlPgAutovacuumEntry 6 }
+
+pgsqlPgAutovacuumAnlScaleFactor                        OBJECT-TYPE
+       SYNTAX          Float
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Multiplier for reltuples to add to anl_base_thresh"
+       ::= { pgsqlPgAutovacuumEntry 7 }
+
+pgsqlPgAutovacuumVacCostDelay                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Custom vacuum_cost_delay parameter"
+       ::= { pgsqlPgAutovacuumEntry 8 }
+
+pgsqlPgAutovacuumVacCostLimit                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Custom vacuum_cost_limit parameter"
+       ::= { pgsqlPgAutovacuumEntry 9 }
+
+pgsqlPgAutovacuumFreezeMinAge                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Custom vacuum_freeze_min_age parameter"
+       ::= { pgsqlPgAutovacuumEntry 10 }
+
+pgsqlPgAutovacuumFreezeMaxAge                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Custom autovacuum_freeze_max_age parameter"
+       ::= { pgsqlPgAutovacuumEntry 11 }
+
+
+---------------------------------------
+pgsqlPgCastTable               OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgCastEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_cast stores data type conversion paths, both built-in paths and those defined with CREATE CAST."
+       ::= { pgsqlCatalogTables 10 }
+
+pgsqlPgCastEntry               OBJECT-TYPE
+       SYNTAX          PgsqlPgCastEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_cast entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgCastEntryOID }
+       ::= { pgsqlPgCastTable 1 }
+
+PgsqlPgCastEntry ::=
+       SEQUENCE {
+               pgsqlPgCastEntryOID             INTEGER,
+               pgsqlPgCastCastsource           INTEGER,
+               pgsqlPgCastCasttarget           INTEGER,
+               pgsqlPgCastCastfunc             INTEGER,
+               pgsqlPgCastCastcontext          DisplayString
+       }
+
+pgsqlPgCastEntryOID                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgCastEntry 1 }
+
+pgsqlPgCastCastsource                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the source data type"
+       ::= { pgsqlPgCastEntry 2 }
+
+pgsqlPgCastCasttarget                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the target data type"
+       ::= { pgsqlPgCastEntry 3 }
+
+pgsqlPgCastCastfunc                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the function to use to perform this cast. Zero is stored if the data types are binary compatible (that is, no run-time operation is needed to perform the cast)"
+       ::= { pgsqlPgCastEntry 4 }
+
+pgsqlPgCastCastcontext                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Indicates what contexts the cast may be invoked in. e means only as an explicit cast (using CAST or :: syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases"
+       ::= { pgsqlPgCastEntry 5 }
+
+
+---------------------------------------
+pgsqlPgClassTable              OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgClassEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_class catalogs tables and most everything else that has columns or is otherwise similar to a table. This includes indexes (but see also pg_index), sequences, views, composite types, and TOAST tables; see relkind. Below, when we mean all of these kinds of objects we speak of 'relations'. Not all columns are meaningful for all relation types."
+       ::= { pgsqlCatalogTables 11 }
+
+pgsqlPgClassEntry              OBJECT-TYPE
+       SYNTAX          PgsqlPgClassEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_class entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgClassEntryOID }
+       ::= { pgsqlPgClassTable 1 }
+
+PgsqlPgClassEntry ::=
+       SEQUENCE {
+               pgsqlPgClassEntryOID            INTEGER,
+               pgsqlPgClassRelname             DisplayString,
+               pgsqlPgClassRelnamespace                INTEGER,
+               pgsqlPgClassReltype             INTEGER,
+               pgsqlPgClassRelowner            INTEGER,
+               pgsqlPgClassRelam               INTEGER,
+               pgsqlPgClassRelfilenode         INTEGER,
+               pgsqlPgClassReltablespace               INTEGER,
+               pgsqlPgClassRelpages            INTEGER,
+               pgsqlPgClassReltuples           Float,
+               pgsqlPgClassReltoastrelid               INTEGER,
+               pgsqlPgClassReltoastidxid               INTEGER,
+               pgsqlPgClassRelhasindex         TruthValue,
+               pgsqlPgClassRelisshared         TruthValue,
+               pgsqlPgClassRelkind             DisplayString,
+               pgsqlPgClassRelnatts            INTEGER,
+               pgsqlPgClassRelchecks           INTEGER,
+               pgsqlPgClassReltriggers         INTEGER,
+               pgsqlPgClassRelukeys            INTEGER,
+               pgsqlPgClassRelfkeys            INTEGER,
+               pgsqlPgClassRelrefs             INTEGER,
+               pgsqlPgClassRelhasoids          TruthValue,
+               pgsqlPgClassRelhaspkey          TruthValue,
+               pgsqlPgClassRelhasrules         TruthValue,
+               pgsqlPgClassRelhassubclass              TruthValue,
+               pgsqlPgClassRelfrozenxid                INTEGER,
+               pgsqlPgClassRelacl              DisplayString,
+               pgsqlPgClassReloptions          DisplayString
+       }
+
+pgsqlPgClassEntryOID                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgClassEntry 1 }
+
+pgsqlPgClassRelname                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the table, index, view, etc."
+       ::= { pgsqlPgClassEntry 2 }
+
+pgsqlPgClassRelnamespace                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this relation"
+       ::= { pgsqlPgClassEntry 3 }
+
+pgsqlPgClassReltype                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the data type that corresponds to this table's row type, if any (zero for indexes, which have no pg_type entry)"
+       ::= { pgsqlPgClassEntry 4 }
+
+pgsqlPgClassRelowner                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the relation"
+       ::= { pgsqlPgClassEntry 5 }
+
+pgsqlPgClassRelam                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this is an index, the access method used (B-tree, hash, etc.)"
+       ::= { pgsqlPgClassEntry 6 }
+
+pgsqlPgClassRelfilenode                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the on-disk file of this relation; 0 if none"
+       ::= { pgsqlPgClassEntry 7 }
+
+pgsqlPgClassReltablespace                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The tablespace in which this relation is stored. If zero, the database's default tablespace is implied. (Not meaningful if the relation has no on-disk file.)"
+       ::= { pgsqlPgClassEntry 8 }
+
+pgsqlPgClassRelpages                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Size of the on-disk representation of this table in pages (of size BLCKSZ ). This is only an estimate used by the planner. It is updated by VACUUM , ANALYZE , and a few DDL commands such as CREATE INDEX"
+       ::= { pgsqlPgClassEntry 9 }
+
+pgsqlPgClassReltuples                  OBJECT-TYPE
+       SYNTAX          Float
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM , ANALYZE , and a few DDL commands such as CREATE INDEX"
+       ::= { pgsqlPgClassEntry 10 }
+
+pgsqlPgClassReltoastrelid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the TOAST table associated with this table, 0 if none. The TOAST table stores large attributes "
+       ::= { pgsqlPgClassEntry 11 }
+
+pgsqlPgClassReltoastidxid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For a TOAST table, the OID of its index. 0 if not a TOAST table"
+       ::= { pgsqlPgClassEntry 12 }
+
+pgsqlPgClassRelhasindex                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if this is a table and it has (or recently had) any indexes. This is set by CREATE INDEX , but not cleared immediately by DROP INDEX . VACUUM clears relhasindex if it finds the table has no indexes"
+       ::= { pgsqlPgClassEntry 13 }
+
+pgsqlPgClassRelisshared                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if this table is shared across all databases in the cluster. Only certain system catalogs (such as pg_database ) are shared"
+       ::= { pgsqlPgClassEntry 14 }
+
+pgsqlPgClassRelkind                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "r = ordinary table, i = index, S = sequence, v = view, c = composite type, t = TOAST table"
+       ::= { pgsqlPgClassEntry 15 }
+
+pgsqlPgClassRelnatts                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of user columns in the relation (system columns not counted). There must be this many corresponding entries in pg_attribute . See also pg_attribute.attnum"
+       ::= { pgsqlPgClassEntry 16 }
+
+pgsqlPgClassRelchecks                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of check constraints on the table; see pg_constraint catalog"
+       ::= { pgsqlPgClassEntry 17 }
+
+pgsqlPgClassReltriggers                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of triggers on the table; see pg_trigger catalog"
+       ::= { pgsqlPgClassEntry 18 }
+
+pgsqlPgClassRelukeys                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Unused ( not the number of unique keys)"
+       ::= { pgsqlPgClassEntry 19 }
+
+pgsqlPgClassRelfkeys                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Unused ( not the number of foreign keys on the table)"
+       ::= { pgsqlPgClassEntry 20 }
+
+pgsqlPgClassRelrefs                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Unused"
+       ::= { pgsqlPgClassEntry 21 }
+
+pgsqlPgClassRelhasoids                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if we generate an OID for each row of the relation"
+       ::= { pgsqlPgClassEntry 22 }
+
+pgsqlPgClassRelhaspkey                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if the table has (or once had) a primary key"
+       ::= { pgsqlPgClassEntry 23 }
+
+pgsqlPgClassRelhasrules                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if table has rules; see pg_rewrite catalog"
+       ::= { pgsqlPgClassEntry 24 }
+
+pgsqlPgClassRelhassubclass                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if table has (or once had) any inheritance children"
+       ::= { pgsqlPgClassEntry 25 }
+
+pgsqlPgClassRelfrozenxid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "All transaction IDs before this one have been replaced with a permanent ( "
+       ::= { pgsqlPgClassEntry 26 }
+
+pgsqlPgClassRelacl                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgClassEntry 27 }
+
+pgsqlPgClassReloptions                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access-method-specific options, as "
+       ::= { pgsqlPgClassEntry 28 }
+
+
+---------------------------------------
+pgsqlPgConstraintTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgConstraintEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_constraint stores check, primary key, unique, and foreign key constraints on tables. (Column constraints are not treated specially. Every column constraint is equivalent to some table constraint.) Not-null constraints are represented in the pg_attribute catalog."
+       ::= { pgsqlCatalogTables 12 }
+
+pgsqlPgConstraintEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgConstraintEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "A constraint entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgConstraintEntryOID }
+       ::= { pgsqlPgConstraintTable 1 }
+
+PgsqlPgConstraintEntry ::=
+       SEQUENCE {
+               pgsqlPgConstraintEntryOID               INTEGER,
+               pgsqlPgConstraintConname                DisplayString,
+               pgsqlPgConstraintConnamespace           INTEGER,
+               pgsqlPgConstraintContype                DisplayString,
+               pgsqlPgConstraintCondeferrable          TruthValue,
+               pgsqlPgConstraintCondeferred            TruthValue,
+               pgsqlPgConstraintConrelid               INTEGER,
+               pgsqlPgConstraintContypid               INTEGER,
+               pgsqlPgConstraintConfrelid              INTEGER,
+               pgsqlPgConstraintConfupdtype            DisplayString,
+               pgsqlPgConstraintConfdeltype            DisplayString,
+               pgsqlPgConstraintConfmatchtype          DisplayString,
+               pgsqlPgConstraintConkey         DisplayString,
+               pgsqlPgConstraintConfkey                DisplayString,
+               pgsqlPgConstraintConbin         DisplayString,
+               pgsqlPgConstraintConsrc         DisplayString
+       }
+
+pgsqlPgConstraintEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgConstraintEntry 1 }
+
+pgsqlPgConstraintConname                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Constraint name (not necessarily unique!)"
+       ::= { pgsqlPgConstraintEntry 2 }
+
+pgsqlPgConstraintConnamespace                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this constraint"
+       ::= { pgsqlPgConstraintEntry 3 }
+
+pgsqlPgConstraintContype                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "c = check constraint, f = foreign key constraint, p = primary key constraint, u = unique constraint"
+       ::= { pgsqlPgConstraintEntry 4 }
+
+pgsqlPgConstraintCondeferrable                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Is the constraint deferrable?"
+       ::= { pgsqlPgConstraintEntry 5 }
+
+pgsqlPgConstraintCondeferred                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Is the constraint deferred by default?"
+       ::= { pgsqlPgConstraintEntry 6 }
+
+pgsqlPgConstraintConrelid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this constraint is on; 0 if not a table constraint"
+       ::= { pgsqlPgConstraintEntry 7 }
+
+pgsqlPgConstraintContypid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The domain this constraint is on; 0 if not a domain constraint"
+       ::= { pgsqlPgConstraintEntry 8 }
+
+pgsqlPgConstraintConfrelid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If a foreign key, the referenced table; else 0"
+       ::= { pgsqlPgConstraintEntry 9 }
+
+pgsqlPgConstraintConfupdtype                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Foreign key update action code"
+       ::= { pgsqlPgConstraintEntry 10 }
+
+pgsqlPgConstraintConfdeltype                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Foreign key deletion action code"
+       ::= { pgsqlPgConstraintEntry 11 }
+
+pgsqlPgConstraintConfmatchtype                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Foreign key match type"
+       ::= { pgsqlPgConstraintEntry 12 }
+
+pgsqlPgConstraintConkey                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If a table constraint, list of columns which the constraint constrains"
+       ::= { pgsqlPgConstraintEntry 13 }
+
+pgsqlPgConstraintConfkey                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If a foreign key, list of the referenced columns"
+       ::= { pgsqlPgConstraintEntry 14 }
+
+pgsqlPgConstraintConbin                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If a check constraint, an internal representation of the expression"
+       ::= { pgsqlPgConstraintEntry 15 }
+
+pgsqlPgConstraintConsrc                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If a check constraint, a human-readable representation of the expression"
+       ::= { pgsqlPgConstraintEntry 16 }
+
+
+---------------------------------------
+pgsqlPgConversionTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgConversionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_conversion describes the available encoding conversion procedures."
+       ::= { pgsqlCatalogTables 13 }
+
+pgsqlPgConversionEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgConversionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "A conversion entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgConversionEntryOID }
+       ::= { pgsqlPgConversionTable 1 }
+
+PgsqlPgConversionEntry ::=
+       SEQUENCE {
+               pgsqlPgConversionEntryOID               INTEGER,
+               pgsqlPgConversionConname                DisplayString,
+               pgsqlPgConversionConnamespace           INTEGER,
+               pgsqlPgConversionConowner               INTEGER,
+               pgsqlPgConversionConforencoding         INTEGER,
+               pgsqlPgConversionContoencoding          INTEGER,
+               pgsqlPgConversionConproc                INTEGER,
+               pgsqlPgConversionCondefault             TruthValue
+       }
+
+pgsqlPgConversionEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgConversionEntry 1 }
+
+pgsqlPgConversionConname                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Conversion name (unique within a namespace)"
+       ::= { pgsqlPgConversionEntry 2 }
+
+pgsqlPgConversionConnamespace                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this conversion"
+       ::= { pgsqlPgConversionEntry 3 }
+
+pgsqlPgConversionConowner                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the conversion"
+       ::= { pgsqlPgConversionEntry 4 }
+
+pgsqlPgConversionConforencoding                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Source encoding ID"
+       ::= { pgsqlPgConversionEntry 5 }
+
+pgsqlPgConversionContoencoding                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Destination encoding ID"
+       ::= { pgsqlPgConversionEntry 6 }
+
+pgsqlPgConversionConproc                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Conversion procedure"
+       ::= { pgsqlPgConversionEntry 7 }
+
+pgsqlPgConversionCondefault                    OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if this is the default conversion"
+       ::= { pgsqlPgConversionEntry 8 }
+
+
+---------------------------------------
+-- TODO: Because pg_authid is shared across databases, find a way to ensure I cover all configured connections exactly once
+pgsqlPgDatabaseTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgDatabaseEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_database stores information about the available databases. Databases are created with the CREATE DATABASE command. Unlike most system catalogs, pg_database is shared across all databases of a cluster: there is only one copy of pg_database per cluster, not one per database."
+       ::= { pgsqlCatalogTables 14 }
+
+pgsqlPgDatabaseEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgDatabaseEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "A database"
+       INDEX  { pgsnmpdConnID, pgsqlPgDatabaseEntryOID }
+       ::= { pgsqlPgDatabaseTable 1 }
+
+PgsqlPgDatabaseEntry ::=
+       SEQUENCE {
+               pgsqlPgDatabaseEntryOID         INTEGER,
+               pgsqlPgDatabaseDatname          DisplayString,
+               pgsqlPgDatabaseDatdba           INTEGER,
+               pgsqlPgDatabaseEncoding         INTEGER,
+               pgsqlPgDatabaseDatistemplate            TruthValue,
+               pgsqlPgDatabaseDatallowconn             TruthValue,
+               pgsqlPgDatabaseDatconnlimit             INTEGER,
+               pgsqlPgDatabaseDatlastsysoid            INTEGER,
+               pgsqlPgDatabaseDatfrozenxid             INTEGER,
+               pgsqlPgDatabaseDattablespace            INTEGER,
+               pgsqlPgDatabaseDatconfig                DisplayString,
+               pgsqlPgDatabaseDatacl           DisplayString
+       }
+
+pgsqlPgDatabaseEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgDatabaseEntry 1 }
+
+pgsqlPgDatabaseDatname                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Database name"
+       ::= { pgsqlPgDatabaseEntry 2 }
+
+pgsqlPgDatabaseDatdba                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the database, usually the user who created it"
+       ::= { pgsqlPgDatabaseEntry 3 }
+
+pgsqlPgDatabaseEncoding                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Character encoding for this database ( pg_encoding_to_char() can translate this number to the encoding name)"
+       ::= { pgsqlPgDatabaseEntry 4 }
+
+pgsqlPgDatabaseDatistemplate                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If true then this database can be used in the TEMPLATE clause of CREATE DATABASE to create a new database as a clone of this one"
+       ::= { pgsqlPgDatabaseEntry 5 }
+
+pgsqlPgDatabaseDatallowconn                    OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If false then no one can connect to this database. This is used to protect the template0 database from being altered"
+       ::= { pgsqlPgDatabaseEntry 6 }
+
+pgsqlPgDatabaseDatconnlimit                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Sets maximum number of concurrent connections that can be made to this database. -1 means no limit"
+       ::= { pgsqlPgDatabaseEntry 7 }
+
+pgsqlPgDatabaseDatlastsysoid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Last system OID in the database; useful particularly to pg_dump"
+       ::= { pgsqlPgDatabaseEntry 8 }
+
+pgsqlPgDatabaseDatfrozenxid                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "All transaction IDs before this one have been replaced with a permanent ( "
+       ::= { pgsqlPgDatabaseEntry 9 }
+
+pgsqlPgDatabaseDattablespace                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The default tablespace for the database. Within this database, all tables for which pg_class . reltablespace is zero will be stored in this tablespace; in particular, all the non-shared system catalogs will be there"
+       ::= { pgsqlPgDatabaseEntry 10 }
+
+pgsqlPgDatabaseDatconfig                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Session defaults for run-time configuration variables"
+       ::= { pgsqlPgDatabaseEntry 11 }
+
+pgsqlPgDatabaseDatacl                  OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgDatabaseEntry 12 }
+
+
+---------------------------------------
+pgsqlPgDependTable             OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgDependEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_depend records the dependency relationships between database objects. This information allows DROP commands to find which other objects must be dropped by DROP CASCADE or prevent dropping in the DROP RESTRICT case. See also pg_shdepend, which performs a similar function for dependencies involving objects that are shared across a database cluster."
+       ::= { pgsqlCatalogTables 15 }
+
+pgsqlPgDependEntry             OBJECT-TYPE
+       SYNTAX          PgsqlPgDependEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Dependancy entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgDependEntryOID }
+       ::= { pgsqlPgDependTable 1 }
+
+PgsqlPgDependEntry ::=
+       SEQUENCE {
+               pgsqlPgDependEntryOID           INTEGER,
+               pgsqlPgDependClassid            INTEGER,
+               pgsqlPgDependObjid              INTEGER,
+               pgsqlPgDependObjsubid           INTEGER,
+               pgsqlPgDependRefclassid         INTEGER,
+               pgsqlPgDependRefobjid           INTEGER,
+               pgsqlPgDependRefobjsubid                INTEGER,
+               pgsqlPgDependDeptype            char
+       }
+
+pgsqlPgDependEntryOID                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgDependEntry 1 }
+
+pgsqlPgDependClassid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog the dependent object is in"
+       ::= { pgsqlPgDependEntry 2 }
+
+pgsqlPgDependObjid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the specific dependent object"
+       ::= { pgsqlPgDependEntry 3 }
+
+pgsqlPgDependObjsubid                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For a table column, this is the column number (the objid and classid refer to the table itself). For all other object types, this column is zero"
+       ::= { pgsqlPgDependEntry 4 }
+
+pgsqlPgDependRefclassid                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog the referenced object is in"
+       ::= { pgsqlPgDependEntry 5 }
+
+pgsqlPgDependRefobjid                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the specific referenced object"
+       ::= { pgsqlPgDependEntry 6 }
+
+pgsqlPgDependRefobjsubid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For a table column, this is the column number (the refobjid and refclassid refer to the table itself). For all other object types, this column is zero"
+       ::= { pgsqlPgDependEntry 7 }
+
+pgsqlPgDependDeptype                   OBJECT-TYPE
+       SYNTAX          char
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code defining the specific semantics of this dependency relationship; see text"
+       ::= { pgsqlPgDependEntry 8 }
+
+
+---------------------------------------
+pgsqlPgDescriptionTable                OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgDescriptionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_description stores optional descriptions (comments) for each database object. Descriptions can be manipulated with the COMMENT command and viewed with psql's \d commands. Descriptions of many built-in system objects are provided in the initial contents of pg_description. See also pg_shdescription, which performs a similar function for descriptions involving objects that are shared across a database cluster."
+       ::= { pgsqlCatalogTables 16 }
+
+pgsqlPgDescriptionEntry                OBJECT-TYPE
+       SYNTAX          PgsqlPgDescriptionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Description entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgDescriptionEntryOID }
+       ::= { pgsqlPgDescriptionTable 1 }
+
+PgsqlPgDescriptionEntry ::=
+       SEQUENCE {
+               pgsqlPgDescriptionEntryOID              INTEGER,
+               pgsqlPgDescriptionObjoid                INTEGER,
+               pgsqlPgDescriptionClassoid              INTEGER,
+               pgsqlPgDescriptionObjsubid              INTEGER,
+               pgsqlPgDescriptionDescription           DisplayString
+       }
+
+pgsqlPgDescriptionEntryOID                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgDescriptionEntry 1 }
+
+pgsqlPgDescriptionObjoid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the object this description pertains to"
+       ::= { pgsqlPgDescriptionEntry 2 }
+
+pgsqlPgDescriptionClassoid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog this object appears in"
+       ::= { pgsqlPgDescriptionEntry 3 }
+
+pgsqlPgDescriptionObjsubid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For a comment on a table column, this is the column number (the objoid and classoid refer to the table itself). For all other object types, this column is zero"
+       ::= { pgsqlPgDescriptionEntry 4 }
+
+pgsqlPgDescriptionDescription                  OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Arbitrary text that serves as the description of this object"
+       ::= { pgsqlPgDescriptionEntry 5 }
+
+
+---------------------------------------
+pgsqlPgEnumTable               OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgEnumEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_enum catalog contains entries matching enum types to their associated values and labels. The internal representation of a given enum value is actually the OID of its associated row in pg_enum. The OIDs for a particular enum type are guaranteed to be ordered in the way the type should sort, but there is no guarantee about the ordering of OIDs of unrelated enum types."
+       ::= { pgsqlCatalogTables 34 }
+
+pgsqlPgEnumEntry               OBJECT-TYPE
+       SYNTAX          PgsqlPgEnumEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_enum entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgEnumEntryOID }
+       ::= { pgsqlPgEnumTable 1 }
+
+PgsqlPgEnumEntry ::=
+       SEQUENCE {
+               pgsqlPgEnumEntryOID             INTEGER,
+               pgsqlPgEnumEnumtypid            INTEGER,
+               pgsqlPgEnumEnumlabel            DisplayString
+       }
+
+pgsqlPgEnumEntryOID                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgEnumEntry 1 }
+
+pgsqlPgEnumEnumtypid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the pg_type entry owning this enum value"
+       ::= { pgsqlPgEnumEntry 2 }
+
+pgsqlPgEnumEnumlabel                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The textual label for this enum value"
+       ::= { pgsqlPgEnumEntry 3 }
+
+
+---------------------------------------
+pgsqlPgIndexTable              OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgIndexEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_index contains part of the information about indexes. The rest is mostly in pg_class."
+       ::= { pgsqlCatalogTables 17 }
+
+pgsqlPgIndexEntry              OBJECT-TYPE
+       SYNTAX          PgsqlPgIndexEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single index"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgIndexEntryOID }
+       ::= { pgsqlPgIndexTable 1 }
+
+PgsqlPgIndexEntry ::=
+       SEQUENCE {
+               pgsqlPgIndexEntryOID            INTEGER,
+               pgsqlPgIndexIndexrelid          INTEGER,
+               pgsqlPgIndexIndrelid            INTEGER,
+               pgsqlPgIndexIndnatts            INTEGER,
+               pgsqlPgIndexIndisunique         TruthValue,
+               pgsqlPgIndexIndisprimary                TruthValue,
+               pgsqlPgIndexIndisclustered              TruthValue,
+               pgsqlPgIndexIndisvalid          TruthValue,
+               pgsqlPgIndexIndkey              DisplayString,
+               pgsqlPgIndexIndclass            DisplayString,
+               pgsqlPgIndexIndexprs            DisplayString,
+               pgsqlPgIndexIndpred             DisplayString
+       }
+
+pgsqlPgIndexEntryOID                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgIndexEntry 1 }
+
+pgsqlPgIndexIndexrelid                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the pg_class entry for this index"
+       ::= { pgsqlPgIndexEntry 2 }
+
+pgsqlPgIndexIndrelid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the pg_class entry for the table this index is for"
+       ::= { pgsqlPgIndexEntry 3 }
+
+pgsqlPgIndexIndnatts                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of columns in the index (duplicates pg_class.relnatts )"
+       ::= { pgsqlPgIndexEntry 4 }
+
+pgsqlPgIndexIndisunique                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If true, this is a unique index"
+       ::= { pgsqlPgIndexEntry 5 }
+
+pgsqlPgIndexIndisprimary                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If true, this index represents the primary key of the table. ( indisunique should always be true when this is true.)"
+       ::= { pgsqlPgIndexEntry 6 }
+
+pgsqlPgIndexIndisclustered                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If true, the table was last clustered on this index"
+       ::= { pgsqlPgIndexEntry 7 }
+
+pgsqlPgIndexIndisvalid                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If true, the index is currently valid for queries. False means the index is possibly incomplete: it must still be modified by INSERT / UPDATE operations, but it cannot safely be used for queries. If it is unique, the uniqueness property is not true either"
+       ::= { pgsqlPgIndexEntry 8 }
+
+pgsqlPgIndexIndkey                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This is an array of indnatts values that indicate which table columns this index indexes. For example a value of 1 3 would mean that the first and the third table columns make up the index key. A zero in this array indicates that the corresponding index attribute is an expression over the table columns, rather than a simple column reference."
+       ::= { pgsqlPgIndexEntry 9 }
+
+pgsqlPgIndexIndclass                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For each column in the index key this contains the OID of the operator class to use. See pg_opclass for details"
+       ::= { pgsqlPgIndexEntry 10 }
+
+pgsqlPgIndexIndexprs                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Expression trees (in nodeToString() representation) for index attributes that are not simple column references. This is a list with one element for each zero entry in indkey . NULL if all index attributes are simple references"
+       ::= { pgsqlPgIndexEntry 11 }
+
+pgsqlPgIndexIndpred                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Expression tree (in nodeToString() representation) for partial index predicate. NULL if not a partial index"
+       ::= { pgsqlPgIndexEntry 12 }
+
+
+---------------------------------------
+pgsqlPgInheritsTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgInheritsEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_inherits records information about table inheritance hierarchies. There is one entry for each direct child table in the database. (Indirect inheritance can be determined by following chains of entries.)"
+       ::= { pgsqlCatalogTables 18 }
+
+pgsqlPgInheritsEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgInheritsEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents an inheritance relationship"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgInheritsEntryOID }
+       ::= { pgsqlPgInheritsTable 1 }
+
+PgsqlPgInheritsEntry ::=
+       SEQUENCE {
+               pgsqlPgInheritsEntryOID         INTEGER,
+               pgsqlPgInheritsInhrelid         INTEGER,
+               pgsqlPgInheritsInhparent                INTEGER,
+               pgsqlPgInheritsInhseqno         INTEGER
+       }
+
+pgsqlPgInheritsEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgInheritsEntry 1 }
+
+pgsqlPgInheritsInhrelid                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the child table"
+       ::= { pgsqlPgInheritsEntry 2 }
+
+pgsqlPgInheritsInhparent                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the parent table"
+       ::= { pgsqlPgInheritsEntry 3 }
+
+pgsqlPgInheritsInhseqno                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If there is more than one direct parent for a child table (multiple inheritance), this number tells the order in which the inherited columns are to be arranged. The count starts at 1"
+       ::= { pgsqlPgInheritsEntry 4 }
+
+
+---------------------------------------
+pgsqlPgLanguageTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgLanguageEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_language registers languages in which you can write functions or stored procedures."
+       ::= { pgsqlCatalogTables 19 }
+
+pgsqlPgLanguageEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgLanguageEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single language"
+       INDEX  { entryID, rdbmsDbIndex, pgsqlPgLanguageEntryOID }
+       ::= { pgsqlPgLanguageTable 1 }
+
+PgsqlPgLanguageEntry ::=
+       SEQUENCE {
+               pgsqlPgLanguageEntryOID         INTEGER,
+               pgsqlPgLanguageLanname          DisplayString,
+               pgsqlPgLanguageLanispl          TruthValue,
+               pgsqlPgLanguageLanpltrusted             TruthValue,
+               pgsqlPgLanguageLanplcallfoid            INTEGER,
+               pgsqlPgLanguageLanvalidator             INTEGER,
+               pgsqlPgLanguageLanacl           DisplayString
+       }
+
+pgsqlPgLanguageEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgLanguageEntry 1 }
+
+pgsqlPgLanguageLanname                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the language"
+       ::= { pgsqlPgLanguageEntry 2 }
+
+pgsqlPgLanguageLanispl                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This is false for internal languages (such as SQL ) and true for user-defined languages. Currently, pg_dump still uses this to determine which languages need to be dumped, but this may be replaced by a different mechanism in the future"
+       ::= { pgsqlPgLanguageEntry 3 }
+
+pgsqlPgLanguageLanpltrusted                    OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if this is a trusted language, which means that it is believed not to grant access to anything outside the normal SQL execution environment. Only superusers may create functions in untrusted languages"
+       ::= { pgsqlPgLanguageEntry 4 }
+
+pgsqlPgLanguageLanplcallfoid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For noninternal languages this references the language handler, which is a special function that is responsible for executing all functions that are written in the particular language"
+       ::= { pgsqlPgLanguageEntry 5 }
+
+pgsqlPgLanguageLanvalidator                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This references a language validator function that is responsible for checking the syntax and validity of new functions when they are created. Zero if no validator is provided"
+       ::= { pgsqlPgLanguageEntry 6 }
+
+pgsqlPgLanguageLanacl                  OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgLanguageEntry 7 }
+
+
+---------------------------------------
+-- The 'data' column from pg_largeobject is not included here, because SNMP would only allow 255 or so bytes to be returned anyway, and that seems fairly useless
+pgsqlPgLargeobjectTable                OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgLargeobjectEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_largeobject holds the data making up 'large objects'. A large object is identified by an OID assigned when it is created. Each large object is broken into segments or 'pages' small enough to be conveniently stored as rows in pg_largeobject. The amount of data per page is defined to be LOBLKSIZE (which is currently BLCKSZ/4, or typically 2 kB)."
+       ::= { pgsqlCatalogTables 20 }
+
+pgsqlPgLargeobjectEntry                OBJECT-TYPE
+       SYNTAX          PgsqlPgLargeobjectEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a page from a large object"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgLargeobjectEntryOID }
+       ::= { pgsqlPgLargeobjectTable 1 }
+
+PgsqlPgLargeobjectEntry ::=
+       SEQUENCE {
+               pgsqlPgLargeobjectEntryOID              INTEGER,
+               pgsqlPgLargeobjectLoid          INTEGER,
+               pgsqlPgLargeobjectPageno                INTEGER
+       }
+
+pgsqlPgLargeobjectEntryOID                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgLargeobjectEntry 1 }
+
+pgsqlPgLargeobjectLoid                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Identifier of the large object that includes this page"
+       ::= { pgsqlPgLargeobjectEntry 2 }
+
+pgsqlPgLargeobjectPageno                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Page number of this page within its large object (counting from zero)"
+       ::= { pgsqlPgLargeobjectEntry 3 }
+
+
+---------------------------------------
+pgsqlPgListenerTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgListenerEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_listener supports the LISTEN and NOTIFY commands. A listener creates an entry in pg_listener for each notification name it is listening for. A notifier scans pg_listener and updates each matching entry to show that a notification has occurred. The notifier also sends a signal (using the PID recorded in the table) to awaken the listener from sleep."
+       ::= { pgsqlCatalogTables 21 }
+
+pgsqlPgListenerEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgListenerEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single listener"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgListenerEntryOID }
+       ::= { pgsqlPgListenerTable 1 }
+
+PgsqlPgListenerEntry ::=
+       SEQUENCE {
+               pgsqlPgListenerEntryOID         INTEGER,
+               pgsqlPgListenerRelname          DisplayString,
+               pgsqlPgListenerListenerpid              INTEGER,
+               pgsqlPgListenerNotification             INTEGER
+       }
+
+pgsqlPgListenerEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgListenerEntry 1 }
+
+pgsqlPgListenerRelname                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Notify condition name. (The name need not match any actual relation in the database; the name relname is historical.)"
+       ::= { pgsqlPgListenerEntry 2 }
+
+pgsqlPgListenerListenerpid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "PID of the server process that created this entry"
+       ::= { pgsqlPgListenerEntry 3 }
+
+pgsqlPgListenerNotification                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Zero if no event is pending for this listener. If an event is pending, the PID of the server process that sent the notification."
+       ::= { pgsqlPgListenerEntry 4 }
+
+
+---------------------------------------
+pgsqlPgNamespaceTable          OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgNamespaceEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_namespace stores namespaces. A namespace is the structure underlying SQL schemas: each namespace can have a separate collection of relations, types, etc. without name conflicts."
+       ::= { pgsqlCatalogTables 22 }
+
+pgsqlPgNamespaceEntry          OBJECT-TYPE
+       SYNTAX          PgsqlPgNamespaceEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single namespace"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgNamespaceEntryOID }
+       ::= { pgsqlPgNamespaceTable 1 }
+
+PgsqlPgNamespaceEntry ::=
+       SEQUENCE {
+               pgsqlPgNamespaceEntryOID                INTEGER,
+               pgsqlPgNamespaceNspname         DisplayString,
+               pgsqlPgNamespaceNspowner                INTEGER,
+               pgsqlPgNamespaceNspacl          DisplayString
+       }
+
+pgsqlPgNamespaceEntryOID                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgNamespaceEntry 1 }
+
+pgsqlPgNamespaceNspname                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the namespace"
+       ::= { pgsqlPgNamespaceEntry 2 }
+
+pgsqlPgNamespaceNspowner                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the namespace"
+       ::= { pgsqlPgNamespaceEntry 3 }
+
+pgsqlPgNamespaceNspacl                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgNamespaceEntry 4 }
+
+
+---------------------------------------
+pgsqlPgOpclassTable            OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgOpclassEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_opclass defines index access method operator classes. Each operator class defines semantics for index columns of a particular data type and a particular index access method. Note that there can be multiple operator classes for a given data type/access method combination, thus supporting multiple behaviors."
+       ::= { pgsqlCatalogTables 23 }
+
+pgsqlPgOpclassEntry            OBJECT-TYPE
+       SYNTAX          PgsqlPgOpclassEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents an index access method operator class"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgOpclassEntryOID }
+       ::= { pgsqlPgOpclassTable 1 }
+
+PgsqlPgOpclassEntry ::=
+       SEQUENCE {
+               pgsqlPgOpclassEntryOID          INTEGER,
+               pgsqlPgOpclassOpcamid           INTEGER,
+               pgsqlPgOpclassOpcname           DisplayString,
+               pgsqlPgOpclassOpcnamespace              INTEGER,
+               pgsqlPgOpclassOpcowner          INTEGER,
+               pgsqlPgOpclassOpcintype         INTEGER,
+               pgsqlPgOpclassOpcdefault                TruthValue,
+               pgsqlPgOpclassOpckeytype                INTEGER
+       }
+
+pgsqlPgOpclassEntryOID                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgOpclassEntry 1 }
+
+pgsqlPgOpclassOpcamid                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Index access method operator class is for"
+       ::= { pgsqlPgOpclassEntry 2 }
+
+pgsqlPgOpclassOpcname                  OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of this operator class"
+       ::= { pgsqlPgOpclassEntry 3 }
+
+pgsqlPgOpclassOpcnamespace                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Namespace of this operator class"
+       ::= { pgsqlPgOpclassEntry 4 }
+
+pgsqlPgOpclassOpcowner                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the operator class"
+       ::= { pgsqlPgOpclassEntry 5 }
+
+pgsqlPgOpclassOpcintype                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Data type that the operator class indexes"
+       ::= { pgsqlPgOpclassEntry 6 }
+
+pgsqlPgOpclassOpcdefault                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if this operator class is the default for opcintype"
+       ::= { pgsqlPgOpclassEntry 7 }
+
+pgsqlPgOpclassOpckeytype                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Type of data stored in index, or zero if same as opcintype"
+       ::= { pgsqlPgOpclassEntry 8 }
+
+
+---------------------------------------
+pgsqlPgOperatorTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgOperatorEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_operator stores information about operators."
+       ::= { pgsqlCatalogTables 24 }
+
+pgsqlPgOperatorEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgOperatorEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single operator"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgOperatorEntryOID }
+       ::= { pgsqlPgOperatorTable 1 }
+
+PgsqlPgOperatorEntry ::=
+       SEQUENCE {
+               pgsqlPgOperatorEntryOID         INTEGER,
+               pgsqlPgOperatorOprname          DisplayString,
+               pgsqlPgOperatorOprnamespace             INTEGER,
+               pgsqlPgOperatorOprowner         INTEGER,
+               pgsqlPgOperatorOprkind          DisplayString,
+               pgsqlPgOperatorOprcanhash               TruthValue,
+               pgsqlPgOperatorOprleft          INTEGER,
+               pgsqlPgOperatorOprright         INTEGER,
+               pgsqlPgOperatorOprresult                INTEGER,
+               pgsqlPgOperatorOprcom           INTEGER,
+               pgsqlPgOperatorOprnegate                INTEGER,
+               pgsqlPgOperatorOprlsortop               INTEGER,
+               pgsqlPgOperatorOprrsortop               INTEGER,
+               pgsqlPgOperatorOprltcmpop               INTEGER,
+               pgsqlPgOperatorOprgtcmpop               INTEGER,
+               pgsqlPgOperatorOprcode          INTEGER,
+               pgsqlPgOperatorOprrest          INTEGER,
+               pgsqlPgOperatorOprjoin          INTEGER
+       }
+
+pgsqlPgOperatorEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgOperatorEntry 1 }
+
+pgsqlPgOperatorOprname                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the operator"
+       ::= { pgsqlPgOperatorEntry 2 }
+
+pgsqlPgOperatorOprnamespace                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this operator"
+       ::= { pgsqlPgOperatorEntry 3 }
+
+pgsqlPgOperatorOprowner                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the operator"
+       ::= { pgsqlPgOperatorEntry 4 }
+
+pgsqlPgOperatorOprkind                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "b = infix ( "
+       ::= { pgsqlPgOperatorEntry 5 }
+
+pgsqlPgOperatorOprcanhash                      OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This operator supports hash joins"
+       ::= { pgsqlPgOperatorEntry 6 }
+
+pgsqlPgOperatorOprleft                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Type of the left operand"
+       ::= { pgsqlPgOperatorEntry 7 }
+
+pgsqlPgOperatorOprright                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Type of the right operand"
+       ::= { pgsqlPgOperatorEntry 8 }
+
+pgsqlPgOperatorOprresult                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Type of the result"
+       ::= { pgsqlPgOperatorEntry 9 }
+
+pgsqlPgOperatorOprcom                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Commutator of this operator, if any"
+       ::= { pgsqlPgOperatorEntry 10 }
+
+pgsqlPgOperatorOprnegate                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Negator of this operator, if any"
+       ::= { pgsqlPgOperatorEntry 11 }
+
+pgsqlPgOperatorOprlsortop                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this operator supports merge joins, the operator that sorts the type of the left-hand operand ( L<L )"
+       ::= { pgsqlPgOperatorEntry 12 }
+
+pgsqlPgOperatorOprrsortop                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this operator supports merge joins, the operator that sorts the type of the right-hand operand ( R<R )"
+       ::= { pgsqlPgOperatorEntry 13 }
+
+pgsqlPgOperatorOprltcmpop                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this operator supports merge joins, the less-than operator that compares the left and right operand types ( L<R )"
+       ::= { pgsqlPgOperatorEntry 14 }
+
+pgsqlPgOperatorOprgtcmpop                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this operator supports merge joins, the greater-than operator that compares the left and right operand types ( L>R )"
+       ::= { pgsqlPgOperatorEntry 15 }
+
+pgsqlPgOperatorOprcode                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function that implements this operator"
+       ::= { pgsqlPgOperatorEntry 16 }
+
+pgsqlPgOperatorOprrest                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Restriction selectivity estimation function for this operator"
+       ::= { pgsqlPgOperatorEntry 17 }
+
+pgsqlPgOperatorOprjoin                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Join selectivity estimation function for this operator"
+       ::= { pgsqlPgOperatorEntry 18 }
+
+
+---------------------------------------
+pgsqlPgOpfamilyTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgOpfamilyEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_opfamily defines operator families. Each operator family is a collection of operators and associated support routines that implement the semantics specified for a particular index access method. Furthermore, the operators in a family are all 'compatible', in a way that is specified by the access method. The operator family concept allows cross-data-type operators to be used with indexes and to be reasoned about using knowledge of access method semantics."
+       ::= { pgsqlCatalogTables 35 }
+
+pgsqlPgOpfamilyEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgOpfamilyEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_opfamily entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgOpfamilyEntryOID }
+       ::= { pgsqlPgOpfamilyTable 1 }
+
+PgsqlPgOpfamilyEntry ::=
+       SEQUENCE {
+               pgsqlPgOpfamilyEntryOID         INTEGER,
+               pgsqlPgOpfamilyOpfmethod                INTEGER,
+               pgsqlPgOpfamilyOpfname          DisplayString,
+               pgsqlPgOpfamilyOpfnamespace             INTEGER,
+               pgsqlPgOpfamilyOpfowner         INTEGER
+       }
+
+pgsqlPgOpfamilyEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgOpfamilyEntry 1 }
+
+pgsqlPgOpfamilyOpfmethod                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Index access method operator family is for"
+       ::= { pgsqlPgOpfamilyEntry 2 }
+
+pgsqlPgOpfamilyOpfname                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of this operator family"
+       ::= { pgsqlPgOpfamilyEntry 3 }
+
+pgsqlPgOpfamilyOpfnamespace                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Namespace of this operator family"
+       ::= { pgsqlPgOpfamilyEntry 4 }
+
+pgsqlPgOpfamilyOpfowner                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the operator family"
+       ::= { pgsqlPgOpfamilyEntry 5 }
+
+
+---------------------------------------
+pgsqlPgPltemplateTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgPltemplateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_pltemplate stores 'template' information for procedural languages. A template for a language allows the language to be created in a particular database by a simple CREATE LANGUAGE command, with no need to specify implementation details. Unlike most system catalogs, pg_pltemplate is shared across all databases of a cluster: there is only one copy of pg_pltemplate per cluster, not one per database. This allows the information to be accessible in each database as it is needed."
+       ::= { pgsqlCatalogTables 25 }
+
+pgsqlPgPltemplateEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgPltemplateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a procedural language template"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgPltemplateEntryOID }
+       ::= { pgsqlPgPltemplateTable 1 }
+
+PgsqlPgPltemplateEntry ::=
+       SEQUENCE {
+               pgsqlPgPltemplateEntryOID               INTEGER,
+               pgsqlPgPltemplateTmplname               DisplayString,
+               pgsqlPgPltemplateTmpltrusted            TruthValue,
+               pgsqlPgPltemplateTmplhandler            DisplayString,
+               pgsqlPgPltemplateTmplvalidator          DisplayString,
+               pgsqlPgPltemplateTmpllibrary            DisplayString,
+               pgsqlPgPltemplateTmplacl                DisplayString
+       }
+
+pgsqlPgPltemplateEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgPltemplateEntry 1 }
+
+pgsqlPgPltemplateTmplname                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the language this template is for"
+       ::= { pgsqlPgPltemplateEntry 2 }
+
+pgsqlPgPltemplateTmpltrusted                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if language is considered trusted"
+       ::= { pgsqlPgPltemplateEntry 3 }
+
+pgsqlPgPltemplateTmplhandler                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of call handler function"
+       ::= { pgsqlPgPltemplateEntry 4 }
+
+pgsqlPgPltemplateTmplvalidator                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of validator function, or NULL if none"
+       ::= { pgsqlPgPltemplateEntry 5 }
+
+pgsqlPgPltemplateTmpllibrary                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Path of shared library that implements language"
+       ::= { pgsqlPgPltemplateEntry 6 }
+
+pgsqlPgPltemplateTmplacl                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges for template (not yet used)"
+       ::= { pgsqlPgPltemplateEntry 7 }
+
+
+---------------------------------------
+pgsqlPgProcTable               OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgProcEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_proc stores information about functions (or procedures). The table contains data for aggregate functions as well as plain functions. If proisagg is true, there should be a matching row in pg_aggregate."
+       ::= { pgsqlCatalogTables 26 }
+
+pgsqlPgProcEntry               OBJECT-TYPE
+       SYNTAX          PgsqlPgProcEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single stored procedure"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgProcEntryOID }
+       ::= { pgsqlPgProcTable 1 }
+
+PgsqlPgProcEntry ::=
+       SEQUENCE {
+               pgsqlPgProcEntryOID             INTEGER,
+               pgsqlPgProcProname              DisplayString,
+               pgsqlPgProcPronamespace         INTEGER,
+               pgsqlPgProcProowner             INTEGER,
+               pgsqlPgProcProlang              INTEGER,
+               pgsqlPgProcProisagg             TruthValue,
+               pgsqlPgProcProsecdef            TruthValue,
+               pgsqlPgProcProisstrict          TruthValue,
+               pgsqlPgProcProretset            TruthValue,
+               pgsqlPgProcProvolatile          DisplayString,
+               pgsqlPgProcPronargs             INTEGER,
+               pgsqlPgProcProrettype           INTEGER,
+               pgsqlPgProcProargtypes          DisplayString,
+               pgsqlPgProcProallargtypes               DisplayString,
+               pgsqlPgProcProargmodes          DisplayString,
+               pgsqlPgProcProargnames          DisplayString,
+               pgsqlPgProcProsrc               DisplayString,
+               pgsqlPgProcProbin               DisplayString,
+               pgsqlPgProcProacl               DisplayString
+       }
+
+pgsqlPgProcEntryOID                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgProcEntry 1 }
+
+pgsqlPgProcProname                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the function"
+       ::= { pgsqlPgProcEntry 2 }
+
+pgsqlPgProcPronamespace                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this function"
+       ::= { pgsqlPgProcEntry 3 }
+
+pgsqlPgProcProowner                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the function"
+       ::= { pgsqlPgProcEntry 4 }
+
+pgsqlPgProcProlang                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Implementation language or call interface of this function"
+       ::= { pgsqlPgProcEntry 5 }
+
+pgsqlPgProcProisagg                    OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function is an aggregate function"
+       ::= { pgsqlPgProcEntry 6 }
+
+pgsqlPgProcProsecdef                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function is a security definer (i.e., a "
+       ::= { pgsqlPgProcEntry 7 }
+
+pgsqlPgProcProisstrict                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function returns null if any call argument is null. In that case the function won't actually be called at all. Functions that are not "
+       ::= { pgsqlPgProcEntry 8 }
+
+pgsqlPgProcProretset                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function returns a set (i.e., multiple values of the specified data type)"
+       ::= { pgsqlPgProcEntry 9 }
+
+pgsqlPgProcProvolatile                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "provolatile tells whether the function's result depends only on its input arguments, or is affected by outside factors. It is i for "
+       ::= { pgsqlPgProcEntry 10 }
+
+pgsqlPgProcPronargs                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of arguments"
+       ::= { pgsqlPgProcEntry 11 }
+
+pgsqlPgProcProrettype                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Data type of the return value"
+       ::= { pgsqlPgProcEntry 12 }
+
+pgsqlPgProcProargtypes                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An array with the data types of the function arguments. This includes only input arguments (including INOUT arguments), and thus represents the call signature of the function"
+       ::= { pgsqlPgProcEntry 13 }
+
+pgsqlPgProcProallargtypes                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An array with the data types of the function arguments. This includes all arguments (including OUT and INOUT arguments); however, if all the arguments are IN arguments, this field will be null. Note that subscripting is 1-based, whereas for historical reasons proargtypes is subscripted from 0"
+       ::= { pgsqlPgProcEntry 14 }
+
+pgsqlPgProcProargmodes                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An array with the modes of the function arguments, encoded as i for IN arguments, o for OUT arguments, b for INOUT arguments. If all the arguments are IN arguments, this field will be null. Note that subscripts correspond to positions of proallargtypes not proargtypes"
+       ::= { pgsqlPgProcEntry 15 }
+
+pgsqlPgProcProargnames                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An array with the names of the function arguments. Arguments without a name are set to empty strings in the array. If none of the arguments have a name, this field will be null. Note that subscripts correspond to positions of proallargtypes not proargtypes"
+       ::= { pgsqlPgProcEntry 16 }
+
+pgsqlPgProcProsrc                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This tells the function handler how to invoke the function. It might be the actual source code of the function for interpreted languages, a link symbol, a file name, or just about anything else, depending on the implementation language/call convention"
+       ::= { pgsqlPgProcEntry 17 }
+
+pgsqlPgProcProbin                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Additional information about how to invoke the function. Again, the interpretation is language-specific"
+       ::= { pgsqlPgProcEntry 18 }
+
+pgsqlPgProcProacl                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgProcEntry 19 }
+
+
+---------------------------------------
+pgsqlPgRewriteTable            OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgRewriteEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_rewrite stores rewrite rules for tables and views."
+       ::= { pgsqlCatalogTables 27 }
+
+pgsqlPgRewriteEntry            OBJECT-TYPE
+       SYNTAX          PgsqlPgRewriteEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single rewrite rule"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgRewriteEntryOID }
+       ::= { pgsqlPgRewriteTable 1 }
+
+PgsqlPgRewriteEntry ::=
+       SEQUENCE {
+               pgsqlPgRewriteEntryOID          INTEGER,
+               pgsqlPgRewriteRulename          DisplayString,
+               pgsqlPgRewriteEvClass           INTEGER,
+               pgsqlPgRewriteEvAttr            INTEGER,
+               pgsqlPgRewriteEvType            DisplayString,
+               pgsqlPgRewriteIsInstead         TruthValue,
+               pgsqlPgRewriteEvQual            DisplayString,
+               pgsqlPgRewriteEvAction          DisplayString
+       }
+
+pgsqlPgRewriteEntryOID                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgRewriteEntry 1 }
+
+pgsqlPgRewriteRulename                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Rule name"
+       ::= { pgsqlPgRewriteEntry 2 }
+
+pgsqlPgRewriteEvClass                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this rule is for"
+       ::= { pgsqlPgRewriteEntry 3 }
+
+pgsqlPgRewriteEvAttr                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The column this rule is for (currently, always zero to indicate the whole table)"
+       ::= { pgsqlPgRewriteEntry 4 }
+
+pgsqlPgRewriteEvType                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Event type that the rule is for: 1 = SELECT , 2 = UPDATE , 3 = INSERT , 4 = DELETE"
+       ::= { pgsqlPgRewriteEntry 5 }
+
+pgsqlPgRewriteIsInstead                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if the rule is an INSTEAD rule"
+       ::= { pgsqlPgRewriteEntry 6 }
+
+pgsqlPgRewriteEvQual                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Expression tree (in the form of a nodeToString() representation) for the rule's qualifying condition"
+       ::= { pgsqlPgRewriteEntry 7 }
+
+pgsqlPgRewriteEvAction                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Query tree (in the form of a nodeToString() representation) for the rule's action"
+       ::= { pgsqlPgRewriteEntry 8 }
+
+
+---------------------------------------
+pgsqlPgShdependTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgShdependEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_shdepend records the dependency relationships between database objects and shared objects, such as roles. This information allows PostgreSQL to ensure that those objects are unreferenced before attempting to delete them. See also pg_depend, which performs a similar function for dependencies involving objects within a single database. Unlike most system catalogs, pg_shdepend is shared across all databases of a cluster: there is only one copy of pg_shdepend per cluster, not one per database."
+       ::= { pgsqlCatalogTables 28 }
+
+pgsqlPgShdependEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgShdependEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single shared-object dependency"
+       INDEX  { pgsnmpdConnID, pgsqlPgShdependEntryOID }
+       ::= { pgsqlPgShdependTable 1 }
+
+PgsqlPgShdependEntry ::=
+       SEQUENCE {
+               pgsqlPgShdependEntryOID         INTEGER,
+               pgsqlPgShdependDbid             INTEGER,
+               pgsqlPgShdependClassid          INTEGER,
+               pgsqlPgShdependObjid            INTEGER,
+               pgsqlPgShdependRefclassid               INTEGER,
+               pgsqlPgShdependRefobjid         INTEGER,
+               pgsqlPgShdependDeptype          DisplayString
+       }
+
+pgsqlPgShdependEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgShdependEntry 1 }
+
+pgsqlPgShdependDbid                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the database the dependent object is in, or zero for a shared object"
+       ::= { pgsqlPgShdependEntry 2 }
+
+pgsqlPgShdependClassid                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog the dependent object is in"
+       ::= { pgsqlPgShdependEntry 3 }
+
+pgsqlPgShdependObjid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the specific dependent object"
+       ::= { pgsqlPgShdependEntry 4 }
+
+pgsqlPgShdependRefclassid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog the referenced object is in (must be a shared catalog)"
+       ::= { pgsqlPgShdependEntry 5 }
+
+pgsqlPgShdependRefobjid                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the specific referenced object"
+       ::= { pgsqlPgShdependEntry 6 }
+
+pgsqlPgShdependDeptype                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code defining the specific semantics of this dependency relationship; see text"
+       ::= { pgsqlPgShdependEntry 7 }
+
+
+---------------------------------------
+pgsqlPgShdescriptionTable              OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgShdescriptionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_shdescription stores optional descriptions (comments) for shared database objects. Descriptions can be manipulated with the COMMENT command and viewed with psql's \d commands. See also pg_description, which performs a similar function for descriptions involving objects within a single database. Unlike most system catalogs, pg_shdescription is shared across all databases of a cluster: there is only one copy of pg_shdescription per cluster, not one per database."
+       ::= { pgsqlCatalogTables 29 }
+
+pgsqlPgShdescriptionEntry              OBJECT-TYPE
+       SYNTAX          PgsqlPgShdescriptionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single shared object description"
+       INDEX  { pgsnmpdConnID, pgsqlPgShdescriptionEntryOID }
+       ::= { pgsqlPgShdescriptionTable 1 }
+
+PgsqlPgShdescriptionEntry ::=
+       SEQUENCE {
+               pgsqlPgShdescriptionEntryOID            INTEGER,
+               pgsqlPgShdescriptionObjoid              INTEGER,
+               pgsqlPgShdescriptionClassoid            INTEGER,
+               pgsqlPgShdescriptionDescription         DisplayString
+       }
+
+pgsqlPgShdescriptionEntryOID                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgShdescriptionEntry 1 }
+
+pgsqlPgShdescriptionObjoid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the object this description pertains to"
+       ::= { pgsqlPgShdescriptionEntry 2 }
+
+pgsqlPgShdescriptionClassoid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog this object appears in"
+       ::= { pgsqlPgShdescriptionEntry 3 }
+
+pgsqlPgShdescriptionDescription                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Arbitrary text that serves as the description of this object"
+       ::= { pgsqlPgShdescriptionEntry 4 }
+
+
+---------------------------------------
+pgsqlPgStatisticTable          OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgStatisticEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_statistic stores statistical data about the contents of the database. Entries are created by ANALYZE and subsequently used by the query planner. There is one entry for each table column that has been analyzed. Note that all the statistical data is inherently approximate, even assuming that it is up-to-date. pg_statistic also stores statistical data about the values of index expressions. These are described as if they were actual data columns; in particular, starelid references the index. No entry is made for an ordinary non-expression index column, however, since it would be redundant with the entry for the underlying table column. Since different kinds of statistics may be appropriate for different kinds of data, pg_statistic is designed not to assume very much about what sort of statistics it stores. Only extremely general statistics (such as nullness) are given dedicated columns in pg_statistic. Everything else is stored in 'slots', which are groups of associated columns whose content is identified by a code number in one of the slot's columns. For more information see src/include/catalog/pg_statistic.h. pg_statistic should not be readable by the public, since even statistical information about a table's contents may be considered sensitive. (Example: minimum and maximum values of a salary column might be quite interesting.) pg_stats is a publicly readable view on pg_statistic that only exposes information about those tables that are readable by the current user."
+       ::= { pgsqlCatalogTables 30 }
+
+pgsqlPgStatisticEntry          OBJECT-TYPE
+       SYNTAX          PgsqlPgStatisticEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents statistics data for a single column"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgStatisticEntryOID }
+       ::= { pgsqlPgStatisticTable 1 }
+
+PgsqlPgStatisticEntry ::=
+       SEQUENCE {
+               pgsqlPgStatisticEntryOID                INTEGER,
+               pgsqlPgStatisticStarelid                INTEGER,
+               pgsqlPgStatisticStaattnum               INTEGER,
+               pgsqlPgStatisticStanullfrac             Float,
+               pgsqlPgStatisticStawidth                INTEGER,
+               pgsqlPgStatisticStadistinct             Float,
+               pgsqlPgStatisticStakind1                INTEGER,
+               pgsqlPgStatisticStakind2                INTEGER,
+               pgsqlPgStatisticStakind3                INTEGER,
+               pgsqlPgStatisticStakind4                INTEGER,
+               pgsqlPgStatisticStaop1          INTEGER,
+               pgsqlPgStatisticStaop2          INTEGER,
+               pgsqlPgStatisticStaop3          INTEGER,
+               pgsqlPgStatisticStaop4          INTEGER,
+               pgsqlPgStatisticStanumbers1             DisplayString,
+               pgsqlPgStatisticStanumbers2             DisplayString,
+               pgsqlPgStatisticStanumbers3             DisplayString,
+               pgsqlPgStatisticStanumbers4             DisplayString,
+               pgsqlPgStatisticStavalues1              DisplayString,
+               pgsqlPgStatisticStavalues2              DisplayString,
+               pgsqlPgStatisticStavalues3              DisplayString,
+               pgsqlPgStatisticStavalues4              DisplayString
+       }
+
+pgsqlPgStatisticEntryOID                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgStatisticEntry 1 }
+
+pgsqlPgStatisticStarelid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table or index that the described column belongs to"
+       ::= { pgsqlPgStatisticEntry 2 }
+
+pgsqlPgStatisticStaattnum                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of the described column"
+       ::= { pgsqlPgStatisticEntry 3 }
+
+pgsqlPgStatisticStanullfrac                    OBJECT-TYPE
+       SYNTAX          Float
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The fraction of the column's entries that are null"
+       ::= { pgsqlPgStatisticEntry 4 }
+
+pgsqlPgStatisticStawidth                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The average stored width, in bytes, of nonnull entries"
+       ::= { pgsqlPgStatisticEntry 5 }
+
+pgsqlPgStatisticStadistinct                    OBJECT-TYPE
+       SYNTAX          Float
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of distinct nonnull data values in the column. A value greater than zero is the actual number of distinct values. A value less than zero is the negative of a fraction of the number of rows in the table (for example, a column in which values appear about twice on the average could be represented by stadistinct = -0.5). A zero value means the number of distinct values is unknown"
+       ::= { pgsqlPgStatisticEntry 6 }
+
+pgsqlPgStatisticStakind1                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code number indicating the kind of statistics stored in the 1st 'slot' of the pg_statistic row"
+       ::= { pgsqlPgStatisticEntry 7 }
+
+pgsqlPgStatisticStakind2                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code number indicating the kind of statistics stored in the 2nd 'slot' of the pg_statistic row"
+       ::= { pgsqlPgStatisticEntry 8 }
+
+pgsqlPgStatisticStakind3                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code number indicating the kind of statistics stored in the 3rd 'slot' of the pg_statistic row"
+       ::= { pgsqlPgStatisticEntry 9 }
+
+pgsqlPgStatisticStakind4                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code number indicating the kind of statistics stored in the 4th 'slot' of the pg_statistic row"
+       ::= { pgsqlPgStatisticEntry 10 }
+
+pgsqlPgStatisticStaop1                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An operator used to derive the statistics stored in the 1st 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"
+       ::= { pgsqlPgStatisticEntry 11 }
+
+pgsqlPgStatisticStaop2                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An operator used to derive the statistics stored in the 2nd 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"
+       ::= { pgsqlPgStatisticEntry 12 }
+
+pgsqlPgStatisticStaop3                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An operator used to derive the statistics stored in the 3rd 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"
+       ::= { pgsqlPgStatisticEntry 13 }
+
+pgsqlPgStatisticStaop4                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An operator used to derive the statistics stored in the 4th 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"
+       ::= { pgsqlPgStatisticEntry 14 }
+
+pgsqlPgStatisticStanumbers1                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Numerical statistics of the appropriate kind for the 1st 'slot' , or NULL if the slot kind does not involve numerical values"
+       ::= { pgsqlPgStatisticEntry 15 }
+
+pgsqlPgStatisticStanumbers2                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Numerical statistics of the appropriate kind for the 2nd 'slot' , or NULL if the slot kind does not involve numerical values"
+       ::= { pgsqlPgStatisticEntry 16 }
+
+pgsqlPgStatisticStanumbers3                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Numerical statistics of the appropriate kind for the 3rd 'slot' , or NULL if the slot kind does not involve numerical values"
+       ::= { pgsqlPgStatisticEntry 17 }
+
+pgsqlPgStatisticStanumbers4                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Numerical statistics of the appropriate kind for the 4th 'slot' , or NULL if the slot kind does not involve numerical values"
+       ::= { pgsqlPgStatisticEntry 18 }
+
+pgsqlPgStatisticStavalues1                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Column data values of the appropriate kind for the 1st 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"
+       ::= { pgsqlPgStatisticEntry 19 }
+
+pgsqlPgStatisticStavalues2                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Column data values of the appropriate kind for the 2nd 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"
+       ::= { pgsqlPgStatisticEntry 20 }
+
+pgsqlPgStatisticStavalues3                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Column data values of the appropriate kind for the 3rd 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"
+       ::= { pgsqlPgStatisticEntry 21 }
+
+pgsqlPgStatisticStavalues4                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Column data values of the appropriate kind for the 4th 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"
+       ::= { pgsqlPgStatisticEntry 22 }
+
+
+---------------------------------------
+pgsqlPgTablespaceTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTablespaceEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_tablespace stores information about the available tablespaces. Tables can be placed in particular tablespaces to aid administration of disk layout. Unlike most system catalogs, pg_tablespace is shared across all databases of a cluster: there is only one copy of pg_tablespace per cluster, not one per database."
+       ::= { pgsqlCatalogTables 31 }
+
+pgsqlPgTablespaceEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgTablespaceEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single tablespace"
+       INDEX  { pgsnmpdConnID, pgsqlPgTablespaceEntryOID }
+       ::= { pgsqlPgTablespaceTable 1 }
+
+PgsqlPgTablespaceEntry ::=
+       SEQUENCE {
+               pgsqlPgTablespaceEntryOID               INTEGER,
+               pgsqlPgTablespaceSpcname                DisplayString,
+               pgsqlPgTablespaceSpcowner               INTEGER,
+               pgsqlPgTablespaceSpclocation            DisplayString,
+               pgsqlPgTablespaceSpcacl         DisplayString
+       }
+
+pgsqlPgTablespaceEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTablespaceEntry 1 }
+
+pgsqlPgTablespaceSpcname                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Tablespace name"
+       ::= { pgsqlPgTablespaceEntry 2 }
+
+pgsqlPgTablespaceSpcowner                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the tablespace, usually the user who created it"
+       ::= { pgsqlPgTablespaceEntry 3 }
+
+pgsqlPgTablespaceSpclocation                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Location (directory path) of the tablespace"
+       ::= { pgsqlPgTablespaceEntry 4 }
+
+pgsqlPgTablespaceSpcacl                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgTablespaceEntry 5 }
+
+
+---------------------------------------
+pgsqlPgTriggerTable            OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTriggerEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_trigger stores triggers on tables."
+       ::= { pgsqlCatalogTables 32 }
+
+pgsqlPgTriggerEntry            OBJECT-TYPE
+       SYNTAX          PgsqlPgTriggerEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single trigger"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTriggerEntryOID }
+       ::= { pgsqlPgTriggerTable 1 }
+
+PgsqlPgTriggerEntry ::=
+       SEQUENCE {
+               pgsqlPgTriggerEntryOID          INTEGER,
+               pgsqlPgTriggerTgrelid           INTEGER,
+               pgsqlPgTriggerTgname            DisplayString,
+               pgsqlPgTriggerTgfoid            INTEGER,
+               pgsqlPgTriggerTgtype            INTEGER,
+               pgsqlPgTriggerTgenabled         TruthValue,
+               pgsqlPgTriggerTgisconstraint            TruthValue,
+               pgsqlPgTriggerTgconstrname              DisplayString,
+               pgsqlPgTriggerTgconstrrelid             INTEGER,
+               pgsqlPgTriggerTgdeferrable              TruthValue,
+               pgsqlPgTriggerTginitdeferred            TruthValue,
+               pgsqlPgTriggerTgnargs           INTEGER,
+               pgsqlPgTriggerTgattr            DisplayString,
+               pgsqlPgTriggerTgargs            DisplayString
+       }
+
+pgsqlPgTriggerEntryOID                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTriggerEntry 1 }
+
+pgsqlPgTriggerTgrelid                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this trigger is on"
+       ::= { pgsqlPgTriggerEntry 2 }
+
+pgsqlPgTriggerTgname                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Trigger name (must be unique among triggers of same table)"
+       ::= { pgsqlPgTriggerEntry 3 }
+
+pgsqlPgTriggerTgfoid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The function to be called"
+       ::= { pgsqlPgTriggerEntry 4 }
+
+pgsqlPgTriggerTgtype                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Bit mask identifying trigger conditions"
+       ::= { pgsqlPgTriggerEntry 5 }
+
+pgsqlPgTriggerTgenabled                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if trigger is enabled"
+       ::= { pgsqlPgTriggerEntry 6 }
+
+pgsqlPgTriggerTgisconstraint                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if trigger implements a referential integrity constraint"
+       ::= { pgsqlPgTriggerEntry 7 }
+
+pgsqlPgTriggerTgconstrname                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Referential integrity constraint name"
+       ::= { pgsqlPgTriggerEntry 8 }
+
+pgsqlPgTriggerTgconstrrelid                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table referenced by an referential integrity constraint"
+       ::= { pgsqlPgTriggerEntry 9 }
+
+pgsqlPgTriggerTgdeferrable                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if deferrable"
+       ::= { pgsqlPgTriggerEntry 10 }
+
+pgsqlPgTriggerTginitdeferred                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if initially deferred"
+       ::= { pgsqlPgTriggerEntry 11 }
+
+pgsqlPgTriggerTgnargs                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of argument strings passed to trigger function"
+       ::= { pgsqlPgTriggerEntry 12 }
+
+pgsqlPgTriggerTgattr                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Currently unused"
+       ::= { pgsqlPgTriggerEntry 13 }
+
+pgsqlPgTriggerTgargs                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Argument strings to pass to trigger, each NULL-terminated"
+       ::= { pgsqlPgTriggerEntry 14 }
+
+
+---------------------------------------
+pgsqlPgTsConfigTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTsConfigEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_ts_config catalog contains entries representing text search configurations. A configuration specifies a particular text search parser and a list of dictionaries to use for each of the parser's output token types. The parser is shown in the pg_ts_config entry, but the token-to-dictionary mapping is defined by subsidiary entries in pg_ts_config_map."
+       ::= { pgsqlCatalogTables 36 }
+
+pgsqlPgTsConfigEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgTsConfigEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_ts_config entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTsConfigEntryOID }
+       ::= { pgsqlPgTsConfigTable 1 }
+
+PgsqlPgTsConfigEntry ::=
+       SEQUENCE {
+               pgsqlPgTsConfigEntryOID         INTEGER,
+               pgsqlPgTsConfigCfgname          DisplayString ,
+               pgsqlPgTsConfigCfgnamespace             INTEGER,
+               pgsqlPgTsConfigCfgowner         INTEGER,
+               pgsqlPgTsConfigCfgparser                INTEGER
+       }
+
+pgsqlPgTsConfigEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTsConfigEntry 1 }
+
+pgsqlPgTsConfigCfgname                 OBJECT-TYPE
+       SYNTAX          DisplayString 
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Text search configuration name"
+       ::= { pgsqlPgTsConfigEntry 2 }
+
+pgsqlPgTsConfigCfgnamespace                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this configuration"
+       ::= { pgsqlPgTsConfigEntry 3 }
+
+pgsqlPgTsConfigCfgowner                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the configuration"
+       ::= { pgsqlPgTsConfigEntry 4 }
+
+pgsqlPgTsConfigCfgparser                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the text search parser for this configuration"
+       ::= { pgsqlPgTsConfigEntry 5 }
+
+
+---------------------------------------
+pgsqlPgTsConfigMapTable                OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTsConfigMapEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_ts_config_map catalog contains entries showing which text search dictionaries should be consulted, and in what order, for each output token type of each text search configuration's parser."
+       ::= { pgsqlCatalogTables 37 }
+
+pgsqlPgTsConfigMapEntry                OBJECT-TYPE
+       SYNTAX          PgsqlPgTsConfigMapEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_ts_config_map entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTsConfigMapEntryOID }
+       ::= { pgsqlPgTsConfigMapTable 1 }
+
+PgsqlPgTsConfigMapEntry ::=
+       SEQUENCE {
+               pgsqlPgTsConfigMapEntryOID              INTEGER,
+               pgsqlPgTsConfigMapMapcfg                INTEGER,
+               pgsqlPgTsConfigMapMaptokentype          INTEGER,
+               pgsqlPgTsConfigMapMapseqno              INTEGER,
+               pgsqlPgTsConfigMapMapdict               INTEGER
+       }
+
+pgsqlPgTsConfigMapEntryOID                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTsConfigMapEntry 1 }
+
+pgsqlPgTsConfigMapMapcfg                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the pg_ts_config entry owning this map entry"
+       ::= { pgsqlPgTsConfigMapEntry 2 }
+
+pgsqlPgTsConfigMapMaptokentype                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A token type emitted by the configuration's parser"
+       ::= { pgsqlPgTsConfigMapEntry 3 }
+
+pgsqlPgTsConfigMapMapseqno                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Order in which to consult this entry (lower mapseqnos first)"
+       ::= { pgsqlPgTsConfigMapEntry 4 }
+
+pgsqlPgTsConfigMapMapdict                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the text search dictionary to consult"
+       ::= { pgsqlPgTsConfigMapEntry 5 }
+
+
+---------------------------------------
+pgsqlPgTsDictTable             OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTsDictEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_ts_dict catalog contains entries defining text search dictionaries. A dictionary depends on a text search template, which specifies all the implementation functions needed; the dictionary itself provides values for the user-settable parameters supported by the template. This division of labor allows dictionaries to be created by unprivileged users. The parameters are specified by a text string dictinitoption, whose format and meaning vary depending on the template."
+       ::= { pgsqlCatalogTables 38 }
+
+pgsqlPgTsDictEntry             OBJECT-TYPE
+       SYNTAX          PgsqlPgTsDictEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_ts_dict entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTsDictEntryOID }
+       ::= { pgsqlPgTsDictTable 1 }
+
+PgsqlPgTsDictEntry ::=
+       SEQUENCE {
+               pgsqlPgTsDictEntryOID           INTEGER,
+               pgsqlPgTsDictDictname           DisplayString ,
+               pgsqlPgTsDictDictnamespace              INTEGER,
+               pgsqlPgTsDictDictowner          INTEGER,
+               pgsqlPgTsDictDicttemplate               INTEGER,
+               pgsqlPgTsDictDictinitoption             DisplayString
+       }
+
+pgsqlPgTsDictEntryOID                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTsDictEntry 1 }
+
+pgsqlPgTsDictDictname                  OBJECT-TYPE
+       SYNTAX          DisplayString 
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Text search dictionary name"
+       ::= { pgsqlPgTsDictEntry 2 }
+
+pgsqlPgTsDictDictnamespace                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this dictionary"
+       ::= { pgsqlPgTsDictEntry 3 }
+
+pgsqlPgTsDictDictowner                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the dictionary"
+       ::= { pgsqlPgTsDictEntry 4 }
+
+pgsqlPgTsDictDicttemplate                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the text search template for this dictionary"
+       ::= { pgsqlPgTsDictEntry 5 }
+
+pgsqlPgTsDictDictinitoption                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Initialization option string for the template"
+       ::= { pgsqlPgTsDictEntry 6 }
+
+
+---------------------------------------
+pgsqlPgTsParserTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTsParserEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_ts_parser catalog contains entries defining text search parsers. A parser is responsible for splitting input text into lexemes and assigning a token type to each lexeme. Since a parser must be implemented by C-language-level functions, creation of new parsers is restricted to database superusers."
+       ::= { pgsqlCatalogTables 39 }
+
+pgsqlPgTsParserEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgTsParserEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_ts_parser entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTsParserEntryOID }
+       ::= { pgsqlPgTsParserTable 1 }
+
+PgsqlPgTsParserEntry ::=
+       SEQUENCE {
+               pgsqlPgTsParserEntryOID         INTEGER,
+               pgsqlPgTsParserPrsname          DisplayString ,
+               pgsqlPgTsParserPrsnamespace             INTEGER,
+               pgsqlPgTsParserPrsstart         INTEGER,
+               pgsqlPgTsParserPrstoken         INTEGER,
+               pgsqlPgTsParserPrsend           INTEGER,
+               pgsqlPgTsParserPrsheadline              INTEGER,
+               pgsqlPgTsParserPrslextype               INTEGER
+       }
+
+pgsqlPgTsParserEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTsParserEntry 1 }
+
+pgsqlPgTsParserPrsname                 OBJECT-TYPE
+       SYNTAX          DisplayString 
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Text search parser name"
+       ::= { pgsqlPgTsParserEntry 2 }
+
+pgsqlPgTsParserPrsnamespace                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this parser"
+       ::= { pgsqlPgTsParserEntry 3 }
+
+pgsqlPgTsParserPrsstart                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the parser's startup function"
+       ::= { pgsqlPgTsParserEntry 4 }
+
+pgsqlPgTsParserPrstoken                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the parser's next-token function"
+       ::= { pgsqlPgTsParserEntry 5 }
+
+pgsqlPgTsParserPrsend                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the parser's shutdown function"
+       ::= { pgsqlPgTsParserEntry 6 }
+
+pgsqlPgTsParserPrsheadline                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the parser's headline function"
+       ::= { pgsqlPgTsParserEntry 7 }
+
+pgsqlPgTsParserPrslextype                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the parser's lextype function"
+       ::= { pgsqlPgTsParserEntry 8 }
+
+
+---------------------------------------
+pgsqlPgTsTemplateTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTsTemplateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_ts_template catalog contains entries defining text search templates. A template is the implementation skeleton for a class of text search dictionaries. Since a template must be implemented by C-language-level functions, creation of new templates is restricted to database superusers."
+       ::= { pgsqlCatalogTables 40 }
+
+pgsqlPgTsTemplateEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgTsTemplateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_ts_template entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTsTemplateEntryOID }
+       ::= { pgsqlPgTsTemplateTable 1 }
+
+PgsqlPgTsTemplateEntry ::=
+       SEQUENCE {
+               pgsqlPgTsTemplateEntryOID               INTEGER,
+               pgsqlPgTsTemplateTmplname               DisplayString,
+               pgsqlPgTsTemplateTmplnamespace          INTEGER,
+               pgsqlPgTsTemplateTmplinit               INTEGER,
+               pgsqlPgTsTemplateTmpllexize             INTEGER
+       }
+
+pgsqlPgTsTemplateEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTsTemplateEntry 1 }
+
+pgsqlPgTsTemplateTmplname                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               " Text search template name"
+       ::= { pgsqlPgTsTemplateEntry 2 }
+
+pgsqlPgTsTemplateTmplnamespace                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this template"
+       ::= { pgsqlPgTsTemplateEntry 3 }
+
+pgsqlPgTsTemplateTmplinit                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the template's initialization function"
+       ::= { pgsqlPgTsTemplateEntry 4 }
+
+pgsqlPgTsTemplateTmpllexize                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the template's lexize function"
+       ::= { pgsqlPgTsTemplateEntry 5 }
+
+
+---------------------------------------
+pgsqlPgTypeTable               OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTypeEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_type stores information about data types. Base types (scalar types) are created with CREATE TYPE, and domains with CREATE DOMAIN. A composite type is automatically created for each table in the database, to represent the row structure of the table. It is also possible to create composite types with CREATE TYPE AS."
+       ::= { pgsqlCatalogTables 33 }
+
+pgsqlPgTypeEntry               OBJECT-TYPE
+       SYNTAX          PgsqlPgTypeEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single type"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTypeEntryOID }
+       ::= { pgsqlPgTypeTable 1 }
+
+PgsqlPgTypeEntry ::=
+       SEQUENCE {
+               pgsqlPgTypeEntryOID             INTEGER,
+               pgsqlPgTypeTypname              name,
+               pgsqlPgTypeTypnamespace         oid,
+               pgsqlPgTypeTypowner             oid,
+               pgsqlPgTypeTyplen               int2,
+               pgsqlPgTypeTypbyval             bool,
+               pgsqlPgTypeTyptype              char,
+               pgsqlPgTypeTypisdefined         bool,
+               pgsqlPgTypeTypdelim             char,
+               pgsqlPgTypeTyprelid             oid,
+               pgsqlPgTypeTypelem              oid,
+               pgsqlPgTypeTypinput             regproc,
+               pgsqlPgTypeTypoutput            regproc,
+               pgsqlPgTypeTypreceive           regproc,
+               pgsqlPgTypeTypsend              regproc,
+               pgsqlPgTypeTypanalyze           regproc,
+               pgsqlPgTypeTypalign             char,
+               pgsqlPgTypeTypstorage           char,
+               pgsqlPgTypeTypnotnull           bool,
+               pgsqlPgTypeTypbasetype          oid,
+               pgsqlPgTypeTyptypmod            int4,
+               pgsqlPgTypeTypndims             int4,
+               pgsqlPgTypeTypdefaultbin                text,
+               pgsqlPgTypeTypdefault           text
+       }
+
+pgsqlPgTypeEntryOID                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTypeEntry 1 }
+
+pgsqlPgTypeTypname                     OBJECT-TYPE
+       SYNTAX          name
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Data type name"
+       ::= { pgsqlPgTypeEntry 2 }
+
+pgsqlPgTypeTypnamespace                        OBJECT-TYPE
+       SYNTAX          oid
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this type"
+       ::= { pgsqlPgTypeEntry 3 }
+
+pgsqlPgTypeTypowner                    OBJECT-TYPE
+       SYNTAX          oid
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the type"
+       ::= { pgsqlPgTypeEntry 4 }
+
+pgsqlPgTypeTyplen                      OBJECT-TYPE
+       SYNTAX          int2
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For a fixed-size type, typlen is the number of bytes in the internal representation of the type. But for a variable-length type, typlen is negative. -1 indicates a "
+       ::= { pgsqlPgTypeEntry 5 }
+
+pgsqlPgTypeTypbyval                    OBJECT-TYPE
+       SYNTAX          bool
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typbyval determines whether internal routines pass a value of this type by value or by reference. typbyval had better be false if typlen is not 1, 2, or 4 (or 8 on machines where Datum is 8 bytes). Variable-length types are always passed by reference. Note that typbyval can be false even if the length would allow pass-by-value; this is currently true for type float4 , for example"
+       ::= { pgsqlPgTypeEntry 6 }
+
+pgsqlPgTypeTyptype                     OBJECT-TYPE
+       SYNTAX          char
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typtype is b for a base type, c for a composite type (e.g., a table's row type), d for a domain, or p for a pseudo-type. See also typrelid and typbasetype"
+       ::= { pgsqlPgTypeEntry 7 }
+
+pgsqlPgTypeTypisdefined                        OBJECT-TYPE
+       SYNTAX          bool
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if the type is defined, false if this is a placeholder entry for a not-yet-defined type. When typisdefined is false, nothing except the type name, namespace, and OID can be relied on"
+       ::= { pgsqlPgTypeEntry 8 }
+
+pgsqlPgTypeTypdelim                    OBJECT-TYPE
+       SYNTAX          char
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Character that separates two values of this type when parsing array input. Note that the delimiter is associated with the array element data type, not the array data type"
+       ::= { pgsqlPgTypeEntry 9 }
+
+pgsqlPgTypeTyprelid                    OBJECT-TYPE
+       SYNTAX          oid
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this is a composite type (see typtype ), then this column points to the pg_class entry that defines the corresponding table. (For a free-standing composite type, the pg_class entry doesn't really represent a table, but it is needed anyway for the type's pg_attribute entries to link to.) Zero for non-composite types"
+       ::= { pgsqlPgTypeEntry 10 }
+
+pgsqlPgTypeTypelem                     OBJECT-TYPE
+       SYNTAX          oid
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If typelem is not 0 then it identifies another row in pg_type . The current type can then be subscripted like an array yielding values of type typelem . A "
+       ::= { pgsqlPgTypeEntry 11 }
+
+pgsqlPgTypeTypinput                    OBJECT-TYPE
+       SYNTAX          regproc
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Input conversion function (text format)"
+       ::= { pgsqlPgTypeEntry 12 }
+
+pgsqlPgTypeTypoutput                   OBJECT-TYPE
+       SYNTAX          regproc
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Output conversion function (text format)"
+       ::= { pgsqlPgTypeEntry 13 }
+
+pgsqlPgTypeTypreceive                  OBJECT-TYPE
+       SYNTAX          regproc
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Input conversion function (binary format), or 0 if none"
+       ::= { pgsqlPgTypeEntry 14 }
+
+pgsqlPgTypeTypsend                     OBJECT-TYPE
+       SYNTAX          regproc
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Output conversion function (binary format), or 0 if none"
+       ::= { pgsqlPgTypeEntry 15 }
+
+pgsqlPgTypeTypanalyze                  OBJECT-TYPE
+       SYNTAX          regproc
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Custom ANALYZE function, or 0 to use the standard function"
+       ::= { pgsqlPgTypeEntry 16 }
+
+pgsqlPgTypeTypalign                    OBJECT-TYPE
+       SYNTAX          char
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typalign is the alignment required when storing a value of this type. It applies to storage on disk as well as most representations of the value inside PostgreSQL . When multiple values are stored consecutively, such as in the representation of a complete row on disk, padding is inserted before a datum of this type so that it begins on the specified boundary. The alignment reference is the beginning of the first datum in the sequence. Possible values are: c = char alignment, i.e., no alignment needed. s = short alignment (2 bytes on most machines). i = int alignment (4 bytes on most machines). d = double alignment (8 bytes on many machines, but by no means all). Note: For types used in system tables, it is critical that the size and alignment defined in pg_type agree with the way that the compiler will lay out the column in a structure representing a table row."
+       ::= { pgsqlPgTypeEntry 17 }
+
+pgsqlPgTypeTypstorage                  OBJECT-TYPE
+       SYNTAX          char
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typstorage tells for varlena types (those with typlen = -1) if the type is prepared for toasting and what the default strategy for attributes of this type should be. Possible values are p : Value must always be stored plain. e : Value can be stored in a "
+       ::= { pgsqlPgTypeEntry 18 }
+
+pgsqlPgTypeTypnotnull                  OBJECT-TYPE
+       SYNTAX          bool
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typnotnull represents a not-null constraint on a type. Used for domains only"
+       ::= { pgsqlPgTypeEntry 19 }
+
+pgsqlPgTypeTypbasetype                 OBJECT-TYPE
+       SYNTAX          oid
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this is a domain (see typtype ), then typbasetype identifies the type that this one is based on. Zero if this type is not a domain"
+       ::= { pgsqlPgTypeEntry 20 }
+
+pgsqlPgTypeTyptypmod                   OBJECT-TYPE
+       SYNTAX          int4
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Domains use typtypmod to record the typmod to be applied to their base type (-1 if base type does not use a typmod ). -1 if this type is not a domain"
+       ::= { pgsqlPgTypeEntry 21 }
+
+pgsqlPgTypeTypndims                    OBJECT-TYPE
+       SYNTAX          int4
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typndims is the number of array dimensions for a domain that is an array (that is, typbasetype is an array type; the domain's typelem will match the base type's typelem ). Zero for types other than array domains"
+       ::= { pgsqlPgTypeEntry 22 }
+
+pgsqlPgTypeTypdefaultbin                       OBJECT-TYPE
+       SYNTAX          text
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If typdefaultbin is not null, it is the nodeToString() representation of a default expression for the type. This is only used for domains"
+       ::= { pgsqlPgTypeEntry 23 }
+
+pgsqlPgTypeTypdefault                  OBJECT-TYPE
+       SYNTAX          text
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typdefault is null if the type has no associated default value. If typdefaultbin is not null, typdefault must contain a human-readable version of the default expression represented by typdefaultbin . If typdefaultbin is null and typdefault is not, then typdefault is the external representation of the type's default value, which may be fed to the type's input converter to produce a constant"
+       ::= { pgsqlPgTypeEntry 24 }
+
+
+---------------------------------------
+END
diff --git a/pgsql_mib_pieces/a_PGSQL_MIB_header.mib b/pgsql_mib_pieces/a_PGSQL_MIB_header.mib
new file mode 100644 (file)
index 0000000..872fd4f
--- /dev/null
@@ -0,0 +1,100 @@
+  PGSQL-MIB DEFINITIONS ::= BEGIN
+
+  IMPORTS
+     MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
+      Counter32, Gauge32, Integer32, enterprises
+          FROM SNMPv2-SMI
+      Float
+          FROM UCD-SNMP-MIB
+      DisplayString, DateAndTime, TruthValue
+          FROM SNMPv2-TC
+      rdbmsDbIndex
+          FROM RDBMS-MIB;
+
+  pgsql MODULE-IDENTITY
+      LAST-UPDATED "200708152113Z"
+      ORGANIZATION "pgsnmpd Development Team"
+      CONTACT-INFO
+              "E-mail: pgsnmpd-devel@pgfoundry.org
+              WWW: http://pgsnmpd.projects.postgresql.org"
+      DESCRIPTION
+          "MIB to describe a PostgreSQL database"
+
+      ::= { enterprises 27645 }
+
+  pgsqlObjects        OBJECT IDENTIFIER ::= { pgsql 1 }
+
+  pgsnmpdTables                OBJECT IDENTIFIER ::= { pgsqlObjects 1 }
+
+  pgsqlCatalogTables   OBJECT IDENTIFIER ::= { pgsqlObjects 2 }
+
+  ----------------------------------------------------------------
+
+pgsnmpdConnectionsTable                OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsnmpdConnectionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The table of connections this SNMP agent has to PostgreSQL databases"
+       ::= { pgsnmpdTables 1 }
+
+pgsnmpdConnectionEntry                 OBJECT-TYPE
+       SYNTAX          PgsnmpdConnectionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "A single connection from pgsnmpd to a PostgreSQL database in a
+               database cluster"
+       INDEX   { pgsnmpdConnID }
+       ::= { pgsnmpdConnectionsTable 1 }
+
+PgsnmpdConnectionEntry ::=
+       SEQUENCE {
+               pgsnmpdConnID           INTEGER,
+        pgsnmpdConnDesc     DisplayString,
+               pgsnmpdConnHost         DisplayString,
+               pgsnmpdConnPort         DisplayString,
+               pgsnmpdConnDbName       DisplayString
+       }
+
+pgsnmpdConnID          OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Identifying integer for this connection."
+       ::= { pgsnmpdConnectionEntry 1 }
+
+pgsnmpdConnDesc     OBJECT-TYPE
+    SYNTAX      DisplayString
+    MAX-ACCESS  not-accessible
+    STATUS      current
+    DESCRIPTION
+        "User-generated decriptive string for this connection."
+    ::= { pgsnmpdConnectionEntry 2 }
+
+pgsnmpdConnHost                OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Host name, IP address, or other identifier of the host PostgreSQL server for this connection"
+       ::= { pgsnmpdConnectionEntry 3 }
+
+pgsnmpdConnPort                OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "PostgreSQL server port number for this connection"
+       ::= { pgsnmpdConnectionEntry 4 }
+
+pgsnmpdConnDbName      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Name of the database this connection is connected to"
+       ::= { pgsnmpdConnectionEntry 5 }
+
+  ----------------------------------------------------------------
diff --git a/pgsql_mib_pieces/pg_aggregate.mib b/pgsql_mib_pieces/pg_aggregate.mib
new file mode 100644 (file)
index 0000000..f3d0316
--- /dev/null
@@ -0,0 +1,86 @@
+pgsqlPgAggregateTable          OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAggregateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_aggregate stores information about aggregate functions. An aggregate function is a function that operates on a set of values (typically one column from each row that matches a query condition) and returns a single value computed from all these values. Typical aggregate functions are sum, count, and max. Each entry in pg_aggregate is an extension of an entry in pg_proc. The pg_proc entry carries the aggregate's name, input and output data types, and other information that is similar to ordinary functions.The catalog pg_aggregate stores information about aggregate functions. An aggregate function is a function that operates on a set of values (typically one column from each row that matches a query condition) and returns a single value computed from all these values. Typical aggregate functions are sum, count, and max. Each entry in pg_aggregate is an extension of an entry in pg_proc. The pg_proc entry carries the aggregate's name, input and output data types, and other information that is similar to ordinary functions."
+       ::= { pgsqlCatalogTables 1 }
+
+pgsqlPgAggregateEntry          OBJECT-TYPE
+       SYNTAX          PgsqlPgAggregateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "A pg_aggregate entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAggregateEntryOID }
+       ::= { pgsqlPgAggregateTable 1 }
+
+PgsqlPgAggregateEntry ::=
+       SEQUENCE {
+               pgsqlPgAggregateEntryOID                INTEGER,
+               pgsqlPgAggregateAggfnoid                INTEGER,
+               pgsqlPgAggregateAggtransfn              INTEGER,
+               pgsqlPgAggregateAggfinalfn              INTEGER,
+               pgsqlPgAggregateAggsortop               INTEGER,
+               pgsqlPgAggregateAggtranstype            INTEGER,
+               pgsqlPgAggregateAgginitval              DisplayString
+       }
+
+pgsqlPgAggregateEntryOID                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAggregateEntry 1 }
+
+pgsqlPgAggregateAggfnoid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "pg_proc OID of the aggregate function"
+       ::= { pgsqlPgAggregateEntry 2 }
+
+pgsqlPgAggregateAggtransfn                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Transition function"
+       ::= { pgsqlPgAggregateEntry 3 }
+
+pgsqlPgAggregateAggfinalfn                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Final function (zero if none)"
+       ::= { pgsqlPgAggregateEntry 4 }
+
+pgsqlPgAggregateAggsortop                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Associated sort operator (zero if none)"
+       ::= { pgsqlPgAggregateEntry 5 }
+
+pgsqlPgAggregateAggtranstype                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Data type of the aggregate function's internal transition (state) data"
+       ::= { pgsqlPgAggregateEntry 6 }
+
+pgsqlPgAggregateAgginitval                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The initial value of the transition state. This is a text field containing the initial value in its external string representation. If this field is NULL, the transition state value starts out NULL"
+       ::= { pgsqlPgAggregateEntry 7 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_aggregate.tbldef b/pgsql_mib_pieces/pg_aggregate.tbldef
new file mode 100644 (file)
index 0000000..9d4a71a
--- /dev/null
@@ -0,0 +1,7 @@
+pg_aggregate   "The catalog pg_aggregate stores information about aggregate functions. An aggregate function is a function that operates on a set of values (typically one column from each row that matches a query condition) and returns a single value computed from all these values. Typical aggregate functions are sum, count, and max. Each entry in pg_aggregate is an extension of an entry in pg_proc. The pg_proc entry carries the aggregate's name, input and output data types, and other information that is similar to ordinary functions.The catalog pg_aggregate stores information about aggregate functions. An aggregate function is a function that operates on a set of values (typically one column from each row that matches a query condition) and returns a single value computed from all these values. Typical aggregate functions are sum, count, and max. Each entry in pg_aggregate is an extension of an entry in pg_proc. The pg_proc entry carries the aggregate's name, input and output data types, and other information that is similar to ordinary functions."      "A pg_aggregate entry"  pgsqlCatalogTables      1       "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAggregateAggfnoid"
+"aggfnoid"     "INTEGER"       "pg_proc OID of the aggregate function"
+"aggtransfn"   "INTEGER"       "Transition function"
+"aggfinalfn"   "INTEGER"       "Final function (zero if none)"
+"aggsortop"    "INTEGER"       "Associated sort operator (zero if none)"
+"aggtranstype" "INTEGER"       "Data type of the aggregate function's internal transition (state) data"
+"agginitval"   "DisplayString" "The initial value of the transition state. This is a text field containing the initial value in its external string representation. If this field is NULL, the transition state value starts out NULL"
diff --git a/pgsql_mib_pieces/pg_am.mib b/pgsql_mib_pieces/pg_am.mib
new file mode 100644 (file)
index 0000000..e688c81
--- /dev/null
@@ -0,0 +1,239 @@
+pgsqlPgAmTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAmEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_am stores information about index access methods. There is one row for each index access method supported by the system."
+       ::= { pgsqlCatalogTables 2 }
+
+pgsqlPgAmEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgAmEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "An access method"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAmEntryOID }
+       ::= { pgsqlPgAmTable 1 }
+
+PgsqlPgAmEntry ::=
+       SEQUENCE {
+               pgsqlPgAmEntryOID               INTEGER,
+               pgsqlPgAmAmname         DisplayString,
+               pgsqlPgAmAmstrategies           INTEGER,
+               pgsqlPgAmAmsupport              INTEGER,
+               pgsqlPgAmAmorderstrategy                INTEGER,
+               pgsqlPgAmAmcanunique            TruthValue,
+               pgsqlPgAmAmcanmulticol          TruthValue,
+               pgsqlPgAmAmoptionalkey          TruthValue,
+               pgsqlPgAmAmindexnulls           TruthValue,
+               pgsqlPgAmAmstorage              TruthValue,
+               pgsqlPgAmAmclusterable          TruthValue,
+               pgsqlPgAmAminsert               INTEGER,
+               pgsqlPgAmAmbeginscan            INTEGER,
+               pgsqlPgAmAmgettuple             INTEGER,
+               pgsqlPgAmAmgetmulti             INTEGER,
+               pgsqlPgAmAmrescan               INTEGER,
+               pgsqlPgAmAmendscan              INTEGER,
+               pgsqlPgAmAmmarkpos              INTEGER,
+               pgsqlPgAmAmrestrpos             INTEGER,
+               pgsqlPgAmAmbuild                INTEGER,
+               pgsqlPgAmAmbulkdelete           INTEGER,
+               pgsqlPgAmAmvacuumcleanup                INTEGER,
+               pgsqlPgAmAmcostestimate         INTEGER,
+               pgsqlPgAmAmoptions              INTEGER
+       }
+
+pgsqlPgAmEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAmEntry 1 }
+
+pgsqlPgAmAmname                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the access method"
+       ::= { pgsqlPgAmEntry 2 }
+
+pgsqlPgAmAmstrategies                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of operator strategies for this access method"
+       ::= { pgsqlPgAmEntry 3 }
+
+pgsqlPgAmAmsupport                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of support routines for this access method"
+       ::= { pgsqlPgAmEntry 4 }
+
+pgsqlPgAmAmorderstrategy                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Zero if the index offers no sort order, otherwise the strategy number of the strategy operator that describes the sort order"
+       ::= { pgsqlPgAmEntry 5 }
+
+pgsqlPgAmAmcanunique                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Does the access method support unique indexes?"
+       ::= { pgsqlPgAmEntry 6 }
+
+pgsqlPgAmAmcanmulticol                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Does the access method support multicolumn indexes?"
+       ::= { pgsqlPgAmEntry 7 }
+
+pgsqlPgAmAmoptionalkey                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Does the access method support a scan without any constraint for the first index column?"
+       ::= { pgsqlPgAmEntry 8 }
+
+pgsqlPgAmAmindexnulls                  OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Does the access method support null index entries?"
+       ::= { pgsqlPgAmEntry 9 }
+
+pgsqlPgAmAmstorage                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Can index storage data type differ from column data type?"
+       ::= { pgsqlPgAmEntry 10 }
+
+pgsqlPgAmAmclusterable                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Can an index of this type be clustered on?"
+       ::= { pgsqlPgAmEntry 11 }
+
+pgsqlPgAmAminsert                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Insert this tuple"
+       ::= { pgsqlPgAmEntry 12 }
+
+pgsqlPgAmAmbeginscan                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Start new scan"
+       ::= { pgsqlPgAmEntry 13 }
+
+pgsqlPgAmAmgettuple                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Next valid tuple"
+       ::= { pgsqlPgAmEntry 14 }
+
+pgsqlPgAmAmgetmulti                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Fetch multiple tuples"
+       ::= { pgsqlPgAmEntry 15 }
+
+pgsqlPgAmAmrescan                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Restart this scan"
+       ::= { pgsqlPgAmEntry 16 }
+
+pgsqlPgAmAmendscan                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "End this scan"
+       ::= { pgsqlPgAmEntry 17 }
+
+pgsqlPgAmAmmarkpos                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Mark current scan position"
+       ::= { pgsqlPgAmEntry 18 }
+
+pgsqlPgAmAmrestrpos                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Restore marked scan position"
+       ::= { pgsqlPgAmEntry 19 }
+
+pgsqlPgAmAmbuild                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Build new index"
+       ::= { pgsqlPgAmEntry 20 }
+
+pgsqlPgAmAmbulkdelete                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Bulk-delete function"
+       ::= { pgsqlPgAmEntry 21 }
+
+pgsqlPgAmAmvacuumcleanup                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Post- VACUUM cleanup function"
+       ::= { pgsqlPgAmEntry 22 }
+
+pgsqlPgAmAmcostestimate                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function to estimate cost of an index scan"
+       ::= { pgsqlPgAmEntry 23 }
+
+pgsqlPgAmAmoptions                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function to parse and validate reloptions for an index"
+       ::= { pgsqlPgAmEntry 24 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_am.tbldef b/pgsql_mib_pieces/pg_am.tbldef
new file mode 100644 (file)
index 0000000..9fd2b7b
--- /dev/null
@@ -0,0 +1,25 @@
+pg_am  "The catalog pg_am stores information about index access methods. There is one row for each index access method supported by the system."       "An access method"      pgsqlCatalogTables      2       "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+amname DisplayString   "Name of the access method"
+amstrategies   INTEGER "Number of operator strategies for this access method"
+amsupport      INTEGER "Number of support routines for this access method"
+amorderstrategy        INTEGER "Zero if the index offers no sort order, otherwise the strategy number of the strategy operator that describes the sort order"
+amcanunique    TruthValue      "Does the access method support unique indexes?"
+amcanmulticol  TruthValue      "Does the access method support multicolumn indexes?"
+amoptionalkey  TruthValue      "Does the access method support a scan without any constraint for the first index column?"
+amindexnulls   TruthValue      "Does the access method support null index entries?"
+amstorage      TruthValue      "Can index storage data type differ from column data type?"
+amclusterable  TruthValue      "Can an index of this type be clustered on?"
+aminsert       INTEGER "Insert this tuple" function"
+ambeginscan    INTEGER "Start new scan" function"
+amgettuple     INTEGER "Next valid tuple" function"
+amgetmulti     INTEGER "Fetch multiple tuples" function"
+amrescan       INTEGER "Restart this scan" function"
+amendscan      INTEGER "End this scan" function"
+ammarkpos      INTEGER "Mark current scan position" function"
+amrestrpos     INTEGER "Restore marked scan position" function"
+ambuild        INTEGER "Build new index" function"
+ambulkdelete   INTEGER "Bulk-delete function"
+amvacuumcleanup        INTEGER "Post- VACUUM cleanup function"
+amcostestimate INTEGER "Function to estimate cost of an index scan"
+amoptions      INTEGER "Function to parse and validate reloptions for an index"
diff --git a/pgsql_mib_pieces/pg_amop.mib b/pgsql_mib_pieces/pg_amop.mib
new file mode 100644 (file)
index 0000000..25ff225
--- /dev/null
@@ -0,0 +1,95 @@
+pgsqlPgAmopTable               OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAmopEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_amop stores information about operators associated with index access method operator classes. There is one row for each operator that is a member of an operator class."
+       ::= { pgsqlCatalogTables 3 }
+
+pgsqlPgAmopEntry               OBJECT-TYPE
+       SYNTAX          PgsqlPgAmopEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_amop entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAmopEntryOID }
+       ::= { pgsqlPgAmopTable 1 }
+
+PgsqlPgAmopEntry ::=
+       SEQUENCE {
+               pgsqlPgAmopEntryOID             INTEGER,
+               pgsqlPgAmopAmopfamily           INTEGER,
+               pgsqlPgAmopAmoplefttype         INTEGER,
+               pgsqlPgAmopAmoprighttype                INTEGER,
+               pgsqlPgAmopAmopstrategy         INTEGER,
+               pgsqlPgAmopAmopreqcheck         TruthValue,
+               pgsqlPgAmopAmopopr              INTEGER,
+               pgsqlPgAmopAmopmethod           INTEGER
+       }
+
+pgsqlPgAmopEntryOID                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAmopEntry 1 }
+
+pgsqlPgAmopAmopfamily                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The operator family this entry is for"
+       ::= { pgsqlPgAmopEntry 2 }
+
+pgsqlPgAmopAmoplefttype                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Left-hand input data type of operator"
+       ::= { pgsqlPgAmopEntry 3 }
+
+pgsqlPgAmopAmoprighttype                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Right-hand input data type of operator"
+       ::= { pgsqlPgAmopEntry 4 }
+
+pgsqlPgAmopAmopstrategy                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Operator strategy number"
+       ::= { pgsqlPgAmopEntry 5 }
+
+pgsqlPgAmopAmopreqcheck                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Index hit must be rechecked"
+       ::= { pgsqlPgAmopEntry 6 }
+
+pgsqlPgAmopAmopopr                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the operator"
+       ::= { pgsqlPgAmopEntry 7 }
+
+pgsqlPgAmopAmopmethod                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Index access method operator family is for"
+       ::= { pgsqlPgAmopEntry 8 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_amop.tbldef b/pgsql_mib_pieces/pg_amop.tbldef
new file mode 100644 (file)
index 0000000..cf182d5
--- /dev/null
@@ -0,0 +1,9 @@
+pg_amop        "The catalog pg_amop stores information about operators associated with index access method operator classes. There is one row for each operator that is a member of an operator class."        "pg_amop entry" pgsqlCatalogTables      3       "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"
+amopfamily     INTEGER "The operator family this entry is for"
+amoplefttype   INTEGER "Left-hand input data type of operator"
+amoprighttype  INTEGER "Right-hand input data type of operator"
+amopstrategy   INTEGER "Operator strategy number"
+amopreqcheck   TruthValue      "Index hit must be rechecked"
+amopopr        INTEGER "OID of the operator"
+amopmethod     INTEGER "Index access method operator family is for"
diff --git a/pgsql_mib_pieces/pg_amproc.mib b/pgsql_mib_pieces/pg_amproc.mib
new file mode 100644 (file)
index 0000000..a637ce0
--- /dev/null
@@ -0,0 +1,68 @@
+pgsqlPgAmprocTable             OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAmprocEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_amproc stores information about support procedures associated with index access method operator classes. There is one row for each support procedure belonging to an operator class."
+       ::= { pgsqlCatalogTables 4 }
+
+pgsqlPgAmprocEntry             OBJECT-TYPE
+       SYNTAX          PgsqlPgAmprocEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_amproc entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAmprocEntryOID }
+       ::= { pgsqlPgAmprocTable 1 }
+
+PgsqlPgAmprocEntry ::=
+       SEQUENCE {
+               pgsqlPgAmprocEntryOID           INTEGER,
+               pgsqlPgAmprocAmopclaid          INTEGER,
+               pgsqlPgAmprocAmprocsubtype              INTEGER,
+               pgsqlPgAmprocAmprocnum          INTEGER,
+               pgsqlPgAmprocAmproc             INTEGER
+       }
+
+pgsqlPgAmprocEntryOID                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAmprocEntry 1 }
+
+pgsqlPgAmprocAmopclaid                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The index operator class this entry is for"
+       ::= { pgsqlPgAmprocEntry 2 }
+
+pgsqlPgAmprocAmprocsubtype                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Subtype, if cross-type routine, else zero"
+       ::= { pgsqlPgAmprocEntry 3 }
+
+pgsqlPgAmprocAmprocnum                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Support procedure number"
+       ::= { pgsqlPgAmprocEntry 4 }
+
+pgsqlPgAmprocAmproc                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the procedure"
+       ::= { pgsqlPgAmprocEntry 5 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_amproc.tbldef b/pgsql_mib_pieces/pg_amproc.tbldef
new file mode 100644 (file)
index 0000000..a7cd257
--- /dev/null
@@ -0,0 +1,5 @@
+pg_amproc      "The catalog pg_amproc stores information about support procedures associated with index access method operator classes. There is one row for each support procedure belonging to an operator class."   "pg_amproc entry"       pgsqlCatalogTables      4       "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAmprocAmopclaid"
+amopclaid      INTEGER "The index operator class this entry is for"
+amprocsubtype  INTEGER "Subtype, if cross-type routine, else zero"
+amprocnum      INTEGER "Support procedure number"
+amproc INTEGER "OID of the procedure"
diff --git a/pgsql_mib_pieces/pg_attrdef.mib b/pgsql_mib_pieces/pg_attrdef.mib
new file mode 100644 (file)
index 0000000..7a3a71b
--- /dev/null
@@ -0,0 +1,68 @@
+pgsqlPgAttrdefTable            OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAttrdefEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_attrdef stores column default values. The main information about columns is stored in pg_attribute (see below). Only columns that explicitly specify a default value (when the table is created or the column is added) will have an entry here."
+       ::= { pgsqlCatalogTables 5 }
+
+pgsqlPgAttrdefEntry            OBJECT-TYPE
+       SYNTAX          PgsqlPgAttrdefEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_attrdef entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAttrdefEntryOID }
+       ::= { pgsqlPgAttrdefTable 1 }
+
+PgsqlPgAttrdefEntry ::=
+       SEQUENCE {
+               pgsqlPgAttrdefEntryOID          INTEGER,
+               pgsqlPgAttrdefAdrelid           INTEGER,
+               pgsqlPgAttrdefAdnum             INTEGER,
+               pgsqlPgAttrdefAdbin             DisplayString,
+               pgsqlPgAttrdefAdsrc             DisplayString
+       }
+
+pgsqlPgAttrdefEntryOID                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAttrdefEntry 1 }
+
+pgsqlPgAttrdefAdrelid                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this column belongs to"
+       ::= { pgsqlPgAttrdefEntry 2 }
+
+pgsqlPgAttrdefAdnum                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of the column"
+       ::= { pgsqlPgAttrdefEntry 3 }
+
+pgsqlPgAttrdefAdbin                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The internal representation of the column default value"
+       ::= { pgsqlPgAttrdefEntry 4 }
+
+pgsqlPgAttrdefAdsrc                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A human-readable representation of the default value"
+       ::= { pgsqlPgAttrdefEntry 5 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_attrdef.tbldef b/pgsql_mib_pieces/pg_attrdef.tbldef
new file mode 100644 (file)
index 0000000..cfe30b9
--- /dev/null
@@ -0,0 +1,6 @@
+pg_attrdef     "The catalog pg_attrdef stores column default values. The main information about columns is stored in pg_attribute (see below). Only columns that explicitly specify a default value (when the table is created or the column is added) will have an entry here."       "pg_attrdef entry"      pgsqlCatalogTables      5       "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+adrelid        INTEGER "The table this column belongs to"
+adnum  INTEGER "The number of the column"
+adbin  DisplayString   "The internal representation of the column default value"
+adsrc  DisplayString   "A human-readable representation of the default value"
diff --git a/pgsql_mib_pieces/pg_attribute.mib b/pgsql_mib_pieces/pg_attribute.mib
new file mode 100644 (file)
index 0000000..30d6b5f
--- /dev/null
@@ -0,0 +1,185 @@
+pgsqlPgAttributeTable          OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAttributeEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_attribute stores information about table columns. There will be exactly one pg_attribute row for every column in every table in the database. (There will also be attribute entries for indexes, and indeed all objects that have pg_class entries.) The term attribute is equivalent to column and is used for historical reasons."
+       ::= { pgsqlCatalogTables 6 }
+
+pgsqlPgAttributeEntry          OBJECT-TYPE
+       SYNTAX          PgsqlPgAttributeEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_attribute entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAttributeEntryOID }
+       ::= { pgsqlPgAttributeTable 1 }
+
+PgsqlPgAttributeEntry ::=
+       SEQUENCE {
+               pgsqlPgAttributeEntryOID                INTEGER,
+               pgsqlPgAttributeAttrelid                INTEGER,
+               pgsqlPgAttributeAttname         DisplayString,
+               pgsqlPgAttributeAtttypid                INTEGER,
+               pgsqlPgAttributeAttstattarget           INTEGER,
+               pgsqlPgAttributeAttlen          INTEGER,
+               pgsqlPgAttributeAttnum          INTEGER,
+               pgsqlPgAttributeAttndims                INTEGER,
+               pgsqlPgAttributeAttcacheoff             INTEGER,
+               pgsqlPgAttributeAtttypmod               INTEGER,
+               pgsqlPgAttributeAttbyval                TruthValue,
+               pgsqlPgAttributeAttstorage              DisplayString,
+               pgsqlPgAttributeAttalign                DisplayString,
+               pgsqlPgAttributeAttnotnull              TruthValue,
+               pgsqlPgAttributeAtthasdef               TruthValue,
+               pgsqlPgAttributeAttisdropped            TruthValue,
+               pgsqlPgAttributeAttislocal              INTEGER,
+               pgsqlPgAttributeAttinhcount             INTEGER
+       }
+
+pgsqlPgAttributeEntryOID                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAttributeEntry 1 }
+
+pgsqlPgAttributeAttrelid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this column belongs to"
+       ::= { pgsqlPgAttributeEntry 2 }
+
+pgsqlPgAttributeAttname                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The column name"
+       ::= { pgsqlPgAttributeEntry 3 }
+
+pgsqlPgAttributeAtttypid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The data type of this column"
+       ::= { pgsqlPgAttributeEntry 4 }
+
+pgsqlPgAttributeAttstattarget                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE . A zero value indicates that no statistics should be collected. A negative value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of "
+       ::= { pgsqlPgAttributeEntry 5 }
+
+pgsqlPgAttributeAttlen                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A copy of pg_type.typlen of this column's type"
+       ::= { pgsqlPgAttributeEntry 6 }
+
+pgsqlPgAttributeAttnum                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of the column. Ordinary columns are numbered from 1 up. System columns, such as oid , have (arbitrary) negative numbers"
+       ::= { pgsqlPgAttributeEntry 7 }
+
+pgsqlPgAttributeAttndims                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means "
+       ::= { pgsqlPgAttributeEntry 8 }
+
+pgsqlPgAttributeAttcacheoff                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Always -1 in storage, but when loaded into a row descriptor in memory this may be updated to cache the offset of the attribute within the row"
+       ::= { pgsqlPgAttributeEntry 9 }
+
+pgsqlPgAttributeAtttypmod                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "atttypmod records type-specific data supplied at table creation time (for example, the maximum length of a varchar column). It is passed to type-specific input functions and length coercion functions. The value will generally be -1 for types that do not need atttypmod"
+       ::= { pgsqlPgAttributeEntry 10 }
+
+pgsqlPgAttributeAttbyval                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A copy of pg_type.typbyval of this column's type"
+       ::= { pgsqlPgAttributeEntry 11 }
+
+pgsqlPgAttributeAttstorage                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Normally a copy of pg_type.typstorage of this column's type. For TOAST-able data types, this can be altered after column creation to control storage policy"
+       ::= { pgsqlPgAttributeEntry 12 }
+
+pgsqlPgAttributeAttalign                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A copy of pg_type.typalign of this column's type"
+       ::= { pgsqlPgAttributeEntry 13 }
+
+pgsqlPgAttributeAttnotnull                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This represents a not-null constraint. It is possible to change this column to enable or disable the constraint"
+       ::= { pgsqlPgAttributeEntry 14 }
+
+pgsqlPgAttributeAtthasdef                      OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This column has a default value, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the value"
+       ::= { pgsqlPgAttributeEntry 15 }
+
+pgsqlPgAttributeAttisdropped                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This column has been dropped and is no longer valid. A dropped column is still physically present in the table, but is ignored by the parser and so cannot be accessed via SQL"
+       ::= { pgsqlPgAttributeEntry 16 }
+
+pgsqlPgAttributeAttislocal                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This column is defined locally in the relation. Note that a column may be locally defined and inherited simultaneously"
+       ::= { pgsqlPgAttributeEntry 17 }
+
+pgsqlPgAttributeAttinhcount                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of direct ancestors this column has. A column with a nonzero number of ancestors cannot be dropped nor renamed"
+       ::= { pgsqlPgAttributeEntry 18 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_attribute.tbldef b/pgsql_mib_pieces/pg_attribute.tbldef
new file mode 100644 (file)
index 0000000..cb98327
--- /dev/null
@@ -0,0 +1,18 @@
+pg_attribute   "The catalog pg_attribute stores information about table columns. There will be exactly one pg_attribute row for every column in every table in the database. (There will also be attribute entries for indexes, and indeed all objects that have pg_class entries.) The term attribute is equivalent to column and is used for historical reasons."    "pg_attribute entry"    pgsqlCatalogTables      6       "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAttributeAttrelid, pgsqlPgAttributeAttname"
+attrelid       INTEGER "The table this column belongs to"
+attname        DisplayString   "The column name"
+atttypid       INTEGER "The data type of this column"
+attstattarget  INTEGER "attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE . A zero value indicates that no statistics should be collected. A negative value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of ""most common values"" to collect, and the target number of histogram bins to create"
+attlen INTEGER "A copy of pg_type.typlen of this column's type"
+attnum INTEGER "The number of the column. Ordinary columns are numbered from 1 up. System columns, such as oid , have (arbitrary) negative numbers"
+attndims       INTEGER "Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means ""it's an array"" )"
+attcacheoff    INTEGER "Always -1 in storage, but when loaded into a row descriptor in memory this may be updated to cache the offset of the attribute within the row"
+atttypmod      INTEGER "atttypmod records type-specific data supplied at table creation time (for example, the maximum length of a varchar column). It is passed to type-specific input functions and length coercion functions. The value will generally be -1 for types that do not need atttypmod"
+attbyval       TruthValue      "A copy of pg_type.typbyval of this column's type"
+attstorage     DisplayString   "Normally a copy of pg_type.typstorage of this column's type. For TOAST-able data types, this can be altered after column creation to control storage policy"
+attalign       DisplayString   "A copy of pg_type.typalign of this column's type"
+attnotnull     TruthValue      "This represents a not-null constraint. It is possible to change this column to enable or disable the constraint"
+atthasdef      TruthValue      "This column has a default value, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the value"
+attisdropped   TruthValue      "This column has been dropped and is no longer valid. A dropped column is still physically present in the table, but is ignored by the parser and so cannot be accessed via SQL"
+attislocal     INTEGER "This column is defined locally in the relation. Note that a column may be locally defined and inherited simultaneously"
+attinhcount    INTEGER "The number of direct ancestors this column has. A column with a nonzero number of ancestors cannot be dropped nor renamed"
diff --git a/pgsql_mib_pieces/pg_auth_members.mib b/pgsql_mib_pieces/pg_auth_members.mib
new file mode 100644 (file)
index 0000000..f3c7b52
--- /dev/null
@@ -0,0 +1,69 @@
+-- TODO: Because pg_authid is shared across databases, find a way to ensure I cover all configured connections exactly once
+pgsqlPgAuthMembersTable                OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAuthMembersEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_auth_members shows the membership relations between roles. Any non-circular set of relationships is allowed. Because user identities are cluster-wide, pg_auth_members is shared across all databases of a cluster: there is only one copy of pg_auth_members per cluster, not one per database."
+       ::= { pgsqlCatalogTables 8 }
+
+pgsqlPgAuthMembersEntry                OBJECT-TYPE
+       SYNTAX          PgsqlPgAuthMembersEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_auth_members entry"
+       INDEX  { pgsnmpdConnID, pgsqlPgAuthMembersEntryOID }
+       ::= { pgsqlPgAuthMembersTable 1 }
+
+PgsqlPgAuthMembersEntry ::=
+       SEQUENCE {
+               pgsqlPgAuthMembersEntryOID              INTEGER,
+               pgsqlPgAuthMembersRoleid                INTEGER,
+               pgsqlPgAuthMembersMember                INTEGER,
+               pgsqlPgAuthMembersGrantor               INTEGER,
+               pgsqlPgAuthMembersAdminOption           TruthValue
+       }
+
+pgsqlPgAuthMembersEntryOID                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAuthMembersEntry 1 }
+
+pgsqlPgAuthMembersRoleid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "ID of a role that has a member"
+       ::= { pgsqlPgAuthMembersEntry 2 }
+
+pgsqlPgAuthMembersMember                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "ID of a role that is a member of roleid"
+       ::= { pgsqlPgAuthMembersEntry 3 }
+
+pgsqlPgAuthMembersGrantor                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "ID of the role that granted this membership"
+       ::= { pgsqlPgAuthMembersEntry 4 }
+
+pgsqlPgAuthMembersAdminOption                  OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if member may grant membership in roleid to others"
+       ::= { pgsqlPgAuthMembersEntry 5 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_auth_members.tbldef b/pgsql_mib_pieces/pg_auth_members.tbldef
new file mode 100644 (file)
index 0000000..7fe3505
--- /dev/null
@@ -0,0 +1,6 @@
+-- TODO: Because pg_authid is shared across databases, find a way to ensure I cover all configured connections exactly once
+pg_auth_members        "The catalog pg_auth_members shows the membership relations between roles. Any non-circular set of relationships is allowed. Because user identities are cluster-wide, pg_auth_members is shared across all databases of a cluster: there is only one copy of pg_auth_members per cluster, not one per database."       "pg_auth_members entry" pgsqlCatalogTables      8       "pgsnmpdConnID, pgsqlPgAuthMembersRoleid"
+roleid INTEGER "ID of a role that has a member"
+member INTEGER "ID of a role that is a member of roleid"
+grantor        INTEGER "ID of the role that granted this membership"
+adminOption    TruthValue      "True if member may grant membership in roleid to others"
diff --git a/pgsql_mib_pieces/pg_authid.mib b/pgsql_mib_pieces/pg_authid.mib
new file mode 100644 (file)
index 0000000..f61b472
--- /dev/null
@@ -0,0 +1,132 @@
+-- TODO: Because pg_authid is shared across databases, find a way to ensure I cover all configured connections exactly once
+pgsqlPgAuthidTable             OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAuthidEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_authid contains information about database authorization identifiers (roles). A role subsumes the concepts of 'users' and 'groups'. A user is essentially just a role with the rolcanlogin flag set. Any role (with or without rolcanlogin) may have other roles as members; see pg_auth_members. Since this catalog contains passwords, it must not be publicly readable. pg_roles is a publicly readable view on pg_authid that blanks out the password field. Because user identities are cluster-wide, pg_authid is shared across all databases of a cluster: there is only one copy of pg_authid per cluster, not one per database."
+       ::= { pgsqlCatalogTables 7 }
+
+pgsqlPgAuthidEntry             OBJECT-TYPE
+       SYNTAX          PgsqlPgAuthidEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_authid entry"
+       INDEX  { pgsnmpdConnID, pgsqlPgAuthidEntryOID }
+       ::= { pgsqlPgAuthidTable 1 }
+
+PgsqlPgAuthidEntry ::=
+       SEQUENCE {
+               pgsqlPgAuthidEntryOID           INTEGER,
+               pgsqlPgAuthidRolname            INTEGER,
+               pgsqlPgAuthidRolsuper           TruthValue,
+               pgsqlPgAuthidRolinherit         TruthValue,
+               pgsqlPgAuthidRolcreaterole              TruthValue,
+               pgsqlPgAuthidRolcreatedb                TruthValue,
+               pgsqlPgAuthidRolcatupdate               TruthValue,
+               pgsqlPgAuthidRolcanlogin                TruthValue,
+               pgsqlPgAuthidRolconnlimit               INTEGER,
+               pgsqlPgAuthidRolpassword                DisplayString,
+               pgsqlPgAuthidRolvaliduntil              DateAndTime,
+               pgsqlPgAuthidRolconfig          DisplayString
+       }
+
+pgsqlPgAuthidEntryOID                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAuthidEntry 1 }
+
+pgsqlPgAuthidRolname                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role name"
+       ::= { pgsqlPgAuthidEntry 2 }
+
+pgsqlPgAuthidRolsuper                  OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role has superuser privileges"
+       ::= { pgsqlPgAuthidEntry 3 }
+
+pgsqlPgAuthidRolinherit                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role automatically inherits privileges of roles it is a member of"
+       ::= { pgsqlPgAuthidEntry 4 }
+
+pgsqlPgAuthidRolcreaterole                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role may create more roles"
+       ::= { pgsqlPgAuthidEntry 5 }
+
+pgsqlPgAuthidRolcreatedb                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role may create databases"
+       ::= { pgsqlPgAuthidEntry 6 }
+
+pgsqlPgAuthidRolcatupdate                      OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role may update system catalogs directly. (Even a superuser may not do this unless this column is true)"
+       ::= { pgsqlPgAuthidEntry 7 }
+
+pgsqlPgAuthidRolcanlogin                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Role may log in. That is, this role can be given as the initial session authorization identifier"
+       ::= { pgsqlPgAuthidEntry 8 }
+
+pgsqlPgAuthidRolconnlimit                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For roles that can log in, this sets maximum number of concurrent connections this role can make. -1 means no limit"
+       ::= { pgsqlPgAuthidEntry 9 }
+
+pgsqlPgAuthidRolpassword                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Password (possibly encrypted); NULL if none"
+       ::= { pgsqlPgAuthidEntry 10 }
+
+pgsqlPgAuthidRolvaliduntil                     OBJECT-TYPE
+       SYNTAX          DateAndTime
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Password expiry time (only used for password authentication); NULL if no expiration"
+       ::= { pgsqlPgAuthidEntry 11 }
+
+pgsqlPgAuthidRolconfig                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Session defaults for run-time configuration variables"
+       ::= { pgsqlPgAuthidEntry 12 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_authid.tbldef b/pgsql_mib_pieces/pg_authid.tbldef
new file mode 100644 (file)
index 0000000..b1b1744
--- /dev/null
@@ -0,0 +1,14 @@
+-- TODO: Because pg_authid is shared across databases, find a way to ensure I cover all configured connections exactly once
+pg_authid      "The catalog pg_authid contains information about database authorization identifiers (roles). A role subsumes the concepts of 'users' and 'groups'. A user is essentially just a role with the rolcanlogin flag set. Any role (with or without rolcanlogin) may have other roles as members; see pg_auth_members. Since this catalog contains passwords, it must not be publicly readable. pg_roles is a publicly readable view on pg_authid that blanks out the password field. Because user identities are cluster-wide, pg_authid is shared across all databases of a cluster: there is only one copy of pg_authid per cluster, not one per database."       "pg_authid entry"       pgsqlCatalogTables      7       "pgsnmpdConnID, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+rolname        INTEGER "Role name"
+rolsuper       TruthValue      "Role has superuser privileges"
+rolinherit     TruthValue      "Role automatically inherits privileges of roles it is a member of"
+rolcreaterole  TruthValue      "Role may create more roles"
+rolcreatedb    TruthValue      "Role may create databases"
+rolcatupdate   TruthValue      "Role may update system catalogs directly. (Even a superuser may not do this unless this column is true)"
+rolcanlogin    TruthValue      "Role may log in. That is, this role can be given as the initial session authorization identifier"
+rolconnlimit   INTEGER "For roles that can log in, this sets maximum number of concurrent connections this role can make. -1 means no limit"
+rolpassword    DisplayString   "Password (possibly encrypted); NULL if none"
+rolvaliduntil  DateAndTime     "Password expiry time (only used for password authentication); NULL if no expiration"
+rolconfig      DisplayString   "Session defaults for run-time configuration variables"
diff --git a/pgsql_mib_pieces/pg_autovacuum.mib b/pgsql_mib_pieces/pg_autovacuum.mib
new file mode 100644 (file)
index 0000000..885ff1e
--- /dev/null
@@ -0,0 +1,122 @@
+pgsqlPgAutovacuumTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgAutovacuumEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_autovacuum stores optional per-relation configuration parameters for the autovacuum daemon. If there is an entry here for a particular relation, the given parameters will be used for autovacuuming that table. If no entry is present, the system-wide defaults will be used."
+       ::= { pgsqlCatalogTables 9 }
+
+pgsqlPgAutovacuumEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgAutovacuumEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Autovacuum settings for a relation"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAutovacuumEntryOID }
+       ::= { pgsqlPgAutovacuumTable 1 }
+
+PgsqlPgAutovacuumEntry ::=
+       SEQUENCE {
+               pgsqlPgAutovacuumEntryOID               INTEGER,
+               pgsqlPgAutovacuumVacrelid               INTEGER,
+               pgsqlPgAutovacuumEnabled                TruthValue,
+               pgsqlPgAutovacuumVacBaseThresh          INTEGER,
+               pgsqlPgAutovacuumVacScaleFactor         Float,
+               pgsqlPgAutovacuumAnlBaseThresh          INTEGER,
+               pgsqlPgAutovacuumAnlScaleFactor         Float,
+               pgsqlPgAutovacuumVacCostDelay           INTEGER,
+               pgsqlPgAutovacuumVacCostLimit           INTEGER,
+               pgsqlPgAutovacuumFreezeMinAge           INTEGER,
+               pgsqlPgAutovacuumFreezeMaxAge           INTEGER
+       }
+
+pgsqlPgAutovacuumEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgAutovacuumEntry 1 }
+
+pgsqlPgAutovacuumVacrelid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this entry is for"
+       ::= { pgsqlPgAutovacuumEntry 2 }
+
+pgsqlPgAutovacuumEnabled                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If false, this table is never autovacuumed"
+       ::= { pgsqlPgAutovacuumEntry 3 }
+
+pgsqlPgAutovacuumVacBaseThresh                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Minimum number of modified tuples before vacuum"
+       ::= { pgsqlPgAutovacuumEntry 4 }
+
+pgsqlPgAutovacuumVacScaleFactor                        OBJECT-TYPE
+       SYNTAX          Float
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Multiplier for reltuples to add to vac_base_thresh"
+       ::= { pgsqlPgAutovacuumEntry 5 }
+
+pgsqlPgAutovacuumAnlBaseThresh                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Minimum number of modified tuples before analyze"
+       ::= { pgsqlPgAutovacuumEntry 6 }
+
+pgsqlPgAutovacuumAnlScaleFactor                        OBJECT-TYPE
+       SYNTAX          Float
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Multiplier for reltuples to add to anl_base_thresh"
+       ::= { pgsqlPgAutovacuumEntry 7 }
+
+pgsqlPgAutovacuumVacCostDelay                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Custom vacuum_cost_delay parameter"
+       ::= { pgsqlPgAutovacuumEntry 8 }
+
+pgsqlPgAutovacuumVacCostLimit                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Custom vacuum_cost_limit parameter"
+       ::= { pgsqlPgAutovacuumEntry 9 }
+
+pgsqlPgAutovacuumFreezeMinAge                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Custom vacuum_freeze_min_age parameter"
+       ::= { pgsqlPgAutovacuumEntry 10 }
+
+pgsqlPgAutovacuumFreezeMaxAge                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Custom autovacuum_freeze_max_age parameter"
+       ::= { pgsqlPgAutovacuumEntry 11 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_autovacuum.tbldef b/pgsql_mib_pieces/pg_autovacuum.tbldef
new file mode 100644 (file)
index 0000000..01e7ba8
--- /dev/null
@@ -0,0 +1,11 @@
+pg_autovacuum  "The catalog pg_autovacuum stores optional per-relation configuration parameters for the autovacuum daemon. If there is an entry here for a particular relation, the given parameters will be used for autovacuuming that table. If no entry is present, the system-wide defaults will be used."        "Autovacuum settings for a relation"    pgsqlCatalogTables      9       "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgAutovacuumVacrelid"
+vacrelid       INTEGER "The table this entry is for"
+enabled        TruthValue      "If false, this table is never autovacuumed"
+vacBaseThresh  INTEGER "Minimum number of modified tuples before vacuum"
+vacScaleFactor Float   "Multiplier for reltuples to add to vac_base_thresh"
+anl_base_thresh        INTEGER "Minimum number of modified tuples before analyze"
+anl_scale_factor       Float   "Multiplier for reltuples to add to anl_base_thresh"
+vac_cost_delay INTEGER "Custom vacuum_cost_delay parameter"
+vac_cost_limit INTEGER "Custom vacuum_cost_limit parameter"
+freeze_min_age INTEGER "Custom vacuum_freeze_min_age parameter"
+freeze_max_age INTEGER "Custom autovacuum_freeze_max_age parameter"
diff --git a/pgsql_mib_pieces/pg_cast.mib b/pgsql_mib_pieces/pg_cast.mib
new file mode 100644 (file)
index 0000000..c2f6a03
--- /dev/null
@@ -0,0 +1,68 @@
+pgsqlPgCastTable               OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgCastEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_cast stores data type conversion paths, both built-in paths and those defined with CREATE CAST."
+       ::= { pgsqlCatalogTables 10 }
+
+pgsqlPgCastEntry               OBJECT-TYPE
+       SYNTAX          PgsqlPgCastEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_cast entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgCastEntryOID }
+       ::= { pgsqlPgCastTable 1 }
+
+PgsqlPgCastEntry ::=
+       SEQUENCE {
+               pgsqlPgCastEntryOID             INTEGER,
+               pgsqlPgCastCastsource           INTEGER,
+               pgsqlPgCastCasttarget           INTEGER,
+               pgsqlPgCastCastfunc             INTEGER,
+               pgsqlPgCastCastcontext          DisplayString
+       }
+
+pgsqlPgCastEntryOID                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgCastEntry 1 }
+
+pgsqlPgCastCastsource                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the source data type"
+       ::= { pgsqlPgCastEntry 2 }
+
+pgsqlPgCastCasttarget                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the target data type"
+       ::= { pgsqlPgCastEntry 3 }
+
+pgsqlPgCastCastfunc                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the function to use to perform this cast. Zero is stored if the data types are binary compatible (that is, no run-time operation is needed to perform the cast)"
+       ::= { pgsqlPgCastEntry 4 }
+
+pgsqlPgCastCastcontext                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Indicates what contexts the cast may be invoked in. e means only as an explicit cast (using CAST or :: syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases"
+       ::= { pgsqlPgCastEntry 5 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_cast.tbldef b/pgsql_mib_pieces/pg_cast.tbldef
new file mode 100644 (file)
index 0000000..f885b28
--- /dev/null
@@ -0,0 +1,6 @@
+pg_cast        "The catalog pg_cast stores data type conversion paths, both built-in paths and those defined with CREATE CAST."        "pg_cast entry" pgsqlCatalogTables      10      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+castsource     INTEGER "OID of the source data type"
+casttarget     INTEGER "OID of the target data type"
+castfunc       INTEGER "The OID of the function to use to perform this cast. Zero is stored if the data types are binary compatible (that is, no run-time operation is needed to perform the cast)"
+castcontext    DisplayString   "Indicates what contexts the cast may be invoked in. e means only as an explicit cast (using CAST or :: syntax). a means implicitly in assignment to a target column, as well as explicitly. i means implicitly in expressions, as well as the other cases"
diff --git a/pgsql_mib_pieces/pg_class.mib b/pgsql_mib_pieces/pg_class.mib
new file mode 100644 (file)
index 0000000..bd11b93
--- /dev/null
@@ -0,0 +1,275 @@
+pgsqlPgClassTable              OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgClassEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_class catalogs tables and most everything else that has columns or is otherwise similar to a table. This includes indexes (but see also pg_index), sequences, views, composite types, and TOAST tables; see relkind. Below, when we mean all of these kinds of objects we speak of 'relations'. Not all columns are meaningful for all relation types."
+       ::= { pgsqlCatalogTables 11 }
+
+pgsqlPgClassEntry              OBJECT-TYPE
+       SYNTAX          PgsqlPgClassEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_class entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgClassEntryOID }
+       ::= { pgsqlPgClassTable 1 }
+
+PgsqlPgClassEntry ::=
+       SEQUENCE {
+               pgsqlPgClassEntryOID            INTEGER,
+               pgsqlPgClassRelname             DisplayString,
+               pgsqlPgClassRelnamespace                INTEGER,
+               pgsqlPgClassReltype             INTEGER,
+               pgsqlPgClassRelowner            INTEGER,
+               pgsqlPgClassRelam               INTEGER,
+               pgsqlPgClassRelfilenode         INTEGER,
+               pgsqlPgClassReltablespace               INTEGER,
+               pgsqlPgClassRelpages            INTEGER,
+               pgsqlPgClassReltuples           Float,
+               pgsqlPgClassReltoastrelid               INTEGER,
+               pgsqlPgClassReltoastidxid               INTEGER,
+               pgsqlPgClassRelhasindex         TruthValue,
+               pgsqlPgClassRelisshared         TruthValue,
+               pgsqlPgClassRelkind             DisplayString,
+               pgsqlPgClassRelnatts            INTEGER,
+               pgsqlPgClassRelchecks           INTEGER,
+               pgsqlPgClassReltriggers         INTEGER,
+               pgsqlPgClassRelukeys            INTEGER,
+               pgsqlPgClassRelfkeys            INTEGER,
+               pgsqlPgClassRelrefs             INTEGER,
+               pgsqlPgClassRelhasoids          TruthValue,
+               pgsqlPgClassRelhaspkey          TruthValue,
+               pgsqlPgClassRelhasrules         TruthValue,
+               pgsqlPgClassRelhassubclass              TruthValue,
+               pgsqlPgClassRelfrozenxid                INTEGER,
+               pgsqlPgClassRelacl              DisplayString,
+               pgsqlPgClassReloptions          DisplayString
+       }
+
+pgsqlPgClassEntryOID                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgClassEntry 1 }
+
+pgsqlPgClassRelname                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the table, index, view, etc."
+       ::= { pgsqlPgClassEntry 2 }
+
+pgsqlPgClassRelnamespace                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this relation"
+       ::= { pgsqlPgClassEntry 3 }
+
+pgsqlPgClassReltype                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the data type that corresponds to this table's row type, if any (zero for indexes, which have no pg_type entry)"
+       ::= { pgsqlPgClassEntry 4 }
+
+pgsqlPgClassRelowner                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the relation"
+       ::= { pgsqlPgClassEntry 5 }
+
+pgsqlPgClassRelam                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this is an index, the access method used (B-tree, hash, etc.)"
+       ::= { pgsqlPgClassEntry 6 }
+
+pgsqlPgClassRelfilenode                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the on-disk file of this relation; 0 if none"
+       ::= { pgsqlPgClassEntry 7 }
+
+pgsqlPgClassReltablespace                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The tablespace in which this relation is stored. If zero, the database's default tablespace is implied. (Not meaningful if the relation has no on-disk file.)"
+       ::= { pgsqlPgClassEntry 8 }
+
+pgsqlPgClassRelpages                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Size of the on-disk representation of this table in pages (of size BLCKSZ ). This is only an estimate used by the planner. It is updated by VACUUM , ANALYZE , and a few DDL commands such as CREATE INDEX"
+       ::= { pgsqlPgClassEntry 9 }
+
+pgsqlPgClassReltuples                  OBJECT-TYPE
+       SYNTAX          Float
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM , ANALYZE , and a few DDL commands such as CREATE INDEX"
+       ::= { pgsqlPgClassEntry 10 }
+
+pgsqlPgClassReltoastrelid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the TOAST table associated with this table, 0 if none. The TOAST table stores large attributes "
+       ::= { pgsqlPgClassEntry 11 }
+
+pgsqlPgClassReltoastidxid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For a TOAST table, the OID of its index. 0 if not a TOAST table"
+       ::= { pgsqlPgClassEntry 12 }
+
+pgsqlPgClassRelhasindex                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if this is a table and it has (or recently had) any indexes. This is set by CREATE INDEX , but not cleared immediately by DROP INDEX . VACUUM clears relhasindex if it finds the table has no indexes"
+       ::= { pgsqlPgClassEntry 13 }
+
+pgsqlPgClassRelisshared                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if this table is shared across all databases in the cluster. Only certain system catalogs (such as pg_database ) are shared"
+       ::= { pgsqlPgClassEntry 14 }
+
+pgsqlPgClassRelkind                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "r = ordinary table, i = index, S = sequence, v = view, c = composite type, t = TOAST table"
+       ::= { pgsqlPgClassEntry 15 }
+
+pgsqlPgClassRelnatts                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of user columns in the relation (system columns not counted). There must be this many corresponding entries in pg_attribute . See also pg_attribute.attnum"
+       ::= { pgsqlPgClassEntry 16 }
+
+pgsqlPgClassRelchecks                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of check constraints on the table; see pg_constraint catalog"
+       ::= { pgsqlPgClassEntry 17 }
+
+pgsqlPgClassReltriggers                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of triggers on the table; see pg_trigger catalog"
+       ::= { pgsqlPgClassEntry 18 }
+
+pgsqlPgClassRelukeys                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Unused ( not the number of unique keys)"
+       ::= { pgsqlPgClassEntry 19 }
+
+pgsqlPgClassRelfkeys                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Unused ( not the number of foreign keys on the table)"
+       ::= { pgsqlPgClassEntry 20 }
+
+pgsqlPgClassRelrefs                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Unused"
+       ::= { pgsqlPgClassEntry 21 }
+
+pgsqlPgClassRelhasoids                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if we generate an OID for each row of the relation"
+       ::= { pgsqlPgClassEntry 22 }
+
+pgsqlPgClassRelhaspkey                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if the table has (or once had) a primary key"
+       ::= { pgsqlPgClassEntry 23 }
+
+pgsqlPgClassRelhasrules                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if table has rules; see pg_rewrite catalog"
+       ::= { pgsqlPgClassEntry 24 }
+
+pgsqlPgClassRelhassubclass                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if table has (or once had) any inheritance children"
+       ::= { pgsqlPgClassEntry 25 }
+
+pgsqlPgClassRelfrozenxid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "All transaction IDs before this one have been replaced with a permanent ( "
+       ::= { pgsqlPgClassEntry 26 }
+
+pgsqlPgClassRelacl                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgClassEntry 27 }
+
+pgsqlPgClassReloptions                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access-method-specific options, as "
+       ::= { pgsqlPgClassEntry 28 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_class.tbldef b/pgsql_mib_pieces/pg_class.tbldef
new file mode 100644 (file)
index 0000000..eac0652
--- /dev/null
@@ -0,0 +1,29 @@
+pg_class       "The catalog pg_class catalogs tables and most everything else that has columns or is otherwise similar to a table. This includes indexes (but see also pg_index), sequences, views, composite types, and TOAST tables; see relkind. Below, when we mean all of these kinds of objects we speak of 'relations'. Not all columns are meaningful for all relation types." "pg_class entry"        pgsqlCatalogTables      11      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+relname        DisplayString   "Name of the table, index, view, etc."  
+relnamespace   INTEGER "The OID of the namespace that contains this relation"  
+reltype        INTEGER "The OID of the data type that corresponds to this table's row type, if any (zero for indexes, which have no pg_type entry)"    
+relowner       INTEGER "Owner of the relation" 
+relam  INTEGER "If this is an index, the access method used (B-tree, hash, etc.)"      
+relfilenode    INTEGER "Name of the on-disk file of this relation; 0 if none"  
+reltablespace  INTEGER "The tablespace in which this relation is stored. If zero, the database's default tablespace is implied. (Not meaningful if the relation has no on-disk file.)" 
+relpages       INTEGER "Size of the on-disk representation of this table in pages (of size BLCKSZ ). This is only an estimate used by the planner. It is updated by VACUUM , ANALYZE , and a few DDL commands such as CREATE INDEX"    
+reltuples      Float   "Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM , ANALYZE , and a few DDL commands such as CREATE INDEX"    
+reltoastrelid  INTEGER "OID of the TOAST table associated with this table, 0 if none. The TOAST table stores large attributes ""out of line"" in a secondary table"    
+reltoastidxid  INTEGER "For a TOAST table, the OID of its index. 0 if not a TOAST table"       
+relhasindex    TruthValue      "True if this is a table and it has (or recently had) any indexes. This is set by CREATE INDEX , but not cleared immediately by DROP INDEX . VACUUM clears relhasindex if it finds the table has no indexes"    
+relisshared    TruthValue      "True if this table is shared across all databases in the cluster. Only certain system catalogs (such as pg_database ) are shared"      
+relkind        DisplayString   "r = ordinary table, i = index, S = sequence, v = view, c = composite type, t = TOAST table"    
+relnatts       INTEGER "Number of user columns in the relation (system columns not counted). There must be this many corresponding entries in pg_attribute . See also pg_attribute.attnum"     
+relchecks      INTEGER "Number of check constraints on the table; see pg_constraint catalog"   
+reltriggers    INTEGER "Number of triggers on the table; see pg_trigger catalog"       
+relukeys       INTEGER "Unused ( not the number of unique keys)"       
+relfkeys       INTEGER "Unused ( not the number of foreign keys on the table)" 
+relrefs        INTEGER Unused  
+relhasoids     TruthValue      "True if we generate an OID for each row of the relation"       
+relhaspkey     TruthValue      "True if the table has (or once had) a primary key"     
+relhasrules    TruthValue      "True if table has rules; see pg_rewrite catalog"       
+relhassubclass TruthValue      "True if table has (or once had) any inheritance children"      
+relfrozenxid   INTEGER "All transaction IDs before this one have been replaced with a permanent ( ""frozen"" ) transaction ID in this table. This is used to track whether the table needs to be vacuumed in order to prevent transaction ID wraparound or to allow pg_clog to be shrunk. Zero ( InvalidTransactionId ) if the relation is not a table"        
+relacl DisplayString   "Access privileges; see GRANT and REVOKE for details"   
+reloptions     DisplayString   "Access-method-specific options, as ""keyword=value"" strings"  
diff --git a/pgsql_mib_pieces/pg_constraint.mib b/pgsql_mib_pieces/pg_constraint.mib
new file mode 100644 (file)
index 0000000..82609a8
--- /dev/null
@@ -0,0 +1,167 @@
+pgsqlPgConstraintTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgConstraintEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_constraint stores check, primary key, unique, and foreign key constraints on tables. (Column constraints are not treated specially. Every column constraint is equivalent to some table constraint.) Not-null constraints are represented in the pg_attribute catalog."
+       ::= { pgsqlCatalogTables 12 }
+
+pgsqlPgConstraintEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgConstraintEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "A constraint entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgConstraintEntryOID }
+       ::= { pgsqlPgConstraintTable 1 }
+
+PgsqlPgConstraintEntry ::=
+       SEQUENCE {
+               pgsqlPgConstraintEntryOID               INTEGER,
+               pgsqlPgConstraintConname                DisplayString,
+               pgsqlPgConstraintConnamespace           INTEGER,
+               pgsqlPgConstraintContype                DisplayString,
+               pgsqlPgConstraintCondeferrable          TruthValue,
+               pgsqlPgConstraintCondeferred            TruthValue,
+               pgsqlPgConstraintConrelid               INTEGER,
+               pgsqlPgConstraintContypid               INTEGER,
+               pgsqlPgConstraintConfrelid              INTEGER,
+               pgsqlPgConstraintConfupdtype            DisplayString,
+               pgsqlPgConstraintConfdeltype            DisplayString,
+               pgsqlPgConstraintConfmatchtype          DisplayString,
+               pgsqlPgConstraintConkey         DisplayString,
+               pgsqlPgConstraintConfkey                DisplayString,
+               pgsqlPgConstraintConbin         DisplayString,
+               pgsqlPgConstraintConsrc         DisplayString
+       }
+
+pgsqlPgConstraintEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgConstraintEntry 1 }
+
+pgsqlPgConstraintConname                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Constraint name (not necessarily unique!)"
+       ::= { pgsqlPgConstraintEntry 2 }
+
+pgsqlPgConstraintConnamespace                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this constraint"
+       ::= { pgsqlPgConstraintEntry 3 }
+
+pgsqlPgConstraintContype                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "c = check constraint, f = foreign key constraint, p = primary key constraint, u = unique constraint"
+       ::= { pgsqlPgConstraintEntry 4 }
+
+pgsqlPgConstraintCondeferrable                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Is the constraint deferrable?"
+       ::= { pgsqlPgConstraintEntry 5 }
+
+pgsqlPgConstraintCondeferred                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Is the constraint deferred by default?"
+       ::= { pgsqlPgConstraintEntry 6 }
+
+pgsqlPgConstraintConrelid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this constraint is on; 0 if not a table constraint"
+       ::= { pgsqlPgConstraintEntry 7 }
+
+pgsqlPgConstraintContypid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The domain this constraint is on; 0 if not a domain constraint"
+       ::= { pgsqlPgConstraintEntry 8 }
+
+pgsqlPgConstraintConfrelid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If a foreign key, the referenced table; else 0"
+       ::= { pgsqlPgConstraintEntry 9 }
+
+pgsqlPgConstraintConfupdtype                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Foreign key update action code"
+       ::= { pgsqlPgConstraintEntry 10 }
+
+pgsqlPgConstraintConfdeltype                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Foreign key deletion action code"
+       ::= { pgsqlPgConstraintEntry 11 }
+
+pgsqlPgConstraintConfmatchtype                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Foreign key match type"
+       ::= { pgsqlPgConstraintEntry 12 }
+
+pgsqlPgConstraintConkey                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If a table constraint, list of columns which the constraint constrains"
+       ::= { pgsqlPgConstraintEntry 13 }
+
+pgsqlPgConstraintConfkey                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If a foreign key, list of the referenced columns"
+       ::= { pgsqlPgConstraintEntry 14 }
+
+pgsqlPgConstraintConbin                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If a check constraint, an internal representation of the expression"
+       ::= { pgsqlPgConstraintEntry 15 }
+
+pgsqlPgConstraintConsrc                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If a check constraint, a human-readable representation of the expression"
+       ::= { pgsqlPgConstraintEntry 16 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_constraint.tbldef b/pgsql_mib_pieces/pg_constraint.tbldef
new file mode 100644 (file)
index 0000000..cf704cf
--- /dev/null
@@ -0,0 +1,17 @@
+pg_constraint  "The catalog pg_constraint stores check, primary key, unique, and foreign key constraints on tables. (Column constraints are not treated specially. Every column constraint is equivalent to some table constraint.) Not-null constraints are represented in the pg_attribute catalog." "A constraint entry"    pgsqlCatalogTables      12      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+conname        DisplayString   "Constraint name (not necessarily unique!)"
+connamespace   INTEGER "The OID of the namespace that contains this constraint"
+contype        DisplayString   "c = check constraint, f = foreign key constraint, p = primary key constraint, u = unique constraint"
+condeferrable  TruthValue      "Is the constraint deferrable?"
+condeferred    TruthValue      "Is the constraint deferred by default?"
+conrelid       INTEGER "The table this constraint is on; 0 if not a table constraint"
+contypid       INTEGER "The domain this constraint is on; 0 if not a domain constraint"
+confrelid      INTEGER "If a foreign key, the referenced table; else 0"
+confupdtype    DisplayString   "Foreign key update action code"
+confdeltype    DisplayString   "Foreign key deletion action code"
+confmatchtype  DisplayString   "Foreign key match type"
+conkey DisplayString   "If a table constraint, list of columns which the constraint constrains"
+confkey        DisplayString   "If a foreign key, list of the referenced columns"
+conbin DisplayString   "If a check constraint, an internal representation of the expression"
+consrc DisplayString   "If a check constraint, a human-readable representation of the expression"
diff --git a/pgsql_mib_pieces/pg_conversion.mib b/pgsql_mib_pieces/pg_conversion.mib
new file mode 100644 (file)
index 0000000..0bf49b4
--- /dev/null
@@ -0,0 +1,95 @@
+pgsqlPgConversionTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgConversionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_conversion describes the available encoding conversion procedures."
+       ::= { pgsqlCatalogTables 13 }
+
+pgsqlPgConversionEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgConversionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "A conversion entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgConversionEntryOID }
+       ::= { pgsqlPgConversionTable 1 }
+
+PgsqlPgConversionEntry ::=
+       SEQUENCE {
+               pgsqlPgConversionEntryOID               INTEGER,
+               pgsqlPgConversionConname                DisplayString,
+               pgsqlPgConversionConnamespace           INTEGER,
+               pgsqlPgConversionConowner               INTEGER,
+               pgsqlPgConversionConforencoding         INTEGER,
+               pgsqlPgConversionContoencoding          INTEGER,
+               pgsqlPgConversionConproc                INTEGER,
+               pgsqlPgConversionCondefault             TruthValue
+       }
+
+pgsqlPgConversionEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgConversionEntry 1 }
+
+pgsqlPgConversionConname                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Conversion name (unique within a namespace)"
+       ::= { pgsqlPgConversionEntry 2 }
+
+pgsqlPgConversionConnamespace                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this conversion"
+       ::= { pgsqlPgConversionEntry 3 }
+
+pgsqlPgConversionConowner                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the conversion"
+       ::= { pgsqlPgConversionEntry 4 }
+
+pgsqlPgConversionConforencoding                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Source encoding ID"
+       ::= { pgsqlPgConversionEntry 5 }
+
+pgsqlPgConversionContoencoding                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Destination encoding ID"
+       ::= { pgsqlPgConversionEntry 6 }
+
+pgsqlPgConversionConproc                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Conversion procedure"
+       ::= { pgsqlPgConversionEntry 7 }
+
+pgsqlPgConversionCondefault                    OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if this is the default conversion"
+       ::= { pgsqlPgConversionEntry 8 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_conversion.tbldef b/pgsql_mib_pieces/pg_conversion.tbldef
new file mode 100644 (file)
index 0000000..feca8d9
--- /dev/null
@@ -0,0 +1,9 @@
+pg_conversion  "The catalog pg_conversion describes the available encoding conversion procedures."     "A conversion entry"    pgsqlCatalogTables      13      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+conname        DisplayString   "Conversion name (unique within a namespace)"
+connamespace   INTEGER "The OID of the namespace that contains this conversion"
+conowner       INTEGER "Owner of the conversion"
+conforencoding INTEGER "Source encoding ID"
+contoencoding  INTEGER "Destination encoding ID"
+conproc        INTEGER "Conversion procedure"
+condefault     TruthValue      "True if this is the default conversion"
diff --git a/pgsql_mib_pieces/pg_database.mib b/pgsql_mib_pieces/pg_database.mib
new file mode 100644 (file)
index 0000000..b689490
--- /dev/null
@@ -0,0 +1,132 @@
+-- TODO: Because pg_authid is shared across databases, find a way to ensure I cover all configured connections exactly once
+pgsqlPgDatabaseTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgDatabaseEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_database stores information about the available databases. Databases are created with the CREATE DATABASE command. Unlike most system catalogs, pg_database is shared across all databases of a cluster: there is only one copy of pg_database per cluster, not one per database."
+       ::= { pgsqlCatalogTables 14 }
+
+pgsqlPgDatabaseEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgDatabaseEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "A database"
+       INDEX  { pgsnmpdConnID, pgsqlPgDatabaseEntryOID }
+       ::= { pgsqlPgDatabaseTable 1 }
+
+PgsqlPgDatabaseEntry ::=
+       SEQUENCE {
+               pgsqlPgDatabaseEntryOID         INTEGER,
+               pgsqlPgDatabaseDatname          DisplayString,
+               pgsqlPgDatabaseDatdba           INTEGER,
+               pgsqlPgDatabaseEncoding         INTEGER,
+               pgsqlPgDatabaseDatistemplate            TruthValue,
+               pgsqlPgDatabaseDatallowconn             TruthValue,
+               pgsqlPgDatabaseDatconnlimit             INTEGER,
+               pgsqlPgDatabaseDatlastsysoid            INTEGER,
+               pgsqlPgDatabaseDatfrozenxid             INTEGER,
+               pgsqlPgDatabaseDattablespace            INTEGER,
+               pgsqlPgDatabaseDatconfig                DisplayString,
+               pgsqlPgDatabaseDatacl           DisplayString
+       }
+
+pgsqlPgDatabaseEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgDatabaseEntry 1 }
+
+pgsqlPgDatabaseDatname                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Database name"
+       ::= { pgsqlPgDatabaseEntry 2 }
+
+pgsqlPgDatabaseDatdba                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the database, usually the user who created it"
+       ::= { pgsqlPgDatabaseEntry 3 }
+
+pgsqlPgDatabaseEncoding                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Character encoding for this database ( pg_encoding_to_char() can translate this number to the encoding name)"
+       ::= { pgsqlPgDatabaseEntry 4 }
+
+pgsqlPgDatabaseDatistemplate                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If true then this database can be used in the TEMPLATE clause of CREATE DATABASE to create a new database as a clone of this one"
+       ::= { pgsqlPgDatabaseEntry 5 }
+
+pgsqlPgDatabaseDatallowconn                    OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If false then no one can connect to this database. This is used to protect the template0 database from being altered"
+       ::= { pgsqlPgDatabaseEntry 6 }
+
+pgsqlPgDatabaseDatconnlimit                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Sets maximum number of concurrent connections that can be made to this database. -1 means no limit"
+       ::= { pgsqlPgDatabaseEntry 7 }
+
+pgsqlPgDatabaseDatlastsysoid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Last system OID in the database; useful particularly to pg_dump"
+       ::= { pgsqlPgDatabaseEntry 8 }
+
+pgsqlPgDatabaseDatfrozenxid                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "All transaction IDs before this one have been replaced with a permanent ( "
+       ::= { pgsqlPgDatabaseEntry 9 }
+
+pgsqlPgDatabaseDattablespace                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The default tablespace for the database. Within this database, all tables for which pg_class . reltablespace is zero will be stored in this tablespace; in particular, all the non-shared system catalogs will be there"
+       ::= { pgsqlPgDatabaseEntry 10 }
+
+pgsqlPgDatabaseDatconfig                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Session defaults for run-time configuration variables"
+       ::= { pgsqlPgDatabaseEntry 11 }
+
+pgsqlPgDatabaseDatacl                  OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgDatabaseEntry 12 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_database.tbldef b/pgsql_mib_pieces/pg_database.tbldef
new file mode 100644 (file)
index 0000000..44f382e
--- /dev/null
@@ -0,0 +1,14 @@
+-- TODO: Because pg_authid is shared across databases, find a way to ensure I cover all configured connections exactly once
+pg_database    "The catalog pg_database stores information about the available databases. Databases are created with the CREATE DATABASE command. Unlike most system catalogs, pg_database is shared across all databases of a cluster: there is only one copy of pg_database per cluster, not one per database."      "A database"    pgsqlCatalogTables      14      "pgsnmpdConnID, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+datname        DisplayString   "Database name"
+datdba INTEGER "Owner of the database, usually the user who created it"
+encoding       INTEGER "Character encoding for this database ( pg_encoding_to_char() can translate this number to the encoding name)"
+datistemplate  TruthValue      "If true then this database can be used in the TEMPLATE clause of CREATE DATABASE to create a new database as a clone of this one"
+datallowconn   TruthValue      "If false then no one can connect to this database. This is used to protect the template0 database from being altered"
+datconnlimit   INTEGER "Sets maximum number of concurrent connections that can be made to this database. -1 means no limit"
+datlastsysoid  INTEGER "Last system OID in the database; useful particularly to pg_dump"
+datfrozenxid   INTEGER "All transaction IDs before this one have been replaced with a permanent ( ""frozen"" ) transaction ID in this database. This is used to track whether the database needs to be vacuumed in order to prevent transaction ID wraparound or to allow pg_clog to be shrunk. It is the minimum of the per-table pg_class . relfrozenxid values"
+dattablespace  INTEGER "The default tablespace for the database. Within this database, all tables for which pg_class . reltablespace is zero will be stored in this tablespace; in particular, all the non-shared system catalogs will be there"
+datconfig      DisplayString   "Session defaults for run-time configuration variables"
+datacl DisplayString   "Access privileges; see GRANT and REVOKE for details"
diff --git a/pgsql_mib_pieces/pg_depend.mib b/pgsql_mib_pieces/pg_depend.mib
new file mode 100644 (file)
index 0000000..64c0aa0
--- /dev/null
@@ -0,0 +1,95 @@
+pgsqlPgDependTable             OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgDependEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_depend records the dependency relationships between database objects. This information allows DROP commands to find which other objects must be dropped by DROP CASCADE or prevent dropping in the DROP RESTRICT case. See also pg_shdepend, which performs a similar function for dependencies involving objects that are shared across a database cluster."
+       ::= { pgsqlCatalogTables 15 }
+
+pgsqlPgDependEntry             OBJECT-TYPE
+       SYNTAX          PgsqlPgDependEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Dependancy entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgDependEntryOID }
+       ::= { pgsqlPgDependTable 1 }
+
+PgsqlPgDependEntry ::=
+       SEQUENCE {
+               pgsqlPgDependEntryOID           INTEGER,
+               pgsqlPgDependClassid            INTEGER,
+               pgsqlPgDependObjid              INTEGER,
+               pgsqlPgDependObjsubid           INTEGER,
+               pgsqlPgDependRefclassid         INTEGER,
+               pgsqlPgDependRefobjid           INTEGER,
+               pgsqlPgDependRefobjsubid                INTEGER,
+               pgsqlPgDependDeptype            char
+       }
+
+pgsqlPgDependEntryOID                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgDependEntry 1 }
+
+pgsqlPgDependClassid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog the dependent object is in"
+       ::= { pgsqlPgDependEntry 2 }
+
+pgsqlPgDependObjid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the specific dependent object"
+       ::= { pgsqlPgDependEntry 3 }
+
+pgsqlPgDependObjsubid                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For a table column, this is the column number (the objid and classid refer to the table itself). For all other object types, this column is zero"
+       ::= { pgsqlPgDependEntry 4 }
+
+pgsqlPgDependRefclassid                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog the referenced object is in"
+       ::= { pgsqlPgDependEntry 5 }
+
+pgsqlPgDependRefobjid                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the specific referenced object"
+       ::= { pgsqlPgDependEntry 6 }
+
+pgsqlPgDependRefobjsubid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For a table column, this is the column number (the refobjid and refclassid refer to the table itself). For all other object types, this column is zero"
+       ::= { pgsqlPgDependEntry 7 }
+
+pgsqlPgDependDeptype                   OBJECT-TYPE
+       SYNTAX          char
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code defining the specific semantics of this dependency relationship; see text"
+       ::= { pgsqlPgDependEntry 8 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_depend.tbldef b/pgsql_mib_pieces/pg_depend.tbldef
new file mode 100644 (file)
index 0000000..6afa4b4
--- /dev/null
@@ -0,0 +1,8 @@
+pg_depend      "The catalog pg_depend records the dependency relationships between database objects. This information allows DROP commands to find which other objects must be dropped by DROP CASCADE or prevent dropping in the DROP RESTRICT case. See also pg_shdepend, which performs a similar function for dependencies involving objects that are shared across a database cluster."   "Dependancy entry"      pgsqlCatalogTables      15      "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgDependClassid, pgsqlPgDependObjid"
+classid        INTEGER "The OID of the system catalog the dependent object is in"
+objid  INTEGER "The OID of the specific dependent object"
+objsubid       INTEGER "For a table column, this is the column number (the objid and classid refer to the table itself). For all other object types, this column is zero"
+refclassid     INTEGER "The OID of the system catalog the referenced object is in"
+refobjid       INTEGER "The OID of the specific referenced object"
+refobjsubid    INTEGER "For a table column, this is the column number (the refobjid and refclassid refer to the table itself). For all other object types, this column is zero"
+deptype        char    "A code defining the specific semantics of this dependency relationship; see text"
diff --git a/pgsql_mib_pieces/pg_description.mib b/pgsql_mib_pieces/pg_description.mib
new file mode 100644 (file)
index 0000000..b89647f
--- /dev/null
@@ -0,0 +1,68 @@
+pgsqlPgDescriptionTable                OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgDescriptionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_description stores optional descriptions (comments) for each database object. Descriptions can be manipulated with the COMMENT command and viewed with psql's \d commands. Descriptions of many built-in system objects are provided in the initial contents of pg_description. See also pg_shdescription, which performs a similar function for descriptions involving objects that are shared across a database cluster."
+       ::= { pgsqlCatalogTables 16 }
+
+pgsqlPgDescriptionEntry                OBJECT-TYPE
+       SYNTAX          PgsqlPgDescriptionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Description entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgDescriptionEntryOID }
+       ::= { pgsqlPgDescriptionTable 1 }
+
+PgsqlPgDescriptionEntry ::=
+       SEQUENCE {
+               pgsqlPgDescriptionEntryOID              INTEGER,
+               pgsqlPgDescriptionObjoid                INTEGER,
+               pgsqlPgDescriptionClassoid              INTEGER,
+               pgsqlPgDescriptionObjsubid              INTEGER,
+               pgsqlPgDescriptionDescription           DisplayString
+       }
+
+pgsqlPgDescriptionEntryOID                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgDescriptionEntry 1 }
+
+pgsqlPgDescriptionObjoid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the object this description pertains to"
+       ::= { pgsqlPgDescriptionEntry 2 }
+
+pgsqlPgDescriptionClassoid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog this object appears in"
+       ::= { pgsqlPgDescriptionEntry 3 }
+
+pgsqlPgDescriptionObjsubid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For a comment on a table column, this is the column number (the objoid and classoid refer to the table itself). For all other object types, this column is zero"
+       ::= { pgsqlPgDescriptionEntry 4 }
+
+pgsqlPgDescriptionDescription                  OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Arbitrary text that serves as the description of this object"
+       ::= { pgsqlPgDescriptionEntry 5 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_description.tbldef b/pgsql_mib_pieces/pg_description.tbldef
new file mode 100644 (file)
index 0000000..f08ba8a
--- /dev/null
@@ -0,0 +1,5 @@
+pg_description "The catalog pg_description stores optional descriptions (comments) for each database object. Descriptions can be manipulated with the COMMENT command and viewed with psql's \d commands. Descriptions of many built-in system objects are provided in the initial contents of pg_description. See also pg_shdescription, which performs a similar function for descriptions involving objects that are shared across a database cluster."     "Description entry"     pgsqlCatalogTables      16      "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgDescriptionObjoid"
+objoid INTEGER "The OID of the object this description pertains to"
+classoid       INTEGER "The OID of the system catalog this object appears in"
+objsubid       INTEGER "For a comment on a table column, this is the column number (the objoid and classoid refer to the table itself). For all other object types, this column is zero"
+description    DisplayString   "Arbitrary text that serves as the description of this object"
diff --git a/pgsql_mib_pieces/pg_enum.mib b/pgsql_mib_pieces/pg_enum.mib
new file mode 100644 (file)
index 0000000..e8f4a53
--- /dev/null
@@ -0,0 +1,50 @@
+pgsqlPgEnumTable               OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgEnumEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_enum catalog contains entries matching enum types to their associated values and labels. The internal representation of a given enum value is actually the OID of its associated row in pg_enum. The OIDs for a particular enum type are guaranteed to be ordered in the way the type should sort, but there is no guarantee about the ordering of OIDs of unrelated enum types."
+       ::= { pgsqlCatalogTables 34 }
+
+pgsqlPgEnumEntry               OBJECT-TYPE
+       SYNTAX          PgsqlPgEnumEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_enum entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgEnumEntryOID }
+       ::= { pgsqlPgEnumTable 1 }
+
+PgsqlPgEnumEntry ::=
+       SEQUENCE {
+               pgsqlPgEnumEntryOID             INTEGER,
+               pgsqlPgEnumEnumtypid            INTEGER,
+               pgsqlPgEnumEnumlabel            DisplayString
+       }
+
+pgsqlPgEnumEntryOID                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgEnumEntry 1 }
+
+pgsqlPgEnumEnumtypid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the pg_type entry owning this enum value"
+       ::= { pgsqlPgEnumEntry 2 }
+
+pgsqlPgEnumEnumlabel                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The textual label for this enum value"
+       ::= { pgsqlPgEnumEntry 3 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_enum.tbldef b/pgsql_mib_pieces/pg_enum.tbldef
new file mode 100644 (file)
index 0000000..76e0817
--- /dev/null
@@ -0,0 +1,4 @@
+pg_enum        "The pg_enum catalog contains entries matching enum types to their associated values and labels. The internal representation of a given enum value is actually the OID of its associated row in pg_enum. The OIDs for a particular enum type are guaranteed to be ordered in the way the type should sort, but there is no guarantee about the ordering of OIDs of unrelated enum types."       "pg_enum entry" pgsqlCatalogTables      34      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+enumtypid      INTEGER The OID of the pg_type entry owning this enum value
+enumlabel      DisplayString   The textual label for this enum value
diff --git a/pgsql_mib_pieces/pg_index.mib b/pgsql_mib_pieces/pg_index.mib
new file mode 100644 (file)
index 0000000..c5a999b
--- /dev/null
@@ -0,0 +1,131 @@
+pgsqlPgIndexTable              OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgIndexEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_index contains part of the information about indexes. The rest is mostly in pg_class."
+       ::= { pgsqlCatalogTables 17 }
+
+pgsqlPgIndexEntry              OBJECT-TYPE
+       SYNTAX          PgsqlPgIndexEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single index"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgIndexEntryOID }
+       ::= { pgsqlPgIndexTable 1 }
+
+PgsqlPgIndexEntry ::=
+       SEQUENCE {
+               pgsqlPgIndexEntryOID            INTEGER,
+               pgsqlPgIndexIndexrelid          INTEGER,
+               pgsqlPgIndexIndrelid            INTEGER,
+               pgsqlPgIndexIndnatts            INTEGER,
+               pgsqlPgIndexIndisunique         TruthValue,
+               pgsqlPgIndexIndisprimary                TruthValue,
+               pgsqlPgIndexIndisclustered              TruthValue,
+               pgsqlPgIndexIndisvalid          TruthValue,
+               pgsqlPgIndexIndkey              DisplayString,
+               pgsqlPgIndexIndclass            DisplayString,
+               pgsqlPgIndexIndexprs            DisplayString,
+               pgsqlPgIndexIndpred             DisplayString
+       }
+
+pgsqlPgIndexEntryOID                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgIndexEntry 1 }
+
+pgsqlPgIndexIndexrelid                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the pg_class entry for this index"
+       ::= { pgsqlPgIndexEntry 2 }
+
+pgsqlPgIndexIndrelid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the pg_class entry for the table this index is for"
+       ::= { pgsqlPgIndexEntry 3 }
+
+pgsqlPgIndexIndnatts                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of columns in the index (duplicates pg_class.relnatts )"
+       ::= { pgsqlPgIndexEntry 4 }
+
+pgsqlPgIndexIndisunique                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If true, this is a unique index"
+       ::= { pgsqlPgIndexEntry 5 }
+
+pgsqlPgIndexIndisprimary                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If true, this index represents the primary key of the table. ( indisunique should always be true when this is true.)"
+       ::= { pgsqlPgIndexEntry 6 }
+
+pgsqlPgIndexIndisclustered                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If true, the table was last clustered on this index"
+       ::= { pgsqlPgIndexEntry 7 }
+
+pgsqlPgIndexIndisvalid                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If true, the index is currently valid for queries. False means the index is possibly incomplete: it must still be modified by INSERT / UPDATE operations, but it cannot safely be used for queries. If it is unique, the uniqueness property is not true either"
+       ::= { pgsqlPgIndexEntry 8 }
+
+pgsqlPgIndexIndkey                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This is an array of indnatts values that indicate which table columns this index indexes. For example a value of 1 3 would mean that the first and the third table columns make up the index key. A zero in this array indicates that the corresponding index attribute is an expression over the table columns, rather than a simple column reference."
+       ::= { pgsqlPgIndexEntry 9 }
+
+pgsqlPgIndexIndclass                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For each column in the index key this contains the OID of the operator class to use. See pg_opclass for details"
+       ::= { pgsqlPgIndexEntry 10 }
+
+pgsqlPgIndexIndexprs                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Expression trees (in nodeToString() representation) for index attributes that are not simple column references. This is a list with one element for each zero entry in indkey . NULL if all index attributes are simple references"
+       ::= { pgsqlPgIndexEntry 11 }
+
+pgsqlPgIndexIndpred                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Expression tree (in nodeToString() representation) for partial index predicate. NULL if not a partial index"
+       ::= { pgsqlPgIndexEntry 12 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_index.tbldef b/pgsql_mib_pieces/pg_index.tbldef
new file mode 100644 (file)
index 0000000..afda4a5
--- /dev/null
@@ -0,0 +1,12 @@
+pg_index       "The catalog pg_index contains part of the information about indexes. The rest is mostly in pg_class."  "Represents a single index"     pgsqlCatalogTables      17      "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgIndexIndexrelid"
+indexrelid     INTEGER "The OID of the pg_class entry for this index"
+indrelid       INTEGER "The OID of the pg_class entry for the table this index is for"
+indnatts       INTEGER "The number of columns in the index (duplicates pg_class.relnatts )"
+indisunique    TruthValue      "If true, this is a unique index"
+indisprimary   TruthValue      "If true, this index represents the primary key of the table. ( indisunique should always be true when this is true.)"
+indisclustered TruthValue      "If true, the table was last clustered on this index"
+indisvalid     TruthValue      "If true, the index is currently valid for queries. False means the index is possibly incomplete: it must still be modified by INSERT / UPDATE operations, but it cannot safely be used for queries. If it is unique, the uniqueness property is not true either"
+indkey DisplayString   "This is an array of indnatts values that indicate which table columns this index indexes. For example a value of 1 3 would mean that the first and the third table columns make up the index key. A zero in this array indicates that the corresponding index attribute is an expression over the table columns, rather than a simple column reference."
+indclass       DisplayString   "For each column in the index key this contains the OID of the operator class to use. See pg_opclass for details"
+indexprs       DisplayString   "Expression trees (in nodeToString() representation) for index attributes that are not simple column references. This is a list with one element for each zero entry in indkey . NULL if all index attributes are simple references"
+indpred        DisplayString   "Expression tree (in nodeToString() representation) for partial index predicate. NULL if not a partial index"
diff --git a/pgsql_mib_pieces/pg_inherits.mib b/pgsql_mib_pieces/pg_inherits.mib
new file mode 100644 (file)
index 0000000..ca70dae
--- /dev/null
@@ -0,0 +1,59 @@
+pgsqlPgInheritsTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgInheritsEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_inherits records information about table inheritance hierarchies. There is one entry for each direct child table in the database. (Indirect inheritance can be determined by following chains of entries.)"
+       ::= { pgsqlCatalogTables 18 }
+
+pgsqlPgInheritsEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgInheritsEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents an inheritance relationship"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgInheritsEntryOID }
+       ::= { pgsqlPgInheritsTable 1 }
+
+PgsqlPgInheritsEntry ::=
+       SEQUENCE {
+               pgsqlPgInheritsEntryOID         INTEGER,
+               pgsqlPgInheritsInhrelid         INTEGER,
+               pgsqlPgInheritsInhparent                INTEGER,
+               pgsqlPgInheritsInhseqno         INTEGER
+       }
+
+pgsqlPgInheritsEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgInheritsEntry 1 }
+
+pgsqlPgInheritsInhrelid                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the child table"
+       ::= { pgsqlPgInheritsEntry 2 }
+
+pgsqlPgInheritsInhparent                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the parent table"
+       ::= { pgsqlPgInheritsEntry 3 }
+
+pgsqlPgInheritsInhseqno                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If there is more than one direct parent for a child table (multiple inheritance), this number tells the order in which the inherited columns are to be arranged. The count starts at 1"
+       ::= { pgsqlPgInheritsEntry 4 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_inherits.tbldef b/pgsql_mib_pieces/pg_inherits.tbldef
new file mode 100644 (file)
index 0000000..08b34d8
--- /dev/null
@@ -0,0 +1,4 @@
+pg_inherits    "The catalog pg_inherits records information about table inheritance hierarchies. There is one entry for each direct child table in the database. (Indirect inheritance can be determined by following chains of entries.)"     "Represents an inheritance relationship"        pgsqlCatalogTables      18      "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgInheritsInhrelid, pgsqlPgInheritsInhparent"
+inhrelid       INTEGER "The OID of the child table"
+inhparent      INTEGER "The OID of the parent table"
+inhseqno       INTEGER "If there is more than one direct parent for a child table (multiple inheritance), this number tells the order in which the inherited columns are to be arranged. The count starts at 1"
diff --git a/pgsql_mib_pieces/pg_language.mib b/pgsql_mib_pieces/pg_language.mib
new file mode 100644 (file)
index 0000000..ec670c1
--- /dev/null
@@ -0,0 +1,86 @@
+pgsqlPgLanguageTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgLanguageEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_language registers languages in which you can write functions or stored procedures."
+       ::= { pgsqlCatalogTables 19 }
+
+pgsqlPgLanguageEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgLanguageEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single language"
+       INDEX  { entryID, rdbmsDbIndex, pgsqlPgLanguageEntryOID }
+       ::= { pgsqlPgLanguageTable 1 }
+
+PgsqlPgLanguageEntry ::=
+       SEQUENCE {
+               pgsqlPgLanguageEntryOID         INTEGER,
+               pgsqlPgLanguageLanname          DisplayString,
+               pgsqlPgLanguageLanispl          TruthValue,
+               pgsqlPgLanguageLanpltrusted             TruthValue,
+               pgsqlPgLanguageLanplcallfoid            INTEGER,
+               pgsqlPgLanguageLanvalidator             INTEGER,
+               pgsqlPgLanguageLanacl           DisplayString
+       }
+
+pgsqlPgLanguageEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgLanguageEntry 1 }
+
+pgsqlPgLanguageLanname                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the language"
+       ::= { pgsqlPgLanguageEntry 2 }
+
+pgsqlPgLanguageLanispl                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This is false for internal languages (such as SQL ) and true for user-defined languages. Currently, pg_dump still uses this to determine which languages need to be dumped, but this may be replaced by a different mechanism in the future"
+       ::= { pgsqlPgLanguageEntry 3 }
+
+pgsqlPgLanguageLanpltrusted                    OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if this is a trusted language, which means that it is believed not to grant access to anything outside the normal SQL execution environment. Only superusers may create functions in untrusted languages"
+       ::= { pgsqlPgLanguageEntry 4 }
+
+pgsqlPgLanguageLanplcallfoid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For noninternal languages this references the language handler, which is a special function that is responsible for executing all functions that are written in the particular language"
+       ::= { pgsqlPgLanguageEntry 5 }
+
+pgsqlPgLanguageLanvalidator                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This references a language validator function that is responsible for checking the syntax and validity of new functions when they are created. Zero if no validator is provided"
+       ::= { pgsqlPgLanguageEntry 6 }
+
+pgsqlPgLanguageLanacl                  OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgLanguageEntry 7 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_language.tbldef b/pgsql_mib_pieces/pg_language.tbldef
new file mode 100644 (file)
index 0000000..2f12259
--- /dev/null
@@ -0,0 +1,8 @@
+pg_language    "The catalog pg_language registers languages in which you can write functions or stored procedures."    "Represents a single language"  pgsqlCatalogTables      19      "entryID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+lanname        DisplayString   "Name of the language"  
+lanispl        TruthValue      "This is false for internal languages (such as SQL ) and true for user-defined languages. Currently, pg_dump still uses this to determine which languages need to be dumped, but this may be replaced by a different mechanism in the future"   
+lanpltrusted   TruthValue      "True if this is a trusted language, which means that it is believed not to grant access to anything outside the normal SQL execution environment. Only superusers may create functions in untrusted languages" 
+lanplcallfoid  INTEGER "For noninternal languages this references the language handler, which is a special function that is responsible for executing all functions that are written in the particular language"       
+lanvalidator   INTEGER "This references a language validator function that is responsible for checking the syntax and validity of new functions when they are created. Zero if no validator is provided"       
+lanacl DisplayString   "Access privileges; see GRANT and REVOKE for details"   
diff --git a/pgsql_mib_pieces/pg_largeobject.mib b/pgsql_mib_pieces/pg_largeobject.mib
new file mode 100644 (file)
index 0000000..b223132
--- /dev/null
@@ -0,0 +1,51 @@
+-- The 'data' column from pg_largeobject is not included here, because SNMP would only allow 255 or so bytes to be returned anyway, and that seems fairly useless
+pgsqlPgLargeobjectTable                OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgLargeobjectEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_largeobject holds the data making up 'large objects'. A large object is identified by an OID assigned when it is created. Each large object is broken into segments or 'pages' small enough to be conveniently stored as rows in pg_largeobject. The amount of data per page is defined to be LOBLKSIZE (which is currently BLCKSZ/4, or typically 2 kB)."
+       ::= { pgsqlCatalogTables 20 }
+
+pgsqlPgLargeobjectEntry                OBJECT-TYPE
+       SYNTAX          PgsqlPgLargeobjectEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a page from a large object"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgLargeobjectEntryOID }
+       ::= { pgsqlPgLargeobjectTable 1 }
+
+PgsqlPgLargeobjectEntry ::=
+       SEQUENCE {
+               pgsqlPgLargeobjectEntryOID              INTEGER,
+               pgsqlPgLargeobjectLoid          INTEGER,
+               pgsqlPgLargeobjectPageno                INTEGER
+       }
+
+pgsqlPgLargeobjectEntryOID                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgLargeobjectEntry 1 }
+
+pgsqlPgLargeobjectLoid                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Identifier of the large object that includes this page"
+       ::= { pgsqlPgLargeobjectEntry 2 }
+
+pgsqlPgLargeobjectPageno                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Page number of this page within its large object (counting from zero)"
+       ::= { pgsqlPgLargeobjectEntry 3 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_largeobject.tbldef b/pgsql_mib_pieces/pg_largeobject.tbldef
new file mode 100644 (file)
index 0000000..fb96811
--- /dev/null
@@ -0,0 +1,4 @@
+-- The 'data' column from pg_largeobject is not included here, because SNMP would only allow 255 or so bytes to be returned anyway, and that seems fairly useless
+pg_largeobject "The catalog pg_largeobject holds the data making up 'large objects'. A large object is identified by an OID assigned when it is created. Each large object is broken into segments or 'pages' small enough to be conveniently stored as rows in pg_largeobject. The amount of data per page is defined to be LOBLKSIZE (which is currently BLCKSZ/4, or typically 2 kB)."      "Represents a page from a large object" pgsqlCatalogTables      20      "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgLargeobjectLoid"
+loid   INTEGER "Identifier of the large object that includes this page"        
+pageno INTEGER "Page number of this page within its large object (counting from zero)" 
diff --git a/pgsql_mib_pieces/pg_listener.mib b/pgsql_mib_pieces/pg_listener.mib
new file mode 100644 (file)
index 0000000..934be7d
--- /dev/null
@@ -0,0 +1,59 @@
+pgsqlPgListenerTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgListenerEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_listener supports the LISTEN and NOTIFY commands. A listener creates an entry in pg_listener for each notification name it is listening for. A notifier scans pg_listener and updates each matching entry to show that a notification has occurred. The notifier also sends a signal (using the PID recorded in the table) to awaken the listener from sleep."
+       ::= { pgsqlCatalogTables 21 }
+
+pgsqlPgListenerEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgListenerEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single listener"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgListenerEntryOID }
+       ::= { pgsqlPgListenerTable 1 }
+
+PgsqlPgListenerEntry ::=
+       SEQUENCE {
+               pgsqlPgListenerEntryOID         INTEGER,
+               pgsqlPgListenerRelname          DisplayString,
+               pgsqlPgListenerListenerpid              INTEGER,
+               pgsqlPgListenerNotification             INTEGER
+       }
+
+pgsqlPgListenerEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgListenerEntry 1 }
+
+pgsqlPgListenerRelname                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Notify condition name. (The name need not match any actual relation in the database; the name relname is historical.)"
+       ::= { pgsqlPgListenerEntry 2 }
+
+pgsqlPgListenerListenerpid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "PID of the server process that created this entry"
+       ::= { pgsqlPgListenerEntry 3 }
+
+pgsqlPgListenerNotification                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Zero if no event is pending for this listener. If an event is pending, the PID of the server process that sent the notification."
+       ::= { pgsqlPgListenerEntry 4 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_listener.tbldef b/pgsql_mib_pieces/pg_listener.tbldef
new file mode 100644 (file)
index 0000000..bfbc3e7
--- /dev/null
@@ -0,0 +1,4 @@
+pg_listener    "The catalog pg_listener supports the LISTEN and NOTIFY commands. A listener creates an entry in pg_listener for each notification name it is listening for. A notifier scans pg_listener and updates each matching entry to show that a notification has occurred. The notifier also sends a signal (using the PID recorded in the table) to awaken the listener from sleep."  "Represents a single listener"  pgsqlCatalogTables      21      "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgListenerRelname"
+relname        DisplayString   "Notify condition name. (The name need not match any actual relation in the database; the name relname is historical.)"
+listenerpid    INTEGER "PID of the server process that created this entry"
+notification   INTEGER "Zero if no event is pending for this listener. If an event is pending, the PID of the server process that sent the notification."
diff --git a/pgsql_mib_pieces/pg_namespace.mib b/pgsql_mib_pieces/pg_namespace.mib
new file mode 100644 (file)
index 0000000..54a7436
--- /dev/null
@@ -0,0 +1,59 @@
+pgsqlPgNamespaceTable          OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgNamespaceEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_namespace stores namespaces. A namespace is the structure underlying SQL schemas: each namespace can have a separate collection of relations, types, etc. without name conflicts."
+       ::= { pgsqlCatalogTables 22 }
+
+pgsqlPgNamespaceEntry          OBJECT-TYPE
+       SYNTAX          PgsqlPgNamespaceEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single namespace"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgNamespaceEntryOID }
+       ::= { pgsqlPgNamespaceTable 1 }
+
+PgsqlPgNamespaceEntry ::=
+       SEQUENCE {
+               pgsqlPgNamespaceEntryOID                INTEGER,
+               pgsqlPgNamespaceNspname         DisplayString,
+               pgsqlPgNamespaceNspowner                INTEGER,
+               pgsqlPgNamespaceNspacl          DisplayString
+       }
+
+pgsqlPgNamespaceEntryOID                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgNamespaceEntry 1 }
+
+pgsqlPgNamespaceNspname                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the namespace"
+       ::= { pgsqlPgNamespaceEntry 2 }
+
+pgsqlPgNamespaceNspowner                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the namespace"
+       ::= { pgsqlPgNamespaceEntry 3 }
+
+pgsqlPgNamespaceNspacl                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgNamespaceEntry 4 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_namespace.tbldef b/pgsql_mib_pieces/pg_namespace.tbldef
new file mode 100644 (file)
index 0000000..1d6d4a7
--- /dev/null
@@ -0,0 +1,5 @@
+pg_namespace   "The catalog pg_namespace stores namespaces. A namespace is the structure underlying SQL schemas: each namespace can have a separate collection of relations, types, etc. without name conflicts."      "Represents a single namespace" pgsqlCatalogTables      22      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+nspname        DisplayString   "Name of the namespace"
+nspowner       INTEGER "Owner of the namespace"
+nspacl DisplayString   "Access privileges; see GRANT and REVOKE for details"
diff --git a/pgsql_mib_pieces/pg_opclass.mib b/pgsql_mib_pieces/pg_opclass.mib
new file mode 100644 (file)
index 0000000..3c3d24c
--- /dev/null
@@ -0,0 +1,95 @@
+pgsqlPgOpclassTable            OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgOpclassEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_opclass defines index access method operator classes. Each operator class defines semantics for index columns of a particular data type and a particular index access method. Note that there can be multiple operator classes for a given data type/access method combination, thus supporting multiple behaviors."
+       ::= { pgsqlCatalogTables 23 }
+
+pgsqlPgOpclassEntry            OBJECT-TYPE
+       SYNTAX          PgsqlPgOpclassEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents an index access method operator class"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgOpclassEntryOID }
+       ::= { pgsqlPgOpclassTable 1 }
+
+PgsqlPgOpclassEntry ::=
+       SEQUENCE {
+               pgsqlPgOpclassEntryOID          INTEGER,
+               pgsqlPgOpclassOpcamid           INTEGER,
+               pgsqlPgOpclassOpcname           DisplayString,
+               pgsqlPgOpclassOpcnamespace              INTEGER,
+               pgsqlPgOpclassOpcowner          INTEGER,
+               pgsqlPgOpclassOpcintype         INTEGER,
+               pgsqlPgOpclassOpcdefault                TruthValue,
+               pgsqlPgOpclassOpckeytype                INTEGER
+       }
+
+pgsqlPgOpclassEntryOID                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgOpclassEntry 1 }
+
+pgsqlPgOpclassOpcamid                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Index access method operator class is for"
+       ::= { pgsqlPgOpclassEntry 2 }
+
+pgsqlPgOpclassOpcname                  OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of this operator class"
+       ::= { pgsqlPgOpclassEntry 3 }
+
+pgsqlPgOpclassOpcnamespace                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Namespace of this operator class"
+       ::= { pgsqlPgOpclassEntry 4 }
+
+pgsqlPgOpclassOpcowner                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the operator class"
+       ::= { pgsqlPgOpclassEntry 5 }
+
+pgsqlPgOpclassOpcintype                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Data type that the operator class indexes"
+       ::= { pgsqlPgOpclassEntry 6 }
+
+pgsqlPgOpclassOpcdefault                       OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if this operator class is the default for opcintype"
+       ::= { pgsqlPgOpclassEntry 7 }
+
+pgsqlPgOpclassOpckeytype                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Type of data stored in index, or zero if same as opcintype"
+       ::= { pgsqlPgOpclassEntry 8 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_opclass.tbldef b/pgsql_mib_pieces/pg_opclass.tbldef
new file mode 100644 (file)
index 0000000..a208ec4
--- /dev/null
@@ -0,0 +1,9 @@
+pg_opclass     "The catalog pg_opclass defines index access method operator classes. Each operator class defines semantics for index columns of a particular data type and a particular index access method. Note that there can be multiple operator classes for a given data type/access method combination, thus supporting multiple behaviors."    "Represents an index access method operator class"      pgsqlCatalogTables      23      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+opcamid        INTEGER "Index access method operator class is for"
+opcname        DisplayString   "Name of this operator class"
+opcnamespace   INTEGER "Namespace of this operator class"
+opcowner       INTEGER "Owner of the operator class"
+opcintype      INTEGER "Data type that the operator class indexes"
+opcdefault     TruthValue      "True if this operator class is the default for opcintype"
+opckeytype     INTEGER "Type of data stored in index, or zero if same as opcintype"
diff --git a/pgsql_mib_pieces/pg_operator.mib b/pgsql_mib_pieces/pg_operator.mib
new file mode 100644 (file)
index 0000000..4ac676e
--- /dev/null
@@ -0,0 +1,185 @@
+pgsqlPgOperatorTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgOperatorEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_operator stores information about operators."
+       ::= { pgsqlCatalogTables 24 }
+
+pgsqlPgOperatorEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgOperatorEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single operator"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgOperatorEntryOID }
+       ::= { pgsqlPgOperatorTable 1 }
+
+PgsqlPgOperatorEntry ::=
+       SEQUENCE {
+               pgsqlPgOperatorEntryOID         INTEGER,
+               pgsqlPgOperatorOprname          DisplayString,
+               pgsqlPgOperatorOprnamespace             INTEGER,
+               pgsqlPgOperatorOprowner         INTEGER,
+               pgsqlPgOperatorOprkind          DisplayString,
+               pgsqlPgOperatorOprcanhash               TruthValue,
+               pgsqlPgOperatorOprleft          INTEGER,
+               pgsqlPgOperatorOprright         INTEGER,
+               pgsqlPgOperatorOprresult                INTEGER,
+               pgsqlPgOperatorOprcom           INTEGER,
+               pgsqlPgOperatorOprnegate                INTEGER,
+               pgsqlPgOperatorOprlsortop               INTEGER,
+               pgsqlPgOperatorOprrsortop               INTEGER,
+               pgsqlPgOperatorOprltcmpop               INTEGER,
+               pgsqlPgOperatorOprgtcmpop               INTEGER,
+               pgsqlPgOperatorOprcode          INTEGER,
+               pgsqlPgOperatorOprrest          INTEGER,
+               pgsqlPgOperatorOprjoin          INTEGER
+       }
+
+pgsqlPgOperatorEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgOperatorEntry 1 }
+
+pgsqlPgOperatorOprname                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the operator"
+       ::= { pgsqlPgOperatorEntry 2 }
+
+pgsqlPgOperatorOprnamespace                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this operator"
+       ::= { pgsqlPgOperatorEntry 3 }
+
+pgsqlPgOperatorOprowner                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the operator"
+       ::= { pgsqlPgOperatorEntry 4 }
+
+pgsqlPgOperatorOprkind                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "b = infix ( "
+       ::= { pgsqlPgOperatorEntry 5 }
+
+pgsqlPgOperatorOprcanhash                      OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This operator supports hash joins"
+       ::= { pgsqlPgOperatorEntry 6 }
+
+pgsqlPgOperatorOprleft                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Type of the left operand"
+       ::= { pgsqlPgOperatorEntry 7 }
+
+pgsqlPgOperatorOprright                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Type of the right operand"
+       ::= { pgsqlPgOperatorEntry 8 }
+
+pgsqlPgOperatorOprresult                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Type of the result"
+       ::= { pgsqlPgOperatorEntry 9 }
+
+pgsqlPgOperatorOprcom                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Commutator of this operator, if any"
+       ::= { pgsqlPgOperatorEntry 10 }
+
+pgsqlPgOperatorOprnegate                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Negator of this operator, if any"
+       ::= { pgsqlPgOperatorEntry 11 }
+
+pgsqlPgOperatorOprlsortop                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this operator supports merge joins, the operator that sorts the type of the left-hand operand ( L<L )"
+       ::= { pgsqlPgOperatorEntry 12 }
+
+pgsqlPgOperatorOprrsortop                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this operator supports merge joins, the operator that sorts the type of the right-hand operand ( R<R )"
+       ::= { pgsqlPgOperatorEntry 13 }
+
+pgsqlPgOperatorOprltcmpop                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this operator supports merge joins, the less-than operator that compares the left and right operand types ( L<R )"
+       ::= { pgsqlPgOperatorEntry 14 }
+
+pgsqlPgOperatorOprgtcmpop                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this operator supports merge joins, the greater-than operator that compares the left and right operand types ( L>R )"
+       ::= { pgsqlPgOperatorEntry 15 }
+
+pgsqlPgOperatorOprcode                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function that implements this operator"
+       ::= { pgsqlPgOperatorEntry 16 }
+
+pgsqlPgOperatorOprrest                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Restriction selectivity estimation function for this operator"
+       ::= { pgsqlPgOperatorEntry 17 }
+
+pgsqlPgOperatorOprjoin                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Join selectivity estimation function for this operator"
+       ::= { pgsqlPgOperatorEntry 18 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_operator.tbldef b/pgsql_mib_pieces/pg_operator.tbldef
new file mode 100644 (file)
index 0000000..ae90c58
--- /dev/null
@@ -0,0 +1,19 @@
+pg_operator    "The catalog pg_operator stores information about operators."   "Represents a single operator"  pgsqlCatalogTables      24      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+oprname        DisplayString   "Name of the operator"
+oprnamespace   INTEGER "The OID of the namespace that contains this operator"
+oprowner       INTEGER "Owner of the operator"
+oprkind        DisplayString   "b = infix ( ""both"" ), l = prefix ( ""left"" ), r = postfix ( ""right"" )"
+oprcanhash     TruthValue      "This operator supports hash joins"
+oprleft        INTEGER "Type of the left operand"
+oprright       INTEGER "Type of the right operand"
+oprresult      INTEGER "Type of the result"
+oprcom INTEGER "Commutator of this operator, if any"
+oprnegate      INTEGER "Negator of this operator, if any"
+oprlsortop     INTEGER "If this operator supports merge joins, the operator that sorts the type of the left-hand operand ( L<L )"
+oprrsortop     INTEGER "If this operator supports merge joins, the operator that sorts the type of the right-hand operand ( R<R )"
+oprltcmpop     INTEGER "If this operator supports merge joins, the less-than operator that compares the left and right operand types ( L<R )"
+oprgtcmpop     INTEGER "If this operator supports merge joins, the greater-than operator that compares the left and right operand types ( L>R )"
+oprcode        INTEGER "Function that implements this operator"
+oprrest        INTEGER "Restriction selectivity estimation function for this operator"
+oprjoin        INTEGER "Join selectivity estimation function for this operator"
diff --git a/pgsql_mib_pieces/pg_opfamily.mib b/pgsql_mib_pieces/pg_opfamily.mib
new file mode 100644 (file)
index 0000000..91ed03e
--- /dev/null
@@ -0,0 +1,68 @@
+pgsqlPgOpfamilyTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgOpfamilyEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_opfamily defines operator families. Each operator family is a collection of operators and associated support routines that implement the semantics specified for a particular index access method. Furthermore, the operators in a family are all 'compatible', in a way that is specified by the access method. The operator family concept allows cross-data-type operators to be used with indexes and to be reasoned about using knowledge of access method semantics."
+       ::= { pgsqlCatalogTables 35 }
+
+pgsqlPgOpfamilyEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgOpfamilyEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_opfamily entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgOpfamilyEntryOID }
+       ::= { pgsqlPgOpfamilyTable 1 }
+
+PgsqlPgOpfamilyEntry ::=
+       SEQUENCE {
+               pgsqlPgOpfamilyEntryOID         INTEGER,
+               pgsqlPgOpfamilyOpfmethod                INTEGER,
+               pgsqlPgOpfamilyOpfname          DisplayString,
+               pgsqlPgOpfamilyOpfnamespace             INTEGER,
+               pgsqlPgOpfamilyOpfowner         INTEGER
+       }
+
+pgsqlPgOpfamilyEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgOpfamilyEntry 1 }
+
+pgsqlPgOpfamilyOpfmethod                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Index access method operator family is for"
+       ::= { pgsqlPgOpfamilyEntry 2 }
+
+pgsqlPgOpfamilyOpfname                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of this operator family"
+       ::= { pgsqlPgOpfamilyEntry 3 }
+
+pgsqlPgOpfamilyOpfnamespace                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Namespace of this operator family"
+       ::= { pgsqlPgOpfamilyEntry 4 }
+
+pgsqlPgOpfamilyOpfowner                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the operator family"
+       ::= { pgsqlPgOpfamilyEntry 5 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_opfamily.tbldef b/pgsql_mib_pieces/pg_opfamily.tbldef
new file mode 100644 (file)
index 0000000..5950a5f
--- /dev/null
@@ -0,0 +1,6 @@
+pg_opfamily    "The catalog pg_opfamily defines operator families. Each operator family is a collection of operators and associated support routines that implement the semantics specified for a particular index access method. Furthermore, the operators in a family are all 'compatible', in a way that is specified by the access method. The operator family concept allows cross-data-type operators to be used with indexes and to be reasoned about using knowledge of access method semantics."     "pg_opfamily entry"     pgsqlCatalogTables      35      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+opfmethod      INTEGER Index access method operator family is for
+opfname        DisplayString   Name of this operator family
+opfnamespace   INTEGER Namespace of this operator family
+opfowner       INTEGER Owner of the operator family
diff --git a/pgsql_mib_pieces/pg_pltemplate.mib b/pgsql_mib_pieces/pg_pltemplate.mib
new file mode 100644 (file)
index 0000000..5f42761
--- /dev/null
@@ -0,0 +1,86 @@
+pgsqlPgPltemplateTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgPltemplateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_pltemplate stores 'template' information for procedural languages. A template for a language allows the language to be created in a particular database by a simple CREATE LANGUAGE command, with no need to specify implementation details. Unlike most system catalogs, pg_pltemplate is shared across all databases of a cluster: there is only one copy of pg_pltemplate per cluster, not one per database. This allows the information to be accessible in each database as it is needed."
+       ::= { pgsqlCatalogTables 25 }
+
+pgsqlPgPltemplateEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgPltemplateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a procedural language template"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgPltemplateEntryOID }
+       ::= { pgsqlPgPltemplateTable 1 }
+
+PgsqlPgPltemplateEntry ::=
+       SEQUENCE {
+               pgsqlPgPltemplateEntryOID               INTEGER,
+               pgsqlPgPltemplateTmplname               DisplayString,
+               pgsqlPgPltemplateTmpltrusted            TruthValue,
+               pgsqlPgPltemplateTmplhandler            DisplayString,
+               pgsqlPgPltemplateTmplvalidator          DisplayString,
+               pgsqlPgPltemplateTmpllibrary            DisplayString,
+               pgsqlPgPltemplateTmplacl                DisplayString
+       }
+
+pgsqlPgPltemplateEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgPltemplateEntry 1 }
+
+pgsqlPgPltemplateTmplname                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the language this template is for"
+       ::= { pgsqlPgPltemplateEntry 2 }
+
+pgsqlPgPltemplateTmpltrusted                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if language is considered trusted"
+       ::= { pgsqlPgPltemplateEntry 3 }
+
+pgsqlPgPltemplateTmplhandler                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of call handler function"
+       ::= { pgsqlPgPltemplateEntry 4 }
+
+pgsqlPgPltemplateTmplvalidator                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of validator function, or NULL if none"
+       ::= { pgsqlPgPltemplateEntry 5 }
+
+pgsqlPgPltemplateTmpllibrary                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Path of shared library that implements language"
+       ::= { pgsqlPgPltemplateEntry 6 }
+
+pgsqlPgPltemplateTmplacl                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges for template (not yet used)"
+       ::= { pgsqlPgPltemplateEntry 7 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_pltemplate.tbldef b/pgsql_mib_pieces/pg_pltemplate.tbldef
new file mode 100644 (file)
index 0000000..61e7c1f
--- /dev/null
@@ -0,0 +1,7 @@
+pg_pltemplate  "The catalog pg_pltemplate stores 'template' information for procedural languages. A template for a language allows the language to be created in a particular database by a simple CREATE LANGUAGE command, with no need to specify implementation details. Unlike most system catalogs, pg_pltemplate is shared across all databases of a cluster: there is only one copy of pg_pltemplate per cluster, not one per database. This allows the information to be accessible in each database as it is needed." "Represents a procedural language template"     pgsqlCatalogTables      25      "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgPltemplateTmplname"
+tmplname       DisplayString   "Name of the language this template is for"
+tmpltrusted    TruthValue      "True if language is considered trusted"
+tmplhandler    DisplayString   "Name of call handler function"
+tmplvalidator  DisplayString   "Name of validator function, or NULL if none"
+tmpllibrary    DisplayString   "Path of shared library that implements language"
+tmplacl        DisplayString   "Access privileges for template (not yet used)"
diff --git a/pgsql_mib_pieces/pg_proc.mib b/pgsql_mib_pieces/pg_proc.mib
new file mode 100644 (file)
index 0000000..567fc17
--- /dev/null
@@ -0,0 +1,194 @@
+pgsqlPgProcTable               OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgProcEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_proc stores information about functions (or procedures). The table contains data for aggregate functions as well as plain functions. If proisagg is true, there should be a matching row in pg_aggregate."
+       ::= { pgsqlCatalogTables 26 }
+
+pgsqlPgProcEntry               OBJECT-TYPE
+       SYNTAX          PgsqlPgProcEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single stored procedure"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgProcEntryOID }
+       ::= { pgsqlPgProcTable 1 }
+
+PgsqlPgProcEntry ::=
+       SEQUENCE {
+               pgsqlPgProcEntryOID             INTEGER,
+               pgsqlPgProcProname              DisplayString,
+               pgsqlPgProcPronamespace         INTEGER,
+               pgsqlPgProcProowner             INTEGER,
+               pgsqlPgProcProlang              INTEGER,
+               pgsqlPgProcProisagg             TruthValue,
+               pgsqlPgProcProsecdef            TruthValue,
+               pgsqlPgProcProisstrict          TruthValue,
+               pgsqlPgProcProretset            TruthValue,
+               pgsqlPgProcProvolatile          DisplayString,
+               pgsqlPgProcPronargs             INTEGER,
+               pgsqlPgProcProrettype           INTEGER,
+               pgsqlPgProcProargtypes          DisplayString,
+               pgsqlPgProcProallargtypes               DisplayString,
+               pgsqlPgProcProargmodes          DisplayString,
+               pgsqlPgProcProargnames          DisplayString,
+               pgsqlPgProcProsrc               DisplayString,
+               pgsqlPgProcProbin               DisplayString,
+               pgsqlPgProcProacl               DisplayString
+       }
+
+pgsqlPgProcEntryOID                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgProcEntry 1 }
+
+pgsqlPgProcProname                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Name of the function"
+       ::= { pgsqlPgProcEntry 2 }
+
+pgsqlPgProcPronamespace                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this function"
+       ::= { pgsqlPgProcEntry 3 }
+
+pgsqlPgProcProowner                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the function"
+       ::= { pgsqlPgProcEntry 4 }
+
+pgsqlPgProcProlang                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Implementation language or call interface of this function"
+       ::= { pgsqlPgProcEntry 5 }
+
+pgsqlPgProcProisagg                    OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function is an aggregate function"
+       ::= { pgsqlPgProcEntry 6 }
+
+pgsqlPgProcProsecdef                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function is a security definer (i.e., a "
+       ::= { pgsqlPgProcEntry 7 }
+
+pgsqlPgProcProisstrict                 OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function returns null if any call argument is null. In that case the function won't actually be called at all. Functions that are not "
+       ::= { pgsqlPgProcEntry 8 }
+
+pgsqlPgProcProretset                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Function returns a set (i.e., multiple values of the specified data type)"
+       ::= { pgsqlPgProcEntry 9 }
+
+pgsqlPgProcProvolatile                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "provolatile tells whether the function's result depends only on its input arguments, or is affected by outside factors. It is i for "
+       ::= { pgsqlPgProcEntry 10 }
+
+pgsqlPgProcPronargs                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of arguments"
+       ::= { pgsqlPgProcEntry 11 }
+
+pgsqlPgProcProrettype                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Data type of the return value"
+       ::= { pgsqlPgProcEntry 12 }
+
+pgsqlPgProcProargtypes                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An array with the data types of the function arguments. This includes only input arguments (including INOUT arguments), and thus represents the call signature of the function"
+       ::= { pgsqlPgProcEntry 13 }
+
+pgsqlPgProcProallargtypes                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An array with the data types of the function arguments. This includes all arguments (including OUT and INOUT arguments); however, if all the arguments are IN arguments, this field will be null. Note that subscripting is 1-based, whereas for historical reasons proargtypes is subscripted from 0"
+       ::= { pgsqlPgProcEntry 14 }
+
+pgsqlPgProcProargmodes                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An array with the modes of the function arguments, encoded as i for IN arguments, o for OUT arguments, b for INOUT arguments. If all the arguments are IN arguments, this field will be null. Note that subscripts correspond to positions of proallargtypes not proargtypes"
+       ::= { pgsqlPgProcEntry 15 }
+
+pgsqlPgProcProargnames                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An array with the names of the function arguments. Arguments without a name are set to empty strings in the array. If none of the arguments have a name, this field will be null. Note that subscripts correspond to positions of proallargtypes not proargtypes"
+       ::= { pgsqlPgProcEntry 16 }
+
+pgsqlPgProcProsrc                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "This tells the function handler how to invoke the function. It might be the actual source code of the function for interpreted languages, a link symbol, a file name, or just about anything else, depending on the implementation language/call convention"
+       ::= { pgsqlPgProcEntry 17 }
+
+pgsqlPgProcProbin                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Additional information about how to invoke the function. Again, the interpretation is language-specific"
+       ::= { pgsqlPgProcEntry 18 }
+
+pgsqlPgProcProacl                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgProcEntry 19 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_proc.tbldef b/pgsql_mib_pieces/pg_proc.tbldef
new file mode 100644 (file)
index 0000000..bfaf91e
--- /dev/null
@@ -0,0 +1,20 @@
+pg_proc        "The catalog pg_proc stores information about functions (or procedures). The table contains data for aggregate functions as well as plain functions. If proisagg is true, there should be a matching row in pg_aggregate."      "Represents a single stored procedure"  pgsqlCatalogTables      26      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+proname        DisplayString   "Name of the function"          
+pronamespace   INTEGER "The OID of the namespace that contains this function"          
+proowner       INTEGER "Owner of the function"         
+prolang        INTEGER "Implementation language or call interface of this function"            
+proisagg       TruthValue      "Function is an aggregate function"             
+prosecdef      TruthValue      "Function is a security definer (i.e., a ""setuid"" function)"          
+proisstrict    TruthValue      "Function returns null if any call argument is null. In that case the function won't actually be called at all. Functions that are not ""strict"" must be prepared to handle null inputs"               
+proretset      TruthValue      "Function returns a set (i.e., multiple values of the specified data type)"             
+provolatile    DisplayString   "provolatile tells whether the function's result depends only on its input arguments, or is affected by outside factors. It is i for ""immutable"" functions, which always deliver the same result for the same inputs. It is s for ""stable"" functions, whose results (for fixed inputs) do not change within a scan. It is v for ""volatile"" functions, whose results may change at any time. (Use v also for functions with side-effects, so that calls to them cannot get optimized away.)"               
+pronargs       INTEGER "Number of arguments"           
+prorettype     INTEGER "Data type of the return value"         
+proargtypes    DisplayString   "An array with the data types of the function arguments. This includes only input arguments (including INOUT arguments), and thus represents the call signature of the function"                
+proallargtypes DisplayString   "An array with the data types of the function arguments. This includes all arguments (including OUT and INOUT arguments); however, if all the arguments are IN arguments, this field will be null. Note that subscripting is 1-based, whereas for historical reasons proargtypes is subscripted from 0"         
+proargmodes    DisplayString   "An array with the modes of the function arguments, encoded as i for IN arguments, o for OUT arguments, b for INOUT arguments. If all the arguments are IN arguments, this field will be null. Note that subscripts correspond to positions of proallargtypes not proargtypes"          
+proargnames    DisplayString   "An array with the names of the function arguments. Arguments without a name are set to empty strings in the array. If none of the arguments have a name, this field will be null. Note that subscripts correspond to positions of proallargtypes not proargtypes"              
+prosrc DisplayString   "This tells the function handler how to invoke the function. It might be the actual source code of the function for interpreted languages, a link symbol, a file name, or just about anything else, depending on the implementation language/call convention"           
+probin DisplayString   "Additional information about how to invoke the function. Again, the interpretation is language-specific"               
+proacl DisplayString   "Access privileges; see GRANT and REVOKE for details"           
diff --git a/pgsql_mib_pieces/pg_rewrite.mib b/pgsql_mib_pieces/pg_rewrite.mib
new file mode 100644 (file)
index 0000000..fdf2540
--- /dev/null
@@ -0,0 +1,95 @@
+pgsqlPgRewriteTable            OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgRewriteEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_rewrite stores rewrite rules for tables and views."
+       ::= { pgsqlCatalogTables 27 }
+
+pgsqlPgRewriteEntry            OBJECT-TYPE
+       SYNTAX          PgsqlPgRewriteEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single rewrite rule"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgRewriteEntryOID }
+       ::= { pgsqlPgRewriteTable 1 }
+
+PgsqlPgRewriteEntry ::=
+       SEQUENCE {
+               pgsqlPgRewriteEntryOID          INTEGER,
+               pgsqlPgRewriteRulename          DisplayString,
+               pgsqlPgRewriteEvClass           INTEGER,
+               pgsqlPgRewriteEvAttr            INTEGER,
+               pgsqlPgRewriteEvType            DisplayString,
+               pgsqlPgRewriteIsInstead         TruthValue,
+               pgsqlPgRewriteEvQual            DisplayString,
+               pgsqlPgRewriteEvAction          DisplayString
+       }
+
+pgsqlPgRewriteEntryOID                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgRewriteEntry 1 }
+
+pgsqlPgRewriteRulename                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Rule name"
+       ::= { pgsqlPgRewriteEntry 2 }
+
+pgsqlPgRewriteEvClass                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this rule is for"
+       ::= { pgsqlPgRewriteEntry 3 }
+
+pgsqlPgRewriteEvAttr                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The column this rule is for (currently, always zero to indicate the whole table)"
+       ::= { pgsqlPgRewriteEntry 4 }
+
+pgsqlPgRewriteEvType                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Event type that the rule is for: 1 = SELECT , 2 = UPDATE , 3 = INSERT , 4 = DELETE"
+       ::= { pgsqlPgRewriteEntry 5 }
+
+pgsqlPgRewriteIsInstead                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if the rule is an INSTEAD rule"
+       ::= { pgsqlPgRewriteEntry 6 }
+
+pgsqlPgRewriteEvQual                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Expression tree (in the form of a nodeToString() representation) for the rule's qualifying condition"
+       ::= { pgsqlPgRewriteEntry 7 }
+
+pgsqlPgRewriteEvAction                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Query tree (in the form of a nodeToString() representation) for the rule's action"
+       ::= { pgsqlPgRewriteEntry 8 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_rewrite.tbldef b/pgsql_mib_pieces/pg_rewrite.tbldef
new file mode 100644 (file)
index 0000000..8b9d02d
--- /dev/null
@@ -0,0 +1,9 @@
+pg_rewrite     "The catalog pg_rewrite stores rewrite rules for tables and views."     "Represents a single rewrite rule"      pgsqlCatalogTables      27      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+rulename       DisplayString   "Rule name"             
+ev_class       INTEGER "The table this rule is for"            
+ev_attr        INTEGER "The column this rule is for (currently, always zero to indicate the whole table)"              
+ev_type        DisplayString   "Event type that the rule is for: 1 = SELECT , 2 = UPDATE , 3 = INSERT , 4 = DELETE"            
+is_instead     TruthValue      "True if the rule is an INSTEAD rule"           
+ev_qual        DisplayString   "Expression tree (in the form of a nodeToString() representation) for the rule's qualifying condition"          
+ev_action      DisplayString   "Query tree (in the form of a nodeToString() representation) for the rule's action"             
diff --git a/pgsql_mib_pieces/pg_shdepend.mib b/pgsql_mib_pieces/pg_shdepend.mib
new file mode 100644 (file)
index 0000000..4601091
--- /dev/null
@@ -0,0 +1,86 @@
+pgsqlPgShdependTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgShdependEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_shdepend records the dependency relationships between database objects and shared objects, such as roles. This information allows PostgreSQL to ensure that those objects are unreferenced before attempting to delete them. See also pg_depend, which performs a similar function for dependencies involving objects within a single database. Unlike most system catalogs, pg_shdepend is shared across all databases of a cluster: there is only one copy of pg_shdepend per cluster, not one per database."
+       ::= { pgsqlCatalogTables 28 }
+
+pgsqlPgShdependEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgShdependEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single shared-object dependency"
+       INDEX  { pgsnmpdConnID, pgsqlPgShdependEntryOID }
+       ::= { pgsqlPgShdependTable 1 }
+
+PgsqlPgShdependEntry ::=
+       SEQUENCE {
+               pgsqlPgShdependEntryOID         INTEGER,
+               pgsqlPgShdependDbid             INTEGER,
+               pgsqlPgShdependClassid          INTEGER,
+               pgsqlPgShdependObjid            INTEGER,
+               pgsqlPgShdependRefclassid               INTEGER,
+               pgsqlPgShdependRefobjid         INTEGER,
+               pgsqlPgShdependDeptype          DisplayString
+       }
+
+pgsqlPgShdependEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgShdependEntry 1 }
+
+pgsqlPgShdependDbid                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the database the dependent object is in, or zero for a shared object"
+       ::= { pgsqlPgShdependEntry 2 }
+
+pgsqlPgShdependClassid                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog the dependent object is in"
+       ::= { pgsqlPgShdependEntry 3 }
+
+pgsqlPgShdependObjid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the specific dependent object"
+       ::= { pgsqlPgShdependEntry 4 }
+
+pgsqlPgShdependRefclassid                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog the referenced object is in (must be a shared catalog)"
+       ::= { pgsqlPgShdependEntry 5 }
+
+pgsqlPgShdependRefobjid                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the specific referenced object"
+       ::= { pgsqlPgShdependEntry 6 }
+
+pgsqlPgShdependDeptype                 OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code defining the specific semantics of this dependency relationship; see text"
+       ::= { pgsqlPgShdependEntry 7 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_shdepend.tbldef b/pgsql_mib_pieces/pg_shdepend.tbldef
new file mode 100644 (file)
index 0000000..1b13b72
--- /dev/null
@@ -0,0 +1,7 @@
+pg_shdepend    "The catalog pg_shdepend records the dependency relationships between database objects and shared objects, such as roles. This information allows PostgreSQL to ensure that those objects are unreferenced before attempting to delete them. See also pg_depend, which performs a similar function for dependencies involving objects within a single database. Unlike most system catalogs, pg_shdepend is shared across all databases of a cluster: there is only one copy of pg_shdepend per cluster, not one per database." "Represents a single shared-object dependency"  pgsqlCatalogTables      28      "pgsnmpdConnID, pgsqlPgShdependDbid, pgsqlPgShdependClassid, pgsqlPgShdependObjid"
+dbid   INTEGER "The OID of the database the dependent object is in, or zero for a shared object"               
+classid        INTEGER "The OID of the system catalog the dependent object is in"              
+objid  INTEGER "The OID of the specific dependent object"              
+refclassid     INTEGER "The OID of the system catalog the referenced object is in (must be a shared catalog)"          
+refobjid       INTEGER "The OID of the specific referenced object"             
+deptype        DisplayString   "A code defining the specific semantics of this dependency relationship; see text"              
diff --git a/pgsql_mib_pieces/pg_shdescription.mib b/pgsql_mib_pieces/pg_shdescription.mib
new file mode 100644 (file)
index 0000000..fa44d5c
--- /dev/null
@@ -0,0 +1,59 @@
+pgsqlPgShdescriptionTable              OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgShdescriptionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_shdescription stores optional descriptions (comments) for shared database objects. Descriptions can be manipulated with the COMMENT command and viewed with psql's \d commands. See also pg_description, which performs a similar function for descriptions involving objects within a single database. Unlike most system catalogs, pg_shdescription is shared across all databases of a cluster: there is only one copy of pg_shdescription per cluster, not one per database."
+       ::= { pgsqlCatalogTables 29 }
+
+pgsqlPgShdescriptionEntry              OBJECT-TYPE
+       SYNTAX          PgsqlPgShdescriptionEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single shared object description"
+       INDEX  { pgsnmpdConnID, pgsqlPgShdescriptionEntryOID }
+       ::= { pgsqlPgShdescriptionTable 1 }
+
+PgsqlPgShdescriptionEntry ::=
+       SEQUENCE {
+               pgsqlPgShdescriptionEntryOID            INTEGER,
+               pgsqlPgShdescriptionObjoid              INTEGER,
+               pgsqlPgShdescriptionClassoid            INTEGER,
+               pgsqlPgShdescriptionDescription         DisplayString
+       }
+
+pgsqlPgShdescriptionEntryOID                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgShdescriptionEntry 1 }
+
+pgsqlPgShdescriptionObjoid                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the object this description pertains to"
+       ::= { pgsqlPgShdescriptionEntry 2 }
+
+pgsqlPgShdescriptionClassoid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the system catalog this object appears in"
+       ::= { pgsqlPgShdescriptionEntry 3 }
+
+pgsqlPgShdescriptionDescription                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Arbitrary text that serves as the description of this object"
+       ::= { pgsqlPgShdescriptionEntry 4 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_shdescription.tbldef b/pgsql_mib_pieces/pg_shdescription.tbldef
new file mode 100644 (file)
index 0000000..c122ef2
--- /dev/null
@@ -0,0 +1,4 @@
+pg_shdescription       "The catalog pg_shdescription stores optional descriptions (comments) for shared database objects. Descriptions can be manipulated with the COMMENT command and viewed with psql's \d commands. See also pg_description, which performs a similar function for descriptions involving objects within a single database. Unlike most system catalogs, pg_shdescription is shared across all databases of a cluster: there is only one copy of pg_shdescription per cluster, not one per database."       "Represents a single shared object description" pgsqlCatalogTables      29      "pgsnmpdConnID, pgsqlPgShdescriptionObjid"
+objoid INTEGER "The OID of the object this description pertains to"            
+classoid       INTEGER "The OID of the system catalog this object appears in"          
+description    DisplayString   "Arbitrary text that serves as the description of this object"          
diff --git a/pgsql_mib_pieces/pg_statistic.mib b/pgsql_mib_pieces/pg_statistic.mib
new file mode 100644 (file)
index 0000000..e86f14d
--- /dev/null
@@ -0,0 +1,221 @@
+pgsqlPgStatisticTable          OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgStatisticEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_statistic stores statistical data about the contents of the database. Entries are created by ANALYZE and subsequently used by the query planner. There is one entry for each table column that has been analyzed. Note that all the statistical data is inherently approximate, even assuming that it is up-to-date. pg_statistic also stores statistical data about the values of index expressions. These are described as if they were actual data columns; in particular, starelid references the index. No entry is made for an ordinary non-expression index column, however, since it would be redundant with the entry for the underlying table column. Since different kinds of statistics may be appropriate for different kinds of data, pg_statistic is designed not to assume very much about what sort of statistics it stores. Only extremely general statistics (such as nullness) are given dedicated columns in pg_statistic. Everything else is stored in 'slots', which are groups of associated columns whose content is identified by a code number in one of the slot's columns. For more information see src/include/catalog/pg_statistic.h. pg_statistic should not be readable by the public, since even statistical information about a table's contents may be considered sensitive. (Example: minimum and maximum values of a salary column might be quite interesting.) pg_stats is a publicly readable view on pg_statistic that only exposes information about those tables that are readable by the current user."
+       ::= { pgsqlCatalogTables 30 }
+
+pgsqlPgStatisticEntry          OBJECT-TYPE
+       SYNTAX          PgsqlPgStatisticEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents statistics data for a single column"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgStatisticEntryOID }
+       ::= { pgsqlPgStatisticTable 1 }
+
+PgsqlPgStatisticEntry ::=
+       SEQUENCE {
+               pgsqlPgStatisticEntryOID                INTEGER,
+               pgsqlPgStatisticStarelid                INTEGER,
+               pgsqlPgStatisticStaattnum               INTEGER,
+               pgsqlPgStatisticStanullfrac             Float,
+               pgsqlPgStatisticStawidth                INTEGER,
+               pgsqlPgStatisticStadistinct             Float,
+               pgsqlPgStatisticStakind1                INTEGER,
+               pgsqlPgStatisticStakind2                INTEGER,
+               pgsqlPgStatisticStakind3                INTEGER,
+               pgsqlPgStatisticStakind4                INTEGER,
+               pgsqlPgStatisticStaop1          INTEGER,
+               pgsqlPgStatisticStaop2          INTEGER,
+               pgsqlPgStatisticStaop3          INTEGER,
+               pgsqlPgStatisticStaop4          INTEGER,
+               pgsqlPgStatisticStanumbers1             DisplayString,
+               pgsqlPgStatisticStanumbers2             DisplayString,
+               pgsqlPgStatisticStanumbers3             DisplayString,
+               pgsqlPgStatisticStanumbers4             DisplayString,
+               pgsqlPgStatisticStavalues1              DisplayString,
+               pgsqlPgStatisticStavalues2              DisplayString,
+               pgsqlPgStatisticStavalues3              DisplayString,
+               pgsqlPgStatisticStavalues4              DisplayString
+       }
+
+pgsqlPgStatisticEntryOID                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgStatisticEntry 1 }
+
+pgsqlPgStatisticStarelid                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table or index that the described column belongs to"
+       ::= { pgsqlPgStatisticEntry 2 }
+
+pgsqlPgStatisticStaattnum                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of the described column"
+       ::= { pgsqlPgStatisticEntry 3 }
+
+pgsqlPgStatisticStanullfrac                    OBJECT-TYPE
+       SYNTAX          Float
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The fraction of the column's entries that are null"
+       ::= { pgsqlPgStatisticEntry 4 }
+
+pgsqlPgStatisticStawidth                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The average stored width, in bytes, of nonnull entries"
+       ::= { pgsqlPgStatisticEntry 5 }
+
+pgsqlPgStatisticStadistinct                    OBJECT-TYPE
+       SYNTAX          Float
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The number of distinct nonnull data values in the column. A value greater than zero is the actual number of distinct values. A value less than zero is the negative of a fraction of the number of rows in the table (for example, a column in which values appear about twice on the average could be represented by stadistinct = -0.5). A zero value means the number of distinct values is unknown"
+       ::= { pgsqlPgStatisticEntry 6 }
+
+pgsqlPgStatisticStakind1                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code number indicating the kind of statistics stored in the 1st 'slot' of the pg_statistic row"
+       ::= { pgsqlPgStatisticEntry 7 }
+
+pgsqlPgStatisticStakind2                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code number indicating the kind of statistics stored in the 2nd 'slot' of the pg_statistic row"
+       ::= { pgsqlPgStatisticEntry 8 }
+
+pgsqlPgStatisticStakind3                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code number indicating the kind of statistics stored in the 3rd 'slot' of the pg_statistic row"
+       ::= { pgsqlPgStatisticEntry 9 }
+
+pgsqlPgStatisticStakind4                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A code number indicating the kind of statistics stored in the 4th 'slot' of the pg_statistic row"
+       ::= { pgsqlPgStatisticEntry 10 }
+
+pgsqlPgStatisticStaop1                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An operator used to derive the statistics stored in the 1st 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"
+       ::= { pgsqlPgStatisticEntry 11 }
+
+pgsqlPgStatisticStaop2                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An operator used to derive the statistics stored in the 2nd 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"
+       ::= { pgsqlPgStatisticEntry 12 }
+
+pgsqlPgStatisticStaop3                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An operator used to derive the statistics stored in the 3rd 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"
+       ::= { pgsqlPgStatisticEntry 13 }
+
+pgsqlPgStatisticStaop4                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "An operator used to derive the statistics stored in the 4th 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"
+       ::= { pgsqlPgStatisticEntry 14 }
+
+pgsqlPgStatisticStanumbers1                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Numerical statistics of the appropriate kind for the 1st 'slot' , or NULL if the slot kind does not involve numerical values"
+       ::= { pgsqlPgStatisticEntry 15 }
+
+pgsqlPgStatisticStanumbers2                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Numerical statistics of the appropriate kind for the 2nd 'slot' , or NULL if the slot kind does not involve numerical values"
+       ::= { pgsqlPgStatisticEntry 16 }
+
+pgsqlPgStatisticStanumbers3                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Numerical statistics of the appropriate kind for the 3rd 'slot' , or NULL if the slot kind does not involve numerical values"
+       ::= { pgsqlPgStatisticEntry 17 }
+
+pgsqlPgStatisticStanumbers4                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Numerical statistics of the appropriate kind for the 4th 'slot' , or NULL if the slot kind does not involve numerical values"
+       ::= { pgsqlPgStatisticEntry 18 }
+
+pgsqlPgStatisticStavalues1                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Column data values of the appropriate kind for the 1st 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"
+       ::= { pgsqlPgStatisticEntry 19 }
+
+pgsqlPgStatisticStavalues2                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Column data values of the appropriate kind for the 2nd 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"
+       ::= { pgsqlPgStatisticEntry 20 }
+
+pgsqlPgStatisticStavalues3                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Column data values of the appropriate kind for the 3rd 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"
+       ::= { pgsqlPgStatisticEntry 21 }
+
+pgsqlPgStatisticStavalues4                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Column data values of the appropriate kind for the 4th 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"
+       ::= { pgsqlPgStatisticEntry 22 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_statistic.tbldef b/pgsql_mib_pieces/pg_statistic.tbldef
new file mode 100644 (file)
index 0000000..8fe824b
--- /dev/null
@@ -0,0 +1,22 @@
+pg_statistic   "The catalog pg_statistic stores statistical data about the contents of the database. Entries are created by ANALYZE and subsequently used by the query planner. There is one entry for each table column that has been analyzed. Note that all the statistical data is inherently approximate, even assuming that it is up-to-date. pg_statistic also stores statistical data about the values of index expressions. These are described as if they were actual data columns; in particular, starelid references the index. No entry is made for an ordinary non-expression index column, however, since it would be redundant with the entry for the underlying table column. Since different kinds of statistics may be appropriate for different kinds of data, pg_statistic is designed not to assume very much about what sort of statistics it stores. Only extremely general statistics (such as nullness) are given dedicated columns in pg_statistic. Everything else is stored in 'slots', which are groups of associated columns whose content is identified by a code number in one of the slot's columns. For more information see src/include/catalog/pg_statistic.h. pg_statistic should not be readable by the public, since even statistical information about a table's contents may be considered sensitive. (Example: minimum and maximum values of a salary column might be quite interesting.) pg_stats is a publicly readable view on pg_statistic that only exposes information about those tables that are readable by the current user."     "Represents statistics data for a single column"        pgsqlCatalogTables      30      "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgStatisticStarelid, pgsqlPgStatisticStaattnum"
+starelid       INTEGER "The table or index that the described column belongs to"               
+staattnum      INTEGER "The number of the described column"            
+stanullfrac    Float   "The fraction of the column's entries that are null"            
+stawidth       INTEGER "The average stored width, in bytes, of nonnull entries"                
+stadistinct    Float   "The number of distinct nonnull data values in the column. A value greater than zero is the actual number of distinct values. A value less than zero is the negative of a fraction of the number of rows in the table (for example, a column in which values appear about twice on the average could be represented by stadistinct = -0.5). A zero value means the number of distinct values is unknown"                
+"stakind1"     INTEGER "A code number indicating the kind of statistics stored in the 1st 'slot' of the pg_statistic row"              
+"stakind2"     INTEGER "A code number indicating the kind of statistics stored in the 2nd 'slot' of the pg_statistic row"              
+"stakind3"     INTEGER "A code number indicating the kind of statistics stored in the 3rd 'slot' of the pg_statistic row"              
+"stakind4"     INTEGER "A code number indicating the kind of statistics stored in the 4th 'slot' of the pg_statistic row"              
+"staop1"       INTEGER "An operator used to derive the statistics stored in the 1st 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"          
+"staop2"       INTEGER "An operator used to derive the statistics stored in the 2nd 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"          
+"staop3"       INTEGER "An operator used to derive the statistics stored in the 3rd 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"          
+"staop4"       INTEGER "An operator used to derive the statistics stored in the 4th 'slot' . For example, a histogram slot would show the < operator that defines the sort order of the data"          
+"stanumbers1"  DisplayString   "Numerical statistics of the appropriate kind for the 1st 'slot' , or NULL if the slot kind does not involve numerical values"          
+"stanumbers2"  DisplayString   "Numerical statistics of the appropriate kind for the 2nd 'slot' , or NULL if the slot kind does not involve numerical values"          
+"stanumbers3"  DisplayString   "Numerical statistics of the appropriate kind for the 3rd 'slot' , or NULL if the slot kind does not involve numerical values"          
+"stanumbers4"  DisplayString   "Numerical statistics of the appropriate kind for the 4th 'slot' , or NULL if the slot kind does not involve numerical values"          
+"stavalues1"   DisplayString   "Column data values of the appropriate kind for the 1st 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"                
+"stavalues2"   DisplayString   "Column data values of the appropriate kind for the 2nd 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"                
+"stavalues3"   DisplayString   "Column data values of the appropriate kind for the 3rd 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"                
+"stavalues4"   DisplayString   "Column data values of the appropriate kind for the 4th 'slot' , or NULL if the slot kind does not store any data values. Each array's element values are actually of the specific column's data type, so there is no way to define these columns' type more specifically than anyarray"                
diff --git a/pgsql_mib_pieces/pg_tablespace.mib b/pgsql_mib_pieces/pg_tablespace.mib
new file mode 100644 (file)
index 0000000..a37bfea
--- /dev/null
@@ -0,0 +1,68 @@
+pgsqlPgTablespaceTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTablespaceEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_tablespace stores information about the available tablespaces. Tables can be placed in particular tablespaces to aid administration of disk layout. Unlike most system catalogs, pg_tablespace is shared across all databases of a cluster: there is only one copy of pg_tablespace per cluster, not one per database."
+       ::= { pgsqlCatalogTables 31 }
+
+pgsqlPgTablespaceEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgTablespaceEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single tablespace"
+       INDEX  { pgsnmpdConnID, pgsqlPgTablespaceEntryOID }
+       ::= { pgsqlPgTablespaceTable 1 }
+
+PgsqlPgTablespaceEntry ::=
+       SEQUENCE {
+               pgsqlPgTablespaceEntryOID               INTEGER,
+               pgsqlPgTablespaceSpcname                DisplayString,
+               pgsqlPgTablespaceSpcowner               INTEGER,
+               pgsqlPgTablespaceSpclocation            DisplayString,
+               pgsqlPgTablespaceSpcacl         DisplayString
+       }
+
+pgsqlPgTablespaceEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTablespaceEntry 1 }
+
+pgsqlPgTablespaceSpcname                       OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Tablespace name"
+       ::= { pgsqlPgTablespaceEntry 2 }
+
+pgsqlPgTablespaceSpcowner                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the tablespace, usually the user who created it"
+       ::= { pgsqlPgTablespaceEntry 3 }
+
+pgsqlPgTablespaceSpclocation                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Location (directory path) of the tablespace"
+       ::= { pgsqlPgTablespaceEntry 4 }
+
+pgsqlPgTablespaceSpcacl                        OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Access privileges; see GRANT and REVOKE for details"
+       ::= { pgsqlPgTablespaceEntry 5 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_tablespace.tbldef b/pgsql_mib_pieces/pg_tablespace.tbldef
new file mode 100644 (file)
index 0000000..83cb641
--- /dev/null
@@ -0,0 +1,6 @@
+pg_tablespace  "The catalog pg_tablespace stores information about the available tablespaces. Tables can be placed in particular tablespaces to aid administration of disk layout. Unlike most system catalogs, pg_tablespace is shared across all databases of a cluster: there is only one copy of pg_tablespace per cluster, not one per database." "Represents a single tablespace"        pgsqlCatalogTables      31      "pgsnmpdConnID, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+spcname        DisplayString   "Tablespace name"               
+spcowner       INTEGER "Owner of the tablespace, usually the user who created it"              
+spclocation    DisplayString   "Location (directory path) of the tablespace"           
+spcacl DisplayString   "Access privileges; see GRANT and REVOKE for details"           
diff --git a/pgsql_mib_pieces/pg_trigger.mib b/pgsql_mib_pieces/pg_trigger.mib
new file mode 100644 (file)
index 0000000..3713a3a
--- /dev/null
@@ -0,0 +1,149 @@
+pgsqlPgTriggerTable            OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTriggerEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_trigger stores triggers on tables."
+       ::= { pgsqlCatalogTables 32 }
+
+pgsqlPgTriggerEntry            OBJECT-TYPE
+       SYNTAX          PgsqlPgTriggerEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single trigger"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTriggerEntryOID }
+       ::= { pgsqlPgTriggerTable 1 }
+
+PgsqlPgTriggerEntry ::=
+       SEQUENCE {
+               pgsqlPgTriggerEntryOID          INTEGER,
+               pgsqlPgTriggerTgrelid           INTEGER,
+               pgsqlPgTriggerTgname            DisplayString,
+               pgsqlPgTriggerTgfoid            INTEGER,
+               pgsqlPgTriggerTgtype            INTEGER,
+               pgsqlPgTriggerTgenabled         TruthValue,
+               pgsqlPgTriggerTgisconstraint            TruthValue,
+               pgsqlPgTriggerTgconstrname              DisplayString,
+               pgsqlPgTriggerTgconstrrelid             INTEGER,
+               pgsqlPgTriggerTgdeferrable              TruthValue,
+               pgsqlPgTriggerTginitdeferred            TruthValue,
+               pgsqlPgTriggerTgnargs           INTEGER,
+               pgsqlPgTriggerTgattr            DisplayString,
+               pgsqlPgTriggerTgargs            DisplayString
+       }
+
+pgsqlPgTriggerEntryOID                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTriggerEntry 1 }
+
+pgsqlPgTriggerTgrelid                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table this trigger is on"
+       ::= { pgsqlPgTriggerEntry 2 }
+
+pgsqlPgTriggerTgname                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Trigger name (must be unique among triggers of same table)"
+       ::= { pgsqlPgTriggerEntry 3 }
+
+pgsqlPgTriggerTgfoid                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The function to be called"
+       ::= { pgsqlPgTriggerEntry 4 }
+
+pgsqlPgTriggerTgtype                   OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Bit mask identifying trigger conditions"
+       ::= { pgsqlPgTriggerEntry 5 }
+
+pgsqlPgTriggerTgenabled                        OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if trigger is enabled"
+       ::= { pgsqlPgTriggerEntry 6 }
+
+pgsqlPgTriggerTgisconstraint                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if trigger implements a referential integrity constraint"
+       ::= { pgsqlPgTriggerEntry 7 }
+
+pgsqlPgTriggerTgconstrname                     OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Referential integrity constraint name"
+       ::= { pgsqlPgTriggerEntry 8 }
+
+pgsqlPgTriggerTgconstrrelid                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The table referenced by an referential integrity constraint"
+       ::= { pgsqlPgTriggerEntry 9 }
+
+pgsqlPgTriggerTgdeferrable                     OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if deferrable"
+       ::= { pgsqlPgTriggerEntry 10 }
+
+pgsqlPgTriggerTginitdeferred                   OBJECT-TYPE
+       SYNTAX          TruthValue
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if initially deferred"
+       ::= { pgsqlPgTriggerEntry 11 }
+
+pgsqlPgTriggerTgnargs                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Number of argument strings passed to trigger function"
+       ::= { pgsqlPgTriggerEntry 12 }
+
+pgsqlPgTriggerTgattr                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Currently unused"
+       ::= { pgsqlPgTriggerEntry 13 }
+
+pgsqlPgTriggerTgargs                   OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Argument strings to pass to trigger, each NULL-terminated"
+       ::= { pgsqlPgTriggerEntry 14 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_trigger.tbldef b/pgsql_mib_pieces/pg_trigger.tbldef
new file mode 100644 (file)
index 0000000..ce5a8b9
--- /dev/null
@@ -0,0 +1,15 @@
+pg_trigger     "The catalog pg_trigger stores triggers on tables."     "Represents a single trigger"   pgsqlCatalogTables      32      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+tgrelid        INTEGER "The table this trigger is on"          
+tgname DisplayString   "Trigger name (must be unique among triggers of same table)"            
+tgfoid INTEGER "The function to be called"             
+tgtype INTEGER "Bit mask identifying trigger conditions"               
+tgenabled      TruthValue      "True if trigger is enabled"            
+tgisconstraint TruthValue      "True if trigger implements a referential integrity constraint"         
+tgconstrname   DisplayString   "Referential integrity constraint name"         
+tgconstrrelid  INTEGER "The table referenced by an referential integrity constraint"           
+tgdeferrable   TruthValue      "True if deferrable"            
+tginitdeferred TruthValue      "True if initially deferred"            
+tgnargs        INTEGER "Number of argument strings passed to trigger function"         
+tgattr DisplayString   "Currently unused"              
+tgargs DisplayString   "Argument strings to pass to trigger, each NULL-terminated"             
diff --git a/pgsql_mib_pieces/pg_ts_config.mib b/pgsql_mib_pieces/pg_ts_config.mib
new file mode 100644 (file)
index 0000000..3c845df
--- /dev/null
@@ -0,0 +1,68 @@
+pgsqlPgTsConfigTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTsConfigEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_ts_config catalog contains entries representing text search configurations. A configuration specifies a particular text search parser and a list of dictionaries to use for each of the parser's output token types. The parser is shown in the pg_ts_config entry, but the token-to-dictionary mapping is defined by subsidiary entries in pg_ts_config_map."
+       ::= { pgsqlCatalogTables 36 }
+
+pgsqlPgTsConfigEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgTsConfigEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_ts_config entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTsConfigEntryOID }
+       ::= { pgsqlPgTsConfigTable 1 }
+
+PgsqlPgTsConfigEntry ::=
+       SEQUENCE {
+               pgsqlPgTsConfigEntryOID         INTEGER,
+               pgsqlPgTsConfigCfgname          DisplayString ,
+               pgsqlPgTsConfigCfgnamespace             INTEGER,
+               pgsqlPgTsConfigCfgowner         INTEGER,
+               pgsqlPgTsConfigCfgparser                INTEGER
+       }
+
+pgsqlPgTsConfigEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTsConfigEntry 1 }
+
+pgsqlPgTsConfigCfgname                 OBJECT-TYPE
+       SYNTAX          DisplayString 
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Text search configuration name"
+       ::= { pgsqlPgTsConfigEntry 2 }
+
+pgsqlPgTsConfigCfgnamespace                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this configuration"
+       ::= { pgsqlPgTsConfigEntry 3 }
+
+pgsqlPgTsConfigCfgowner                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the configuration"
+       ::= { pgsqlPgTsConfigEntry 4 }
+
+pgsqlPgTsConfigCfgparser                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the text search parser for this configuration"
+       ::= { pgsqlPgTsConfigEntry 5 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_ts_config.tbldef b/pgsql_mib_pieces/pg_ts_config.tbldef
new file mode 100644 (file)
index 0000000..50932e6
--- /dev/null
@@ -0,0 +1,6 @@
+pg_ts_config   "The pg_ts_config catalog contains entries representing text search configurations. A configuration specifies a particular text search parser and a list of dictionaries to use for each of the parser's output token types. The parser is shown in the pg_ts_config entry, but the token-to-dictionary mapping is defined by subsidiary entries in pg_ts_config_map."  "pg_ts_config entry"    pgsqlCatalogTables      36      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+cfgname        DisplayString   Text search configuration name
+cfgnamespace   INTEGER The OID of the namespace that contains this configuration
+cfgowner       INTEGER Owner of the configuration
+cfgparser      INTEGER The OID of the text search parser for this configuration
diff --git a/pgsql_mib_pieces/pg_ts_config_map.mib b/pgsql_mib_pieces/pg_ts_config_map.mib
new file mode 100644 (file)
index 0000000..15c20e9
--- /dev/null
@@ -0,0 +1,68 @@
+pgsqlPgTsConfigMapTable                OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTsConfigMapEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_ts_config_map catalog contains entries showing which text search dictionaries should be consulted, and in what order, for each output token type of each text search configuration's parser."
+       ::= { pgsqlCatalogTables 37 }
+
+pgsqlPgTsConfigMapEntry                OBJECT-TYPE
+       SYNTAX          PgsqlPgTsConfigMapEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_ts_config_map entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTsConfigMapEntryOID }
+       ::= { pgsqlPgTsConfigMapTable 1 }
+
+PgsqlPgTsConfigMapEntry ::=
+       SEQUENCE {
+               pgsqlPgTsConfigMapEntryOID              INTEGER,
+               pgsqlPgTsConfigMapMapcfg                INTEGER,
+               pgsqlPgTsConfigMapMaptokentype          INTEGER,
+               pgsqlPgTsConfigMapMapseqno              INTEGER,
+               pgsqlPgTsConfigMapMapdict               INTEGER
+       }
+
+pgsqlPgTsConfigMapEntryOID                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTsConfigMapEntry 1 }
+
+pgsqlPgTsConfigMapMapcfg                       OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the pg_ts_config entry owning this map entry"
+       ::= { pgsqlPgTsConfigMapEntry 2 }
+
+pgsqlPgTsConfigMapMaptokentype                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "A token type emitted by the configuration's parser"
+       ::= { pgsqlPgTsConfigMapEntry 3 }
+
+pgsqlPgTsConfigMapMapseqno                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Order in which to consult this entry (lower mapseqnos first)"
+       ::= { pgsqlPgTsConfigMapEntry 4 }
+
+pgsqlPgTsConfigMapMapdict                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the text search dictionary to consult"
+       ::= { pgsqlPgTsConfigMapEntry 5 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_ts_config_map.tbldef b/pgsql_mib_pieces/pg_ts_config_map.tbldef
new file mode 100644 (file)
index 0000000..8937266
--- /dev/null
@@ -0,0 +1,5 @@
+pg_ts_config_map       "The pg_ts_config_map catalog contains entries showing which text search dictionaries should be consulted, and in what order, for each output token type of each text search configuration's parser."   "pg_ts_config_map entry"        pgsqlCatalogTables      37      "pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTsConfigMapMapcfg, pgsqlPgTsConfigMapMapseqno"
+mapcfg INTEGER The OID of the pg_ts_config entry owning this map entry
+mapseqno       INTEGER Order in which to consult this entry (lower mapseqnos first)
+maptokentype   INTEGER A token type emitted by the configuration's parser
+mapdict        INTEGER The OID of the text search dictionary to consult
diff --git a/pgsql_mib_pieces/pg_ts_dict.mib b/pgsql_mib_pieces/pg_ts_dict.mib
new file mode 100644 (file)
index 0000000..7412db6
--- /dev/null
@@ -0,0 +1,77 @@
+pgsqlPgTsDictTable             OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTsDictEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_ts_dict catalog contains entries defining text search dictionaries. A dictionary depends on a text search template, which specifies all the implementation functions needed; the dictionary itself provides values for the user-settable parameters supported by the template. This division of labor allows dictionaries to be created by unprivileged users. The parameters are specified by a text string dictinitoption, whose format and meaning vary depending on the template."
+       ::= { pgsqlCatalogTables 38 }
+
+pgsqlPgTsDictEntry             OBJECT-TYPE
+       SYNTAX          PgsqlPgTsDictEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_ts_dict entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTsDictEntryOID }
+       ::= { pgsqlPgTsDictTable 1 }
+
+PgsqlPgTsDictEntry ::=
+       SEQUENCE {
+               pgsqlPgTsDictEntryOID           INTEGER,
+               pgsqlPgTsDictDictname           DisplayString ,
+               pgsqlPgTsDictDictnamespace              INTEGER,
+               pgsqlPgTsDictDictowner          INTEGER,
+               pgsqlPgTsDictDicttemplate               INTEGER,
+               pgsqlPgTsDictDictinitoption             DisplayString
+       }
+
+pgsqlPgTsDictEntryOID                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTsDictEntry 1 }
+
+pgsqlPgTsDictDictname                  OBJECT-TYPE
+       SYNTAX          DisplayString 
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Text search dictionary name"
+       ::= { pgsqlPgTsDictEntry 2 }
+
+pgsqlPgTsDictDictnamespace                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this dictionary"
+       ::= { pgsqlPgTsDictEntry 3 }
+
+pgsqlPgTsDictDictowner                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the dictionary"
+       ::= { pgsqlPgTsDictEntry 4 }
+
+pgsqlPgTsDictDicttemplate                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the text search template for this dictionary"
+       ::= { pgsqlPgTsDictEntry 5 }
+
+pgsqlPgTsDictDictinitoption                    OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Initialization option string for the template"
+       ::= { pgsqlPgTsDictEntry 6 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_ts_dict.tbldef b/pgsql_mib_pieces/pg_ts_dict.tbldef
new file mode 100644 (file)
index 0000000..a465acf
--- /dev/null
@@ -0,0 +1,7 @@
+pg_ts_dict     "The pg_ts_dict catalog contains entries defining text search dictionaries. A dictionary depends on a text search template, which specifies all the implementation functions needed; the dictionary itself provides values for the user-settable parameters supported by the template. This division of labor allows dictionaries to be created by unprivileged users. The parameters are specified by a text string dictinitoption, whose format and meaning vary depending on the template."  "pg_ts_dict entry"      pgsqlCatalogTables      38      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+dictname       DisplayString   Text search dictionary name
+dictnamespace  INTEGER The OID of the namespace that contains this dictionary
+dictowner      INTEGER Owner of the dictionary
+dicttemplate   INTEGER The OID of the text search template for this dictionary
+dictinitoption DisplayString   Initialization option string for the template
diff --git a/pgsql_mib_pieces/pg_ts_parser.mib b/pgsql_mib_pieces/pg_ts_parser.mib
new file mode 100644 (file)
index 0000000..53c33ae
--- /dev/null
@@ -0,0 +1,95 @@
+pgsqlPgTsParserTable           OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTsParserEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_ts_parser catalog contains entries defining text search parsers. A parser is responsible for splitting input text into lexemes and assigning a token type to each lexeme. Since a parser must be implemented by C-language-level functions, creation of new parsers is restricted to database superusers."
+       ::= { pgsqlCatalogTables 39 }
+
+pgsqlPgTsParserEntry           OBJECT-TYPE
+       SYNTAX          PgsqlPgTsParserEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_ts_parser entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTsParserEntryOID }
+       ::= { pgsqlPgTsParserTable 1 }
+
+PgsqlPgTsParserEntry ::=
+       SEQUENCE {
+               pgsqlPgTsParserEntryOID         INTEGER,
+               pgsqlPgTsParserPrsname          DisplayString ,
+               pgsqlPgTsParserPrsnamespace             INTEGER,
+               pgsqlPgTsParserPrsstart         INTEGER,
+               pgsqlPgTsParserPrstoken         INTEGER,
+               pgsqlPgTsParserPrsend           INTEGER,
+               pgsqlPgTsParserPrsheadline              INTEGER,
+               pgsqlPgTsParserPrslextype               INTEGER
+       }
+
+pgsqlPgTsParserEntryOID                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTsParserEntry 1 }
+
+pgsqlPgTsParserPrsname                 OBJECT-TYPE
+       SYNTAX          DisplayString 
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Text search parser name"
+       ::= { pgsqlPgTsParserEntry 2 }
+
+pgsqlPgTsParserPrsnamespace                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this parser"
+       ::= { pgsqlPgTsParserEntry 3 }
+
+pgsqlPgTsParserPrsstart                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the parser's startup function"
+       ::= { pgsqlPgTsParserEntry 4 }
+
+pgsqlPgTsParserPrstoken                        OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the parser's next-token function"
+       ::= { pgsqlPgTsParserEntry 5 }
+
+pgsqlPgTsParserPrsend                  OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the parser's shutdown function"
+       ::= { pgsqlPgTsParserEntry 6 }
+
+pgsqlPgTsParserPrsheadline                     OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the parser's headline function"
+       ::= { pgsqlPgTsParserEntry 7 }
+
+pgsqlPgTsParserPrslextype                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the parser's lextype function"
+       ::= { pgsqlPgTsParserEntry 8 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_ts_parser.tbldef b/pgsql_mib_pieces/pg_ts_parser.tbldef
new file mode 100644 (file)
index 0000000..f4fdbe3
--- /dev/null
@@ -0,0 +1,9 @@
+pg_ts_parser   "The pg_ts_parser catalog contains entries defining text search parsers. A parser is responsible for splitting input text into lexemes and assigning a token type to each lexeme. Since a parser must be implemented by C-language-level functions, creation of new parsers is restricted to database superusers."      "pg_ts_parser entry"    pgsqlCatalogTables      39      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+prsname        DisplayString   Text search parser name
+prsnamespace   INTEGER The OID of the namespace that contains this parser
+prsstart       INTEGER OID of the parser's startup function
+prstoken       INTEGER OID of the parser's next-token function
+prsend INTEGER OID of the parser's shutdown function
+prsheadline    INTEGER OID of the parser's headline function
+prslextype     INTEGER OID of the parser's lextype function
diff --git a/pgsql_mib_pieces/pg_ts_template.mib b/pgsql_mib_pieces/pg_ts_template.mib
new file mode 100644 (file)
index 0000000..942f470
--- /dev/null
@@ -0,0 +1,68 @@
+pgsqlPgTsTemplateTable         OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTsTemplateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The pg_ts_template catalog contains entries defining text search templates. A template is the implementation skeleton for a class of text search dictionaries. Since a template must be implemented by C-language-level functions, creation of new templates is restricted to database superusers."
+       ::= { pgsqlCatalogTables 40 }
+
+pgsqlPgTsTemplateEntry         OBJECT-TYPE
+       SYNTAX          PgsqlPgTsTemplateEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "pg_ts_template entry"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTsTemplateEntryOID }
+       ::= { pgsqlPgTsTemplateTable 1 }
+
+PgsqlPgTsTemplateEntry ::=
+       SEQUENCE {
+               pgsqlPgTsTemplateEntryOID               INTEGER,
+               pgsqlPgTsTemplateTmplname               DisplayString,
+               pgsqlPgTsTemplateTmplnamespace          INTEGER,
+               pgsqlPgTsTemplateTmplinit               INTEGER,
+               pgsqlPgTsTemplateTmpllexize             INTEGER
+       }
+
+pgsqlPgTsTemplateEntryOID                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTsTemplateEntry 1 }
+
+pgsqlPgTsTemplateTmplname                      OBJECT-TYPE
+       SYNTAX          DisplayString
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               " Text search template name"
+       ::= { pgsqlPgTsTemplateEntry 2 }
+
+pgsqlPgTsTemplateTmplnamespace                 OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this template"
+       ::= { pgsqlPgTsTemplateEntry 3 }
+
+pgsqlPgTsTemplateTmplinit                      OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the template's initialization function"
+       ::= { pgsqlPgTsTemplateEntry 4 }
+
+pgsqlPgTsTemplateTmpllexize                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "OID of the template's lexize function"
+       ::= { pgsqlPgTsTemplateEntry 5 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_ts_template.tbldef b/pgsql_mib_pieces/pg_ts_template.tbldef
new file mode 100644 (file)
index 0000000..17a502a
--- /dev/null
@@ -0,0 +1,6 @@
+pg_ts_template "The pg_ts_template catalog contains entries defining text search templates. A template is the implementation skeleton for a class of text search dictionaries. Since a template must be implemented by C-language-level functions, creation of new templates is restricted to database superusers."    "pg_ts_template entry"  pgsqlCatalogTables      40      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+tmplname       DisplayString    Text search template name
+tmplnamespace  INTEGER The OID of the namespace that contains this template
+tmplinit       INTEGER OID of the template's initialization function
+tmpllexize     INTEGER OID of the template's lexize function
diff --git a/pgsql_mib_pieces/pg_type.mib b/pgsql_mib_pieces/pg_type.mib
new file mode 100644 (file)
index 0000000..a8c942e
--- /dev/null
@@ -0,0 +1,239 @@
+pgsqlPgTypeTable               OBJECT-TYPE
+       SYNTAX          SEQUENCE OF pgsqlPgTypeEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "The catalog pg_type stores information about data types. Base types (scalar types) are created with CREATE TYPE, and domains with CREATE DOMAIN. A composite type is automatically created for each table in the database, to represent the row structure of the table. It is also possible to create composite types with CREATE TYPE AS."
+       ::= { pgsqlCatalogTables 33 }
+
+pgsqlPgTypeEntry               OBJECT-TYPE
+       SYNTAX          PgsqlPgTypeEntry
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "Represents a single type"
+       INDEX  { pgsnmpdConnID, rdbmsDbIndex, pgsqlPgTypeEntryOID }
+       ::= { pgsqlPgTypeTable 1 }
+
+PgsqlPgTypeEntry ::=
+       SEQUENCE {
+               pgsqlPgTypeEntryOID             INTEGER,
+               pgsqlPgTypeTypname              name,
+               pgsqlPgTypeTypnamespace         oid,
+               pgsqlPgTypeTypowner             oid,
+               pgsqlPgTypeTyplen               int2,
+               pgsqlPgTypeTypbyval             bool,
+               pgsqlPgTypeTyptype              char,
+               pgsqlPgTypeTypisdefined         bool,
+               pgsqlPgTypeTypdelim             char,
+               pgsqlPgTypeTyprelid             oid,
+               pgsqlPgTypeTypelem              oid,
+               pgsqlPgTypeTypinput             regproc,
+               pgsqlPgTypeTypoutput            regproc,
+               pgsqlPgTypeTypreceive           regproc,
+               pgsqlPgTypeTypsend              regproc,
+               pgsqlPgTypeTypanalyze           regproc,
+               pgsqlPgTypeTypalign             char,
+               pgsqlPgTypeTypstorage           char,
+               pgsqlPgTypeTypnotnull           bool,
+               pgsqlPgTypeTypbasetype          oid,
+               pgsqlPgTypeTyptypmod            int4,
+               pgsqlPgTypeTypndims             int4,
+               pgsqlPgTypeTypdefaultbin                text,
+               pgsqlPgTypeTypdefault           text
+       }
+
+pgsqlPgTypeEntryOID                    OBJECT-TYPE
+       SYNTAX          INTEGER
+       MAX-ACCESS      not-accessible
+       STATUS          current
+       DESCRIPTION
+               "OID of this entry"
+       ::= { pgsqlPgTypeEntry 1 }
+
+pgsqlPgTypeTypname                     OBJECT-TYPE
+       SYNTAX          name
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Data type name"
+       ::= { pgsqlPgTypeEntry 2 }
+
+pgsqlPgTypeTypnamespace                        OBJECT-TYPE
+       SYNTAX          oid
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "The OID of the namespace that contains this type"
+       ::= { pgsqlPgTypeEntry 3 }
+
+pgsqlPgTypeTypowner                    OBJECT-TYPE
+       SYNTAX          oid
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Owner of the type"
+       ::= { pgsqlPgTypeEntry 4 }
+
+pgsqlPgTypeTyplen                      OBJECT-TYPE
+       SYNTAX          int2
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "For a fixed-size type, typlen is the number of bytes in the internal representation of the type. But for a variable-length type, typlen is negative. -1 indicates a "
+       ::= { pgsqlPgTypeEntry 5 }
+
+pgsqlPgTypeTypbyval                    OBJECT-TYPE
+       SYNTAX          bool
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typbyval determines whether internal routines pass a value of this type by value or by reference. typbyval had better be false if typlen is not 1, 2, or 4 (or 8 on machines where Datum is 8 bytes). Variable-length types are always passed by reference. Note that typbyval can be false even if the length would allow pass-by-value; this is currently true for type float4 , for example"
+       ::= { pgsqlPgTypeEntry 6 }
+
+pgsqlPgTypeTyptype                     OBJECT-TYPE
+       SYNTAX          char
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typtype is b for a base type, c for a composite type (e.g., a table's row type), d for a domain, or p for a pseudo-type. See also typrelid and typbasetype"
+       ::= { pgsqlPgTypeEntry 7 }
+
+pgsqlPgTypeTypisdefined                        OBJECT-TYPE
+       SYNTAX          bool
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "True if the type is defined, false if this is a placeholder entry for a not-yet-defined type. When typisdefined is false, nothing except the type name, namespace, and OID can be relied on"
+       ::= { pgsqlPgTypeEntry 8 }
+
+pgsqlPgTypeTypdelim                    OBJECT-TYPE
+       SYNTAX          char
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Character that separates two values of this type when parsing array input. Note that the delimiter is associated with the array element data type, not the array data type"
+       ::= { pgsqlPgTypeEntry 9 }
+
+pgsqlPgTypeTyprelid                    OBJECT-TYPE
+       SYNTAX          oid
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this is a composite type (see typtype ), then this column points to the pg_class entry that defines the corresponding table. (For a free-standing composite type, the pg_class entry doesn't really represent a table, but it is needed anyway for the type's pg_attribute entries to link to.) Zero for non-composite types"
+       ::= { pgsqlPgTypeEntry 10 }
+
+pgsqlPgTypeTypelem                     OBJECT-TYPE
+       SYNTAX          oid
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If typelem is not 0 then it identifies another row in pg_type . The current type can then be subscripted like an array yielding values of type typelem . A "
+       ::= { pgsqlPgTypeEntry 11 }
+
+pgsqlPgTypeTypinput                    OBJECT-TYPE
+       SYNTAX          regproc
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Input conversion function (text format)"
+       ::= { pgsqlPgTypeEntry 12 }
+
+pgsqlPgTypeTypoutput                   OBJECT-TYPE
+       SYNTAX          regproc
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Output conversion function (text format)"
+       ::= { pgsqlPgTypeEntry 13 }
+
+pgsqlPgTypeTypreceive                  OBJECT-TYPE
+       SYNTAX          regproc
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Input conversion function (binary format), or 0 if none"
+       ::= { pgsqlPgTypeEntry 14 }
+
+pgsqlPgTypeTypsend                     OBJECT-TYPE
+       SYNTAX          regproc
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Output conversion function (binary format), or 0 if none"
+       ::= { pgsqlPgTypeEntry 15 }
+
+pgsqlPgTypeTypanalyze                  OBJECT-TYPE
+       SYNTAX          regproc
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Custom ANALYZE function, or 0 to use the standard function"
+       ::= { pgsqlPgTypeEntry 16 }
+
+pgsqlPgTypeTypalign                    OBJECT-TYPE
+       SYNTAX          char
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typalign is the alignment required when storing a value of this type. It applies to storage on disk as well as most representations of the value inside PostgreSQL . When multiple values are stored consecutively, such as in the representation of a complete row on disk, padding is inserted before a datum of this type so that it begins on the specified boundary. The alignment reference is the beginning of the first datum in the sequence. Possible values are: c = char alignment, i.e., no alignment needed. s = short alignment (2 bytes on most machines). i = int alignment (4 bytes on most machines). d = double alignment (8 bytes on many machines, but by no means all). Note: For types used in system tables, it is critical that the size and alignment defined in pg_type agree with the way that the compiler will lay out the column in a structure representing a table row."
+       ::= { pgsqlPgTypeEntry 17 }
+
+pgsqlPgTypeTypstorage                  OBJECT-TYPE
+       SYNTAX          char
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typstorage tells for varlena types (those with typlen = -1) if the type is prepared for toasting and what the default strategy for attributes of this type should be. Possible values are p : Value must always be stored plain. e : Value can be stored in a "
+       ::= { pgsqlPgTypeEntry 18 }
+
+pgsqlPgTypeTypnotnull                  OBJECT-TYPE
+       SYNTAX          bool
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typnotnull represents a not-null constraint on a type. Used for domains only"
+       ::= { pgsqlPgTypeEntry 19 }
+
+pgsqlPgTypeTypbasetype                 OBJECT-TYPE
+       SYNTAX          oid
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If this is a domain (see typtype ), then typbasetype identifies the type that this one is based on. Zero if this type is not a domain"
+       ::= { pgsqlPgTypeEntry 20 }
+
+pgsqlPgTypeTyptypmod                   OBJECT-TYPE
+       SYNTAX          int4
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "Domains use typtypmod to record the typmod to be applied to their base type (-1 if base type does not use a typmod ). -1 if this type is not a domain"
+       ::= { pgsqlPgTypeEntry 21 }
+
+pgsqlPgTypeTypndims                    OBJECT-TYPE
+       SYNTAX          int4
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typndims is the number of array dimensions for a domain that is an array (that is, typbasetype is an array type; the domain's typelem will match the base type's typelem ). Zero for types other than array domains"
+       ::= { pgsqlPgTypeEntry 22 }
+
+pgsqlPgTypeTypdefaultbin                       OBJECT-TYPE
+       SYNTAX          text
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "If typdefaultbin is not null, it is the nodeToString() representation of a default expression for the type. This is only used for domains"
+       ::= { pgsqlPgTypeEntry 23 }
+
+pgsqlPgTypeTypdefault                  OBJECT-TYPE
+       SYNTAX          text
+       MAX-ACCESS      read-only
+       STATUS          current
+       DESCRIPTION
+               "typdefault is null if the type has no associated default value. If typdefaultbin is not null, typdefault must contain a human-readable version of the default expression represented by typdefaultbin . If typdefaultbin is null and typdefault is not, then typdefault is the external representation of the type's default value, which may be fed to the type's input converter to produce a constant"
+       ::= { pgsqlPgTypeEntry 24 }
+
+
+---------------------------------------
diff --git a/pgsql_mib_pieces/pg_type.tbldef b/pgsql_mib_pieces/pg_type.tbldef
new file mode 100644 (file)
index 0000000..1c92f0b
--- /dev/null
@@ -0,0 +1,25 @@
+pg_type        "The catalog pg_type stores information about data types. Base types (scalar types) are created with CREATE TYPE, and domains with CREATE DOMAIN. A composite type is automatically created for each table in the database, to represent the row structure of the table. It is also possible to create composite types with CREATE TYPE AS."    "Represents a single type"      pgsqlCatalogTables      33      "pgsnmpdConnID, rdbmsDbIndex, entryOID"
+"entryOID"     "INTEGER"       "OID of this entry"     1       not-accessible
+typname        name    "Data type name"                
+typnamespace   oid     "The OID of the namespace that contains this type"              
+typowner       oid     "Owner of the type"             
+typlen int2    "For a fixed-size type, typlen is the number of bytes in the internal representation of the type. But for a variable-length type, typlen is negative. -1 indicates a ""varlena"" type (one that has a length word), -2 indicates a null-terminated C string."           
+typbyval       bool    "typbyval determines whether internal routines pass a value of this type by value or by reference. typbyval had better be false if typlen is not 1, 2, or 4 (or 8 on machines where Datum is 8 bytes). Variable-length types are always passed by reference. Note that typbyval can be false even if the length would allow pass-by-value; this is currently true for type float4 , for example"                
+typtype        char    "typtype is b for a base type, c for a composite type (e.g., a table's row type), d for a domain, or p for a pseudo-type. See also typrelid and typbasetype"            
+typisdefined   bool    "True if the type is defined, false if this is a placeholder entry for a not-yet-defined type. When typisdefined is false, nothing except the type name, namespace, and OID can be relied on"           
+typdelim       char    "Character that separates two values of this type when parsing array input. Note that the delimiter is associated with the array element data type, not the array data type"            
+typrelid       oid     "If this is a composite type (see typtype ), then this column points to the pg_class entry that defines the corresponding table. (For a free-standing composite type, the pg_class entry doesn't really represent a table, but it is needed anyway for the type's pg_attribute entries to link to.) Zero for non-composite types"               
+typelem        oid     "If typelem is not 0 then it identifies another row in pg_type . The current type can then be subscripted like an array yielding values of type typelem . A ""true"" array type is variable length ( typlen = -1), but some fixed-length ( typlen > 0) types also have nonzero typelem , for example name and point . If a fixed-length type has a typelem then its internal representation must be some number of values of the typelem data type with no other data. Variable-length array types have a header defined by the array subroutines"              
+typinput       regproc "Input conversion function (text format)"               
+typoutput      regproc "Output conversion function (text format)"              
+typreceive     regproc "Input conversion function (binary format), or 0 if none"               
+typsend        regproc "Output conversion function (binary format), or 0 if none"              
+typanalyze     regproc "Custom ANALYZE function, or 0 to use the standard function"            
+typalign       char    "typalign is the alignment required when storing a value of this type. It applies to storage on disk as well as most representations of the value inside PostgreSQL . When multiple values are stored consecutively, such as in the representation of a complete row on disk, padding is inserted before a datum of this type so that it begins on the specified boundary. The alignment reference is the beginning of the first datum in the sequence. Possible values are: c = char alignment, i.e., no alignment needed. s = short alignment (2 bytes on most machines). i = int alignment (4 bytes on most machines). d = double alignment (8 bytes on many machines, but by no means all). Note: For types used in system tables, it is critical that the size and alignment defined in pg_type agree with the way that the compiler will lay out the column in a structure representing a table row."             
+typstorage     char    "typstorage tells for varlena types (those with typlen = -1) if the type is prepared for toasting and what the default strategy for attributes of this type should be. Possible values are p : Value must always be stored plain. e : Value can be stored in a ""secondary"" relation (if relation has one, see pg_class.reltoastrelid ). m : Value can be stored compressed inline. x : Value can be stored compressed inline or stored in ""secondary"" storage. Note that m columns can also be moved out to secondary storage, but only as a last resort ( e and x columns are moved first)."               
+typnotnull     bool    "typnotnull represents a not-null constraint on a type. Used for domains only"          
+typbasetype    oid     "If this is a domain (see typtype ), then typbasetype identifies the type that this one is based on. Zero if this type is not a domain"         
+typtypmod      int4    "Domains use typtypmod to record the typmod to be applied to their base type (-1 if base type does not use a typmod ). -1 if this type is not a domain"         
+typndims       int4    "typndims is the number of array dimensions for a domain that is an array (that is, typbasetype is an array type; the domain's typelem will match the base type's typelem ). Zero for types other than array domains"           
+typdefaultbin  text    "If typdefaultbin is not null, it is the nodeToString() representation of a default expression for the type. This is only used for domains"             
+typdefault     text    "typdefault is null if the type has no associated default value. If typdefaultbin is not null, typdefault must contain a human-readable version of the default expression represented by typdefaultbin . If typdefaultbin is null and typdefault is not, then typdefault is the external representation of the type's default value, which may be fed to the type's input converter to produce a constant"              
diff --git a/pgsql_mib_pieces/reprocess.sh b/pgsql_mib_pieces/reprocess.sh
new file mode 100644 (file)
index 0000000..292a3f6
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+#for i in *.tbldef; do j=${i/tbldef/mib}; echo $i; perl ../pgsqlMibWriter.pl < $i > $j; done
+#
+#cat *.mib > PGSQL-MIB
+for i in `ls *.tbldef|cut -f1 -d.`
+do
+     echo $i.tbldef;
+     if [ ! -e $i.mib ]
+     then
+       echo Reprocessing $i.mib
+       perl ../pgsqlMibWriter.pl < $i.tbldef > $i.mib;
+     fi
+done
+cat *.mib > PGSQL-MIB
diff --git a/pgsql_mib_pieces/z_FOOTER.mib b/pgsql_mib_pieces/z_FOOTER.mib
new file mode 100644 (file)
index 0000000..dce2c1d
--- /dev/null
@@ -0,0 +1 @@
+END
diff --git a/query_reader.c b/query_reader.c
new file mode 100644 (file)
index 0000000..6067ccb
--- /dev/null
@@ -0,0 +1,333 @@
+#include <yaml.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include "query_reader.h"
+
+/* TODO: Return value checking of strdup, etc. is fairly haphazard. */
+
+void print_error(yaml_parser_t *parser);
+
+typedef enum query_reader_state_s {
+    INIT,
+    READ_QUERY,
+    NAME_VALUE,
+    QUERY_VALUE,
+    OID_VALUE,
+    INDEXES_VALUE,
+    MINCOL_VALUE,
+    TYPES_VALUE,
+    TYPE_MAPPING_VALUE
+} query_reader_state_t;
+
+typedef struct string_to_int_struct {
+    char *name;
+    int   value;
+} string_to_int;
+
+char *yaml_get_event_type(yaml_event_type_t t);
+
+char *
+yaml_get_event_type (yaml_event_type_t t) {
+    switch (t) {
+        case YAML_NO_EVENT:
+            return "YAML_NO_EVENT";
+        case YAML_STREAM_START_EVENT:
+            return "YAML_STREAM_START_EVENT";
+        case YAML_STREAM_END_EVENT:
+            return "YAML_STREAM_END_EVENT";
+        case YAML_DOCUMENT_START_EVENT:
+            return "YAML_DOCUMENT_START_EVENT";
+        case YAML_DOCUMENT_END_EVENT:
+            return "YAML_DOCUMENT_END_EVENT";
+        case YAML_ALIAS_EVENT:
+            return "YAML_ALIAS_EVENT";
+        case YAML_SCALAR_EVENT:
+            return "YAML_SCALAR_EVENT";
+        case YAML_SEQUENCE_START_EVENT:
+            return "YAML_SEQUENCE_START_EVENT";
+        case YAML_SEQUENCE_END_EVENT:
+            return "YAML_SEQUENCE_END_EVENT";
+        case YAML_MAPPING_START_EVENT:
+            return "YAML_MAPPING_START_EVENT";
+        case YAML_MAPPING_END_EVENT:
+            return "YAML_MAPPING_END_EVENT";
+        default:
+            return "Unknown yaml event type";
+    };
+}
+
+pgsnmpd_query *
+parse_config(const char *filename) {
+    FILE *inputfile;
+    u_char *types;
+    yaml_parser_t parser;
+    yaml_event_t event;
+    int done = 0, i, error = 0, found = 0;
+    pgsnmpd_query *head = NULL, *cur, *newquery;
+    query_reader_state_t st = INIT;
+    char *name_str = NULL, *query_str = NULL, *oid_str = NULL;
+    int indexes_val, mincol_val, query_count = 0;
+    oid *oid_arr;
+    int oid_len = 1, typecol, typeslen;
+    int yaml_type_map_len = 6;
+    string_to_int yaml_type_map[6] = {
+        { "name",       NAME_VALUE },
+        { "query",      QUERY_VALUE },
+        { "oid",        OID_VALUE },
+        { "indexes",    INDEXES_VALUE },
+        { "min_column", MINCOL_VALUE },
+        { "types",      TYPES_VALUE }
+    };
+
+    int snmp_type_map_len = 5;
+    string_to_int snmp_type_map[5] = {
+        { "ASN_INTEGER",   ASN_INTEGER },
+        { "ASN_FLOAT",     ASN_FLOAT },
+        { "ASN_BOOLEAN",   ASN_BOOLEAN },
+        { "ASN_OBJECT_ID", ASN_OBJECT_ID },
+        { "ASN_OCTET_STR", ASN_OCTET_STR },
+    };
+
+    yaml_parser_initialize(&parser);
+    inputfile = fopen(filename, "rb");
+    if (inputfile == NULL) {
+        snmp_log(LOG_ERR, "Problem opening input file \"%s\": %s\n", filename, strerror(errno));
+        return 0;
+    }
+    yaml_parser_set_input_file(&parser, inputfile);
+
+    while (!done) {
+        if (!yaml_parser_parse(&parser, &event)) {
+            error = 1;
+            break;
+        }
+        done = (event.type == YAML_STREAM_END_EVENT);
+        /*snmp_log(LOG_INFO, "Found a %s value\n", yaml_get_event_type(event.type));*/
+        /* head = process_event(&event); */
+        switch (st) {
+            case INIT:
+                if (event.type == YAML_SCALAR_EVENT &&
+                    strcmp((char *)event.data.scalar.value, "queries") == 0) {
+                    st = READ_QUERY;
+                    if (name_str  != NULL) free(name_str);
+                    if (query_str != NULL) free(query_str);
+                    if (oid_str   != NULL) free(oid_str);
+
+                    name_str    = NULL;
+                    query_str   = NULL;
+                    oid_str     = NULL;
+
+                    indexes_val = -1;
+                    mincol_val  = -1;
+                }
+                query_count++;
+                break;
+            case READ_QUERY:
+                if (event.type == YAML_SCALAR_EVENT) {
+                    typeslen = -1;
+                    types = NULL;
+                    found = 0;
+                    for (i = 0; i < yaml_type_map_len; i++) {
+                        if (strcmp(yaml_type_map[i].name, (char*) event.data.scalar.value) == 0) {
+                            st = yaml_type_map[i].value;
+                            found = 1;
+                            break;
+                        }
+                    }
+                    if (found != 1) {
+                        snmp_log(LOG_ERR, "Unexpected data object reading query %d: %s\n", query_count, (char *) event.data.scalar.value);
+                        return NULL;
+                    }
+                }
+                else if (event.type == YAML_MAPPING_END_EVENT) {
+                    if (indexes_val == -1 ||
+                        mincol_val  == -1 ||
+                        name_str    == NULL ||
+                        oid_str     == NULL ||
+                        query_str   == NULL) {
+                        snmp_log(LOG_ERR, "Error reading query %d (%s): %s%s%s%s%s\n",
+                            query_count,
+                            name_str    == NULL ? "Name Unknown" : name_str,
+                            name_str    == NULL ? "Name not specified"    : "",
+                            oid_str     == NULL ? "OID not specified"     : "",
+                            query_str   == NULL ? "Query not specified"   : "",
+                            indexes_val == -1   ? "Indexes not specified" : "",
+                            mincol_val  == -1   ? "Min column not specified" : "");
+                        return NULL;
+                    }
+
+                    oid_arr = parse_oid(oid_str, &oid_len);
+
+                    newquery = alloc_custom_query(name_str, query_str, oid_arr, oid_len);
+                    newquery->num_indexes = indexes_val;
+                    newquery->min_colnum  = mincol_val;
+                    newquery->types       = types;
+                    newquery->typeslen    = typeslen;
+
+                    if (head == NULL) {
+                        head = newquery;
+                        cur = head;
+                    }
+                    else {
+                        cur->next = newquery;
+                        cur = newquery;
+                    }
+                }
+                else if (event.type == YAML_SEQUENCE_END_EVENT)
+                    st = INIT;
+                break;
+            case NAME_VALUE:
+                if (event.type == YAML_SCALAR_EVENT) {
+                    name_str = strdup((char *)event.data.scalar.value);
+                    st = READ_QUERY;
+                }
+                else {
+                    snmp_log(LOG_ERR, "Unexpected YAML event trying to read name of query %d\n", query_count);
+                    return NULL;
+                }
+                break;
+            case QUERY_VALUE:
+                if (event.type == YAML_SCALAR_EVENT) {
+                    query_str = strdup((char *)event.data.scalar.value);
+                    st = READ_QUERY;
+                }
+                else {
+                    snmp_log(LOG_ERR,"Unexpected YAML event trying to read query string of query %d\n", query_count);
+                    return NULL;
+                }
+                break;
+            case OID_VALUE:
+                if (event.type == YAML_SCALAR_EVENT) {
+                    oid_str = strdup((char *)event.data.scalar.value);
+                    st = READ_QUERY;
+                }
+                else {
+                    snmp_log(LOG_ERR, "Unexpected YAML event trying to read OID of query %d\n", query_count);
+                    return NULL;
+                }
+                break;
+            case INDEXES_VALUE:
+                if (event.type == YAML_SCALAR_EVENT) {
+                    indexes_val = atoi((char *)event.data.scalar.value);
+                    st = READ_QUERY;
+                }
+                else {
+                    snmp_log(LOG_ERR, "Unexpected YAML event trying to read indexes of query %d\n", query_count);
+                    return NULL;
+                }
+                break;
+            case MINCOL_VALUE:
+                if (event.type == YAML_SCALAR_EVENT) {
+                    mincol_val = atoi((char *)event.data.scalar.value);
+                    st = READ_QUERY;
+                }
+                else {
+                    snmp_log(LOG_ERR, "Unexpected YAML event trying to read min_column of query %d\n", query_count);
+                    return NULL;
+                }
+                break;
+            case TYPES_VALUE:
+                if (event.type == YAML_SCALAR_EVENT) {
+                    typecol = atoi((char *)event.data.scalar.value);
+                    if (typecol < 1)
+                        /* LOG_CRIT or higher? */
+                        snmp_log(LOG_ERR, "Invalid column number (must be > 0): %d\n", typecol);
+                    st = TYPE_MAPPING_VALUE;
+                }
+                else if (event.type == YAML_SEQUENCE_END_EVENT)
+                    st = READ_QUERY;
+                break;
+            case TYPE_MAPPING_VALUE:
+                st = TYPES_VALUE;
+                if (typeslen < typecol) {
+                    types = realloc(types, sizeof(u_char *) * typecol);
+                    if (types == NULL) {
+                        /* Perhaps LOG_CRIT or higher? */
+                        snmp_log(LOG_ERR, "Couldn't allocate enough memory for column types\n");
+                    }
+                    else {
+                        init_types_array(types, typeslen, typecol);
+                        if (typeslen != -1)
+                            for (i = typeslen; i < typecol; i++)
+                                types[i] = (u_char) 255;
+                        typeslen = typecol;
+                    }
+                }
+                types[typecol-1] = 255;
+                for (i = 0; i < snmp_type_map_len; i++) {
+                    if (strcmp((char *) event.data.scalar.value, snmp_type_map[i].name) == 0)
+                        types[typecol-1] = (u_char) snmp_type_map[i].value;
+                }
+                if (types[typecol-1] == 255)
+                    snmp_log(LOG_ERR, "Couldn't understand SNMP type \"%s\"\n", (char *) event.data.scalar.value);
+                break;
+        }
+        yaml_event_delete(&event);
+    }
+    
+    if (error)
+        print_error(&parser);
+
+    yaml_parser_delete(&parser);
+    fclose(inputfile);
+
+
+
+    /* Print out results
+    cur = head;
+    while (cur != NULL) {
+        printf("Query:\n\tname: %s\n\tquery: %s\n\toid len: %d\n\tindexes: %d\n\tmin_col: %d\n",
+            cur->table_name,
+            cur->query_text,
+            cur->oid_len,
+            cur->num_indexes,
+            cur->min_colnum);
+        printf("\tOID: ");
+        done = 0;
+        while (done < cur->oid_len)
+            printf(".%u", (u_int) cur->table_oid[done++]);
+        printf("\n");
+        cur = cur->next;
+    }
+    */
+    return head;
+}
+
+void print_error(yaml_parser_t *parser) {
+    snmp_log(LOG_ERR, "YAML parse error: %s at offset %d, value %d, context \"%s\"\n",
+        parser->problem, parser->problem_offset, parser->problem_value, parser->context);
+
+    snmp_log(LOG_ERR, "Problem mark: index %d, line %d, column %d\n", 
+        parser->problem_mark.index, parser->problem_mark.line, parser->problem_mark.column);
+    snmp_log(LOG_ERR, "Context marK: index %d, line %d, column %d\n", 
+        parser->context_mark.index, parser->context_mark.line, parser->context_mark.column);
+
+    switch (parser->error) {
+        case YAML_NO_ERROR:
+            snmp_log(LOG_ERR, "\tYAML_NO_ERROR\n");
+            break;
+        case YAML_MEMORY_ERROR:
+            snmp_log(LOG_ERR, "\tYAML_MEMORY_ERROR\n");
+            break;
+        case YAML_READER_ERROR:
+            snmp_log(LOG_ERR, "\tYAML_READER_ERROR\n");
+            break;
+        case YAML_SCANNER_ERROR:
+            snmp_log(LOG_ERR, "\tYAML_SCANNER_ERROR\n");
+            break;
+        case YAML_PARSER_ERROR:
+            snmp_log(LOG_ERR, "\tYAML_PARSER_ERROR\n");
+            break;
+        case YAML_COMPOSER_ERROR:
+            snmp_log(LOG_ERR, "\tYAML_COMPOSER_ERROR\n");
+            break;
+        case YAML_WRITER_ERROR:
+            snmp_log(LOG_ERR, "\tYAML_WRITER_ERROR\n");
+            break;
+        case YAML_EMITTER_ERROR:
+            snmp_log(LOG_ERR, "\tYAML_EMITTER_ERROR\n");
+            break;
+    }
+}
diff --git a/query_reader.h b/query_reader.h
new file mode 100644 (file)
index 0000000..aaa0929
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef QUERY_READER_H
+#define QUERY_READER_H
+
+#include "customquery.h"
+
+pgsnmpd_query *
+parse_config(const char *filename);
+
+#endif  /* QUERY_READER_H */
diff --git a/test_pgsnmpd.sh b/test_pgsnmpd.sh
new file mode 100755 (executable)
index 0000000..8714bd1
--- /dev/null
@@ -0,0 +1,16 @@
+sudo ./pgsnmpd -s -C "user=josh" -Q pgsnmpd.yaml 2>&1 &
+A=$!
+echo "PID: $A"
+sleep 2
+#snmpwalk -v 2c -c public localhost RDBMS-MIB::rdbmsDbInfoTable
+#snmpwalk -v 2c -c public localhost  1.3.6.1.4.1.27645.1.3.2
+#sudo strace -p $A &> strace.out &
+#B=$!
+#snmpwalk -v 2c -c public localhost 1.3.6.1.4.1.27645.1.3.2.1.2.1.1
+snmpwalk -On -v 2c -c public localhost  1.3.6.1.4.1.27645.1.2.1
+snmpwalk -On -v 2c -c public localhost  1.3.6.1.4.1.27645.1.2.2
+#snmpwalk -v 2c -c public localhost  1.3.6.1.4.1.27645.1.3.3
+#snmpwalk -v 2c -c public localhost  1.3.6.1.4.1.27646.1.1
+#snmpwalk -v 2c -c public localhost  1.3.6.1.4.1.27646.1.2
+sleep 4
+sudo kill -9 $A $B
diff --git a/yaml_interp.c b/yaml_interp.c
new file mode 100644 (file)
index 0000000..3676a04
--- /dev/null
@@ -0,0 +1,135 @@
+
+void process_event(yaml_event_t *event) {
+    switch (event->type) {
+        case YAML_NO_EVENT:
+            printf("YAML_NO_EVENT\n");
+            break;
+        case YAML_STREAM_START_EVENT:
+            printf("YAML_STREAM_START_EVENT\n");
+            switch (event->data.stream_start.encoding) {
+                case YAML_ANY_ENCODING:
+                    printf("\tYAML_ANY_ENCODING\n");
+                    break;
+                case YAML_UTF8_ENCODING:
+                    printf("\tYAML_UTF8_ENCODING\n");
+                    break;
+                case YAML_UTF16LE_ENCODING:
+                    printf("\tYAML_UTF16LE_ENCODING\n");
+                    break;
+                case YAML_UTF16BE_ENCODING:
+                    printf("\tYAML_UTF16BE_ENCODING\n");
+                    break;
+            }
+            break;
+        case YAML_STREAM_END_EVENT:
+            printf("YAML_STREAM_END_EVENT\n");
+            break;
+        case YAML_DOCUMENT_START_EVENT:
+            printf("YAML_DOCUMENT_START_EVENT\n");
+            if (event->data.document_start.version_directive != NULL) {
+                printf("\tVersion directive: %d.%d\n",
+                    event->data.document_start.version_directive->major,
+                    event->data.document_start.version_directive->minor);
+            }
+            printf("\t\"document indicator\" is %simplicit, whatever that means\n", event->data.document_start.implicit ? "" : "not ");
+            if (event->data.document_start.tag_directives.start != NULL) {
+                printf("\tTag directives start: tag handle: %s\t\ttag prefix: %s\n",
+                    event->data.document_start.tag_directives.start->handle,
+                    event->data.document_start.tag_directives.start->prefix);
+            }
+            if (event->data.document_start.tag_directives.end != NULL) {
+                printf("\tTag directives end: tag handle: %s\t\ttag prefix: %s\n",
+                    event->data.document_start.tag_directives.end->handle,
+                    event->data.document_start.tag_directives.end->prefix);
+            }
+            break;
+        case YAML_DOCUMENT_END_EVENT:
+            printf("YAML_DOCUMENT_END_EVENT\n");
+            printf("\t\"document indicator\" is %simplicit, whatever that means\n", event->data.document_end.implicit ? "" : "not ");
+            break;
+        case YAML_ALIAS_EVENT:
+            printf("YAML_ALIAS_EVENT\n");
+            if (event->data.alias.anchor != NULL) {
+                printf("\tAnchor: %s\n", event->data.alias.anchor);
+            }
+            break;
+        case YAML_SCALAR_EVENT:
+            printf("YAML_SCALAR_EVENT\n");
+            if (event->data.scalar.anchor != NULL)
+                printf("\tAnchor: %s\n", event->data.scalar.anchor);
+            if (event->data.scalar.tag != NULL)
+                printf("\tTag: %s\n", event->data.scalar.tag);
+            if (event->data.scalar.value != NULL)
+                printf("\tValue: %s\n", event->data.scalar.value);
+            printf("\tLength: %d\n", event->data.scalar.length);
+            printf("\t\"plain_implicit\" is %simplicit, whatever that means\n", event->data.scalar.plain_implicit ? "" : "not ");
+            printf("\t\"quoted_implicit\" is %simplicit, whatever that means\n", event->data.scalar.quoted_implicit ? "" : "not ");
+            switch (event->data.scalar.style) {
+                case YAML_ANY_SCALAR_STYLE:
+                    printf("\tYAML_ANY_SCALAR_STYLE\n");
+                    break;
+                case YAML_PLAIN_SCALAR_STYLE:
+                    printf("\tYAML_PLAIN_SCALAR_STYLE\n");
+                    break;
+                case YAML_SINGLE_QUOTED_SCALAR_STYLE:
+                    printf("\tYAML_SINGLE_QUOTED_SCALAR_STYLE\n");
+                    break;
+                case YAML_DOUBLE_QUOTED_SCALAR_STYLE:
+                    printf("\tYAML_DOUBLE_QUOTED_SCALAR_STYLE\n");
+                    break;
+                case YAML_LITERAL_SCALAR_STYLE:
+                    printf("\tYAML_LITERAL_SCALAR_STYLE\n");
+                    break;
+                case YAML_FOLDED_SCALAR_STYLE:
+                    printf("\tYAML_FOLDED_SCALAR_STYLE\n");
+                    break;
+            }
+            break;
+        case YAML_SEQUENCE_START_EVENT:
+            printf("YAML_SEQUENCE_START_EVENT\n");
+            if (event->data.sequence_start.anchor != NULL)
+                printf("\tAnchor: %s\n", event->data.sequence_start.anchor);
+            if (event->data.sequence_start.tag != NULL)
+                printf("\tTag: %s\n", event->data.sequence_start.tag);
+            printf("\ttag is %simplicit, whatever that means\n", event->data.sequence_start.implicit ? "" : "not ");
+            switch (event->data.sequence_start.style) {
+                case YAML_ANY_SEQUENCE_STYLE:
+                    printf("\tYAML_ANY_SEQUENCE_STYLE\n");
+                    break;
+                case YAML_BLOCK_SEQUENCE_STYLE:
+                    printf("\tYAML_BLOCK_SEQUENCE_STYLE\n");
+                    break;
+                case YAML_FLOW_SEQUENCE_STYLE:
+                    printf("\tYAML_FLOW_SEQUENCE_STYLE\n");
+                    break;
+            }
+            break;
+        case YAML_SEQUENCE_END_EVENT:
+            printf("YAML_SEQUENCE_END_EVENT\n");
+            break;
+        case YAML_MAPPING_START_EVENT:
+            printf("YAML_MAPPING_START_EVENT\n");
+            if (event->data.mapping_start.anchor != NULL)
+                printf("\tAnchor: %s\n", event->data.mapping_start.anchor);
+            if (event->data.mapping_start.tag != NULL)
+                printf("\tTag: %s\n", event->data.mapping_start.tag);
+            printf("\tmapping is %simplicit, whatever that means\n", event->data.mapping_start.implicit ? "" : "not ");
+            switch (event->data.sequence_start.style) {
+                case YAML_ANY_MAPPING_STYLE:
+                    printf("\tYAML_ANY_MAPPING_STYLE\n");
+                    break;
+                case YAML_BLOCK_MAPPING_STYLE:
+                    printf("\tYAML_BLOCK_MAPPING_STYLE\n");
+                    break;
+                case YAML_FLOW_MAPPING_STYLE:
+                    printf("\tYAML_FLOW_MAPPING_STYLE\n");
+                    break;
+            }
+            break;
+        case YAML_MAPPING_END_EVENT:
+            printf("YAML_MAPPING_END_EVENT\n");
+            break;
+    };
+}
+
+