Commit e09b3e97 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/snmpd: create wrsTemperature.h

Move code from wrsTemperature.c to wrsTemperature.h and wrsSnmp.h
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 602e638a
......@@ -7,6 +7,7 @@
/* The sub-init functions */
#include "wrsSnmp.h"
#include "wrsTemperature.h"
FILE *wrs_logf; /* for the local-hack messages */
......
#ifndef WRS_SNMP_H
#define WRS_SNMP_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 <libwr/shmem.h>
#include <libwr/hal_shmem.h>
extern struct wrs_shm_head *hal_head;
extern struct hal_shmem_header *hal_shmem;
extern struct hal_port_state *hal_ports;
extern int hal_nports_local;
/*
* local hack: besides the file pointer, that is there anyways,
......
#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/auto_nlist.h>
/* Crap! -- everybody makes them different, and even ppsi::ieee wants them */
#undef FALSE
#undef TRUE
/* conflict between definition in net-snmp-agent-includes.h (which include
* snmp_vars.h) and ppsi.h where INST is defined as a inline function */
#undef INST
#include <ppsi/ieee1588_types.h> /* for ClockIdentity */
#include <libwr/shmem.h>
#include <ppsi/ppsi.h>
#include <libwr/hal_shmem.h>
#include <stdio.h>
#include "wrsSnmp.h"
extern struct wrs_shm_head *hal_head;
extern struct hal_shmem_header *hal_shmem;
extern struct hal_port_state *hal_ports;
extern int hal_nports_local;
/* Our data: globals */
static struct wrsTemperature_s {
int temp_fpga; /* FPGA temperature */
int temp_pll; /* PLL temperature */
int temp_psl; /* PSL temperature */
int temp_psr; /* PSR temperature */
int temp_fpga_thold; /* Threshold value for FPGA temperature */
int temp_pll_thold; /* Threshold value for PLL temperature */
int temp_psl_thold; /* Threshold value for PSL temperature */
int temp_psr_thold; /* Threshold value for PSR temperature */
} wrsTemperature_s;
#include "wrsTemperature.h"
static struct pickinfo wrsTemperature_pickinfo[] = {
FIELD(wrsTemperature_s, ASN_INTEGER, temp_fpga),
......@@ -46,6 +12,7 @@ static struct pickinfo wrsTemperature_pickinfo[] = {
FIELD(wrsTemperature_s, ASN_INTEGER, temp_psr_thold),
};
struct wrsTemperature_s wrsTemperature_s;
int wrsTemperature_data_fill(void)
{
......
#ifndef WRS_WRS_TEMPERATURE_H
#define WRS_WRS_TEMPERATURE_H
struct wrsTemperature_s {
int temp_fpga; /* FPGA temperature */
int temp_pll; /* PLL temperature */
int temp_psl; /* PSL temperature */
int temp_psr; /* PSR temperature */
int temp_fpga_thold; /* Threshold value for FPGA temperature */
int temp_pll_thold; /* Threshold value for PLL temperature */
int temp_psl_thold; /* Threshold value for PSL temperature */
int temp_psr_thold; /* Threshold value for PSR temperature */
};
extern struct wrsTemperature_s wrsTemperature_s;
int wrsTemperature_data_fill(void);
void init_wrsTemperature(void);
#endif /* WRS_WRS_TEMPERATURE_H */
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