Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
fe70c334
Commit
fe70c334
authored
Mar 27, 2015
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/snmpd: add wrsGeneralStatusGroup so far only for cache testing
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
cb7a60cf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
1 deletion
+72
-1
Makefile
userspace/snmpd/Makefile
+2
-1
init.c
userspace/snmpd/init.c
+2
-0
wrsGeneralStatusGroup.c
userspace/snmpd/wrsGeneralStatusGroup.c
+55
-0
wrsGeneralStatusGroup.h
userspace/snmpd/wrsGeneralStatusGroup.h
+13
-0
No files found.
userspace/snmpd/Makefile
View file @
fe70c334
...
...
@@ -36,7 +36,8 @@ SOURCES = \
wrsTemperature.c
\
wrsOSStatus.c
\
wrsVersionGroup.c
\
wrsPortStatusTable.c
wrsPortStatusTable.c
\
wrsGeneralStatusGroup.c
OBJECTS
=
$
(
SOURCES:.c
=
.o
)
...
...
userspace/snmpd/init.c
View file @
fe70c334
...
...
@@ -16,6 +16,7 @@
#include "wrsOSStatus.h"
#include "wrsVersionGroup.h"
#include "wrsPortStatusTable.h"
#include "wrsGeneralStatusGroup.h"
FILE
*
wrs_logf
;
/* for the local-hack messages */
...
...
@@ -31,4 +32,5 @@ void init_wrsSnmp(void)
init_wrsOSStatus
();
init_wrsVersionGroup
();
init_wrsPortStatusTable
();
init_wrsGeneralStatusGroup
();
}
userspace/snmpd/wrsGeneralStatusGroup.c
0 → 100644
View file @
fe70c334
#include "wrsSnmp.h"
#include "shmem_snmp.h"
#include "wrsCurrentTimeGroup.h"
#include "wrsOSStatus.h"
#include "wrsPortStatusTable.h"
#include "wrsPstatsTable.h"
#include "wrsPtpDataTable.h"
#include "wrsStartCntGroup.h"
#include "wrsTemperature.h"
#include "wrsVersionGroup.h"
#include "wrsGeneralStatusGroup.h"
static
struct
pickinfo
wrsGeneralStatus_pickinfo
[]
=
{
FIELD
(
wrsGeneralStatus_s
,
ASN_INTEGER
,
wrsMainSystemStatus
),
};
struct
wrsGeneralStatus_s
wrsGeneralStatus_s
;
time_t
wrsGeneralStatus_data_fill
(
void
)
{
static
time_t
time_update
;
/* time of last update */
time_t
time_temp
;
/* time when temperature data was updated */
time_temp
=
wrsTemperature_data_fill
();
if
(
time_temp
<=
time_update
)
{
/* cache not updated, return last update time */
snmp_log
(
LOG_ERR
,
"SNMP: wrsGeneralStatusGroup cache
\n
"
);
return
time_update
;
}
time_update
=
time
(
NULL
);
wrsCurrentTime_data_fill
();
wrsOSStatus_data_fill
();
wrsPortStatusTable_data_fill
(
NULL
);
wrsPstatsTable_data_fill
(
NULL
);
wrsPtpDataTable_data_fill
(
NULL
);
wrsStartCnt_data_fill
();
wrsVersion_data_fill
();
/*memset(&wrsGeneralStatus_s, 0, sizeof(wrsGeneralStatus_s));*/
wrsGeneralStatus_s
.
wrsMainSystemStatus
++
;
/* there was an update, return current time */
return
time_update
;
}
#define GT_OID WRSGENERALSTATUS_OID
#define GT_PICKINFO wrsGeneralStatus_pickinfo
#define GT_DATA_FILL_FUNC wrsGeneralStatus_data_fill
#define GT_DATA_STRUCT wrsGeneralStatus_s
#define GT_GROUP_NAME "wrsGeneralStatusGroup"
#define GT_INIT_FUNC init_wrsGeneralStatusGroup
#include "wrsGroupTemplate.h"
userspace/snmpd/wrsGeneralStatusGroup.h
0 → 100644
View file @
fe70c334
#ifndef WRS_GENERAL_STATUS_GROUP_H
#define WRS_GENERAL_STATUS_GROUP_H
#define WRSGENERALSTATUS_OID WRS_OID, 254, 254
struct
wrsGeneralStatus_s
{
int
wrsMainSystemStatus
;
};
extern
struct
wrsGeneralStatus_s
wrsGeneralStatus_s
;
time_t
wrsGeneralStatus_data_fill
(
void
);
void
init_wrsGeneralStatusGroup
(
void
);
#endif
/* WRS_GENERAL_STATUS_GROUP_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment