Build failure of network:osmocom:nightly/osmo-iuh in openSUSE_Leap_15.1_ARM/armv7l

2021-10-27 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/openSUSE_Leap_15.1_ARM/armv7l

Package network:osmocom:nightly/osmo-iuh failed to build in 
openSUSE_Leap_15.1_ARM/armv7l

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[ 1459s] intention of the Shared Library Policy is to allow parallel 
installation of
[ 1459s] multiple versions of the same shared library, hard dependencies likely 
make
[ 1459s] that impossible. Please remove this dependency and instead move it to 
the
[ 1459s] runtime uses of your library.
[ 1459s] 
[ 1459s] osmo-iuh.armv7hl: W: suse-missing-rclink osmo-hnbgw
[ 1459s] The package contains an init script or systemd service file but lacks 
the
[ 1459s] symlink /usr/sbin/rcFOO -> /usr/sbin/service
[ 1459s] 
[ 1459s] libosmo-hnbap0.armv7hl: E: library-without-ldconfig-postin (Badness: 
300) /usr/lib/libosmo-hnbap.so.0.0.0
[ 1459s] libosmo-rua0.armv7hl: E: library-without-ldconfig-postin (Badness: 
300) /usr/lib/libosmo-rua.so.0.0.0
[ 1459s] This package contains a library and provides no %post scriptlet 
containing a
[ 1459s] call to ldconfig.
[ 1459s] 
[ 1459s] libosmo-hnbap0.armv7hl: E: library-without-ldconfig-postun (Badness: 
300) /usr/lib/libosmo-hnbap.so.0.0.0
[ 1459s] libosmo-rua0.armv7hl: E: library-without-ldconfig-postun (Badness: 
300) /usr/lib/libosmo-rua.so.0.0.0
[ 1459s] This package contains a library and provides no %postun scriptlet 
containing a
[ 1459s] call to ldconfig.
[ 1459s] 
[ 1459s] (none): E: badness 1200 exceeds threshold 1000, aborting.
[ 1459s] 10 packages and 0 specfiles checked; 4 errors, 21 warnings.
[ 1459s] 
[ 1459s] ### VM INTERACTION START ###
[ 1463s] [ 1433.510209] sysrq: SysRq : Power Off
[ 1463s] [ 1433.520833] reboot: Power down
[ 1463s] ### VM INTERACTION END ###
[ 1463s] 
[ 1463s] obs-arm-5 failed "build osmo-iuh.spec" at Thu Oct 28 01:10:00 UTC 2021.
[ 1463s] 

-- 
Configure notifications at https://build.opensuse.org/my/subscriptions
openSUSE Build Service (https://build.opensuse.org/)


Change in osmo-bsc[master]: refactor lchan counting

2021-10-27 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25972 )

Change subject: refactor lchan counting
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/include/osmocom/bsc/gsm_data.h
File include/osmocom/bsc/gsm_data.h:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/include/osmocom/bsc/gsm_data.h@1439
PS1, Line 1439: CHAN_COUNTS2_N
> it's to know how large to define the array (N as in number of indexes)
A more usual naming would be '_CHAN_COUNTS2_NUM'.


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/include/osmocom/bsc/gsm_data.h@1442
PS1, Line 1442: extern const struct value_string chan_count2_strs[];
> oh i thought i had kept those *str* functions in a separate patch, just 
> needed it for debugging and  […]
If you don't move them yourself, Pau will do this during his next refactoring ;)



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25972
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2fb48c549186db812b1e9d6b735a92e80f27b8d3
Gerrit-Change-Number: 25972
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-CC: fixeria 
Gerrit-Comment-Date: Thu, 28 Oct 2021 00:52:59 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels 
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Build failure of network:osmocom:nightly/osmo-iuh in openSUSE_Leap_15.1_ARM/aarch64

2021-10-27 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/openSUSE_Leap_15.1_ARM/aarch64

Package network:osmocom:nightly/osmo-iuh failed to build in 
openSUSE_Leap_15.1_ARM/aarch64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  159s] intention of the Shared Library Policy is to allow parallel 
installation of
[  159s] multiple versions of the same shared library, hard dependencies likely 
make
[  159s] that impossible. Please remove this dependency and instead move it to 
the
[  159s] runtime uses of your library.
[  159s] 
[  159s] osmo-iuh.aarch64: W: suse-missing-rclink osmo-hnbgw
[  159s] The package contains an init script or systemd service file but lacks 
the
[  159s] symlink /usr/sbin/rcFOO -> /usr/sbin/service
[  159s] 
[  159s] libosmo-hnbap0.aarch64: E: library-without-ldconfig-postin (Badness: 
300) /usr/lib64/libosmo-hnbap.so.0.0.0
[  159s] libosmo-rua0.aarch64: E: library-without-ldconfig-postin (Badness: 
300) /usr/lib64/libosmo-rua.so.0.0.0
[  159s] This package contains a library and provides no %post scriptlet 
containing a
[  159s] call to ldconfig.
[  159s] 
[  159s] libosmo-hnbap0.aarch64: E: library-without-ldconfig-postun (Badness: 
300) /usr/lib64/libosmo-hnbap.so.0.0.0
[  159s] libosmo-rua0.aarch64: E: library-without-ldconfig-postun (Badness: 
300) /usr/lib64/libosmo-rua.so.0.0.0
[  159s] This package contains a library and provides no %postun scriptlet 
containing a
[  159s] call to ldconfig.
[  159s] 
[  159s] (none): E: badness 1200 exceeds threshold 1000, aborting.
[  159s] 10 packages and 0 specfiles checked; 4 errors, 21 warnings.
[  159s] 
[  159s] ### VM INTERACTION START ###
[  165s] [  158.460446] sysrq: SysRq : Power Off
[  165s] [  158.461321] reboot: Power down
[  165s] ### VM INTERACTION END ###
[  165s] 
[  165s] obs-arm-11 failed "build osmo-iuh.spec" at Thu Oct 28 00:41:33 UTC 
2021.
[  165s] 

-- 
Configure notifications at https://build.opensuse.org/my/subscriptions
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/osmo-iuh in openSUSE_Leap_15.1/x86_64

2021-10-27 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/openSUSE_Leap_15.1/x86_64

Package network:osmocom:nightly/osmo-iuh failed to build in 
openSUSE_Leap_15.1/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[  214s] intention of the Shared Library Policy is to allow parallel 
installation of
[  214s] multiple versions of the same shared library, hard dependencies likely 
make
[  214s] that impossible. Please remove this dependency and instead move it to 
the
[  214s] runtime uses of your library.
[  214s] 
[  214s] osmo-iuh.x86_64: W: suse-missing-rclink osmo-hnbgw
[  214s] The package contains an init script or systemd service file but lacks 
the
[  214s] symlink /usr/sbin/rcFOO -> /usr/sbin/service
[  214s] 
[  214s] libosmo-hnbap0.x86_64: E: library-without-ldconfig-postin (Badness: 
300) /usr/lib64/libosmo-hnbap.so.0.0.0
[  214s] libosmo-rua0.x86_64: E: library-without-ldconfig-postin (Badness: 300) 
/usr/lib64/libosmo-rua.so.0.0.0
[  214s] This package contains a library and provides no %post scriptlet 
containing a
[  214s] call to ldconfig.
[  214s] 
[  214s] libosmo-hnbap0.x86_64: E: library-without-ldconfig-postun (Badness: 
300) /usr/lib64/libosmo-hnbap.so.0.0.0
[  214s] libosmo-rua0.x86_64: E: library-without-ldconfig-postun (Badness: 300) 
/usr/lib64/libosmo-rua.so.0.0.0
[  214s] This package contains a library and provides no %postun scriptlet 
containing a
[  214s] call to ldconfig.
[  214s] 
[  214s] (none): E: badness 1200 exceeds threshold 1000, aborting.
[  214s] 10 packages and 0 specfiles checked; 4 errors, 21 warnings.
[  214s] 
[  214s] ### VM INTERACTION START ###
[  217s] [  207.552211] sysrq: SysRq : Power Off
[  217s] [  207.557003] reboot: Power down
[  217s] ### VM INTERACTION END ###
[  217s] 
[  217s] old-cirrus3 failed "build osmo-iuh.spec" at Thu Oct 28 00:39:36 UTC 
2021.
[  217s] 

-- 
Configure notifications at https://build.opensuse.org/my/subscriptions
openSUSE Build Service (https://build.opensuse.org/)


Build failure of network:osmocom:nightly/osmo-iuh in openSUSE_Leap_15.2/x86_64

2021-10-27 Thread OBS Notification
Visit 
https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-iuh/openSUSE_Leap_15.2/x86_64

Package network:osmocom:nightly/osmo-iuh failed to build in 
openSUSE_Leap_15.2/x86_64

Check out the package for editing:
  osc checkout network:osmocom:nightly osmo-iuh

Last lines of build log:
[   93s] intention of the Shared Library Policy is to allow parallel 
installation of
[   93s] multiple versions of the same shared library, hard dependencies likely 
make
[   93s] that impossible. Please remove this dependency and instead move it to 
the
[   93s] runtime uses of your library.
[   93s] 
[   93s] osmo-iuh.x86_64: W: suse-missing-rclink osmo-hnbgw
[   93s] The package contains an init script or systemd service file but lacks 
the
[   93s] symlink /usr/sbin/rcFOO -> /usr/sbin/service
[   93s] 
[   93s] libosmo-hnbap0.x86_64: E: library-without-ldconfig-postin (Badness: 
300) /usr/lib64/libosmo-hnbap.so.0.0.0
[   93s] libosmo-rua0.x86_64: E: library-without-ldconfig-postin (Badness: 300) 
/usr/lib64/libosmo-rua.so.0.0.0
[   93s] This package contains a library and provides no %post scriptlet 
containing a
[   93s] call to ldconfig.
[   93s] 
[   93s] libosmo-hnbap0.x86_64: E: library-without-ldconfig-postun (Badness: 
300) /usr/lib64/libosmo-hnbap.so.0.0.0
[   93s] libosmo-rua0.x86_64: E: library-without-ldconfig-postun (Badness: 300) 
/usr/lib64/libosmo-rua.so.0.0.0
[   93s] This package contains a library and provides no %postun scriptlet 
containing a
[   93s] call to ldconfig.
[   93s] 
[   93s] (none): E: badness 1200 exceeds threshold 1000, aborting.
[   93s] 10 packages and 0 specfiles checked; 4 errors, 21 warnings.
[   93s] 
[   93s] ### VM INTERACTION START ###
[   96s] [   90.899513] sysrq: Power Off
[   96s] [   90.902693] reboot: Power down
[   96s] ### VM INTERACTION END ###
[   96s] 
[   96s] goat07 failed "build osmo-iuh.spec" at Thu Oct 28 00:35:08 UTC 2021.
[   96s] 

-- 
Configure notifications at https://build.opensuse.org/my/subscriptions
openSUSE Build Service (https://build.opensuse.org/)


Change in osmo-bsc[master]: constify lchan_state_is()

2021-10-27 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25971 )

Change subject: constify lchan_state_is()
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25971
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I523cbf04e77f43924c3f09094d56f815d3de640d
Gerrit-Change-Number: 25971
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 22:54:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: implement all_allocated:{sdcch, tch} rate counters

2021-10-27 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25974 )

Change subject: implement all_allocated:{sdcch,tch} rate counters
..


Patch Set 1:

The user simply sees a rate counter named "all_allocated:sdcch", both on each 
BTS and on the global BSC level, and when that rate counter shows '1', it means 
all SDCCH have been fully allocated for 1 second. If they increment a lot, it 
means there is a lot of congestion. No further action needed from the user, 
besides evaluating stats obtained from osmo-bsc


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25974
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I8b06e435a224c8708cd6c67e97ee5413718fc1ed
Gerrit-Change-Number: 25974
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 21:15:37 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: implement all_allocated:{sdcch, tch} rate counters

2021-10-27 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25974 )

Change subject: implement all_allocated:{sdcch,tch} rate counters
..


Patch Set 1:

> Please share an example on how this would look like from user point of view, 
> I'm totally lost here.

Again, you are familiar with the concept of rate counters, right?
Seems that you already know everything i am going to explain?
in summary, i add rate counters that increment for each second where all SDCCH 
slots are allocated.
Same for TCH. They are rate counters... I don't know what else to explain =) =) 
=)


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25974
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I8b06e435a224c8708cd6c67e97ee5413718fc1ed
Gerrit-Change-Number: 25974
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 21:12:40 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: add time_cc API: cumlative counter for time, reported as rate_ctr

2021-10-27 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25973 )

Change subject: add time_cc API: cumlative counter for time, reported as 
rate_ctr
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/25973/1/include/osmocom/bsc/time_cc.h
File include/osmocom/bsc/time_cc.h:

https://gerrit.osmocom.org/c/osmo-bsc/+/25973/1/include/osmocom/bsc/time_cc.h@129
PS1, Line 129: struct time_cc {
> Maybe add an API to allocate/initialize a structure for this.
Hmm, the usage example above this line actually lacks mention of talloc_zero().
There is no init needed besides bzero(). will add that.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25973
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icdd36f27cb54b2e1b940c9e6404ba9dd3692a310
Gerrit-Change-Number: 25973
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 21:09:54 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-bsc[master]: add time_cc API: cumlative counter for time, reported as rate_ctr

2021-10-27 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25973 )

Change subject: add time_cc API: cumlative counter for time, reported as 
rate_ctr
..


Patch Set 1:

> I'm really lacking some perspective/documentation on the exact use of this. I 
> mean, how is someone expected to consume this information and how is it 
> displayed? through VTY rate_ctr show?

You are familiar with rate_ctr, the prime way we deal out statistics from osmo 
programs.
As you certainly know, via stats exporter, also possible via CTRL, and IIRC via 
VTY too.
I don't understand what you're getting at. This is a rate counter that counts 
elapsed time, nothing else to it. Commit log states the inteded use, namely 
allAvailableSDCCHAllocated etc.
I don't know what else to say?


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25973
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icdd36f27cb54b2e1b940c9e6404ba9dd3692a310
Gerrit-Change-Number: 25973
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 21:06:58 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: refactor lchan counting

2021-10-27 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25972 )

Change subject: refactor lchan counting
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/include/osmocom/bsc/gsm_data.h
File include/osmocom/bsc/gsm_data.h:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/include/osmocom/bsc/gsm_data.h@1448
PS1, Line 1448: typedef unsigned int chan_counts_t 
[CHAN_COUNTS1_N][CHAN_COUNTS2_N][_GSM_LCHAN_MAX];
lol, the linter says "NEW_TYPEDEFS: do not add new typedefs"

but I'd really really like to fixate the array dimensions.
interwebs says one can put it in a struct like

  struct chan_counts {
  unsigned int x[2][3][4];
  }

but i don't know, seems weird to me when all i need is an array.

Also for functions accessing only the third or second dimension, i still need 
to put the array dimensions, and if not as a typedef, then all callers need to 
put the correct array dimensions everywhere.

seems we don't have a way to deal with multi-dimension arrays yet, in the way 
that i'd like to do it? any suggestions?



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25972
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2fb48c549186db812b1e9d6b735a92e80f27b8d3
Gerrit-Change-Number: 25972
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 21:03:06 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: refactor lchan counting

2021-10-27 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25972 )

Change subject: refactor lchan counting
..


Patch Set 1:

(6 comments)

feedback on my feedback to your feedback is welcome...

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/include/osmocom/bsc/gsm_data.h
File include/osmocom/bsc/gsm_data.h:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/include/osmocom/bsc/gsm_data.h@1439
PS1, Line 1439: CHAN_COUNTS2_N
> is this simply to flag the end? please document so, since it's a bit 
> confusing as this is an enum en […]
it's to know how large to define the array (N as in number of indexes)


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/include/osmocom/bsc/gsm_data.h@1442
PS1, Line 1442: extern const struct value_string chan_count2_strs[];
> Lots of new infra, sounds like all this can be moved to a new header file.
oh i thought i had kept those *str* functions in a separate patch, just needed 
it for debugging and haven't decided yet whether to commit at all. these 
shouldn't be here

but ack, maybe a separate .h/.c pair could be nice


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/abis_rsl.c
File src/osmo-bsc/abis_rsl.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/abis_rsl.c@1961
PS1, Line 1961: chan_counts_t bts_counts;
> we don't tend to use *_t types in osmocom (see kernel programming style 
> guide). […]
well, we usually use 'struct foo' or 'enum foo', but this typedef (used to 
pinpoint the array sizes) can't be used as 'typedef chan_counts', just 
'chan_counts'.

So what I often like to do, name the instance exactly like the type:

  struct foo foo;

is not possible with a typedef like this.
That's why I added the _t. Not harmful, is it?


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/abis_rsl.c@1974
PS1, Line 1974: free_tchf = 
bts_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_FREE][GSM_LCHAN_TCH_F];
> I'd rather prefer getters here, this way the array can be kept internal to 
> its own module and no nee […]
To me it all seems super obvious, could it be about improving readability?
Maybe abbreviating CHAN_COUNTS1_ to CC1_ could make it more readable?
(but CC also means Call Control ...)
CHANS1_ CHANS2_ ?

...you mean a getter like this?

  static inline unsigned int chan_counts_get(chan_counts vals,
enum chan_counts_dim1 dim1, enum chan_counts_dim2 dim2, enum gsm_chan_t 
dim3)
  {
   return vals[dim1][dim2][dim3];
  }

  free_tchf = chan_counts_get(bts_counts, CHAN_COUNTS1_ALL, CHAN_COUNTS2_FREE, 
GSM_LCHAN_TCH_F);

Does that help? From typedef chan_counts_t it's obvious which enum values to 
use in which array dimension??

"some comment here describing what you fetch here"
I fetch literally the count of "ALL FREE TCH_F" as the enum values indicate.
Besides ALL, there could be STATIC or DYNAMIC, as seen in the enum definition, 
but here i get ALL.
FREE is obvious, TCH_F is obvious ... what is there to explain?


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/bts_trx.c
File src/osmo-bsc/bts_trx.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/bts_trx.c@327
PS1, Line 327: void trx_count_lchans(chan_counts_t ret, const struct 
gsm_bts_trx *trx)
> All this could go into a new counts.c file, to have all this logic in one 
> place. […]
re "all logic in one file" -- who introduced the separation of bts and trx? I 
dimly remember that this used to be in the same place at some point? The only 
reason why this is here is because previous bts lchan counting and trx lchan 
counting code was in these separate places. I assumed that is so for a reason, 
so rather leave all trx logic in the same file...?

we usually put out-arguments first, right? 'ret' is a returned argument, maybe 
I should doc that


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/gsm_data.c
File src/osmo-bsc/gsm_data.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/gsm_data.c@650
PS1, Line 650:  * TODO: include possible VAMOS secondary lchans? */
> what about this TODO?
wait, this bit of patch may be an unrelated leftover from a previous patch 
version...



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25972
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2fb48c549186db812b1e9d6b735a92e80f27b8d3
Gerrit-Change-Number: 25972
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 20:57:08 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bsc_ctrl_commands: add ctrl command to resend system information

2021-10-27 Thread keith
keith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25829 )

Change subject: bsc_ctrl_commands: add ctrl command to resend system information
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/25829/3/src/osmo-bsc/bsc_ctrl_commands.c
File src/osmo-bsc/bsc_ctrl_commands.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25829/3/src/osmo-bsc/bsc_ctrl_commands.c@670
PS3, Line 670: static int set_bts_resend_si(struct ctrl_cmd *cmd, void *data)
Not that I object at all, but this is basically code duplication of lines 
276-290



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25829
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id628fc6f0771de67f60cbc96b631000b04c765f4
Gerrit-Change-Number: 25829
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 18:28:50 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-hnodeb[master]: Allocate g_hnb as a pointer, move code to hnb.c/h

2021-10-27 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/26001 )


Change subject: Allocate g_hnb as a pointer, move code to hnb.c/h
..

Allocate g_hnb as a pointer, move code to hnb.c/h

Change-Id: I5ec61d2a72d55d182e1498939209b30b6e652467
---
M include/osmocom/hnodeb/hnodeb.h
M src/osmo-hnodeb/Makefile.am
A src/osmo-hnodeb/hnb.c
M src/osmo-hnodeb/main.c
M src/osmo-hnodeb/vty.c
5 files changed, 178 insertions(+), 127 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/01/26001/1

diff --git a/include/osmocom/hnodeb/hnodeb.h b/include/osmocom/hnodeb/hnodeb.h
index b283145..261fc3a 100644
--- a/include/osmocom/hnodeb/hnodeb.h
+++ b/include/osmocom/hnodeb/hnodeb.h
@@ -97,6 +97,8 @@
struct hnb_chan *chan;
} cs;
 };
+struct hnb *hnb_alloc(void *tall_ctx);
+int hnb_connect(struct hnb *hnb);

 void hnb_rx_iu_release(struct hnb *hnb);
 void hnb_rx_paging(struct hnb *hnb, const char *imsi);
@@ -106,4 +108,4 @@
 struct msgb *gen_initue_lu(int is_ps, uint32_t conn_id, const char *imsi);

 extern void *tall_hnb_ctx;
-extern struct hnb g_hnb;
+extern struct hnb *g_hnb;
diff --git a/src/osmo-hnodeb/Makefile.am b/src/osmo-hnodeb/Makefile.am
index d782a4a..54c7083 100644
--- a/src/osmo-hnodeb/Makefile.am
+++ b/src/osmo-hnodeb/Makefile.am
@@ -32,6 +32,7 @@
main.c \
debug.c \
hnbap.c \
+   hnb.c \
ranap.c \
rua.c \
vty.c \
diff --git a/src/osmo-hnodeb/hnb.c b/src/osmo-hnodeb/hnb.c
new file mode 100644
index 000..335fd3a
--- /dev/null
+++ b/src/osmo-hnodeb/hnb.c
@@ -0,0 +1,161 @@
+/* (C) 2015 by Daniel Willmann 
+ * (C) 2021 by sysmocom - s.f.m.c. GmbH 
+ * Author: Pau Espin Pedrol 
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#include "config.h"
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+static int sctp_sock_init(int fd)
+{
+   struct sctp_event_subscribe event;
+   int rc;
+
+   /* subscribe for all events */
+   memset((uint8_t *)&event, 1, sizeof(event));
+   rc = setsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS,
+   &event, sizeof(event));
+
+   return rc;
+}
+
+static int hnb_read_cb(struct osmo_fd *fd)
+{
+   struct hnb *hnb = fd->data;
+   struct sctp_sndrcvinfo sinfo;
+   struct msgb *msg = msgb_alloc(IUH_MSGB_SIZE, "Iuh rx");
+   int flags = 0;
+   int rc;
+
+   if (!msg)
+   return -ENOMEM;
+
+   rc = sctp_recvmsg(fd->fd, msgb_data(msg), msgb_tailroom(msg),
+ NULL, NULL, &sinfo, &flags);
+   if (rc < 0) {
+   LOGP(DMAIN, LOGL_ERROR, "Error during sctp_recvmsg()\n");
+   /* FIXME: clean up after disappeared HNB */
+   close(fd->fd);
+   osmo_fd_unregister(fd);
+   return rc;
+   } else if (rc == 0) {
+   LOGP(DMAIN, LOGL_INFO, "Connection to HNB closed\n");
+   close(fd->fd);
+   osmo_fd_unregister(fd);
+   fd->fd = -1;
+
+   return -1;
+   } else {
+   msgb_put(msg, rc);
+   }
+
+   if (flags & MSG_NOTIFICATION) {
+   LOGP(DMAIN, LOGL_DEBUG, "Ignoring SCTP notification\n");
+   msgb_free(msg);
+   return 0;
+   }
+
+   sinfo.sinfo_ppid = ntohl(sinfo.sinfo_ppid);
+
+   switch (sinfo.sinfo_ppid) {
+   case IUH_PPI_HNBAP:
+   printf("HNBAP message received\n");
+   rc = hnb_hnbap_rx(hnb, msg);
+   break;
+   case IUH_PPI_RUA:
+   printf("RUA message received\n");
+   rc = hnb_rua_rx(hnb, msg);
+   break;
+   case IUH_PPI_SABP:
+   case IUH_PPI_RNA:
+   case IUH_PPI_PUA:
+   LOGP(DMAIN, LOGL_ERROR, "Unimplemented SCTP PPID=%u received\n",
+sinfo.sinfo_ppid);
+   rc = 0;
+   break;
+   default:
+   LOGP(DMAIN, LOGL_ERROR, "Unknown SCTP PPID=%u received\n",
+sinfo.sinfo_ppid);
+   rc = 0;
+   break;
+   }
+
+   msgb_free(msg);
+   return rc;
+

Change in osmo-hnodeb[master]: Move protocol related code in main.c to related proto files

2021-10-27 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/26002 )


