Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
White Rabbit Switch - Software
Manage
Activity
Members
Labels
Plan
Issues
91
Issue boards
Milestones
Wiki
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
White Rabbit Switch - Software
Commits
66c68d4a
Commit
66c68d4a
authored
10 years ago
by
Adam Wujek
Browse files
Options
Downloads
Patches
Plain Diff
userspace/snmpd: add opening RTUd's shmem
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
b51ddef0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
userspace/snmpd/snmp_shmem.c
+22
-0
22 additions, 0 deletions
userspace/snmpd/snmp_shmem.c
userspace/snmpd/snmp_shmem.h
+4
-0
4 additions, 0 deletions
userspace/snmpd/snmp_shmem.h
with
26 additions
and
0 deletions
userspace/snmpd/snmp_shmem.c
+
22
−
0
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
();
}
This diff is collapsed.
Click to expand it.
userspace/snmpd/snmp_shmem.h
+
4
−
0
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 */
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment