Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi! I cleaned up your code for you! #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc

# Logs and databases #
######################
*.log

# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ PG_LIBS = $(libpq_pgport) $(AGENTLIBS) -lyaml

DOCS = README.pgsnmpd

DATA = pgsnmpd.conf pgsnmpd.sql
DATA = pgsnmpd.conf pgsnmpd.sql

ifndef DONT_USE_PGXS
PGXS := $(shell pg_config --pgxs)
Expand Down
10 changes: 5 additions & 5 deletions PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Note: this file originally auto-generated by mib2c using
* version : 1.32.2.3 $ of : mfd-top.m2c,v $
* version : 1.32.2.3 $ of : mfd-top.m2c,v $
*
* $Id: pgsnmpdConnectionsTable.c,v 1.1 2007/10/30 11:44:41 eggyknap Exp $
*/
Expand Down Expand Up @@ -39,7 +39,7 @@ init_pgsnmpdConnectionsTable(void)
/*
* TODO:300:o: Perform pgsnmpdConnectionsTable one-time module initialization.
*/

/*
* here we initialize all the tables we're planning on supporting
*/
Expand All @@ -49,7 +49,7 @@ init_pgsnmpdConnectionsTable(void)
} /* init_pgsnmpdConnectionsTable */

/**
* Initialize the table pgsnmpdConnectionsTable
* Initialize the table pgsnmpdConnectionsTable
* (Define its contents and how it's structured)
*/
void
Expand All @@ -74,13 +74,13 @@ initialize_table_pgsnmpdConnectionsTable(void)
* 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
*/
Expand Down
14 changes: 7 additions & 7 deletions PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,25 @@ typedef netsnmp_data_list * pgsnmpdConnectionsTable_registration_ptr;
* 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;


Expand Down Expand Up @@ -134,9 +134,9 @@ 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;

/*
Expand All @@ -153,7 +153,7 @@ typedef struct pgsnmpdConnectionsTable_rowreq_ctx_s {
/*
* TODO:131:o: | |-> Add useful data to pgsnmpdConnectionsTable rowreq context.
*/