Change subject: Move protocol related code in main.c to related proto files
..

Move protocol related code in main.c to related proto files

Change-Id: I771b3d3f61207137477eed2b316a5f670fb79ef2
---
M include/osmocom/hnodeb/Makefile.am
M include/osmocom/hnodeb/hnodeb.h
A include/osmocom/hnodeb/nas.h
M include/osmocom/hnodeb/ranap.h
M include/osmocom/hnodeb/rua.h
M src/osmo-hnodeb/Makefile.am
M src/osmo-hnodeb/main.c
A src/osmo-hnodeb/nas.c
M src/osmo-hnodeb/ranap.c
M src/osmo-hnodeb/rua.c
M src/osmo-hnodeb/vty.c
11 files changed, 389 insertions(+), 339 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/02/26002/1

diff --git a/include/osmocom/hnodeb/Makefile.am 
b/include/osmocom/hnodeb/Makefile.am
index f6c91b4..197568c 100644
--- a/include/osmocom/hnodeb/Makefile.am
+++ b/include/osmocom/hnodeb/Makefile.am
@@ -1,6 +1,7 @@
 noinst_HEADERS = \
hnbap.h \
hnodeb.h \
+   nas.h \
ranap.h \
rua.h \
vty.h \
diff --git a/include/osmocom/hnodeb/hnodeb.h b/include/osmocom/hnodeb/hnodeb.h
index 261fc3a..50432d1 100644
--- a/include/osmocom/hnodeb/hnodeb.h
+++ b/include/osmocom/hnodeb/hnodeb.h
@@ -100,12 +100,5 @@
 struct hnb *hnb_alloc(void *tall_ctx);
 int hnb_connect(struct hnb *hnb);

-void hnb_rx_iu_release(struct hnb *hnb);
-void hnb_rx_paging(struct hnb *hnb, const char *imsi);
-void hnb_nas_rx_dtap(struct hnb *hnb, void *data, int len);
-void hnb_rx_secmode_cmd(struct hnb *hnb, long ip_alg);
-
-struct msgb *gen_initue_lu(int is_ps, uint32_t conn_id, const char *imsi);
-
 extern void *tall_hnb_ctx;
 extern struct hnb *g_hnb;
diff --git a/include/osmocom/hnodeb/nas.h b/include/osmocom/hnodeb/nas.h
new file mode 100644
index 000..f6a7976
--- /dev/null
+++ b/include/osmocom/hnodeb/nas.h
@@ -0,0 +1,24 @@
+/* (C) 2015 by Daniel Willmann 
+ * (C) 2021 by sysmocom - s.f.m.c. GmbH 
+ * Author: Pau Espin Pedrol 
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#pragma once
+
+struct hnb;
+void hnb_nas_rx_dtap(struct hnb *hnb, void *data, int len);
diff --git a/include/osmocom/hnodeb/ranap.h b/include/osmocom/hnodeb/ranap.h
index f68006f..df756b1 100644
--- a/include/osmocom/hnodeb/ranap.h
+++ b/include/osmocom/hnodeb/ranap.h
@@ -19,8 +19,15 @@
  */
 #pragma once

+struct hnb;
 struct ranap_message_s;
 #include 

+void hnb_rx_iu_release(struct hnb *hnb);
+void hnb_rx_paging(struct hnb *hnb, const char *imsi);
+void hnb_rx_secmode_cmd(struct hnb *hnb, long ip_alg);
+
 void hnb_rua_dt_handle_ranap(struct hnb *hnb, struct ranap_message_s 
*ranap_msg);
 void hnb_rua_cl_handle_ranap(struct hnb *hnb, struct ranap_message_s 
*ranap_msg);
+void hnb_tx_iu_release_req(struct hnb *hnb);
+struct msgb *gen_initue_lu(int is_ps, uint32_t conn_id, const char *imsi);
diff --git a/include/osmocom/hnodeb/rua.h b/include/osmocom/hnodeb/rua.h
index 9d7cc12..52221be 100644
--- a/include/osmocom/hnodeb/rua.h
+++ b/include/osmocom/hnodeb/rua.h
@@ -22,5 +22,7 @@
 #include 

 struct hnb;
+struct msgb;

 int hnb_rua_rx(struct hnb *hnb, struct msgb *msg);
+int hnb_tx_dt(struct hnb *hnb, struct msgb *txm);
diff --git a/src/osmo-hnodeb/Makefile.am b/src/osmo-hnodeb/Makefile.am
index 54c7083..fd18233 100644
--- a/src/osmo-hnodeb/Makefile.am
+++ b/src/osmo-hnodeb/Makefile.am
@@ -33,6 +33,7 @@
debug.c \
hnbap.c \
hnb.c \
+   nas.c \
ranap.c \
rua.c \
vty.c \
diff --git a/src/osmo-hnodeb/main.c b/src/osmo-hnodeb/main.c
index dc662aa..9c7a548 100644
--- a/src/osmo-hnodeb/main.c
+++ b/src/osmo-hnodeb/main.c
@@ -33,28 +33,12 @@
 #include 
 #include 
 #include 
-#include 
-#include 

 #include 
 #include 
 #include 

-#include 
-
-#include 
-#include 
-
-#include 
-
-#include 
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
+#include  /* ranap_set_log_area() */

 #include 
 #include 
@@ -65,326 +49,11 @@
 void *tall_hnb_ctx;
 struct hnb *g_hnb;

-struct msgb *rua_new_udt(struct msgb *inmsg);
-
-static struct msgb *gen_nas_id_resp()
-{
-   uint8_t id_resp[] = {
-   GSM48_PDISC_MM,
-   GSM48_MT_MM_ID_RESP,
-   /* IMEISV */
-   0x09, /* len */
-

Change in osmo-hnodeb[master]: main.c: Drop commented out code

2021-10-27 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/25998 )


Change subject: main.c: Drop commented out code
..

main.c: Drop commented out code

We can always get it back from git history if necessary, let's drop it.

Change-Id: I6ea1e3b8692cc6e162962d2e812eb1342c100251
---
M src/osmo-hnodeb/main.c
1 file changed, 0 insertions(+), 67 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/98/25998/1

diff --git a/src/osmo-hnodeb/main.c b/src/osmo-hnodeb/main.c
index ae9403d..a9c26bf 100644
--- a/src/osmo-hnodeb/main.c
+++ b/src/osmo-hnodeb/main.c
@@ -81,38 +81,6 @@

 struct msgb *rua_new_udt(struct msgb *inmsg);

-#if 0
-static int hnb_ue_de_register_tx(struct hnb *hnb)
-{
-   struct msgb *msg;
-   int rc;
-   uint32_t ctx_id;
-
-   UEDe_Register_t dereg;
-   UEDe_RegisterIEs_t dereg_ies;
-   memset(&dereg_ies, 0, sizeof(dereg_ies));
-
-   asn1_u24_to_bitstring(&dereg_ies.context_ID, &ctx_id, hnb->ctx_id);
-   dereg_ies.cause.present = Cause_PR_radioNetwork;
-   dereg_ies.cause.choice.radioNetwork = 
CauseRadioNetwork_connection_with_UE_lost;
-
-   memset(&dereg, 0, sizeof(dereg));
-   rc = hnbap_encode_uede_registeries(&dereg, &dereg_ies);
-   OSMO_ASSERT(rc == 0);
-
-   msg = hnbap_generate_initiating_message(ProcedureCode_id_UEDe_Register,
-   Criticality_ignore,
-   &asn_DEF_UEDe_Register,
-   &dereg);
-
-   ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_UEDe_Register, &dereg);
-
-   msgb_sctp_ppid(msg) = IUH_PPI_HNBAP;
-
-   return osmo_wqueue_enqueue(&hnb->wqueue, msg);
-}
-#endif
-
 int hnb_ue_register_tx(struct hnb *hnb, const char *imsi_str)
 {
struct msgb *msg;
@@ -848,41 +816,6 @@
}
sctp_sock_init(g_hnb.wqueue.bfd.fd);

-#if 0
-   /* some hard-coded message generation.  Doesn't make sense from
-* a protocol point of view but enables to look at the encoded
-* results in wireshark for manual verification */
-   {
-   struct msgb *msg, *rua;
-   const uint8_t nas[] = { 0, 1, 2, 3 };
-   const uint8_t ik[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 
12, 13, 14, 15 };
-
-   msg = ranap_new_msg_dt(0, nas, sizeof(nas));
-   rua = rua_new_udt(msg);
-   osmo_wqueue_enqueue(&g_hnb.wqueue, rua);
-
-   msg = ranap_new_msg_sec_mod_cmd(ik, ik, RANAP_KeyStatus_new);
-   rua = rua_new_udt(msg);
-   osmo_wqueue_enqueue(&g_hnb.wqueue, rua);
-
-   msg = ranap_new_msg_iu_rel_cmd()
-   rua = rua_new_udt(msg);
-   osmo_wqueue_enqueue(&g_hnb.wqueue, rua);
-
-   msg = ranap_new_msg_paging_cmd("901990123456789", NULL, 0, 0);
-   rua = rua_new_udt(msg);
-   osmo_wqueue_enqueue(&g_hnb.wqueue, rua);
-
-   msg = ranap_new_msg_rab_assign_voice(1, 0x01020304, 0x1020);
-   rua = rua_new_udt(msg);
-   osmo_wqueue_enqueue(&g_hnb.wqueue, rua);
-
-   msg = ranap_new_msg_rab_assign_data(2, 0x01020304, 0x11223344);
-   rua = rua_new_udt(msg);
-   osmo_wqueue_enqueue(&g_hnb.wqueue, rua);
-   }
-#endif
-
while (1) {
rc = osmo_select_main(0);
if (rc < 0)

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/25998
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I6ea1e3b8692cc6e162962d2e812eb1342c100251
Gerrit-Change-Number: 25998
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmo-hnodeb[master]: Move hnbap related code to hnbap.c/h

2021-10-27 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/26000 )


Change subject: Move hnbap related code to hnbap.c/h
..

Move hnbap related code to hnbap.c/h

Change-Id: I8356421169bebe1d411b05b19241ea639dc3f733
---
M include/osmocom/hnodeb/Makefile.am
A include/osmocom/hnodeb/hnbap.h
M include/osmocom/hnodeb/hnodeb.h
M src/osmo-hnodeb/Makefile.am
A src/osmo-hnodeb/hnbap.c
M src/osmo-hnodeb/main.c
M src/osmo-hnodeb/vty.c
7 files changed, 261 insertions(+), 197 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/00/26000/1

diff --git a/include/osmocom/hnodeb/Makefile.am 
b/include/osmocom/hnodeb/Makefile.am
index 339f8a3..f6c91b4 100644
--- a/include/osmocom/hnodeb/Makefile.am
+++ b/include/osmocom/hnodeb/Makefile.am
@@ -1,4 +1,5 @@
 noinst_HEADERS = \
+   hnbap.h \
hnodeb.h \
ranap.h \
rua.h \
diff --git a/include/osmocom/hnodeb/hnbap.h b/include/osmocom/hnodeb/hnbap.h
new file mode 100644
index 000..22f6d25
--- /dev/null
+++ b/include/osmocom/hnodeb/hnbap.h
@@ -0,0 +1,31 @@
+/* (C) 2015 by Daniel Willmann 
+ * (C) 2021 by sysmocom - s.f.m.c. GmbH 
+ * Author: Pau Espin Pedrol 
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+#pragma once
+
+#include 
+
+struct hnb;
+struct msg;
+
+int hnb_hnbap_rx(struct hnb *hnb, struct msgb *msg);
+
+int hnb_ue_register_tx(struct hnb *hnb, const char *imsi_str);
+void hnb_send_register_req(struct hnb *hnb);
+void hnb_send_deregister_req(struct hnb *hnb);
diff --git a/include/osmocom/hnodeb/hnodeb.h b/include/osmocom/hnodeb/hnodeb.h
index e36311e..b283145 100644
--- a/include/osmocom/hnodeb/hnodeb.h
+++ b/include/osmocom/hnodeb/hnodeb.h
@@ -103,9 +103,6 @@
 void hnb_nas_rx_dtap(struct hnb *hnb, void *data, int len);
 void hnb_rx_secmode_cmd(struct hnb *hnb, long ip_alg);

-int hnb_ue_register_tx(struct hnb *hnb, const char *imsi_str);
-void hnb_send_register_req(struct hnb *hnb);
-void hnb_send_deregister_req(struct hnb *hnb);
 struct msgb *gen_initue_lu(int is_ps, uint32_t conn_id, const char *imsi);

 extern void *tall_hnb_ctx;
diff --git a/src/osmo-hnodeb/Makefile.am b/src/osmo-hnodeb/Makefile.am
index 7526c28..d782a4a 100644
--- a/src/osmo-hnodeb/Makefile.am
+++ b/src/osmo-hnodeb/Makefile.am
@@ -31,6 +31,7 @@
 osmo_hnodeb_SOURCES = \
main.c \
debug.c \
+   hnbap.c \
ranap.c \
rua.c \
vty.c \
diff --git a/src/osmo-hnodeb/hnbap.c b/src/osmo-hnodeb/hnbap.c
new file mode 100644
index 000..7e54004
--- /dev/null
+++ b/src/osmo-hnodeb/hnbap.c
@@ -0,0 +1,226 @@
+/* (C) 2015 by Daniel Willmann 
+ * (C) 2021 by sysmocom - s.f.m.c. GmbH 
+ * Author: Pau Espin Pedrol 
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include  /* ranap_bcd_decode() */
+
+#include 
+#include 
+
+static int hnb_rx_hnb_register_acc(struct hnb *hnb, ANY_t *in)
+{
+   int rc;
+   HNBAP_HNBRegisterAcceptIEs_t accept;
+
+   rc = hnbap_decode_hnbregisteraccepties(&accept, in);
+   if (rc < 0) {
+   }
+
+   hnb->rnc_id = accept.rnc_id;
+   printf("HNB Register accept with RNC ID %u\n", hnb->rnc_id);
+
+   hnbap_free_hnbregisteraccepties(&accept);
+   return 0;
+}
+
+static int hnb_rx_ue_register_acc(struct hnb *hnb, ANY_t *in)
+{
+   int rc;
+   uint32_t ctx_id;
+   HNBAP_UERegisterAcceptIEs_t accept;
+   char imsi[16];
+
+   rc = hnbap_decode_ueregisteraccepties(&accept, in);
+   if (rc < 0) {
+   return rc;
+   }
+
+   if (accept.

Change in osmo-hnodeb[master]: Move rua related code to rua.c/h

2021-10-27 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/25999 )


Change subject: Move rua related code to rua.c/h
..

Move rua related code to rua.c/h

Change-Id: Ibefe952fe1b642cab5c4abe36383a7ebb05f39c3
---
M include/osmocom/hnodeb/rua.h
M src/osmo-hnodeb/main.c
M src/osmo-hnodeb/rua.c
3 files changed, 66 insertions(+), 64 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/99/25999/1

diff --git a/include/osmocom/hnodeb/rua.h b/include/osmocom/hnodeb/rua.h
index 28d0a1a..9d7cc12 100644
--- a/include/osmocom/hnodeb/rua.h
+++ b/include/osmocom/hnodeb/rua.h
@@ -23,5 +23,4 @@

 struct hnb;

-void hnb_rua_dt_handle(struct hnb *hnb, struct ANY *in);
-void hnb_rua_cl_handle(struct hnb *hnb, struct ANY *in);
+int hnb_rua_rx(struct hnb *hnb, struct msgb *msg);
diff --git a/src/osmo-hnodeb/main.c b/src/osmo-hnodeb/main.c
index a9c26bf..0fcb909 100644
--- a/src/osmo-hnodeb/main.c
+++ b/src/osmo-hnodeb/main.c
@@ -476,66 +476,6 @@

 extern void direct_transfer_nas_pdu_print(ANY_t *in);

-int hnb_rua_rx(struct hnb *hnb, struct msgb *msg)
-{
-   RUA_RUA_PDU_t _pdu, *pdu = &_pdu;
-   asn_dec_rval_t dec_ret;
-
-   memset(pdu, 0, sizeof(*pdu));
-   dec_ret = aper_decode(NULL, &asn_DEF_RUA_RUA_PDU, (void **) &pdu,
- msg->data, msgb_length(msg), 0, 0);
-   if (dec_ret.code != RC_OK) {
-   LOGP(DMAIN, LOGL_ERROR, "Error in ASN.1 decode\n");
-   return -EINVAL;
-   }
-
-   switch (pdu->present) {
-   case RUA_RUA_PDU_PR_successfulOutcome:
-   printf("RUA_RUA_PDU_PR_successfulOutcome\n");
-   break;
-   case RUA_RUA_PDU_PR_initiatingMessage:
-   printf("RUA_RUA_PDU_PR_initiatingMessage\n");
-   break;
-   case RUA_RUA_PDU_PR_NOTHING:
-   printf("RUA_RUA_PDU_PR_NOTHING\n");
-   break;
-   case RUA_RUA_PDU_PR_unsuccessfulOutcome:
-   printf("RUA_RUA_PDU_PR_unsuccessfulOutcome\n");
-   break;
-   default:
-   printf("Unexpected RUA message received\n");
-   break;
-   }
-
-   switch (pdu->choice.successfulOutcome.procedureCode) {
-   case RUA_ProcedureCode_id_ConnectionlessTransfer:
-   printf("RUA rx Connectionless Transfer\n");
-   hnb_rua_cl_handle(hnb, &pdu->choice.successfulOutcome.value);
-   break;
-   case RUA_ProcedureCode_id_Connect:
-   printf("RUA rx Connect\n");
-   break;
-   case RUA_ProcedureCode_id_DirectTransfer:
-   printf("RUA rx DirectTransfer\n");
-   hnb_rua_dt_handle(hnb, &pdu->choice.successfulOutcome.value);
-   break;
-   case RUA_ProcedureCode_id_Disconnect:
-   printf("RUA rx Disconnect\n");
-   break;
-   case RUA_ProcedureCode_id_ErrorIndication:
-   printf("RUA rx ErrorIndication\n");
-   break;
-   case RUA_ProcedureCode_id_privateMessage:
-   printf("RUA rx privateMessage\n");
-   break;
-   default:
-   printf("RUA rx unknown message\n");
-   break;
-   }
-
-   return 0;
-}
-
 static int hnb_read_cb(struct osmo_fd *fd)
 {
struct hnb *hnb = fd->data;
diff --git a/src/osmo-hnodeb/rua.c b/src/osmo-hnodeb/rua.c
index 3db9de7..0839c0d 100644
--- a/src/osmo-hnodeb/rua.c
+++ b/src/osmo-hnodeb/rua.c
@@ -17,6 +17,9 @@
  * along with this program.  If not, see .
  *
  */
+
+#include 
+
 #include 

 #include 
@@ -26,7 +29,7 @@
 #include 


-void hnb_rua_dt_handle(struct hnb *hnb, ANY_t *in)
+static void hnb_rua_dt_handle(struct hnb *hnb, ANY_t *in)
 {
RUA_DirectTransferIEs_t ies;
int rc;
@@ -43,7 +46,7 @@
rua_free_directtransferies(&ies);
 }

-void hnb_rua_cl_handle(struct hnb *hnb, ANY_t *in)
+static void hnb_rua_cl_handle(struct hnb *hnb, ANY_t *in)
 {
RUA_ConnectionlessTransferIEs_t ies;
int rc;
@@ -59,3 +62,63 @@
/* FIXME: what to do with the asn1c-allocated memory */
rua_free_connectionlesstransferies(&ies);
 }
+
+int hnb_rua_rx(struct hnb *hnb, struct msgb *msg)
+{
+   RUA_RUA_PDU_t _pdu, *pdu = &_pdu;
+   asn_dec_rval_t dec_ret;
+
+   memset(pdu, 0, sizeof(*pdu));
+   dec_ret = aper_decode(NULL, &asn_DEF_RUA_RUA_PDU, (void **) &pdu,
+ msg->data, msgb_length(msg), 0, 0);
+   if (dec_ret.code != RC_OK) {
+   LOGP(DMAIN, LOGL_ERROR, "Error in ASN.1 decode\n");
+   return -EINVAL;
+   }
+
+   switch (pdu->present) {
+   case RUA_RUA_PDU_PR_successfulOutcome:
+   printf("RUA_RUA_PDU_PR_successfulOutcome\n");
+   break;
+   case RUA_RUA_PDU_PR_initiatingMessage:
+   printf("RUA_RUA_PDU_PR_initiatingMessage\n");
+

Change in osmo-hnodeb[master]: Move existing vty code to its own cty.c/h file

2021-10-27 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/25997 )


Change subject: Move existing vty code to its own cty.c/h file
..

Move existing vty code to its own cty.c/h file

Change-Id: I88107e9ed03ff8f807b57a3ea0d189fd70864861
---
M include/osmocom/hnodeb/Makefile.am
M include/osmocom/hnodeb/hnodeb.h
A include/osmocom/hnodeb/vty.h
M src/osmo-hnodeb/Makefile.am
M src/osmo-hnodeb/main.c
A src/osmo-hnodeb/vty.c
6 files changed, 195 insertions(+), 123 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/97/25997/1

diff --git a/include/osmocom/hnodeb/Makefile.am 
b/include/osmocom/hnodeb/Makefile.am
index 9f8963a..339f8a3 100644
--- a/include/osmocom/hnodeb/Makefile.am
+++ b/include/osmocom/hnodeb/Makefile.am
@@ -2,4 +2,5 @@
hnodeb.h \
ranap.h \
rua.h \
+   vty.h \
$(NULL)
diff --git a/include/osmocom/hnodeb/hnodeb.h b/include/osmocom/hnodeb/hnodeb.h
index ef11ab7..e36311e 100644
--- a/include/osmocom/hnodeb/hnodeb.h
+++ b/include/osmocom/hnodeb/hnodeb.h
@@ -19,6 +19,8 @@
  */
 #pragma once

+#include 
+
 #include 
 #include 
 #include 
@@ -101,4 +103,10 @@
 void hnb_nas_rx_dtap(struct hnb *hnb, void *data, int len);
 void hnb_rx_secmode_cmd(struct hnb *hnb, long ip_alg);

+int hnb_ue_register_tx(struct hnb *hnb, const char *imsi_str);
+void hnb_send_register_req(struct hnb *hnb);
+void hnb_send_deregister_req(struct hnb *hnb);
+struct msgb *gen_initue_lu(int is_ps, uint32_t conn_id, const char *imsi);
+
+extern void *tall_hnb_ctx;
 extern struct hnb g_hnb;
diff --git a/include/osmocom/hnodeb/vty.h b/include/osmocom/hnodeb/vty.h
new file mode 100644
index 000..7e3f29f
--- /dev/null
+++ b/include/osmocom/hnodeb/vty.h
@@ -0,0 +1,31 @@
+/* (C) 2015 by Daniel Willmann 
+ * (C) 2021 by sysmocom - s.f.m.c. GmbH 
+ * Author: Pau Espin Pedrol 
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ *
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+
+enum hnb_vty_nodes {
+   CHAN_NODE = _LAST_OSMOVTY_NODE,
+};
+
+void hnb_vty_init(void);
diff --git a/src/osmo-hnodeb/Makefile.am b/src/osmo-hnodeb/Makefile.am
index 5ca020f..7526c28 100644
--- a/src/osmo-hnodeb/Makefile.am
+++ b/src/osmo-hnodeb/Makefile.am
@@ -33,6 +33,7 @@
debug.c \
ranap.c \
rua.c \
+   vty.c \
$(NULL)

 osmo_hnodeb_LDADD = \
diff --git a/src/osmo-hnodeb/main.c b/src/osmo-hnodeb/main.c
index 9a2aaf9..ae9403d 100644
--- a/src/osmo-hnodeb/main.c
+++ b/src/osmo-hnodeb/main.c
@@ -54,7 +54,6 @@
 #include 
 #include 
 #include 
-#include "asn1helpers.h"
 #include 

 #include 
@@ -70,9 +69,10 @@

 #include 
 #include 
+#include 
 #include 

-static void *tall_hnb_ctx;
+void *tall_hnb_ctx;

 struct hnb g_hnb = {
.gw_addr = "127.0.0.1",
@@ -113,7 +113,7 @@
 }
 #endif

-static int hnb_ue_register_tx(struct hnb *hnb, const char *imsi_str)
+int hnb_ue_register_tx(struct hnb *hnb, const char *imsi_str)
 {
struct msgb *msg;
int rc, imsi_len;
@@ -649,7 +649,7 @@
return rc;
 }

-static void hnb_send_register_req(struct hnb *hnb)
+void hnb_send_register_req(struct hnb *hnb)
 {
HNBAP_HNBRegisterRequest_t request_out;
struct msgb *msg;
@@ -698,7 +698,7 @@
osmo_wqueue_enqueue(&hnb->wqueue, msg);
 }

-static void hnb_send_deregister_req(struct hnb *hnb)
+void hnb_send_deregister_req(struct hnb *hnb)
 {
struct msgb *msg;
int rc;
@@ -744,79 +744,8 @@
return rc;
 }

-#define HNBAP_STR  "HNBAP related commands\n"
-#define HNB_STR"HomeNodeB commands\n"
-#define UE_STR "User Equipment commands\n"
-#define RANAP_STR  "RANAP related commands\n"
-#define CSPS_STR   "Circuit Switched\n" "Packet Switched\n"

-DEFUN(hnb_register, hnb_register_cmd,
-   "hnbap hnb register", HNBAP_STR HNB_STR "Send HNB-REGISTER REQUEST")
-{
-   hnb_send_register_req(&g_hnb);
-
-   return CMD_SUCCESS;
-}
-
-DEFUN(hnb_deregister, hnb_deregister_cmd,
-   "hnbap hnb deregister", HNBAP_STR HNB_STR "Send HNB-DEREGISTER REQUEST")
-{
-   hnb_send_deregister_req(&g_hnb);
-
-   return CMD_SUCCESS;
-}
-
-DEFUN(ue_register, ue_register_cmd,
-   "hnbap ue register IMSI", HNBAP_STR UE_STR "Send UE-REGISTER REQUEST

Change in osmo-hnodeb[master]: Import hnb-test from osmo-iuh.git

2021-10-27 Thread pespin
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-hnodeb/+/25995

to look at the new patch set (#3).

Change subject: Import hnb-test from osmo-iuh.git
..

Import hnb-test from osmo-iuh.git

Import from osmo-iuh.git Change-Id Iba106dcc18e3d429b4b9808610a44ac29b798172,
with minimal renaming of s/hnb_test/hnb/ and required mangling to have
it compile and run.

Change-Id: I36fd4aa5d39222371bd36e9f540b91e36a26de43
---
M configure.ac
M include/osmocom/hnodeb/Makefile.am
M include/osmocom/hnodeb/hnodeb.h
A include/osmocom/hnodeb/ranap.h
A include/osmocom/hnodeb/rua.h
M src/osmo-hnodeb/Makefile.am
A src/osmo-hnodeb/debug.c
M src/osmo-hnodeb/main.c
A src/osmo-hnodeb/ranap.c
A src/osmo-hnodeb/rua.c
10 files changed, 1,380 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/95/25995/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/25995
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I36fd4aa5d39222371bd36e9f540b91e36a26de43
Gerrit-Change-Number: 25995
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-hnodeb[master]: Import hnb-test from osmo-iuh.git

2021-10-27 Thread pespin
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-hnodeb/+/25995

to look at the new patch set (#2).

Change subject: Import hnb-test from osmo-iuh.git
..

Import hnb-test from osmo-iuh.git

Import from osmo-iuh.git Change-Id Iba106dcc18e3d429b4b9808610a44ac29b798172,
with minimal renaming of s/hnb_test/hnb/ and required mangling to have
it compile and run.

Change-Id: I36fd4aa5d39222371bd36e9f540b91e36a26de43
---
M configure.ac
M include/osmocom/hnodeb/Makefile.am
M include/osmocom/hnodeb/hnodeb.h
A include/osmocom/hnodeb/ranap.h
A include/osmocom/hnodeb/rua.h
M src/osmo-hnodeb/Makefile.am
A src/osmo-hnodeb/debug.c
M src/osmo-hnodeb/main.c
A src/osmo-hnodeb/ranap.c
A src/osmo-hnodeb/rua.c
10 files changed, 1,266 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/95/25995/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/25995
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I36fd4aa5d39222371bd36e9f540b91e36a26de43
Gerrit-Change-Number: 25995
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: bsc_ctrl_commands: change neighbor-list mode/arfcn via control interface

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25996 )

Change subject: bsc_ctrl_commands: change neighbor-list mode/arfcn via control 
interface
..


Patch Set 1:

(2 comments)

https://gerrit.osmocom.org/c/osmo-bsc/+/25996/1//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/c/osmo-bsc/+/25996/1//COMMIT_MSG@12
PS1, Line 12: under the bts node. Lets add pendant of this command on the 
control
pendant?


https://gerrit.osmocom.org/c/osmo-bsc/+/25996/1/src/osmo-bsc/bsc_ctrl_commands.c
File src/osmo-bsc/bsc_ctrl_commands.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25996/1/src/osmo-bsc/bsc_ctrl_commands.c@741
PS1, Line 741: CTRL_CMD_DEFINE_WO(bts_neighbor_list_add, "neighbor-list add");
Same, please add some comment lines documenting the command.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25996
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id97bc0d31a358db6221c385761773fb48670c921
Gerrit-Change-Number: 25996
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-CC: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 15:50:54 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: heighbor_ident: add/del neighbor cells via ctrl interface

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25976 )

Change subject: heighbor_ident: add/del neighbor cells via ctrl interface
..


Patch Set 4:

Some comments from prev version still apply.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25976
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I343a40e18fa9b91e6c381912c0426a002841e079
Gerrit-Change-Number: 25976
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 15:48:57 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bsc_ctrl_commands: change neighbor-list mode/arfcn via control interface

2021-10-27 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25996 )


Change subject: bsc_ctrl_commands: change neighbor-list mode/arfcn via control 
interface
..

bsc_ctrl_commands: change neighbor-list mode/arfcn via control interface

It is possible to change the neighbor-list mode via the VTY from
automatic mode to manual neighbor-list configuration. In the manual
mode, the user can add ARFCN values manually. This command can be found
under the bts node. Lets add pendant of this command on the control
interface as well.

Related: SYS#5641
Change-Id: Id97bc0d31a358db6221c385761773fb48670c921
---
M doc/manuals/chapters/control.adoc
M src/osmo-bsc/bsc_ctrl_commands.c
M tests/ctrl_test_runner.py
3 files changed, 160 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/96/25996/1

diff --git a/doc/manuals/chapters/control.adoc 
b/doc/manuals/chapters/control.adoc
index cf3110b..8e54561 100644
--- a/doc/manuals/chapters/control.adoc
+++ b/doc/manuals/chapters/control.adoc
@@ -69,6 +69,9 @@
 |[bts.N.]handover2.retries|RW|No|<0-9>,"default"|Number of times to 
immediately retry a failed handover/assignment, before a penalty time is 
applied.
 |handover2.congestion-check|RW|No|"disabled",<1-999>,"now"|Congestion check 
interval in seconds, "now" triggers immediate congestion check.
 |bts.N.resend-si|WO|No|Ignored|Resend system information to BTS.
+|bts.N.neighbor-list.mode|WO|No|"automatic","manual","manual-si5"|Mode of 
Neighbor List generation.
+|bts.N.neighbor-list.add|WO|No|<0-1023>|Add to manual neighbor list.
+|bts.N.neighbor-list.del|WO|No|<0-1023>|Delete from manual neighbor list.
 |===

 [[notif]]
diff --git a/src/osmo-bsc/bsc_ctrl_commands.c b/src/osmo-bsc/bsc_ctrl_commands.c
index f2ba5af..456fcd9 100644
--- a/src/osmo-bsc/bsc_ctrl_commands.c
+++ b/src/osmo-bsc/bsc_ctrl_commands.c
@@ -683,6 +683,120 @@

 CTRL_CMD_DEFINE_WO_NOVRF(bts_resend_si, "resend-si");

+static int verify_bts_neighbor_list_add_del(struct ctrl_cmd *cmd, const char 
*value, void *_data)
+{
+   int arfcn;
+
+   if (osmo_str_to_int(&arfcn, value, 10, 0, 1023) < 0) {
+   cmd->reply = "Invalid ARFCN value";
+   return 1;
+   }
+
+   return 0;
+}
+
+static int set_bts_neighbor_list_add_del(struct ctrl_cmd *cmd, void *data, 
bool add)
+{
+   struct gsm_bts *bts = cmd->node;
+   struct bitvec *bv = &bts->si_common.neigh_list;
+   int arfcn_int;
+   uint16_t arfcn;
+   enum gsm_band unused;
+
+   if (osmo_str_to_int(&arfcn_int, cmd->value, 10, 0, 1023) < 0) {
+   cmd->reply = "Failed to parse ARFCN value";
+   return CTRL_CMD_ERROR;
+   }
+   arfcn = (uint16_t) arfcn_int;
+
+   if (bts->neigh_list_manual_mode == NL_MODE_AUTOMATIC) {
+   cmd->reply = "Neighbor list not in manual mode";
+   return CTRL_CMD_ERROR;
+   }
+
+   if (gsm_arfcn2band_rc(arfcn, &unused) < 0) {
+   cmd->reply = "Invalid arfcn detected";
+   return CTRL_CMD_ERROR;
+   }
+
+   if (add)
+   bitvec_set_bit_pos(bv, arfcn, 1);
+   else
+   bitvec_set_bit_pos(bv, arfcn, 0);
+
+   cmd->reply = "OK";
+   return CTRL_CMD_REPLY;
+}
+
+static int verify_bts_neighbor_list_add(struct ctrl_cmd *cmd, const char 
*value, void *_data)
+{
+   return verify_bts_neighbor_list_add_del(cmd, value, _data);
+}
+
+static int set_bts_neighbor_list_add(struct ctrl_cmd *cmd, void *data)
+{
+   return set_bts_neighbor_list_add_del(cmd, data, true);
+}
+
+CTRL_CMD_DEFINE_WO(bts_neighbor_list_add, "neighbor-list add");
+
+static int verify_bts_neighbor_list_del(struct ctrl_cmd *cmd, const char 
*value, void *_data)
+{
+   return verify_bts_neighbor_list_add_del(cmd, value, _data);
+}
+
+static int set_bts_neighbor_list_del(struct ctrl_cmd *cmd, void *data)
+{
+   return set_bts_neighbor_list_add_del(cmd, data, false);
+}
+
+CTRL_CMD_DEFINE_WO(bts_neighbor_list_del, "neighbor-list del");
+
+static int verify_bts_neighbor_list_mode(struct ctrl_cmd *cmd, const char 
*value, void *_data)
+{
+   if (!strcmp(value, "automatic"))
+   return 0;
+   if (!strcmp(value, "manual"))
+   return 0;
+   if (!strcmp(value, "manual-si5"))
+   return 0;
+
+   cmd->reply = "Invalid mode";
+   return 1;
+}
+
+static int set_bts_neighbor_list_mode(struct ctrl_cmd *cmd, void *data)
+{
+   struct gsm_bts *bts = cmd->node;
+   int mode;
+
+   if (!strcmp(cmd->value, "automatic"))
+   mode = NL_MODE_AUTOMATIC;
+   else if (!strcmp(cmd->value, "manual"))
+   mode = NL_MODE_MANUAL;
+   else if (!strcmp(cmd->value, "manual-si5"))
+   mode = NL_MODE_MANUAL_SI5SEP;
+
+   switch (mode) {
+   case NL_MODE_MANUAL_SI5SEP:
+   case NL_MODE_MANUAL:
+  

Change in osmo-bsc[master]: heighbor_ident: add/del neighbor cells via ctrl interface

2021-10-27 Thread dexter
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-bsc/+/25976

to look at the new patch set (#4).

Change subject: heighbor_ident: add/del neighbor cells via ctrl interface
..

heighbor_ident: add/del neighbor cells via ctrl interface

The VTY allows flexible control over the neighbor cell information via
the neighbor command, which can be found in the configure terminal under
the bts node. Lets add pendant of this command on the control interface
as well.

Change-Id: I343a40e18fa9b91e6c381912c0426a002841e079
Related: SYS#5641
---
M doc/manuals/chapters/control.adoc
M include/osmocom/bsc/neighbor_ident.h
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/bsc_ctrl_commands.c
A src/osmo-bsc/neighbor_ident_ctrl.c
M src/osmo-bsc/neighbor_ident_vty.c
M tests/ctrl_test_runner.py
7 files changed, 916 insertions(+), 30 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/76/25976/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25976
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I343a40e18fa9b91e6c381912c0426a002841e079
Gerrit-Change-Number: 25976
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-MessageType: newpatchset


Change in osmo-iuh[master]: ranap: Use asn1c flag -fcompound-names to avoid name collisions with ...

2021-10-27 Thread pespin
pespin has removed a vote from this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25994 )


Change subject: ranap: Use asn1c flag -fcompound-names to avoid name collisions 
with other libs
..


Removed Verified-1 by Jenkins Builder (102)
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25994
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Iba106dcc18e3d429b4b9808610a44ac29b798172
Gerrit-Change-Number: 25994
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: deleteVote


Change in osmo-iuh[master]: ranap: Use asn1c flag -fcompound-names to avoid name collisions with ...

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25994 )

Change subject: ranap: Use asn1c flag -fcompound-names to avoid name collisions 
with other libs
..


Patch Set 1: Verified+1

linter doesn't apply here.


--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25994
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Iba106dcc18e3d429b4b9808610a44ac29b798172
Gerrit-Change-Number: 25994
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 15:35:02 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-iuh[master]: sabp: Use asn1c flag -fcompound-names to avoid name collisions with o...

2021-10-27 Thread pespin
pespin has removed a vote from this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25993 )


Change subject: sabp: Use asn1c flag -fcompound-names to avoid name collisions 
with other libs
..


Removed Verified-1 by Jenkins Builder (102)
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25993
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I10ce4a9414768cdcf850feeca4088296e339919f
Gerrit-Change-Number: 25993
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: deleteVote


Change in osmo-iuh[master]: sabp: Use asn1c flag -fcompound-names to avoid name collisions with o...

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25993 )

Change subject: sabp: Use asn1c flag -fcompound-names to avoid name collisions 
with other libs
..


Patch Set 1: Verified+1

linter doesn't apply here.


--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25993
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I10ce4a9414768cdcf850feeca4088296e339919f
Gerrit-Change-Number: 25993
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 15:34:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-iuh[master]: rua: Use asn1c flag -fcompound-names to avoid name collisions with ot...

2021-10-27 Thread pespin
pespin has removed a vote from this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25992 )


Change subject: rua: Use asn1c flag -fcompound-names to avoid name collisions 
with other libs
..


Removed Verified-1 by Jenkins Builder (102)
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25992
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Id4e337cdc82c26922b7ca7f0fe8af523e9a0945c
Gerrit-Change-Number: 25992
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: deleteVote


Change in osmo-iuh[master]: rua: Use asn1c flag -fcompound-names to avoid name collisions with ot...

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25992 )

Change subject: rua: Use asn1c flag -fcompound-names to avoid name collisions 
with other libs
..


Patch Set 1: Verified+1

linter doesn't apply here.


--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25992
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Id4e337cdc82c26922b7ca7f0fe8af523e9a0945c
Gerrit-Change-Number: 25992
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 15:34:47 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-iuh[master]: hnbap: Use asn1c flag -fcompound-names to avoid name collisions with ...

2021-10-27 Thread pespin
pespin has removed a vote from this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25991 )


Change subject: hnbap: Use asn1c flag -fcompound-names to avoid name collisions 
with other libs
..


Removed Verified-1 by Jenkins Builder (102)
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25991
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I1bcbe047d233684647d6ffe9febb14a12c579696
Gerrit-Change-Number: 25991
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: deleteVote


Change in osmo-iuh[master]: hnbap: Use asn1c flag -fcompound-names to avoid name collisions with ...

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25991 )

Change subject: hnbap: Use asn1c flag -fcompound-names to avoid name collisions 
with other libs
..


Patch Set 1: Verified+1

linter doesn't apply here.


--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25991
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I1bcbe047d233684647d6ffe9febb14a12c579696
Gerrit-Change-Number: 25991
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 15:34:30 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-iuh[master]: hnbap: Drop no longer existing asn1c param -fnative-types

2021-10-27 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25986 )

Change subject: hnbap: Drop no longer existing asn1c param -fnative-types
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25986
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Iccf81539a5045416185e619d24c3d542204437e6
Gerrit-Change-Number: 25986
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 15:24:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-iuh[master]: ranap: Use asn1c flag -fcompound-names to avoid name collisions with ...

2021-10-27 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25994 )


Change subject: ranap: Use asn1c flag -fcompound-names to avoid name collisions 
with other libs
..

ranap: Use asn1c flag -fcompound-names to avoid name collisions with other libs

Change-Id: Iba106dcc18e3d429b4b9808610a44ac29b798172
---
M include/osmocom/ranap/RANAP_APN.h
M include/osmocom/ranap/RANAP_AccuracyFulfilmentIndicator.h
M include/osmocom/ranap/RANAP_AllocationOrRetentionPriority.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-ExtendedGuaranteedBitrateInf.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-ExtendedGuaranteedBitrateList.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-ExtendedGuaranteedBitrates.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-ExtendedMaxBitrateInf.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-ExtendedMaxBitrateList.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-ExtendedMaxBitrates.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-GuaranteedBitrateInf.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-GuaranteedBitrateList.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-GuaranteedBitrateType.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-GuaranteedBitrates.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-MaxBitrateInf.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-MaxBitrateList.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-MaxBitrateType.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-MaxBitrates.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-SupportedGuaranteedBitrateInf.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-SupportedGuaranteedBitrates.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-SupportedMaxBitrateInf.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameter-SupportedMaxBitrates.h
M include/osmocom/ranap/RANAP_Alt-RAB-Parameters.h
M include/osmocom/ranap/RANAP_AlternativeRABConfigurationRequest.h
M include/osmocom/ranap/RANAP_AreaIdentity.h
M include/osmocom/ranap/RANAP_Ass-RAB-Parameter-ExtendedGuaranteedBitrateList.h
M include/osmocom/ranap/RANAP_Ass-RAB-Parameter-ExtendedMaxBitrateList.h
M include/osmocom/ranap/RANAP_Ass-RAB-Parameter-GuaranteedBitrateList.h
M include/osmocom/ranap/RANAP_Ass-RAB-Parameter-MaxBitrateList.h
M include/osmocom/ranap/RANAP_Ass-RAB-Parameters.h
M include/osmocom/ranap/RANAP_AuthorisedPLMNs.h
M include/osmocom/ranap/RANAP_AuthorisedSNAs.h
M include/osmocom/ranap/RANAP_BindingID.h
M include/osmocom/ranap/RANAP_BroadcastAssistanceDataDecipheringKeys.h
M include/osmocom/ranap/RANAP_CGI.h
M include/osmocom/ranap/RANAP_CI.h
M include/osmocom/ranap/RANAP_CN-DeactivateTrace.h
M include/osmocom/ranap/RANAP_CN-DomainIndicator.h
M include/osmocom/ranap/RANAP_CN-ID.h
M include/osmocom/ranap/RANAP_CN-InvokeTrace.h
M include/osmocom/ranap/RANAP_CNMBMSLinkingInformation.h
M include/osmocom/ranap/RANAP_CSFB-Information.h
M include/osmocom/ranap/RANAP_CSG-Id-List.h
M include/osmocom/ranap/RANAP_CSG-Id.h
M include/osmocom/ranap/RANAP_CSG-Membership-Status.h
M include/osmocom/ranap/RANAP_Cause.h
M include/osmocom/ranap/RANAP_CauseMisc.h
M include/osmocom/ranap/RANAP_CauseNAS.h
M include/osmocom/ranap/RANAP_CauseNon-Standard.h
M include/osmocom/ranap/RANAP_CauseProtocol.h
M include/osmocom/ranap/RANAP_CauseRadioNetwork.h
M include/osmocom/ranap/RANAP_CauseRadioNetworkExtension.h
M include/osmocom/ranap/RANAP_CauseTransmissionNetwork.h
M include/osmocom/ranap/RANAP_Cell-Access-Mode.h
M include/osmocom/ranap/RANAP_Cell-Capacity-Class-Value.h
M include/osmocom/ranap/RANAP_Cell-Id.h
M include/osmocom/ranap/RANAP_CellBased.h
M include/osmocom/ranap/RANAP_CellIdList.h
M include/osmocom/ranap/RANAP_CellLoadInformation.h
M include/osmocom/ranap/RANAP_CellLoadInformationGroup.h
M include/osmocom/ranap/RANAP_CellType.h
M include/osmocom/ranap/RANAP_ChosenEncryptionAlgorithm.h
M include/osmocom/ranap/RANAP_ChosenIntegrityProtectionAlgorithm.h
M include/osmocom/ranap/RANAP_ClassmarkInformation2.h
M include/osmocom/ranap/RANAP_ClassmarkInformation3.h
M include/osmocom/ranap/RANAP_ClientType.h
M include/osmocom/ranap/RANAP_CommonID.h
M include/osmocom/ranap/RANAP_Correlation-ID.h
M include/osmocom/ranap/RANAP_Criticality.h
M include/osmocom/ranap/RANAP_CriticalityDiagnostics-IE-List.h
M include/osmocom/ranap/RANAP_CriticalityDiagnostics.h
M include/osmocom/ranap/RANAP_D-RNTI.h
M include/osmocom/ranap/RANAP_DCH-ID.h
M include/osmocom/ranap/RANAP_DL-GTP-PDU-SequenceNumber.h
M include/osmocom/ranap/RANAP_DL-N-PDU-SequenceNumber.h
M include/osmocom/ranap/RANAP_DRX-CycleLengthCoefficient.h
M include/osmocom/ranap/RANAP_DSCH-ID.h
M include/osmocom/ranap/RANAP_DataPDUType.h
M include/osmocom/ranap/RANAP_DataVolumeList.h
M include/osmocom/ranap/RANAP_DataVolumeReference.h
M include/osmocom/ranap/RANAP_DataVolumeReport.h
M include/osmocom/ranap/RANAP_DataVolumeReportList.h
M include/osmocom/ranap/RANAP_DataVolumeReportRequest.h
M include/osmocom/ranap/RANAP_DataVolumeReportin

Change in osmo-ttcn3-hacks[master]: library/MNCC_EncDec: rip out MNCC version 6 support

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25990 )

Change subject: library/MNCC_EncDec: rip out MNCC version 6 support
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25990
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ie45158e805a62e86b9496b46f323b83a74630460
Gerrit-Change-Number: 25990
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 15:21:30 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: library/MNCC_EncDec: rip out MNCC version 6 support

2021-10-27 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25990 )


Change subject: library/MNCC_EncDec: rip out MNCC version 6 support
..

library/MNCC_EncDec: rip out MNCC version 6 support

The latest release of osmo-sip-connector (1.5.0, 23 Feb 2021) does
support MNCCv7, so there is no need to maintain MNCCv6 support.

Change-Id: Ie45158e805a62e86b9496b46f323b83a74630460
Related: I5448ff931ec33f24f4837a51376f1703fe97683b
Related: OS#5282
---
M library/MNCC_EncDec.cc
M library/mncc.h
2 files changed, 37 insertions(+), 83 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/90/25990/1

diff --git a/library/MNCC_EncDec.cc b/library/MNCC_EncDec.cc
index be5d01a..7d09d0a 100644
--- a/library/MNCC_EncDec.cc
+++ b/library/MNCC_EncDec.cc
@@ -9,7 +9,7 @@

 BOOLEAN set__MNCC__version(INTEGER const& version)
 {
-   if (version != 6 && version != 7)
+   if (version != 7)
return false;
mncc_sock_version = version;
return true;
@@ -195,46 +195,27 @@
ret_val = ret_val & in.u().data().data();
break;
case MNCC__MsgUnion::ALT_rtp:
-   switch (mncc_sock_version) {
-   case 6:
-   struct gsm_mncc_rtp_mncc6 rtp_old;
-   memset(&rtp_old, 0, sizeof(rtp_old));
-   rtp_old.msg_type = in.msg__type();
-   rtp_old.callref = in.u().rtp().callref();
-   ttcn_buffer.put_string(in.u().rtp().ip());
-   if (!in.u().rtp().is__ipv6()) {
-   memcpy(&rtp_old.ip, ttcn_buffer.get_data(), 
sizeof(struct in_addr));
-   rtp_old.ip = ntohl(rtp_old.ip);
-   } /* else: ipv6 not supported in MNCCv6 */
-   rtp_old.port = in.u().rtp().rtp__port();
-   rtp_old.payload_type = in.u().rtp().payload__type();
-   rtp_old.payload_msg_type = 
in.u().rtp().payload__msg__type();
-   ret_val = OCTETSTRING(sizeof(rtp_old), (uint8_t *) 
&rtp_old);
-   break;
-   case 7:
-   struct gsm_mncc_rtp rtp;
-   memset(&rtp, 0, sizeof(rtp));
-   rtp.msg_type = in.msg__type();
-   rtp.callref = in.u().rtp().callref();
-   ttcn_buffer.put_string(in.u().rtp().ip());
-   if (in.u().rtp().is__ipv6()) {
-   // if(in.u().rtp().ip().lengthof() != 16) print 
error
-   rtp.addr.ss_family = AF_INET6;
-   memcpy(&((struct 
sockaddr_in6*)&rtp.addr)->sin6_addr, ttcn_buffer.get_data(),
-  sizeof(struct in6_addr));
-   ((struct sockaddr_in6*)&rtp.addr)->sin6_port = 
htons(in.u().rtp().rtp__port());
-   } else {
-   // if(in.u().rtp().ip().lengthof() != 4) print 
error
-   rtp.addr.ss_family = AF_INET;
-   memcpy(&((struct 
sockaddr_in*)&rtp.addr)->sin_addr, ttcn_buffer.get_data(),
-  sizeof(struct in_addr));
-   ((struct sockaddr_in*)&rtp.addr)->sin_port = 
htons(in.u().rtp().rtp__port());
-   }
-   rtp.payload_type = in.u().rtp().payload__type();
-   rtp.payload_msg_type = 
in.u().rtp().payload__msg__type();
-   ret_val = OCTETSTRING(sizeof(rtp), (uint8_t *) &rtp);
-   break;
+   struct gsm_mncc_rtp rtp;
+   memset(&rtp, 0, sizeof(rtp));
+   rtp.msg_type = in.msg__type();
+   rtp.callref = in.u().rtp().callref();
+   ttcn_buffer.put_string(in.u().rtp().ip());
+   if (in.u().rtp().is__ipv6()) {
+   // if(in.u().rtp().ip().lengthof() != 16) print error
+   rtp.addr.ss_family = AF_INET6;
+   memcpy(&((struct sockaddr_in6*)&rtp.addr)->sin6_addr, 
ttcn_buffer.get_data(),
+  sizeof(struct in6_addr));
+   ((struct sockaddr_in6*)&rtp.addr)->sin6_port = 
htons(in.u().rtp().rtp__port());
+   } else {
+   // if(in.u().rtp().ip().lengthof() != 4) print error
+   rtp.addr.ss_family = AF_INET;
+   memcpy(&((struct sockaddr_in*)&rtp.addr)->sin_addr, 
ttcn_buffer.get_data(),
+  sizeof(struct in_addr));
+   ((struct sockaddr_in*)&rtp.addr)->sin_port = 
htons(in.u().rtp().rtp__port());
}
+   rtp.payload_type = in.u

Change in osmo-bts[master]: l1sap: process_l1sap_meas_data() accepts pointer to lchan

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/25989 )

Change subject: l1sap: process_l1sap_meas_data() accepts pointer to lchan
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25989
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I9de67a0b2d2b18923f2c2003b400387a0f1af411
Gerrit-Change-Number: 25989
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Wed, 27 Oct 2021 15:17:10 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: l1sap: use designated initializers in process_l1sap_meas_data()

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/25988 )

Change subject: l1sap: use designated initializers in process_l1sap_meas_data()
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25988
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I5169a6c5f6865655dbfebb6b68d5f67941d9cdb1
Gerrit-Change-Number: 25988
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Wed, 27 Oct 2021 15:15:20 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: l1sap: move false PTCCH/U detection into PDCH branch

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/25987 )

