--- autogen.sh | 4 +- docs/libvirtMib_subagent.pod | 4 +- src/LIBVIRT-MIB.txt | 4 +- src/libvirtGuestTable-README-FIRST.txt | 6 +- src/libvirtGuestTable-README-libvirtGuestTable.txt | 16 ++-- src/libvirtGuestTable.c | 16 ++-- src/libvirtGuestTable.h | 22 +++--- src/libvirtGuestTable_data_access.c | 8 +- src/libvirtGuestTable_data_get.c | 8 +- src/libvirtGuestTable_data_set.c | 22 +++--- src/libvirtGuestTable_enums.h | 24 +++--- src/libvirtGuestTable_interface.c | 82 ++++++++++---------- src/libvirtGuestTable_interface.h | 2 +- src/libvirtGuestTable_oids.h | 20 +++--- src/libvirtMib_subagent.c | 18 ++-- 15 files changed, 128 insertions(+), 128 deletions(-) diff --git a/autogen.sh b/autogen.sh index 067edea..5d00494 100755 --- a/autogen.sh +++ b/autogen.sh @@ -3,7 +3,7 @@ set -e srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. +test -z "$srcdir" && srcdir=. THEDIR=`pwd` cd $srcdir @@ -24,6 +24,6 @@ autoreconf -i -f cd $THEDIR $srcdir/configure "$@" && { - echo + echo echo "Now type 'make' to compile libvirt-snmp." } diff --git a/docs/libvirtMib_subagent.pod b/docs/libvirtMib_subagent.pod index 96faaab..bd074f0 100644 --- a/docs/libvirtMib_subagent.pod +++ b/docs/libvirtMib_subagent.pod @@ -46,7 +46,7 @@ Run as a normal SNMP Agent instead of an AgentX sub-agent. Connect to master agent at ADDRESS (default C</var/agentx/master>). The address can either be a Unix domain socket path, or the address of a network interface. -The format is the same as the format of listening addresses described below. +The format is the same as the format of listening addresses described below. =item B<-L> @@ -54,7 +54,7 @@ Do not open a log file; print all messages to stderr. =back -The last optional I<LISTENING ADDRESSES> specify on which addresses should +The last optional I<LISTENING ADDRESSES> specify on which addresses should subagent running in normal SNMP Agent mode listen for incoming requests. See B<snmpd> for further information. diff --git a/src/LIBVIRT-MIB.txt b/src/LIBVIRT-MIB.txt index 932dec9..d83db49 100644 --- a/src/LIBVIRT-MIB.txt +++ b/src/LIBVIRT-MIB.txt @@ -74,7 +74,7 @@ LibvirtGuestEntry ::= SEQUENCE { libvirtGuestMemoryLimit Unsigned32, libvirtGuestCpuTime Counter64, libvirtGuestRowStatus RowStatus -} +} libvirtGuestUUID OBJECT-TYPE SYNTAX UUID @@ -157,7 +157,7 @@ libvirtGuestRowStatus OBJECT-TYPE STATUS current DESCRIPTION "Status of the virtual guest. - + A new virtual guest can be activated by setting this column to 'createAndGo'. libvirtGuestState can be specified to 'paused' or 'running' or does not need to be specified at all. diff --git a/src/libvirtGuestTable-README-FIRST.txt b/src/libvirtGuestTable-README-FIRST.txt index ce13d90..cd66c1f 100644 --- a/src/libvirtGuestTable-README-FIRST.txt +++ b/src/libvirtGuestTable-README-FIRST.txt @@ -56,7 +56,7 @@ introduction to some of the general concepts you should be familar with. variable, sysContact.0, which is a string containing the contact information for the person in charge of a particular agent. Note that scalar variable always end with '.0'. - + Rows and Tables --------------- @@ -67,7 +67,7 @@ introduction to some of the general concepts you should be familar with. For example, the SNMP standard MIB-II defines a table, ifTable, which contains information on the ethernet interfaces on a system. - + Data Structures --------------- @@ -115,7 +115,7 @@ introduction to some of the general concepts you should be familar with. -These files are top-level files potentially useful for all the tables: +These files are top-level files potentially useful for all the tables: ------------------------------------------------------------------------ File : libvirtGuestTable_Makefile diff --git a/src/libvirtGuestTable-README-libvirtGuestTable.txt b/src/libvirtGuestTable-README-libvirtGuestTable.txt index b571138..5a74dae 100644 --- a/src/libvirtGuestTable-README-libvirtGuestTable.txt +++ b/src/libvirtGuestTable-README-libvirtGuestTable.txt @@ -59,7 +59,7 @@ libvirtGuestTable README netsnmp_data_list pointer, which will allow you to keep multiple pointers tagged by a text name. If you have a new or existing structure you would rather use, you can redefine this variable. - + To avoid regenerating code, you may also change this typedef directly in the libvirtGuestTable.h header. @@ -128,7 +128,7 @@ libvirtGuestTable README Syntax: @eval $m2c_table_access = 'container-cached'@ - + m2c_include_examples (currently '1') ------------------------------------------------------------------ This variable determines whether or not to generate example code. The @@ -173,7 +173,7 @@ libvirtGuestTable File Overview File: libvirtGuestTable_data_access.[c|h] ------------------------------------------------------------------------ The libvirtGuestTable_data_access file contains the interface to your data in - its raw format. These functions are used to build the row cache or + its raw format. These functions are used to build the row cache or locate the row (depending on the table access method). Set MIB context @@ -188,7 +188,7 @@ File: libvirtGuestTable_data_access.[c|h] This function should update the table index values (found in tbl_idx) for the given raw data. - + container summary ------------------------ The container data access code is for cases when you want to @@ -447,7 +447,7 @@ _cache_load xxx_interface.c xxxTable_indexes_set xxx_data_get.c xxxTable_indexes_set_tbl_idx xxx_data_get.c -xxxTable_pre_request +xxxTable_pre_request _mfd_xxxTable_object_lookup xxx_interface.c xxxTable_row_prep xxx_data_access.c @@ -731,14 +731,14 @@ The CPU time used by the virtual guest, in nanoseconds. * OID: .1.3.6.1.4.1.12345.1.1.1.9 * Description: Status of the virtual guest. - + A new virtual guest can be activated when either libvirtGuestName or libvirtGuestUUID is specified and libvirtGuestState is either set to running or paused. - + A virtual guest can be destroyed by setting this column value to 'destroy'. - + * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 diff --git a/src/libvirtGuestTable.c b/src/libvirtGuestTable.c index d595568..cb4c59f 100644 --- a/src/libvirtGuestTable.c +++ b/src/libvirtGuestTable.c @@ -52,7 +52,7 @@ init_libvirtGuestTable(void) /* * TODO:300:o: Perform libvirtGuestTable one-time module initialization. */ - + /* * here we initialize all the tables we're planning on supporting */ @@ -73,7 +73,7 @@ shutdown_libvirtGuestTable(void) } /** - * Initialize the table libvirtGuestTable + * Initialize the table libvirtGuestTable * (Define its contents and how it's structured) */ void @@ -98,13 +98,13 @@ initialize_table_libvirtGuestTable(void) * string token is used to add, find or remove pointers. */ user_context = netsnmp_create_data_list("libvirtGuestTable", NULL, NULL); - + /* * No support for any flags yet, but in the future you would * set any flags here. */ flags = 0; - + /* * call interface initialization code */ @@ -112,7 +112,7 @@ initialize_table_libvirtGuestTable(void) } /* initialize_table_libvirtGuestTable */ /** - * Shutdown the table libvirtGuestTable + * Shutdown the table libvirtGuestTable */ void shutdown_table_libvirtGuestTable(void) @@ -139,7 +139,7 @@ libvirtGuestTable_rowreq_ctx_init(libvirtGuestTable_rowreq_ctx *rowreq_ctx, DEBUGMSGTL(("verbose:libvirtGuestTable:libvirtGuestTable_rowreq_ctx_init","called\n")); netsnmp_assert(NULL != rowreq_ctx); - + /* * TODO:210:o: |-> Perform extra libvirtGuestTable rowreq initialization. (eg DEFVALS) */ @@ -156,7 +156,7 @@ void libvirtGuestTable_rowreq_ctx_cleanup(libvirtGuestTable_rowreq_ctx *rowreq_c DEBUGMSGTL(("verbose:libvirtGuestTable:libvirtGuestTable_rowreq_ctx_cleanup","called\n")); netsnmp_assert(NULL != rowreq_ctx); - + /* * TODO:211:o: |-> Perform extra libvirtGuestTable rowreq cleanup. */ @@ -217,7 +217,7 @@ libvirtGuestTable_post_request(libvirtGuestTable_registration * user_context, in * save changed rows, if you haven't already */ } - + libvirtGuestTable_dirty_set(0); /* clear table dirty flag */ } diff --git a/src/libvirtGuestTable.h b/src/libvirtGuestTable.h index eb64048..ca27abd 100644 --- a/src/libvirtGuestTable.h +++ b/src/libvirtGuestTable.h @@ -92,42 +92,42 @@ typedef netsnmp_data_list libvirtGuestTable_registration; * libvirtGuestTable. */ typedef struct libvirtGuestTable_data_s { - + /* * libvirtGuestName(2)/OCTETSTR/ASN_OCTET_STR/char(char)//L/A/w/e/r/d/h */ char *libvirtGuestName; - + /* * libvirtGuestState(3)/INTEGER/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ u_long libvirtGuestState; - + /* * libvirtGuestCpuCount(4)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/R/d/h */ u_long libvirtGuestCpuCount; - + /* * libvirtGuestMemoryCurrent(5)/GAUGE/ASN_GAUGE/u_long(u_long)//l/A/w/e/R/d/h */ u_long libvirtGuestMemoryCurrent; - + /* * libvirtGuestMemoryLimit(6)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/A/w/e/R/d/h */ u_long libvirtGuestMemoryLimit; - + /* * libvirtGuestCpuTime(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h */ U64 libvirtGuestCpuTime; - + /* * libvirtGuestRowStatus(9)/RowStatus/ASN_INTEGER/long(u_long)//l/A/W/E/r/d/h */ u_long libvirtGuestRowStatus; - + } libvirtGuestTable_data; @@ -176,9 +176,9 @@ typedef struct libvirtGuestTable_rowreq_ctx_s { /** this must be first for container compare to work */ netsnmp_index oid_idx; oid oid_tmp[MAX_libvirtGuestTable_IDX_LEN]; - + libvirtGuestTable_mib_index tbl_idx; - + libvirtGuestTable_data data; libvirtGuestTable_undo_data * undo; unsigned int column_set_flags; /* flags for set columns */ @@ -193,7 +193,7 @@ typedef struct libvirtGuestTable_rowreq_ctx_s { /* * TODO:131:o: | |-> Add useful data to libvirtGuestTable rowreq context. */ - + /* * storage for future expansion */ diff --git a/src/libvirtGuestTable_data_access.c b/src/libvirtGuestTable_data_access.c index f602021..2958284 100644 --- a/src/libvirtGuestTable_data_access.c +++ b/src/libvirtGuestTable_data_access.c @@ -38,7 +38,7 @@ * * These routines are used to locate the data used to satisfy * requests. - * + * * @{ */ /********************************************************************** @@ -129,7 +129,7 @@ libvirtGuestTable_container_init(netsnmp_container **container_ptr_ptr, netsnmp_cache *cache) { DEBUGMSGTL(("verbose:libvirtGuestTable:libvirtGuestTable_container_init","called\n")); - + if (NULL == container_ptr_ptr) { snmp_log(LOG_ERR,"bad container param to libvirtGuestTable_container_init\n"); return; @@ -182,7 +182,7 @@ void libvirtGuestTable_container_shutdown(netsnmp_container *container_ptr) { DEBUGMSGTL(("verbose:libvirtGuestTable:libvirtGuestTable_container_shutdown","called\n")); - + if (NULL == container_ptr) { snmp_log(LOG_ERR,"bad params to libvirtGuestTable_container_shutdown\n"); return; @@ -364,7 +364,7 @@ libvirtGuestUUID_check_index( libvirtGuestTable_rowreq_ctx *rowreq_ctx ) * is the place to make sure they are valid as a whole when combined. If * you only have one index, then you probably don't need to do anything else * here. - * + * * @note Keep in mind that if the indexes refer to a row in this or * some other table, you can't check for that row here to make * decisions, since that row might not be created yet, but may diff --git a/src/libvirtGuestTable_data_get.c b/src/libvirtGuestTable_data_get.c index 059f4a9..b252bdd 100644 --- a/src/libvirtGuestTable_data_get.c +++ b/src/libvirtGuestTable_data_get.c @@ -89,7 +89,7 @@ libvirtGuestTable_indexes_set_tbl_idx(libvirtGuestTable_mib_index *tbl_idx, char } tbl_idx->libvirtGuestUUID_len = libvirtGuestUUID_val_ptr_len; memcpy( tbl_idx->libvirtGuestUUID, libvirtGuestUUID_val_ptr, libvirtGuestUUID_val_ptr_len* sizeof(libvirtGuestUUID_val_ptr[0]) ); - + return MFD_SUCCESS; } /* libvirtGuestTable_indexes_set_tbl_idx */ @@ -482,14 +482,14 @@ libvirtGuestCpuTime_get( libvirtGuestTable_rowreq_ctx *rowreq_ctx, U64 * libvirt * OID: .1.3.6.1.4.1.12345.1.1.1.9 * Description: Status of the virtual guest. - + A new virtual guest can be activated when either libvirtGuestName or libvirtGuestUUID is specified and libvirtGuestState is either set to running or paused. - + A virtual guest can be destroyed by setting this column value to 'destroy'. - + * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 diff --git a/src/libvirtGuestTable_data_set.c b/src/libvirtGuestTable_data_set.c index c1f6625..d67c9d9 100644 --- a/src/libvirtGuestTable_data_set.c +++ b/src/libvirtGuestTable_data_set.c @@ -33,7 +33,7 @@ * * These routines are used to set the value for individual objects. The * row context is passed, along with the new value. - * + * * @{ */ /********************************************************************** @@ -386,7 +386,7 @@ libvirtGuestTable_undo_commit( libvirtGuestTable_rowreq_ctx *rowreq_ctx) * eg: if (rowreq_ctx->column_set_flags & COLUMN__FLAG) {} */ - + /* * if we successfully un-commited this row, clear the dirty flag. */ @@ -440,12 +440,12 @@ Current state of the active guest. * 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 @@ -578,7 +578,7 @@ libvirtGuestState_undo( libvirtGuestTable_rowreq_ctx *rowreq_ctx) */ rowreq_ctx->data.libvirtGuestState = rowreq_ctx->undo->libvirtGuestState; - + return MFD_SUCCESS; } /* libvirtGuestState_undo */ @@ -589,14 +589,14 @@ libvirtGuestState_undo( libvirtGuestTable_rowreq_ctx *rowreq_ctx) * OID: .1.3.6.1.4.1.12345.1.1.1.9 * Description: Status of the virtual guest. - + A new virtual guest can be activated when either libvirtGuestName or libvirtGuestUUID is specified and libvirtGuestState is either set to running or paused. - + A virtual guest can be destroyed by setting this column value to 'destroy'. - + * * Attributes: * accessible 1 isscalar 0 enums 1 hasdefval 0 @@ -627,12 +627,12 @@ Status of the virtual guest. * 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 @@ -754,7 +754,7 @@ libvirtGuestRowStatus_undo( libvirtGuestTable_rowreq_ctx *rowreq_ctx) */ rowreq_ctx->data.libvirtGuestRowStatus = rowreq_ctx->undo->libvirtGuestRowStatus; - + return MFD_SUCCESS; } /* libvirtGuestRowStatus_undo */ diff --git a/src/libvirtGuestTable_enums.h b/src/libvirtGuestTable_enums.h index ea7e6df..bd131c6 100644 --- a/src/libvirtGuestTable_enums.h +++ b/src/libvirtGuestTable_enums.h @@ -57,12 +57,12 @@ extern "C" { #ifndef LIBVIRTGUESTSTATE_ENUMS #define LIBVIRTGUESTSTATE_ENUMS -#define LIBVIRTGUESTSTATE_RUNNING 1 -#define LIBVIRTGUESTSTATE_BLOCKED 2 -#define LIBVIRTGUESTSTATE_PAUSED 3 -#define LIBVIRTGUESTSTATE_SHUTDOWN 4 -#define LIBVIRTGUESTSTATE_SHUTOFF 5 -#define LIBVIRTGUESTSTATE_CRASHED 6 +#define LIBVIRTGUESTSTATE_RUNNING 1 +#define LIBVIRTGUESTSTATE_BLOCKED 2 +#define LIBVIRTGUESTSTATE_PAUSED 3 +#define LIBVIRTGUESTSTATE_SHUTDOWN 4 +#define LIBVIRTGUESTSTATE_SHUTOFF 5 +#define LIBVIRTGUESTSTATE_CRASHED 6 #endif /* LIBVIRTGUESTSTATE_ENUMS */ @@ -77,12 +77,12 @@ extern "C" { #ifndef ROWSTATUS_ENUMS #define ROWSTATUS_ENUMS -#define ROWSTATUS_ACTIVE 1 -#define ROWSTATUS_NOTINSERVICE 2 -#define ROWSTATUS_NOTREADY 3 -#define ROWSTATUS_CREATEANDGO 4 -#define ROWSTATUS_CREATEANDWAIT 5 -#define ROWSTATUS_DESTROY 6 +#define ROWSTATUS_ACTIVE 1 +#define ROWSTATUS_NOTINSERVICE 2 +#define ROWSTATUS_NOTREADY 3 +#define ROWSTATUS_CREATEANDGO 4 +#define ROWSTATUS_CREATEANDWAIT 5 +#define ROWSTATUS_DESTROY 6 #endif /* ROWSTATUS_ENUMS */ diff --git a/src/libvirtGuestTable_interface.c b/src/libvirtGuestTable_interface.c index 2d78d5b..ce29c3b 100644 --- a/src/libvirtGuestTable_interface.c +++ b/src/libvirtGuestTable_interface.c @@ -76,7 +76,7 @@ typedef struct libvirtGuestTable_interface_ctx_s { netsnmp_cache *cache; libvirtGuestTable_registration * user_ctx; - + netsnmp_table_registration_info tbl_info; netsnmp_baby_steps_access_methods access_multiplexer; @@ -154,7 +154,7 @@ libvirtGuestTable_data *libvirtGuestTable_allocate_data(void); /** * @internal - * Initialize the table libvirtGuestTable + * Initialize the table libvirtGuestTable * (Define its contents and how it's structured) */ void @@ -204,7 +204,7 @@ _libvirtGuestTable_initialize_interface(libvirtGuestTable_registration * reg_ptr snmp_log(LOG_ERR,"could not initialize container for libvirtGuestTable\n"); return; } - + /* * access_multiplexer: REQUIRED wrapper for get request handling */ @@ -239,7 +239,7 @@ _libvirtGuestTable_initialize_interface(libvirtGuestTable_registration * reg_ptr * Create a registration, save our reg data, register table. */ DEBUGMSGTL(("libvirtGuestTable:init_libvirtGuestTable", - "Registering libvirtGuestTable as a mibs-for-dummies table.\n")); + "Registering libvirtGuestTable as a mibs-for-dummies table.\n")); handler = netsnmp_baby_steps_access_multiplexer_get(access_multiplexer); reginfo = netsnmp_handler_registration_create("libvirtGuestTable", handler, libvirtGuestTable_oid, @@ -270,14 +270,14 @@ _libvirtGuestTable_initialize_interface(libvirtGuestTable_registration * reg_ptr 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 ) @@ -286,7 +286,7 @@ _libvirtGuestTable_initialize_interface(libvirtGuestTable_registration * reg_ptr 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); @@ -351,7 +351,7 @@ libvirtGuestTable_index_to_oid(netsnmp_index *oid_idx, libvirtGuestTable_mib_index *mib_idx) { int err = SNMP_ERR_NOERROR; - + /* * temp storage for parsing indexes */ @@ -403,7 +403,7 @@ libvirtGuestTable_index_from_oid(netsnmp_index *oid_idx, libvirtGuestTable_mib_index *mib_idx) { int err = SNMP_ERR_NOERROR; - + /* * temp storage for parsing indexes */ @@ -536,12 +536,12 @@ libvirtGuestTable_release_rowreq_ctx(libvirtGuestTable_rowreq_ctx *rowreq_ctx) DEBUGMSGTL(("internal:libvirtGuestTable:libvirtGuestTable_release_rowreq_ctx","called\n")); netsnmp_assert(NULL != rowreq_ctx); - + libvirtGuestTable_rowreq_ctx_cleanup(rowreq_ctx); if(rowreq_ctx->undo) libvirtGuestTable_release_data(rowreq_ctx->undo); - + /* * free index oid pointer */ @@ -565,13 +565,13 @@ _mfd_libvirtGuestTable_pre_request(netsnmp_mib_handler *handler, DEBUGMSGTL(("internal:libvirtGuestTable:_mfd_libvirtGuestTable_pre_request", "called\n")); - + if (1 != netsnmp_row_merge_status_first(reginfo, agtreq_info)) { DEBUGMSGTL(("internal:libvirtGuestTable", "skipping additional pre_request\n")); return SNMP_ERR_NOERROR; } - + rc = libvirtGuestTable_pre_request(libvirtGuestTable_if_ctx.user_ctx); if (MFD_SUCCESS != rc) { /* @@ -581,7 +581,7 @@ _mfd_libvirtGuestTable_pre_request(netsnmp_mib_handler *handler, "libvirtGuestTable_pre_request\n", rc)); netsnmp_request_set_error_all(requests, SNMP_VALIDATE_ERR(rc)); } - + return SNMP_ERR_NOERROR; } /* _mfd_libvirtGuestTable_pre_request */ @@ -616,7 +616,7 @@ _mfd_libvirtGuestTable_post_request(netsnmp_mib_handler *handler, "waiting for last post_request\n")); return SNMP_ERR_NOERROR; } - + packet_rc = netsnmp_check_all_requests_error(agtreq_info->asp, 0); if ((MFD_SUCCESS != packet_rc) && libvirtGuestTable_dirty_get()) { /* @@ -635,7 +635,7 @@ _mfd_libvirtGuestTable_post_request(netsnmp_mib_handler *handler, DEBUGMSGTL(("libvirtGuestTable","error %d from " "libvirtGuestTable_post_request\n", rc)); } - + return SNMP_ERR_NOERROR; } /* _mfd_libvirtGuestTable_post_request */ @@ -686,7 +686,7 @@ _mfd_libvirtGuestTable_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr) *rc_ptr = MFD_SUCCESS; memset(&mib_idx, 0x0, sizeof(mib_idx)); - + /* * try to parse oid */ @@ -704,7 +704,7 @@ _mfd_libvirtGuestTable_rowreq_from_index(netsnmp_index *oid_idx, int * rc_ptr) *rc_ptr = MFD_ERROR; return NULL; /* msg already logged */ } - + memcpy(&rowreq_ctx->tbl_idx, &mib_idx, sizeof(mib_idx)); /* @@ -741,7 +741,7 @@ _mfd_libvirtGuestTable_object_lookup(netsnmp_mib_handler *handler, int rc = SNMP_ERR_NOERROR; libvirtGuestTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); - + DEBUGMSGTL(("internal:libvirtGuestTable:_mfd_libvirtGuestTable_object_lookup","called\n")); /* @@ -799,7 +799,7 @@ _libvirtGuestTable_get_column( libvirtGuestTable_rowreq_ctx *rowreq_ctx, netsnmp_variable_list *var, int column ) { int rc = SNMPERR_SUCCESS; - + DEBUGMSGTL(("internal:libvirtGuestTable:_mfd_libvirtGuestTable_get_column", "called for %d\n", column)); @@ -887,7 +887,7 @@ _mfd_libvirtGuestTable_get_values(netsnmp_mib_handler *handler, DEBUGMSGTL(("internal:libvirtGuestTable:_mfd_libvirtGuestTable_get_values","called\n")); netsnmp_assert(NULL != rowreq_ctx); - + for(;requests; requests = requests->next) { /* * save old pointer, so we can free it if replaced @@ -909,7 +909,7 @@ _mfd_libvirtGuestTable_get_values(netsnmp_mib_handler *handler, tri = netsnmp_extract_table_info(requests); if(NULL == tri) continue; - + rc = _libvirtGuestTable_get_column(rowreq_ctx, requests->requestvb, tri->colnum); if(rc) { if(MFD_SKIP == rc) { @@ -961,7 +961,7 @@ _libvirtGuestTable_check_column( libvirtGuestTable_rowreq_ctx *rowreq_ctx, netsnmp_variable_list *var, int column ) { int rc = SNMPERR_SUCCESS; - + DEBUGMSGTL(("internal:libvirtGuestTable:_libvirtGuestTable_check_column", "called for %d\n", column)); @@ -1066,7 +1066,7 @@ _mfd_libvirtGuestTable_check_objects(netsnmp_mib_handler *handler, DEBUGMSGTL(("internal:libvirtGuestTable:_mfd_libvirtGuestTable_check_objects","called\n")); netsnmp_assert(NULL != rowreq_ctx); - + for(;requests; requests = requests->next) { /* @@ -1101,7 +1101,7 @@ NETSNMP_STATIC_INLINE int _libvirtGuestTable_undo_setup_column( libvirtGuestTable_rowreq_ctx *rowreq_ctx, int column ) { int rc = SNMPERR_SUCCESS; - + DEBUGMSGTL(("internal:libvirtGuestTable:_libvirtGuestTable_undo_setup_column", "called for %d\n", column)); @@ -1180,7 +1180,7 @@ _mfd_libvirtGuestTable_undo_setup(netsnmp_mib_handler *handler, tri = netsnmp_extract_table_info(requests); if(NULL == tri) continue; - + rc = _libvirtGuestTable_undo_setup_column(rowreq_ctx, tri->colnum); if(MFD_SUCCESS != rc) { DEBUGMSGTL(("libvirtGuestTable:mfd","error %d from " @@ -1189,7 +1189,7 @@ _mfd_libvirtGuestTable_undo_setup(netsnmp_mib_handler *handler, } } /* for results */ } - + return SNMP_ERR_NOERROR; } /* _mfd_libvirtGuestTable_undo_setup */ @@ -1253,7 +1253,7 @@ _libvirtGuestTable_set_column( libvirtGuestTable_rowreq_ctx *rowreq_ctx, netsnmp_variable_list *var, int column ) { int rc = SNMPERR_SUCCESS; - + DEBUGMSGTL(("internal:libvirtGuestTable:_libvirtGuestTable_set_column", "called for %d\n", column)); @@ -1278,7 +1278,7 @@ _libvirtGuestTable_set_column( libvirtGuestTable_rowreq_ctx *rowreq_ctx, rc = SNMP_ERR_GENERR; break; } - + return rc; } /* _libvirtGuestTable_set_column */ @@ -1296,7 +1296,7 @@ _mfd_libvirtGuestTable_set_values(netsnmp_mib_handler *handler, DEBUGMSGTL(("internal:libvirtGuestTable:_mfd_libvirtGuestTable_set_values","called\n")); netsnmp_assert(NULL != rowreq_ctx); - + rowreq_ctx->column_set_flags = 0; for(;requests; requests = requests->next) { /* @@ -1305,7 +1305,7 @@ _mfd_libvirtGuestTable_set_values(netsnmp_mib_handler *handler, tri = netsnmp_extract_table_info(requests); if(NULL == tri) continue; - + rc = _libvirtGuestTable_set_column(rowreq_ctx, requests->requestvb, tri->colnum); if(MFD_SUCCESS != rc) { @@ -1340,7 +1340,7 @@ _mfd_libvirtGuestTable_commit(netsnmp_mib_handler *handler, DEBUGMSGTL(("internal:libvirtGuestTable:_mfd_libvirtGuestTable_commit","called\n")); netsnmp_assert(NULL != rowreq_ctx); - + rc = libvirtGuestTable_commit(rowreq_ctx); if (MFD_SUCCESS != rc) { DEBUGMSGTL(("libvirtGuestTable:mfd","error %d from " @@ -1413,7 +1413,7 @@ _libvirtGuestTable_undo_column( libvirtGuestTable_rowreq_ctx *rowreq_ctx, netsnmp_variable_list *var, int column ) { int rc = SNMPERR_SUCCESS; - + DEBUGMSGTL(("internal:libvirtGuestTable:_libvirtGuestTable_undo_column", "called for %d\n", column)); @@ -1453,7 +1453,7 @@ _mfd_libvirtGuestTable_undo_values(netsnmp_mib_handler *handler, DEBUGMSGTL(("internal:libvirtGuestTable:_mfd_libvirtGuestTable_undo_values","called\n")); netsnmp_assert(NULL != rowreq_ctx); - + rc = libvirtGuestTable_undo(rowreq_ctx); if (MFD_SUCCESS != rc) { /* @@ -1462,7 +1462,7 @@ _mfd_libvirtGuestTable_undo_values(netsnmp_mib_handler *handler, DEBUGMSGTL(("libvirtGuestTable:mfd","error %d from " "libvirtGuestTable_undo\n", rc)); } - + for(;requests; requests = requests->next) { /* * set column data @@ -1470,7 +1470,7 @@ _mfd_libvirtGuestTable_undo_values(netsnmp_mib_handler *handler, tri = netsnmp_extract_table_info(requests); if(NULL == tri) continue; - + rc = _libvirtGuestTable_undo_column(rowreq_ctx, requests->requestvb, tri->colnum); if (MFD_SUCCESS != rc) { @@ -1502,11 +1502,11 @@ _mfd_libvirtGuestTable_irreversible_commit(netsnmp_mib_handler *handler, { libvirtGuestTable_rowreq_ctx *rowreq_ctx = netsnmp_container_table_row_extract(requests); - + DEBUGMSGTL(("internal:libvirtGuestTable:_mfd_libvirtGuestTable_irreversible:commit","called\n")); - + netsnmp_assert(NULL != rowreq_ctx); - + /* * check for and handle row creation/deletion * and update column exist flags... @@ -1550,7 +1550,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 */ @@ -1608,7 +1608,7 @@ _container_free(netsnmp_container *container) * call user code */ libvirtGuestTable_container_free(container); - + /* * free all items. inefficient, but easy. */ diff --git a/src/libvirtGuestTable_interface.h b/src/libvirtGuestTable_interface.h index 97a7ccc..149a045 100644 --- a/src/libvirtGuestTable_interface.h +++ b/src/libvirtGuestTable_interface.h @@ -25,7 +25,7 @@ * \warning This code should not be modified, called directly, * or used to interpret functionality. It is subject to * change at any time. - * + * * @{ */ /* diff --git a/src/libvirtGuestTable_oids.h b/src/libvirtGuestTable_oids.h index a8f97fd..85950f4 100644 --- a/src/libvirtGuestTable_oids.h +++ b/src/libvirtGuestTable_oids.h @@ -33,27 +33,27 @@ extern "C" { #define COLUMN_LIBVIRTGUESTUUID 1 - + #define COLUMN_LIBVIRTGUESTNAME 2 - + #define COLUMN_LIBVIRTGUESTSTATE 3 #define COLUMN_LIBVIRTGUESTSTATE_FLAG (0x1 << 0) - + #define COLUMN_LIBVIRTGUESTCPUCOUNT 4 - + #define COLUMN_LIBVIRTGUESTMEMORYCURRENT 5 - + #define COLUMN_LIBVIRTGUESTMEMORYLIMIT 6 - + #define COLUMN_LIBVIRTGUESTCPUTIME 7 - + #define COLUMN_LIBVIRTGUESTROWSTATUS 9 #define COLUMN_LIBVIRTGUESTROWSTATUS_FLAG (0x1 << 1) - + #define LIBVIRTGUESTTABLE_MIN_COL COLUMN_LIBVIRTGUESTNAME #define LIBVIRTGUESTTABLE_MAX_COL COLUMN_LIBVIRTGUESTROWSTATUS - + /* * TODO:405:r: Review LIBVIRTGUESTTABLE_SETTABLE_COLS macro. @@ -66,7 +66,7 @@ extern "C" { * default is writable cols w/out defaults. */ #define LIBVIRTGUESTTABLE_REQUIRED_COLS (COLUMN_LIBVIRTGUESTSTATE_FLAG | COLUMN_LIBVIRTGUESTROWSTATUS_FLAG) - + #ifdef __cplusplus } diff --git a/src/libvirtMib_subagent.c b/src/libvirtMib_subagent.c index 2ce1509..7c038fc 100644 --- a/src/libvirtMib_subagent.c +++ b/src/libvirtMib_subagent.c @@ -73,10 +73,10 @@ main (int argc, char **argv) { dont_fork = 1; break; case 'H': - netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, + netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_NO_ROOT_ACCESS, 1); init_agent("libvirtGuestTable"); /* register our .conf handlers */ - init_libvirtGuestTable(); + init_libvirtGuestTable(); init_snmp("libvirtGuestTable"); fprintf(stderr, "Configuration directives understood:\n"); read_config_print_usage(" "); @@ -98,12 +98,12 @@ main (int argc, char **argv) { if (optind < argc) { int i; /* - * There are optional transport addresses on the command line. + * There are optional transport addresses on the command line. */ DEBUGMSGTL(("snmpd/main", "optind %d, argc %d\n", optind, argc)); for (i = optind; i < argc; i++) { char *c, *astring; - if ((c = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, + if ((c = netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_PORTS))) { astring = malloc(strlen(c) + 2 + strlen(argv[i])); if (astring == NULL) { @@ -111,16 +111,16 @@ main (int argc, char **argv) { exit(1); } sprintf(astring, "%s,%s", c, argv[i]); - netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, + netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_PORTS, astring); SNMP_FREE(astring); } else { - netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, + netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_PORTS, argv[i]); } } DEBUGMSGTL(("snmpd/main", "port spec: %s\n", - netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, + netsnmp_ds_get_string(NETSNMP_DS_APPLICATION_ID, NETSNMP_DS_AGENT_PORTS))); } @@ -148,12 +148,12 @@ main (int argc, char **argv) { /* initialize tcp/ip if necessary */ SOCK_STARTUP; - + /* initialize the agent library */ init_agent("libvirtGuestTable"); /* init libvirtGuestTable mib code */ - init_libvirtGuestTable(); + init_libvirtGuestTable(); /* read libvirtGuestTable.conf files. */ init_snmp("libvirtGuestTable"); -- 1.7.8.6 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list