/*
* storage for future expansion
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Note: this file originally auto-generated by mib2c using
* version : 1.18.2.1 $ of : mfd-data-get.m2c,v $
* 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 $
*/
Expand Down Expand Up @@ -92,9 +92,9 @@ pgsnmpdConnID_map(char **mib_pgsnmpdConnID_val_ptr_ptr, size_t *mib_pgsnmpdConnI

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
Expand Down Expand Up @@ -155,7 +155,7 @@ pgsnmpdConnectionsTable_indexes_set_tbl_idx(pgsnmpdConnectionsTable_mib_index *t
}
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 */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* These routines are used to set the value for individual objects. The
* row context is passed, along with the new value.
*
*
* @{
*/
/** @} */
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Note: this file originally auto-generated by mib2c using
* version : 1.18 $ of : mfd-data-set.m2c,v $
* 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 $
*/
Expand Down
40 changes: 20 additions & 20 deletions PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_interface.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Note: this file originally auto-generated by mib2c using
* version : 1.43.2.3 $ of : mfd-interface.m2c,v $
* 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 $
*/
Expand Down Expand Up @@ -57,7 +57,7 @@ typedef struct pgsnmpdConnectionsTable_interface_ctx_s {
netsnmp_cache *cache; /* optional cache */

pgsnmpdConnectionsTable_registration_ptr user_ctx;

netsnmp_table_registration_info tbl_info;

netsnmp_baby_steps_access_methods access_multiplexer;
Expand All @@ -76,7 +76,7 @@ static Netsnmp_Node_Handler _mfd_pgsnmpdConnectionsTable_object_lookup;
static Netsnmp_Node_Handler _mfd_pgsnmpdConnectionsTable_get_values;
/**
* @internal
* Initialize the table pgsnmpdConnectionsTable
* Initialize the table pgsnmpdConnectionsTable
* (Define its contents and how it's structured)
*/
void
Expand Down Expand Up @@ -126,7 +126,7 @@ _pgsnmpdConnectionsTable_initialize_interface(pgsnmpdConnectionsTable_registrati
snmp_log(LOG_ERR,"could not initialize container for pgsnmpdConnectionsTable\n");
return;
}

/*
* access_multiplexer: REQUIRED wrapper for get request handling
*/
Expand All @@ -145,7 +145,7 @@ _pgsnmpdConnectionsTable_initialize_interface(pgsnmpdConnectionsTable_registrati
* Create a registration, save our reg data, register table.
*/
DEBUGMSGTL(("pgsnmpdConnectionsTable:init_pgsnmpdConnectionsTable",
"Registering pgsnmpdConnectionsTable as a mibs-for-dummies table.\n"));
"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,
Expand Down Expand Up @@ -176,14 +176,14 @@ _pgsnmpdConnectionsTable_initialize_interface(pgsnmpdConnectionsTable_registrati
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 )
Expand All @@ -192,7 +192,7 @@ _pgsnmpdConnectionsTable_initialize_interface(pgsnmpdConnectionsTable_registrati
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);

Expand Down Expand Up @@ -243,7 +243,7 @@ pgsnmpdConnectionsTable_index_to_oid(netsnmp_index *oid_idx,
pgsnmpdConnectionsTable_mib_index *mib_idx)
{
int err = SNMP_ERR_NOERROR;

/*
* temp storage for parsing indexes
*/
Expand Down Expand Up @@ -295,7 +295,7 @@ pgsnmpdConnectionsTable_index_from_oid(netsnmp_index *oid_idx,
pgsnmpdConnectionsTable_mib_index *mib_idx)
{
int err = SNMP_ERR_NOERROR;

/*
* temp storage for parsing indexes
*/
Expand Down Expand Up @@ -385,7 +385,7 @@ pgsnmpdConnectionsTable_release_rowreq_ctx(pgsnmpdConnectionsTable_rowreq_ctx *r
DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:pgsnmpdConnectionsTable_release_rowreq_ctx","called\n"));

netsnmp_assert(NULL != rowreq_ctx);


/*
* free index oid pointer
Expand Down Expand Up @@ -415,7 +415,7 @@ _mfd_pgsnmpdConnectionsTable_pre_request(netsnmp_mib_handler *handler,
"pgsnmpdConnectionsTable_pre_request\n", rc));
netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc));
}

return SNMP_ERR_NOERROR;
} /* _mfd_pgsnmpdConnectionsTable_pre_request */

Expand All @@ -438,7 +438,7 @@ _mfd_pgsnmpdConnectionsTable_post_request(netsnmp_mib_handler *handler,
DEBUGMSGTL(("internal:pgsnmpdConnectionsTable","error %d from "
"pgsnmpdConnectionsTable_post_request\n", rc));
}

/*
* if there are no errors, check for and handle row creation/deletion
*/
Expand Down Expand Up @@ -471,7 +471,7 @@ _mfd_pgsnmpdConnectionsTable_object_lookup(netsnmp_mib_handler *handler,
{
pgsnmpdConnectionsTable_rowreq_ctx *rowreq_ctx =
netsnmp_container_table_row_extract(requests);

DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:_mfd_pgsnmpdConnectionsTable_object_lookup","called\n"));

/*
Expand Down Expand Up @@ -504,7 +504,7 @@ _pgsnmpdConnectionsTable_get_column( pgsnmpdConnectionsTable_rowreq_ctx *rowreq_
netsnmp_variable_list *var, int column )
{
int rc = SNMPERR_SUCCESS;

DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:_mfd_pgsnmpdConnectionsTable_get_column","called\n"));


Expand Down Expand Up @@ -536,7 +536,7 @@ _mfd_pgsnmpdConnectionsTable_get_values(netsnmp_mib_handler *handler,
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
Expand All @@ -558,7 +558,7 @@ _mfd_pgsnmpdConnectionsTable_get_values(netsnmp_mib_handler *handler,
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) {
Expand Down Expand Up @@ -619,7 +619,7 @@ _cache_load(netsnmp_cache *cache, void *vmagic)

/** should only be called for an invalid or expired cache */
netsnmp_assert((0 == cache->valid) || (1 == cache->expired));

/*
* call user code
*/
Expand Down Expand Up @@ -661,7 +661,7 @@ _cache_free(netsnmp_cache *cache, void *magic)
* call user code
*/
pgsnmpdConnectionsTable_cache_free(container);

/*
* free all items. inefficient, but easy.
*/
Expand All @@ -678,7 +678,7 @@ void
_pgsnmpdConnectionsTable_container_init(pgsnmpdConnectionsTable_interface_ctx *if_ctx)
{
DEBUGMSGTL(("internal:pgsnmpdConnectionsTable:_pgsnmpdConnectionsTable_container_init","called\n"));

/*
* set up the cache
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* \warning This code should not be modified, called directly,
* or used to interpret functionality. It is subject to
* change at any time.
*
*
* @{
*/
/*
Expand Down
4 changes: 2 additions & 2 deletions PGSQL-MIB_src/pgsnmpdTables/pgsnmpdConnectionsTable_oids.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ extern "C" {
#define COLUMN_PGSNMPDCONNPORT 3
#define COLUMN_PGSNMPDCONNDBNAME 4

#define PGSNMPDCONNECTIONSTABLE_MIN_COL
#define PGSNMPDCONNECTIONSTABLE_MAX_COL
#define PGSNMPDCONNECTIONSTABLE_MIN_COL
#define PGSNMPDCONNECTIONSTABLE_MAX_COL


#ifdef __cplusplus
Expand Down
Loading