Change subject: l1sap: move false PTCCH/U detection into PDCH branch
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25987
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I187fef8f3de0b41b502b0b18acfb11c56c5551f0
Gerrit-Change-Number: 25987
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Wed, 27 Oct 2021 15:14:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: l1sap: use designated initializers in process_l1sap_meas_data()

2021-10-27 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/25988 )


Change subject: l1sap: use designated initializers in process_l1sap_meas_data()
..

l1sap: use designated initializers in process_l1sap_meas_data()

Change-Id: I5169a6c5f6865655dbfebb6b68d5f67941d9cdb1
---
M src/common/l1sap.c
1 file changed, 24 insertions(+), 30 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/88/25988/1

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index d9e27b2..d02676b 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -705,11 +705,6 @@
struct ph_tch_param *ph_tch_ind;
uint8_t chan_nr;
uint32_t fn;
-   uint8_t inv_rssi;
-   uint8_t is_sub;
-   int16_t ta_offs_256bits;
-   uint16_t ber10k;
-   int16_t ci_cb;
const char *ind_name;

switch (ind_type) {
@@ -718,12 +713,14 @@
info_meas_ind = &l1sap->u.info.u.meas_ind;
chan_nr = info_meas_ind->chan_nr;
fn = info_meas_ind->fn;
-   inv_rssi = info_meas_ind->inv_rssi;
-   is_sub = info_meas_ind->is_sub;
-   ta_offs_256bits = info_meas_ind->ta_offs_256bits;
-   ber10k = info_meas_ind->ber10k;
-   ci_cb = info_meas_ind->c_i_cb;
ind_name = "MPH INFO";
+   ulm = (struct bts_ul_meas) {
+   .ta_offs_256bits = info_meas_ind->ta_offs_256bits,
+   .inv_rssi = info_meas_ind->inv_rssi,
+   .ber10k = info_meas_ind->ber10k,
+   .c_i = info_meas_ind->c_i_cb,
+   .is_sub = info_meas_ind->is_sub,
+   };
break;
case PRIM_TCH:
ph_tch_ind = &l1sap->u.tch;
@@ -731,12 +728,14 @@
return;
chan_nr = ph_tch_ind->chan_nr;
fn = ph_tch_ind->fn;
-   inv_rssi = abs(ph_tch_ind->rssi);
-   is_sub = ph_tch_ind->is_sub;
-   ta_offs_256bits = ph_tch_ind->ta_offs_256bits;
-   ber10k = ph_tch_ind->ber10k;
-   ci_cb = ph_tch_ind->lqual_cb;
ind_name = "TCH";
+   ulm = (struct bts_ul_meas) {
+   .ta_offs_256bits = ph_tch_ind->ta_offs_256bits,
+   .inv_rssi = abs(ph_tch_ind->rssi),
+   .ber10k = ph_tch_ind->ber10k,
+   .c_i = ph_tch_ind->lqual_cb,
+   .is_sub = ph_tch_ind->is_sub,
+   };
break;
case PRIM_PH_DATA:
ph_data_ind = &l1sap->u.data;
@@ -744,12 +743,14 @@
return;
chan_nr = ph_data_ind->chan_nr;
fn = ph_data_ind->fn;
-   inv_rssi = abs(ph_data_ind->rssi);
-   is_sub = ph_data_ind->is_sub;
-   ta_offs_256bits = ph_data_ind->ta_offs_256bits;
-   ber10k = ph_data_ind->ber10k;
-   ci_cb = ph_data_ind->lqual_cb;
ind_name = "DATA";
+   ulm = (struct bts_ul_meas) {
+   .ta_offs_256bits = ph_data_ind->ta_offs_256bits,
+   .inv_rssi = abs(ph_data_ind->rssi),
+   .ber10k = ph_data_ind->ber10k,
+   .c_i = ph_data_ind->lqual_cb,
+   .is_sub = ph_data_ind->is_sub,
+   };
break;
default:
OSMO_ASSERT(false);
@@ -765,23 +766,16 @@

DEBUGPFN(DL1P, fn,
 "%s %s meas ind, ta_offs_256bits=%d, ber10k=%d, inv_rssi=%u, 
C/I=%d cB\n",
-gsm_lchan_name(lchan), ind_name, ta_offs_256bits, ber10k,
-inv_rssi, ci_cb);
+gsm_lchan_name(lchan), ind_name, ulm.ta_offs_256bits,
+ulm.ber10k, ulm.inv_rssi, ulm.c_i);

/* in the GPRS case we are not interested in measurement
 * processing.  The PCU will take care of it */
if (lchan->type == GSM_LCHAN_PDTCH)
return;

-   memset(&ulm, 0, sizeof(ulm));
-   ulm.ta_offs_256bits = ta_offs_256bits;
-   ulm.ber10k = ber10k;
-   ulm.c_i = ci_cb;
-   ulm.inv_rssi = inv_rssi;
-   ulm.is_sub = is_sub;
-
/* we assume that symbol period is 1 bit: */
-   set_ms_to_data(lchan, ta_offs_256bits / 256, true);
+   set_ms_to_data(lchan, ulm.ta_offs_256bits / 256, true);

lchan_meas_process_measurement(lchan, &ulm, fn);


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25988
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I5169a6c5f6865655dbfebb6b68d5f67941d9cdb1
Gerrit-Change-Number: 25988
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-bts[master]: l1sap: process_l1sap_meas_data() accepts pointer to lchan

2021-10-27 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/25989 )


Change subject: l1sap: process_l1sap_meas_data() accepts pointer to lchan
..

l1sap: process_l1sap_meas_data() accepts pointer to lchan

In 2/3 cases when calling process_l1sap_meas_data() we already have
a pointer to the logical channel, so let's pass it as the first
argument instead of a pointer to the transceiver.  This way we
avoid calling get_active_lchan_by_chan_nr() two times.

In l1sap_ph_data_ind(), call process_l1sap_meas_data() below the
conditional branch handling PDCH, so it won't be called for
GSM_LCHAN_PDTCH anymore.  GPRS specific measurements are handled
by the PCU and not of interest for the BSC.

Change-Id: I9de67a0b2d2b18923f2c2003b400387a0f1af411
---
M src/common/l1sap.c
1 file changed, 21 insertions(+), 27 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/89/25989/1

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index d02676b..47ba663 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -694,16 +694,14 @@
 }

 /* measurement information received from bts model */
