Commit 204c50ab authored by Martin Kletzander's avatar Martin Kletzander

cleanup: whitespaces removed from ends of lines

parent 3c399ce4
......@@ -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."
}
......@@ -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.
......
......@@ -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.
......
......@@ -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
......
......@@ -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
......
......@@ -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 */
}
......
......@@ -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
*/
......
......@@ -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
......
......@@ -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
......
......@@ -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 */
......
......@@ -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 */
......
This diff is collapsed.
......@@ -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.
*
*
* @{
*/
/*
......
......@@ -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
}
......
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment