Commit 3acd87a2 authored by Adam Wujek's avatar Adam Wujek 💬

userspace/snmpd: add wrsSpllBuildBy to the wrsSpllVersionGroup

Add "Build by" of spll
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 6bef87d2
......@@ -1035,6 +1035,14 @@ wrsSpllBuildDate OBJECT-TYPE
"The build date of the Soft PLL, '__DATE__' at build time"
::= { wrsSpllVersionGroup 2 }
wrsSpllBuildBy OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..32))
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The build by of the Soft PLL"
::= { wrsSpllVersionGroup 3 }
-- wrsSpllStatusGroup (.7.3.2)
wrsSpllStatusGroup OBJECT IDENTIFIER ::= { wrsSpllState 2 }
......
......@@ -77,6 +77,7 @@ struct spll_stats {
char commit_id[32];
char build_date[16];
char build_time[16];
char build_by[32];
};
extern struct spll_stats stats;
......
......@@ -11,6 +11,7 @@ static struct spll_stats *spll_stats_p;
static struct pickinfo wrsSpllVersion_pickinfo[] = {
FIELD(wrsSpllVersion_s, ASN_OCTET_STR, commit_id),
FIELD(wrsSpllVersion_s, ASN_OCTET_STR, build_date),
FIELD(wrsSpllVersion_s, ASN_OCTET_STR, build_by),
};
struct wrsSpllVersion_s wrsSpllVersion_s;
......@@ -60,7 +61,7 @@ time_t wrsSpllVersion_data_fill(void)
}
/* check version of SPLL's stat structure, version fields are from
* version 2 */
if (spll_stats_p->ver == 2) {
if (spll_stats_p->ver == 2 || spll_stats_p->ver == 3) {
int len;
strncpy_e(wrsSpllVersion_s.commit_id, spll_stats_p->commit_id, 32);
/* concatenate date and time */
......@@ -70,6 +71,10 @@ time_t wrsSpllVersion_data_fill(void)
/* add time after added space at the end of string */
strncpy_e(&wrsSpllVersion_s.build_date[len + 1], spll_stats_p->build_time, 16 - 1);
}
/* buil_by was introduced in version 3 */
if (spll_stats_p->ver == 3) {
strncpy_e(wrsSpllVersion_s.build_by, spll_stats_p->build_by, 32);
}
/* there was an update, return current time */
return time_update;
}
......
......@@ -7,6 +7,7 @@
struct wrsSpllVersion_s {
char commit_id[32];
char build_date[32];
char build_by[32];
};
extern struct wrsSpllVersion_s wrsSpllVersion_s;
......
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