-static void process_l1sap_meas_data(struct gsm_bts_trx *trx,
+static void process_l1sap_meas_data(struct gsm_lchan *lchan,
struct osmo_phsap_prim *l1sap,
enum osmo_ph_prim ind_type)
 {
struct bts_ul_meas ulm;
-   struct gsm_lchan *lchan;
struct info_meas_ind_param *info_meas_ind;
struct ph_data_param *ph_data_ind;
struct ph_tch_param *ph_tch_ind;
-   uint8_t chan_nr;
uint32_t fn;
const char *ind_name;

@@ -711,7 +709,6 @@
case PRIM_MPH_INFO:
/* (legacy way, see also OS#2977) */
info_meas_ind = &l1sap->u.info.u.meas_ind;
-   chan_nr = info_meas_ind->chan_nr;
fn = info_meas_ind->fn;
ind_name = "MPH INFO";
ulm = (struct bts_ul_meas) {
@@ -726,7 +723,6 @@
ph_tch_ind = &l1sap->u.tch;
if (ph_tch_ind->rssi == 0)
return;
-   chan_nr = ph_tch_ind->chan_nr;
fn = ph_tch_ind->fn;
ind_name = "TCH";
ulm = (struct bts_ul_meas) {
@@ -741,7 +737,6 @@
ph_data_ind = &l1sap->u.data;
if (ph_data_ind->rssi == 0)
return;
-   chan_nr = ph_data_ind->chan_nr;
fn = ph_data_ind->fn;
ind_name = "DATA";
ulm = (struct bts_ul_meas) {
@@ -756,24 +751,11 @@
OSMO_ASSERT(false);
}

-   lchan = get_active_lchan_by_chan_nr(trx, chan_nr);
-   if (!lchan) {
-   LOGPFN(DL1P, LOGL_ERROR, fn,
-  "No lchan for %s MEAS IND (chan_nr=%s)\n",
-  ind_name, rsl_chan_nr_str(chan_nr));
-   return;
-   }
-
DEBUGPFN(DL1P, fn,
 "%s %s meas ind, ta_offs_256bits=%d, ber10k=%d, inv_rssi=%u, 
C/I=%d cB\n",
 gsm_lchan_name(lchan), ind_name, ulm.ta_offs_256bits,
 ulm.ber10k, ulm.inv_rssi, ulm.c_i);

-   /* in the GPRS case we are not interested in measurement
-* processing.  The PCU will take care of it */
-   if (lchan->type == GSM_LCHAN_PDTCH)
-   return;
-
/* we assume that symbol period is 1 bit: */
set_ms_to_data(lchan, ulm.ta_offs_256bits / 256, true);

@@ -786,6 +768,8 @@
 static int l1sap_mph_info_ind(struct gsm_bts_trx *trx,
 struct osmo_phsap_prim *l1sap, struct mph_info_param *info)
 {
+   const struct info_meas_ind_param *meas_ind;
+   struct gsm_lchan *lchan;
int rc = 0;

switch (info->type) {
@@ -805,7 +789,17 @@
if (bts_internal_flag_get(trx->bts, 
BTS_INTERNAL_FLAG_MEAS_PAYLOAD_COMB))
OSMO_ASSERT(false);

-   process_l1sap_meas_data(trx, l1sap, PRIM_MPH_INFO);
+   meas_ind = &l1sap->u.info.u.meas_ind;
+
+   lchan = get_active_lchan_by_chan_nr(trx, meas_ind->chan_nr);
+   if (!lchan) {
+   LOGPFN(DL1P, LOGL_ERROR, meas_ind->fn,
+  "No lchan for chan_nr=%s\n",
+  rsl_chan_nr_str(meas_ind->chan_nr));
+   return 0;
+   }
+
+   process_l1sap_meas_data(lchan, l1sap, PRIM_MPH_INFO);
break;
default:
LOGP(DL1P, LOGL_NOTICE, "unknown MPH_INFO ind type %d\n",
@@ -1488,12 +1482,6 @@
DEBUGPGT(DL1P, &g_time, "Rx PH-DATA.ind chan_nr=%s link_id=0x%02x 
len=%d\n",
 rsl_chan_nr_str(chan_nr), link_id, len);

-   /* The ph_data_param contained in the l1sap primitive may contain
-* measurement data. If this data is present, fo

Change in osmo-bts[master]: l1sap: move false PTCCH/U detection into PDCH branch

2021-10-27 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/25987 )


Change subject: l1sap: move false PTCCH/U detection into PDCH branch
..

l1sap: move false PTCCH/U detection into PDCH branch

This check is only relevant for PDCH timeslots.

Change-Id: I187fef8f3de0b41b502b0b18acfb11c56c5551f0
---
M src/common/l1sap.c
1 file changed, 8 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/87/25987/1

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 6eb08ba..d9e27b2 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1494,15 +1494,6 @@
DEBUGPGT(DL1P, &g_time, "Rx PH-DATA.ind chan_nr=%s link_id=0x%02x 
len=%d\n",
 rsl_chan_nr_str(chan_nr), link_id, len);

-   /* Actually, there can be no DATA.ind on PTCCH/U (rather RACH.ind 
instead),
-* but some BTS models with buggy implementation may still be sending 
them
-* to us. Let's keep this for backwards compatibility. */
-   if (L1SAP_IS_CHAN_PDCH(chan_nr) && L1SAP_IS_PTCCH(fn)) {
-   LOGPGT(DL1P, LOGL_NOTICE, &g_time, "There can be no DATA.ind on 
PTCCH/U. "
-  "This is probably a bug of the BTS model you're using, 
please fix!\n");
-   return -EINVAL;
-   }
-
/* The ph_data_param contained in the l1sap primitive may contain
 * measurement data. If this data is present, forward it for
 * processing */
@@ -1525,6 +1516,14 @@
return 1;
}

+   /* There can be no DATA.ind on PTCCH/U (rather RACH.ind 
instead), but some
+* BTS models with buggy implementation may still be sending 
them to us. */
+   if (L1SAP_IS_PTCCH(fn)) {
+   LOGPGT(DL1P, LOGL_NOTICE, &g_time, "There can be no 
DATA.ind on PTCCH/U. "
+  "This is probably a bug of the BTS model you're 
using, please fix!\n");
+   return -EINVAL;
+   }
+
/* Drop all data from incomplete UL block */
if (pr_info != PRES_INFO_BOTH)
len = 0;

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25987
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I187fef8f3de0b41b502b0b18acfb11c56c5551f0
Gerrit-Change-Number: 25987
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-iuh[master]: hnbap: Drop no longer existing asn1c param -fnative-types

2021-10-27 Thread pespin
pespin has removed a vote from this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25986 )


Change subject: hnbap: Drop no longer existing asn1c param -fnative-types
..


Removed Verified-1 by Jenkins Builder (102)
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25986
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Iccf81539a5045416185e619d24c3d542204437e6
Gerrit-Change-Number: 25986
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-MessageType: deleteVote


Change in osmo-iuh[master]: hnbap: Drop no longer existing asn1c param -fnative-types

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25986 )

Change subject: hnbap: Drop no longer existing asn1c param -fnative-types
..


Patch Set 1: Verified+1

linter doesn't apply here.


--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25986
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Iccf81539a5045416185e619d24c3d542204437e6
Gerrit-Change-Number: 25986
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 14:41:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gbproxy[master]: gbproxy: Route DL STATUS with BVCI on SIG-BVC

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gbproxy/+/25985 )

Change subject: gbproxy: Route DL STATUS with BVCI on SIG-BVC
..


Patch Set 1:

(3 comments)

https://gerrit.osmocom.org/c/osmo-gbproxy/+/25985/1/src/gb_proxy.c
File src/gb_proxy.c:

https://gerrit.osmocom.org/c/osmo-gbproxy/+/25985/1/src/gb_proxy.c@1021
PS1, Line 1021: static int gbproxy_bvci_from_status_pdu(struct msgb *msg, 
struct tlv_parsed *tp, uint16_t *bvci, char *log_pfx)
Some small func description would be helpful here.
BTW, "msg" is not used here?


https://gerrit.osmocom.org/c/osmo-gbproxy/+/25985/1/src/gb_proxy.c@1527
PS1, Line 1527: if (bvci != 0) {
You can add this check inline with the other if:
if ((gbproxy_bvci_from_status_pdu(msg, tp, &bvci, log_pfx) == 0) && (bvci != 
0)) {


https://gerrit.osmocom.org/c/osmo-gbproxy/+/25985/1/src/gb_proxy.c@1530
PS1, Line 1530: /* TODO: Log */
Please add the log right now :)



--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/25985
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I5928cebea7f39d6648f95dfa1a46437de202f723
Gerrit-Change-Number: 25985
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 14:18:08 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-gbproxy[master]: gbproxy: Improve STATUS handling from SGSN

2021-10-27 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gbproxy/+/25984 )

Change subject: gbproxy: Improve STATUS handling from SGSN
..


Patch Set 1: Code-Review-1

This one is not ready yet


--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/25984
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I0ab88634fe2eab5299ff4587fcef4177ce5b4831
Gerrit-Change-Number: 25984
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 14:16:29 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gbproxy[master]: gbproxy: Improve STATUS handling from SGSN

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gbproxy/+/25984 )

Change subject: gbproxy: Improve STATUS handling from SGSN
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/25984
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I0ab88634fe2eab5299ff4587fcef4177ce5b4831
Gerrit-Change-Number: 25984
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 14:15:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gbproxy[master]: gbproxy: Add comment, improve log message in gbproxy_tlli_from_status...

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-gbproxy/+/25983 )

Change subject: gbproxy: Add comment, improve log message in 
gbproxy_tlli_from_status_pdu
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/25983
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: Idcd2742f451ba5ae79f62395e033924782336cac
Gerrit-Change-Number: 25983
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-Reviewer: pespin 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Wed, 27 Oct 2021 14:12:43 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-gbproxy[master]: gbproxy: Route DL STATUS with BVCI on SIG-BVC

2021-10-27 Thread daniel
daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gbproxy/+/25985 )


Change subject: gbproxy: Route DL STATUS with BVCI on SIG-BVC
..

gbproxy: Route DL STATUS with BVCI on SIG-BVC

Fixes TTCN3 gbproxy test TC_status_sig_dl_bvci

Related: OS#4892
Change-Id: I5928cebea7f39d6648f95dfa1a46437de202f723
---
M src/gb_proxy.c
1 file changed, 37 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/85/25985/1

diff --git a/src/gb_proxy.c b/src/gb_proxy.c
index f92585a..4c45adb 100644
--- a/src/gb_proxy.c
+++ b/src/gb_proxy.c
@@ -1018,6 +1018,30 @@
return 0;
 }

+static int gbproxy_bvci_from_status_pdu(struct msgb *msg, struct tlv_parsed 
*tp, uint16_t *bvci, char *log_pfx)
+{
+   int rc;
+   int pdu_len = TLVP_LEN(&tp[0], BSSGP_IE_PDU_IN_ERROR);
+   const uint8_t *pdu_data = TLVP_VAL(&tp[0], BSSGP_IE_PDU_IN_ERROR);
+   struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *)pdu_data;
+   struct tlv_parsed tp_inner[2];
+
+   /* TODO: Parse partial messages as well */
+   rc = osmo_tlv_prot_parse(&osmo_pdef_bssgp, tp_inner, 
ARRAY_SIZE(tp_inner), bgph->pdu_type, bgph->data,
+pdu_len - sizeof(*bgph), 0, 0, DGPRS, log_pfx);
+
+   if (rc < 0)
+   return rc;
+
+   if (TLVP_PRESENT(&tp_inner[0], BSSGP_IE_BVCI)) {
+   *bvci = ntohs(tlvp_val16_unal(&tp_inner[0], BSSGP_IE_BVCI));
+   } else {
+   return -ENOENT;
+   }
+
+   return 0;
+}
+
 /* Receive an incoming signalling message from a BSS-side NS-VC */
 static int gbprox_rx_sig_from_bss(struct gbproxy_nse *nse, struct msgb *msg, 
uint16_t ns_bvci)
 {
@@ -1498,6 +1522,19 @@
LOGPNSE(nse, LOGL_NOTICE, "Rx STATUS cause=0x%02x(%s)\n", cause,
bssgp_cause_str(cause));

+
+   if (gbproxy_bvci_from_status_pdu(msg, tp, &bvci, log_pfx) == 0) 
{
+   if (bvci != 0) {
+   struct gbproxy_cell *cell = 
gbproxy_cell_by_bvci(cfg, bvci);
+
+   /* TODO: Log */
+   if ((!cell || !cell->bss_bvc || 
!cell->bss_bvc->nse))
+   break;
+
+   return gbprox_relay2nse(msg, 
cell->bss_bvc->nse, 0);
+   }
+   }
+
if (gbproxy_tlli_from_status_pdu(msg, tp, &tlli, log_pfx) == 0) 
{
nse_peer = gbproxy_nse_by_tlli(cfg, tlli);
if (nse_peer)

--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/25985
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I5928cebea7f39d6648f95dfa1a46437de202f723
Gerrit-Change-Number: 25985
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-MessageType: newchange


Change in osmo-gbproxy[master]: gbproxy: Improve STATUS handling from SGSN

2021-10-27 Thread daniel
daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gbproxy/+/25984 )


Change subject: gbproxy: Improve STATUS handling from SGSN
..

gbproxy: Improve STATUS handling from SGSN

STATUS with cause bvci blocked or unknown should not be forwarded

Related: OS#4892
Change-Id: I0ab88634fe2eab5299ff4587fcef4177ce5b4831
---
M src/gb_proxy.c
1 file changed, 33 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/84/25984/1

diff --git a/src/gb_proxy.c b/src/gb_proxy.c
index 5c2d5bb..f92585a 100644
--- a/src/gb_proxy.c
+++ b/src/gb_proxy.c
@@ -1380,7 +1380,6 @@
uint16_t bvci;
char log_pfx[32];
int rc = 0;
-   int cause;
int i;
bool paging_bc = false;

@@ -1475,20 +1474,41 @@
rc = gbprox_rx_paging(nse, msg, pdut_name, &tp[0], ns_bvci, 
paging_bc);
break;
case BSSGP_PDUT_STATUS:
-   /* Some exception has occurred */
-   cause = *TLVP_VAL(&tp[0], BSSGP_IE_CAUSE);
-   LOGPNSE(nse, LOGL_NOTICE, "Rx STATUS cause=0x%02x(%s) ", cause,
+   {
+   struct gbproxy_nse *nse_peer;
+   uint32_t tlli;
+
+   /* Check if the status needs to be terminated locally */
+   uint8_t cause = *TLVP_VAL(&tp[0], BSSGP_IE_CAUSE);
+
+   if (cause == BSSGP_CAUSE_UNKNOWN_BVCI || cause == 
BSSGP_CAUSE_BVCI_BLOCKED) {
+   /* Log and handle locally, BVCI should be present for 
these causes */
+   if (!TLVP_PRESENT(&tp[0], BSSGP_IE_BVCI)) {
+   LOGPNSE(nse, LOGL_ERROR, "Rx STATUS 
cause=0x%02x(%s), but BVCI is missing\n", cause,
+   bssgp_cause_str(cause));
+   break;
+   }
+   uint16_t ptp_bvci = ntohs(tlvp_val16_unal(&tp[0], 
BSSGP_IE_BVCI));
+   LOGPNSE(nse, LOGL_ERROR, "Rx STATUS cause=0x%02x(%s) 
for PtP-BVC %05u\n", cause,
+   bssgp_cause_str(cause), ptp_bvci);
+   /* FIXME: Remove/block the other BSS/SGSN BVCs if 
present? */
+   break;
+   }
+
+   LOGPNSE(nse, LOGL_NOTICE, "Rx STATUS cause=0x%02x(%s)\n", cause,
bssgp_cause_str(cause));
-   if (TLVP_PRES_LEN(&tp[0], BSSGP_IE_BVCI, 2)) {
-   bvci = ntohs(tlvp_val16_unal(&tp[0], BSSGP_IE_BVCI));
-   LOGPC(DGPRS, LOGL_NOTICE, "BVCI=%05u\n", bvci);
-   sgsn_bvc = gbproxy_bvc_by_bvci(nse, bvci);
-   /* don't send STATUS in response to STATUS if !bvc */
-   if (sgsn_bvc && sgsn_bvc->cell && 
sgsn_bvc->cell->bss_bvc)
-   rc = gbprox_relay2peer(msg, 
sgsn_bvc->cell->bss_bvc, ns_bvci);
-   } else
-   LOGPC(DGPRS, LOGL_NOTICE, "\n");
+
+   if (gbproxy_tlli_from_status_pdu(msg, tp, &tlli, log_pfx) == 0) 
{
+   nse_peer = gbproxy_nse_by_tlli(cfg, tlli);
+   if (nse_peer)
+   return gbprox_relay2nse(msg, nse_peer, 0);
+   }
+
+   LOGPNSE(nse, LOGL_ERROR, "Unable to handle STATUS 
cause=0x%02x(%s)\n", cause,
+   bssgp_cause_str(cause));
+
break;
+   }
/* those only exist in the SGSN -> BSS direction */
case BSSGP_PDUT_SUSPEND_ACK:
case BSSGP_PDUT_SUSPEND_NACK:

--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/25984
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: I0ab88634fe2eab5299ff4587fcef4177ce5b4831
Gerrit-Change-Number: 25984
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-MessageType: newchange


Change in osmo-gbproxy[master]: gbproxy: Add comment, improve log message in gbproxy_tlli_from_status...

2021-10-27 Thread daniel
daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-gbproxy/+/25983 )


Change subject: gbproxy: Add comment, improve log message in 
gbproxy_tlli_from_status_pdu
..

gbproxy: Add comment, improve log message in gbproxy_tlli_from_status_pdu

Change-Id: Idcd2742f451ba5ae79f62395e033924782336cac
---
M src/gb_proxy.c
1 file changed, 6 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gbproxy refs/changes/83/25983/1

diff --git a/src/gb_proxy.c b/src/gb_proxy.c
index 1e8bc96..5c2d5bb 100644
--- a/src/gb_proxy.c
+++ b/src/gb_proxy.c
@@ -997,6 +997,7 @@
struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *)pdu_data;
struct tlv_parsed tp_inner[2];

+   /* TODO: Parse partial messages as well */
rc = osmo_tlv_prot_parse(&osmo_pdef_bssgp, tp_inner, 
ARRAY_SIZE(tp_inner), bgph->pdu_type, bgph->data,
 pdu_len - sizeof(*bgph), 0, 0, DGPRS, log_pfx);

@@ -,16 +1112,19 @@
struct gbproxy_sgsn *sgsn;
/* Check if the status needs to be terminated locally */
uint8_t cause = *TLVP_VAL(&tp[0], BSSGP_IE_CAUSE);
+
if (cause == BSSGP_CAUSE_UNKNOWN_BVCI || cause == 
BSSGP_CAUSE_BVCI_BLOCKED) {
/* Log and handle locally */
ptp_bvci = ntohs(tlvp_val16_unal(&tp[0], 
BSSGP_IE_BVCI));
-   LOGP(DGPRS, LOGL_ERROR, "%s Rx STATUS with cause %s for 
PtP-BVC %05u\n", log_pfx,
+   LOGPNSE(nse, LOGL_ERROR, "Rx STATUS cause=0x%02x(%s) 
for PtP-BVC %05u\n", cause,
bssgp_cause_str(cause), ptp_bvci);
/* FIXME: Remove/block our BVC if present? */
break;
}
 
-   LOGP(DGPRS, LOGL_INFO, "Forwarding STATUS with cause %s\n", 
bssgp_cause_str(cause));
+   LOGPNSE(nse, LOGL_NOTICE, "Rx STATUS cause=0x%02x(%s) ", cause,
+   bssgp_cause_str(cause));
+
if (gbproxy_tlli_from_status_pdu(msg, tp, &tlli, log_pfx) == 0)
sgsn = gbproxy_select_sgsn(nse->cfg, &tlli);
else

--
To view, visit https://gerrit.osmocom.org/c/osmo-gbproxy/+/25983
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gbproxy
Gerrit-Branch: master
Gerrit-Change-Id: Idcd2742f451ba5ae79f62395e033924782336cac
Gerrit-Change-Number: 25983
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-MessageType: newchange


Change in osmo-msc[master]: mncc: rework passing GCR over the MNCC interface

2021-10-27 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-msc/+/25982 )


Change subject: mncc: rework passing GCR over the MNCC interface
..

mncc: rework passing GCR over the MNCC interface

Using *unpacked* 'struct osmo_gcr_parsed' in the MNCC PDUs makes
the protocol even more complicated than it currently is, and
moreover complicates implementing MNCCv8 in the ttcn3-sip-test.

Replace 'struct osmo_gcr_parsed' in 'struct gsm_mncc' with a
fixed-length buffer, which is supposed to hold the Global Call
Reference encoded as per 3GPP TS 29.205.

Indicate presence of GCR using the MNCC_F_GCR flag.

Change-Id: I259b6d7e4cbe26159b9b496356fc7c1c27d54521
Fixes: I705c860e51637b4537cad65a330ecbaaca96dd5b
Related: OS#5164, OS#5282
---
M include/osmocom/msc/mncc.h
M src/libmsc/gsm_04_08_cc.c
2 files changed, 15 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/82/25982/1

diff --git a/include/osmocom/msc/mncc.h b/include/osmocom/msc/mncc.h
index 5002227..d4d3f96 100644
--- a/include/osmocom/msc/mncc.h
+++ b/include/osmocom/msc/mncc.h
@@ -26,7 +26,6 @@

 #include 
 #include 
-#include 

 #include 
 #include 
@@ -161,7 +160,10 @@

unsigned char   lchan_type;
unsigned char   lchan_mode;
-   struct osmo_gcr_parsed gcr;
+
+   /* Global Call Reference (encoded as per 3GPP TS 29.205) */
+   uint8_t gcr[16];
+
/* A buffer to contain SDP ('\0' terminated) */
charsdp[1024];
 };
diff --git a/src/libmsc/gsm_04_08_cc.c b/src/libmsc/gsm_04_08_cc.c
index d6a2864..42f6bf0 100644
--- a/src/libmsc/gsm_04_08_cc.c
+++ b/src/libmsc/gsm_04_08_cc.c
@@ -517,8 +517,17 @@
trans->cc.lcls = trans_lcls_compose(trans, true);

/* Pass the LCLS GCR on to the MT call leg via MNCC */
-   if (trans->cc.lcls)
-   setup.gcr = trans->cc.lcls->gcr;
+   if (trans->cc.lcls) {
+   struct msgb *_msg = msgb_alloc(sizeof(setup.gcr), "MNCC GCR");
+   const struct osmo_gcr_parsed gcr = &trans->cc.lcls->gcr;
+   int rc;
+
+   if (msg == NULL || (rc = osmo_enc_gcr(msg, gcr)) == 0)
+   LOG_TRANS(trans, LOGL_ERROR, "Failed to encode GCR\n");
+   else
+   memcpy(&setup.gcr[0], msg->data, rc);
+   msgb_free(msg);
+   }

tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0);
/* emergency setup is identified by msg_type */

--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/25982
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I259b6d7e4cbe26159b9b496356fc7c1c27d54521
Gerrit-Change-Number: 25982
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: heighbor_ident: add/del neighbor cells via ctrl interface

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25976 )

Change subject: heighbor_ident: add/del neighbor cells via ctrl interface
..


Patch Set 3:

(4 comments)

https://gerrit.osmocom.org/c/osmo-bsc/+/25976/3/doc/manuals/chapters/control.adoc
File doc/manuals/chapters/control.adoc:

https://gerrit.osmocom.org/c/osmo-bsc/+/25976/3/doc/manuals/chapters/control.adoc@124
PS3, Line 124: FIXME: add variables defined in src/ctrl/control_if.c?
This FIXME probably needs to be kept at the end.


https://gerrit.osmocom.org/c/osmo-bsc/+/25976/3/src/osmo-bsc/neighbor_ident_ctrl.c
File src/osmo-bsc/neighbor_ident_ctrl.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25976/3/src/osmo-bsc/neighbor_ident_ctrl.c@28
PS3, Line 28: #include 
why are these vty headers needed here?


https://gerrit.osmocom.org/c/osmo-bsc/+/25976/3/src/osmo-bsc/neighbor_ident_ctrl.c@121
PS3, Line 121: CTRL_CMD_DEFINE_WO(neighbor_bts_add, "neighbor-bts add");
Please add some documentation here on the expected format regarding params, 
etc. for each command.


https://gerrit.osmocom.org/c/osmo-bsc/+/25976/3/tests/ctrl_test_runner.py
File tests/ctrl_test_runner.py:

https://gerrit.osmocom.org/c/osmo-bsc/+/25976/3/tests/ctrl_test_runner.py@655
PS3, Line 655: r = self.do_set('bts.0.neighbor-cgi.add', 
'001-01-100-200-123-4')
This kind of stuff is what you need to add as a comment before definining each 
CTRL command, explaining what each param is.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25976
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I343a40e18fa9b91e6c381912c0426a002841e079
Gerrit-Change-Number: 25976
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 14:04:43 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in libosmocore[master]: Revert "Prevent GCR encoder/decoder functions from being used directly"

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/25981 )

Change subject: Revert "Prevent GCR encoder/decoder functions from being used 
directly"
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/25981
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I06babb959fdc82f4e82d92260131d60c98b0abd2
Gerrit-Change-Number: 25981
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 13:57:16 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sip-connector[master]: sip: use osmo_{enc, dec}_gcr() from libosmocore

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/25979 )

Change subject: sip: use osmo_{enc,dec}_gcr() from libosmocore
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/25979
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I46fa46fc79494d337f2f4657215b91c39207eea4
Gerrit-Change-Number: 25979
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 13:56:32 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sip-connector[master]: sip: fix memory leak (x_gcr) in send_invite()

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/25978 )

Change subject: sip: fix memory leak (x_gcr) in send_invite()
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/25978
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I6a2e5e15061010f6e62d0f3b0acd2c040dbe3249
Gerrit-Change-Number: 25978
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 13:55:11 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: implement all_allocated:{sdcch, tch} rate counters

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25974 )

Change subject: implement all_allocated:{sdcch,tch} rate counters
..


Patch Set 1:

Please share an example on how this would look like from user point of view, 
I'm totally lost here.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25974
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I8b06e435a224c8708cd6c67e97ee5413718fc1ed
Gerrit-Change-Number: 25974
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 13:54:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: add time_cc API: cumlative counter for time, reported as rate_ctr

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25973 )

Change subject: add time_cc API: cumlative counter for time, reported as 
rate_ctr
..


Patch Set 1:

(1 comment)

I'm really lacking some perspective/documentation on the exact use of this. I 
mean, how is someone expected to consume this information and how is it 
displayed? through VTY rate_ctr show?

https://gerrit.osmocom.org/c/osmo-bsc/+/25973/1/include/osmocom/bsc/time_cc.h
File include/osmocom/bsc/time_cc.h:

https://gerrit.osmocom.org/c/osmo-bsc/+/25973/1/include/osmocom/bsc/time_cc.h@129
PS1, Line 129: struct time_cc {
Maybe add an API to allocate/initialize a structure for this.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25973
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Icdd36f27cb54b2e1b940c9e6404ba9dd3692a310
Gerrit-Change-Number: 25973
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 13:53:00 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-sip-connector[master]: mncc: rework passing GCR over the MNCC interface

2021-10-27 Thread fixeria
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-sip-connector/+/25980

to look at the new patch set (#2).

Change subject: mncc: rework passing GCR over the MNCC interface
..

mncc: rework passing GCR over the MNCC interface

Using *unpacked* 'struct osmo_gcr_parsed' in the MNCC PDUs makes
the protocol even more complicated than it currently is, and
moreover complicates implementing MNCCv8 in the ttcn3-sip-test.

Replace 'struct osmo_gcr_parsed' in 'struct gsm_mncc' with a
fixed-length buffer, which is supposed to hold the Global Call
Reference encoded as per 3GPP TS 29.205.

Check / indicate presence of GCR using the MNCC_F_GCR flag.

Change-Id: Iaff46732948f8f5d03e42f17c35cbac8a80af49b
Fixes: Id40d7e0fed9356f801b3627c118150055e7232b1
Related: OS#5164, OS#5282
---
M src/mncc.c
M src/mncc_protocol.h
2 files changed, 31 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/80/25980/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/25980
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: Iaff46732948f8f5d03e42f17c35cbac8a80af49b
Gerrit-Change-Number: 25980
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: heighbor_ident: add/del neighbor cells via ctrl interface

2021-10-27 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25976 )

Change subject: heighbor_ident: add/del neighbor cells via ctrl interface
..


Patch Set 3:

This change is ready for review.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25976
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I343a40e18fa9b91e6c381912c0426a002841e079
Gerrit-Change-Number: 25976
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Wed, 27 Oct 2021 13:49:38 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in libosmocore[master]: Revert "Prevent GCR encoder/decoder functions from being used directly"

2021-10-27 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/25981 )


Change subject: Revert "Prevent GCR encoder/decoder functions from being used 
directly"
..

Revert "Prevent GCR encoder/decoder functions from being used directly"

We need this API for communicating GCR over the MNCC and SIP.

Change-Id: I06babb959fdc82f4e82d92260131d60c98b0abd2
Related: OS#5164
---
M include/osmocom/gsm/gsm29205.h
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/25981/1

diff --git a/include/osmocom/gsm/gsm29205.h b/include/osmocom/gsm/gsm29205.h
index 9575456..f93e34a 100644
--- a/include/osmocom/gsm/gsm29205.h
+++ b/include/osmocom/gsm/gsm29205.h
@@ -37,6 +37,6 @@
uint8_t cr[5];   /** Call Reference ID */
 };

-uint8_t osmo_enc_gcr(struct msgb *msg, const struct osmo_gcr_parsed *g) 
OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE;
-int osmo_dec_gcr(struct osmo_gcr_parsed *gcr, const uint8_t *elem, uint8_t 
len) OSMO_DEPRECATED_OUTSIDE_LIBOSMOCORE;
+uint8_t osmo_enc_gcr(struct msgb *msg, const struct osmo_gcr_parsed *g);
+int osmo_dec_gcr(struct osmo_gcr_parsed *gcr, const uint8_t *elem, uint8_t 
len);
 bool osmo_gcr_eq(const struct osmo_gcr_parsed *gcr1, const struct 
osmo_gcr_parsed *gcr2);

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/25981
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I06babb959fdc82f4e82d92260131d60c98b0abd2
Gerrit-Change-Number: 25981
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-sip-connector[master]: mncc: rework passing GCR over the MNCC interface

2021-10-27 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/25980 )


Change subject: mncc: rework passing GCR over the MNCC interface
..

mncc: rework passing GCR over the MNCC interface

Change-Id: Iaff46732948f8f5d03e42f17c35cbac8a80af49b
Fixes: Id40d7e0fed9356f801b3627c118150055e7232b1
Related: OS#5164, OS#5282
---
M src/mncc.c
M src/mncc_protocol.h
2 files changed, 31 insertions(+), 6 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/80/25980/1

diff --git a/src/mncc.c b/src/mncc.c
index c8bf4bd..ea8f020 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -485,6 +485,7 @@
const struct gsm_mncc_number *called;
struct call *call;
struct mncc_call_leg *leg;
+   struct osmo_gcr_parsed gcr;

if (rc < sizeof(*data)) {
LOGP(DMNCC, LOGL_ERROR, "gsm_mncc of wrong size %d vs. %zu\n",
@@ -525,6 +526,16 @@
return;
}

+   /* Decode the Global Call Reference (if present) */
+   if (data->fields & MNCC_F_GCR) {
+   if (osmo_dec_gcr(&gcr, data->gcr, sizeof(data->gcr)) < 0) {
+   LOGP(DMNCC, LOGL_ERROR,
+   "MNCC leg(%u) failed to parse GCR\n", 
data->callref);
+   mncc_send(conn, MNCC_REJ_REQ, data->callref);
+   return;
+   }
+   }
+
/* Create an RTP port and then allocate a call */
call = call_mncc_create();
if (!call) {
@@ -543,12 +554,15 @@
leg->conn = conn;
leg->state = MNCC_CC_INITIAL;
leg->dir = MNCC_DIR_MO;
-   leg->base.call->gcr = data->gcr;
-   leg->base.call->gcr_present = true;
memcpy(&leg->called, called, sizeof(leg->called));
memcpy(&leg->calling, &data->calling, sizeof(leg->calling));
memcpy(&leg->imsi, data->imsi, sizeof(leg->imsi));

+   if (data->fields & MNCC_F_GCR) {
+   leg->base.call->gcr_present = true;
+   leg->base.call->gcr = gcr;
+   }
+
LOGP(DMNCC, LOGL_INFO,
"Created call(%u) with MNCC leg(%u) IMSI(%.16s)\n",
call->id, leg->callref, data->imsi);
@@ -873,6 +887,7 @@
 {
struct mncc_call_leg *leg;
struct gsm_mncc mncc = { 0, };
+   struct msgb *msg;
int rc;

leg = talloc_zero(call, struct mncc_call_leg);
@@ -900,8 +915,6 @@

mncc.fields |= MNCC_F_CALLING;
mncc.calling.plan = GSM48_NPI_ISDN_E164;
-   if (call->gcr_present)
-   mncc.gcr = call->gcr;

if (call->source && call->source[0] == '+') {
mncc.calling.type = GSM48_TON_INTERNATIONAL;
@@ -920,6 +933,16 @@
OSMO_STRLCPY_ARRAY(mncc.called.number, call->dest);
}

+   /* Encode the Global Call Reference (if present) */
+   if (call->gcr_present) {
+   msg = msgb_alloc(sizeof(mncc.gcr), "MNCC GCR");
+   if (msg == NULL || (rc = osmo_enc_gcr(msg, &call->gcr)) == 0)
+   LOGP(DMNCC, LOGL_ERROR, "MNCC leg(%u) failed to encode 
GCR\n", call->id);
+   else
+   memcpy(&mncc.gcr, msg->data, rc);
+   msgb_free(msg);
+   }
+
/*
 * TODO/FIXME:
 *  - Determine/request channel based on offered audio codecs
diff --git a/src/mncc_protocol.h b/src/mncc_protocol.h
index 11969ee..cd592ad 100644
--- a/src/mncc_protocol.h
+++ b/src/mncc_protocol.h
@@ -26,7 +26,6 @@
 
 #include 
 #include 
-#include 

 #include 
 #include 
@@ -124,6 +123,7 @@
 #define MNCC_F_CCCAP   0x0800
 #define MNCC_F_KEYPAD  0x1000
 #define MNCC_F_SIGNAL  0x2000
+#define MNCC_F_GCR 0x4000

 struct gsm_mncc {
/* context based information */
@@ -160,7 +160,9 @@

unsigned char   lchan_type;
unsigned char   lchan_mode;
-   struct osmo_gcr_parsed gcr;
+
+   /* Global Call Reference (encoded as per 3GPP TS 29.205) */
+   uint8_t gcr[16];

/* A buffer to contain SDP ('\0' terminated) */
charsdp[1024];

--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/25980
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: Iaff46732948f8f5d03e42f17c35cbac8a80af49b
Gerrit-Change-Number: 25980
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-sip-connector[master]: sip: fix memory leak (x_gcr) in send_invite()

2021-10-27 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/25978 )


Change subject: sip: fix memory leak (x_gcr) in send_invite()
..

sip: fix memory leak (x_gcr) in send_invite()

Change-Id: I6a2e5e15061010f6e62d0f3b0acd2c040dbe3249
Fixes: Id40d7e0fed9356f801b3627c118150055e7232b1
Related: OS#5164
---
M src/sip.c
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/78/25978/1

diff --git a/src/sip.c b/src/sip.c
index 684ef74..0e88716 100644
--- a/src/sip.c
+++ b/src/sip.c
@@ -692,6 +692,7 @@
talloc_free(from);
talloc_free(to);
talloc_free(sdp);
+   talloc_free(x_gcr);
return 0;
 }


--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/25978
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I6a2e5e15061010f6e62d0f3b0acd2c040dbe3249
Gerrit-Change-Number: 25978
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmo-sip-connector[master]: sip: use osmo_{enc, dec}_gcr() from libosmocore

2021-10-27 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/25979 )


Change subject: sip: use osmo_{enc,dec}_gcr() from libosmocore
..

sip: use osmo_{enc,dec}_gcr() from libosmocore

Change-Id: I46fa46fc79494d337f2f4657215b91c39207eea4
Depends: I06babb959fdc82f4e82d92260131d60c98b0abd2
Fixes: Id40d7e0fed9356f801b3627c118150055e7232b1
Related: OS#5164
---
M src/call.h
M src/mncc.c
M src/sip.c
3 files changed, 34 insertions(+), 63 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/79/25979/1

diff --git a/src/call.h b/src/call.h
index 8360711..a835f71 100644
--- a/src/call.h
+++ b/src/call.h
@@ -5,6 +5,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -31,7 +32,10 @@

const char *source;
const char *dest;
+
+   /* Global Call Reference */
struct osmo_gcr_parsed gcr;
+   bool gcr_present;
 };

 enum {
diff --git a/src/mncc.c b/src/mncc.c
index fc99400..c8bf4bd 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -544,6 +544,7 @@
leg->state = MNCC_CC_INITIAL;
leg->dir = MNCC_DIR_MO;
leg->base.call->gcr = data->gcr;
+   leg->base.call->gcr_present = true;
memcpy(&leg->called, called, sizeof(leg->called));
memcpy(&leg->calling, &data->calling, sizeof(leg->calling));
memcpy(&leg->imsi, data->imsi, sizeof(leg->imsi));
@@ -899,7 +900,8 @@

mncc.fields |= MNCC_F_CALLING;
mncc.calling.plan = GSM48_NPI_ISDN_E164;
-   mncc.gcr = call->gcr;
+   if (call->gcr_present)
+   mncc.gcr = call->gcr;

if (call->source && call->source[0] == '+') {
mncc.calling.type = GSM48_TON_INTERNATIONAL;
diff --git a/src/sip.c b/src/sip.c
index 0e88716..9124752 100644
--- a/src/sip.c
+++ b/src/sip.c
@@ -107,34 +107,6 @@
nua_ack(leg->nua_handle, TAG_END());
 }

-int _osmo_dec_gcr(struct osmo_gcr_parsed *gcr, const uint8_t *elem, uint8_t 
len)
-{
-   uint16_t parsed = 1; /* account for length byte right away */
-
-   if (len < 13)
-   return -EBADMSG;
-
-   gcr->net_len = elem[0];
-   if (gcr->net_len < 3 || gcr->net_len > 5)
-   return -EINVAL;
-
-   memcpy(gcr->net, elem + parsed, gcr->net_len);
-   /* +1 for ignored Node ID length field */
-   parsed += (gcr->net_len + 1);
-
-   gcr->node = osmo_load16be(elem + parsed);
-   parsed += 2;
-
-   if (elem[parsed] != 5) /* see Table B 2.1.9.2 */
-   return -ENOENT;
-
-   parsed++;
-
-   memcpy(gcr->cr, elem + parsed, 5);
-
-   return parsed + 5;
-}
-
 static void new_call(struct sip_agent *agent, nua_handle_t *nh,
const sip_t *sip)
 {
@@ -142,15 +114,16 @@
struct sip_call_leg *leg;
const char *from = NULL, *to = NULL;
char ip_addr[INET6_ADDRSTRLEN];
-   uint8_t gcr_back[28] = { 0 };
-
+   bool xgcr_hdr_present = false;
+   uint8_t xgcr_hdr[28] = { 0 };

LOGP(DSIP, LOGL_INFO, "Incoming call(%s) handle(%p)\n", 
sip->sip_call_id->i_id, nh);

sip_unknown_t *unknown_header = sip->sip_unknown;
while (unknown_header != NULL) {
if (!strcmp("X-Global-Call-Ref", unknown_header->un_name)) {
-   osmo_hexparse(unknown_header->un_value, gcr_back, 
sizeof(gcr_back));
+   osmo_hexparse(unknown_header->un_value, xgcr_hdr, 
sizeof(xgcr_hdr));
+   xgcr_hdr_present = true;
break;
}
unknown_header = unknown_header->un_next;
@@ -171,7 +144,16 @@
return;
}

-   _osmo_dec_gcr(&call->gcr, gcr_back, sizeof(gcr_back));
+   /* Decode Decode the Global Call Reference (if present) */
+   if (xgcr_hdr_present) {
+   if (osmo_dec_gcr(&call->gcr, xgcr_hdr, sizeof(xgcr_hdr)) < 0) {
+   LOGP(DSIP, LOGL_ERROR, "Failed to parse 
X-Global-Call-Ref.\n");
+   nua_respond(nh, SIP_406_NOT_ACCEPTABLE, TAG_END());
+   nua_handle_destroy(nh);
+   return;
+   }
+   call->gcr_present = true;
+   }

if (sip->sip_to)
to = sip->sip_to->a_url->url_user;
@@ -632,38 +614,10 @@
leg->state = SIP_CC_CONNECTED;
 }

-/*! Encode Global Call Reference. */
-uint8_t _osmo_enc_gcr(uint8_t *buf, const struct osmo_gcr_parsed *g)
-{
-   uint8_t tmp[2];
-
-   if (!g)
-   return 0;
-
-   if (g->net_len < 3 || g->net_len > 5)
-   return 0;
-
-   buf = lv_put(buf, g->net_len, g->net);
-   osmo_store16be(g->node, &tmp);
-   buf = lv_put(buf, 2, tmp);
-   buf = lv_put(buf, 5, g->cr);
-
-   /* Length: LV(Net) + LV(Node) + LV(CRef) - see 3GPP TS §3.2.2.115 */
-   return (g->net_len + 1) + (2 + 1) + (5 + 1);
-}
-
 sta

Change in osmo-bsc[master]: bsc_ctrl_commands: add ctrl command to resend system information

2021-10-27 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25829 )

Change subject: bsc_ctrl_commands: add ctrl command to resend system information
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/25829/2/src/osmo-bsc/bsc_ctrl_commands.c
File src/osmo-bsc/bsc_ctrl_commands.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25829/2/src/osmo-bsc/bsc_ctrl_commands.c@670
PS2, Line 670: static int get_bts_resend_si(struct ctrl_cmd *cmd, void *data)
> Don't you need to fill some sort of response value somehwere? I'd expect 
> lower layers in the protoco […]
I think yes, but it worked without - probably there was a warning in the log 
text though.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25829
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id628fc6f0771de67f60cbc96b631000b04c765f4
Gerrit-Change-Number: 25829
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 13:34:56 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in osmo-bts[master]: scheduler: Avoid crash upon call to trx_sched_set_lchan if l1ts is un...

2021-10-27 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/25966 )

Change subject: scheduler: Avoid crash upon call to trx_sched_set_lchan if l1ts 
is uninitialized
..

scheduler: Avoid crash upon call to trx_sched_set_lchan if l1ts is uninitialized

It could happen if for instance l1 code called trx_sched_clean() when
closing the phy, and after that some code called (erroneously)
trx_sched_set_lchan(). Let's make sure we don't allow other modules to
crash the process when using this function.

Related: SYS#4971
Change-Id: I93af7c3dcf0e34e9317eec0ee183dbf18b8d2f3b
---
M src/common/scheduler.c
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index c068ea0..0388445 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -1085,6 +1085,12 @@
bool found = false;
int i;

+   if (!l1ts) {
+   LOGPLCHAN(lchan, DL1C, LOGL_ERROR, "%s lchan with uninitialized 
scheduler structure\n",
+ (active) ? "Activating" : "Deactivating");
+   return -EINVAL;
+   }
+
/* VAMOS: convert Osmocom specific channel number to a generic one,
 * otherwise we won't match anything in trx_chan_desc[]. */
if (lchan->ts->vamos.is_shadow)

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25966
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I93af7c3dcf0e34e9317eec0ee183dbf18b8d2f3b
Gerrit-Change-Number: 25966
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-CC: daniel 
Gerrit-MessageType: merged


Change in osmo-bts[master]: l1sap: Avoid re-(de)activating already (de)active lchans

2021-10-27 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/25965 )

Change subject: l1sap: Avoid re-(de)activating already (de)active lchans
..

l1sap: Avoid re-(de)activating already (de)active lchans

This avoids triggering all sorts of unexpected paths where one tries to
release an already released lchan, etc.
This can happen for instance if BTS shuts down due to BSC link going
down, and hence resets all lchans, announcing it to the PCU. Then the
PCU may try to deactivate the channel sending act_req (disable), but the
BTS already unilaterally dropped the channels.
That code path seems to trigger some crash, probably because something
in lchan has been freed.

Related: SYS#4971
Change-Id: I093e4d4e23b527b10bf5d6ff538460626c30a8f8
---
M src/common/l1sap.c
1 file changed, 13 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  daniel: Looks good to me, approved



diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index c89b2c3..f1d1575 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1961,6 +1961,12 @@
struct gsm_lchan *lchan = get_lchan_by_chan_nr(trx, chan_nr);
int rc;

+   if (lchan->state == LCHAN_S_ACTIVE) {
+   LOGPLCHAN(lchan, DL1C, LOGL_ERROR, "Trying to activate already 
active channel %s\n",
+ rsl_chan_nr_str(chan_nr));
+   return -1;
+   }
+
LOGPLCHAN(lchan, DL1C, LOGL_INFO, "Activating channel %s\n", 
rsl_chan_nr_str(chan_nr));

lchan->s = trx->bts->radio_link_timeout.current;
@@ -1994,6 +2000,13 @@
 int l1sap_chan_rel(struct gsm_bts_trx *trx, uint8_t chan_nr)
 {
struct gsm_lchan *lchan = get_lchan_by_chan_nr(trx, chan_nr);
+
+   if (lchan->state == LCHAN_S_NONE) {
+   LOGPLCHAN(lchan, DL1C, LOGL_ERROR, "Trying to deactivate 
already deactivated channel %s\n",
+ rsl_chan_nr_str(chan_nr));
+   return -1;
+   }
+
LOGPLCHAN(lchan, DL1C, LOGL_INFO, "Deactivating channel %s\n",
  rsl_chan_nr_str(chan_nr));


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25965
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I093e4d4e23b527b10bf5d6ff538460626c30a8f8
Gerrit-Change-Number: 25965
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-iuh[master]: src/*/Makefile.am: Use asn1c -R to avoid generating runtime code

2021-10-27 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25959 )

Change subject: src/*/Makefile.am: Use asn1c -R to avoid generating runtime code
..

src/*/Makefile.am: Use asn1c -R to avoid generating runtime code

Change-Id: I5666a6dc1ec9e56fe133642fb0054e913265c081
---
M src/hnbap/Makefile.am
M src/ranap/Makefile.am
M src/rua/Makefile.am
M src/sabp/Makefile.am
4 files changed, 5 insertions(+), 13 deletions(-)

Approvals:
  pespin: Looks good to me, approved; Verified
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve



diff --git a/src/hnbap/Makefile.am b/src/hnbap/Makefile.am
index 7835bcd..79c0ac4 100644
--- a/src/hnbap/Makefile.am
+++ b/src/hnbap/Makefile.am
@@ -243,9 +243,7 @@
 regen: regenerate-from-asn1-source

 regenerate-from-asn1-source:
-   asn1c -gen-PER -fnative-types $(HNBAP_ASN1)/HNBAP-CommonDataTypes.asn 
$(HNBAP_ASN1)/HNBAP-Constants.asn $(HNBAP_ASN1)/HNBAP-IEs.asn 
$(HNBAP_ASN1)/HNBAP-PDU.asn
-#  remove the local copy of the runtime code
-   -rm ANY.* BOOLEAN.* INTEGER.* NativeEnumerated.* NativeInteger.* 
OBJECT_IDENTIFIER.* asn_* OCTET_STRING.* converter-sample.c per_* xer_* constr* 
der_* ber_* BIT_STRING.*
+   asn1c -R -gen-PER -fnative-types 
$(HNBAP_ASN1)/HNBAP-CommonDataTypes.asn $(HNBAP_ASN1)/HNBAP-Constants.asn 
$(HNBAP_ASN1)/HNBAP-IEs.asn $(HNBAP_ASN1)/HNBAP-PDU.asn
 #  change include style to `#include '
$(top_srcdir)/move-asn1-header-files.sh osmocom/hnbap $(ASN_MODULE_INC)
 #  Finally copy *.c from buildir to srcdir:
diff --git a/src/ranap/Makefile.am b/src/ranap/Makefile.am
index 4ba3a79..d5dc4fc 100644
--- a/src/ranap/Makefile.am
+++ b/src/ranap/Makefile.am
@@ -1169,10 +1169,8 @@
 regen: regenerate-from-asn1-source

 regenerate-from-asn1-source:
-   ASN1C_PREFIX="RANAP_" asn1c -gen-PER 
$(top_srcdir)/asn1/ranap/RANAP-CommonDataTypes.asn 
$(top_srcdir)/asn1/ranap/RANAP-Constants.asn 
$(top_srcdir)/asn1/ranap/RANAP-IEs.asn $(top_srcdir)/asn1/ranap/RANAP-PDU.asn
-   @rm ANY.* BOOLEAN.* INTEGER.* NativeEnumerated.* NativeInteger.* NULL.* 
OBJECT_IDENTIFIER.* asn_* OCTET_STRING.* converter-sample.c per_* xer_* constr* 
der_* ber_* BIT_STRING.*
-#  some fixups in erroneous code that asn1c generates
-   sed -i '6i#include ' RANAP_ChosenEncryptionAlgorithm.h 
RANAP_ChosenIntegrityProtectionAlgorithm.h RANAP_IMSI.h RANAP_PLMNidentity.h 
RANAP_RAB-ReleaseFailedList.c RANAP_RAB-ReleaseList.c 
RANAP_RAB-SetupOrModifyList.c RANAP_ResetResourceList.c 
RANAP_ResetResourceAckList.c
+   ASN1C_PREFIX="RANAP_" asn1c -R -gen-PER 
$(top_srcdir)/asn1/ranap/RANAP-CommonDataTypes.asn 
$(top_srcdir)/asn1/ranap/RANAP-Constants.asn 
$(top_srcdir)/asn1/ranap/RANAP-IEs.asn $(top_srcdir)/asn1/ranap/RANAP-PDU.asn
+   sed -i '7i#include ' RANAP_ChosenEncryptionAlgorithm.h 
RANAP_ChosenIntegrityProtectionAlgorithm.h RANAP_IMSI.h RANAP_PLMNidentity.h 
RANAP_RAB-ReleaseFailedList.c RANAP_RAB-ReleaseList.c 
RANAP_RAB-SetupOrModifyList.c RANAP_ResetResourceList.c 
RANAP_ResetResourceAckList.c
sed -i 's/Member/MemberA/' RANAP_LA-LIST.[ch]
sed -i 's/Member/MemberB/' RANAP_RABParametersList.[ch]
sed -i 's/Member/MemberC/' RANAP_AuthorisedPLMNs.[ch]
diff --git a/src/rua/Makefile.am b/src/rua/Makefile.am
index c848639..493a466 100644
--- a/src/rua/Makefile.am
+++ b/src/rua/Makefile.am
@@ -81,9 +81,7 @@
 regen: regenerate-from-asn1-source

 regenerate-from-asn1-source:
-   ASN1C_PREFIX="RUA_" asn1c -gen-PER 
$(top_srcdir)/asn1/rua/RUA-CommonDataTypes.asn 
$(top_srcdir)/asn1/rua/RUA-Constants.asn $(top_srcdir)/asn1/rua/RUA-IEs.asn 
$(top_srcdir)/asn1/rua/RUA-PDU.asn
-#  remove the local copy of the runtime code
-   @rm ANY.* BOOLEAN.* INTEGER.* NativeEnumerated.* NativeInteger.* 
OBJECT_IDENTIFIER.* asn_* OCTET_STRING.* converter-sample.c per_* xer_* constr* 
der_* ber_* BIT_STRING.*
+   ASN1C_PREFIX="RUA_" asn1c -R -gen-PER 
$(top_srcdir)/asn1/rua/RUA-CommonDataTypes.asn 
$(top_srcdir)/asn1/rua/RUA-Constants.asn $(top_srcdir)/asn1/rua/RUA-IEs.asn 
$(top_srcdir)/asn1/rua/RUA-PDU.asn
 #  change include style to `#include '
$(top_srcdir)/move-asn1-header-files.sh osmocom/rua $(ASN_MODULE_INC)
 #  Finally copy *.c from buildir to srcdir:
diff --git a/src/sabp/Makefile.am b/src/sabp/Makefile.am
index 5e1b557..faace13 100644
--- a/src/sabp/Makefile.am
+++ b/src/sabp/Makefile.am
@@ -135,9 +135,7 @@
 regen: regenerate-from-asn1-source

 regenerate-from-asn1-source:
-   ASN1C_PREFIX="SABP_" asn1c -gen-PER 
$(top_srcdir)/asn1/sabp/SABP-CommonDataTypes.asn 
$(top_srcdir)/asn1/sabp/SABP-Constants.asn $(top_srcdir)/asn1/sabp/SABP-IEs.asn 
$(top_srcdir)/asn1/sabp/SABP-PDU.asn
-#  remove the local copy of the runtime code
-   @rm ANY.* INTEGER.* NativeEnumerated.* NativeInteger.* asn_* 
OCTET_STRING.* converter-sample.c per_* xer_* constr* der_* ber_* B

Change in osmo-iuh[master]: Update generated .c/.h after using asn1c -R param

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25960 )

Change subject: Update generated .c/.h after using asn1c -R param
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25960
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: Ib7a03973d43828f47ff59b561d9ddce43186f8af
Gerrit-Change-Number: 25960
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:58:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-iuh[master]: src/*/Makefile.am: Use asn1c -R to avoid generating runtime code

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25959 )

Change subject: src/*/Makefile.am: Use asn1c -R to avoid generating runtime code
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25959
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I5666a6dc1ec9e56fe133642fb0054e913265c081
Gerrit-Change-Number: 25959
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:57:26 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bsc_ctrl_commands: add ctrl command to resend system information

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25829 )

Change subject: bsc_ctrl_commands: add ctrl command to resend system information
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bsc/+/25829/2/src/osmo-bsc/bsc_ctrl_commands.c
File src/osmo-bsc/bsc_ctrl_commands.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25829/2/src/osmo-bsc/bsc_ctrl_commands.c@670
PS2, Line 670: static int get_bts_resend_si(struct ctrl_cmd *cmd, void *data)
Don't you need to fill some sort of response value somehwere? I'd expect lower 
layers in the protocol to have to submit something back in GET responses.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25829
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id628fc6f0771de67f60cbc96b631000b04c765f4
Gerrit-Change-Number: 25829
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:56:37 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bsc_ctrl_commands: add ctrl command to resend system information

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25829 )

Change subject: bsc_ctrl_commands: add ctrl command to resend system information
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25829
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id628fc6f0771de67f60cbc96b631000b04c765f4
Gerrit-Change-Number: 25829
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:55:41 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: scheduler: Avoid crash upon call to trx_sched_set_lchan if l1ts is un...

2021-10-27 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/25966 )

Change subject: scheduler: Avoid crash upon call to trx_sched_set_lchan if l1ts 
is uninitialized
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/c/osmo-bts/+/25966/3/src/common/scheduler.c
File src/common/scheduler.c:

https://gerrit.osmocom.org/c/osmo-bts/+/25966/3/src/common/scheduler.c@1089
PS3, Line 1089: LOGPLCHAN(lchan, DL1C, LOGL_ERROR, "%s lchan 
with uninitialized scheduler structure\n",
Add "Not " before the string so the message is more clear?



--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25966
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I93af7c3dcf0e34e9317eec0ee183dbf18b8d2f3b
Gerrit-Change-Number: 25966
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: daniel 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:55:04 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: neighbor_ident: add comment about Neighbor Address Resolution Service

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25977 )

Change subject: neighbor_ident: add comment about Neighbor Address Resolution 
Service
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25977
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iec86f72548bfc54a2c86dadec69dd1c64813d852
Gerrit-Change-Number: 25977
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:54:25 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: BTS_Tests: add TC_meas_res_speech_{tchf, tchh}_sapi3()

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25968 )

Change subject: BTS_Tests: add TC_meas_res_speech_{tchf,tchh}_sapi3()
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25968
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I7d17d6e5f413f2de78db944f23ad731b81ad24cf
Gerrit-Change-Number: 25968
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:53:59 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bts[master]: l1sap: Avoid re-(de)activating already (de)active lchans

2021-10-27 Thread daniel
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/25965 )

Change subject: l1sap: Avoid re-(de)activating already (de)active lchans
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/25965
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I093e4d4e23b527b10bf5d6ff538460626c30a8f8
Gerrit-Change-Number: 25965
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:52:55 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: refactor lchan counting

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25972 )

Change subject: refactor lchan counting
..


Patch Set 1: Code-Review-1

(8 comments)

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/include/osmocom/bsc/gsm_data.h
File include/osmocom/bsc/gsm_data.h:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/include/osmocom/bsc/gsm_data.h@1439
PS1, Line 1439: CHAN_COUNTS2_N
is this simply to flag the end? please document so, since it's a bit confusing 
as this is an enum enumerating types of counting ;)


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/include/osmocom/bsc/gsm_data.h@1442
PS1, Line 1442: extern const struct value_string chan_count2_strs[];
Lots of new infra, sounds like all this can be moved to a new header file.


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/abis_rsl.c
File src/osmo-bsc/abis_rsl.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/abis_rsl.c@1961
PS1, Line 1961: chan_counts_t bts_counts;
we don't tend to use *_t types in osmocom (see kernel programming style guide). 
If it's a struct, describe it as a struct.


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/abis_rsl.c@1974
PS1, Line 1974: free_tchf = 
bts_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_FREE][GSM_LCHAN_TCH_F];
I'd rather prefer getters here, this way the array can be kept internal to its 
own module and no need for other modules to know how counting ocurrs.
Moreover, some comment here describing what you fetch here with all those enums 
is welcome.


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/bts.c
File src/osmo-bsc/bts.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/bts.c@728
PS1, Line 728:  chan_counts_t trx_counts;
same, no *_t types, only for basic type typedefs.


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/bts_trx.c
File src/osmo-bsc/bts_trx.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/bts_trx.c@327
PS1, Line 327: void trx_count_lchans(chan_counts_t ret, const struct 
gsm_bts_trx *trx)
All this could go into a new counts.c file, to have all this logic in one 
place. Alternatively, pass trx as first param as in object-oriented, since also 
the function starts with trx_*


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/gsm_data.c
File src/osmo-bsc/gsm_data.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/gsm_data.c@650
PS1, Line 650:  * TODO: include possible VAMOS secondary lchans? */
what about this TODO?


https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/handover_decision_2.c
File src/osmo-bsc/handover_decision_2.c:

https://gerrit.osmocom.org/c/osmo-bsc/+/25972/1/src/osmo-bsc/handover_decision_2.c@997
PS1, Line 997:  c->current.free_tchf = 
bts_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_FREE][GSM_LCHAN_TCH_F];
same, use getters (be it static inline or whatever)



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25972
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2fb48c549186db812b1e9d6b735a92e80f27b8d3
Gerrit-Change-Number: 25972
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:39:10 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: bsc: add TC_ratectr_all_available_allocated and _dyn

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25969 )

Change subject: bsc: add TC_ratectr_all_available_allocated and _dyn
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25969
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib3997a827c9cc43d1361bb0cf3bfab9f6d91bf82
Gerrit-Change-Number: 25969
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:23:41 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: constify lchan_state_is()

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25971 )

Change subject: constify lchan_state_is()
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25971
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I523cbf04e77f43924c3f09094d56f815d3de640d
Gerrit-Change-Number: 25971
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:20:42 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: bsc: Introduce test TC_dyn_ts_sdcch8_all_subslots_used

2021-10-27 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25938 )

Change subject: bsc: Introduce test TC_dyn_ts_sdcch8_all_subslots_used
..

bsc: Introduce test TC_dyn_ts_sdcch8_all_subslots_used

Related: OS#5278
Related: SYS#5309
Change-Id: Iee37eef2012ce2c2e2f0a0db4c26abb75a947d84
---
M bsc/BSC_Tests.ttcn
1 file changed, 79 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index cebd634..ee4dac2 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1672,6 +1672,37 @@
return dt;
 }

+/* Like f_est_dchan(), but for the first lchan of a dynamic timeslot: first 
ACK the deactivation of PDCH. */
+function f_est_dchan_dyn(OCT1 ra, GsmFrameNumber fn, octetstring l3)
+runs on test_CT return DchanTuple {
+   var BSSAP_N_CONNECT_ind rx_c_ind;
+   var DchanTuple dt;
+
+   /* Send CHAN RQD */
+   var RSL_Message rx_rsl;
+   f_ipa_tx(0, ts_RSL_CHAN_RQD(ra, fn));
+
+   /* The dyn TS first deactivates PDCH */
+   rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), 
T3101_MAX);
+   dt.rsl_chan_nr := rx_rsl.ies[0].body.chan_nr;
+   f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr));
+
+   rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
+   dt.rsl_chan_nr := rx_rsl.ies[0].body.chan_nr;
+
+   /* Now activates the signalling channel */
+   f_ipa_tx(0, ts_RSL_CHAN_ACT_ACK(dt.rsl_chan_nr, fn+10));
+   rx_rsl := f_exp_ipa_rx(0, tr_RSL_IMM_ASSIGN(0));
+
+   f_ipa_tx(0, ts_RSL_EST_IND(dt.rsl_chan_nr, 
valueof(ts_RslLinkID_DCCH(0)), l3));
+
+   BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))) -> 
value rx_c_ind;
+   dt.sccp_conn_id := rx_c_ind.connectionId;
+   BSSAP.send(ts_BSSAP_CONNECT_res(dt.sccp_conn_id));
+
+   return dt;
+}
+
 /* expect RF CAN REL from BTS, acknowledge it and clear the MSC side */
 private function f_exp_chan_rel_and_clear(DchanTuple dt, integer bts_nr := 0) 
runs on test_CT {
var RSL_Message rx_rsl;
@@ -7241,6 +7272,53 @@
f_shutdown_helper();
 }

+/* Validate all 8 subslots of a dynamics TS configured as SDCCH8 are used */
+testcase TC_dyn_ts_sdcch8_all_subslots_used() runs on test_CT {
+   var ASP_RSL_Unitdata rsl_ud;
+   var integer i;
+   var integer chreq_total, chreq_nochan;
+
+   f_init_vty();
+   for (i := 1; i < 8; i := i + 1) {
+   if (i == 2) {
+   f_ts_set_chcomb(0, 0, i, "TCH/F_TCH/H_SDCCH8_PDCH");
+   } else {
+   f_ts_set_chcomb(0, 0, i, "PDCH");
+   }
+   }
+   f_vty_transceive(BSCVTY, "drop bts connection 0 oml");
+
+   f_init(1);
+
+   /* The dyn TS want to activate PDCH mode, ACK that. */
+   var RslChannelNr chan_nr;
+   chan_nr := valueof(t_RslChanNr_PDCH(2));
+   f_exp_ipa_rx(0, tr_RSL_CHAN_ACT_PDCH(chan_nr, ?));
+   f_ipa_tx(0, ts_RSL_CHAN_ACT_ACK(chan_nr, 2342));
+
+   f_sleep(1.0);
+
+   /* Exhaust all dedicated SDCCH lchans.
+   /* GSM 44.018 Table 9.1.8.2:
+* RA = '13'O -> Establishment cause = 0001 (MS dual rate capable 
and asks for "SDCCH").
+*/
+   for (i := 0; i < NUM_SDCCH_PER_BTS; i := i+1) {
+   f_est_dchan('13'O, NUM_SDCCH_PER_BTS + i, '00010203040506'O);
+   }
+
+   /* Only the dyn TS is still available. Its first lchan gets converted 
to SDCCH8 */
+   f_est_dchan_dyn('33'O, NUM_SDCCH_PER_BTS + i, '00010203040506'O);
+   /* Also occupy the seven other SDCCH of the dyn TS */
+   for (i := 0; i < 7; i := i+1) {
+   f_est_dchan('33'O, NUM_SDCCH_PER_BTS + i, '00010203040506'O);
+   }
+
+   /* clean up config */
+   f_ts_reset_chcomb(0);
+
+   f_shutdown_helper();
+}
+
 /* Test Osmocom dyn TS SDCCH8 activation / deactivation: If activating dyn TS 
as
SDCCH8 would end up in having no free TCH, then BSC should decide to 
activate
it as TCH directly instead. SYS#5309. */
@@ -10517,6 +10595,7 @@
execute( TC_dyn_pdch_osmo_act_nack() );
if (mp_enable_dyn_sdcch8_test) {
execute( TC_dyn_ts_sdcch8_act_deact() );
+   execute( TC_dyn_ts_sdcch8_all_subslots_used() );
execute( TC_dyn_ts_sdcch8_tch_call_act_deact() );
execute( TC_dyn_ts_sdcch8_act_nack() );
}

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25938
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iee37eef2012ce2c2e2f0a0db4c26abb75a947d84
Gerrit-Change-Number: 25938
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit

Change in osmo-ttcn3-hacks[master]: bsc: Introduce test TC_dyn_ts_sdcch8_all_subslots_used

2021-10-27 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25938 )

Change subject: bsc: Introduce test TC_dyn_ts_sdcch8_all_subslots_used
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/25938
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Iee37eef2012ce2c2e2f0a0db4c26abb75a947d84
Gerrit-Change-Number: 25938
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:20:16 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-iuh[master]: src/*/Makefile.am: Use asn1c -R to avoid generating runtime code

2021-10-27 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/25959 )

Change subject: src/*/Makefile.am: Use asn1c -R to avoid generating runtime code
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/25959
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I5666a6dc1ec9e56fe133642fb0054e913265c081
Gerrit-Change-Number: 25959
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:13:13 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-cbc[master]: varaible for atoi() result shouild be signed integer

2021-10-27 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-cbc/+/25931 )

Change subject: varaible for atoi() result shouild be signed integer
..

varaible for atoi() result shouild be signed integer

... otherwise we won't detect < 0 cases.

Fixes: CID#240731
Change-Id: I650fce5bd64752823ee57d8b528d2b371fada857
---
M src/rest_api.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/rest_api.c b/src/rest_api.c
index c70d096..52bf25e 100644
--- a/src/rest_api.c
+++ b/src/rest_api.c
@@ -602,7 +602,7 @@
 {
const char *message_id_str = u_map_get(req->map_url, "message_id");
struct rest_it_op *riop = talloc_zero(g_cbc, struct rest_it_op);
-   uint16_t message_id;
+   int message_id;
int status = 404;
int rc;


--
To view, visit https://gerrit.osmocom.org/c/osmo-cbc/+/25931
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: I650fce5bd64752823ee57d8b528d2b371fada857
Gerrit-Change-Number: 25931
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: fixeria 
Gerrit-MessageType: merged


Change in osmo-cbc[master]: varaible for atoi() result shouild be signed integer

2021-10-27 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-cbc/+/25931 )

Change subject: varaible for atoi() result shouild be signed integer
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-cbc/+/25931
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: I650fce5bd64752823ee57d8b528d2b371fada857
Gerrit-Change-Number: 25931
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: fixeria 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:12:32 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bsc_ctrl_commands: add ctrl command to resend system information

2021-10-27 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25829 )

Change subject: bsc_ctrl_commands: add ctrl command to resend system information
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25829
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id628fc6f0771de67f60cbc96b631000b04c765f4
Gerrit-Change-Number: 25829
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:11:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in simtrace2[master]: add initial testing scripts for a hw-driven ci - flash every image an...

2021-10-27 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/simtrace2/+/25967 )

Change subject: add initial testing scripts for a hw-driven ci - flash every 
image and test
..


Patch Set 1:

some general comments:

1) occupying all of "test" might be a bit over-raching as we may very well have 
other tests at some point, so maybe a sub-directory like tests/firmware-fash-ci 
or whatever name you can come up with makes more sense

2) matching on all of the detailed stdout of the various programs of course 
introduces a lot of dependency on very specific versions of all the host OS 
utilities.  This will likely require a lot of updtes when we do an OS upgrae

3) sniffing the ATR alone is not sufficient, as the ATR is always transmitted 
at an exceptionally slow speed.   We should definitely have some kind of simple 
APDU exchange afterwards. At the very least something like "00a40904023f00" 
(SELECT MF) should be done.  This then happens after PPS and hence at a higher 
speed [if cards supporting higher speeds are used, like sysmoUSIM/ISIM and not 
some magic sim that only does 9600 bps].


--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/25967
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I88bc32334f23e6fd702e0cbcb1b1510029909b20
Gerrit-Change-Number: 25967
Gerrit-PatchSet: 1
Gerrit-Owner: roh 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:10:29 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in libosmocore[master]: logging: Attempt a synchronous, non-blocking write first (file, stderr)

2021-10-27 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/20317 )

Change subject: logging: Attempt a synchronous, non-blocking write first (file, 
stderr)
..

logging: Attempt a synchronous, non-blocking write first (file, stderr)

In the old days, we performed synchronous, blocking writes to the log
file or stderr.  This was replaced by code that turned all log
file/stderr writes into non-blocking writes behind a write_queue.

This patch now introduces a further optimization: If we currently
don't have any log messages pending in the write queue, we are not
back-logged and assume we have a fair chance of writing the log message
right now, synchronously.  So we try that first, and only enqueue
the log message if the write fails (no bytes or insufficient number
of bytes written).

This way we should get the best of both worlds: No delay/re-ordering
(and lower select syscall load) for the "normal" case (benefits of
the old synchronous writes) while at the same time never risking to
block on log output.

Related: OS#4311
Change-Id: I08469a7e4be9bc5bbd39140457bb582f4a0b1703
---
M src/logging.c
1 file changed, 30 insertions(+), 17 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve



diff --git a/src/logging.c b/src/logging.c
index 087a271..00d75c3 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -937,6 +937,24 @@
 }

 #if (!EMBEDDED)
+/* write-queue tells us we should write another msgb (log line) to the output 
fd */
+static int _file_wq_write_cb(struct osmo_fd *ofd, struct msgb *msg)
+{
+   int rc;
+
+   rc = write(ofd->fd, msgb_data(msg), msgb_length(msg));
+   if (rc < 0)
+   return rc;
+   if (rc != msgb_length(msg)) {
+   /* pull the number of bytes we have already written */
+   msgb_pull(msg, rc);
+   /* ask write_queue to re-insert the msgb at the head of the 
queue */
+   return -EAGAIN;
+   }
+   return 0;
+}
+
+/* output via buffered, blocking stdio streams */
 static void _file_output_stream(struct log_target *target, unsigned int level,
 const char *log)
 {
@@ -962,6 +980,18 @@
 * and call _file_wq_write_cb() */
rc = _output_buf((char *)msgb_data(msg), msgb_tailroom(msg), target, 
subsys, level, file, line, cont, format, ap);
msgb_put(msg, rc);
+
+   /* attempt a synchronous, non-blocking write, if the write queue is 
empty */
+   if (target->tgt_file.wqueue->current_length == 0) {
+   rc = _file_wq_write_cb(&target->tgt_file.wqueue->bfd, msg);
+   if (rc == 0) {
+   /* the write was complete, we can exit early */
+   msgb_free(msg);
+   return;
+   }
+   }
+   /* if we reach here, either we already had elements in the write_queue, 
or the synchronous write
+* failed: enqueue the message to the write_queue (backlog) */
osmo_wqueue_enqueue_quiet(target->tgt_file.wqueue, msg);
 }
 #endif
@@ -1034,23 +1064,6 @@
 }

 #if (!EMBEDDED)
-/* write-queue tells us we should write another msgb (log line) to the output 
fd */
-static int _file_wq_write_cb(struct osmo_fd *ofd, struct msgb *msg)
-{
-   int rc;
-
-   rc = write(ofd->fd, msgb_data(msg), msgb_length(msg));
-   if (rc < 0)
-   return rc;
-   if (rc != msgb_length(msg)) {
-   /* pull the number of bytes we have already written */
-   msgb_pull(msg, rc);
-   /* ask write_queue to re-insert the msgb at the head of the 
queue */
-   return -EAGAIN;
-   }
-   return 0;
-}
-
 /*! Create a new file-based log target using buffered, blocking stream output
  *  \param[in] fname File name of the new log file
  *  \returns Log target in case of success, NULL otherwise

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/20317
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I08469a7e4be9bc5bbd39140457bb582f4a0b1703
Gerrit-Change-Number: 20317
Gerrit-PatchSet: 11
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in libosmocore[master]: logging: Avoid memcpy from stack to msgb in _file_output()

2021-10-27 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/20305 )

Change subject: logging: Avoid memcpy from stack to msgb in _file_output()
..

logging: Avoid memcpy from stack to msgb in _file_output()

For file and stderr output, the existing code always generates
the log string on a stack buffer, and then (in case of non-blocking
write via write_queue) copies it over to a msgb.

Let's optimize this by turning _file_output() into a raw_output
callback which first allocates the msgb and then format-prints
directly to that msgb instaed of stack + memcpy.

This has the disadvantage that we don't know how long the buffer
has to be in order to print the entire string to it.  As a result
we always have to allocate a 4k-sized buffer (plus msgb overhead).

The write_queue length for log file output has been decreased from
1024 entries to 156 entries in order to stay within the same
memory requirements for each log target memory pool (about 648 kBytes).

Related: OS#4311
Change-Id: I0d10b0199576d2e7ff6421a6dba19ae5ffafd946
---
M src/logging.c
1 file changed, 43 insertions(+), 18 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve



diff --git a/src/logging.c b/src/logging.c
index 5c6b993..087a271 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -78,7 +78,7 @@
 #define MAX_LOG_SIZE   4096

 /* maximum number of log statements we queue in file/stderr target write queue 
*/
-#define LOG_WQUEUE_LEN 1024
+#define LOG_WQUEUE_LEN 156

 osmo_static_assert(_LOG_CTX_COUNT <= ARRAY_SIZE(((struct 
log_context*)NULL)->ctx),
   enum_logging_ctx_items_fit_in_struct_log_context);
@@ -449,12 +449,23 @@
return bn + 1;
 }

-static void _output(struct log_target *target, unsigned int subsys,
-   unsigned int level, const char *file, int line, int cont,
-   const char *format, va_list ap)
+/*! main output formatting function for log lines.
+ *  \param[out] buf caller-allocated output buffer for the generated string
+ *  \param[in] buf_len number of bytes available in buf
+ *  \param[in] target log target for which the string is to be formatted
+ *  \param[in] subsys Log sub-system number
+ *  \param[in] level Log level
+ *  \param[in] file name of source code file generating the log
+ *  \param[in] line line source code line number within 'file' generating the 
log
+ *  \param[in] cont is this a continuation (true) or not (false)
+ *  \param[in] format format string
+ *  \param[in] ap variable argument list for format
+ *  \returns number of bytes written to out */
+static int _output_buf(char *buf, int buf_len, struct log_target *target, 
unsigned int subsys,
+   unsigned int level, const char *file, int line, int 
cont,
+   const char *format, va_list ap)
 {
-   char buf[MAX_LOG_SIZE];
-   int ret, len = 0, offset = 0, rem = sizeof(buf);
+   int ret, len = 0, offset = 0, rem = buf_len;
const char *c_subsys = NULL;

/* are we using color */
@@ -588,8 +599,21 @@
OSMO_SNPRINTF_RET(ret, rem, offset, len);
}
 err:
-   buf[sizeof(buf)-1] = '\0';
-   target->output(target, level, buf);
+   buf[buf_len-1] = '\0';
+   return len;
+}
+
+/* Format the log line for given target; use a stack buffer and call 
target->output */
+static void _output(struct log_target *target, unsigned int subsys,
+   unsigned int level, const char *file, int line, int cont,
+   const char *format, va_list ap)
+{
+   char buf[MAX_LOG_SIZE];
+   int rc;
+
+   rc = _output_buf(buf, sizeof(buf), target, subsys, level, file, line, 
cont, format, ap);
+   if (rc > 0)
+   target->output(target, level, buf);
 }

 /* Catch internal logging category indexes as well as out-of-bounds indexes.
@@ -922,22 +946,22 @@
 }

 /* output via non-blocking write_queue, doing internal buffering */
-static void _file_output(struct log_target *target, unsigned int level,
-const char *log)
+static void _file_raw_output(struct log_target *target, int subsys, unsigned 
int level, const char *file,
+int line, int cont, const char *format, va_list ap)
 {
-   int len = strlen(log);
struct msgb *msg;
+   int rc;

OSMO_ASSERT(target->tgt_file.wqueue);
-   msg = msgb_alloc_c(target->tgt_file.wqueue, len, "log_file_msg");
+   msg = msgb_alloc_c(target->tgt_file.wqueue, MAX_LOG_SIZE, 
"log_file_msg");
if (!msg)
return;

/* we simply enqueue the log message to a write queue here, to avoid 
any blocking
 * writes on the output file.  The write queue will tell us once the 
file is writable
 * and call _file_w

Change in libosmocore[master]: logging: Change stderr + file target to use non-blocking write

2021-10-27 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/20296 )

Change subject: logging: Change stderr + file target to use non-blocking write
..

logging: Change stderr + file target to use non-blocking write

So far, we used blocking, buffered fwrite() to write to stderr
and file targets.  This causes problems if there are [slow] consumers
causing delays, such as gnome-terminal (when the program is started
interactively) or systemd/journald (where we observe 64..128ms blocks on
stderr).

This patch introduces stderr/file based logging via write_queue
and osmo_select_main(), i.e. switch from glibc-buffered, blocking
to internally buffered, non-blocking writes.

* when osmo_stderr_target is created via application.c, we create it
  in blocking stream mode for backwards compatibility, particularly
  for [smaller] programs that don't use osmo_select_main()

* when the VTY code encounters 'log stderr' or 'log file FILENAME',
  we switch that respective target to non-blocking write-queue mode,
  as this means the application is in fact using osmo_select_main()

* The config file can now state 'log stderr blocking-io' or
  'log file FILENAME blocking-io' to explicitly enforce using blocking
  stream based I/O

* The application can at any time use API functions to switch either way

Closes: OS#4311
Change-Id: Ia58fd78535c41b3da3aeb7733aadc785ace610da
---
M include/osmocom/core/logging.h
M src/logging.c
M src/vty/logging_vty.c
M tests/logging/logging_vty_test.c
4 files changed, 313 insertions(+), 22 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h
index 343f976..a554adc 100644
--- a/include/osmocom/core/logging.h
+++ b/include/osmocom/core/logging.h
@@ -297,8 +297,11 @@

union {
struct {
+   /* direct, blocking output via stdio */
FILE *out;
const char *fname;
+   /* indirect output via write_queue and 
osmo_select_main() */
+   struct osmo_wqueue *wqueue;
} tgt_file;

struct {
@@ -408,6 +411,8 @@
 struct log_target *log_target_create_systemd(bool raw);
 void log_target_systemd_set_raw(struct log_target *target, bool raw);
 int log_target_file_reopen(struct log_target *tgt);
+int log_target_file_switch_to_stream(struct log_target *tgt);
+int log_target_file_switch_to_wqueue(struct log_target *tgt);
 int log_targets_reopen(void);

 void log_add_target(struct log_target *target);
diff --git a/src/logging.c b/src/logging.c
index 1d139d5..5c6b993 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 

 #ifdef HAVE_STRINGS_H
 #include 
@@ -57,6 +58,9 @@

 #include 
 #include 
+#include 
+#include 
+#include 
 #include 
 #include 

@@ -65,12 +69,17 @@
 #include 
 #include 
 #include 
+#include 
+#include 

 #include/* for LOGGING_STR. */

 /* maximum length of the log string of a single log event (typically  line) */
 #define MAX_LOG_SIZE   4096

+/* maximum number of log statements we queue in file/stderr target write queue 
*/
+#define LOG_WQUEUE_LEN 1024
+
 osmo_static_assert(_LOG_CTX_COUNT <= ARRAY_SIZE(((struct 
log_context*)NULL)->ctx),
   enum_logging_ctx_items_fit_in_struct_log_context);
 osmo_static_assert(_LOG_FLT_COUNT <= ARRAY_SIZE(((struct 
log_target*)NULL)->filter_data),
@@ -904,11 +913,32 @@
 }

 #if (!EMBEDDED)
+static void _file_output_stream(struct log_target *target, unsigned int level,
+const char *log)
+{
+   OSMO_ASSERT(target->tgt_file.out);
+   fputs(log, target->tgt_file.out);
+   fflush(target->tgt_file.out);
+}
+
+/* output via non-blocking write_queue, doing internal buffering */
 static void _file_output(struct log_target *target, unsigned int level,
 const char *log)
 {
-   fprintf(target->tgt_file.out, "%s", log);
-   fflush(target->tgt_file.out);
+   int len = strlen(log);
+   struct msgb *msg;
+
+   OSMO_ASSERT(target->tgt_file.wqueue);
+   msg = msgb_alloc_c(target->tgt_file.wqueue, len, "log_file_msg");
+   if (!msg)
+   return;
+
+   /* we simply enqueue the log message to a write queue here, to avoid 
any blocking
+* writes on the output file.  The write queue will tell us once the 
file is writable
+* and call _file_wq_write_cb() */
+   memcpy(msg->data, log, len);
+   msgb_put(msg, len);
+   osmo_wqueue_enqueue_quiet(target->tgt_file.wqueue, msg);
 }
 #endif

@@ -972,7 +1002,7 @@

target->type = LOG_TGT_TYPE_STDERR;
target->tgt_file.out = stderr;
-   target->output =

Change in libosmocore[master]: logging: Attempt a synchronous, non-blocking write first (file, stderr)

2021-10-27 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/20317 )

Change subject: logging: Attempt a synchronous, non-blocking write first (file, 
stderr)
..


Patch Set 11: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/20317
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I08469a7e4be9bc5bbd39140457bb582f4a0b1703
Gerrit-Change-Number: 20317
Gerrit-PatchSet: 11
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:02:48 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: logging: Avoid memcpy from stack to msgb in _file_output()

2021-10-27 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/20305 )

Change subject: logging: Avoid memcpy from stack to msgb in _file_output()
..


Patch Set 13: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/20305
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0d10b0199576d2e7ff6421a6dba19ae5ffafd946
Gerrit-Change-Number: 20305
Gerrit-PatchSet: 13
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:02:44 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: logging: Change stderr + file target to use non-blocking write

2021-10-27 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/20296 )

Change subject: logging: Change stderr + file target to use non-blocking write
..


Patch Set 16: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/20296
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia58fd78535c41b3da3aeb7733aadc785ace610da
Gerrit-Change-Number: 20296
Gerrit-PatchSet: 16
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 27 Oct 2021 12:02:37 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmo-sccp[master]: sccp: Add minimalistic support for XUDT / XUDTS

2021-10-27 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/25962 )

Change subject: sccp: Add minimalistic support for XUDT / XUDTS
..

sccp: Add minimalistic support for XUDT / XUDTS

XUDT and XUDTS can be used in two situations:

a) because the sender wants to use segmentation
b) because the sender wants to include a hop counter

In this patch, we implement support for case "b" only.

Change-Id: Ic5b9486f1aeb4bb90cfe702a7ce996f5d82ded2c
Related: OS#5281, SYS#5674
---
M include/osmocom/sccp/sccp_types.h
M src/sccp2sua.c
2 files changed, 110 insertions(+), 2 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/sccp/sccp_types.h 
b/include/osmocom/sccp/sccp_types.h
index 616a7ee..4ad7edf 100644
--- a/include/osmocom/sccp/sccp_types.h
+++ b/include/osmocom/sccp/sccp_types.h
@@ -446,6 +446,9 @@
data
 #endif

+   /* optional */
+   uint8_t optional_start;
+
 #if OPTIONAL
segmentation
importance
@@ -475,6 +478,9 @@
data
 #endif

+   /* optional */
+   uint8_t optional_start;
+
 #if OPTIONAL
segmentation
importancd
diff --git a/src/sccp2sua.c b/src/sccp2sua.c
index c937231..51fe00b 100644
--- a/src/sccp2sua.c
+++ b/src/sccp2sua.c
@@ -1200,9 +1200,16 @@

 }

+static int sua_to_sccp_xudt(struct msgb *msg, struct xua_msg *xua);
+
 static int sua_to_sccp_udt(struct msgb *msg, struct xua_msg *xua)
 {
struct sccp_data_unitdata *udt;
+
+   /* Use XUDT if we have a hop counter on the SUA side */
+   if (xua_msg_find_tag(xua, SUA_IEI_S7_HOP_CTR))
+   return sua_to_sccp_xudt(msg, xua);
+
udt = (struct sccp_data_unitdata *) msgb_put(msg, sizeof(*udt));

/* Fixed Part */
@@ -1216,6 +1223,46 @@
 }

 /*! \returns \ref xua in case of success, NULL on error (xua not freed!) */
+static struct xua_msg *sccp_to_xua_xudt(struct msgb *msg, struct xua_msg *xua)
+{
+   struct sccp_data_ext_unitdata *xudt = (struct sccp_data_ext_unitdata 
*)msg->l2h;
+
+   /* Fixed Part */
+   xua_msg_add_u32(xua, SUA_IEI_PROTO_CLASS, xudt->proto_class);
+   xua_msg_add_u32(xua, SUA_IEI_S7_HOP_CTR, xudt->hop_counter);
+   /* Variable Part */
+   if (!sccp_ptr_part_consistent(msg, &xudt->variable_called))
+   return NULL;
+   sccp_addr_to_sua_ptr(xua, SUA_IEI_DEST_ADDR, msg, 
&xudt->variable_called);
+   if (!sccp_ptr_part_consistent(msg, &xudt->variable_calling))
+   return NULL;
+   sccp_addr_to_sua_ptr(xua, SUA_IEI_SRC_ADDR, msg, 
&xudt->variable_calling);
+   if (!sccp_ptr_part_consistent(msg, &xudt->variable_data))
+   return NULL;
+   sccp_data_to_sua_ptr(xua, SUA_IEI_DATA, msg, &xudt->variable_data);
+   /* Optional Part */
+   return sccp_to_xua_opt(msg, &xudt->optional_start, xua);
+
+}
+
+static int sua_to_sccp_xudt(struct msgb *msg, struct xua_msg *xua)
+{
+   struct sccp_data_ext_unitdata *xudt;
+   xudt = (struct sccp_data_ext_unitdata *) msgb_put(msg, sizeof(*xudt));
+
+   /* Fixed Part */
+   xudt->type = SCCP_MSG_TYPE_XUDT;
+   xudt->proto_class = xua_msg_get_u32(xua, SUA_IEI_PROTO_CLASS);
+   xudt->hop_counter = xua_msg_get_u32(xua, SUA_IEI_S7_HOP_CTR);
+   /* Variable Part */
+   sccp_add_var_addr(msg, &xudt->variable_called, xua, SUA_IEI_DEST_ADDR);
+   sccp_add_var_addr(msg, &xudt->variable_calling, xua, SUA_IEI_SRC_ADDR);
+   sccp_add_variable_part(msg, &xudt->variable_data, xua, SUA_IEI_DATA);
+   /* Optional Part */
+   return xua_ies_to_sccp_opts(msg, &xudt->optional_start, xudt->type, 
xua);
+}
+
+/*! \returns \ref xua in case of success, NULL on error (xua not freed!) */
 static struct xua_msg *sccp_to_xua_udts(struct msgb *msg, struct xua_msg *xua)
 {
struct sccp_data_unitdata_service *udts;
@@ -1237,9 +1284,16 @@

 }

+static int sua_to_sccp_xudts(struct msgb *msg, struct xua_msg *xua);
+
 static int sua_to_sccp_udts(struct msgb *msg, struct xua_msg *xua)
 {
struct sccp_data_unitdata_service *udts;
+
+   /* Use XUDTS if we have a hop counter */
+   if (xua_msg_find_tag(xua, SUA_IEI_S7_HOP_CTR))
+   return sua_to_sccp_xudts(msg, xua);
+
udts = (struct sccp_data_unitdata_service *) msgb_put(msg, 
sizeof(*udts));

/* Fixed Part */
@@ -1253,6 +1307,46 @@
 }

 /*! \returns \ref xua in case of success, NULL on error (xua not freed!) */
+static struct xua_msg *sccp_to_xua_xudts(struct msgb *msg, struct xua_msg *xua)
+{
+   struct sccp_data_ext_unitdata_service *xudts;
+   xudts = (struct sccp_data_ext_unitdata_service *)msg->l2h;
+
+   /* Fixed Part */
+   xua_msg_add_u32(xua, SUA_IEI_CAUSE, SUA_CAUSE_T_RETURN | 
xudts->return_cause);
+   xua_msg_add_u32(xua, SUA_IEI_S7_HOP_CT

Change in osmo-bsc[master]: bsc_ctrl_commands: add ctrl command to resend system information

2021-10-27 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25829 )

Change subject: bsc_ctrl_commands: add ctrl command to resend system information
..


Patch Set 3:

Ok, I hope now everything is resolved now. Please have another look.


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25829
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id628fc6f0771de67f60cbc96b631000b04c765f4
Gerrit-Change-Number: 25829
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-Comment-Date: Wed, 27 Oct 2021 10:03:49 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bsc_ctrl_commands: add ctrl command to resend system information

2021-10-27 Thread dexter
Hello Jenkins Builder, fixeria, keith,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-bsc/+/25829

to look at the new patch set (#3).

Change subject: bsc_ctrl_commands: add ctrl command to resend system information
..

bsc_ctrl_commands: add ctrl command to resend system information

The system information can be modified via the ctrl interface, but there
is no way to resend it to the BTS afterwards. At the moment it is only
possible to resend the system information via VTY. Lets add a control
command that does the same via the control interface.

Change-Id: Id628fc6f0771de67f60cbc96b631000b04c765f4
Related: SYS#5641
---
M doc/manuals/chapters/control.adoc
M src/osmo-bsc/bsc_ctrl_commands.c
2 files changed, 17 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/29/25829/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25829
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id628fc6f0771de67f60cbc96b631000b04c765f4
Gerrit-Change-Number: 25829
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: bsc_ctrl_commands: add ctrl command to resend system information

2021-10-27 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25829 )

Change subject: bsc_ctrl_commands: add ctrl command to resend system information
..


Patch Set 2:

> Patch Set 2:
>
> > Patch Set 1:
> >
> > NOTE: It's implemented as a set command, This patch wants to implement it 
> > as a get command.
>
> This is an interesting question. I find this also irritating. The control 
> interface API seems to lack an appropriate abstraction of commands that 
> execute an action. This command here is neither a get or a set command.
>
> In any case, I think my implementation is correct, the user manual already 
> mentions some commands that take no parameters. They are WO commands and the 
> value column simply says "Ignored", so I think that this is the right way to 
> use the control interface in this situation.
>
> See https://ftp.osmocom.org/docs/latest/osmobsc-usermanual.pdf 
> "bts.N.apply-configuration" for example.
>
> I also think that using a get command here would be even more confusing since 
> there is nothing to get...
>
> (also I forgot to update the manual with this command...)

Its actually the other way around - how confusing ;-)


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25829
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id628fc6f0771de67f60cbc96b631000b04c765f4
Gerrit-Change-Number: 25829
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-Comment-Date: Wed, 27 Oct 2021 09:29:05 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: bsc_ctrl_commands: add ctrl command to resend system information

2021-10-27 Thread dexter
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25829 )

Change subject: bsc_ctrl_commands: add ctrl command to resend system information
..


Patch Set 2:

> Patch Set 1:
>
> NOTE: It's implemented as a set command, This patch wants to implement it as 
> a get command.

This is an interesting question. I find this also irritating. The control 
interface API seems to lack an appropriate abstraction of commands that execute 
an action. This command here is neither a get or a set command.

In any case, I think my implementation is correct, the user manual already 
mentions some commands that take no parameters. They are WO commands and the 
value column simply says "Ignored", so I think that this is the right way to 
use the control interface in this situation.

See https://ftp.osmocom.org/docs/latest/osmobsc-usermanual.pdf 
"bts.N.apply-configuration" for example.

I also think that using a get command here would be even more confusing since 
there is nothing to get...

(also I forgot to update the manual with this command...)


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25829
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Id628fc6f0771de67f60cbc96b631000b04c765f4
Gerrit-Change-Number: 25829
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: keith 
Gerrit-Comment-Date: Wed, 27 Oct 2021 09:21:07 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: neighbor_ident: add comment about Neighbor Address Resolution Service

2021-10-27 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25977 )


Change subject: neighbor_ident: add comment about Neighbor Address Resolution 
Service
..

neighbor_ident: add comment about Neighbor Address Resolution Service

The Neighbor Address Resolution Service is using the control interface
API as well. Lets add a comment to indicate that this service is not
related to the normal control interface.

Change-Id: Iec86f72548bfc54a2c86dadec69dd1c64813d852
---
M src/osmo-bsc/neighbor_ident.c
1 file changed, 1 insertion(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/77/25977/1

diff --git a/src/osmo-bsc/neighbor_ident.c b/src/osmo-bsc/neighbor_ident.c
index c66d3ac..44b0b43 100644
--- a/src/osmo-bsc/neighbor_ident.c
+++ b/src/osmo-bsc/neighbor_ident.c
@@ -489,6 +489,7 @@

 struct ctrl_handle *neighbor_controlif_setup(struct gsm_network *net)
 {
+   /* See also osmobsc-usermanual.pdf, section 14.1 Neighbor Address 
Resolution Service */
return ctrl_interface_setup_dynip2(net, net->neigh_ctrl.addr, 
net->neigh_ctrl.port,
   NULL, _LAST_CTRL_NODE_NEIGHBOR);
 }

--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/25977
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Iec86f72548bfc54a2c86dadec69dd1c64813d852
Gerrit-Change-Number: 25977
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange


Change in osmo-bsc[master]: heighbor_ident: add/del neighbor cells via ctrl interface

2021-10-27 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/25976 )


Change subject: heighbor_ident: add/del neighbor cells via ctrl interface
..

heighbor_ident: add/del neighbor cells via ctrl interface

The VTY allows flexible control over the neighbor cell information via
the neighbor command, which can be found in the configure terminal under
the bts node. Lets add pendant of this command on the control interface
as well.

Change-Id: I343a40e18fa9b91e6c381912c0426a002841e079
Related: SYS#5641
---
M doc/manuals/chapters/control.adoc
M include/osmocom/bsc/neighbor_ident.h
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/bsc_ctrl_commands.c
A src/osmo-bsc/neighbor_ident_ctrl.c
M src/osmo-bsc/neighbor_ident_vty.c
6 files changed, 729 insertions(+), 29 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/76/25976/1

diff --git a/doc/manuals/chapters/control.adoc 
b/doc/manuals/chapters/control.adoc
index 2585126..40a5cb9 100644
--- a/doc/manuals/chapters/control.adoc
+++ b/doc/manuals/chapters/control.adoc
@@ -121,3 +121,28 @@
 accepted.

 FIXME: add variables defined in src/ctrl/control_if.c?
+
+=== add/del neighbor cell
+
+The control interface allows for editing the neighbor cell configuration. 
Neighbor
+cells can be added or removed during runtime. It is also possible to clear the
+entire neighbor list if necessary.
+
+.Variables available over control interface
+[options="header",width="100%",cols="20%,5%,5%,50%,20%"]
+|===
+|Name|Access|Trap|Value|Comment
+|bts.N.neighbor-bts.add|WO|No|""|Add neighbor cell by local BTS number.
+|bts.N.neighbor-bts.del|WO|No|""|Delete neighbor cell by local BTS number.
+|bts.N.neighbor-lac.add|WO|No|"[--]"|Add neighbor cell by 
LAC.
+|bts.N.neighbor-lac.del|WO|No|"[--]"|Delete neighbor cell by 
LAC.
+|bts.N.neighbor-lac-ci.add|WO|No|"-[--]"|Add neighbor 
cell by LAC and CI.
+|bts.N.neighbor-lac-ci.del|WO|No|"-[--]"|Delete neighbor 
cell by LAC and CI.
+|bts.N.neighbor-cgi.add|WO|No|"---[--]"|Add 
neighbor cell by cgi.
+|bts.N.neighbor-cgi.del|WO|No|"---[--]"|Delete 
neighbor cell by cgi.
+|bts.N.neighbor-cgi-ps.add|WO|No|"[--]"|Add
 neighbor cell by cgi (Packet Switched, with RAC)
+|bts.N.neighbor-cgi-ps.del|WO|No|"[--]"|Delete
 neighbor cell by cgi (Packet Switched, with RAC).
+|bts.N.neighbor-clear|WO|No|Ignored|Delete all neighbor cells.
+|===
+
+NOTE: The bsic-number () can also be set to "any" if no explcit bsic 
shall be given
diff --git a/include/osmocom/bsc/neighbor_ident.h 
b/include/osmocom/bsc/neighbor_ident.h
index 58300ba..c6a2c42 100644
--- a/include/osmocom/bsc/neighbor_ident.h
+++ b/include/osmocom/bsc/neighbor_ident.h
@@ -77,6 +77,10 @@
 void neighbor_ident_vty_write_bts(struct vty *vty, const char *indent, struct 
gsm_bts *bts);
 void neighbor_ident_vty_write_network(struct vty *vty, const char *indent);

+int neighbor_ident_add_neighbor(struct vty *vty, struct gsm_bts *bts, struct 
neighbor *n);
+int neighbor_ident_del_neighbor(struct vty *vty, struct gsm_bts *bts, struct 
neighbor *n);
+int neighbor_ident_ctrl_init(void);
+
 int neighbors_check_cfg();

 #define CELL_AB_VTY_PARAMS "arfcn <0-1023> bsic (<0-63>|any)"
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 19af569..3de 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -78,6 +78,7 @@
meas_rep.c \
neighbor_ident.c \
neighbor_ident_vty.c \
+   neighbor_ident_ctrl.c \
net_init.c \
nm_common_fsm.c \
nm_bb_transc_fsm.c \
diff --git a/src/osmo-bsc/bsc_ctrl_commands.c b/src/osmo-bsc/bsc_ctrl_commands.c
index 4c8cb99..a902eb2 100644
--- a/src/osmo-bsc/bsc_ctrl_commands.c
+++ b/src/osmo-bsc/bsc_ctrl_commands.c
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 

 static int verify_net_apply_config_file(struct ctrl_cmd *cmd, const char 
*value, void *_data)
 {
@@ -706,6 +707,8 @@
rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_c0_power_red);
rc |= ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_resend_si);

+   rc |= neighbor_ident_ctrl_init();
+
rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_max_power);
rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_arfcn);
rc |= ctrl_cmd_install(CTRL_NODE_TRX, &cmd_trx_rf_locked);
diff --git a/src/osmo-bsc/neighbor_ident_ctrl.c 
b/src/osmo-bsc/neighbor_ident_ctrl.c
new file mode 100644
index 000..d476da6
--- /dev/null
+++ b/src/osmo-bsc/neighbor_ident_ctrl.c
@@ -0,0 +1,656 @@
+/* CTRL interface implementation to manage identity of neighboring BSS cells 
for inter-BSC handover. */
+/* (C) 2021 by sysmocom - s.f.m.c. GmbH 
+ *
+ * All Rights Reserved
+ *
+ * Author: Neels Hofmeyr 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License,

  1   2   >