Attention is currently required from: pespin. daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-gbproxy/+/29714 )
Change subject: gbproxy_vty: Add commands to list Cell/BVC of an NSE ......................................................................
Patch Set 2:
(4 comments)
File src/gb_proxy_vty.c:
https://gerrit.osmocom.org/c/osmo-gbproxy/+/29714/comment/70caa7bd_6f637b89 PS1, Line 549: if (!strcmp(argv[0], "bss")) {
you could simply store g_cfg->bss_nses or g_cfg->sgsn_nses in a pointer and use shared code below.
I don't think that works with hashtable. DECLARE_HASHTABLE makes those:
struct hlist_head X_nses[256];
hash_for_hash() uses ARRAY_SIZE, so it doesn't work on a struct hlist_head *nses:
gb_proxy_vty.c: In function ‘show_gbproxy_bvc’: /home/daniel/local/osmo-master/include/osmocom/core/utils.h:19:34: warning: division ‘sizeof (struct hlist_head *) / sizeof (struct hlist_head)’ does not compute the number of array elements [-Wsizeof-pointer-div] 19 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | ^ /home/daniel/local/osmo-master/include/osmocom/core/hashtable.h:19:26: note: in expansion of macro ‘ARRAY_SIZE’ 19 | #define HASH_SIZE(name) (ARRAY_SIZE(name)) | ^~~~~~~~~~ /home/daniel/local/osmo-master/include/osmocom/core/hashtable.h:101:60: note: in expansion of macro ‘HASH_SIZE’ 101 | for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\ | ^~~~~~~~~ gb_proxy_vty.c:529:9: note: in expansion of macro ‘hash_for_each’ 529 | hash_for_each(nses, i, nse, list) { | ^~~~~~~~~~~~~ gb_proxy_vty.c:516:28: note: first ‘sizeof’ operand was declared here 516 | struct hlist_head *nses; | ^~~~
https://gerrit.osmocom.org/c/osmo-gbproxy/+/29714/comment/1e601b2b_a1301eca PS1, Line 550: hash_for_each(g_cfg->bss_nses, i, nse, list)
please add {} around hash_for_each
Done
https://gerrit.osmocom.org/c/osmo-gbproxy/+/29714/comment/c2e5e3b8_be7b69e5 PS1, Line 554: hash_for_each(g_cfg->sgsn_nses, i, nse, list)
please add {} around hash_for_each
Done
https://gerrit.osmocom.org/c/osmo-gbproxy/+/29714/comment/542920dc_a67ec229 PS1, Line 588: hash_for_each(g_cfg->cells, i, cell, list)
please add {} around hash_for_each
Done