This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
fixeria gerrit-no-reply at lists.osmocom.orgfixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/26150 )
Change subject: ipaccess-config: request and print NM_ATT_IPACC_NV_FLAGS
......................................................................
ipaccess-config: request and print NM_ATT_IPACC_NV_FLAGS
Below is an example output:
"""
Received SIGNAL S_NM_GET_ATTR_REP
{
"primary_oml_ip": "192.168.100.100",
"primary_oml_port": "0",
"unit_id": "6969/0/0",
"nv_flags": {
"static-ip": "no",
"static-gw": "no",
"no-dhcp-vsi": "no",
"dhcp-enabled": "yes",
"led-enabled": "yes",
"secondary-oml-enabled": "yes",
"diag-enabled": "yes",
"cli-enabled": "yes",
"http-enabled": "no",
"post-enabled": "yes",
"snmp-enabled": "yes",
}
}
"""
Change-Id: Ic901910878529e6d8b152b3417463bae60644b82
---
M src/ipaccess/ipaccess-config.c
1 file changed, 23 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/50/26150/1
diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c
index b10959c..493644b 100644
--- a/src/ipaccess/ipaccess-config.c
+++ b/src/ipaccess/ipaccess-config.c
@@ -268,6 +268,8 @@
return 0;
}
+static const struct value_string ipa_nvflag_strs[];
+
static int print_attr_rep(struct msgb *mb)
{
/* Parse using nanoBTS own formatting for Get Attribute Response */
@@ -303,6 +305,26 @@
print_field("primary_oml_port", "%u", oml_port);
print_field("unit_id", "%s", unit_id);
+ uint16_t Fx = (TLVP_VAL(&tp, NM_ATT_IPACC_NV_FLAGS)[2] << 8)
+ | (TLVP_VAL(&tp, NM_ATT_IPACC_NV_FLAGS)[0] << 0);
+ uint16_t Mx = (TLVP_VAL(&tp, NM_ATT_IPACC_NV_FLAGS)[3] << 8)
+ | (TLVP_VAL(&tp, NM_ATT_IPACC_NV_FLAGS)[1] << 0);
+ const struct value_string *nvflag = ipa_nvflag_strs;
+
+ print_offset("\"nv_flags\": {\n");
+ indent++;
+
+ while (nvflag->value != 0x00 && nvflag->str != NULL) {
+ const char *val = (Fx & nvflag->value) ? "yes" : "no";
+ if (~Mx & nvflag->value)
+ val = "unknown";
+ print_field(nvflag->str, "%s", val);
+ nvflag++;
+ }
+
+ indent--;
+ print_offset("}\n");
+
indent--;
print_offset("}\n");
@@ -557,6 +579,7 @@
if (get_attr) {
msgb_put_u8(nmsg_get, NM_ATT_IPACC_PRIM_OML_CFG);
msgb_put_u8(nmsg_get, NM_ATT_IPACC_UNIT_ID);
+ msgb_put_u8(nmsg_get, NM_ATT_IPACC_NV_FLAGS);
}
if (unit_id) {
len = strlen(unit_id);
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/26150
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ic901910878529e6d8b152b3417463bae60644b82
Gerrit-Change-Number: 26150
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211107/9b6066b6/attachment.htm>