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
66c68d4a
Commit
66c68d4a
authored
Mar 26, 2015
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace/snmpd: add opening RTUd's shmem
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
b51ddef0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
snmp_shmem.c
userspace/snmpd/snmp_shmem.c
+22
-0
snmp_shmem.h
userspace/snmpd/snmp_shmem.h
+4
-0
No files found.
userspace/snmpd/snmp_shmem.c
View file @
66c68d4a
...
...
@@ -12,6 +12,9 @@ struct wrs_shm_head *ppsi_head;
static
struct
pp_globals
*
ppg
;
struct
wr_servo_state_t
*
ppsi_servo
;
/* RTUd */
struct
wrs_shm_head
*
rtud_head
;
static
void
init_shm_hal
(
void
)
...
...
@@ -73,7 +76,26 @@ static void init_shm_ppsi(void)
}
static
void
init_shm_rtud
(
void
)
{
/* open RTUd's shm */
rtud_head
=
wrs_shm_get
(
wrs_shm_rtu
,
""
,
WRS_SHM_READ
);
if
(
!
rtud_head
)
{
snmp_log
(
LOG_ERR
,
"unable to open shm for RTUd!
\n
"
);
exit
(
-
1
);
}
/* check rtud's shm version */
if
(
rtud_head
->
version
!=
RTU_SHMEM_VERSION
)
{
snmp_log
(
LOG_ERR
,
"unknown RTUd's shm version %i "
"(known is %i)
\n
"
,
rtud_head
->
version
,
RTU_SHMEM_VERSION
);
exit
(
-
1
);
}
}
void
init_shm
(
void
){
init_shm_hal
();
init_shm_ppsi
();
init_shm_rtud
();
}
userspace/snmpd/snmp_shmem.h
View file @
66c68d4a
...
...
@@ -5,6 +5,7 @@
#include <libwr/hal_shmem.h>
#include <ppsi/ppsi.h>
#include <libwr/hal_shmem.h>
#include <libwr/rtu_shmem.h>
/* HAL */
extern
struct
wrs_shm_head
*
hal_head
;
...
...
@@ -16,6 +17,9 @@ extern int hal_nports_local;
extern
struct
wrs_shm_head
*
ppsi_head
;
extern
struct
wr_servo_state_t
*
ppsi_servo
;
/* RTUd */
struct
wrs_shm_head
*
rtud_head
;
void
init_shm
();
#endif
/* WRS_SNMP_SHMEM_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